From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/privacy/associated-item-privacy-inherent.rs | 6 +- .../associated-item-privacy-inherent.stderr | 6 +- .../ui/privacy/associated-item-privacy-trait.rs | 6 +- .../privacy/associated-item-privacy-trait.stderr | 6 +- .../privacy/auxiliary/issue-17718-const-privacy.rs | 8 ++ src/test/ui/privacy/effective_visibilities.rs | 75 ++++++++++++ src/test/ui/privacy/effective_visibilities.stderr | 134 +++++++++++++++++++++ src/test/ui/privacy/issue-17718-const-privacy.rs | 16 +++ .../ui/privacy/issue-17718-const-privacy.stderr | 27 +++++ src/test/ui/privacy/issue-30079.stderr | 2 +- .../ui/privacy/private-in-public-assoc-ty.stderr | 2 +- .../privacy/private-in-public-non-principal.stderr | 2 +- src/test/ui/privacy/private-in-public-warn.stderr | 4 +- src/test/ui/privacy/private-inferred-type-3.rs | 2 +- src/test/ui/privacy/private-inferred-type-3.stderr | 2 +- src/test/ui/privacy/private-inferred-type.rs | 2 +- src/test/ui/privacy/private-inferred-type.stderr | 2 +- src/test/ui/privacy/reachable-unnameable-items.rs | 1 - src/test/ui/privacy/where-priv-type.stderr | 2 +- 19 files changed, 282 insertions(+), 23 deletions(-) create mode 100644 src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs create mode 100644 src/test/ui/privacy/effective_visibilities.rs create mode 100644 src/test/ui/privacy/effective_visibilities.stderr create mode 100644 src/test/ui/privacy/issue-17718-const-privacy.rs create mode 100644 src/test/ui/privacy/issue-17718-const-privacy.stderr (limited to 'src/test/ui/privacy') diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.rs b/src/test/ui/privacy/associated-item-privacy-inherent.rs index c3ae92023..7b7c734a9 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.rs +++ b/src/test/ui/privacy/associated-item-privacy-inherent.rs @@ -11,11 +11,11 @@ mod priv_nominal { pub macro mac() { let value = Pub::method; - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private value; - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private Pub.method(); - //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private Pub::CONST; //~^ ERROR associated constant `CONST` is private // let _: Pub::AssocTy; diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr index 4478e5c2a..f4d4ee459 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr +++ b/src/test/ui/privacy/associated-item-privacy-inherent.stderr @@ -1,4 +1,4 @@ -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:13:21 | LL | let value = Pub::method; @@ -9,7 +9,7 @@ LL | priv_nominal::mac!(); | = note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:15:9 | LL | value; @@ -20,7 +20,7 @@ LL | priv_nominal::mac!(); | = note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private +error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:17:13 | LL | Pub.method(); diff --git a/src/test/ui/privacy/associated-item-privacy-trait.rs b/src/test/ui/privacy/associated-item-privacy-trait.rs index c07aeed99..ad9a5e15c 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.rs +++ b/src/test/ui/privacy/associated-item-privacy-trait.rs @@ -13,11 +13,11 @@ mod priv_trait { pub macro mac() { let value = ::method; - //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private value; - //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private Pub.method(); - //~^ ERROR type `for<'r> fn(&'r Self) {::method}` is private + //~^ ERROR type `for<'a> fn(&'a Self) {::method}` is private ::CONST; //~^ ERROR associated constant `::CONST` is private let _: ::AssocTy; diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr index 6095f5f42..c4be1a9d9 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -1,4 +1,4 @@ -error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private +error: type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:15:21 | LL | let value = ::method; @@ -9,7 +9,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private +error: type `for<'a> fn(&'a priv_trait::Pub) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:17:9 | LL | value; @@ -20,7 +20,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Self) {::method}` is private +error: type `for<'a> fn(&'a Self) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:19:13 | LL | Pub.method(); diff --git a/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs new file mode 100644 index 000000000..93cf4bf3e --- /dev/null +++ b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs @@ -0,0 +1,8 @@ +pub use foo::FOO2; + +pub const FOO: usize = 3; +const BAR: usize = 3; + +mod foo { + pub const FOO2: usize = 3; +} diff --git a/src/test/ui/privacy/effective_visibilities.rs b/src/test/ui/privacy/effective_visibilities.rs new file mode 100644 index 000000000..1d806a1d1 --- /dev/null +++ b/src/test/ui/privacy/effective_visibilities.rs @@ -0,0 +1,75 @@ +#![feature(rustc_attrs)] + +#[rustc_effective_visibility] +mod outer { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) + #[rustc_effective_visibility] + pub mod inner1 { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + + #[rustc_effective_visibility] + extern "C" {} //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + + #[rustc_effective_visibility] + pub trait PubTrait { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + const A: i32; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + type B; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + } + + #[rustc_effective_visibility] + struct PrivStruct; //~ ERROR not in the table + + #[rustc_effective_visibility] + pub union PubUnion { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + a: u8, //~ ERROR not in the table + #[rustc_effective_visibility] + pub b: u8, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + } + + #[rustc_effective_visibility] + pub enum Enum { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + A( //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + PubUnion, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + ), + } + } + + #[rustc_effective_visibility] + macro_rules! none_macro { //~ Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) + () => {}; + } + + #[macro_export] + #[rustc_effective_visibility] + macro_rules! public_macro { //~ Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + () => {}; + } + + #[rustc_effective_visibility] + pub struct ReachableStruct { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + pub a: u8, //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub + } +} + +#[rustc_effective_visibility] +pub use outer::inner1; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + +pub fn foo() -> outer::ReachableStruct { outer::ReachableStruct {a: 0} } + +mod half_public_import { + #[rustc_effective_visibility] + pub type HalfPublicImport = u8; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + #[rustc_effective_visibility] + #[allow(non_upper_case_globals)] + pub(crate) const HalfPublicImport: u8 = 0; //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) +} + +#[rustc_effective_visibility] +pub use half_public_import::HalfPublicImport; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + //~^ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + +fn main() {} diff --git a/src/test/ui/privacy/effective_visibilities.stderr b/src/test/ui/privacy/effective_visibilities.stderr new file mode 100644 index 000000000..1c6201600 --- /dev/null +++ b/src/test/ui/privacy/effective_visibilities.stderr @@ -0,0 +1,134 @@ +error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) + --> $DIR/effective_visibilities.rs:4:1 + | +LL | mod outer { + | ^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:6:5 + | +LL | pub mod inner1 { + | ^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:9:9 + | +LL | extern "C" {} + | ^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:12:9 + | +LL | pub trait PubTrait { + | ^^^^^^^^^^^^^^^^^^ + +error: not in the table + --> $DIR/effective_visibilities.rs:20:9 + | +LL | struct PrivStruct; + | ^^^^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:23:9 + | +LL | pub union PubUnion { + | ^^^^^^^^^^^^^^^^^^ + +error: not in the table + --> $DIR/effective_visibilities.rs:25:13 + | +LL | a: u8, + | ^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:27:13 + | +LL | pub b: u8, + | ^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:31:9 + | +LL | pub enum Enum { + | ^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:33:13 + | +LL | A( + | ^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:35:17 + | +LL | PubUnion, + | ^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) + --> $DIR/effective_visibilities.rs:41:5 + | +LL | macro_rules! none_macro { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:47:5 + | +LL | macro_rules! public_macro { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:52:5 + | +LL | pub struct ReachableStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:54:9 + | +LL | pub a: u8, + | ^^^^^^^^^ + +error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:59:9 + | +LL | pub use outer::inner1; + | ^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:65:5 + | +LL | pub type HalfPublicImport = u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) + --> $DIR/effective_visibilities.rs:68:5 + | +LL | pub(crate) const HalfPublicImport: u8 = 0; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:72:9 + | +LL | pub use half_public_import::HalfPublicImport; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:72:9 + | +LL | pub use half_public_import::HalfPublicImport; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:14:13 + | +LL | const A: i32; + | ^^^^^^^^^^^^ + +error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub + --> $DIR/effective_visibilities.rs:16:13 + | +LL | type B; + | ^^^^^^ + +error: aborting due to 22 previous errors + diff --git a/src/test/ui/privacy/issue-17718-const-privacy.rs b/src/test/ui/privacy/issue-17718-const-privacy.rs new file mode 100644 index 000000000..6ab3a60df --- /dev/null +++ b/src/test/ui/privacy/issue-17718-const-privacy.rs @@ -0,0 +1,16 @@ +// aux-build:issue-17718-const-privacy.rs + +extern crate issue_17718_const_privacy as other; + +use a::B; //~ ERROR: constant `B` is private +use other::{ + FOO, + BAR, //~ ERROR: constant `BAR` is private + FOO2, +}; + +mod a { + const B: usize = 3; +} + +fn main() {} diff --git a/src/test/ui/privacy/issue-17718-const-privacy.stderr b/src/test/ui/privacy/issue-17718-const-privacy.stderr new file mode 100644 index 000000000..133a6360b --- /dev/null +++ b/src/test/ui/privacy/issue-17718-const-privacy.stderr @@ -0,0 +1,27 @@ +error[E0603]: constant `B` is private + --> $DIR/issue-17718-const-privacy.rs:5:8 + | +LL | use a::B; + | ^ private constant + | +note: the constant `B` is defined here + --> $DIR/issue-17718-const-privacy.rs:13:5 + | +LL | const B: usize = 3; + | ^^^^^^^^^^^^^^^^^^^ + +error[E0603]: constant `BAR` is private + --> $DIR/issue-17718-const-privacy.rs:8:5 + | +LL | BAR, + | ^^^ private constant + | +note: the constant `BAR` is defined here + --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1 + | +LL | const BAR: usize = 3; + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/privacy/issue-30079.stderr b/src/test/ui/privacy/issue-30079.stderr index dc98cfe3b..9179ff339 100644 --- a/src/test/ui/privacy/issue-30079.stderr +++ b/src/test/ui/privacy/issue-30079.stderr @@ -4,9 +4,9 @@ warning: private type `m1::Priv` in public interface (error E0446) LL | pub fn f(_: Priv) {} | ^^^^^^^^^^^^^^^^^ | - = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 + = note: `#[warn(private_in_public)]` on by default error[E0446]: private type `m2::Priv` in public interface --> $DIR/issue-30079.rs:18:9 diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr index 1abeafe39..a59027d81 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.stderr +++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr @@ -13,9 +13,9 @@ warning: private trait `PrivTr` in public interface (error E0445) LL | type Alias1: PrivTr; | ^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 + = note: `#[warn(private_in_public)]` on by default warning: private type `Priv` in public interface (error E0446) --> $DIR/private-in-public-assoc-ty.rs:27:9 diff --git a/src/test/ui/privacy/private-in-public-non-principal.stderr b/src/test/ui/privacy/private-in-public-non-principal.stderr index 5b4123ea8..de20cada4 100644 --- a/src/test/ui/privacy/private-in-public-non-principal.stderr +++ b/src/test/ui/privacy/private-in-public-non-principal.stderr @@ -4,9 +4,9 @@ warning: private trait `PrivNonPrincipal` in public interface (error E0445) LL | pub fn leak_dyn_nonprincipal() -> Box { loop {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 + = note: `#[warn(private_in_public)]` on by default error: missing documentation for an associated function --> $DIR/private-in-public-non-principal.rs:14:9 diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/src/test/ui/privacy/private-in-public-warn.stderr index f2ff6cf2f..66f91ce6f 100644 --- a/src/test/ui/privacy/private-in-public-warn.stderr +++ b/src/test/ui/privacy/private-in-public-warn.stderr @@ -4,13 +4,13 @@ error: private type `types::Priv` in public interface (error E0446) LL | pub type Alias = Priv; | ^^^^^^^^^^^^^^ | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 note: the lint level is defined here --> $DIR/private-in-public-warn.rs:5:9 | LL | #![deny(private_in_public)] | ^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:18:12 diff --git a/src/test/ui/privacy/private-inferred-type-3.rs b/src/test/ui/privacy/private-inferred-type-3.rs index 00f0a715a..0337aedd0 100644 --- a/src/test/ui/privacy/private-inferred-type-3.rs +++ b/src/test/ui/privacy/private-inferred-type-3.rs @@ -6,7 +6,7 @@ // error-pattern:type `fn() {::method}` is private // error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private // error-pattern:type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private -// error-pattern:type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +// error-pattern:type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private #![feature(decl_macro)] diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr index f9dd1c3d0..00b61512d 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/src/test/ui/privacy/private-inferred-type-3.stderr @@ -46,7 +46,7 @@ LL | ext::m!(); | = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +error: type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); diff --git a/src/test/ui/privacy/private-inferred-type.rs b/src/test/ui/privacy/private-inferred-type.rs index b083a3970..e8743dd96 100644 --- a/src/test/ui/privacy/private-inferred-type.rs +++ b/src/test/ui/privacy/private-inferred-type.rs @@ -47,7 +47,7 @@ mod m { PubTupleStruct; //~^ ERROR type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private Pub(0u8).priv_method(); - //~^ ERROR type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private + //~^ ERROR type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private } trait Trait {} diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr index aecd8b58c..fc3f9ab62 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/src/test/ui/privacy/private-inferred-type.stderr @@ -161,7 +161,7 @@ LL | m::m!(); | = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: type `for<'r> fn(&'r Pub) {Pub::::priv_method}` is private +error: type `for<'a> fn(&'a Pub) {Pub::::priv_method}` is private --> $DIR/private-inferred-type.rs:49:18 | LL | Pub(0u8).priv_method(); diff --git a/src/test/ui/privacy/reachable-unnameable-items.rs b/src/test/ui/privacy/reachable-unnameable-items.rs index 1c91541e6..1babe0119 100644 --- a/src/test/ui/privacy/reachable-unnameable-items.rs +++ b/src/test/ui/privacy/reachable-unnameable-items.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-wasm32-bare compiled with panic=abort by default // needs-unwind // aux-build:reachable-unnameable-items.rs diff --git a/src/test/ui/privacy/where-priv-type.stderr b/src/test/ui/privacy/where-priv-type.stderr index 7eb71346a..c5fb2cdb0 100644 --- a/src/test/ui/privacy/where-priv-type.stderr +++ b/src/test/ui/privacy/where-priv-type.stderr @@ -4,9 +4,9 @@ warning: private type `PrivTy` in public interface (error E0446) LL | pub struct S | ^^^^^^^^^^^^ | - = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 + = note: `#[warn(private_in_public)]` on by default warning: private type `PrivTy` in public interface (error E0446) --> $DIR/where-priv-type.rs:27:1 -- cgit v1.2.3