From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/suggestions/missing-lifetime-specifier.rs | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/ui/suggestions/missing-lifetime-specifier.rs (limited to 'tests/ui/suggestions/missing-lifetime-specifier.rs') diff --git a/tests/ui/suggestions/missing-lifetime-specifier.rs b/tests/ui/suggestions/missing-lifetime-specifier.rs new file mode 100644 index 000000000..24f5f782f --- /dev/null +++ b/tests/ui/suggestions/missing-lifetime-specifier.rs @@ -0,0 +1,57 @@ +#![allow(bare_trait_objects)] +use std::collections::HashMap; +use std::cell::RefCell; + +pub union Foo<'t, 'k> { + i: &'t i64, + f: &'k f64, +} +trait Bar<'t, 'k> {} + +pub union Qux<'t, 'k, I> { + i: &'t I, + f: &'k I, +} +trait Tar<'t, 'k, I> {} + +thread_local! { + static a: RefCell>>> = RefCell::new(HashMap::new()); + //~^ ERROR missing lifetime specifiers + //~| ERROR missing lifetime specifiers +} +thread_local! { + static b: RefCell>>> = RefCell::new(HashMap::new()); + //~^ ERROR missing lifetime specifiers + //~| ERROR missing lifetime specifiers +} +thread_local! { + static c: RefCell>>>> = RefCell::new(HashMap::new()); + //~^ ERROR missing lifetime specifiers + //~| ERROR missing lifetime specifiers +} +thread_local! { + static d: RefCell>>>> = RefCell::new(HashMap::new()); + //~^ ERROR missing lifetime specifiers + //~| ERROR missing lifetime specifiers +} + +thread_local! { + static e: RefCell>>>> = RefCell::new(HashMap::new()); + //~^ ERROR this union takes 2 lifetime arguments but 1 lifetime argument + //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied +} +thread_local! { + static f: RefCell>>>> = RefCell::new(HashMap::new()); + //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR missing lifetime + //~| ERROR missing lifetime +} + +fn main() {} -- cgit v1.2.3