about summary refs log tree commit diff
path: root/src/test
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/test
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/test')
-rw-r--r--src/test/run-pass/self/self-in-typedefs.rs3
-rw-r--r--src/test/ui/error-codes/E0411.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs18
-rw-r--r--src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr11
-rw-r--r--src/test/ui/issues/issue-36638.rs1
-rw-r--r--src/test/ui/issues/issue-36638.stderr13
-rw-r--r--src/test/ui/resolve/issue-24968.stderr2
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl-2.stderr2
8 files changed, 16 insertions, 36 deletions
diff --git a/src/test/run-pass/self/self-in-typedefs.rs b/src/test/run-pass/self/self-in-typedefs.rs
index 92eccb47e18..84a7e18f91a 100644
--- a/src/test/run-pass/self/self-in-typedefs.rs
+++ b/src/test/run-pass/self/self-in-typedefs.rs
@@ -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
diff --git a/src/test/ui/error-codes/E0411.stderr b/src/test/ui/error-codes/E0411.stderr
index a5f2e3a7b93..4e85f651b55 100644
--- a/src/test/ui/error-codes/E0411.stderr
+++ b/src/test/ui/error-codes/E0411.stderr
@@ -2,7 +2,7 @@ error[E0411]: cannot find type `Self` in this scope
   --> $DIR/E0411.rs:12:6
    |
 LL |     <Self>::foo; //~ ERROR E0411
-   |      ^^^^ `Self` is only available in traits and impls
+   |      ^^^^ `Self` is only available in impls, traits, and type definitions
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs b/src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs
deleted file mode 100644
index 4b476a0a645..00000000000
--- a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum StackList<'a, T: 'a> {
-    Nil,
-    Cons(T, &'a Self)
-    //~^ ERROR cannot find type `Self` in this scope
-    //~| `Self` is only available in traits and impls
-}
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr b/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr
deleted file mode 100644
index ab04953f3e5..00000000000
--- a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0411]: cannot find type `Self` in this scope
-  --> $DIR/feature-gate-self_in_typedefs.rs:13:17
-   |
-LL |     Cons(T, &'a Self)
-   |                 ^^^^ `Self` is only available in traits and impls
-   |
-   = help: add #![feature(self_in_typedefs)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0411`.
diff --git a/src/test/ui/issues/issue-36638.rs b/src/test/ui/issues/issue-36638.rs
index 5e43536ef3f..acb501c29fc 100644
--- a/src/test/ui/issues/issue-36638.rs
+++ b/src/test/ui/issues/issue-36638.rs
@@ -12,6 +12,7 @@
 
 struct Foo<Self>(Self);
 //~^ ERROR expected identifier, found keyword `Self`
+//~^^ ERROR E0392
 
 trait Bar<Self> {}
 //~^ ERROR expected identifier, found keyword `Self`
diff --git a/src/test/ui/issues/issue-36638.stderr b/src/test/ui/issues/issue-36638.stderr
index d111fb469bf..155eb170b09 100644
--- a/src/test/ui/issues/issue-36638.stderr
+++ b/src/test/ui/issues/issue-36638.stderr
@@ -5,10 +5,19 @@ LL | struct Foo<Self>(Self);
    |            ^^^^ expected identifier, found keyword
 
 error: expected identifier, found keyword `Self`
-  --> $DIR/issue-36638.rs:16:11
+  --> $DIR/issue-36638.rs:17:11
    |
 LL | trait Bar<Self> {}
    |           ^^^^ expected identifier, found keyword
 
-error: aborting due to 2 previous errors
+error[E0392]: parameter `Self` is never used
+  --> $DIR/issue-36638.rs:13:12
+   |
+LL | struct Foo<Self>(Self);
+   |            ^^^^ unused type parameter
+   |
+   = help: consider removing `Self` or using a marker such as `std::marker::PhantomData`
+
+error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/resolve/issue-24968.stderr b/src/test/ui/resolve/issue-24968.stderr
index 9a1d5ea170e..cfb20340504 100644
--- a/src/test/ui/resolve/issue-24968.stderr
+++ b/src/test/ui/resolve/issue-24968.stderr
@@ -2,7 +2,7 @@ error[E0411]: cannot find type `Self` in this scope
   --> $DIR/issue-24968.rs:11:11
    |
 LL | fn foo(_: Self) {
-   |           ^^^^ `Self` is only available in traits and impls
+   |           ^^^^ `Self` is only available in impls, traits, and type definitions
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/resolve/resolve-self-in-impl-2.stderr b/src/test/ui/resolve/resolve-self-in-impl-2.stderr
index 183b9b66327..b3a8261bcfc 100644
--- a/src/test/ui/resolve/resolve-self-in-impl-2.stderr
+++ b/src/test/ui/resolve/resolve-self-in-impl-2.stderr
@@ -2,7 +2,7 @@ error[E0411]: expected trait, found self type `Self`
   --> $DIR/resolve-self-in-impl-2.rs:14:6
    |
 LL | impl Self for S {} //~ ERROR expected trait, found self type `Self`
-   |      ^^^^ `Self` is only available in traits and impls
+   |      ^^^^ `Self` is only available in impls, traits, and type definitions
 
 error[E0405]: cannot find trait `N` in `Self`
   --> $DIR/resolve-self-in-impl-2.rs:15:12