mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Bless and add ICE regression test
This commit is contained in:
parent
c453c82de4
commit
93d83c8f69
16
tests/ui/typeck/suggest-similar-impls-for-root-obligation.rs
Normal file
16
tests/ui/typeck/suggest-similar-impls-for-root-obligation.rs
Normal file
@ -0,0 +1,16 @@
|
||||
trait Foo<'s> {}
|
||||
|
||||
impl<'s> Foo<'s> for () {}
|
||||
|
||||
struct Bar;
|
||||
|
||||
impl<'s, T: Foo<'s>> From<T> for Bar {
|
||||
fn from(_: T) -> Self {
|
||||
Bar
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _: Bar = ((),).into();
|
||||
//~^ ERROR he trait bound `((),): Into<Bar>` is not satisfied
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
error[E0277]: the trait bound `((),): Into<Bar>` is not satisfied
|
||||
--> $DIR/suggest-similar-impls-for-root-obligation.rs:14:24
|
||||
|
|
||||
LL | let _: Bar = ((),).into();
|
||||
| ^^^^ the trait `Foo<'_>` is not implemented for `((),)`, which is required by `((),): Into<_>`
|
||||
|
|
||||
= help: the trait `Foo<'_>` is implemented for `()`
|
||||
= help: for that trait implementation, expected `()`, found `((),)`
|
||||
note: required for `Bar` to implement `From<((),)>`
|
||||
--> $DIR/suggest-similar-impls-for-root-obligation.rs:7:22
|
||||
|
|
||||
LL | impl<'s, T: Foo<'s>> From<T> for Bar {
|
||||
| ------- ^^^^^^^ ^^^
|
||||
| |
|
||||
| unsatisfied trait bound introduced here
|
||||
= note: required for `((),)` to implement `Into<Bar>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
Loading…
Reference in New Issue
Block a user