about summary refs log tree commit diff
path: root/src/librustc_resolve
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-12-03 18:07:07 +0800
committerGitHub <noreply@github.com>2018-12-03 18:07:07 +0800
commitbf96a7bbed4000ec00cf1a320ecd32352f927d23 (patch)
tree34b7f26e3a7e051008f0f70947ec2c8cdab63d36 /src/librustc_resolve
parente9a805522c7cee40fdc88edfb7a6ae05c2ad1752 (diff)
parentd609fdf775f2789066cc92ba30f6de2875c10903 (diff)
downloadrust-bf96a7bbed4000ec00cf1a320ecd32352f927d23.tar.gz
rust-bf96a7bbed4000ec00cf1a320ecd32352f927d23.zip
Rollup merge of #56366 - alexreg:stabilise-self_in_typedefs, r=Centril
Stabilize self_in_typedefs feature

[**Tracking Issue**](https://github.com/rust-lang/rust/issues/49303)

r? @centril
Diffstat (limited to 'src/librustc_resolve')
-rw-r--r--src/librustc_resolve/lib.rs20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index c1d4643c240..fdac1e3b816 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -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);
-                }
+                });
             });
         });
     }
@@ -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) {