-
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
5 changed files
with
94 additions
and
2 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
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
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 | ||
} |
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 | ||
|