diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-27 03:38:43 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-01-12 16:18:55 +0300 |
| commit | 79134c051702f71cb4ef13a283dc3689eec9466d (patch) | |
| tree | 37d06b01291e27872a4aa551faa2e2090445da19 /src/librustc_resolve | |
| parent | 2f3db49c3d99d0338b4a47b62079da71c26db458 (diff) | |
Stabilize `uniform_paths`
Diffstat (limited to 'src/librustc_resolve')
| -rw-r--r-- | src/librustc_resolve/macros.rs | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index 037ade13c20..bb679d340ea 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -831,32 +831,23 @@ impl<'a> Resolver<'a> { // but its `Def` should coincide with a crate passed with `--extern` // (otherwise there would be ambiguity) and we can skip feature error in this case. 'ok: { - if !is_import || (!rust_2015 && self.session.features_untracked().uniform_paths) { + if !is_import || !rust_2015 { break 'ok; } if ns == TypeNS && use_prelude && self.extern_prelude_get(ident, true).is_some() { break 'ok; } - if rust_2015 { - let root_ident = Ident::new(keywords::PathRoot.name(), orig_ident.span); - let root_module = self.resolve_crate_root(root_ident); - if self.resolve_ident_in_module_ext(ModuleOrUniformRoot::Module(root_module), - orig_ident, ns, None, false, path_span) - .is_ok() { - break 'ok; - } + let root_ident = Ident::new(keywords::PathRoot.name(), orig_ident.span); + let root_module = self.resolve_crate_root(root_ident); + if self.resolve_ident_in_module_ext(ModuleOrUniformRoot::Module(root_module), + orig_ident, ns, None, false, path_span) + .is_ok() { + break 'ok; } - let reason = if rust_2015 { - "in macros originating from 2015 edition" - } else { - "on stable channel" - }; - let msg = format!("imports can only refer to extern crate names \ - passed with `--extern` {}", reason); - let mut err = feature_err(&self.session.parse_sess, "uniform_paths", - ident.span, GateIssue::Language, &msg); - + let msg = "imports can only refer to extern crate names passed with \ + `--extern` in macros originating from 2015 edition"; + let mut err = self.session.struct_span_err(ident.span, msg); let what = self.binding_description(binding, ident, flags.contains(Flags::MISC_FROM_PRELUDE)); let note_msg = format!("this import refers to {what}", what = what); |
