Add test for #34979

This commit is contained in:
Yuki Okushi 2020-05-07 02:13:51 +09:00
parent 96d4e0bab2
commit be2d5535ea
No known key found for this signature in database
GPG Key ID: B0986C85C0E2DAA1
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,9 @@
trait Foo {}
impl<'a, T> Foo for &'a T {}
struct Ctx<'a>(&'a ())
where
&'a (): Foo, //~ ERROR: type annotations needed
&'static (): Foo;
fn main() {}

View File

@ -0,0 +1,14 @@
error[E0283]: type annotations needed
--> $DIR/issue-34979.rs:6:13
|
LL | trait Foo {}
| --------- required by this bound in `Foo`
...
LL | &'a (): Foo,
| ^^^ cannot infer type for reference `&'a ()`
|
= note: cannot satisfy `&'a (): Foo`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0283`.