-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
min_generic_const_args
and gate new const path lowering with it
- Loading branch information
Showing
44 changed files
with
383 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
error: the constant `1` is not of type `usize` | ||
--> $DIR/bad-generic-in-copy-impl.rs:4:8 | ||
error[E0308]: mismatched types | ||
--> $DIR/bad-generic-in-copy-impl.rs:3:13 | ||
| | ||
LL | x: [u8; SIZE], | ||
| ^^^^^^^^^^ expected `usize`, found `u32` | ||
| ^^^^ expected `usize`, found `u32` | ||
|
||
error[E0204]: the trait `Copy` cannot be implemented for this type | ||
--> $DIR/bad-generic-in-copy-impl.rs:1:10 | ||
error[E0308]: mismatched types | ||
--> $DIR/bad-generic-in-copy-impl.rs:3:13 | ||
| | ||
LL | #[derive(Copy, Clone)] | ||
| ^^^^ | ||
... | ||
LL | x: [u8; SIZE], | ||
| ------------- this field does not implement `Copy` | ||
| ^^^^ expected `usize`, found `u32` | ||
| | ||
note: the `Copy` impl for `[u8; 1]` requires that `the constant `1` has type `usize`` | ||
--> $DIR/bad-generic-in-copy-impl.rs:4:8 | ||
| | ||
LL | x: [u8; SIZE], | ||
| ^^^^^^^^^^ | ||
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: the constant `1` is not of type `usize` | ||
--> $DIR/bad-generic-in-copy-impl.rs:4:5 | ||
| | ||
LL | #[derive(Copy, Clone)] | ||
| ----- in this derive macro expansion | ||
... | ||
LL | x: [u8; SIZE], | ||
| ^^^^^^^^^^^^^ expected `usize`, found `u32` | ||
| | ||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0204`. | ||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletions
21
tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
error[E0741]: `U` must implement `ConstParamTy` to be used as the type of a const generic parameter | ||
--> $DIR/adt_wf_hang.rs:9:19 | ||
error[E0275]: overflow evaluating the requirement `S<{ U }> well-formed` | ||
--> $DIR/adt_wf_hang.rs:11:5 | ||
| | ||
LL | struct S<const N: U>() | ||
| ^ | ||
| | ||
help: add `#[derive(ConstParamTy)]` to the struct | ||
LL | S<{ U }>:; | ||
| ^^^^^^^^ | ||
| | ||
LL + #[derive(ConstParamTy)] | ||
LL | struct U; | ||
note: required by a bound in `S` | ||
--> $DIR/adt_wf_hang.rs:11:5 | ||
| | ||
LL | struct S<const N: U>() | ||
| - required by a bound in this struct | ||
LL | where | ||
LL | S<{ U }>:; | ||
| ^^^^^^^^ required by this bound in `S` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0741`. | ||
For more information about this error, try `rustc --explain E0275`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.