-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #130443 - veluca93:legacy-const-generics-fix, r=<try>
Fix ICE when passing DefId-creating args to legacy_const_generics. r? BoxyUwU Fixes #123077 Fixes #129150
- Loading branch information
Showing
7 changed files
with
97 additions
and
21 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
tests/ui/invalid/invalid-rustc_legacy_const_generics-issue-123077.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,20 @@ | ||
const fn foo<const U: i32>() -> i32 { | ||
U | ||
} | ||
|
||
fn main() { | ||
std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, || ()); | ||
//~^ invalid argument to a legacy const generic | ||
|
||
std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, 5 + || ()); | ||
//~^ invalid argument to a legacy const generic | ||
|
||
std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, foo::<{ 1 + 2 }>()); | ||
//~^ invalid argument to a legacy const generic | ||
|
||
std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, foo::<3>()); | ||
//~^ invalid argument to a legacy const generic | ||
|
||
std::arch::x86_64::_mm_blend_ps(1, 2, &const {}); | ||
//~^ invalid argument to a legacy const generic | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/ui/invalid/invalid-rustc_legacy_const_generics-issue-123077.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,26 @@ | ||
error: invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items | ||
--> $DIR/invalid-rustc_legacy_const_generics-issue-123077.rs:6:55 | ||
| | ||
LL | std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, || ()); | ||
| ^^^^^ | ||
|
||
error: invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items | ||
--> $DIR/invalid-rustc_legacy_const_generics-issue-123077.rs:9:59 | ||
| | ||
LL | std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, 5 + || ()); | ||
| ^^^^^ | ||
|
||
error: invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items | ||
--> $DIR/invalid-rustc_legacy_const_generics-issue-123077.rs:12:61 | ||
| | ||
LL | std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, foo::<{ 1 + 2 }>()); | ||
| ^^^^^^^^^ | ||
|
||
error: invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items | ||
--> $DIR/invalid-rustc_legacy_const_generics-issue-123077.rs:15:61 | ||
| | ||
LL | std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, foo::<3>()); | ||
| ^ | ||
|
||
error: aborting due to 4 previous errors | ||
|