Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upConfusing error message with Fn(&T) and unsatisfied trait bounds. #18794
Comments
huonw
added
the
I-ICE
label
Nov 12, 2014
This comment has been minimized.
This comment has been minimized.
|
This syntax is now gone, so I'm not sure this issue is relevant. Does an updated version still ICE for you? |
This comment has been minimized.
This comment has been minimized.
|
An updated version on Compiling: trait Foo { }
fn foo<T: Foo>(x: T) { }
fn main() {
let x: &Fn(i32) = &foo;
}Produces:
Which is exactly what I would expect. Compiling: trait Foo { }
fn foo<T: Foo>(x: T) { }
fn main() {
let x: &Fn(&i32) = &foo;
}Produces:
Which is basically incomprehensible to me. I feel like these two cases should probably be producing the same error message, as the problem in both cases is the same - the trait isn't implemented for the specified type. |
This comment has been minimized.
This comment has been minimized.
|
An update on this: I tested it again under the latest nightly ( Compiling: trait Foo {
fn foo(s: Self);
}
fn foo<T: Foo>(x: T) { }
fn main() {
let x: &Fn(&i32) = &foo;
}produces:
|
orodley
changed the title
ICE: Trait not implemented for &int
Confusing error message with Fn(&T) and unsatisfied trait bounds.
Apr 10, 2015
arielb1
added
A-diagnostics
P-low
and removed
I-ICE
labels
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
|
Triage: no change |
steveklabnik
added
the
T-compiler
label
Mar 9, 2017
Mark-Simulacrum
added
the
A-closures
label
May 30, 2017
Mark-Simulacrum
added
the
C-enhancement
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
Current output, no change:
|
This comment has been minimized.
This comment has been minimized.
Updated output:
|
orodley commentedNov 9, 2014
The following (invalid) code triggers an ICE:
Compiler output:
This occurs under: