-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent ICE on
~const
trait bounds involving non-const traits
Co-authored-by: Deadbeef <[email protected]>
- Loading branch information
Showing
4 changed files
with
28 additions
and
9 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
9 changes: 9 additions & 0 deletions
9
tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-on-non-const-trait.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,9 @@ | ||
// Regression test for issue #117244. | ||
#![feature(const_trait_impl, effects)] | ||
|
||
trait NonConst {} | ||
|
||
const fn perform<T: ~const NonConst>() {} | ||
//~^ ERROR ~const can only be applied to `#[const_trait]` traits | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-on-non-const-trait.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,8 @@ | ||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/tilde-const-on-non-const-trait.rs:6:28 | ||
| | ||
LL | const fn perform<T: ~const NonConst>() {} | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|