1
Fork 0

Don't synthesize host effect args inside trait object types

This commit is contained in:
León Orell Valerian Liehr 2024-01-03 09:24:42 +01:00
parent e51e98dde6
commit 695a02e0d8
No known key found for this signature in database
GPG key ID: D17A07215F68E713
3 changed files with 47 additions and 15 deletions

View file

@ -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