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:
commit
8bce6fc35e
17 changed files with 285 additions and 64 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue