From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- ...ue-33174-restricted-type-in-public-interface.rs | 28 ---------- ...3174-restricted-type-in-public-interface.stderr | 30 ---------- src/test/ui/pub/pub-ident-fn-2.fixed | 10 ---- src/test/ui/pub/pub-ident-fn-2.rs | 10 ---- src/test/ui/pub/pub-ident-fn-2.stderr | 13 ----- src/test/ui/pub/pub-ident-fn-3.rs | 8 --- src/test/ui/pub/pub-ident-fn-3.stderr | 8 --- src/test/ui/pub/pub-ident-fn-or-struct-2.rs | 4 -- src/test/ui/pub/pub-ident-fn-or-struct-2.stderr | 8 --- src/test/ui/pub/pub-ident-fn-or-struct.rs | 4 -- src/test/ui/pub/pub-ident-fn-or-struct.stderr | 8 --- src/test/ui/pub/pub-ident-fn-with-lifetime-2.rs | 6 -- .../ui/pub/pub-ident-fn-with-lifetime-2.stderr | 13 ----- src/test/ui/pub/pub-ident-fn-with-lifetime.fixed | 8 --- src/test/ui/pub/pub-ident-fn-with-lifetime.rs | 8 --- src/test/ui/pub/pub-ident-fn-with-lifetime.stderr | 13 ----- src/test/ui/pub/pub-ident-fn.fixed | 8 --- src/test/ui/pub/pub-ident-fn.rs | 8 --- src/test/ui/pub/pub-ident-fn.stderr | 13 ----- src/test/ui/pub/pub-ident-struct-with-lifetime.rs | 4 -- .../ui/pub/pub-ident-struct-with-lifetime.stderr | 13 ----- src/test/ui/pub/pub-ident-struct.fixed | 6 -- src/test/ui/pub/pub-ident-struct.rs | 6 -- src/test/ui/pub/pub-ident-struct.stderr | 13 ----- .../ui/pub/pub-ident-with-lifetime-incomplete.rs | 5 -- .../pub/pub-ident-with-lifetime-incomplete.stderr | 8 --- src/test/ui/pub/pub-reexport-priv-extern-crate.rs | 20 ------- .../ui/pub/pub-reexport-priv-extern-crate.stderr | 37 ------------ src/test/ui/pub/pub-restricted-error-fn.rs | 2 - src/test/ui/pub/pub-restricted-error-fn.stderr | 16 ------ src/test/ui/pub/pub-restricted-error.rs | 7 --- src/test/ui/pub/pub-restricted-error.stderr | 10 ---- src/test/ui/pub/pub-restricted-non-path.rs | 5 -- src/test/ui/pub/pub-restricted-non-path.stderr | 8 --- src/test/ui/pub/pub-restricted.rs | 31 ----------- src/test/ui/pub/pub-restricted.stderr | 65 ---------------------- 36 files changed, 464 deletions(-) delete mode 100644 src/test/ui/pub/issue-33174-restricted-type-in-public-interface.rs delete mode 100644 src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-2.fixed delete mode 100644 src/test/ui/pub/pub-ident-fn-2.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-2.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-3.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-3.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-or-struct-2.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-or-struct-2.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-or-struct.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-or-struct.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-with-lifetime-2.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn-with-lifetime.fixed delete mode 100644 src/test/ui/pub/pub-ident-fn-with-lifetime.rs delete mode 100644 src/test/ui/pub/pub-ident-fn-with-lifetime.stderr delete mode 100644 src/test/ui/pub/pub-ident-fn.fixed delete mode 100644 src/test/ui/pub/pub-ident-fn.rs delete mode 100644 src/test/ui/pub/pub-ident-fn.stderr delete mode 100644 src/test/ui/pub/pub-ident-struct-with-lifetime.rs delete mode 100644 src/test/ui/pub/pub-ident-struct-with-lifetime.stderr delete mode 100644 src/test/ui/pub/pub-ident-struct.fixed delete mode 100644 src/test/ui/pub/pub-ident-struct.rs delete mode 100644 src/test/ui/pub/pub-ident-struct.stderr delete mode 100644 src/test/ui/pub/pub-ident-with-lifetime-incomplete.rs delete mode 100644 src/test/ui/pub/pub-ident-with-lifetime-incomplete.stderr delete mode 100644 src/test/ui/pub/pub-reexport-priv-extern-crate.rs delete mode 100644 src/test/ui/pub/pub-reexport-priv-extern-crate.stderr delete mode 100644 src/test/ui/pub/pub-restricted-error-fn.rs delete mode 100644 src/test/ui/pub/pub-restricted-error-fn.stderr delete mode 100644 src/test/ui/pub/pub-restricted-error.rs delete mode 100644 src/test/ui/pub/pub-restricted-error.stderr delete mode 100644 src/test/ui/pub/pub-restricted-non-path.rs delete mode 100644 src/test/ui/pub/pub-restricted-non-path.stderr delete mode 100644 src/test/ui/pub/pub-restricted.rs delete mode 100644 src/test/ui/pub/pub-restricted.stderr (limited to 'src/test/ui/pub') diff --git a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.rs b/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.rs deleted file mode 100644 index 67f888c5e..000000000 --- a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![allow(non_camel_case_types)] // genus is always capitalized - -pub(crate) struct Snail; -//~^ NOTE `Snail` declared as private - -mod sea { - pub(super) struct Turtle; - //~^ NOTE `Turtle` declared as crate-private -} - -struct Tortoise; -//~^ NOTE `Tortoise` declared as private - -pub struct Shell { - pub(crate) creature: T, -} - -pub type Helix_pomatia = Shell; -//~^ ERROR private type `Snail` in public interface -//~| NOTE can't leak private type -pub type Dermochelys_coriacea = Shell; -//~^ ERROR crate-private type `Turtle` in public interface -//~| NOTE can't leak crate-private type -pub type Testudo_graeca = Shell; -//~^ ERROR private type `Tortoise` in public interface -//~| NOTE can't leak private type - -fn main() {} diff --git a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr b/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr deleted file mode 100644 index 39d4f5ac8..000000000 --- a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0446]: private type `Snail` in public interface - --> $DIR/issue-33174-restricted-type-in-public-interface.rs:18:1 - | -LL | pub(crate) struct Snail; - | ----------------------- `Snail` declared as private -... -LL | pub type Helix_pomatia = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type - -error[E0446]: crate-private type `Turtle` in public interface - --> $DIR/issue-33174-restricted-type-in-public-interface.rs:21:1 - | -LL | pub(super) struct Turtle; - | ------------------------ `Turtle` declared as crate-private -... -LL | pub type Dermochelys_coriacea = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type - -error[E0446]: private type `Tortoise` in public interface - --> $DIR/issue-33174-restricted-type-in-public-interface.rs:24:1 - | -LL | struct Tortoise; - | --------------- `Tortoise` declared as private -... -LL | pub type Testudo_graeca = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/ui/pub/pub-ident-fn-2.fixed b/src/test/ui/pub/pub-ident-fn-2.fixed deleted file mode 100644 index afd75a41f..000000000 --- a/src/test/ui/pub/pub-ident-fn-2.fixed +++ /dev/null @@ -1,10 +0,0 @@ -// run-rustfix - -pub fn foo(_s: usize) { bar() } -//~^ ERROR missing `fn` for function definition - -fn bar() {} - -fn main() { - foo(2); -} diff --git a/src/test/ui/pub/pub-ident-fn-2.rs b/src/test/ui/pub/pub-ident-fn-2.rs deleted file mode 100644 index e7b86a909..000000000 --- a/src/test/ui/pub/pub-ident-fn-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-rustfix - -pub foo(_s: usize) { bar() } -//~^ ERROR missing `fn` for function definition - -fn bar() {} - -fn main() { - foo(2); -} diff --git a/src/test/ui/pub/pub-ident-fn-2.stderr b/src/test/ui/pub/pub-ident-fn-2.stderr deleted file mode 100644 index b5b667b41..000000000 --- a/src/test/ui/pub/pub-ident-fn-2.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `fn` for function definition - --> $DIR/pub-ident-fn-2.rs:3:4 - | -LL | pub foo(_s: usize) { bar() } - | ^ - | -help: add `fn` here to parse `foo` as a public function - | -LL | pub fn foo(_s: usize) { bar() } - | ++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn-3.rs b/src/test/ui/pub/pub-ident-fn-3.rs deleted file mode 100644 index fdbea7cf4..000000000 --- a/src/test/ui/pub/pub-ident-fn-3.rs +++ /dev/null @@ -1,8 +0,0 @@ -// #60115 - -mod foo { - pub bar(); - //~^ ERROR missing `fn` or `struct` for function or struct definition -} - -fn main() {} diff --git a/src/test/ui/pub/pub-ident-fn-3.stderr b/src/test/ui/pub/pub-ident-fn-3.stderr deleted file mode 100644 index 6d3d4e592..000000000 --- a/src/test/ui/pub/pub-ident-fn-3.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-fn-3.rs:4:8 - | -LL | pub bar(); - | ---^--- help: if you meant to call a macro, try: `bar!` - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn-or-struct-2.rs b/src/test/ui/pub/pub-ident-fn-or-struct-2.rs deleted file mode 100644 index 8f67cdd29..000000000 --- a/src/test/ui/pub/pub-ident-fn-or-struct-2.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub S(); -//~^ ERROR missing `fn` or `struct` for function or struct definition - -fn main() {} diff --git a/src/test/ui/pub/pub-ident-fn-or-struct-2.stderr b/src/test/ui/pub/pub-ident-fn-or-struct-2.stderr deleted file mode 100644 index 047e66b18..000000000 --- a/src/test/ui/pub/pub-ident-fn-or-struct-2.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-fn-or-struct-2.rs:1:4 - | -LL | pub S(); - | ---^- help: if you meant to call a macro, try: `S!` - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn-or-struct.rs b/src/test/ui/pub/pub-ident-fn-or-struct.rs deleted file mode 100644 index 832831d29..000000000 --- a/src/test/ui/pub/pub-ident-fn-or-struct.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub S (foo) bar -//~^ ERROR missing `fn` or `struct` for function or struct definition - -fn main() {} diff --git a/src/test/ui/pub/pub-ident-fn-or-struct.stderr b/src/test/ui/pub/pub-ident-fn-or-struct.stderr deleted file mode 100644 index c4a196eb2..000000000 --- a/src/test/ui/pub/pub-ident-fn-or-struct.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-fn-or-struct.rs:1:4 - | -LL | pub S (foo) bar - | ---^- help: if you meant to call a macro, try: `S!` - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.rs b/src/test/ui/pub/pub-ident-fn-with-lifetime-2.rs deleted file mode 100644 index 1ee8c84f1..000000000 --- a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub bar<'a>(&self, _s: &'a usize) -> bool { true } -//~^ ERROR missing `fn` for method definition - -fn main() { - bar(2); -} diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr b/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr deleted file mode 100644 index 6a9aeaf4a..000000000 --- a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `fn` for method definition - --> $DIR/pub-ident-fn-with-lifetime-2.rs:1:4 - | -LL | pub bar<'a>(&self, _s: &'a usize) -> bool { true } - | ^^^ - | -help: add `fn` here to parse `bar` as a public method - | -LL | pub fn bar<'a>(&self, _s: &'a usize) -> bool { true } - | ++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime.fixed b/src/test/ui/pub/pub-ident-fn-with-lifetime.fixed deleted file mode 100644 index e510ace5f..000000000 --- a/src/test/ui/pub/pub-ident-fn-with-lifetime.fixed +++ /dev/null @@ -1,8 +0,0 @@ -// run-rustfix - -pub fn foo<'a>(_s: &'a usize) -> bool { true } -//~^ ERROR missing `fn` for function definition - -fn main() { - foo(&2); -} diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime.rs b/src/test/ui/pub/pub-ident-fn-with-lifetime.rs deleted file mode 100644 index 63e6eca15..000000000 --- a/src/test/ui/pub/pub-ident-fn-with-lifetime.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-rustfix - -pub foo<'a>(_s: &'a usize) -> bool { true } -//~^ ERROR missing `fn` for function definition - -fn main() { - foo(&2); -} diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr b/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr deleted file mode 100644 index c1ca0136b..000000000 --- a/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `fn` for function definition - --> $DIR/pub-ident-fn-with-lifetime.rs:3:4 - | -LL | pub foo<'a>(_s: &'a usize) -> bool { true } - | ^^^ - | -help: add `fn` here to parse `foo` as a public function - | -LL | pub fn foo<'a>(_s: &'a usize) -> bool { true } - | ++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-fn.fixed b/src/test/ui/pub/pub-ident-fn.fixed deleted file mode 100644 index 65ed8c7b4..000000000 --- a/src/test/ui/pub/pub-ident-fn.fixed +++ /dev/null @@ -1,8 +0,0 @@ -// run-rustfix - -pub fn foo(_s: usize) -> bool { true } -//~^ ERROR missing `fn` for function definition - -fn main() { - foo(2); -} diff --git a/src/test/ui/pub/pub-ident-fn.rs b/src/test/ui/pub/pub-ident-fn.rs deleted file mode 100644 index 2fe4d34fb..000000000 --- a/src/test/ui/pub/pub-ident-fn.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-rustfix - -pub foo(_s: usize) -> bool { true } -//~^ ERROR missing `fn` for function definition - -fn main() { - foo(2); -} diff --git a/src/test/ui/pub/pub-ident-fn.stderr b/src/test/ui/pub/pub-ident-fn.stderr deleted file mode 100644 index cb94c48ad..000000000 --- a/src/test/ui/pub/pub-ident-fn.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `fn` for function definition - --> $DIR/pub-ident-fn.rs:3:4 - | -LL | pub foo(_s: usize) -> bool { true } - | ^^^ - | -help: add `fn` here to parse `foo` as a public function - | -LL | pub fn foo(_s: usize) -> bool { true } - | ++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-struct-with-lifetime.rs b/src/test/ui/pub/pub-ident-struct-with-lifetime.rs deleted file mode 100644 index 2feb02660..000000000 --- a/src/test/ui/pub/pub-ident-struct-with-lifetime.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub S<'a> { -//~^ ERROR missing `struct` for struct definition -} -fn main() {} diff --git a/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr b/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr deleted file mode 100644 index 562b68e35..000000000 --- a/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `struct` for struct definition - --> $DIR/pub-ident-struct-with-lifetime.rs:1:4 - | -LL | pub S<'a> { - | ^ - | -help: add `struct` here to parse `S` as a public struct - | -LL | pub struct S<'a> { - | ++++++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-struct.fixed b/src/test/ui/pub/pub-ident-struct.fixed deleted file mode 100644 index 58cde8fd6..000000000 --- a/src/test/ui/pub/pub-ident-struct.fixed +++ /dev/null @@ -1,6 +0,0 @@ -// run-rustfix - -pub struct S { -//~^ ERROR missing `struct` for struct definition -} -fn main() {} diff --git a/src/test/ui/pub/pub-ident-struct.rs b/src/test/ui/pub/pub-ident-struct.rs deleted file mode 100644 index 3930e556e..000000000 --- a/src/test/ui/pub/pub-ident-struct.rs +++ /dev/null @@ -1,6 +0,0 @@ -// run-rustfix - -pub S { -//~^ ERROR missing `struct` for struct definition -} -fn main() {} diff --git a/src/test/ui/pub/pub-ident-struct.stderr b/src/test/ui/pub/pub-ident-struct.stderr deleted file mode 100644 index d3a378786..000000000 --- a/src/test/ui/pub/pub-ident-struct.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: missing `struct` for struct definition - --> $DIR/pub-ident-struct.rs:3:4 - | -LL | pub S { - | ^ - | -help: add `struct` here to parse `S` as a public struct - | -LL | pub struct S { - | ++++++ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-ident-with-lifetime-incomplete.rs b/src/test/ui/pub/pub-ident-with-lifetime-incomplete.rs deleted file mode 100644 index c86a9f2fd..000000000 --- a/src/test/ui/pub/pub-ident-with-lifetime-incomplete.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { -} - -pub foo<'a> -//~^ ERROR missing `fn` or `struct` for function or struct definition diff --git a/src/test/ui/pub/pub-ident-with-lifetime-incomplete.stderr b/src/test/ui/pub/pub-ident-with-lifetime-incomplete.stderr deleted file mode 100644 index 0e0b12705..000000000 --- a/src/test/ui/pub/pub-ident-with-lifetime-incomplete.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: missing `fn` or `struct` for function or struct definition - --> $DIR/pub-ident-with-lifetime-incomplete.rs:4:4 - | -LL | pub foo<'a> - | ^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-reexport-priv-extern-crate.rs b/src/test/ui/pub/pub-reexport-priv-extern-crate.rs deleted file mode 100644 index dd5cd420f..000000000 --- a/src/test/ui/pub/pub-reexport-priv-extern-crate.rs +++ /dev/null @@ -1,20 +0,0 @@ -extern crate core; -pub use core as reexported_core; //~ ERROR `core` is private, and cannot be re-exported - //~^ WARN this was previously accepted - -mod foo1 { - extern crate core; -} - -mod foo2 { - use foo1::core; //~ ERROR crate import `core` is private - pub mod bar { - extern crate core; - } -} - -mod baz { - pub use foo2::bar::core; //~ ERROR crate import `core` is private -} - -fn main() {} diff --git a/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr b/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr deleted file mode 100644 index c7fadc6f9..000000000 --- a/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0603]: crate import `core` is private - --> $DIR/pub-reexport-priv-extern-crate.rs:10:15 - | -LL | use foo1::core; - | ^^^^ private crate import - | -note: the crate import `core` is defined here - --> $DIR/pub-reexport-priv-extern-crate.rs:6:5 - | -LL | extern crate core; - | ^^^^^^^^^^^^^^^^^^ - -error[E0603]: crate import `core` is private - --> $DIR/pub-reexport-priv-extern-crate.rs:17:24 - | -LL | pub use foo2::bar::core; - | ^^^^ private crate import - | -note: the crate import `core` is defined here - --> $DIR/pub-reexport-priv-extern-crate.rs:12:9 - | -LL | extern crate core; - | ^^^^^^^^^^^^^^^^^^ - -error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` - --> $DIR/pub-reexport-priv-extern-crate.rs:2:9 - | -LL | pub use core as reexported_core; - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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: `#[deny(pub_use_of_private_extern_crate)]` on by default - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/pub/pub-restricted-error-fn.rs b/src/test/ui/pub/pub-restricted-error-fn.rs deleted file mode 100644 index fc1aeae2b..000000000 --- a/src/test/ui/pub/pub-restricted-error-fn.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub(crate) () fn foo() {} //~ ERROR visibility `pub(crate)` is not followed by an item -//~^ ERROR expected item, found `(` diff --git a/src/test/ui/pub/pub-restricted-error-fn.stderr b/src/test/ui/pub/pub-restricted-error-fn.stderr deleted file mode 100644 index 0511a821a..000000000 --- a/src/test/ui/pub/pub-restricted-error-fn.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: visibility `pub(crate)` is not followed by an item - --> $DIR/pub-restricted-error-fn.rs:1:1 - | -LL | pub(crate) () fn foo() {} - | ^^^^^^^^^^ the visibility - | - = help: you likely meant to define an item, e.g., `pub(crate) fn foo() {}` - -error: expected item, found `(` - --> $DIR/pub-restricted-error-fn.rs:1:12 - | -LL | pub(crate) () fn foo() {} - | ^ expected item - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/pub/pub-restricted-error.rs b/src/test/ui/pub/pub-restricted-error.rs deleted file mode 100644 index 60fce3f51..000000000 --- a/src/test/ui/pub/pub-restricted-error.rs +++ /dev/null @@ -1,7 +0,0 @@ -struct Bar(pub(())); - -struct Foo { - pub(crate) () foo: usize, //~ ERROR expected identifier -} - -fn main() {} diff --git a/src/test/ui/pub/pub-restricted-error.stderr b/src/test/ui/pub/pub-restricted-error.stderr deleted file mode 100644 index b47328f34..000000000 --- a/src/test/ui/pub/pub-restricted-error.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: expected identifier, found `(` - --> $DIR/pub-restricted-error.rs:4:16 - | -LL | struct Foo { - | --- while parsing this struct -LL | pub(crate) () foo: usize, - | ^ expected identifier - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-restricted-non-path.rs b/src/test/ui/pub/pub-restricted-non-path.rs deleted file mode 100644 index bdad18dbe..000000000 --- a/src/test/ui/pub/pub-restricted-non-path.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(pub_restricted)] - -pub (.) fn afn() {} //~ ERROR expected identifier - -fn main() {} diff --git a/src/test/ui/pub/pub-restricted-non-path.stderr b/src/test/ui/pub/pub-restricted-non-path.stderr deleted file mode 100644 index e0ea50621..000000000 --- a/src/test/ui/pub/pub-restricted-non-path.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected identifier, found `.` - --> $DIR/pub-restricted-non-path.rs:3:6 - | -LL | pub (.) fn afn() {} - | ^ expected identifier - -error: aborting due to previous error - diff --git a/src/test/ui/pub/pub-restricted.rs b/src/test/ui/pub/pub-restricted.rs deleted file mode 100644 index bcd21082f..000000000 --- a/src/test/ui/pub/pub-restricted.rs +++ /dev/null @@ -1,31 +0,0 @@ -mod a {} - -pub (a) fn afn() {} //~ incorrect visibility restriction -pub (b) fn bfn() {} //~ incorrect visibility restriction -pub (crate::a) fn cfn() {} //~ incorrect visibility restriction - -pub fn privfn() {} -mod x { - mod y { - pub (in x) fn foo() {} - pub (super) fn bar() {} - pub (crate) fn qux() {} - } -} - -mod y { - struct Foo { - pub (crate) c: usize, - pub (super) s: usize, - valid_private: usize, - pub (in y) valid_in_x: usize, - pub (a) invalid: usize, //~ incorrect visibility restriction - pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted - } -} - -fn main() {} - -// test multichar names -mod xyz {} -pub (xyz) fn xyz() {} //~ incorrect visibility restriction diff --git a/src/test/ui/pub/pub-restricted.stderr b/src/test/ui/pub/pub-restricted.stderr deleted file mode 100644 index 4694530e5..000000000 --- a/src/test/ui/pub/pub-restricted.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:3:6 - | -LL | pub (a) fn afn() {} - | ^ help: make this visible only to module `a` with `in`: `in a` - | - = help: some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - -error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:4:6 - | -LL | pub (b) fn bfn() {} - | ^ help: make this visible only to module `b` with `in`: `in b` - | - = help: some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - -error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:5:6 - | -LL | pub (crate::a) fn cfn() {} - | ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a` - | - = help: some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - -error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:22:14 - | -LL | pub (a) invalid: usize, - | ^ help: make this visible only to module `a` with `in`: `in a` - | - = help: some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - -error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:31:6 - | -LL | pub (xyz) fn xyz() {} - | ^^^ help: make this visible only to module `xyz` with `in`: `in xyz` - | - = help: some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - -error[E0742]: visibilities can only be restricted to ancestor modules - --> $DIR/pub-restricted.rs:23:17 - | -LL | pub (in x) non_parent_invalid: usize, - | ^ - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0704, E0742. -For more information about an error, try `rustc --explain E0704`. -- cgit v1.2.3