From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../auxiliary/blind-item-mixed-crate-use-item-foo.rs | 3 +++ .../auxiliary/blind-item-mixed-crate-use-item-foo2.rs | 3 +++ tests/ui/resolve/auxiliary/extern-prelude-vec.rs | 3 +++ tests/ui/resolve/auxiliary/extern-prelude.rs | 5 +++++ tests/ui/resolve/auxiliary/issue-19452-aux.rs | 3 +++ tests/ui/resolve/auxiliary/issue-21221-3.rs | 19 +++++++++++++++++++ tests/ui/resolve/auxiliary/issue-21221-4.rs | 12 ++++++++++++ tests/ui/resolve/auxiliary/issue-30535.rs | 5 +++++ tests/ui/resolve/auxiliary/issue-3907.rs | 3 +++ tests/ui/resolve/auxiliary/issue-80079.rs | 18 ++++++++++++++++++ tests/ui/resolve/auxiliary/namespaced_enums.rs | 10 ++++++++++ tests/ui/resolve/auxiliary/privacy-struct-ctor.rs | 9 +++++++++ 12 files changed, 93 insertions(+) create mode 100644 tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs create mode 100644 tests/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs create mode 100644 tests/ui/resolve/auxiliary/extern-prelude-vec.rs create mode 100644 tests/ui/resolve/auxiliary/extern-prelude.rs create mode 100644 tests/ui/resolve/auxiliary/issue-19452-aux.rs create mode 100644 tests/ui/resolve/auxiliary/issue-21221-3.rs create mode 100644 tests/ui/resolve/auxiliary/issue-21221-4.rs create mode 100644 tests/ui/resolve/auxiliary/issue-30535.rs create mode 100644 tests/ui/resolve/auxiliary/issue-3907.rs create mode 100644 tests/ui/resolve/auxiliary/issue-80079.rs create mode 100644 tests/ui/resolve/auxiliary/namespaced_enums.rs create mode 100644 tests/ui/resolve/auxiliary/privacy-struct-ctor.rs (limited to 'tests/ui/resolve/auxiliary') 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; -- cgit v1.2.3