summaryrefslogtreecommitdiffstats
path: root/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs')
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
new file mode 100644
index 000000000..59f7e472e
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
@@ -0,0 +1,18 @@
+// edition:2018
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+#[allow(dead_code)]
+struct Foo<T> {
+ t: T
+}
+
+impl<T> Foo<T>
+where
+ T: WithType<&u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}