Closed
Description
The following code compiles without warnings in 2015:
#![warn(rust_2018_compatibility)]
#[macro_use]
extern crate serde_json;
extern crate json;
pub mod m {
use json;
pub fn f() {
json::parse("").unwrap();
}
}
pub fn f() {
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.