![]() Currently, for the following code, the compiler produces the errors like the following error: ```rust struct Type<T> impl<T: Clone> Type<T> { fn const f() {} } ``` ```text error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable --> ./test.rs:3:6 | 3 | impl<T: Clone> Type<T> { | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable ``` This can be confusing (especially to newcomers) since the error mentions "const fn parameters", but highlights only the impl. This commits adds function highlighting, changing the error to the following: ```text error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable --> ./test.rs:3:6 | 3 | impl<T: Clone> Type<T> { | ^ 4 | pub const fn f() {} | ---------------- function declared as const here | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |