From 02a7ec4672cd44432c6116883eb826e78ba63101 Mon Sep 17 00:00:00 2001 From: kei519 Date: Mon, 23 Dec 2024 00:31:31 +0900 Subject: [PATCH] Update tests to adopt #107295 --- tests/ui/associated-types/issue-26262.stderr | 16 ++++++++ .../in-trait/unconstrained-impl-region.stderr | 6 +++ .../issues/issue-78654.full.stderr | 7 ++++ .../async-await/issues/issue-78654.min.stderr | 7 ++++ ...post-analysis-user-facing-param-env.stderr | 7 ++++ ...ice-unexpected-inference-var-122549.stderr | 7 ++++ .../issues/issue-68366.full.stderr | 14 +++++++ .../issues/issue-68366.min.stderr | 14 +++++++ .../unconstrained_const_param_on_drop.stderr | 7 ++++ tests/ui/error-codes/E0207.stderr | 8 ++++ .../bugs/issue-87735.stderr | 8 ++++ .../bugs/issue-88526.stderr | 8 ++++ .../gat-trait-path-generic-type-arg.stderr | 8 ++++ .../in-trait/refine-resolution-errors.stderr | 6 +++ .../in-trait/unconstrained-lt.stderr | 8 ++++ tests/ui/impl-trait/issues/issue-87340.stderr | 6 +++ tests/ui/impl-unused-rps-in-assoc-type.stderr | 8 ++++ tests/ui/impl-unused-tps-inherent.stderr | 16 ++++++++ tests/ui/impl-unused-tps.stderr | 40 +++++++++++++++++++ tests/ui/issues/issue-16562.stderr | 8 ++++ tests/ui/issues/issue-22886.stderr | 8 ++++ tests/ui/issues/issue-29861.stderr | 8 ++++ tests/ui/issues/issue-35139.stderr | 8 ++++ ...ined-params-in-impl-due-to-overflow.stderr | 8 ++++ .../unconstrained-params-in-impl.stderr | 8 ++++ ...ice-const-not-fully-resolved-113045.stderr | 6 +++ ...assoc-type-suggestion-in-trait-impl.stderr | 8 ++++ ...resolve-impl-before-constrain-check.stderr | 6 +++ .../assoc-type-lifetime-unconstrained.stderr | 8 ++++ ...iled-to-resolve-instance-for-110696.stderr | 8 ++++ .../impl-with-unconstrained-param.stderr | 6 +++ .../type-alias-impl-trait/issue-74244.stderr | 8 ++++ .../issue-74761-2.stderr | 12 ++++++ .../type-alias-impl-trait/issue-74761.stderr | 12 ++++++ ...s-impl-trait-unconstrained-lifetime.stderr | 6 +++ .../unconstrained-impl-param.stderr | 8 ++++ tests/ui/typeck/issue-13853-5.stderr | 8 ++++ 37 files changed, 345 insertions(+) diff --git a/tests/ui/associated-types/issue-26262.stderr b/tests/ui/associated-types/issue-26262.stderr index 90e2d0d930164..09aa37e935d1e 100644 --- a/tests/ui/associated-types/issue-26262.stderr +++ b/tests/ui/associated-types/issue-26262.stderr @@ -3,12 +3,28 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl S { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl S { +LL + impl S { + | +LL | impl S { + | +++ 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<>::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<>::Foo> for T { +LL + impl> Trait1<>::Foo> for T { + | +LL | impl<'a,T: Trait2<'a>> Trait1<>::Foo> for T<'a> { + | ++++ error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr b/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr index ef7e4ef0eb85f..4a3aeea29d149 100644 --- a/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr +++ b/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr @@ -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 diff --git a/tests/ui/async-await/issues/issue-78654.full.stderr b/tests/ui/async-await/issues/issue-78654.full.stderr index 0d12a948c68bd..dd4eadde64a6c 100644 --- a/tests/ui/async-await/issues/issue-78654.full.stderr +++ b/tests/ui/async-await/issues/issue-78654.full.stderr @@ -12,6 +12,13 @@ LL | impl 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 Foo { +LL + impl Foo { + | +LL | impl Foo { + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/issues/issue-78654.min.stderr b/tests/ui/async-await/issues/issue-78654.min.stderr index 0d12a948c68bd..dd4eadde64a6c 100644 --- a/tests/ui/async-await/issues/issue-78654.min.stderr +++ b/tests/ui/async-await/issues/issue-78654.min.stderr @@ -12,6 +12,13 @@ LL | impl 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 Foo { +LL + impl Foo { + | +LL | impl Foo { + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr index ade18eb88b901..3399ece7337f5 100644 --- a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr +++ b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr @@ -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 + | +++++ error[E0284]: type annotations needed --> $DIR/post-analysis-user-facing-param-env.rs:11:40 diff --git a/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr index afad3388145c7..a17656c9d6ac0 100644 --- a/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr +++ b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr @@ -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 diff --git a/tests/ui/const-generics/issues/issue-68366.full.stderr b/tests/ui/const-generics/issues/issue-68366.full.stderr index caed3c1bf3f7d..34a5ab398567f 100644 --- a/tests/ui/const-generics/issues/issue-68366.full.stderr +++ b/tests/ui/const-generics/issues/issue-68366.full.stderr @@ -18,6 +18,13 @@ LL | impl 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 Collatz<{Some(N)}> {} +LL + impl Collatz<{Some(N)}> {} + | +LL | impl 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 @@ -27,6 +34,13 @@ LL | impl 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 Foo {} +LL + impl Foo {} + | +LL | impl Foo {} + | +++ error: overly complex generic constant --> $DIR/issue-68366.rs:12:31 diff --git a/tests/ui/const-generics/issues/issue-68366.min.stderr b/tests/ui/const-generics/issues/issue-68366.min.stderr index 10b5a06682f53..a0e72c8221d0f 100644 --- a/tests/ui/const-generics/issues/issue-68366.min.stderr +++ b/tests/ui/const-generics/issues/issue-68366.min.stderr @@ -27,6 +27,13 @@ LL | impl 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 Collatz<{Some(N)}> {} +LL + impl Collatz<{Some(N)}> {} + | +LL | impl 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 @@ -36,6 +43,13 @@ LL | impl 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 Foo {} +LL + impl Foo {} + | +LL | impl Foo {} + | +++ error: aborting due to 4 previous errors diff --git a/tests/ui/dropck/unconstrained_const_param_on_drop.stderr b/tests/ui/dropck/unconstrained_const_param_on_drop.stderr index 851888534eeb2..a0ac2e1b36e80 100644 --- a/tests/ui/dropck/unconstrained_const_param_on_drop.stderr +++ b/tests/ui/dropck/unconstrained_const_param_on_drop.stderr @@ -18,6 +18,13 @@ LL | impl 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 Drop for Foo {} +LL + impl Drop for Foo {} + | +LL | impl Drop for Foo {} + | ++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0207.stderr b/tests/ui/error-codes/E0207.stderr index 01d7c41854412..b00222ed4d194 100644 --- a/tests/ui/error-codes/E0207.stderr +++ b/tests/ui/error-codes/E0207.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl Foo { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl Foo { +LL + impl Foo { + | +LL | impl Foo { + | +++ error: aborting due to 1 previous error diff --git a/tests/ui/generic-associated-types/bugs/issue-87735.stderr b/tests/ui/generic-associated-types/bugs/issue-87735.stderr index d80050652389d..64544f6fe04f4 100644 --- a/tests/ui/generic-associated-types/bugs/issue-87735.stderr +++ b/tests/ui/generic-associated-types/bugs/issue-87735.stderr @@ -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 | ^ 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 +LL + impl<'b, T> AsRef2 for Foo + | +LL | impl<'b, T, U> AsRef2 for Foo + | +++ error[E0309]: the parameter type `U` may not live long enough --> $DIR/issue-87735.rs:34:21 diff --git a/tests/ui/generic-associated-types/bugs/issue-88526.stderr b/tests/ui/generic-associated-types/bugs/issue-88526.stderr index 5da3e3ff64ab9..98ebef6a7b0fd 100644 --- a/tests/ui/generic-associated-types/bugs/issue-88526.stderr +++ b/tests/ui/generic-associated-types/bugs/issue-88526.stderr @@ -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 | ^ 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 +LL + impl<'q, Q, F> A for TestB + | +LL | impl<'q, Q, I, F> A for TestB + | +++ error[E0309]: the parameter type `F` may not live long enough --> $DIR/issue-88526.rs:16:18 diff --git a/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr b/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr index cb2b9f32bfe72..c01c8763a2da1 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr +++ b/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr @@ -18,6 +18,14 @@ error[E0207]: the type parameter `T1` is not constrained by the impl trait, self | LL | impl Foo for T { | ^^ unconstrained type parameter + | +help: either remove the type parameter T1, or make use of it, for example + | +LL - impl Foo for T { +LL + impl Foo for T { + | +LL | impl Foo for T { + | ++++ error: aborting due to 3 previous errors diff --git a/tests/ui/impl-trait/in-trait/refine-resolution-errors.stderr b/tests/ui/impl-trait/in-trait/refine-resolution-errors.stderr index 0f5573dda04c1..46b5ee4683e28 100644 --- a/tests/ui/impl-trait/in-trait/refine-resolution-errors.stderr +++ b/tests/ui/impl-trait/in-trait/refine-resolution-errors.stderr @@ -3,6 +3,12 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl Mirror for () { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl Mirror for () { +LL + impl Mirror for () { + | error[E0282]: type annotations needed --> $DIR/refine-resolution-errors.rs:15:5 diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr index 4c5a42c0b4b47..45cdbc42bfef3 100644 --- a/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr +++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr @@ -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 Foo for T { + | +LL | impl<'a, T> Foo for T<'a> { + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/issues/issue-87340.stderr b/tests/ui/impl-trait/issues/issue-87340.stderr index 1be4087be4242..d40f07eef4b46 100644 --- a/tests/ui/impl-trait/issues/issue-87340.stderr +++ b/tests/ui/impl-trait/issues/issue-87340.stderr @@ -3,6 +3,12 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl X for () { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl X for () { +LL + impl X for () { + | error[E0282]: type annotations needed --> $DIR/issue-87340.rs:11:23 diff --git a/tests/ui/impl-unused-rps-in-assoc-type.stderr b/tests/ui/impl-unused-rps-in-assoc-type.stderr index ef61fa4be4830..84bacd4968fa0 100644 --- a/tests/ui/impl-unused-rps-in-assoc-type.stderr +++ b/tests/ui/impl-unused-rps-in-assoc-type.stderr @@ -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 diff --git a/tests/ui/impl-unused-tps-inherent.stderr b/tests/ui/impl-unused-tps-inherent.stderr index 43f63cf968cf5..86b8d5c3d56f5 100644 --- a/tests/ui/impl-unused-tps-inherent.stderr +++ b/tests/ui/impl-unused-tps-inherent.stderr @@ -3,12 +3,28 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl MyType { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl MyType { +LL + impl MyType { + | +LL | impl MyType { + | +++ 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 MyType1 { | ^ unconstrained type parameter + | +help: either remove the type parameter U, or make use of it, for example + | +LL - impl MyType1 { +LL + impl MyType1 { + | +LL | impl MyType1 { + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/impl-unused-tps.stderr b/tests/ui/impl-unused-tps.stderr index da4589dee8278..86536a0b382fd 100644 --- a/tests/ui/impl-unused-tps.stderr +++ b/tests/ui/impl-unused-tps.stderr @@ -45,30 +45,70 @@ error[E0207]: the type parameter `U` is not constrained by the impl trait, self | LL | impl Foo for [isize; 1] { | ^ unconstrained type parameter + | +help: either remove the type parameter U, or make use of it, for example + | +LL - impl Foo for [isize; 1] { +LL + impl Foo for [isize; 1] { + | +LL | impl Foo for [isize; 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 Bar for T { | ^ unconstrained type parameter + | +help: either remove the type parameter U, or make use of it, for example + | +LL - impl Bar for T { +LL + impl Bar for T { + | +LL | impl Bar for T { + | +++ 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 Bar for T | ^ unconstrained type parameter + | +help: either remove the type parameter U, or make use of it, for example + | +LL - impl Bar for T +LL + impl Bar for T + | +LL | impl Bar for T + | +++ 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 Foo for T | ^ unconstrained type parameter + | +help: either remove the type parameter U, or make use of it, for example + | +LL - impl Foo for T +LL + impl Foo for T + | +LL | impl Foo for T + | +++ 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 Foo for T | ^ unconstrained type parameter + | +help: either remove the type parameter V, or make use of it, for example + | +LL - impl Foo for T +LL + impl Foo for T + | +LL | impl Foo for T + | +++ error: aborting due to 9 previous errors diff --git a/tests/ui/issues/issue-16562.stderr b/tests/ui/issues/issue-16562.stderr index efbd7f712a45a..185d5a8e67e2d 100644 --- a/tests/ui/issues/issue-16562.stderr +++ b/tests/ui/issues/issue-16562.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl Collection for Col { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl Collection for Col { +LL + impl Collection for Col { + | +LL | impl Collection for Col { + | +++ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-22886.stderr b/tests/ui/issues/issue-22886.stderr index a04fa677f9ec5..609436800564c 100644 --- a/tests/ui/issues/issue-22886.stderr +++ b/tests/ui/issues/issue-22886.stderr @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a> Iterator for Newtype { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a> Iterator for Newtype { +LL + impl Iterator for Newtype { + | +LL | impl<'a> Iterator for Newtype<'a> { + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-29861.stderr b/tests/ui/issues/issue-29861.stderr index a25cbf0515d84..c5014203b2bcf 100644 --- a/tests/ui/issues/issue-29861.stderr +++ b/tests/ui/issues/issue-29861.stderr @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a, T: 'a> MakeRef2 for T { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a, T: 'a> MakeRef2 for T { +LL + impl MakeRef2 for T { + | +LL | impl<'a, T: 'a> MakeRef2 for T<'a> { + | ++++ error[E0716]: temporary value dropped while borrowed --> $DIR/issue-29861.rs:16:43 diff --git a/tests/ui/issues/issue-35139.stderr b/tests/ui/issues/issue-35139.stderr index 875af70483224..f0d88c5076835 100644 --- a/tests/ui/issues/issue-35139.stderr +++ b/tests/ui/issues/issue-35139.stderr @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a> MethodType for MTFn { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a> MethodType for MTFn { +LL + impl MethodType for MTFn { + | +LL | impl<'a> MethodType for MTFn<'a> { + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr index bcffa02ddd424..7c42c870ec20a 100644 --- a/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr +++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl Loop {} | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl Loop {} +LL + impl Loop {} + | +LL | impl Loop {} + | +++ error[E0275]: overflow normalizing the type alias `Loop` --> $DIR/unconstrained-params-in-impl-due-to-overflow.rs:6:16 diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr index 2419c78cba8d9..57c0a6abd868a 100644 --- a/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr +++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl NotInjective {} | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl NotInjective {} +LL + impl NotInjective {} + | +LL | impl NotInjective {} + | +++ error: aborting due to 1 previous error diff --git a/tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.stderr b/tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.stderr index acbdb9b0a308e..45ec1be44c6ed 100644 --- a/tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.stderr +++ b/tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.stderr @@ -3,6 +3,12 @@ error[E0207]: the type parameter `Unconstrained` is not constrained by the impl | LL | impl<'a, Unconstrained> X for [(); 0] {} | ^^^^^^^^^^^^^ unconstrained type parameter + | +help: either remove the type parameter Unconstrained, or make use of it, for example + | +LL - impl<'a, Unconstrained> X for [(); 0] {} +LL + impl<'a> X for [(); 0] {} + | error: specialization impl does not specialize any associated items --> $DIR/ice-const-not-fully-resolved-113045.rs:11:1 diff --git a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr index a22d88b7c59fa..e0c990cec7576 100644 --- a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr +++ b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `S` is not constrained by the impl trait, self | LL | impl Trait for i32 { | ^ unconstrained type parameter + | +help: either remove the type parameter S, or make use of it, for example + | +LL - impl Trait for i32 { +LL + impl Trait for i32 { + | +LL | impl Trait for i32 { + | +++ error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:15:12 diff --git a/tests/ui/traits/resolve-impl-before-constrain-check.stderr b/tests/ui/traits/resolve-impl-before-constrain-check.stderr index e8e569ba625ee..6a97ab4e5cf41 100644 --- a/tests/ui/traits/resolve-impl-before-constrain-check.stderr +++ b/tests/ui/traits/resolve-impl-before-constrain-check.stderr @@ -3,6 +3,12 @@ error[E0207]: the type parameter `V` is not constrained by the impl trait, self | LL | impl Callable for () { | ^ unconstrained type parameter + | +help: either remove the type parameter V, or make use of it, for example + | +LL - impl Callable for () { +LL + impl Callable for () { + | error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr b/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr index e6b94c525ff23..94e29424ec950 100644 --- a/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr +++ b/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a, I> UnwrapItemsExt for I { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a, I> UnwrapItemsExt for I { +LL + impl UnwrapItemsExt for I { + | +LL | impl<'a, I> UnwrapItemsExt for I<'a> { + | ++++ error[E0792]: expected generic lifetime parameter, found `'_` --> $DIR/assoc-type-lifetime-unconstrained.rs:22:9 diff --git a/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr index eace96317dc1d..6bc489ea84f4d 100644 --- a/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr +++ b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl>>, U> MyIndex> for Scope { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl>>, U> MyIndex> for Scope { +LL + impl MyIndex> for Scope { + | +LL | impl>>, U> MyIndex> for Scope { + | +++ error: item does not constrain `DummyT::{opaque#0}`, but has it in its signature --> $DIR/ice-failed-to-resolve-instance-for-110696.rs:28:8 diff --git a/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr b/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr index bb0e11d314c33..47059a9ce7d5c 100644 --- a/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr +++ b/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr @@ -3,6 +3,12 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl X for () { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl X for () { +LL + impl X for () { + | error[E0282]: type annotations needed --> $DIR/impl-with-unconstrained-param.rs:14:23 diff --git a/tests/ui/type-alias-impl-trait/issue-74244.stderr b/tests/ui/type-alias-impl-trait/issue-74244.stderr index d2b50ffd86b59..2b12e5d9ebcca 100644 --- a/tests/ui/type-alias-impl-trait/issue-74244.stderr +++ b/tests/ui/type-alias-impl-trait/issue-74244.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl Allocator for DefaultAllocator { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl Allocator for DefaultAllocator { +LL + impl Allocator for DefaultAllocator { + | +LL | impl Allocator for DefaultAllocator { + | +++ error[E0282]: type annotations needed --> $DIR/issue-74244.rs:16:13 diff --git a/tests/ui/type-alias-impl-trait/issue-74761-2.stderr b/tests/ui/type-alias-impl-trait/issue-74761-2.stderr index 26babc29000c0..0fe4422f13b42 100644 --- a/tests/ui/type-alias-impl-trait/issue-74761-2.stderr +++ b/tests/ui/type-alias-impl-trait/issue-74761-2.stderr @@ -3,12 +3,24 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a, 'b> A for () { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a, 'b> A for () { +LL + impl<'b> A for () { + | error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-74761-2.rs:7:10 | LL | impl<'a, 'b> A for () { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'b, or make use of it, for example + | +LL - impl<'a, 'b> A for () { +LL + impl<'a> A for () { + | error[E0792]: expected generic lifetime parameter, found `'_` --> $DIR/issue-74761-2.rs:12:28 diff --git a/tests/ui/type-alias-impl-trait/issue-74761.stderr b/tests/ui/type-alias-impl-trait/issue-74761.stderr index a4826c293467e..3be849611bf17 100644 --- a/tests/ui/type-alias-impl-trait/issue-74761.stderr +++ b/tests/ui/type-alias-impl-trait/issue-74761.stderr @@ -3,12 +3,24 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a, 'b> A for () { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a, 'b> A for () { +LL + impl<'b> A for () { + | error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-74761.rs:7:10 | LL | impl<'a, 'b> A for () { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'b, or make use of it, for example + | +LL - impl<'a, 'b> A for () { +LL + impl<'a> A for () { + | error[E0792]: expected generic lifetime parameter, found `'_` --> $DIR/issue-74761.rs:12:28 diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr index 5f9c56f1ca9d0..ad613b902e6b8 100644 --- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr +++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr @@ -3,6 +3,12 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a, I: Iterator> Trait for (i32, I) { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a, I: Iterator> Trait for (i32, I) { +LL + impl> Trait for (i32, I) { + | error[E0792]: expected generic lifetime parameter, found `'_` --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:14:9 diff --git a/tests/ui/type-alias-impl-trait/unconstrained-impl-param.stderr b/tests/ui/type-alias-impl-trait/unconstrained-impl-param.stderr index 6206f169c5b9e..c14d947b1f2cc 100644 --- a/tests/ui/type-alias-impl-trait/unconstrained-impl-param.stderr +++ b/tests/ui/type-alias-impl-trait/unconstrained-impl-param.stderr @@ -3,6 +3,14 @@ error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, | LL | impl<'a> Trait for Opaque<&'a str> { | ^^ unconstrained lifetime parameter + | +help: either remove the type parameter 'a, or make use of it, for example + | +LL - impl<'a> Trait for Opaque<&'a str> { +LL + impl Trait for Opaque<&'a str> { + | +LL | impl<'a> Trait for Opaque<&'a str, 'a> { + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-13853-5.stderr b/tests/ui/typeck/issue-13853-5.stderr index 388d5ec746ce6..87d81db126c94 100644 --- a/tests/ui/typeck/issue-13853-5.stderr +++ b/tests/ui/typeck/issue-13853-5.stderr @@ -3,6 +3,14 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self | LL | impl<'a, T: Deserializable> Deserializable for &'a str { | ^ unconstrained type parameter + | +help: either remove the type parameter T, or make use of it, for example + | +LL - impl<'a, T: Deserializable> Deserializable for &'a str { +LL + impl<'a: Deserializable> Deserializable for &'a str { + | +LL | impl<'a, T: Deserializable> Deserializable for &'a str { + | +++ error[E0308]: mismatched types --> $DIR/issue-13853-5.rs:9:70