f2c1265483
This is a very large commit since a lot needs to be changed in order to make the tests pass. The salient changes are: - `ConstArgKind` gets a new `Path` variant, and all const params are now represented using it. Non-param paths still use `ConstArgKind::Anon` to prevent this change from getting too large, but they will soon use the `Path` variant too. - `ConstArg` gets a distinct `hir_id` field and its own variant in `hir::Node`. This affected many parts of the compiler that expected the parent of an `AnonConst` to be the containing context (e.g., an array repeat expression). They have been changed to check the "grandparent" where necessary. - Some `ast::AnonConst`s now have their `DefId`s created in rustc_ast_lowering rather than `DefCollector`. This is because in some cases they will end up becoming a `ConstArgKind::Path` instead, which has no `DefId`. We have to solve this in a hacky way where we guess whether the `AnonConst` could end up as a path const since we can't know for sure until after name resolution (`N` could refer to a free const or a nullary struct). If it has no chance as being a const param, then we create a `DefId` in `DefCollector` -- otherwise we decide during ast_lowering. This will have to be updated once all path consts use `ConstArgKind::Path`. - We explicitly use `ConstArgHasType` for array lengths, rather than implicitly relying on anon const type feeding -- this is due to the addition of `ConstArgKind::Path`. - Some tests have their outputs changed, but the changes are for the most part minor (including removing duplicate or almost-duplicate errors). One test now ICEs, but it is for an incomplete, unstable feature and is now tracked at #127009.
198 lines
4.5 KiB
Plaintext
198 lines
4.5 KiB
Plaintext
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:9:8
|
|
|
|
|
LL | struct A {
|
|
| ^
|
|
|
|
|
= note: `-D clippy::min-ident-chars` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::min_ident_chars)]`
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:10:5
|
|
|
|
|
LL | a: u32,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:12:5
|
|
|
|
|
LL | A: u32,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:13:5
|
|
|
|
|
LL | I: u32,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:16:8
|
|
|
|
|
LL | struct B(u32);
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:18:8
|
|
|
|
|
LL | struct O {
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:19:5
|
|
|
|
|
LL | o: u32,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:24:6
|
|
|
|
|
LL | enum C {
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:25:5
|
|
|
|
|
LL | D,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:26:5
|
|
|
|
|
LL | E,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:27:5
|
|
|
|
|
LL | F,
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:41:11
|
|
|
|
|
LL | const A: u32 = 0;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:42:10
|
|
|
|
|
LL | type A;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:43:8
|
|
|
|
|
LL | fn a() {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:57:9
|
|
|
|
|
LL | let h = 1;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:58:9
|
|
|
|
|
LL | let e = 2;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:59:9
|
|
|
|
|
LL | let l = 3;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:60:9
|
|
|
|
|
LL | let l = 4;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:61:9
|
|
|
|
|
LL | let o = 6;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:65:10
|
|
|
|
|
LL | let (h, o, w) = (1, 2, 3);
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:65:13
|
|
|
|
|
LL | let (h, o, w) = (1, 2, 3);
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:66:10
|
|
|
|
|
LL | for (a, (r, e)) in (0..1000).enumerate().enumerate() {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:66:14
|
|
|
|
|
LL | for (a, (r, e)) in (0..1000).enumerate().enumerate() {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:66:17
|
|
|
|
|
LL | for (a, (r, e)) in (0..1000).enumerate().enumerate() {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:68:16
|
|
|
|
|
LL | while let (d, o, _i, n, g) = (true, true, false, false, true) {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:68:19
|
|
|
|
|
LL | while let (d, o, _i, n, g) = (true, true, false, false, true) {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:68:29
|
|
|
|
|
LL | while let (d, o, _i, n, g) = (true, true, false, false, true) {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:72:9
|
|
|
|
|
LL | let o = 1;
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:73:9
|
|
|
|
|
LL | let o = O { o };
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:87:4
|
|
|
|
|
LL | fn b() {}
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:88:21
|
|
|
|
|
LL | fn wrong_pythagoras(a: f32, b: f32) -> f32 {
|
|
| ^
|
|
|
|
error: this ident consists of a single char
|
|
--> tests/ui/min_ident_chars.rs:88:29
|
|
|
|
|
LL | fn wrong_pythagoras(a: f32, b: f32) -> f32 {
|
|
| ^
|
|
|
|
error: aborting due to 32 previous errors
|
|
|