-
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.
Fix ICE when passing DefId-creating args to legacy_const_generics.
- Loading branch information
Showing
7 changed files
with
105 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.
22 changes: 22 additions & 0 deletions
22
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,22 @@ | ||
//@ only-x86_64 | ||
|
||
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(loop {}, loop {}, &const {}); | ||
//~^ invalid argument to a legacy const generic | ||
} |
32 changes: 32 additions & 0 deletions
32
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,32 @@ | ||
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: 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:18:56 | ||
| | ||
LL | std::arch::x86_64::_mm_blend_ps(loop {}, loop {}, &const {}); | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to 5 previous errors | ||
|