diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/nll/ty-outlives/wf-unreachable.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/nll/ty-outlives/wf-unreachable.rs')
-rw-r--r-- | src/test/ui/nll/ty-outlives/wf-unreachable.rs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/test/ui/nll/ty-outlives/wf-unreachable.rs b/src/test/ui/nll/ty-outlives/wf-unreachable.rs deleted file mode 100644 index c6f4c4afa..000000000 --- a/src/test/ui/nll/ty-outlives/wf-unreachable.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Test that we check that user type annotations are well-formed, even in dead -// code. - -fn uninit<'a>() { - return; - let x: &'static &'a (); //~ ERROR lifetime may not live long enough -} - -fn var_type<'a>() { - return; - let x: &'static &'a () = &&(); //~ ERROR lifetime may not live long enough -} - -fn uninit_infer<'a>() { - let x: &'static &'a _; //~ ERROR lifetime may not live long enough - x = && (); -} - -fn infer<'a>() { - return; - let x: &'static &'a _ = &&(); //~ ERROR lifetime may not live long enough -} - -fn uninit_no_var<'a>() { - return; - let _: &'static &'a (); //~ ERROR lifetime may not live long enough -} - -fn no_var<'a>() { - return; - let _: &'static &'a () = &&(); //~ ERROR lifetime may not live long enough -} - -fn infer_no_var<'a>() { - return; - let _: &'static &'a _ = &&(); //~ ERROR lifetime may not live long enough -} - -trait X<'a, 'b> {} - -struct C<'a, 'b, T: X<'a, 'b>>(T, &'a (), &'b ()); - -impl X<'_, '_> for i32 {} -impl<'a> X<'a, 'a> for () {} - -// This type annotation is not well-formed because we substitute `()` for `_`. -fn required_substs<'a>() { - return; - let _: C<'static, 'a, _> = C((), &(), &()); //~ ERROR lifetime may not live long enough -} - -fn main() {} |