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