From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- .../placeholders-dont-outlive-static.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs (limited to 'tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs') diff --git a/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs new file mode 100644 index 000000000..ae6866511 --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs @@ -0,0 +1,22 @@ +// revisions: good bad + +//[good] known-bug: unknown +// `for T: 'static` doesn't imply itself when processing outlives obligations + +#![feature(non_lifetime_binders)] +//[bad]~^ WARN the feature `non_lifetime_binders` is incomplete + +fn foo() where for T: 'static {} + +#[cfg(bad)] +fn bad() { + foo(); + //[bad]~^ ERROR the placeholder type `!1_"T"` may not live long enough +} + +#[cfg(good)] +fn good() where for T: 'static { + foo(); +} + +fn main() {} -- cgit v1.2.3