about summary refs log tree commit diff
path: root/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs')
-rw-r--r--src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs
index c60e321219b..a85776a938b 100644
--- a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs
+++ b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs
@@ -10,7 +10,9 @@
 
 // ignore-tidy-linelength
 
-struct Foo<'x> { bar: isize }
+use std::marker::PhantomData;
+
+struct Foo<'x> { bar: isize, marker: PhantomData<&'x ()> }
 fn foo1<'a>(x: &Foo) -> &'a isize {
 //~^ HELP: consider using an explicit lifetime parameter as shown: fn foo1<'a>(x: &'a Foo) -> &'a isize
     &x.bar //~ ERROR: cannot infer