-
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.
Don't synthesize host effect args inside trait object types
- Loading branch information
Showing
3 changed files
with
47 additions
and
15 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
10 changes: 9 additions & 1 deletion
10
tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
#![feature(const_trait_impl)] | ||
#![feature(const_trait_impl, effects)] | ||
// edition: 2021 | ||
|
||
#[const_trait] | ||
trait Trait {} | ||
|
||
fn main() { | ||
let _: &dyn const Trait; //~ ERROR const trait bounds are not allowed in trait object types | ||
let _: &dyn ~const Trait; //~ ERROR `~const` is not allowed here | ||
} | ||
|
||
// Regression test for issue #119525. | ||
trait NonConst {} | ||
const fn handle(_: &dyn const NonConst) {} | ||
//~^ ERROR const trait bounds are not allowed in trait object types | ||
const fn take(_: &dyn ~const NonConst) {} | ||
//~^ ERROR `~const` is not allowed here |
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