Closed
Description
openedon Aug 4, 2022
I was looking at namely issue #99751 when I thought about this. If work is being put into improving error messages when somebody uses a keyword that defines a function in another language, there should also be improved error messages if someone uses the incorrect directive to bring something into the scope of their module or namespace/
Given the following code: Playground Link
import std::mem;
using std::mem;
require std::mem;
The current output is:
error: expected one of `!` or `::`, found `std`
--> src/main.rs:1:8
|
1 | import std::mem;
| ^^^ expected one of `!` or `::`
error: could not compile `playground` due to previous error
The error message should preferably suggest the user to use the use
directive to bring something into scope of their module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment