Add test case demonstrating leak

This commit is contained in:
Avi Dessauer 2020-07-11 19:08:05 -04:00 committed by Jacob Hughes
parent 2793da3f39
commit af19d44921
2 changed files with 30 additions and 28 deletions

View File

@ -44,6 +44,8 @@ fn main() {
// and can be used without the 'unstable_default' feature. // and can be used without the 'unstable_default' feature.
let _ = STRUCT1.field; let _ = STRUCT1.field;
let _ = Struct1 { field: 1 }; let _ = Struct1 { field: 1 };
let _ = Struct1 { field: () };
let _ = Struct1 { field: 1isize };
let _: Struct1 = Struct1 { field: 1 }; let _: Struct1 = Struct1 { field: 1 };
let _: usize = STRUCT1.field; let _: usize = STRUCT1.field;
let _ = STRUCT1.field + 1; let _ = STRUCT1.field + 1;

View File

@ -23,7 +23,7 @@ LL | impl Trait2<usize> for S {
= help: add `#![feature(unstable_default)]` to the crate attributes to enable = help: add `#![feature(unstable_default)]` to the crate attributes to enable
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 1 };
| ^^^^^^^ | ^^^^^^^
@ -31,67 +31,67 @@ LL | let _: Struct4<isize> = Struct4 { field: 1 };
= note: `#[warn(deprecated)]` on by default = note: `#[warn(deprecated)]` on by default
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 1 };
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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; LL | let _: Struct4 = STRUCT4;
| ^^^^^^^ | ^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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; LL | let _: Struct4<usize> = STRUCT4;
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 0 };
| ^^^^^^^ | ^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct4': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 0 };
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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 }; LL | let _: Struct5<isize> = Struct5 { field: 1 };
| ^^^^^^^ | ^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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 }; LL | let _: Struct5<isize> = Struct5 { field: 1 };
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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; LL | let _: Struct5 = STRUCT5;
| ^^^^^^^ | ^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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; LL | let _: Struct5<usize> = STRUCT5;
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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 }; LL | let _: Struct5<isize> = Struct5 { field: 0 };
| ^^^^^^^ | ^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5': test 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 }; 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 = help: add `#![feature(unstable_default)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_default' 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; 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 = help: add `#![feature(unstable_default)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_default' 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 }; 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 = help: add `#![feature(unstable_default)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_default' 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 }; LL | let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 };
| ^^^^^ | ^^^^^
@ -145,49 +145,49 @@ LL | let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 };
= help: add `#![feature(unstable_default)]` to the crate attributes to enable = help: add `#![feature(unstable_default)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_default' 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 }; LL | let _: Struct5<isize> = Struct5 { field: 1 };
| ^^^^^ | ^^^^^
| |
= help: add `#![feature(unstable_default)]` to the crate attributes to enable = 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
|
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' error[E0658]: use of unstable library feature 'unstable_default'
--> $DIR/generics-default-stability.rs:102:20 --> $DIR/generics-default-stability.rs:102:20
| |
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:104:20
|
LL | let _: Struct5<isize> = Struct5 { field: 0 }; LL | let _: Struct5<isize> = Struct5 { field: 0 };
| ^^^^^ | ^^^^^
| |
= help: add `#![feature(unstable_default)]` to the crate attributes to enable = help: add `#![feature(unstable_default)]` to the crate attributes to enable
warning: use of deprecated item 'unstable_generic_param::Struct4::field': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 1 };
| ^^^^^^^^ | ^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct4::field': test 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 }; LL | let _: Struct4<isize> = Struct4 { field: 0 };
| ^^^^^^^^ | ^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5::field': test 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 }; LL | let _: Struct5<isize> = Struct5 { field: 1 };
| ^^^^^^^^ | ^^^^^^^^
warning: use of deprecated item 'unstable_generic_param::Struct5::field': test 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 }; LL | let _: Struct5<isize> = Struct5 { field: 0 };
| ^^^^^^^^ | ^^^^^^^^