From c4f6ef25d207ad0cff8d1e5282fedbe1e3ac743c Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sun, 13 Jan 2019 14:18:00 +0100 Subject: [PATCH] remove extern_in_paths. --- .../src/language-features/extern-in-paths.md | 40 ------------------- src/librustc/middle/cstore.rs | 2 +- src/librustc_resolve/lib.rs | 9 ++--- src/libsyntax/feature_gate.rs | 29 +++----------- src/libsyntax/parse/parser.rs | 13 ++---- src/libsyntax_pos/symbol.rs | 1 - .../save-analysis-rfc2126/Makefile | 5 +-- .../save-analysis-rfc2126/extern_in_paths.rs | 7 ---- .../rfc-2126-extern-absolute-paths/extern.rs | 28 ------------- .../feature-gate-extern_in_paths.rs | 5 --- .../feature-gate-extern_in_paths.stderr | 11 ----- .../keyword-extern-as-identifier-expr.rs | 3 ++ .../keyword-extern-as-identifier-expr.stderr | 8 ++++ .../keyword-extern-as-identifier-pat.rs | 3 ++ .../keyword-extern-as-identifier-pat.stderr | 8 ++++ .../keyword-extern-as-identifier-type.rs | 3 ++ .../keyword-extern-as-identifier-type.stderr | 8 ++++ .../keyword-extern-as-identifier-use.rs | 3 ++ .../keyword-extern-as-identifier-use.stderr | 12 ++++++ .../keyword/keyword-extern-as-identifier.rs | 5 --- .../keyword-extern-as-identifier.stderr | 9 ----- .../auxiliary/xcrate.rs | 5 --- .../non-existent-1.rs | 5 --- .../non-existent-1.stderr | 9 ----- .../non-existent-2.rs | 6 --- .../non-existent-2.stderr | 9 ----- .../non-existent-3.rs | 5 --- .../non-existent-3.stderr | 9 ----- .../single-segment.rs | 13 ------ .../single-segment.stderr | 22 ---------- 30 files changed, 62 insertions(+), 233 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/extern-in-paths.md delete mode 100644 src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs delete mode 100644 src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-extern_in_paths.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.rs create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.stderr create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.rs create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-type.rs create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-type.stderr create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-use.rs create mode 100644 src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr delete mode 100644 src/test/ui/keyword/keyword-extern-as-identifier.rs delete mode 100644 src/test/ui/keyword/keyword-extern-as-identifier.stderr delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/single-segment.rs delete mode 100644 src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr diff --git a/src/doc/unstable-book/src/language-features/extern-in-paths.md b/src/doc/unstable-book/src/language-features/extern-in-paths.md deleted file mode 100644 index 9979d7742291e..0000000000000 --- a/src/doc/unstable-book/src/language-features/extern-in-paths.md +++ /dev/null @@ -1,40 +0,0 @@ -# `extern_in_paths` - -The tracking issue for this feature is: [#44660] - -[#44660]: https://github.com/rust-lang/rust/issues/44660 - ------------------------- - -The `extern_in_paths` feature allows to refer to names from other crates "inline", without -introducing `extern crate` items, using keyword `extern`. - -For example, `extern::my_crat::a::b` will resolve to path `a::b` in crate `my_crate`. - -Absolute paths on 2018 edition (e.g. `::my_crate::a::b`) provide the same effect -and resolve to extern crates (built-in or passed with `--extern`). - -```rust,ignore -#![feature(extern_in_paths)] - -// Suppose we have a dependency crate `xcrate` available through `Cargo.toml`, or `--extern` -// options, or standard Rust distribution, or some other means. - -use extern::xcrate::Z; - -fn f() { - use extern::xcrate; - use extern::xcrate as ycrate; - let s = xcrate::S; - assert_eq!(format!("{:?}", s), "S"); - let z = ycrate::Z; - assert_eq!(format!("{:?}", z), "Z"); -} - -fn main() { - let s = extern::xcrate::S; - assert_eq!(format!("{:?}", s), "S"); - let z = Z; - assert_eq!(format!("{:?}", z), "Z"); -} -``` diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index c431dc77f782f..9168bbf907f1e 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -140,7 +140,7 @@ pub enum ExternCrateSource { ), // Crate is loaded by `use`. Use, - /// Crate is implicitly loaded by an absolute or an `extern::` path. + /// Crate is implicitly loaded by an absolute path. Path, } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 7c05913467c54..71adca4d26ca7 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -1005,7 +1005,7 @@ enum ModuleOrUniformRoot<'a> { CrateRootAndExternPrelude, /// Virtual module that denotes resolution in extern prelude. - /// Used for paths starting with `::` on 2018 edition or `extern::`. + /// Used for paths starting with `::` on 2018 edition. ExternPrelude, /// Virtual module that denotes resolution in current scope. @@ -3817,8 +3817,7 @@ impl<'a> Resolver<'a> { self.resolve_self(&mut ctxt, self.current_module))); continue; } - if name == keywords::Extern.name() || - name == keywords::PathRoot.name() && ident.span.rust_2018() { + if name == keywords::PathRoot.name() && ident.span.rust_2018() { module = Some(ModuleOrUniformRoot::ExternPrelude); continue; } @@ -3985,8 +3984,8 @@ impl<'a> Resolver<'a> { }; // We're only interested in `use` paths which should start with - // `{{root}}` or `extern` currently. - if first_name != keywords::Extern.name() && first_name != keywords::PathRoot.name() { + // `{{root}}` currently. + if first_name != keywords::PathRoot.name() { return } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 89da1a219b70a..b40101a7243c0 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -25,9 +25,9 @@ use syntax_pos::{Span, DUMMY_SP}; use errors::{DiagnosticBuilder, Handler}; use visit::{self, FnKind, Visitor}; use parse::ParseSess; -use symbol::{keywords, Symbol}; +use symbol::Symbol; -use std::{env}; +use std::env; macro_rules! set { ($field: ident) => {{ @@ -375,9 +375,6 @@ declare_features! ( // Generic associated types (RFC 1598) (active, generic_associated_types, "1.23.0", Some(44265), None), - // `extern` in paths - (active, extern_in_paths, "1.23.0", Some(55600), None), - // Infer static outlives requirements (RFC 2093). (active, infer_static_outlives_requirements, "1.26.0", Some(54185), None), @@ -506,6 +503,9 @@ declare_features! ( // Allows the use of `#[derive(Anything)]` as sugar for `#[derive_Anything]`. (removed, custom_derive, "1.0.0", Some(29644), None, Some("subsumed by `#[proc_macro_derive]`")), + // Paths of the form: `extern::foo::bar` + (removed, extern_in_paths, "1.33.0", Some(55600), None, + Some("subsumed by `::foo::bar` paths")), ); declare_features! ( @@ -1829,25 +1829,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { visit::walk_impl_item(self, ii); } - fn visit_path(&mut self, path: &'a ast::Path, _id: NodeId) { - for segment in &path.segments { - // Identifiers we are going to check could come from a legacy macro (e.g., `#[test]`). - // For such macros identifiers must have empty context, because this context is - // used during name resolution and produced names must be unhygienic for compatibility. - // On the other hand, we need the actual non-empty context for feature gate checking - // because it's hygienic even for legacy macros. As previously stated, such context - // cannot be kept in identifiers, so it's kept in paths instead and we take it from - // there while keeping location info from the ident span. - let span = segment.ident.span.with_ctxt(path.span.ctxt()); - if segment.ident.name == keywords::Extern.name() { - gate_feature_post!(&self, extern_in_paths, span, - "`extern` in paths is experimental"); - } - } - - visit::walk_path(self, path); - } - fn visit_vis(&mut self, vis: &'a ast::Visibility) { if let ast::VisibilityKind::Crate(ast::CrateSugar::JustCrate) = vis.node { gate_feature_post!(&self, crate_visibility_modifier, vis.span, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b90eeaca54b97..e4b8866d7d291 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1299,7 +1299,7 @@ impl<'a> Parser<'a> { fn token_is_bare_fn_keyword(&mut self) -> bool { self.check_keyword(keywords::Fn) || self.check_keyword(keywords::Unsafe) || - self.check_keyword(keywords::Extern) && self.is_extern_non_path() + self.check_keyword(keywords::Extern) } /// parse a `TyKind::BareFn` type: @@ -4605,10 +4605,6 @@ impl<'a> Parser<'a> { self.token.is_keyword(keywords::Crate) && self.look_ahead(1, |t| t != &token::ModSep) } - fn is_extern_non_path(&self) -> bool { - self.token.is_keyword(keywords::Extern) && self.look_ahead(1, |t| t != &token::ModSep) - } - fn is_existential_type_decl(&self) -> bool { self.token.is_keyword(keywords::Existential) && self.look_ahead(1, |t| t.is_keyword(keywords::Type)) @@ -4712,12 +4708,10 @@ impl<'a> Parser<'a> { // like a path (1 token), but it fact not a path. // `union::b::c` - path, `union U { ... }` - not a path. // `crate::b::c` - path, `crate struct S;` - not a path. - // `extern::b::c` - path, `extern crate c;` - not a path. } else if self.token.is_path_start() && !self.token.is_qpath_start() && !self.is_union_item() && !self.is_crate_vis() && - !self.is_extern_non_path() && !self.is_existential_type_decl() && !self.is_auto_trait_item() { let pth = self.parse_path(PathStyle::Expr)?; @@ -7113,8 +7107,7 @@ impl<'a> Parser<'a> { return Ok(Some(item)); } - if self.check_keyword(keywords::Extern) && self.is_extern_non_path() { - self.bump(); // `extern` + if self.eat_keyword(keywords::Extern) { if self.eat_keyword(keywords::Crate) { return Ok(Some(self.parse_item_extern_crate(lo, visibility, attrs)?)); } @@ -7623,7 +7616,7 @@ impl<'a> Parser<'a> { fn parse_assoc_macro_invoc(&mut self, item_kind: &str, vis: Option<&Visibility>, at_end: &mut bool) -> PResult<'a, Option> { - if self.token.is_path_start() && !self.is_extern_non_path() { + if self.token.is_path_start() { let prev_span = self.prev_span; let lo = self.span; let pth = self.parse_path(PathStyle::Mod)?; diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 76d47f421b3de..e741b79bd4c45 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -478,7 +478,6 @@ impl Ident { self.name == keywords::Super.name() || self.name == keywords::SelfLower.name() || self.name == keywords::SelfUpper.name() || - self.name == keywords::Extern.name() || self.name == keywords::Crate.name() || self.name == keywords::PathRoot.name() || self.name == keywords::DollarCrate.name() diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile index 2b931d89f1fec..bf98fcd10cfde 100644 --- a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile @@ -1,12 +1,9 @@ -include ../tools.mk -all: extern_absolute_paths.rs extern_in_paths.rs krate2 +all: extern_absolute_paths.rs krate2 $(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 \ -Z unstable-options --extern krate2 cat $(TMPDIR)/save-analysis/extern_absolute_paths.json | "$(PYTHON)" validate_json.py - $(RUSTC) extern_in_paths.rs -Zsave-analysis --edition=2018 \ - -Z unstable-options --extern krate2 - cat $(TMPDIR)/save-analysis/extern_in_paths.json | "$(PYTHON)" validate_json.py krate2: krate2.rs $(RUSTC) $< diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs deleted file mode 100644 index 299b96621ac32..0000000000000 --- a/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![feature(extern_in_paths)] - -use extern::krate2; - -fn main() { - extern::krate2::hello(); -} diff --git a/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs deleted file mode 100644 index 165a753c8a434..0000000000000 --- a/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs +++ /dev/null @@ -1,28 +0,0 @@ -// run-pass -#![allow(dead_code)] -// aux-build:xcrate.rs -// compile-flags:--extern xcrate - -#![feature(extern_in_paths)] - -use extern::xcrate::Z; - -type A = extern::xcrate::S; -type B = for<'a> extern::xcrate::Tr<'a>; - -fn f() { - use extern::xcrate; - use extern::xcrate as ycrate; - let s = xcrate::S; - assert_eq!(format!("{:?}", s), "S"); - let z = ycrate::Z; - assert_eq!(format!("{:?}", z), "Z"); -} - -fn main() { - let s = extern::xcrate::S; - assert_eq!(format!("{:?}", s), "S"); - let z = Z; - assert_eq!(format!("{:?}", z), "Z"); - assert_eq!(A {}, extern::xcrate::S {}); -} diff --git a/src/test/ui/feature-gates/feature-gate-extern_in_paths.rs b/src/test/ui/feature-gates/feature-gate-extern_in_paths.rs deleted file mode 100644 index 2d23d13d2472b..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-extern_in_paths.rs +++ /dev/null @@ -1,5 +0,0 @@ -struct S; - -fn main() { - let _ = extern::std::vec::Vec::new(); //~ ERROR `extern` in paths is experimental -} diff --git a/src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr b/src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr deleted file mode 100644 index 6b5963b8559af..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0658]: `extern` in paths is experimental (see issue #55600) - --> $DIR/feature-gate-extern_in_paths.rs:4:13 - | -LL | let _ = extern::std::vec::Vec::new(); //~ ERROR `extern` in paths is experimental - | ^^^^^^ - | - = help: add #![feature(extern_in_paths)] to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.rs b/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.rs new file mode 100644 index 0000000000000..b738eb4c70350 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.rs @@ -0,0 +1,3 @@ +fn main() { + let s = extern::foo::Bar; //~ ERROR expected expression, found keyword `extern` +} diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.stderr new file mode 100644 index 0000000000000..150fc88e7efc2 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-expr.stderr @@ -0,0 +1,8 @@ +error: expected expression, found keyword `extern` + --> $DIR/keyword-extern-as-identifier-expr.rs:2:13 + | +LL | let s = extern::foo::Bar; //~ ERROR expected expression, found keyword `extern` + | ^^^^^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.rs b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.rs new file mode 100644 index 0000000000000..f9b6bad7c2552 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.rs @@ -0,0 +1,3 @@ +fn main() { + let extern = 0; //~ ERROR expected pattern, found keyword `extern` +} diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr new file mode 100644 index 0000000000000..426b4eef0569c --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `extern` + --> $DIR/keyword-extern-as-identifier-pat.rs:2:9 + | +LL | let extern = 0; //~ ERROR expected pattern, found keyword `extern` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.rs b/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.rs new file mode 100644 index 0000000000000..3845a9aa017ce --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.rs @@ -0,0 +1,3 @@ +type A = extern::foo::bar; //~ ERROR expected `fn`, found `::` + +fn main() {} diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.stderr new file mode 100644 index 0000000000000..97b641fbea557 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-type.stderr @@ -0,0 +1,8 @@ +error: expected `fn`, found `::` + --> $DIR/keyword-extern-as-identifier-type.rs:1:16 + | +LL | type A = extern::foo::bar; //~ ERROR expected `fn`, found `::` + | ^^ expected `fn` here + +error: aborting due to previous error + diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.rs b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.rs new file mode 100644 index 0000000000000..b07de3e341c41 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.rs @@ -0,0 +1,3 @@ +use extern::foo; //~ ERROR expected identifier, found keyword `extern` + +fn main() {} diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr new file mode 100644 index 0000000000000..31b575a92e0c8 --- /dev/null +++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr @@ -0,0 +1,12 @@ +error: expected identifier, found keyword `extern` + --> $DIR/keyword-extern-as-identifier-use.rs:1:5 + | +LL | use extern::foo; //~ ERROR expected identifier, found keyword `extern` + | ^^^^^^ expected identifier, found keyword +help: you can escape reserved keywords to use them as identifiers + | +LL | use r#extern::foo; //~ ERROR expected identifier, found keyword `extern` + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/keyword/keyword-extern-as-identifier.rs b/src/test/ui/keyword/keyword-extern-as-identifier.rs deleted file mode 100644 index 6775290a26bd5..0000000000000 --- a/src/test/ui/keyword/keyword-extern-as-identifier.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(extern_in_paths)] - -fn main() { - let extern = 0; //~ ERROR cannot find unit struct/variant or constant `extern` in this scope -} diff --git a/src/test/ui/keyword/keyword-extern-as-identifier.stderr b/src/test/ui/keyword/keyword-extern-as-identifier.stderr deleted file mode 100644 index ef2a4b3ff3c30..0000000000000 --- a/src/test/ui/keyword/keyword-extern-as-identifier.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0531]: cannot find unit struct/variant or constant `extern` in this scope - --> $DIR/keyword-extern-as-identifier.rs:4:9 - | -LL | let extern = 0; //~ ERROR cannot find unit struct/variant or constant `extern` in this scope - | ^^^^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0531`. diff --git a/src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs b/src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs deleted file mode 100644 index c4d4447644577..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[derive(Debug)] -pub struct S; - -#[derive(Debug)] -pub struct Z; diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs b/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs deleted file mode 100644 index 5e5e6c6eebfad..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(extern_in_paths)] - -use extern::xcrate::S; //~ ERROR unresolved import `extern::xcrate` - -fn main() {} diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr deleted file mode 100644 index 5b7528c2ed9aa..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0432]: unresolved import `extern::xcrate` - --> $DIR/non-existent-1.rs:3:13 - | -LL | use extern::xcrate::S; //~ ERROR unresolved import `extern::xcrate` - | ^^^^^^ could not find `xcrate` in `extern` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs deleted file mode 100644 index 0f26eef5d7e1b..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![feature(extern_in_paths)] - -fn main() { - let s = extern::xcrate::S; - //~^ ERROR failed to resolve: could not find `xcrate` in `extern` -} diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr deleted file mode 100644 index 21c2a0c14d601..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: could not find `xcrate` in `extern` - --> $DIR/non-existent-2.rs:4:21 - | -LL | let s = extern::xcrate::S; - | ^^^^^^ could not find `xcrate` in `extern` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs b/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs deleted file mode 100644 index 1875fb99fe893..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(extern_in_paths)] - -use extern::ycrate; //~ ERROR unresolved import `extern::ycrate` - -fn main() {} diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr deleted file mode 100644 index e2e7df648c62c..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0432]: unresolved import `extern::ycrate` - --> $DIR/non-existent-3.rs:3:5 - | -LL | use extern::ycrate; //~ ERROR unresolved import `extern::ycrate` - | ^^^^^^^^^^^^^^ no `ycrate` external crate - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rfc-2126-extern-in-paths/single-segment.rs b/src/test/ui/rfc-2126-extern-in-paths/single-segment.rs deleted file mode 100644 index 1d5af1e9d8636..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/single-segment.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:xcrate.rs -// compile-flags:--extern xcrate - -#![feature(extern_in_paths)] - -use extern; //~ ERROR unresolved import `extern` - //~^ NOTE no `extern` in the root -use extern::*; //~ ERROR cannot glob-import all possible crates - -fn main() { - let s = extern::xcrate; //~ ERROR expected value, found module `extern::xcrate` - //~^ NOTE not a value -} diff --git a/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr b/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr deleted file mode 100644 index 2d8ecd48d4825..0000000000000 --- a/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: cannot glob-import all possible crates - --> $DIR/single-segment.rs:8:5 - | -LL | use extern::*; //~ ERROR cannot glob-import all possible crates - | ^^^^^^^^^ - -error[E0432]: unresolved import `extern` - --> $DIR/single-segment.rs:6:5 - | -LL | use extern; //~ ERROR unresolved import `extern` - | ^^^^^^ no `extern` in the root - -error[E0423]: expected value, found module `extern::xcrate` - --> $DIR/single-segment.rs:11:13 - | -LL | let s = extern::xcrate; //~ ERROR expected value, found module `extern::xcrate` - | ^^^^^^^^^^^^^^ not a value - -error: aborting due to 3 previous errors - -Some errors occurred: E0423, E0432. -For more information about an error, try `rustc --explain E0423`.