summaryrefslogtreecommitdiffstats
path: root/src/test/ui/xcrate
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/xcrate
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/xcrate')
-rw-r--r--src/test/ui/xcrate/auxiliary/static_priv_by_default.rs51
-rw-r--r--src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs28
-rw-r--r--src/test/ui/xcrate/xcrate-private-by-default.rs45
-rw-r--r--src/test/ui/xcrate/xcrate-private-by-default.stderr123
-rw-r--r--src/test/ui/xcrate/xcrate-unit-struct-2.rs30
-rw-r--r--src/test/ui/xcrate/xcrate-unit-struct.rs12
-rw-r--r--src/test/ui/xcrate/xcrate-unit-struct.stderr14
7 files changed, 0 insertions, 303 deletions
diff --git a/src/test/ui/xcrate/auxiliary/static_priv_by_default.rs b/src/test/ui/xcrate/auxiliary/static_priv_by_default.rs
deleted file mode 100644
index 39f912066..000000000
--- a/src/test/ui/xcrate/auxiliary/static_priv_by_default.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-#![crate_type = "lib"]
-
-static private: isize = 0;
-pub static public: isize = 0;
-
-pub struct A(());
-
-impl A {
- fn foo() {}
-}
-
-mod foo {
- pub static a: isize = 0;
- pub fn b() {}
- pub struct c;
- pub enum d {}
- pub type e = isize;
-
- pub struct A(());
-
- impl A {
- fn foo() {}
- }
-
- // these are public so the parent can re-export them.
- pub static reexported_a: isize = 0;
- pub fn reexported_b() {}
- pub struct reexported_c;
- pub enum reexported_d {}
- pub type reexported_e = isize;
-}
-
-pub mod bar {
- pub use foo::reexported_a as e;
- pub use foo::reexported_b as f;
- pub use foo::reexported_c as g;
- pub use foo::reexported_d as h;
- pub use foo::reexported_e as i;
-}
-
-pub static a: isize = 0;
-pub fn b() {}
-pub struct c;
-pub enum d {}
-pub type e = isize;
-
-static j: isize = 0;
-fn k() {}
-struct l;
-enum m {}
-type n = isize;
diff --git a/src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs b/src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs
deleted file mode 100644
index 69ed498e7..000000000
--- a/src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-#![crate_type = "lib"]
-
-// used by the rpass test
-
-#[derive(Copy, Clone)]
-pub struct Struct;
-
-#[derive(Copy, Clone)]
-pub enum Unit {
- UnitVariant,
- Argument(Struct)
-}
-
-#[derive(Copy, Clone)]
-pub struct TupleStruct(pub usize, pub &'static str);
-
-// used by the cfail test
-
-#[derive(Copy, Clone)]
-pub struct StructWithFields {
- foo: isize,
-}
-
-#[derive(Copy, Clone)]
-pub enum EnumWithVariants {
- EnumVariant,
- EnumVariantArg(isize)
-}
diff --git a/src/test/ui/xcrate/xcrate-private-by-default.rs b/src/test/ui/xcrate/xcrate-private-by-default.rs
deleted file mode 100644
index 299cff54f..000000000
--- a/src/test/ui/xcrate/xcrate-private-by-default.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// aux-build:static_priv_by_default.rs
-
-extern crate static_priv_by_default;
-
-fn foo<T>() {}
-
-fn main() {
- // Actual public items should be public
- static_priv_by_default::a;
- static_priv_by_default::b;
- static_priv_by_default::c;
- foo::<static_priv_by_default::d>();
- foo::<static_priv_by_default::e>();
-
- // publicly re-exported items should be available
- static_priv_by_default::bar::e;
- static_priv_by_default::bar::f;
- static_priv_by_default::bar::g;
- foo::<static_priv_by_default::bar::h>();
- foo::<static_priv_by_default::bar::i>();
-
- // private items at the top should be inaccessible
- static_priv_by_default::j;
- //~^ ERROR: static `j` is private
- static_priv_by_default::k;
- //~^ ERROR: function `k` is private
- static_priv_by_default::l;
- //~^ ERROR: struct `l` is private
- foo::<static_priv_by_default::m>();
- //~^ ERROR: enum `m` is private
- foo::<static_priv_by_default::n>();
- //~^ ERROR: type alias `n` is private
-
- // public items in a private mod should be inaccessible
- static_priv_by_default::foo::a;
- //~^ ERROR: module `foo` is private
- static_priv_by_default::foo::b;
- //~^ ERROR: module `foo` is private
- static_priv_by_default::foo::c;
- //~^ ERROR: module `foo` is private
- foo::<static_priv_by_default::foo::d>();
- //~^ ERROR: module `foo` is private
- foo::<static_priv_by_default::foo::e>();
- //~^ ERROR: module `foo` is private
-}
diff --git a/src/test/ui/xcrate/xcrate-private-by-default.stderr b/src/test/ui/xcrate/xcrate-private-by-default.stderr
deleted file mode 100644
index 0bdd4002f..000000000
--- a/src/test/ui/xcrate/xcrate-private-by-default.stderr
+++ /dev/null
@@ -1,123 +0,0 @@
-error[E0603]: static `j` is private
- --> $DIR/xcrate-private-by-default.rs:23:29
- |
-LL | static_priv_by_default::j;
- | ^ private static
- |
-note: the static `j` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:47:1
- |
-LL | static j: isize = 0;
- | ^^^^^^^^^^^^^^^
-
-error[E0603]: function `k` is private
- --> $DIR/xcrate-private-by-default.rs:25:29
- |
-LL | static_priv_by_default::k;
- | ^ private function
- |
-note: the function `k` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:48:1
- |
-LL | fn k() {}
- | ^^^^^^
-
-error[E0603]: unit struct `l` is private
- --> $DIR/xcrate-private-by-default.rs:27:29
- |
-LL | static_priv_by_default::l;
- | ^ private unit struct
- |
-note: the unit struct `l` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:49:1
- |
-LL | struct l;
- | ^^^^^^^^
-
-error[E0603]: enum `m` is private
- --> $DIR/xcrate-private-by-default.rs:29:35
- |
-LL | foo::<static_priv_by_default::m>();
- | ^ private enum
- |
-note: the enum `m` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:50:1
- |
-LL | enum m {}
- | ^^^^^^
-
-error[E0603]: type alias `n` is private
- --> $DIR/xcrate-private-by-default.rs:31:35
- |
-LL | foo::<static_priv_by_default::n>();
- | ^ private type alias
- |
-note: the type alias `n` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:51:1
- |
-LL | type n = isize;
- | ^^^^^^
-
-error[E0603]: module `foo` is private
- --> $DIR/xcrate-private-by-default.rs:35:29
- |
-LL | static_priv_by_default::foo::a;
- | ^^^ private module
- |
-note: the module `foo` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:12:1
- |
-LL | mod foo {
- | ^^^^^^^
-
-error[E0603]: module `foo` is private
- --> $DIR/xcrate-private-by-default.rs:37:29
- |
-LL | static_priv_by_default::foo::b;
- | ^^^ private module
- |
-note: the module `foo` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:12:1
- |
-LL | mod foo {
- | ^^^^^^^
-
-error[E0603]: module `foo` is private
- --> $DIR/xcrate-private-by-default.rs:39:29
- |
-LL | static_priv_by_default::foo::c;
- | ^^^ private module
- |
-note: the module `foo` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:12:1
- |
-LL | mod foo {
- | ^^^^^^^
-
-error[E0603]: module `foo` is private
- --> $DIR/xcrate-private-by-default.rs:41:35
- |
-LL | foo::<static_priv_by_default::foo::d>();
- | ^^^ private module
- |
-note: the module `foo` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:12:1
- |
-LL | mod foo {
- | ^^^^^^^
-
-error[E0603]: module `foo` is private
- --> $DIR/xcrate-private-by-default.rs:43:35
- |
-LL | foo::<static_priv_by_default::foo::e>();
- | ^^^ private module
- |
-note: the module `foo` is defined here
- --> $DIR/auxiliary/static_priv_by_default.rs:12:1
- |
-LL | mod foo {
- | ^^^^^^^
-
-error: aborting due to 10 previous errors
-
-For more information about this error, try `rustc --explain E0603`.
diff --git a/src/test/ui/xcrate/xcrate-unit-struct-2.rs b/src/test/ui/xcrate/xcrate-unit-struct-2.rs
deleted file mode 100644
index 7aa3eb0d6..000000000
--- a/src/test/ui/xcrate/xcrate-unit-struct-2.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// run-pass
-// aux-build:xcrate_unit_struct.rs
-// pretty-expanded FIXME #23616
-#![allow(non_upper_case_globals)]
-
-extern crate xcrate_unit_struct;
-
-const s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct;
-static s2: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::UnitVariant;
-static s3: xcrate_unit_struct::Unit =
- xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct);
-static s4: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::Argument(s1);
-static s5: xcrate_unit_struct::TupleStruct = xcrate_unit_struct::TupleStruct(20, "foo");
-
-fn f1(_: xcrate_unit_struct::Struct) {}
-fn f2(_: xcrate_unit_struct::Unit) {}
-fn f3(_: xcrate_unit_struct::TupleStruct) {}
-
-pub fn main() {
- f1(xcrate_unit_struct::Struct);
- f2(xcrate_unit_struct::Unit::UnitVariant);
- f2(xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct));
- f3(xcrate_unit_struct::TupleStruct(10, "bar"));
-
- f1(s1);
- f2(s2);
- f2(s3);
- f2(s4);
- f3(s5);
-}
diff --git a/src/test/ui/xcrate/xcrate-unit-struct.rs b/src/test/ui/xcrate/xcrate-unit-struct.rs
deleted file mode 100644
index c99cf77ce..000000000
--- a/src/test/ui/xcrate/xcrate-unit-struct.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// aux-build:xcrate_unit_struct.rs
-
-// Make sure that when we have cross-crate unit structs we don't accidentally
-// make values out of cross-crate structs that aren't unit.
-
-extern crate xcrate_unit_struct;
-
-fn main() {
- let _ = xcrate_unit_struct::StructWithFields;
- //~^ ERROR expected value, found struct `xcrate_unit_struct::StructWithFields`
- let _ = xcrate_unit_struct::Struct;
-}
diff --git a/src/test/ui/xcrate/xcrate-unit-struct.stderr b/src/test/ui/xcrate/xcrate-unit-struct.stderr
deleted file mode 100644
index cee314568..000000000
--- a/src/test/ui/xcrate/xcrate-unit-struct.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0423]: expected value, found struct `xcrate_unit_struct::StructWithFields`
- --> $DIR/xcrate-unit-struct.rs:9:13
- |
-LL | let _ = xcrate_unit_struct::StructWithFields;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `xcrate_unit_struct::StructWithFields { foo: val }`
- |
- ::: $DIR/auxiliary/xcrate_unit_struct.rs:20:1
- |
-LL | pub struct StructWithFields {
- | --------------------------- `xcrate_unit_struct::StructWithFields` defined here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0423`.