Skip to content

Commit f79eeaa

Browse files
committed
stabilize extern_crate_self
1 parent 789a15a commit f79eeaa

7 files changed

+5
-28
lines changed

Diff for: src/librustc_resolve/build_reduced_graph.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use syntax::ext::base::{MacroKind, SyntaxExtension};
3030
use syntax::ext::base::Determinacy::Undetermined;
3131
use syntax::ext::hygiene::Mark;
3232
use syntax::ext::tt::macro_rules;
33-
use syntax::feature_gate::{is_builtin_attr, emit_feature_err, GateIssue};
33+
use syntax::feature_gate::is_builtin_attr;
3434
use syntax::parse::token::{self, Token};
3535
use syntax::std_inject::injected_crate_name;
3636
use syntax::symbol::keywords;
@@ -349,10 +349,6 @@ impl<'a> Resolver<'a> {
349349
.emit();
350350
return;
351351
} else if orig_name == Some(keywords::SelfLower.name()) {
352-
if !self.session.features_untracked().extern_crate_self {
353-
emit_feature_err(&self.session.parse_sess, "extern_crate_self", item.span,
354-
GateIssue::Language, "`extern crate self` is unstable");
355-
}
356352
self.graph_root
357353
} else {
358354
let crate_id = self.crate_loader.process_extern_crate(item, &self.definitions);

Diff for: src/libsyntax/feature_gate.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,6 @@ declare_features! (
474474
// Adds `reason` and `expect` lint attributes.
475475
(active, lint_reasons, "1.31.0", Some(54503), None),
476476

477-
// `extern crate self as foo;` puts local crate root into extern prelude under name `foo`.
478-
(active, extern_crate_self, "1.31.0", Some(56409), None),
479-
480477
// Allows paths to enum variants on type aliases.
481478
(active, type_alias_enum_variants, "1.31.0", Some(49683), None),
482479

@@ -689,6 +686,8 @@ declare_features! (
689686
(accepted, repr_packed, "1.33.0", Some(33158), None),
690687
// Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
691688
(accepted, min_const_unsafe_fn, "1.33.0", Some(55607), None),
689+
// `extern crate self as foo;` puts local crate root into extern prelude under name `foo`.
690+
(accepted, extern_crate_self, "1.33.0", Some(56409), None),
692691
);
693692

694693
// If you change this, please modify `src/doc/unstable-book` as well. You must

Diff for: src/test/ui/feature-gates/feature-gate-extern_crate_self.rs

-3
This file was deleted.

Diff for: src/test/ui/feature-gates/feature-gate-extern_crate_self.stderr

-11
This file was deleted.

Diff for: src/test/ui/imports/extern-crate-self-fail.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(extern_crate_self)]
2-
31
extern crate self; //~ ERROR `extern crate self;` requires renaming
42

53
#[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self`

Diff for: src/test/ui/imports/extern-crate-self-fail.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: `extern crate self;` requires renaming
2-
--> $DIR/extern-crate-self-fail.rs:3:1
2+
--> $DIR/extern-crate-self-fail.rs:1:1
33
|
44
LL | extern crate self; //~ ERROR `extern crate self;` requires renaming
55
| ^^^^^^^^^^^^^^^^^^ help: try: `extern crate self as name;`
66

77
error: `macro_use` is not supported on `extern crate self`
8-
--> $DIR/extern-crate-self-fail.rs:5:1
8+
--> $DIR/extern-crate-self-fail.rs:3:1
99
|
1010
LL | #[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self`
1111
| ^^^^^^^^^^^^

Diff for: src/test/ui/imports/extern-crate-self-pass.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// compile-pass
22

3-
#![feature(extern_crate_self)]
4-
53
extern crate self as foo;
64

75
struct S;

0 commit comments

Comments
 (0)