Description
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
--> src/schema.rs:441:9
|
441 | use std::convert::TryFrom;
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(try_from)] to the crate attributes to enable
The message above is what I get attempting to use try_from. The issue is that it's not clear where crate attributes are, or whey they go. The rust book makes little mention of them. Adding this to "lib.rs", causes new errors such as:
error: an inner attribute is not permitted in this context
--> src/lib.rs:15:3
|
15 | #![feature(try_from)]
| ^
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
As a result, it's really not clear how to resolve this error.
The descriptive error rustc --explain E0658 also doesn't demonstrate what to do correctly.
The error message should explain which file to add the #[feature] line too. Additionally, the E0658 should explain not just what file, but what to do in a multi-file case (ie lib.rs contains mod foo, and foo.rs wants to use the feature).
This would help to make this easier to resolve and access these features.
EDIT: It would be also useful to handle the mod tests situation as well where you want to test a feature like TryFrom in mod tests, because that likely needs different/other handling?