Skip to content

Commit be2d553

Browse files
committed
Add test for #34979
1 parent 96d4e0b commit be2d553

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/test/ui/lifetimes/issue-34979.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
trait Foo {}
2+
impl<'a, T> Foo for &'a T {}
3+
4+
struct Ctx<'a>(&'a ())
5+
where
6+
&'a (): Foo, //~ ERROR: type annotations needed
7+
&'static (): Foo;
8+
9+
fn main() {}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0283]: type annotations needed
2+
--> $DIR/issue-34979.rs:6:13
3+
|
4+
LL | trait Foo {}
5+
| --------- required by this bound in `Foo`
6+
...
7+
LL | &'a (): Foo,
8+
| ^^^ cannot infer type for reference `&'a ()`
9+
|
10+
= note: cannot satisfy `&'a (): Foo`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0283`.

0 commit comments

Comments
 (0)