Don't synthesize host effect args inside trait object types
This commit is contained in:
parent
e51e98dde6
commit
695a02e0d8
3 changed files with 47 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
#![feature(const_trait_impl)]
|
||||
#![feature(const_trait_impl, effects)]
|
||||
// edition: 2021
|
||||
|
||||
#[const_trait]
|
||||
|
@ -6,4 +6,12 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue