diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-30255.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-30255.rs b/src/test/ui/issues/issue-30255.rs new file mode 100644 index 000000000..6970a122b --- /dev/null +++ b/src/test/ui/issues/issue-30255.rs @@ -0,0 +1,24 @@ +// +// Test that lifetime elision error messages correctly omit parameters +// with no elided lifetimes + +struct S<'a> { + field: &'a i32, +} + +fn f(a: &S, b: i32) -> &i32 { +//~^ ERROR missing lifetime specifier [E0106] + panic!(); +} + +fn g(a: &S, b: bool, c: &i32) -> &i32 { +//~^ ERROR missing lifetime specifier [E0106] + panic!(); +} + +fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 { +//~^ ERROR missing lifetime specifier [E0106] + panic!(); +} + +fn main() {} |