diff options
10 files changed, 180 insertions, 180 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 73138340d78..c621867e60a 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -58,12 +58,12 @@ fn collect_mod_item_types(tcx: TyCtxt<'_>, module_def_id: LocalModDefId) { let items = tcx.hir_module_items(module_def_id); let hir = tcx.hir(); let _ = items.par_items(|item| Ok(CollectItemTypesVisitor { tcx }.visit_item(hir.item(item)))); - let _ = items.par_trait_items(|item| { - Ok(CollectItemTypesVisitor { tcx }.visit_trait_item(hir.trait_item(item))) - }); let _ = items.par_impl_items(|item| { Ok(CollectItemTypesVisitor { tcx }.visit_impl_item(hir.impl_item(item))) }); + let _ = items.par_trait_items(|item| { + Ok(CollectItemTypesVisitor { tcx }.visit_trait_item(hir.trait_item(item))) + }); let _ = items.par_foreign_items(|item| { Ok(CollectItemTypesVisitor { tcx }.visit_foreign_item(hir.foreign_item(item))) }); diff --git a/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr index df01e1e3768..33b7445daf1 100644 --- a/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr +++ b/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr @@ -62,7 +62,7 @@ LL | fn c<C>(_: <C as Vehicle>::Color) where C : Vehicle, C : Box { | ~~~~~~~~~~~~~~~~ error[E0221]: ambiguous associated type `Color` in bounds of `X` - --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20 + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20 | LL | type Color; | ---------- ambiguous `Color` from `Vehicle` @@ -70,20 +70,20 @@ LL | type Color; LL | type Color; | ---------- ambiguous `Color` from `Box` ... -LL | fn e(&self, _: X::Color) where X : Box; +LL | fn d(&self, _: X::Color) where X : Box { } | ^^^^^^^^ ambiguous associated type `Color` | help: use fully-qualified syntax to disambiguate | -LL | fn e(&self, _: <X as Box>::Color) where X : Box; +LL | fn d(&self, _: <X as Box>::Color) where X : Box { } | ~~~~~~~~~~~~ help: use fully-qualified syntax to disambiguate | -LL | fn e(&self, _: <X as Vehicle>::Color) where X : Box; +LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { } | ~~~~~~~~~~~~~~~~ error[E0221]: ambiguous associated type `Color` in bounds of `X` - --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20 + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20 | LL | type Color; | ---------- ambiguous `Color` from `Vehicle` @@ -91,20 +91,20 @@ LL | type Color; LL | type Color; | ---------- ambiguous `Color` from `Box` ... -LL | fn f(&self, _: X::Color) where X : Box { } +LL | fn e(&self, _: X::Color) where X : Box; | ^^^^^^^^ ambiguous associated type `Color` | help: use fully-qualified syntax to disambiguate | -LL | fn f(&self, _: <X as Box>::Color) where X : Box { } +LL | fn e(&self, _: <X as Box>::Color) where X : Box; | ~~~~~~~~~~~~ help: use fully-qualified syntax to disambiguate | -LL | fn f(&self, _: <X as Vehicle>::Color) where X : Box { } +LL | fn e(&self, _: <X as Vehicle>::Color) where X : Box; | ~~~~~~~~~~~~~~~~ error[E0221]: ambiguous associated type `Color` in bounds of `X` - --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20 + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20 | LL | type Color; | ---------- ambiguous `Color` from `Vehicle` @@ -112,16 +112,16 @@ LL | type Color; LL | type Color; | ---------- ambiguous `Color` from `Box` ... -LL | fn d(&self, _: X::Color) where X : Box { } +LL | fn f(&self, _: X::Color) where X : Box { } | ^^^^^^^^ ambiguous associated type `Color` | help: use fully-qualified syntax to disambiguate | -LL | fn d(&self, _: <X as Box>::Color) where X : Box { } +LL | fn f(&self, _: <X as Box>::Color) where X : Box { } | ~~~~~~~~~~~~ help: use fully-qualified syntax to disambiguate | -LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { } +LL | fn f(&self, _: <X as Vehicle>::Color) where X : Box { } | ~~~~~~~~~~~~~~~~ error: aborting due to 6 previous errors diff --git a/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr b/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr index 48433b15286..a6ed44f0661 100644 --- a/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr +++ b/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr @@ -1,24 +1,24 @@ error[E0212]: cannot use the associated type of a trait with uninferred generic parameters - --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:13:32 + --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:32:24 | -LL | fn some_method(&self, arg: I::A); - | ^^^^ +LL | fn mango(&self) -> X::Assoc { + | ^^^^^^^^ | help: use a fully qualified path with inferred lifetimes | -LL | fn some_method(&self, arg: <I as Foo<&isize>>::A); - | ~~~~~~~~~~~~~~~~~~~~ +LL | fn mango(&self) -> <X as Banana<'_>>::Assoc { + | ~~~~~~~~~~~~~~~~~~~ error[E0212]: cannot use the associated type of a trait with uninferred generic parameters - --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:32:24 + --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:13:32 | -LL | fn mango(&self) -> X::Assoc { - | ^^^^^^^^ +LL | fn some_method(&self, arg: I::A); + | ^^^^ | help: use a fully qualified path with inferred lifetimes | -LL | fn mango(&self) -> <X as Banana<'_>>::Assoc { - | ~~~~~~~~~~~~~~~~~~~ +LL | fn some_method(&self, arg: <I as Foo<&isize>>::A); + | ~~~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr index b32018a6a2d..fcac95732d1 100644 --- a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr +++ b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr @@ -74,26 +74,6 @@ LL | static TY_STATIC_MIXED: Bar<_, _> = Bar::<i32, 3>(0); | not allowed in type signatures | help: replace with the correct type: `Bar<i32, 3>` -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/in-signature.rs:35:21 - | -LL | const ARR: [u8; _]; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/in-signature.rs:39:25 - | -LL | const ARR: Bar<i32, _>; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/in-signature.rs:43:20 - | -LL | const ARR: Bar<_, _>; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types --> $DIR/in-signature.rs:51:23 | @@ -114,6 +94,26 @@ LL | type Assoc = Bar<_, _>; | | | not allowed in type signatures +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants + --> $DIR/in-signature.rs:35:21 + | +LL | const ARR: [u8; _]; + | ^ not allowed in type signatures + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants + --> $DIR/in-signature.rs:39:25 + | +LL | const ARR: Bar<i32, _>; + | ^ not allowed in type signatures + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants + --> $DIR/in-signature.rs:43:20 + | +LL | const ARR: Bar<_, _>; + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + error: aborting due to 15 previous errors For more information about this error, try `rustc --explain E0121`. diff --git a/tests/ui/delegation/not-supported.stderr b/tests/ui/delegation/not-supported.stderr index f235767d50a..a19169db8d2 100644 --- a/tests/ui/delegation/not-supported.stderr +++ b/tests/ui/delegation/not-supported.stderr @@ -8,24 +8,6 @@ LL | #![feature(fn_delegation)] = note: `#[warn(incomplete_features)]` on by default error: delegation with early bound generics is not supported yet - --> $DIR/not-supported.rs:16:29 - | -LL | fn bar(&self, x: T) -> T { x } - | ------------------------ callee defined here -... -LL | reuse GenericTrait::bar; - | ^^^ - -error: delegation with early bound generics is not supported yet - --> $DIR/not-supported.rs:18:29 - | -LL | fn bar1() {} - | --------- callee defined here -... -LL | reuse GenericTrait::bar1; - | ^^^^ - -error: delegation with early bound generics is not supported yet --> $DIR/not-supported.rs:29:39 | LL | fn bar(&self, x: T) -> T { x } @@ -98,6 +80,24 @@ LL | reuse Trait::foo { &self.0 } | ^^^ error: delegation with early bound generics is not supported yet + --> $DIR/not-supported.rs:16:29 + | +LL | fn bar(&self, x: T) -> T { x } + | ------------------------ callee defined here +... +LL | reuse GenericTrait::bar; + | ^^^ + +error: delegation with early bound generics is not supported yet + --> $DIR/not-supported.rs:18:29 + | +LL | fn bar1() {} + | --------- callee defined here +... +LL | reuse GenericTrait::bar1; + | ^^^^ + +error: delegation with early bound generics is not supported yet --> $DIR/not-supported.rs:74:21 | LL | pub fn opaque_arg(_: impl Trait) -> i32 { 0 } diff --git a/tests/ui/generic-associated-types/elided-in-expr-position.stderr b/tests/ui/generic-associated-types/elided-in-expr-position.stderr index 842b23bd49d..ef54f9180ab 100644 --- a/tests/ui/generic-associated-types/elided-in-expr-position.stderr +++ b/tests/ui/generic-associated-types/elided-in-expr-position.stderr @@ -1,7 +1,7 @@ error[E0107]: missing generics for associated type `Trait::Assoc` - --> $DIR/elided-in-expr-position.rs:9:26 + --> $DIR/elided-in-expr-position.rs:31:26 | -LL | fn g(&self) -> Self::Assoc; +LL | fn g(&self) -> Self::Assoc { | ^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` @@ -11,13 +11,13 @@ LL | type Assoc<'a> where Self: 'a; | ^^^^^ -- help: add missing lifetime argument | -LL | fn g(&self) -> Self::Assoc<'_>; +LL | fn g(&self) -> Self::Assoc<'_> { | ++++ error[E0107]: missing generics for associated type `Trait::Assoc` - --> $DIR/elided-in-expr-position.rs:31:26 + --> $DIR/elided-in-expr-position.rs:9:26 | -LL | fn g(&self) -> Self::Assoc { +LL | fn g(&self) -> Self::Assoc; | ^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` @@ -27,7 +27,7 @@ LL | type Assoc<'a> where Self: 'a; | ^^^^^ -- help: add missing lifetime argument | -LL | fn g(&self) -> Self::Assoc<'_> { +LL | fn g(&self) -> Self::Assoc<'_>; | ++++ error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr index eb0f18edd34..00efbb52f15 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr @@ -1,5 +1,5 @@ error: `#[target_feature(..)]` cannot be applied to safe trait method - --> $DIR/trait-impl.rs:22:5 + --> $DIR/trait-impl.rs:13:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method @@ -8,7 +8,7 @@ LL | fn foo(&self) {} | ------------- not an `unsafe` function error: `#[target_feature(..)]` cannot be applied to safe trait method - --> $DIR/trait-impl.rs:13:5 + --> $DIR/trait-impl.rs:22:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method diff --git a/tests/ui/typeck/type-placeholder-fn-in-const.stderr b/tests/ui/typeck/type-placeholder-fn-in-const.stderr index 302359d2500..27d9c483548 100644 --- a/tests/ui/typeck/type-placeholder-fn-in-const.stderr +++ b/tests/ui/typeck/type-placeholder-fn-in-const.stderr @@ -1,25 +1,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/type-placeholder-fn-in-const.rs:4:25 + --> $DIR/type-placeholder-fn-in-const.rs:10:25 | -LL | const TEST: fn() -> _; +LL | const TEST: fn() -> _ = 42; | ^ not allowed in type signatures error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/type-placeholder-fn-in-const.rs:4:25 + --> $DIR/type-placeholder-fn-in-const.rs:10:25 | -LL | const TEST: fn() -> _; +LL | const TEST: fn() -> _ = 42; | ^ not allowed in type signatures error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/type-placeholder-fn-in-const.rs:10:25 + --> $DIR/type-placeholder-fn-in-const.rs:4:25 | -LL | const TEST: fn() -> _ = 42; +LL | const TEST: fn() -> _; | ^ not allowed in type signatures error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/type-placeholder-fn-in-const.rs:10:25 + --> $DIR/type-placeholder-fn-in-const.rs:4:25 | -LL | const TEST: fn() -> _ = 42; +LL | const TEST: fn() -> _; | ^ not allowed in type signatures error: aborting due to 4 previous errors diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr index c102926fcf5..ab3c90bea30 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr @@ -449,103 +449,6 @@ note: however, the inferred type `Map<Filter<Range<i32>, {closure@typeck_type_pl LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:140:31 - | -LL | fn method_test1(&self, x: _); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test1<T>(&self, x: T); - | +++ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:142:31 - | -LL | fn method_test2(&self, x: _) -> _; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test2<T>(&self, x: T) -> T; - | +++ ~ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:144:31 - | -LL | fn method_test3(&self) -> _; - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test3<T>(&self) -> T; - | +++ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:146:26 - | -LL | fn assoc_fn_test1(x: _); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test1<T>(x: T); - | +++ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:148:26 - | -LL | fn assoc_fn_test2(x: _) -> _; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test2<T>(x: T) -> T; - | +++ ~ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:150:28 - | -LL | fn assoc_fn_test3() -> _; - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test3<T>() -> T; - | +++ ~ - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:190:14 - | -LL | type B = _; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/typeck_type_placeholder_item.rs:192:14 - | -LL | const C: _; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/typeck_type_placeholder_item.rs:194:14 - | -LL | const D: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:197:26 - | -LL | type F: std::ops::Fn(_); - | ^ not allowed in type signatures - error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:41:24 | @@ -657,6 +560,103 @@ LL | const D: _ = 42; | not allowed in type signatures | help: replace with the correct type: `i32` +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:140:31 + | +LL | fn method_test1(&self, x: _); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test1<T>(&self, x: T); + | +++ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:142:31 + | +LL | fn method_test2(&self, x: _) -> _; + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test2<T>(&self, x: T) -> T; + | +++ ~ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:144:31 + | +LL | fn method_test3(&self) -> _; + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test3<T>(&self) -> T; + | +++ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:146:26 + | +LL | fn assoc_fn_test1(x: _); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test1<T>(x: T); + | +++ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:148:26 + | +LL | fn assoc_fn_test2(x: _) -> _; + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test2<T>(x: T) -> T; + | +++ ~ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:150:28 + | +LL | fn assoc_fn_test3() -> _; + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test3<T>() -> T; + | +++ ~ + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:190:14 + | +LL | type B = _; + | ^ not allowed in type signatures + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants + --> $DIR/typeck_type_placeholder_item.rs:192:14 + | +LL | const C: _; + | ^ not allowed in type signatures + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants + --> $DIR/typeck_type_placeholder_item.rs:194:14 + | +LL | const D: _ = 42; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:197:26 + | +LL | type F: std::ops::Fn(_); + | ^ not allowed in type signatures + error[E0046]: not all trait items implemented, missing: `F` --> $DIR/typeck_type_placeholder_item.rs:200:1 | diff --git a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr index b0d4ed8272b..32585e2937b 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr @@ -38,18 +38,18 @@ LL | const TEST4: fn() -> _ = 42; | ^ not allowed in type signatures error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/typeck_type_placeholder_item_help.rs:18:18 + --> $DIR/typeck_type_placeholder_item_help.rs:25:18 | -LL | const TEST5: _ = 42; +LL | const TEST6: _ = 13; | ^ | | | not allowed in type signatures | help: replace with the correct type: `i32` error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants - --> $DIR/typeck_type_placeholder_item_help.rs:25:18 + --> $DIR/typeck_type_placeholder_item_help.rs:18:18 | -LL | const TEST6: _ = 13; +LL | const TEST5: _ = 42; | ^ | | | not allowed in type signatures |
