Skip to content

Commit

Permalink
Add test for rust-lang#34979
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 6, 2020
1 parent 96d4e0b commit be2d553
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/lifetimes/issue-34979.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions src/test/ui/lifetimes/issue-34979.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit be2d553

Please sign in to comment.