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 --- .../non_lifetime_binders/bad-copy-cond.stderr | 2 +- .../capture-late-ct-in-anon.stderr | 2 +- .../non_lifetime_binders/drop-impl-pred.no.stderr | 2 +- .../non_lifetime_binders/foreach-partial-eq.stderr | 2 +- .../late-bound-in-anon-ct.stderr | 2 +- .../non_lifetime_binders/missing-assoc-item.stderr | 2 +- .../nested-apit-mentioning-outer-bound-var.stderr | 2 +- tests/ui/traits/non_lifetime_binders/on-dyn.stderr | 2 +- tests/ui/traits/non_lifetime_binders/on-ptr.stderr | 2 +- .../placeholders-dont-outlive-static.bad.stderr | 26 ++++++++++++++++++++++ .../placeholders-dont-outlive-static.good.stderr | 26 ++++++++++++++++++++++ .../placeholders-dont-outlive-static.rs | 22 ++++++++++++++++++ .../type-match-with-late-bound.rs | 3 +-- .../type-match-with-late-bound.stderr | 17 +++++++++++++- .../non_lifetime_binders/universe-error1.stderr | 2 +- 15 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.bad.stderr create mode 100644 tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.good.stderr create mode 100644 tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.rs (limited to 'tests/ui/traits/non_lifetime_binders') diff --git a/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr index 07e02d47f..d5f2bfef1 100644 --- a/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr +++ b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr @@ -19,6 +19,6 @@ note: required by a bound in `foo` LL | fn foo() where for T: Copy {} | ^^^^ required by this bound in `foo` -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr index d65892ec6..4e0441c1c 100644 --- a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr +++ b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr @@ -15,5 +15,5 @@ LL | for [(); C]: Copy, | | | parameter defined here -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/non_lifetime_binders/drop-impl-pred.no.stderr b/tests/ui/traits/non_lifetime_binders/drop-impl-pred.no.stderr index a985b1a6e..1f13207e3 100644 --- a/tests/ui/traits/non_lifetime_binders/drop-impl-pred.no.stderr +++ b/tests/ui/traits/non_lifetime_binders/drop-impl-pred.no.stderr @@ -19,6 +19,6 @@ note: the implementor must specify the same requirement LL | struct Bar(T) where T: Foo; | ^^^^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0367`. diff --git a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr index da09343fb..8cf32c894 100644 --- a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr +++ b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr @@ -23,6 +23,6 @@ LL | where LL | for T: PartialEq + PartialOrd, | ^^^^^^^^^^ required by this bound in `auto_trait` -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/non_lifetime_binders/late-bound-in-anon-ct.stderr b/tests/ui/traits/non_lifetime_binders/late-bound-in-anon-ct.stderr index dc54e1acc..cc482887c 100644 --- a/tests/ui/traits/non_lifetime_binders/late-bound-in-anon-ct.stderr +++ b/tests/ui/traits/non_lifetime_binders/late-bound-in-anon-ct.stderr @@ -23,5 +23,5 @@ LL | for [i32; { let _: T = todo!(); 0 }]:, | | | parameter defined here -error: aborting due to previous error; 2 warnings emitted +error: aborting due to 1 previous error; 2 warnings emitted diff --git a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr index d98538642..eecf8e88f 100644 --- a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr +++ b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr @@ -18,6 +18,6 @@ help: if there were a trait named `Example` with associated type `Item` implemen LL | for ::Item: Send, | ~~~~~~~~~~~~~~~~~~~~ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0223`. diff --git a/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr index 1124076c2..830446915 100644 --- a/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr +++ b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr @@ -13,5 +13,5 @@ error: `impl Trait` can only mention type parameters from an fn or impl LL | fn uwu(_: impl for Trait<(), Assoc = impl Trait>) {} | - type parameter declared here ^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/non_lifetime_binders/on-dyn.stderr b/tests/ui/traits/non_lifetime_binders/on-dyn.stderr index 95656f999..2d330f6b1 100644 --- a/tests/ui/traits/non_lifetime_binders/on-dyn.stderr +++ b/tests/ui/traits/non_lifetime_binders/on-dyn.stderr @@ -13,5 +13,5 @@ error: late-bound type parameter not allowed on trait object types LL | fn foo() -> &'static dyn for Test { | ^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/non_lifetime_binders/on-ptr.stderr b/tests/ui/traits/non_lifetime_binders/on-ptr.stderr index 3b17f7697..fbd723a1b 100644 --- a/tests/ui/traits/non_lifetime_binders/on-ptr.stderr +++ b/tests/ui/traits/non_lifetime_binders/on-ptr.stderr @@ -13,5 +13,5 @@ error: late-bound type parameter not allowed on function pointer types LL | fn foo() -> for fn(T) { | ^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.bad.stderr b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.bad.stderr new file mode 100644 index 000000000..7dd383b1e --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.bad.stderr @@ -0,0 +1,26 @@ +warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/placeholders-dont-outlive-static.rs:6:12 + | +LL | #![feature(non_lifetime_binders)] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #108185 for more information + = note: `#[warn(incomplete_features)]` on by default + +error[E0310]: the placeholder type `!1_"T"` may not live long enough + --> $DIR/placeholders-dont-outlive-static.rs:13:5 + | +LL | foo(); + | ^^^^^ + | | + | the placeholder type `!1_"T"` must be valid for the static lifetime... + | ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | fn bad() where !1_"T": 'static { + | +++++++++++++++++++++ + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0310`. diff --git a/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.good.stderr b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.good.stderr new file mode 100644 index 000000000..b4f00978a --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/placeholders-dont-outlive-static.good.stderr @@ -0,0 +1,26 @@ +warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/placeholders-dont-outlive-static.rs:6:12 + | +LL | #![feature(non_lifetime_binders)] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #108185 for more information + = note: `#[warn(incomplete_features)]` on by default + +error[E0310]: the placeholder type `!1_"T"` may not live long enough + --> $DIR/placeholders-dont-outlive-static.rs:19:5 + | +LL | foo(); + | ^^^^^ + | | + | the placeholder type `!1_"T"` must be valid for the static lifetime... + | ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | fn good() where for T: 'static, !1_"T": 'static { + | +++++++++++++++++ + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0310`. 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() {} diff --git a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.rs b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.rs index 5ff7089b9..53957914e 100644 --- a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.rs +++ b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.rs @@ -1,10 +1,9 @@ // edition:2021 -// check-pass +// known-bug: unknown // Checks that test_type_match code doesn't ICE when predicates have late-bound types #![feature(non_lifetime_binders)] -//~^ WARN is incomplete and may not be safe to use async fn walk2<'a, T: 'a>(_: T) where diff --git a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr index 3609bed28..3a4415ed2 100644 --- a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr +++ b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr @@ -7,5 +7,20 @@ LL | #![feature(non_lifetime_binders)] = note: see issue #108185 for more information = note: `#[warn(incomplete_features)]` on by default -warning: 1 warning emitted +error[E0309]: the placeholder type `!1_"F"` may not live long enough + --> $DIR/type-match-with-late-bound.rs:11:1 + | +LL | async fn walk2<'a, T: 'a>(_: T) + | -- the placeholder type `!1_"F"` must be valid for the lifetime `'a` as defined here... +... +LL | {} + | ^^ ...so that the type `F` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | for F: 'a, !1_"F": 'a + | ~~~~~~~~~~~~ + +error: aborting due to 1 previous error; 1 warning emitted +For more information about this error, try `rustc --explain E0309`. diff --git a/tests/ui/traits/non_lifetime_binders/universe-error1.stderr b/tests/ui/traits/non_lifetime_binders/universe-error1.stderr index bfcad72e3..ecc97e283 100644 --- a/tests/ui/traits/non_lifetime_binders/universe-error1.stderr +++ b/tests/ui/traits/non_lifetime_binders/universe-error1.stderr @@ -22,6 +22,6 @@ LL | where LL | for T: Other {} | ^^^^^^^^ required by this bound in `foo` -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3