Skip to content

Commit

Permalink
Update tests to adopt rust-lang#107295
Browse files Browse the repository at this point in the history
  • Loading branch information
kei519 committed Dec 22, 2024
1 parent 77a1a64 commit 02a7ec4
Show file tree
Hide file tree
Showing 37 changed files with 345 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/ui/associated-types/issue-26262.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T: Tr> S<T::Assoc> {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T: Tr> S<T::Assoc> {
LL + impl S<T::Assoc> {
|
LL | impl<T: Tr> S<T::Assoc, T> {
| +++

error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-26262.rs:17:6
|
LL | impl<'a,T: Trait2<'a>> Trait1<<T as Trait2<'a>>::Foo> for T {
| ^^ unconstrained lifetime parameter
|
help: either remove the type parameter 'a, or make use of it, for example
|
LL - impl<'a,T: Trait2<'a>> Trait1<<T as Trait2<'a>>::Foo> for T {
LL + impl<T: Trait2<'a>> Trait1<<T as Trait2<'a>>::Foo> for T {
|
LL | impl<'a,T: Trait2<'a>> Trait1<<T as Trait2<'a>>::Foo> for T<'a> {
| ++++

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait,
|
LL | impl<'a> Actor for () {
| ^^ unconstrained lifetime parameter
|
help: either remove the type parameter 'a, or make use of it, for example
|
LL - impl<'a> Actor for () {
LL + impl Actor for () {
|

error: aborting due to 1 previous error

Expand Down
7 changes: 7 additions & 0 deletions tests/ui/async-await/issues/issue-78654.full.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ LL | impl<const H: feature> Foo {
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter H, or make use of it, for example
|
LL - impl<const H: feature> Foo {
LL + impl Foo {
|
LL | impl<const H: feature> Foo<H> {
| +++

error: aborting due to 2 previous errors

Expand Down
7 changes: 7 additions & 0 deletions tests/ui/async-await/issues/issue-78654.min.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ LL | impl<const H: feature> Foo {
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter H, or make use of it, for example
|
LL - impl<const H: feature> Foo {
LL + impl Foo {
|
LL | impl<const H: feature> Foo<H> {
| +++

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter NUM, or make use of it, for example
|
LL - impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
LL + impl<'a> std::ops::Add<&'a Foo> for Foo
|
LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo<NUM>
| +++++

error[E0284]: type annotations needed
--> $DIR/post-analysis-user-facing-param-env.rs:11:40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> {
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter N, or make use of it, for example
|
LL - impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> {
LL + impl<'a, T> Iterator for ConstChunksExact<'a, T, {}> {
|
LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}, N> {
| +++

error[E0308]: mismatched types
--> $DIR/ice-unexpected-inference-var-122549.rs:15:66
Expand Down
14 changes: 14 additions & 0 deletions tests/ui/const-generics/issues/issue-68366.full.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ LL | impl <const N: usize> Collatz<{Some(N)}> {}
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter N, or make use of it, for example
|
LL - impl <const N: usize> Collatz<{Some(N)}> {}
LL + impl Collatz<{Some(N)}> {}
|
LL | impl <const N: usize> Collatz<{Some(N)}, N> {}
| +++

error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:19:6
Expand All @@ -27,6 +34,13 @@ LL | impl<const N: usize> Foo {}
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter N, or make use of it, for example
|
LL - impl<const N: usize> Foo {}
LL + impl Foo {}
|
LL | impl<const N: usize> Foo<N> {}
| +++

error: overly complex generic constant
--> $DIR/issue-68366.rs:12:31
Expand Down
14 changes: 14 additions & 0 deletions tests/ui/const-generics/issues/issue-68366.min.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ LL | impl <const N: usize> Collatz<{Some(N)}> {}
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter N, or make use of it, for example
|
LL - impl <const N: usize> Collatz<{Some(N)}> {}
LL + impl Collatz<{Some(N)}> {}
|
LL | impl <const N: usize> Collatz<{Some(N)}, N> {}
| +++

error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:19:6
Expand All @@ -36,6 +43,13 @@ LL | impl<const N: usize> Foo {}
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter N, or make use of it, for example
|
LL - impl<const N: usize> Foo {}
LL + impl Foo {}
|
LL | impl<const N: usize> Foo<N> {}
| +++

error: aborting due to 4 previous errors

Expand Down
7 changes: 7 additions & 0 deletions tests/ui/dropck/unconstrained_const_param_on_drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ LL | impl<const UNUSED: usize> Drop for Foo {}
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
help: either remove the type parameter UNUSED, or make use of it, for example
|
LL - impl<const UNUSED: usize> Drop for Foo {}
LL + impl Drop for Foo {}
|
LL | impl<const UNUSED: usize> Drop for Foo<UNUSED> {}
| ++++++++

error: aborting due to 2 previous errors

Expand Down
8 changes: 8 additions & 0 deletions tests/ui/error-codes/E0207.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T: Default> Foo {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T: Default> Foo {
LL + impl Foo {
|
LL | impl<T: Default> Foo<T> {
| +++

error: aborting due to 1 previous error

Expand Down
8 changes: 8 additions & 0 deletions tests/ui/generic-associated-types/bugs/issue-87735.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the type parameter `U` is not constrained by the impl trait, self
|
LL | impl<'b, T, U> AsRef2 for Foo<T>
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<'b, T, U> AsRef2 for Foo<T>
LL + impl<'b, T> AsRef2 for Foo<T>
|
LL | impl<'b, T, U> AsRef2 for Foo<T, U>
| +++

error[E0309]: the parameter type `U` may not live long enough
--> $DIR/issue-87735.rs:34:21
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/generic-associated-types/bugs/issue-88526.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the type parameter `I` is not constrained by the impl trait, self
|
LL | impl<'q, Q, I, F> A for TestB<Q, F>
| ^ unconstrained type parameter
|
help: either remove the type parameter I, or make use of it, for example
|
LL - impl<'q, Q, I, F> A for TestB<Q, F>
LL + impl<'q, Q, F> A for TestB<Q, F>
|
LL | impl<'q, Q, I, F> A for TestB<Q, F, I>
| +++

error[E0309]: the parameter type `F` may not live long enough
--> $DIR/issue-88526.rs:16:18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ error[E0207]: the type parameter `T1` is not constrained by the impl trait, self
|
LL | impl <T, T1> Foo for T {
| ^^ unconstrained type parameter
|
help: either remove the type parameter T1, or make use of it, for example
|
LL - impl <T, T1> Foo for T {
LL + impl <T> Foo for T {
|
LL | impl <T, T1> Foo for T<T1> {
| ++++

error: aborting due to 3 previous errors

Expand Down
6 changes: 6 additions & 0 deletions tests/ui/impl-trait/in-trait/refine-resolution-errors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T: ?Sized> Mirror for () {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T: ?Sized> Mirror for () {
LL + impl Mirror for () {
|

error[E0282]: type annotations needed
--> $DIR/refine-resolution-errors.rs:15:5
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/impl-trait/in-trait/unconstrained-lt.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait,
|
LL | impl<'a, T> Foo for T {
| ^^ unconstrained lifetime parameter
|
help: either remove the type parameter 'a, or make use of it, for example
|
LL - impl<'a, T> Foo for T {
LL + impl<T> Foo for T {
|
LL | impl<'a, T> Foo for T<'a> {
| ++++

error: aborting due to 1 previous error

Expand Down
6 changes: 6 additions & 0 deletions tests/ui/impl-trait/issues/issue-87340.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T> X for () {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T> X for () {
LL + impl X for () {
|

error[E0282]: type annotations needed
--> $DIR/issue-87340.rs:11:23
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/impl-unused-rps-in-assoc-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait,
|
LL | impl<'a> Fun for Holder {
| ^^ unconstrained lifetime parameter
|
help: either remove the type parameter 'a, or make use of it, for example
|
LL - impl<'a> Fun for Holder {
LL + impl Fun for Holder {
|
LL | impl<'a> Fun for Holder<'a> {
| ++++

error: aborting due to 1 previous error

Expand Down
16 changes: 16 additions & 0 deletions tests/ui/impl-unused-tps-inherent.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T> MyType {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T> MyType {
LL + impl MyType {
|
LL | impl<T> MyType<T> {
| +++

error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/impl-unused-tps-inherent.rs:17:8
|
LL | impl<T,U> MyType1<T> {
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<T,U> MyType1<T> {
LL + impl<T> MyType1<T> {
|
LL | impl<T,U> MyType1<T, U> {
| +++

error: aborting due to 2 previous errors

Expand Down
40 changes: 40 additions & 0 deletions tests/ui/impl-unused-tps.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,70 @@ error[E0207]: the type parameter `U` is not constrained by the impl trait, self
|
LL | impl<T, U> Foo<T> for [isize; 1] {
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<T, U> Foo<T> for [isize; 1] {
LL + impl<T> Foo<T> for [isize; 1] {
|
LL | impl<T, U> Foo<T> for [isize<U>; 1] {
| +++

error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/impl-unused-tps.rs:32:9
|
LL | impl<T, U> Bar for T {
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<T, U> Bar for T {
LL + impl<T> Bar for T {
|
LL | impl<T, U> Bar for T<U> {
| +++

error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/impl-unused-tps.rs:40:9
|
LL | impl<T, U> Bar for T
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<T, U> Bar for T
LL + impl<T> Bar for T
|
LL | impl<T, U> Bar for T<U>
| +++

error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/impl-unused-tps.rs:49:9
|
LL | impl<T, U, V> Foo<T> for T
| ^ unconstrained type parameter
|
help: either remove the type parameter U, or make use of it, for example
|
LL - impl<T, U, V> Foo<T> for T
LL + impl<T, V> Foo<T> for T
|
LL | impl<T, U, V> Foo<T> for T<U>
| +++

error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates
--> $DIR/impl-unused-tps.rs:49:12
|
LL | impl<T, U, V> Foo<T> for T
| ^ unconstrained type parameter
|
help: either remove the type parameter V, or make use of it, for example
|
LL - impl<T, U, V> Foo<T> for T
LL + impl<T, U> Foo<T> for T
|
LL | impl<T, U, V> Foo<T> for T<V>
| +++

error: aborting due to 9 previous errors

Expand Down
8 changes: 8 additions & 0 deletions tests/ui/issues/issue-16562.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
|
LL | impl<T, M: MatrixShape> Collection for Col<M, usize> {
| ^ unconstrained type parameter
|
help: either remove the type parameter T, or make use of it, for example
|
LL - impl<T, M: MatrixShape> Collection for Col<M, usize> {
LL + impl<M: MatrixShape> Collection for Col<M, usize> {
|
LL | impl<T, M: MatrixShape> Collection for Col<M, usize, T> {
| +++

error: aborting due to 1 previous error

Expand Down
Loading

0 comments on commit 02a7ec4

Please sign in to comment.