about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAvi Dessauer <avi.the.coder@gmail.com>2020-07-11 19:08:05 -0400
committerJacob Hughes <j@jacobhughes.me>2020-09-22 21:55:41 -0400
commitaf19d4492124a9681c1e3bc9c9effe1641ad7d20 (patch)
tree46e267b0e9e6c37faad5663e894afb13c0f83592
parent2793da3f39033d7f0b2c07a3556d68ccd4d03d4e (diff)
downloadrust-af19d4492124a9681c1e3bc9c9effe1641ad7d20.tar.gz
rust-af19d4492124a9681c1e3bc9c9effe1641ad7d20.zip
Add test case demonstrating leak
-rw-r--r--src/test/ui/stability-attribute/generics-default-stability.rs2
-rw-r--r--src/test/ui/stability-attribute/generics-default-stability.stderr44
2 files changed, 24 insertions, 22 deletions
diff --git a/src/test/ui/stability-attribute/generics-default-stability.rs b/src/test/ui/stability-attribute/generics-default-stability.rs
index de178eee1d7..c44f3c32bbe 100644
--- a/src/test/ui/stability-attribute/generics-default-stability.rs
+++ b/src/test/ui/stability-attribute/generics-default-stability.rs
@@ -44,6 +44,8 @@ fn main() {
     // and can be used without the 'unstable_default' feature.
     let _ = STRUCT1.field;
     let _ = Struct1 { field: 1 };
+    let _ = Struct1 { field: () };
+    let _ = Struct1 { field: 1isize };
     let _: Struct1 = Struct1 { field: 1 };
     let _: usize = STRUCT1.field;
     let _ = STRUCT1.field + 1;
diff --git a/src/test/ui/stability-attribute/generics-default-stability.stderr b/src/test/ui/stability-attribute/generics-default-stability.stderr
index 2bc98cc0095..87ebe65dcfc 100644
--- a/src/test/ui/stability-attribute/generics-default-stability.stderr
+++ b/src/test/ui/stability-attribute/generics-default-stability.stderr
@@ -23,7 +23,7 @@ LL | impl Trait2<usize> for S {
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:81:29
+  --> $DIR/generics-default-stability.rs:83:29
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 1 };
    |                             ^^^^^^^
@@ -31,67 +31,67 @@ LL |     let _: Struct4<isize> = Struct4 { field: 1 };
    = note: `#[warn(deprecated)]` on by default
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:81:12
+  --> $DIR/generics-default-stability.rs:83:12
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 1 };
    |            ^^^^^^^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:86:12
+  --> $DIR/generics-default-stability.rs:88:12
    |
 LL |     let _: Struct4 = STRUCT4;
    |            ^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:87:12
+  --> $DIR/generics-default-stability.rs:89:12
    |
 LL |     let _: Struct4<usize> = STRUCT4;
    |            ^^^^^^^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:88:29
+  --> $DIR/generics-default-stability.rs:90:29
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 0 };
    |                             ^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct4': test
-  --> $DIR/generics-default-stability.rs:88:12
+  --> $DIR/generics-default-stability.rs:90:12
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 0 };
    |            ^^^^^^^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:94:29
+  --> $DIR/generics-default-stability.rs:96:29
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 1 };
    |                             ^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:94:12
+  --> $DIR/generics-default-stability.rs:96:12
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 1 };
    |            ^^^^^^^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:99:12
+  --> $DIR/generics-default-stability.rs:101:12
    |
 LL |     let _: Struct5 = STRUCT5;
    |            ^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:100:12
+  --> $DIR/generics-default-stability.rs:102:12
    |
 LL |     let _: Struct5<usize> = STRUCT5;
    |            ^^^^^^^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:102:29
+  --> $DIR/generics-default-stability.rs:104:29
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 0 };
    |                             ^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5': test
-  --> $DIR/generics-default-stability.rs:102:12
+  --> $DIR/generics-default-stability.rs:104:12
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 0 };
    |            ^^^^^^^^^^^^^^
@@ -121,7 +121,7 @@ LL |     let _: Struct1<isize> = Struct1 { field: 0 };
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:67:27
+  --> $DIR/generics-default-stability.rs:69:27
    |
 LL |     let _: Struct3<isize, usize> = STRUCT3;
    |                           ^^^^^
@@ -129,7 +129,7 @@ LL |     let _: Struct3<isize, usize> = STRUCT3;
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:69:27
+  --> $DIR/generics-default-stability.rs:71:27
    |
 LL |     let _: Struct3<isize, isize> = Struct3 { field1: 0, field2: 0 };
    |                           ^^^^^
@@ -137,7 +137,7 @@ LL |     let _: Struct3<isize, isize> = Struct3 { field1: 0, field2: 0 };
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:70:27
+  --> $DIR/generics-default-stability.rs:72:27
    |
 LL |     let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 };
    |                           ^^^^^
@@ -145,7 +145,7 @@ LL |     let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 };
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:94:20
+  --> $DIR/generics-default-stability.rs:96:20
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 1 };
    |                    ^^^^^
@@ -153,7 +153,7 @@ LL |     let _: Struct5<isize> = Struct5 { field: 1 };
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:100:20
+  --> $DIR/generics-default-stability.rs:102:20
    |
 LL |     let _: Struct5<usize> = STRUCT5;
    |                    ^^^^^
@@ -161,7 +161,7 @@ LL |     let _: Struct5<usize> = STRUCT5;
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_default'
-  --> $DIR/generics-default-stability.rs:102:20
+  --> $DIR/generics-default-stability.rs:104:20
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 0 };
    |                    ^^^^^
@@ -169,25 +169,25 @@ LL |     let _: Struct5<isize> = Struct5 { field: 0 };
    = help: add `#![feature(unstable_default)]` to the crate attributes to enable
 
 warning: use of deprecated item 'unstable_generic_param::Struct4::field': test
-  --> $DIR/generics-default-stability.rs:81:39
+  --> $DIR/generics-default-stability.rs:83:39
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 1 };
    |                                       ^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct4::field': test
-  --> $DIR/generics-default-stability.rs:88:39
+  --> $DIR/generics-default-stability.rs:90:39
    |
 LL |     let _: Struct4<isize> = Struct4 { field: 0 };
    |                                       ^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5::field': test
-  --> $DIR/generics-default-stability.rs:94:39
+  --> $DIR/generics-default-stability.rs:96:39
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 1 };
    |                                       ^^^^^^^^
 
 warning: use of deprecated item 'unstable_generic_param::Struct5::field': test
-  --> $DIR/generics-default-stability.rs:102:39
+  --> $DIR/generics-default-stability.rs:104:39
    |
 LL |     let _: Struct5<isize> = Struct5 { field: 0 };
    |                                       ^^^^^^^^