Skip to content

Commit aa5a4ef

Browse files
committed
Removed feature gate.
1 parent d09466c commit aa5a4ef

File tree

5 files changed

+10
-53
lines changed

5 files changed

+10
-53
lines changed

src/librustc_resolve/lib.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,13 +2373,9 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
23732373
self.with_current_self_item(item, |this| {
23742374
this.with_type_parameter_rib(HasTypeParameters(generics, ItemRibKind), |this| {
23752375
let item_def_id = this.definitions.local_def_id(item.id);
2376-
if this.session.features_untracked().self_in_typedefs {
2377-
this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| {
2378-
visit::walk_item(this, item);
2379-
});
2380-
} else {
2376+
this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| {
23812377
visit::walk_item(this, item);
2382-
}
2378+
});
23832379
});
23842380
});
23852381
}
@@ -3185,16 +3181,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
31853181
if is_self_type(path, ns) {
31863182
__diagnostic_used!(E0411);
31873183
err.code(DiagnosticId::Error("E0411".into()));
3188-
let available_in = if this.session.features_untracked().self_in_typedefs {
3189-
"impls, traits, and type definitions"
3190-
} else {
3191-
"traits and impls"
3192-
};
3193-
err.span_label(span, format!("`Self` is only available in {}", available_in));
3194-
if this.current_self_item.is_some() && nightly_options::is_nightly_build() {
3195-
err.help("add #![feature(self_in_typedefs)] to the crate attributes \
3196-
to enable");
3197-
}
3184+
err.span_label(span, format!("`Self` is only available in impls, traits, \
3185+
and type definitions"));
31983186
return (err, Vec::new());
31993187
}
32003188
if is_self_value(path, ns) {

src/libsyntax/feature_gate.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,6 @@ declare_features! (
462462
// Allows `use x::y;` to resolve through `self::x`, not just `::x`
463463
(active, uniform_paths, "1.30.0", Some(53130), None),
464464

465-
// Allows `Self` in type definitions
466-
(active, self_in_typedefs, "1.30.0", Some(49303), None),
467-
468465
// Allows unsized rvalues at arguments and parameters
469466
(active, unsized_locals, "1.30.0", Some(48055), None),
470467

@@ -672,21 +669,23 @@ declare_features! (
672669
(accepted, extern_prelude, "1.30.0", Some(44660), None),
673670
// Parentheses in patterns
674671
(accepted, pattern_parentheses, "1.31.0", Some(51087), None),
675-
// Allows the definition of `const fn` functions.
672+
// Allows the definition of `const fn` functions
676673
(accepted, min_const_fn, "1.31.0", Some(53555), None),
677674
// Scoped lints
678675
(accepted, tool_lints, "1.31.0", Some(44690), None),
679676
// impl<I:Iterator> Iterator for &mut Iterator
680677
// impl Debug for Foo<'_>
681678
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872), None),
682-
// `extern crate foo as bar;` puts `bar` into extern prelude.
679+
// `extern crate foo as bar;` puts `bar` into extern prelude
683680
(accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None),
684681
// Allows use of the :literal macro fragment specifier (RFC 1576)
685682
(accepted, macro_literal_matcher, "1.31.0", Some(35625), None),
686683
// Use `?` as the Kleene "at most one" operator
687684
(accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None),
688-
// Self struct constructor (RFC 2302)
685+
// `Self` struct constructor (RFC 2302)
689686
(accepted, self_struct_ctor, "1.32.0", Some(51994), None),
687+
// `Self` in type definitions (RFC 2300)
688+
(accepted, self_in_typedefs, "1.32.0", Some(49303), None),
690689
);
691690

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

src/test/run-pass/self/self-in-typedefs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
// except according to those terms.
1010

1111
// run-pass
12-
#![allow(unions_with_drop_fields)]
1312

14-
#![feature(self_in_typedefs)]
1513
#![feature(untagged_unions)]
1614

1715
#![allow(dead_code)]
16+
#![allow(unions_with_drop_fields)]
1817

1918
enum A<'a, T: 'a>
2019
where

src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)