diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-07-05 01:28:24 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-07-22 22:04:49 +0000 |
| commit | 5c2b36a21cabafb1f08e278f4c6ed61753a654cf (patch) | |
| tree | 922c29165702f2010839dccdcfc00b48dcbe7b05 /tests/ui/generics | |
| parent | c807ac034089e31364baa24e19d5d61cbb657989 (diff) | |
| download | rust-5c2b36a21cabafb1f08e278f4c6ed61753a654cf.tar.gz rust-5c2b36a21cabafb1f08e278f4c6ed61753a654cf.zip | |
Change suggestion message wording
Diffstat (limited to 'tests/ui/generics')
7 files changed, 50 insertions, 50 deletions
diff --git a/tests/ui/generics/bad-mid-path-type-params.stderr b/tests/ui/generics/bad-mid-path-type-params.stderr index 7f4ba781e6a..ba1d48f1210 100644 --- a/tests/ui/generics/bad-mid-path-type-params.stderr +++ b/tests/ui/generics/bad-mid-path-type-params.stderr @@ -9,7 +9,7 @@ note: associated function defined here, with 1 generic parameter: `U` | LL | fn new<U>(x: T, _: U) -> S<T> { | ^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - let _ = S::new::<isize,f64>(1, 1.0); LL + let _ = S::new::<isize,>(1, 1.0); @@ -26,7 +26,7 @@ note: struct defined here, with 0 lifetime parameters | LL | struct S<T> { | ^ -help: remove this lifetime argument +help: remove the lifetime argument | LL - let _ = S::<'a,isize>::new::<f64>(1, 1.0); LL + let _ = S::<,isize>::new::<f64>(1, 1.0); @@ -43,7 +43,7 @@ note: associated function defined here, with 1 generic parameter: `U` | LL | fn new<U>(x: T, y: U) -> Self; | ^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - let _: S2 = Trait::new::<isize,f64>(1, 1.0); LL + let _: S2 = Trait::new::<isize,>(1, 1.0); @@ -60,7 +60,7 @@ note: trait defined here, with 0 lifetime parameters | LL | trait Trait<T> { | ^^^^^ -help: remove this lifetime argument +help: remove the lifetime argument | LL - let _: S2 = Trait::<'a,isize>::new::<f64,f64>(1, 1.0); LL + let _: S2 = Trait::<,isize>::new::<f64,f64>(1, 1.0); @@ -77,7 +77,7 @@ note: associated function defined here, with 1 generic parameter: `U` | LL | fn new<U>(x: T, y: U) -> Self; | ^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - let _: S2 = Trait::<'a,isize>::new::<f64,f64>(1, 1.0); LL + let _: S2 = Trait::<'a,isize>::new::<f64,>(1, 1.0); diff --git a/tests/ui/generics/foreign-generic-mismatch.stderr b/tests/ui/generics/foreign-generic-mismatch.stderr index 7e8e854d642..740963aeec5 100644 --- a/tests/ui/generics/foreign-generic-mismatch.stderr +++ b/tests/ui/generics/foreign-generic-mismatch.stderr @@ -27,7 +27,7 @@ note: function defined here, with 1 lifetime parameter: `'a` | LL | pub fn lt_arg<'a: 'a>() {} | ^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - foreign_generic_mismatch::lt_arg::<'static, 'static>(); LL + foreign_generic_mismatch::lt_arg::<'static, >(); diff --git a/tests/ui/generics/generic-arg-mismatch-recover.stderr b/tests/ui/generics/generic-arg-mismatch-recover.stderr index cb25fa7af40..e8c2a4665f3 100644 --- a/tests/ui/generics/generic-arg-mismatch-recover.stderr +++ b/tests/ui/generics/generic-arg-mismatch-recover.stderr @@ -9,7 +9,7 @@ note: struct defined here, with 1 lifetime parameter: `'a` | LL | struct Foo<'a, T: 'a>(&'a T); | ^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - Foo::<'static, 'static, ()>(&0); LL + Foo::<'static, , ()>(&0); @@ -26,7 +26,7 @@ note: struct defined here, with 1 lifetime parameter: `'a` | LL | struct Bar<'a>(&'a ()); | ^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - Bar::<'static, 'static, ()>(&()); LL + Bar::<'static, , ()>(&()); @@ -43,7 +43,7 @@ note: struct defined here, with 0 generic parameters | LL | struct Bar<'a>(&'a ()); | ^^^ -help: remove this generic argument +help: remove the unnecessary generic argument | LL - Bar::<'static, 'static, ()>(&()); LL + Bar::<'static, 'static, >(&()); diff --git a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr index edbe7a5e139..b0973c477ff 100644 --- a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr @@ -9,7 +9,7 @@ note: struct defined here, with at most 2 generic parameters: `T`, `A` | LL | struct Vec<T, A = Heap>( | ^^^ - -------- -help: remove this generic argument +help: remove the unnecessary generic argument | LL - Vec::<isize, Heap, bool>::new(); LL + Vec::<isize, Heap, >::new(); diff --git a/tests/ui/generics/generic-type-more-params-with-defaults.stderr b/tests/ui/generics/generic-type-more-params-with-defaults.stderr index 27752af1ad6..e83a433b060 100644 --- a/tests/ui/generics/generic-type-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-type-more-params-with-defaults.stderr @@ -9,7 +9,7 @@ note: struct defined here, with at most 2 generic parameters: `T`, `A` | LL | struct Vec<T, A = Heap>( | ^^^ - -------- -help: remove this generic argument +help: remove the unnecessary generic argument | LL - let _: Vec<isize, Heap, bool>; LL + let _: Vec<isize, Heap, >; diff --git a/tests/ui/generics/wrong-number-of-args.rs b/tests/ui/generics/wrong-number-of-args.rs index 95463d1c32c..6524bd538b6 100644 --- a/tests/ui/generics/wrong-number-of-args.rs +++ b/tests/ui/generics/wrong-number-of-args.rs @@ -5,19 +5,19 @@ mod no_generics { type B = Ty<'static>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the unnecessary generics type C = Ty<'static, usize>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument //~| ERROR struct takes 0 generic arguments but 1 generic argument - //~| HELP remove this lifetime argument - //~| HELP remove this generic argument + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic argument type D = Ty<'static, usize, { 0 }>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument //~| ERROR struct takes 0 generic arguments but 2 generic arguments - //~| HELP remove this lifetime argument - //~| HELP remove these generic arguments + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic arguments } mod type_and_type { @@ -35,7 +35,7 @@ mod type_and_type { type D = Ty<usize, String, char>; //~^ ERROR struct takes 2 generic arguments but 3 generic arguments - //~| HELP remove this + //~| HELP remove the type E = Ty<>; //~^ ERROR struct takes 2 generic arguments but 0 generic arguments were supplied @@ -70,8 +70,8 @@ mod lifetime_and_type { type F = Ty<'static, usize, 'static, usize>; //~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments //~| ERROR struct takes 1 generic argument but 2 generic arguments - //~| HELP remove this lifetime argument - //~| HELP remove this generic argument + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic argument } mod type_and_type_and_type { @@ -317,13 +317,13 @@ mod stdlib { type C = HashMap<'static>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the //~| ERROR struct takes at least 2 //~| HELP add missing type D = HashMap<usize, String, char, f64>; //~^ ERROR struct takes at most 3 - //~| HELP remove this + //~| HELP remove the type E = HashMap<>; //~^ ERROR struct takes at least 2 generic arguments but 0 generic arguments @@ -341,7 +341,7 @@ mod stdlib { type C = Result<'static>; //~^ ERROR enum takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the unnecessary generics //~| ERROR enum takes 2 generic arguments but 0 generic arguments //~| HELP add missing diff --git a/tests/ui/generics/wrong-number-of-args.stderr b/tests/ui/generics/wrong-number-of-args.stderr index 9df759bf29b..1363032ad14 100644 --- a/tests/ui/generics/wrong-number-of-args.stderr +++ b/tests/ui/generics/wrong-number-of-args.stderr @@ -178,7 +178,7 @@ note: struct defined here, with 0 lifetime parameters | LL | struct Ty; | ^^ -help: remove these generics +help: remove the unnecessary generics | LL - type B = Ty<'static>; LL + type B = Ty; @@ -195,7 +195,7 @@ note: struct defined here, with 0 lifetime parameters | LL | struct Ty; | ^^ -help: remove this lifetime argument +help: remove the lifetime argument | LL - type C = Ty<'static, usize>; LL + type C = Ty<, usize>; @@ -212,7 +212,7 @@ note: struct defined here, with 0 generic parameters | LL | struct Ty; | ^^ -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type C = Ty<'static, usize>; LL + type C = Ty<'static, >; @@ -229,7 +229,7 @@ note: struct defined here, with 0 lifetime parameters | LL | struct Ty; | ^^ -help: remove this lifetime argument +help: remove the lifetime argument | LL - type D = Ty<'static, usize, { 0 }>; LL + type D = Ty<, usize, { 0 }>; @@ -246,7 +246,7 @@ note: struct defined here, with 0 generic parameters | LL | struct Ty; | ^^ -help: remove these generic arguments +help: remove the unnecessary generic arguments | LL - type D = Ty<'static, usize, { 0 }>; LL + type D = Ty<'static, >; @@ -297,7 +297,7 @@ note: struct defined here, with 2 generic parameters: `A`, `B` | LL | struct Ty<A, B>(A, B); | ^^ - - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type D = Ty<usize, String, char>; LL + type D = Ty<usize, String, >; @@ -378,7 +378,7 @@ note: struct defined here, with 1 lifetime parameter: `'a` | LL | struct Ty<'a, T>(&'a T); | ^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type F = Ty<'static, usize, 'static, usize>; LL + type F = Ty<'static, usize, , usize>; @@ -395,7 +395,7 @@ note: struct defined here, with 1 generic parameter: `T` | LL | struct Ty<'a, T>(&'a T); | ^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type F = Ty<'static, usize, 'static, usize>; LL + type F = Ty<'static, usize, 'static, >; @@ -446,7 +446,7 @@ note: struct defined here, with at most 3 generic parameters: `A`, `B`, `C` | LL | struct Ty<A, B, C = &'static str>(A, B, C); | ^^ - - ---------------- -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type E = Ty<usize, String, char, f64>; LL + type E = Ty<usize, String, char, >; @@ -479,7 +479,7 @@ note: trait defined here, with 0 generic parameters | LL | trait NonGeneric { | ^^^^^^^^^^ -help: remove these generics +help: remove the unnecessary generics | LL - type A = Box<dyn NonGeneric<usize>>; LL + type A = Box<dyn NonGeneric>; @@ -496,7 +496,7 @@ note: trait defined here, with 1 lifetime parameter: `'a` | LL | trait GenericLifetime<'a> { | ^^^^^^^^^^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type C = Box<dyn GenericLifetime<'static, 'static>>; LL + type C = Box<dyn GenericLifetime<'static, >>; @@ -529,7 +529,7 @@ note: trait defined here, with 1 generic parameter: `A` | LL | trait GenericType<A> { | ^^^^^^^^^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type E = Box<dyn GenericType<String, usize>>; LL + type E = Box<dyn GenericType<String, >>; @@ -562,7 +562,7 @@ note: trait defined here, with 0 generic parameters | LL | trait NonGenericAT { | ^^^^^^^^^^^^ -help: remove these generics +help: remove the unnecessary generics | LL - type A = Box<dyn NonGenericAT<usize, AssocTy=()>>; LL + type A = Box<dyn NonGenericAT>; @@ -579,7 +579,7 @@ note: trait defined here, with 1 lifetime parameter: `'a` | LL | trait GenericLifetimeAT<'a> { | ^^^^^^^^^^^^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type B = Box<dyn GenericLifetimeAT<'static, 'static, AssocTy=()>>; LL + type B = Box<dyn GenericLifetimeAT<'static, , AssocTy=()>>; @@ -596,7 +596,7 @@ note: trait defined here, with 0 generic parameters | LL | trait GenericLifetimeAT<'a> { | ^^^^^^^^^^^^^^^^^ -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type C = Box<dyn GenericLifetimeAT<(), AssocTy=()>>; LL + type C = Box<dyn GenericLifetimeAT<, AssocTy=()>>; @@ -629,7 +629,7 @@ note: trait defined here, with 1 generic parameter: `A` | LL | trait GenericTypeAT<A> { | ^^^^^^^^^^^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type B = Box<dyn GenericTypeAT<(), (), AssocTy=()>>; LL + type B = Box<dyn GenericTypeAT<(), , AssocTy=()>>; @@ -646,7 +646,7 @@ note: trait defined here, with 0 lifetime parameters | LL | trait GenericTypeAT<A> { | ^^^^^^^^^^^^^ -help: remove these generics +help: remove the unnecessary generics | LL - type C = Box<dyn GenericTypeAT<'static, AssocTy=()>>; LL + type C = Box<dyn GenericTypeAT>; @@ -711,7 +711,7 @@ note: trait defined here, with 1 lifetime parameter: `'a` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type C = Box<dyn GenericLifetimeTypeAT<'static, 'static, AssocTy=()>>; LL + type C = Box<dyn GenericLifetimeTypeAT<'static, , AssocTy=()>>; @@ -744,7 +744,7 @@ note: trait defined here, with 1 generic parameter: `A` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type E = Box<dyn GenericLifetimeTypeAT<(), (), AssocTy=()>>; LL + type E = Box<dyn GenericLifetimeTypeAT<(), , AssocTy=()>>; @@ -761,7 +761,7 @@ note: trait defined here, with 1 lifetime parameter: `'a` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type F = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), AssocTy=()>>; LL + type F = Box<dyn GenericLifetimeTypeAT<'static, , (), AssocTy=()>>; @@ -778,7 +778,7 @@ note: trait defined here, with 1 generic parameter: `A` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type G = Box<dyn GenericLifetimeTypeAT<'static, (), (), AssocTy=()>>; LL + type G = Box<dyn GenericLifetimeTypeAT<'static, (), , AssocTy=()>>; @@ -795,7 +795,7 @@ note: trait defined here, with 1 lifetime parameter: `'a` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- -help: remove this lifetime argument +help: remove the lifetime argument | LL - type H = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), (), AssocTy=()>>; LL + type H = Box<dyn GenericLifetimeTypeAT<'static, , (), (), AssocTy=()>>; @@ -812,7 +812,7 @@ note: trait defined here, with 1 generic parameter: `A` | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type H = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), (), AssocTy=()>>; LL + type H = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), , AssocTy=()>>; @@ -863,7 +863,7 @@ note: trait defined here, with 2 generic parameters: `A`, `B` | LL | trait GenericTypeTypeAT<A, B> { | ^^^^^^^^^^^^^^^^^ - - -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type C = Box<dyn GenericTypeTypeAT<(), (), (), AssocTy=()>>; LL + type C = Box<dyn GenericTypeTypeAT<(), (), , AssocTy=()>>; @@ -985,7 +985,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp LL | type C = HashMap<'static>; | ^^^^^^^ expected 0 lifetime arguments | -help: remove these generics +help: remove the unnecessary generics | LL - type C = HashMap<'static>; LL + type C = HashMap; @@ -1008,7 +1008,7 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w LL | type D = HashMap<usize, String, char, f64>; | ^^^^^^^ expected at most 3 generic arguments | -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type D = HashMap<usize, String, char, f64>; LL + type D = HashMap<usize, String, char, >; @@ -1055,7 +1055,7 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli LL | type C = Result<'static>; | ^^^^^^ expected 0 lifetime arguments | -help: remove these generics +help: remove the unnecessary generics | LL - type C = Result<'static>; LL + type C = Result; @@ -1078,7 +1078,7 @@ error[E0107]: enum takes 2 generic arguments but 3 generic arguments were suppli LL | type D = Result<usize, String, char>; | ^^^^^^ expected 2 generic arguments | -help: remove this generic argument +help: remove the unnecessary generic argument | LL - type D = Result<usize, String, char>; LL + type D = Result<usize, String, >; |
