error: expected type, found `2`
--> <anon>:3:37
|
3 | ::std::convert::From:from(idx < 2);
| ^
error: expected one of `!`, `->`, `::`, `;`, or `}`, found `)`
--> <anon>:3:38
|
3 | ::std::convert::From:from(idx < 2);
| ^
error: type ascription is experimental (see issue #23416)
--> <anon>:3:5
|
3 | ::std::convert::From:from(idx < 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
Computers are always so literal, aren’t they? Either way, the error is really syntax error, not that we wanted to use some unrelated feature.
This reminds me of another compiler (ahem gcc) which when you forgot a closing brace, it dutifully told you for each following function in the file, that nested functions was a gcc extension.
The extensions (in gcc’s case) and unstable features (in rustc’s case) get in the way of the users’ normal interaction with the stable (or standardized) language.
It’s a confusion for new users and a papercut for us established rusties.