Skip to content

Commit

Permalink
stabilize extern_crate_self
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Jan 7, 2019
1 parent 789a15a commit f79eeaa
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 28 deletions.
6 changes: 1 addition & 5 deletions src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use syntax::ext::base::{MacroKind, SyntaxExtension};
use syntax::ext::base::Determinacy::Undetermined;
use syntax::ext::hygiene::Mark;
use syntax::ext::tt::macro_rules;
use syntax::feature_gate::{is_builtin_attr, emit_feature_err, GateIssue};
use syntax::feature_gate::is_builtin_attr;
use syntax::parse::token::{self, Token};
use syntax::std_inject::injected_crate_name;
use syntax::symbol::keywords;
Expand Down Expand Up @@ -349,10 +349,6 @@ impl<'a> Resolver<'a> {
.emit();
return;
} else if orig_name == Some(keywords::SelfLower.name()) {
if !self.session.features_untracked().extern_crate_self {
emit_feature_err(&self.session.parse_sess, "extern_crate_self", item.span,
GateIssue::Language, "`extern crate self` is unstable");
}
self.graph_root
} else {
let crate_id = self.crate_loader.process_extern_crate(item, &self.definitions);
Expand Down
5 changes: 2 additions & 3 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,6 @@ declare_features! (
// Adds `reason` and `expect` lint attributes.
(active, lint_reasons, "1.31.0", Some(54503), None),
// `extern crate self as foo;` puts local crate root into extern prelude under name `foo`.
(active, extern_crate_self, "1.31.0", Some(56409), None),
// Allows paths to enum variants on type aliases.
(active, type_alias_enum_variants, "1.31.0", Some(49683), None),
Expand Down Expand Up @@ -689,6 +686,8 @@ declare_features! (
(accepted, repr_packed, "1.33.0", Some(33158), None),
// Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
(accepted, min_const_unsafe_fn, "1.33.0", Some(55607), None),
// `extern crate self as foo;` puts local crate root into extern prelude under name `foo`.
(accepted, extern_crate_self, "1.33.0", Some(56409), None),
);

// If you change this, please modify `src/doc/unstable-book` as well. You must
Expand Down
3 changes: 0 additions & 3 deletions src/test/ui/feature-gates/feature-gate-extern_crate_self.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-extern_crate_self.stderr

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/ui/imports/extern-crate-self-fail.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(extern_crate_self)]

extern crate self; //~ ERROR `extern crate self;` requires renaming

#[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self`
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/imports/extern-crate-self-fail.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: `extern crate self;` requires renaming
--> $DIR/extern-crate-self-fail.rs:3:1
--> $DIR/extern-crate-self-fail.rs:1:1
|
LL | extern crate self; //~ ERROR `extern crate self;` requires renaming
| ^^^^^^^^^^^^^^^^^^ help: try: `extern crate self as name;`

error: `macro_use` is not supported on `extern crate self`
--> $DIR/extern-crate-self-fail.rs:5:1
--> $DIR/extern-crate-self-fail.rs:3:1
|
LL | #[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self`
| ^^^^^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/imports/extern-crate-self-pass.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// compile-pass

#![feature(extern_crate_self)]

extern crate self as foo;

struct S;
Expand Down

0 comments on commit f79eeaa

Please sign in to comment.