-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::compile_error is missing when adding macro to root main module #2
Comments
I've encountered this too. I don't know the cause or fix, unfortunately. |
Not certain, but I think I may have found the cause: dtolnay/syn#1427 |
With #6, one now gets the following error message:
There were a couple of underlying issues. The first was that, when used as an inner attribute at the crate level, Anyway, do you think we can close this? |
Yes, sounds good! Do you think this can work with the crate root in the future? (maybe even recursively) |
My impression is that it would require better support from the compiler. The compiler injects some stuff at the top the crate that looks roughly like this: #[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std; One problem is, when the macro processes the file and leaves those things in place, the compiler complains because it thinks the macro put them there (not the compiler) and it considers those things privileged. I haven't dug into the issues to understand what still needs to be implemented:
But I agree it would be nice to just use |
The following program does not compile. Not sure if it should, or if this is a bug of my nightly.
The text was updated successfully, but these errors were encountered: