summaryrefslogtreecommitdiffstats
path: root/tests/ui/resolve/auxiliary
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 /tests/ui/resolve/auxiliary
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 'tests/ui/resolve/auxiliary')
-rw-r--r--tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs3
-rw-r--r--tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs3
-rw-r--r--tests/ui/resolve/auxiliary/extern-prelude-vec.rs3
-rw-r--r--tests/ui/resolve/auxiliary/extern-prelude.rs5
-rw-r--r--tests/ui/resolve/auxiliary/issue-19452-aux.rs3
-rw-r--r--tests/ui/resolve/auxiliary/issue-21221-3.rs19
-rw-r--r--tests/ui/resolve/auxiliary/issue-21221-4.rs12
-rw-r--r--tests/ui/resolve/auxiliary/issue-30535.rs5
-rw-r--r--tests/ui/resolve/auxiliary/issue-3907.rs3
-rw-r--r--tests/ui/resolve/auxiliary/issue-80079.rs18
-rw-r--r--tests/ui/resolve/auxiliary/namespaced_enums.rs10
-rw-r--r--tests/ui/resolve/auxiliary/privacy-struct-ctor.rs9
12 files changed, 93 insertions, 0 deletions
diff --git a/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs b/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs
new file mode 100644
index 000000000..cf769f31b
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs
@@ -0,0 +1,3 @@
+#![crate_type="lib"]
+
+pub const X: () = ();
diff --git a/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs b/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs
new file mode 100644
index 000000000..81c16ede9
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs
@@ -0,0 +1,3 @@
+#![crate_type="lib"]
+
+pub const Y: () = ();
diff --git a/tests/ui/resolve/auxiliary/extern-prelude-vec.rs b/tests/ui/resolve/auxiliary/extern-prelude-vec.rs
new file mode 100644
index 000000000..a643c8889
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/extern-prelude-vec.rs
@@ -0,0 +1,3 @@
+#![crate_name = "Vec"]
+
+pub fn new(arg1: f32, arg2: ()) {}
diff --git a/tests/ui/resolve/auxiliary/extern-prelude.rs b/tests/ui/resolve/auxiliary/extern-prelude.rs
new file mode 100644
index 000000000..2fdfd85a1
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/extern-prelude.rs
@@ -0,0 +1,5 @@
+pub struct S;
+
+impl S {
+ pub fn external(&self) {}
+}
diff --git a/tests/ui/resolve/auxiliary/issue-19452-aux.rs b/tests/ui/resolve/auxiliary/issue-19452-aux.rs
new file mode 100644
index 000000000..9c7bcec51
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-19452-aux.rs
@@ -0,0 +1,3 @@
+pub enum Homura {
+ Madoka { age: u32 }
+}
diff --git a/tests/ui/resolve/auxiliary/issue-21221-3.rs b/tests/ui/resolve/auxiliary/issue-21221-3.rs
new file mode 100644
index 000000000..176c23180
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-21221-3.rs
@@ -0,0 +1,19 @@
+// testing whether the lookup mechanism picks up types
+// defined in the outside crate
+
+#![crate_type="lib"]
+
+pub mod outer {
+ // should suggest this
+ pub trait OuterTrait {}
+
+ // should not suggest this since the module is private
+ mod private_module {
+ pub trait OuterTrait {}
+ }
+
+ // should not suggest since the trait is private
+ pub mod public_module {
+ trait OuterTrait {}
+ }
+}
diff --git a/tests/ui/resolve/auxiliary/issue-21221-4.rs b/tests/ui/resolve/auxiliary/issue-21221-4.rs
new file mode 100644
index 000000000..5e0d6cbdf
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-21221-4.rs
@@ -0,0 +1,12 @@
+// testing whether the lookup mechanism picks up types
+// defined in the outside crate
+
+#![crate_type="lib"]
+
+mod foo {
+ // should not be suggested => foo is private
+ pub trait T {}
+}
+
+// should be suggested
+pub use foo::T;
diff --git a/tests/ui/resolve/auxiliary/issue-30535.rs b/tests/ui/resolve/auxiliary/issue-30535.rs
new file mode 100644
index 000000000..3608d4a2f
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-30535.rs
@@ -0,0 +1,5 @@
+#![crate_type="lib"]
+
+pub enum Foo {
+ FooV { data: () }
+}
diff --git a/tests/ui/resolve/auxiliary/issue-3907.rs b/tests/ui/resolve/auxiliary/issue-3907.rs
new file mode 100644
index 000000000..5dc502930
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-3907.rs
@@ -0,0 +1,3 @@
+pub trait Foo {
+ fn bar();
+}
diff --git a/tests/ui/resolve/auxiliary/issue-80079.rs b/tests/ui/resolve/auxiliary/issue-80079.rs
new file mode 100644
index 000000000..190ca75ab
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-80079.rs
@@ -0,0 +1,18 @@
+#![crate_type = "lib"]
+
+pub mod public {
+ use private_import;
+
+ // should not be suggested since it is private
+ struct Foo;
+
+ mod private_module {
+ // should not be suggested since it is private
+ pub struct Foo;
+ }
+}
+
+mod private_import {
+ // should not be suggested since it is private
+ pub struct Foo;
+}
diff --git a/tests/ui/resolve/auxiliary/namespaced_enums.rs b/tests/ui/resolve/auxiliary/namespaced_enums.rs
new file mode 100644
index 000000000..d3548c76c
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/namespaced_enums.rs
@@ -0,0 +1,10 @@
+pub enum Foo {
+ A,
+ B(isize),
+ C { a: isize },
+}
+
+impl Foo {
+ pub fn foo() {}
+ pub fn bar(&self) {}
+}
diff --git a/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs
new file mode 100644
index 000000000..6d0bc7285
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs
@@ -0,0 +1,9 @@
+pub mod m {
+ pub struct S(u8);
+
+ pub mod n {
+ pub(in m) struct Z(pub(in m::n) u8);
+ }
+}
+
+pub use m::S;