Use the same collection order as check_mod_type_wf

This commit is contained in:
Oli Scherer 2024-02-23 11:09:57 +00:00
parent de3fb8d429
commit ebf1b92417
10 changed files with 211 additions and 211 deletions

View file

@ -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)))
});

View file

@ -61,6 +61,27 @@ help: use fully-qualified syntax to disambiguate
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:30:20
|
LL | type Color;
| ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
| ---------- ambiguous `Color` from `Box`
...
LL | fn d(&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 { }
| ~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
|
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:35:20
|
@ -103,27 +124,6 @@ help: use fully-qualified syntax to disambiguate
LL | fn f(&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
|
LL | type Color;
| ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
| ---------- ambiguous `Color` from `Box`
...
LL | fn d(&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 { }
| ~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { }
| ~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0221`.

View file

@ -1,14 +1,3 @@
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
|
LL | fn some_method(&self, arg: I::A);
| ^^^^
|
help: use a fully qualified path with inferred lifetimes
|
LL | fn some_method(&self, arg: <I as Foo<&isize>>::A);
| ~~~~~~~~~~~~~~~~~~~~
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
|
@ -20,6 +9,17 @@ help: use a fully qualified path with inferred lifetimes
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:13:32
|
LL | fn some_method(&self, arg: I::A);
| ^^^^
|
help: use a fully qualified path with inferred lifetimes
|
LL | fn some_method(&self, arg: <I as Foo<&isize>>::A);
| ~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0212`.

View file

@ -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`.

View file

@ -7,24 +7,6 @@ LL | #![feature(fn_delegation)]
= note: see issue #118212 <https://github.com/rust-lang/rust/issues/118212> for more information
= 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
|
@ -97,6 +79,24 @@ LL | fn foo(&self, x: i32) -> i32 { x }
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
|

View file

@ -1,19 +1,3 @@
error[E0107]: missing generics for associated type `Trait::Assoc`
--> $DIR/elided-in-expr-position.rs:9:26
|
LL | fn g(&self) -> Self::Assoc;
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> $DIR/elided-in-expr-position.rs:4:10
|
LL | type Assoc<'a> where Self: 'a;
| ^^^^^ --
help: add missing lifetime argument
|
LL | fn g(&self) -> Self::Assoc<'_>;
| ++++
error[E0107]: missing generics for associated type `Trait::Assoc`
--> $DIR/elided-in-expr-position.rs:31:26
|
@ -30,6 +14,22 @@ help: add missing lifetime argument
LL | fn g(&self) -> Self::Assoc<'_> {
| ++++
error[E0107]: missing generics for associated type `Trait::Assoc`
--> $DIR/elided-in-expr-position.rs:9:26
|
LL | fn g(&self) -> Self::Assoc;
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> $DIR/elided-in-expr-position.rs:4:10
|
LL | type Assoc<'a> where Self: 'a;
| ^^^^^ --
help: add missing lifetime argument
|
LL | fn g(&self) -> Self::Assoc<'_>;
| ++++
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0107`.

View file

@ -1,12 +1,3 @@
error: `#[target_feature(..)]` cannot be applied to safe trait method
--> $DIR/trait-impl.rs:22:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method
LL |
LL | fn foo(&self) {}
| ------------- not an `unsafe` function
error: `#[target_feature(..)]` cannot be applied to safe trait method
--> $DIR/trait-impl.rs:13:5
|
@ -16,5 +7,14 @@ LL |
LL | fn foo(&self) {}
| ------------- not an `unsafe` function
error: `#[target_feature(..)]` cannot be applied to safe trait method
--> $DIR/trait-impl.rs:22:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method
LL |
LL | fn foo(&self) {}
| ------------- not an `unsafe` function
error: aborting due to 2 previous errors

View file

@ -1,15 +1,3 @@
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/type-placeholder-fn-in-const.rs:4:25
|
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:4:25
|
LL | const TEST: fn() -> _;
| ^ 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
|
@ -22,6 +10,18 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
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:4:25
|
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:4:25
|
LL | const TEST: fn() -> _;
| ^ not allowed in type signatures
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0121`.

View file

@ -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
|

View file

@ -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