diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-01-24 02:52:29 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-01-24 02:53:15 +0000 |
| commit | a9841936fe25d3d2841a02abfdb2da2342a3dbcf (patch) | |
| tree | 70fe579803d4eed1718eb9cf78808339db8e9830 /tests/ui/traits/next-solver | |
| parent | 0b7730105fb7e008002f6ba29f87a55699f67744 (diff) | |
| download | rust-a9841936fe25d3d2841a02abfdb2da2342a3dbcf.tar.gz rust-a9841936fe25d3d2841a02abfdb2da2342a3dbcf.zip | |
Deduplicate more sized errors on call exprs
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
Diffstat (limited to 'tests/ui/traits/next-solver')
5 files changed, 5 insertions, 18 deletions
diff --git a/tests/ui/traits/next-solver/alias-bound-unsound.rs b/tests/ui/traits/next-solver/alias-bound-unsound.rs index 8fddbd7ecdc..01b90977d71 100644 --- a/tests/ui/traits/next-solver/alias-bound-unsound.rs +++ b/tests/ui/traits/next-solver/alias-bound-unsound.rs @@ -22,8 +22,7 @@ impl Foo for () { fn main() { let x = String::from("hello, world"); drop(<() as Foo>::copy_me(&x)); - //~^ ERROR overflow evaluating the requirement `<() as Foo>::Item: Sized` - //~| ERROR overflow evaluating the requirement `String <: <() as Foo>::Item` + //~^ ERROR overflow evaluating the requirement `String <: <() as Foo>::Item` //~| ERROR overflow evaluating the requirement `<() as Foo>::Item well-formed` //~| ERROR overflow evaluating the requirement `&<() as Foo>::Item well-formed` //~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _` diff --git a/tests/ui/traits/next-solver/alias-bound-unsound.stderr b/tests/ui/traits/next-solver/alias-bound-unsound.stderr index 874644317eb..1983360b658 100644 --- a/tests/ui/traits/next-solver/alias-bound-unsound.stderr +++ b/tests/ui/traits/next-solver/alias-bound-unsound.stderr @@ -27,15 +27,6 @@ LL | drop(<() as Foo>::copy_me(&x)); | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`alias_bound_unsound`) -error[E0275]: overflow evaluating the requirement `<() as Foo>::Item: Sized` - --> $DIR/alias-bound-unsound.rs:24:10 - | -LL | drop(<() as Foo>::copy_me(&x)); - | ^^^^^^^^^^^^^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`alias_bound_unsound`) - = note: the return type of a function must have a statically known size - error[E0275]: overflow evaluating the requirement `&<() as Foo>::Item well-formed` --> $DIR/alias-bound-unsound.rs:24:31 | @@ -61,6 +52,6 @@ LL | drop(<() as Foo>::copy_me(&x)); = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`alias_bound_unsound`) = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/traits/next-solver/more-object-bound.stderr b/tests/ui/traits/next-solver/more-object-bound.stderr index e3be2931e12..1b776d7198e 100644 --- a/tests/ui/traits/next-solver/more-object-bound.stderr +++ b/tests/ui/traits/next-solver/more-object-bound.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `dyn Trait<A = A, B = B>: Trait` is not satisfied --> $DIR/more-object-bound.rs:12:5 | LL | foo::<A, B, dyn Trait<A = A, B = B>>(x) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Trait<A = A, B = B>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Trait<A = A, B = B>` | note: required by a bound in `foo` --> $DIR/more-object-bound.rs:18:8 diff --git a/tests/ui/traits/next-solver/object-unsafety.stderr b/tests/ui/traits/next-solver/object-unsafety.stderr index ee38c256e5f..eedca879b0c 100644 --- a/tests/ui/traits/next-solver/object-unsafety.stderr +++ b/tests/ui/traits/next-solver/object-unsafety.stderr @@ -46,10 +46,7 @@ error[E0277]: the size for values of type `<dyn Setup<From = T> as Setup>::From` --> $DIR/object-unsafety.rs:12:5 | LL | copy::<dyn Setup<From=T>>(t) - | ^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | doesn't have a size known at compile-time - | this returned value is of type `<dyn Setup<From = T> as Setup>::From` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `<dyn Setup<From = T> as Setup>::From` = note: the return type of a function must have a statically known size diff --git a/tests/ui/traits/next-solver/specialization-unconstrained.stderr b/tests/ui/traits/next-solver/specialization-unconstrained.stderr index ed4dafa1484..68232aacc0c 100644 --- a/tests/ui/traits/next-solver/specialization-unconstrained.stderr +++ b/tests/ui/traits/next-solver/specialization-unconstrained.stderr @@ -12,7 +12,7 @@ error[E0284]: type annotations needed: cannot satisfy `<u32 as Default>::Id == ( --> $DIR/specialization-unconstrained.rs:20:5 | LL | test::<u32, ()>(); - | ^^^^^^^^^^^^^^^ cannot satisfy `<u32 as Default>::Id == ()` + | ^^^^^^^^^^^^^^^^^ cannot satisfy `<u32 as Default>::Id == ()` | note: required by a bound in `test` --> $DIR/specialization-unconstrained.rs:17:20 |
