You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code compiles without warnings in 2015:
#![warn(rust_2018_compatibility)]#[macro_use]externcrate serde_json;externcrate json;pubmod m {use json;pubfnf(){
json::parse("").unwrap();}}pubfnf(){println!("{:?}", json!({}));}
In 2018, it fails to compile with the following error:
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
--> src/lib.rs:7:9
|
2 | #[macro_use]
| ------------ not an extern crate passed with `--extern`
...
7 | use json;
| ^^^^
|
= help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the macro imported here
--> src/lib.rs:2:1
|
2 | #[macro_use]
| ^^^^^^^^^^^^
Notice the json macro conflicts with the json crate.
The text was updated successfully, but these errors were encountered:
Stabilize `uniform_paths`
Address all the things described in #56417.
Assign visibilities to `macro_rules` items - `pub` to `macro_export`-ed macros and `pub(crate)` to non-exported macros, these visibilities determine how far these macros can be reexported with `use`.
Prohibit use of reexported inert attributes and "tool modules", after renaming (e.g. `use inline as imported_inline`) their respective tools and even compiler passes won't be able to recognize and properly check them.
Also turn use of uniform paths in 2015 macros into an error, I'd prefer to neither remove nor stabilize them right away because I still want to make some experiments in this area (uniform path fallback was added to 2015 macros used on 2018 edition in #56053 (comment)).
UPDATE: The last commit also stabilizes the feature `uniform_paths`.
Closes#53130Closes#55618Closes#56326Closes#56398Closes#56417Closes#56821Closes#57252Closes#57422
Stabilize `uniform_paths`
Address all the things described in #56417.
Assign visibilities to `macro_rules` items - `pub` to `macro_export`-ed macros and `pub(crate)` to non-exported macros, these visibilities determine how far these macros can be reexported with `use`.
Prohibit use of reexported inert attributes and "tool modules", after renaming (e.g. `use inline as imported_inline`) their respective tools and even compiler passes won't be able to recognize and properly check them.
Also turn use of uniform paths in 2015 macros into an error, I'd prefer to neither remove nor stabilize them right away because I still want to make some experiments in this area (uniform path fallback was added to 2015 macros used on 2018 edition in #56053 (comment)).
UPDATE: The last commit also stabilizes the feature `uniform_paths`.
Closes#53130Closes#55618Closes#56326Closes#56398Closes#56417Closes#56821Closes#57252Closes#57422
The following code compiles without warnings in 2015:
In 2018, it fails to compile with the following error:
Notice the
json
macro conflicts with thejson
crate.The text was updated successfully, but these errors were encountered: