From 7616b30bff843ff279fae9ae4eea44b87d46b310 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Sat, 11 Jul 2020 19:24:04 -0400 Subject: [PATCH] Add unstable default feature enabled test --- .../auxiliary/unstable_generic_param.rs | 6 ++ .../generics-default-stability.rs | 4 ++ .../generics-default-stability.stderr | 56 +++++++++---------- 3 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs index 64d725e55ed..82eed9a38f9 100644 --- a/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs +++ b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs @@ -55,6 +55,12 @@ pub struct Struct5<#[unstable(feature = "unstable_default", issue = "none")] A = pub field: A, } +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: T, +} + #[stable(feature = "stable_test_feature", since = "1.0.0")] pub const STRUCT1: Struct1 = Struct1 { field: 1 }; diff --git a/src/test/ui/stability-attribute/generics-default-stability.rs b/src/test/ui/stability-attribute/generics-default-stability.rs index c44f3c32bbe..26f7692209f 100644 --- a/src/test/ui/stability-attribute/generics-default-stability.rs +++ b/src/test/ui/stability-attribute/generics-default-stability.rs @@ -1,5 +1,6 @@ // ignore-tidy-linelength // aux-build:unstable_generic_param.rs +#![feature(unstable_default6)] extern crate unstable_generic_param; @@ -105,4 +106,7 @@ fn main() { //~^ use of deprecated item 'unstable_generic_param::Struct5': test [deprecated] //~^^ use of deprecated item 'unstable_generic_param::Struct5': test [deprecated] //~^^^ use of deprecated item 'unstable_generic_param::Struct5::field': test [deprecated] + + let _: Struct6 = Struct6 { field: 1 }; // ok + let _: Struct6 = Struct6 { field: 0 }; // ok } diff --git a/src/test/ui/stability-attribute/generics-default-stability.stderr b/src/test/ui/stability-attribute/generics-default-stability.stderr index 87ebe65dcfc..d9e195c21d6 100644 --- a/src/test/ui/stability-attribute/generics-default-stability.stderr +++ b/src/test/ui/stability-attribute/generics-default-stability.stderr @@ -1,5 +1,5 @@ error[E0658]: use of unstable library feature 'unstable_default' - --> $DIR/generics-default-stability.rs:16:13 + --> $DIR/generics-default-stability.rs:17:13 | LL | impl Trait1 for S { | ^^^^^ @@ -7,7 +7,7 @@ LL | impl Trait1 for S { = 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:20:13 + --> $DIR/generics-default-stability.rs:21:13 | LL | impl Trait1 for S { | ^^^^^ @@ -15,7 +15,7 @@ LL | impl Trait1 for S { = 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:24:13 + --> $DIR/generics-default-stability.rs:25:13 | LL | impl Trait2 for S { | ^^^^^ @@ -23,7 +23,7 @@ LL | impl Trait2 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:83:29 + --> $DIR/generics-default-stability.rs:84:29 | LL | let _: Struct4 = Struct4 { field: 1 }; | ^^^^^^^ @@ -31,73 +31,73 @@ LL | let _: Struct4 = Struct4 { field: 1 }; = note: `#[warn(deprecated)]` on by default warning: use of deprecated item 'unstable_generic_param::Struct4': test - --> $DIR/generics-default-stability.rs:83:12 + --> $DIR/generics-default-stability.rs:84:12 | LL | let _: Struct4 = Struct4 { field: 1 }; | ^^^^^^^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct4': test - --> $DIR/generics-default-stability.rs:88:12 + --> $DIR/generics-default-stability.rs:89:12 | LL | let _: Struct4 = STRUCT4; | ^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct4': test - --> $DIR/generics-default-stability.rs:89:12 + --> $DIR/generics-default-stability.rs:90:12 | LL | let _: Struct4 = STRUCT4; | ^^^^^^^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct4': test - --> $DIR/generics-default-stability.rs:90:29 + --> $DIR/generics-default-stability.rs:91:29 | LL | let _: Struct4 = Struct4 { field: 0 }; | ^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct4': test - --> $DIR/generics-default-stability.rs:90:12 + --> $DIR/generics-default-stability.rs:91:12 | LL | let _: Struct4 = Struct4 { field: 0 }; | ^^^^^^^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:96:29 + --> $DIR/generics-default-stability.rs:97:29 | LL | let _: Struct5 = Struct5 { field: 1 }; | ^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:96:12 + --> $DIR/generics-default-stability.rs:97:12 | LL | let _: Struct5 = Struct5 { field: 1 }; | ^^^^^^^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:101:12 + --> $DIR/generics-default-stability.rs:102:12 | LL | let _: Struct5 = STRUCT5; | ^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:102:12 + --> $DIR/generics-default-stability.rs:103:12 | LL | let _: Struct5 = STRUCT5; | ^^^^^^^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:104:29 + --> $DIR/generics-default-stability.rs:105:29 | LL | let _: Struct5 = Struct5 { field: 0 }; | ^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5': test - --> $DIR/generics-default-stability.rs:104:12 + --> $DIR/generics-default-stability.rs:105:12 | LL | let _: Struct5 = Struct5 { field: 0 }; | ^^^^^^^^^^^^^^ error[E0658]: use of unstable library feature 'unstable_default' - --> $DIR/generics-default-stability.rs:35:20 + --> $DIR/generics-default-stability.rs:36:20 | LL | let _: Struct1 = Struct1 { field: 1 }; | ^^^^^ @@ -105,7 +105,7 @@ LL | let _: Struct1 = Struct1 { 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:39:20 + --> $DIR/generics-default-stability.rs:40:20 | LL | let _: Struct1 = STRUCT1; | ^^^^^ @@ -113,7 +113,7 @@ LL | let _: Struct1 = STRUCT1; = 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:40:20 + --> $DIR/generics-default-stability.rs:41:20 | LL | let _: Struct1 = Struct1 { field: 0 }; | ^^^^^ @@ -121,7 +121,7 @@ LL | let _: Struct1 = 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:69:27 + --> $DIR/generics-default-stability.rs:70:27 | LL | let _: Struct3 = STRUCT3; | ^^^^^ @@ -129,7 +129,7 @@ LL | let _: Struct3 = 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:71:27 + --> $DIR/generics-default-stability.rs:72:27 | LL | let _: Struct3 = Struct3 { field1: 0, field2: 0 }; | ^^^^^ @@ -137,7 +137,7 @@ LL | let _: Struct3 = 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:72:27 + --> $DIR/generics-default-stability.rs:73:27 | LL | let _: Struct3 = Struct3 { field1: 0, field2: 0 }; | ^^^^^ @@ -145,7 +145,7 @@ LL | let _: Struct3 = 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:96:20 + --> $DIR/generics-default-stability.rs:97:20 | LL | let _: Struct5 = Struct5 { field: 1 }; | ^^^^^ @@ -153,7 +153,7 @@ LL | let _: Struct5 = 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:102:20 + --> $DIR/generics-default-stability.rs:103:20 | LL | let _: Struct5 = STRUCT5; | ^^^^^ @@ -161,7 +161,7 @@ LL | let _: Struct5 = 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 + --> $DIR/generics-default-stability.rs:105:20 | LL | let _: Struct5 = Struct5 { field: 0 }; | ^^^^^ @@ -169,25 +169,25 @@ LL | let _: Struct5 = 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:83:39 + --> $DIR/generics-default-stability.rs:84:39 | LL | let _: Struct4 = Struct4 { field: 1 }; | ^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct4::field': test - --> $DIR/generics-default-stability.rs:90:39 + --> $DIR/generics-default-stability.rs:91:39 | LL | let _: Struct4 = Struct4 { field: 0 }; | ^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5::field': test - --> $DIR/generics-default-stability.rs:96:39 + --> $DIR/generics-default-stability.rs:97:39 | LL | let _: Struct5 = Struct5 { field: 1 }; | ^^^^^^^^ warning: use of deprecated item 'unstable_generic_param::Struct5::field': test - --> $DIR/generics-default-stability.rs:104:39 + --> $DIR/generics-default-stability.rs:105:39 | LL | let _: Struct5 = Struct5 { field: 0 }; | ^^^^^^^^