forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#132997 - GuillaumeGomez:rollup-8j97gl3, r=Gui…
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2) - rust-lang#132842 (ABI checks: add support for tier2 arches) - rust-lang#132965 (allow CFGuard on windows-gnullvm) - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs) - rust-lang#132971 (Handle infer vars in anon consts on stable) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
17 changed files
with
252 additions
and
66 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
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: 21 additions & 0 deletions
21
tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.rs
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Regression test for #132955 checking that we handle anon consts with | ||
// inference variables in their generic arguments correctly. | ||
// | ||
// This arose via diagnostics where we would have some failing goal such | ||
// as `[u8; AnonConst<Self>]: PartialEq<Self::A>`, then as part of diagnostics | ||
// we would replace all generic parameters with inference vars which would yield | ||
// a self type of `[u8; AnonConst<?x>]` and then attempt to normalize `AnonConst<?x>`. | ||
|
||
pub trait T { | ||
type A; | ||
const P: Self::A; | ||
|
||
fn a() { | ||
[0u8; std::mem::size_of::<Self::A>()] == Self::P; | ||
//~^ ERROR: can't compare | ||
//~| ERROR: constant expression depends on a generic parameter | ||
//~| ERROR: constant expression depends on a generic parameter | ||
} | ||
} | ||
|
||
fn main() {} |
31 changes: 31 additions & 0 deletions
31
tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/failing_goal_with_repeat_expr_anon_const.rs:14:15 | ||
| | ||
LL | [0u8; std::mem::size_of::<Self::A>()] == Self::P; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: constant expression depends on a generic parameter | ||
--> $DIR/failing_goal_with_repeat_expr_anon_const.rs:14:47 | ||
| | ||
LL | [0u8; std::mem::size_of::<Self::A>()] == Self::P; | ||
| ^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error[E0277]: can't compare `[u8; std::mem::size_of::<Self::A>()]` with `<Self as T>::A` | ||
--> $DIR/failing_goal_with_repeat_expr_anon_const.rs:14:47 | ||
| | ||
LL | [0u8; std::mem::size_of::<Self::A>()] == Self::P; | ||
| ^^ no implementation for `[u8; std::mem::size_of::<Self::A>()] == <Self as T>::A` | ||
| | ||
= help: the trait `PartialEq<<Self as T>::A>` is not implemented for `[u8; std::mem::size_of::<Self::A>()]` | ||
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | ||
| | ||
LL | pub trait T where [u8; std::mem::size_of::<Self::A>()]: PartialEq<<Self as T>::A> { | ||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Oops, something went wrong.