Skip to content

Commit 4ef3d8b

Browse files
Bless and add ICE regression test
1 parent 384d387 commit 4ef3d8b

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
trait Foo<'s> {}
2+
3+
impl<'s> Foo<'s> for () {}
4+
5+
struct Bar;
6+
7+
impl<'s, T: Foo<'s>> From<T> for Bar {
8+
fn from(_: T) -> Self {
9+
Bar
10+
}
11+
}
12+
13+
fn main() {
14+
let _: Bar = ((),).into();
15+
//~^ ERROR he trait bound `((),): Into<Bar>` is not satisfied
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0277]: the trait bound `((),): Into<Bar>` is not satisfied
2+
--> $DIR/suggest-similar-impls-for-root-obligation.rs:14:24
3+
|
4+
LL | let _: Bar = ((),).into();
5+
| ^^^^ the trait `Foo<'_>` is not implemented for `((),)`, which is required by `((),): Into<_>`
6+
|
7+
= help: the trait `Foo<'_>` is implemented for `()`
8+
= help: for that trait implementation, expected `()`, found `((),)`
9+
note: required for `Bar` to implement `From<((),)>`
10+
--> $DIR/suggest-similar-impls-for-root-obligation.rs:7:22
11+
|
12+
LL | impl<'s, T: Foo<'s>> From<T> for Bar {
13+
| ------- ^^^^^^^ ^^^
14+
| |
15+
| unsatisfied trait bound introduced here
16+
= note: required for `((),)` to implement `Into<Bar>`
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)