Skip to content

Commit aa97acc

Browse files
committed
Relocate qualified/qualified-path-params to
typeck/qualified-path-params.rs merged test removed ui/qualified directory
1 parent 8e74c6b commit aa97acc

File tree

6 files changed

+34
-61
lines changed

6 files changed

+34
-61
lines changed

tests/ui/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,12 +1125,6 @@ A large category about function and type public/private visibility, and its impa
11251125

11261126
**FIXME**: merge with `tests/ui/privacy/`.
11271127

1128-
## `tests/ui/qualified/`
1129-
1130-
Contains few tests on qualified paths where a type parameter is provided at the end: `type A = <S as Tr>::A::f<u8>;`. The tests check if this fails during type checking, not parsing.
1131-
1132-
**FIXME**: Should be rehomed to `ui/typeck`.
1133-
11341128
## `tests/ui/query-system/`
11351129

11361130
Tests on Rust methods and functions which use the query system, such as `std::mem::size_of`. These compute information about the current runtime and return it. See [Query system | rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/query.html).

tests/ui/qualified/qualified-path-params-2.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/ui/qualified/qualified-path-params-2.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ui/qualified/qualified-path-params.stderr

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/ui/qualified/qualified-path-params.rs renamed to tests/ui/typeck/qualified-path-params.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ impl S {
1515
fn f<T>() {}
1616
}
1717

18+
type A = <S as Tr>::A::f<u8>;
19+
//~^ ERROR ambiguous associated type
20+
1821
fn main() {
1922
match 10 {
2023
<S as Tr>::A::f::<u8> => {}
2124
//~^ ERROR expected unit struct, unit variant or constant, found associated function
22-
0 ..= <S as Tr>::A::f::<u8> => {}
25+
0..=<S as Tr>::A::f::<u8> => {}
2326
//~^ ERROR only `char` and numeric types are allowed in range
2427
}
2528
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error[E0223]: ambiguous associated type
2+
--> $DIR/qualified-path-params.rs:18:10
3+
|
4+
LL | type A = <S as Tr>::A::f<u8>;
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
help: if there were a trait named `Example` with associated type `f` implemented for `<S as Tr>::A`, you could use the fully-qualified path
8+
|
9+
LL - type A = <S as Tr>::A::f<u8>;
10+
LL + type A = <<S as Tr>::A as Example>::f<u8>;
11+
|
12+
13+
error[E0533]: expected unit struct, unit variant or constant, found associated function `<<S as Tr>::A>::f<u8>`
14+
--> $DIR/qualified-path-params.rs:23:9
15+
|
16+
LL | <S as Tr>::A::f::<u8> => {}
17+
| ^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant
18+
19+
error[E0029]: only `char` and numeric types are allowed in range patterns
20+
--> $DIR/qualified-path-params.rs:25:13
21+
|
22+
LL | 0..=<S as Tr>::A::f::<u8> => {}
23+
| - ^^^^^^^^^^^^^^^^^^^^^ this is of type `fn() {S::f::<u8>}` but it should be `char` or numeric
24+
| |
25+
| this is of type `{integer}`
26+
27+
error: aborting due to 3 previous errors
28+
29+
Some errors have detailed explanations: E0029, E0223, E0533.
30+
For more information about an error, try `rustc --explain E0029`.

0 commit comments

Comments
 (0)