Skip to content

Commit

Permalink
Removed feature gate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Regueiro committed Nov 30, 2018
1 parent d09466c commit aa5a4ef
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 53 deletions.
20 changes: 4 additions & 16 deletions src/librustc_resolve/lib.rs
Expand Up @@ -2373,13 +2373,9 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
self.with_current_self_item(item, |this| {
this.with_type_parameter_rib(HasTypeParameters(generics, ItemRibKind), |this| {
let item_def_id = this.definitions.local_def_id(item.id);
if this.session.features_untracked().self_in_typedefs {
this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| {
visit::walk_item(this, item);
});
} else {
this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| {
visit::walk_item(this, item);
}
});
});
});
}
Expand Down Expand Up @@ -3185,16 +3181,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
if is_self_type(path, ns) {
__diagnostic_used!(E0411);
err.code(DiagnosticId::Error("E0411".into()));
let available_in = if this.session.features_untracked().self_in_typedefs {
"impls, traits, and type definitions"
} else {
"traits and impls"
};
err.span_label(span, format!("`Self` is only available in {}", available_in));
if this.current_self_item.is_some() && nightly_options::is_nightly_build() {
err.help("add #![feature(self_in_typedefs)] to the crate attributes \
to enable");
}
err.span_label(span, format!("`Self` is only available in impls, traits, \
and type definitions"));
return (err, Vec::new());
}
if is_self_value(path, ns) {
Expand Down
11 changes: 5 additions & 6 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -462,9 +462,6 @@ declare_features! (
// Allows `use x::y;` to resolve through `self::x`, not just `::x`
(active, uniform_paths, "1.30.0", Some(53130), None),

// Allows `Self` in type definitions
(active, self_in_typedefs, "1.30.0", Some(49303), None),

// Allows unsized rvalues at arguments and parameters
(active, unsized_locals, "1.30.0", Some(48055), None),

Expand Down Expand Up @@ -672,21 +669,23 @@ declare_features! (
(accepted, extern_prelude, "1.30.0", Some(44660), None),
// Parentheses in patterns
(accepted, pattern_parentheses, "1.31.0", Some(51087), None),
// Allows the definition of `const fn` functions.
// Allows the definition of `const fn` functions
(accepted, min_const_fn, "1.31.0", Some(53555), None),
// Scoped lints
(accepted, tool_lints, "1.31.0", Some(44690), None),
// impl<I:Iterator> Iterator for &mut Iterator
// impl Debug for Foo<'_>
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872), None),
// `extern crate foo as bar;` puts `bar` into extern prelude.
// `extern crate foo as bar;` puts `bar` into extern prelude
(accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None),
// Allows use of the :literal macro fragment specifier (RFC 1576)
(accepted, macro_literal_matcher, "1.31.0", Some(35625), None),
// Use `?` as the Kleene "at most one" operator
(accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None),
// Self struct constructor (RFC 2302)
// `Self` struct constructor (RFC 2302)
(accepted, self_struct_ctor, "1.32.0", Some(51994), None),
// `Self` in type definitions (RFC 2300)
(accepted, self_in_typedefs, "1.32.0", Some(49303), None),
);

// If you change this, please modify `src/doc/unstable-book` as well. You must
Expand Down
3 changes: 1 addition & 2 deletions src/test/run-pass/self/self-in-typedefs.rs
Expand Up @@ -9,12 +9,11 @@
// except according to those terms.

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

#![feature(self_in_typedefs)]
#![feature(untagged_unions)]

#![allow(dead_code)]
#![allow(unions_with_drop_fields)]

enum A<'a, T: 'a>
where
Expand Down
18 changes: 0 additions & 18 deletions src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs

This file was deleted.

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

This file was deleted.

0 comments on commit aa5a4ef

Please sign in to comment.