Closed dtolnay closed 9 months ago
The most recent nightly (nightly-2022-08-21) started producing the following suggestion:
error[E0015]: cannot call non-const fn `Thing::new` in statics --> tests/ui/submit-nonconst.rs:11:20 | 11 | inventory::submit!(Thing::new()); | ^^^^^^^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants + = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
This is basically never going to be helpful in using inventory::submit!. Maybe there is something we can do with spans to make it not emit this.
inventory::submit!
Is there a way around this error?
(The issue title is about hiding the suggestion, but right now I'm facing the problem of how to avoid the error.)
The most recent nightly (nightly-2022-08-21) started producing the following suggestion:
This is basically never going to be helpful in using
inventory::submit!
. Maybe there is something we can do with spans to make it not emit this.