summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-codes/E0311.fixed
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/error-codes/E0311.fixed13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0311.fixed b/tests/ui/error-codes/E0311.fixed
new file mode 100644
index 000000000..4410a4d70
--- /dev/null
+++ b/tests/ui/error-codes/E0311.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+#![allow(warnings)]
+
+fn no_restriction<'a, T: 'a>(x: &'a ()) -> &() {
+ with_restriction::<T>(x) //~ ERROR E0311
+}
+
+fn with_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {
+ x
+}
+
+fn main() {}