From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- .../check-trait-object-bounds-2.stderr | 2 +- src/test/ui/traits/bound/not-on-bare-trait.stderr | 2 +- .../ui/traits/copy-impl-cannot-normalize.stderr | 4 +- src/test/ui/traits/issue-102989.rs | 16 ++++++ src/test/ui/traits/issue-102989.stderr | 59 ++++++++++++++++++++++ .../ui/traits/issue-33140-hack-boundaries.stderr | 17 +++++++ src/test/ui/traits/issue-43784-supertrait.rs | 10 ++++ src/test/ui/traits/issue-43784-supertrait.stderr | 19 +++++++ src/test/ui/traits/issue-8153.stderr | 7 ++- .../traits/issue-91949-hangs-on-recursion.stderr | 2 +- .../negative-impls/negative-default-impls.stderr | 2 +- .../negative-specializes-negative.stderr | 2 +- .../negative-specializes-positive-item.stderr | 2 +- .../negative-specializes-positive.stderr | 2 +- .../positive-specializes-negative.stderr | 2 +- .../object/issue-33140-traitobject-crate.stderr | 57 ++++++++++++++++++++- src/test/ui/traits/safety-trait-impl-cc.stderr | 6 +++ src/test/ui/traits/safety-trait-impl.stderr | 12 +++++ .../traits/static-method-generic-inference.stderr | 4 +- .../trait-upcasting/migrate-lint-deny.stderr | 4 +- .../multiple-occurence-ambiguousity.rs | 22 -------- .../multiple-occurence-ambiguousity.stderr | 14 ----- .../multiple-occurrence-ambiguousity.rs | 22 ++++++++ .../multiple-occurrence-ambiguousity.stderr | 14 +++++ .../ui/traits/unspecified-self-in-trait-ref.stderr | 2 +- 25 files changed, 250 insertions(+), 55 deletions(-) create mode 100644 src/test/ui/traits/issue-102989.rs create mode 100644 src/test/ui/traits/issue-102989.stderr create mode 100644 src/test/ui/traits/issue-43784-supertrait.rs create mode 100644 src/test/ui/traits/issue-43784-supertrait.stderr delete mode 100644 src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs delete mode 100644 src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr create mode 100644 src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs create mode 100644 src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr (limited to 'src/test/ui/traits') diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr index 4084f69a6..10e82c54e 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr @@ -4,7 +4,7 @@ error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32` LL | f:: X<'x, F = i32>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32` | - = help: the trait `for<'r> FnOnce<(&'r i32,)>` is not implemented for `i32` + = help: the trait `for<'a> FnOnce<(&'a i32,)>` is not implemented for `i32` note: required by a bound in `f` --> $DIR/check-trait-object-bounds-2.rs:8:9 | diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr index 1c52629da..8da0b6d6b 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ | - = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see + = note: `#[warn(bare_trait_objects)]` on by default help: use `dyn` | LL | fn foo(_x: dyn Foo + Send) { diff --git a/src/test/ui/traits/copy-impl-cannot-normalize.stderr b/src/test/ui/traits/copy-impl-cannot-normalize.stderr index afdad1609..68b95b42b 100644 --- a/src/test/ui/traits/copy-impl-cannot-normalize.stderr +++ b/src/test/ui/traits/copy-impl-cannot-normalize.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `T: TraitFoo` is not satisfied - --> $DIR/copy-impl-cannot-normalize.rs:22:1 + --> $DIR/copy-impl-cannot-normalize.rs:22:18 | LL | impl Copy for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T` + | ^^^^^^ the trait `TraitFoo` is not implemented for `T` | help: consider restricting type parameter `T` | diff --git a/src/test/ui/traits/issue-102989.rs b/src/test/ui/traits/issue-102989.rs new file mode 100644 index 000000000..62f95272f --- /dev/null +++ b/src/test/ui/traits/issue-102989.rs @@ -0,0 +1,16 @@ +// normalize-stderr-test "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib" + +#![feature(lang_items)] +#[lang="sized"] +trait Sized { } //~ ERROR found duplicate lang item `sized` + +fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + //~^ ERROR `self` parameter is only allowed in associated functions + //~| ERROR cannot find type `Struct` in this scope + //~| ERROR mismatched types + let x = x << 1; + //~^ ERROR the size for values of type `{integer}` cannot be known at compilation time + //~| ERROR cannot find value `x` in this scope +} + +fn main() {} diff --git a/src/test/ui/traits/issue-102989.stderr b/src/test/ui/traits/issue-102989.stderr new file mode 100644 index 000000000..efe1a2467 --- /dev/null +++ b/src/test/ui/traits/issue-102989.stderr @@ -0,0 +1,59 @@ +error: `self` parameter is only allowed in associated functions + --> $DIR/issue-102989.rs:7:15 + | +LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + | ^^^^ not semantically valid as function parameter + | + = note: associated functions are those in `impl` or `trait` definitions + +error[E0412]: cannot find type `Struct` in this scope + --> $DIR/issue-102989.rs:7:22 + | +LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + | ^^^^^^ not found in this scope + +error[E0425]: cannot find value `x` in this scope + --> $DIR/issue-102989.rs:11:13 + | +LL | let x = x << 1; + | ^ help: a local variable with a similar name exists: `f` + +error[E0152]: found duplicate lang item `sized` + --> $DIR/issue-102989.rs:5:1 + | +LL | trait Sized { } + | ^^^^^^^^^^^ + | + = note: the lang item is first defined in crate `core` (which `std` depends on) + = note: first definition in `core` loaded from SYSROOT/libcore-*.rlib + = note: second definition in the local crate (`issue_102989`) + +error[E0277]: the size for values of type `{integer}` cannot be known at compilation time + --> $DIR/issue-102989.rs:11:15 + | +LL | let x = x << 1; + | ^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `{integer}` + +error[E0308]: mismatched types + --> $DIR/issue-102989.rs:7:42 + | +LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + | ---------- ^^^^ expected `&u32`, found `()` + | | + | implicitly returns `()` as its body has no tail or `return` expression + | +note: consider returning one of these bindings + --> $DIR/issue-102989.rs:7:30 + | +LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + | ^ +... +LL | let x = x << 1; + | ^ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0152, E0277, E0308, E0412, E0425. +For more information about an error, try `rustc --explain E0152`. diff --git a/src/test/ui/traits/issue-33140-hack-boundaries.stderr b/src/test/ui/traits/issue-33140-hack-boundaries.stderr index 62cfca545..58286648d 100644 --- a/src/test/ui/traits/issue-33140-hack-boundaries.stderr +++ b/src/test/ui/traits/issue-33140-hack-boundaries.stderr @@ -66,3 +66,20 @@ error: aborting due to 8 previous errors Some errors have detailed explanations: E0119, E0751. For more information about an error, try `rustc --explain E0119`. +Future incompatibility report: Future breakage diagnostic: +warning: conflicting implementations of trait `Trait0` for type `(dyn std::marker::Send + 'static)`: (E0119) + --> $DIR/issue-33140-hack-boundaries.rs:10:1 + | +LL | impl Trait0 for dyn Send {} + | ------------------------ first implementation here +LL | impl Trait0 for dyn Send {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #56484 +note: the lint level is defined here + --> $DIR/issue-33140-hack-boundaries.rs:2:10 + | +LL | #![allow(order_dependent_trait_objects)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/traits/issue-43784-supertrait.rs b/src/test/ui/traits/issue-43784-supertrait.rs new file mode 100644 index 000000000..55c26ccd2 --- /dev/null +++ b/src/test/ui/traits/issue-43784-supertrait.rs @@ -0,0 +1,10 @@ +pub trait Partial: Copy { +} + +pub trait Complete: Partial { +} + +impl Partial for T where T: Complete {} +impl Complete for T {} //~ ERROR the trait bound `T: Copy` is not satisfied + +fn main() {} diff --git a/src/test/ui/traits/issue-43784-supertrait.stderr b/src/test/ui/traits/issue-43784-supertrait.stderr new file mode 100644 index 000000000..bb890cb99 --- /dev/null +++ b/src/test/ui/traits/issue-43784-supertrait.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/issue-43784-supertrait.rs:8:9 + | +LL | impl Complete for T {} + | ^^^^^^^^ the trait `Copy` is not implemented for `T` + | +note: required by a bound in `Complete` + --> $DIR/issue-43784-supertrait.rs:4:21 + | +LL | pub trait Complete: Partial { + | ^^^^^^^ required by this bound in `Complete` +help: consider restricting type parameter `T` + | +LL | impl Complete for T {} + | +++++++++++++++++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/traits/issue-8153.stderr b/src/test/ui/traits/issue-8153.stderr index b76bbc023..ae214bb9e 100644 --- a/src/test/ui/traits/issue-8153.stderr +++ b/src/test/ui/traits/issue-8153.stderr @@ -1,10 +1,13 @@ error[E0201]: duplicate definitions with name `bar`: --> $DIR/issue-8153.rs:11:5 | +LL | fn bar(&self) -> isize; + | ----------------------- item in trait +... LL | fn bar(&self) -> isize {1} - | ---------------------- previous definition of `bar` here + | -------------------------- previous definition here LL | fn bar(&self) -> isize {2} - | ^^^^^^^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition error: aborting due to previous error diff --git a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr index 6acf2fe65..61b6d4b08 100644 --- a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr +++ b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr @@ -9,8 +9,8 @@ LL | { LL | recurse(IteratorOfWrapped(elements).map(|t| t.0)) | ------------------------------------------------- recursive call site | - = note: `#[warn(unconditional_recursion)]` on by default = help: a `loop` may express intention better if this is on purpose + = note: `#[warn(unconditional_recursion)]` on by default error[E0275]: overflow evaluating the requirement `(): Sized` | diff --git a/src/test/ui/traits/negative-impls/negative-default-impls.stderr b/src/test/ui/traits/negative-impls/negative-default-impls.stderr index ceb86559d..7b54cf542 100644 --- a/src/test/ui/traits/negative-impls/negative-default-impls.stderr +++ b/src/test/ui/traits/negative-impls/negative-default-impls.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0750]: negative impls cannot be default impls --> $DIR/negative-default-impls.rs:9:1 diff --git a/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr b/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr index 9a846143d..751e29c3b 100644 --- a/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr +++ b/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr b/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr index 77b4373a2..1cfa49b20 100644 --- a/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr +++ b/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`: --> $DIR/negative-specializes-positive-item.rs:11:1 diff --git a/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr b/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr index e5dc81b3e..9f9e28678 100644 --- a/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr +++ b/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`: --> $DIR/negative-specializes-positive.rs:7:1 diff --git a/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr b/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr index c091bc81d..545f94143 100644 --- a/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr +++ b/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`: --> $DIR/positive-specializes-negative.rs:7:1 diff --git a/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr b/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr index 77d71360b..0af4df2ae 100644 --- a/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr +++ b/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr @@ -6,13 +6,13 @@ LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #56484 note: the lint level is defined here --> $DIR/issue-33140-traitobject-crate.rs:3:9 | LL | #![warn(order_dependent_trait_objects)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56484 warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) --> $DIR/issue-33140-traitobject-crate.rs:89:1 @@ -40,3 +40,56 @@ LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { } warning: 3 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) + --> $DIR/issue-33140-traitobject-crate.rs:86:1 + | +LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } + | ------------------------------------------------------ first implementation here +LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #56484 +note: the lint level is defined here + --> $DIR/issue-33140-traitobject-crate.rs:3:9 + | +LL | #![warn(order_dependent_trait_objects)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) + --> $DIR/issue-33140-traitobject-crate.rs:89:1 + | +LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } + | ------------------------------------------------------------- first implementation here +... +LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #56484 +note: the lint level is defined here + --> $DIR/issue-33140-traitobject-crate.rs:3:9 + | +LL | #![warn(order_dependent_trait_objects)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) + --> $DIR/issue-33140-traitobject-crate.rs:93:1 + | +LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } + | ------------------------------------------------------ first implementation here +... +LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #56484 +note: the lint level is defined here + --> $DIR/issue-33140-traitobject-crate.rs:3:9 + | +LL | #![warn(order_dependent_trait_objects)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/traits/safety-trait-impl-cc.stderr b/src/test/ui/traits/safety-trait-impl-cc.stderr index 5a0f8d3b8..0b1fb3047 100644 --- a/src/test/ui/traits/safety-trait-impl-cc.stderr +++ b/src/test/ui/traits/safety-trait-impl-cc.stderr @@ -7,6 +7,12 @@ LL | | panic!(); LL | | } LL | | } | |_^ + | + = note: the trait `Foo` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword +help: add `unsafe` to this trait implementation + | +LL | unsafe impl lib::Foo for Bar { + | ++++++ error: aborting due to previous error diff --git a/src/test/ui/traits/safety-trait-impl.stderr b/src/test/ui/traits/safety-trait-impl.stderr index fc0f6c693..721e2b48b 100644 --- a/src/test/ui/traits/safety-trait-impl.stderr +++ b/src/test/ui/traits/safety-trait-impl.stderr @@ -3,12 +3,24 @@ error[E0200]: the trait `UnsafeTrait` requires an `unsafe impl` declaration | LL | impl UnsafeTrait for u16 { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the trait `UnsafeTrait` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword +help: add `unsafe` to this trait implementation + | +LL | unsafe impl UnsafeTrait for u16 { } + | ++++++ error[E0199]: implementing the trait `SafeTrait` is not unsafe --> $DIR/safety-trait-impl.rs:16:1 | LL | unsafe impl SafeTrait for u32 { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove `unsafe` from this trait implementation + | +LL - unsafe impl SafeTrait for u32 { } +LL + impl SafeTrait for u32 { } + | error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/static-method-generic-inference.stderr b/src/test/ui/traits/static-method-generic-inference.stderr index f1b8f23ec..5f74d0c3b 100644 --- a/src/test/ui/traits/static-method-generic-inference.stderr +++ b/src/test/ui/traits/static-method-generic-inference.stderr @@ -9,8 +9,8 @@ LL | let _f: base::Foo = base::HasNew::new(); | help: use the fully-qualified path to the only available implementation | -LL | let _f: base::Foo = base::<::base::Foo as HasNew>::new(); - | +++++++++++++++ + +LL | let _f: base::Foo = base::::new(); + | +++++++ + error: aborting due to previous error diff --git a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr index 35af9112a..6c359b698 100644 --- a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr +++ b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr @@ -4,13 +4,13 @@ error: `dyn B` implements `Deref` with supertrait `(dyn A + 'static)` as output LL | take_a(b) | ^ | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #89460 note: the lint level is defined here --> $DIR/migrate-lint-deny.rs:1:9 | LL | #![deny(deref_into_dyn_supertrait)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #89460 error: aborting due to previous error diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs deleted file mode 100644 index 6986ad621..000000000 --- a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-fail -#![feature(trait_upcasting)] -#![allow(incomplete_features)] - -trait Bar { - fn bar(&self, _: T) {} -} - -trait Foo : Bar + Bar { - fn foo(&self, _: ()) {} -} - -struct S; - -impl Bar for S {} -impl Bar for S {} -impl Foo for S {} - -fn main() { - let s: &dyn Foo = &S; - let t: &dyn Bar<_> = s; //~ ERROR mismatched types -} diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr deleted file mode 100644 index e9670ad7d..000000000 --- a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/multiple-occurence-ambiguousity.rs:21:26 - | -LL | let t: &dyn Bar<_> = s; - | ----------- ^ expected trait `Bar`, found trait `Foo` - | | - | expected due to this - | - = note: expected reference `&dyn Bar<_>` - found reference `&dyn Foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs new file mode 100644 index 000000000..6986ad621 --- /dev/null +++ b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs @@ -0,0 +1,22 @@ +// check-fail +#![feature(trait_upcasting)] +#![allow(incomplete_features)] + +trait Bar { + fn bar(&self, _: T) {} +} + +trait Foo : Bar + Bar { + fn foo(&self, _: ()) {} +} + +struct S; + +impl Bar for S {} +impl Bar for S {} +impl Foo for S {} + +fn main() { + let s: &dyn Foo = &S; + let t: &dyn Bar<_> = s; //~ ERROR mismatched types +} diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr new file mode 100644 index 000000000..956481351 --- /dev/null +++ b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/multiple-occurrence-ambiguousity.rs:21:26 + | +LL | let t: &dyn Bar<_> = s; + | ----------- ^ expected trait `Bar`, found trait `Foo` + | | + | expected due to this + | + = note: expected reference `&dyn Bar<_>` + found reference `&dyn Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/traits/unspecified-self-in-trait-ref.stderr b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr index 7869176bb..b5e8e8867 100644 --- a/src/test/ui/traits/unspecified-self-in-trait-ref.stderr +++ b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr @@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated LL | let a = Foo::lol(); | ^^^ | - = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see + = note: `#[warn(bare_trait_objects)]` on by default help: use `dyn` | LL | let a = ::lol(); -- cgit v1.2.3