mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Add test for #34979
This commit is contained in:
parent
96d4e0bab2
commit
be2d5535ea
9
src/test/ui/lifetimes/issue-34979.rs
Normal file
9
src/test/ui/lifetimes/issue-34979.rs
Normal 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() {}
|
14
src/test/ui/lifetimes/issue-34979.stderr
Normal file
14
src/test/ui/lifetimes/issue-34979.stderr
Normal 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`.
|
Loading…
Reference in New Issue
Block a user