about summary refs log tree commit diff
path: root/tests/ui/error-codes/E0311.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/error-codes/E0311.rs')
-rw-r--r--tests/ui/error-codes/E0311.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0311.rs b/tests/ui/error-codes/E0311.rs
new file mode 100644
index 00000000000..566b518b433
--- /dev/null
+++ b/tests/ui/error-codes/E0311.rs
@@ -0,0 +1,9 @@
+fn no_restriction<T>(x: &()) -> &() {
+    with_restriction::<T>(x) //~ ERROR E0311
+}
+
+fn with_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {
+    x
+}
+
+fn main() {}