Rollup merge of #119505 - fmease:no-host-param-for-trait-fns, r=fee1-dead

Don't synthesize host effect params for trait associated functions marked const

Fixes #113378.

r? fee1-dead or compiler
This commit is contained in:
León Orell Valerian Liehr
2024-01-03 16:08:30 +01:00
committed by GitHub
17 changed files with 285 additions and 64 deletions

View File

@@ -6,6 +6,10 @@ Erroneous code example:
trait Foo {
const fn bar() -> u32; // error!
}
impl Foo for () {
const fn bar() -> u32 { 0 } // error!
}
```
Trait methods cannot be declared `const` by design. For more information, see