From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/imports/auxiliary/gensymed.rs | 3 ++ src/test/ui/imports/auxiliary/glob-conflict.rs | 13 +++++++++ src/test/ui/imports/auxiliary/import_crate_var.rs | 7 +++++ src/test/ui/imports/auxiliary/issue-36881-aux.rs | 1 + src/test/ui/imports/auxiliary/issue-52891.rs | 33 ++++++++++++++++++++++ src/test/ui/imports/auxiliary/issue-55811.rs | 5 ++++ src/test/ui/imports/auxiliary/issue-56125.rs | 11 ++++++++ src/test/ui/imports/auxiliary/issue-59764.rs | 18 ++++++++++++ .../auxiliary/overlapping_pub_trait_source.rs | 13 +++++++++ src/test/ui/imports/auxiliary/two_macros.rs | 5 ++++ .../imports/auxiliary/unnamed_pub_trait_source.rs | 13 +++++++++ 11 files changed, 122 insertions(+) create mode 100644 src/test/ui/imports/auxiliary/gensymed.rs create mode 100644 src/test/ui/imports/auxiliary/glob-conflict.rs create mode 100644 src/test/ui/imports/auxiliary/import_crate_var.rs create mode 100644 src/test/ui/imports/auxiliary/issue-36881-aux.rs create mode 100644 src/test/ui/imports/auxiliary/issue-52891.rs create mode 100644 src/test/ui/imports/auxiliary/issue-55811.rs create mode 100644 src/test/ui/imports/auxiliary/issue-56125.rs create mode 100644 src/test/ui/imports/auxiliary/issue-59764.rs create mode 100644 src/test/ui/imports/auxiliary/overlapping_pub_trait_source.rs create mode 100644 src/test/ui/imports/auxiliary/two_macros.rs create mode 100644 src/test/ui/imports/auxiliary/unnamed_pub_trait_source.rs (limited to 'src/test/ui/imports/auxiliary') diff --git a/src/test/ui/imports/auxiliary/gensymed.rs b/src/test/ui/imports/auxiliary/gensymed.rs new file mode 100644 index 000000000..bbb19f5ec --- /dev/null +++ b/src/test/ui/imports/auxiliary/gensymed.rs @@ -0,0 +1,3 @@ +// edition:2018 + +mod std {} diff --git a/src/test/ui/imports/auxiliary/glob-conflict.rs b/src/test/ui/imports/auxiliary/glob-conflict.rs new file mode 100644 index 000000000..c83db64c6 --- /dev/null +++ b/src/test/ui/imports/auxiliary/glob-conflict.rs @@ -0,0 +1,13 @@ +mod m1 { + pub fn f() {} +} +mod m2 { + pub fn f(_: u8) {} +} + +pub use m1::*; +pub use m2::*; + +pub mod glob { + pub use *; +} diff --git a/src/test/ui/imports/auxiliary/import_crate_var.rs b/src/test/ui/imports/auxiliary/import_crate_var.rs new file mode 100644 index 000000000..a273b103a --- /dev/null +++ b/src/test/ui/imports/auxiliary/import_crate_var.rs @@ -0,0 +1,7 @@ +pub fn f() {} + +#[macro_export] +macro_rules! m { () => { + use $crate; + import_crate_var::f(); +} } diff --git a/src/test/ui/imports/auxiliary/issue-36881-aux.rs b/src/test/ui/imports/auxiliary/issue-36881-aux.rs new file mode 100644 index 000000000..e373b6438 --- /dev/null +++ b/src/test/ui/imports/auxiliary/issue-36881-aux.rs @@ -0,0 +1 @@ +pub trait Foo {} diff --git a/src/test/ui/imports/auxiliary/issue-52891.rs b/src/test/ui/imports/auxiliary/issue-52891.rs new file mode 100644 index 000000000..075981183 --- /dev/null +++ b/src/test/ui/imports/auxiliary/issue-52891.rs @@ -0,0 +1,33 @@ +pub mod a { + pub mod inner { + } +} + +pub mod b { + pub mod inner { + } +} + +pub mod c {} + +pub mod d {} + +pub mod e {} + +pub mod f {} + +pub mod g {} + +pub mod h {} + +pub mod i {} + +pub mod j {} + +pub mod k {} + +pub mod l {} + +pub mod m {} + +pub mod n {} diff --git a/src/test/ui/imports/auxiliary/issue-55811.rs b/src/test/ui/imports/auxiliary/issue-55811.rs new file mode 100644 index 000000000..877e4cdb0 --- /dev/null +++ b/src/test/ui/imports/auxiliary/issue-55811.rs @@ -0,0 +1,5 @@ +mod m {} + +// These two imports should not conflict when this crate is loaded from some other crate. +use m::{}; +use m::{}; diff --git a/src/test/ui/imports/auxiliary/issue-56125.rs b/src/test/ui/imports/auxiliary/issue-56125.rs new file mode 100644 index 000000000..8e0797582 --- /dev/null +++ b/src/test/ui/imports/auxiliary/issue-56125.rs @@ -0,0 +1,11 @@ +pub mod issue_56125 {} + +pub mod last_segment { + pub mod issue_56125 {} +} + +pub mod non_last_segment { + pub mod non_last_segment { + pub mod issue_56125 {} + } +} diff --git a/src/test/ui/imports/auxiliary/issue-59764.rs b/src/test/ui/imports/auxiliary/issue-59764.rs new file mode 100644 index 000000000..a92eed968 --- /dev/null +++ b/src/test/ui/imports/auxiliary/issue-59764.rs @@ -0,0 +1,18 @@ +pub mod foo { + #[macro_export] + macro_rules! makro { + ($foo:ident) => { + fn $foo() { } + } + } + + pub fn baz() {} + + pub fn foobar() {} + + pub mod barbaz { + pub fn barfoo() {} + } +} + +pub fn foobaz() {} diff --git a/src/test/ui/imports/auxiliary/overlapping_pub_trait_source.rs b/src/test/ui/imports/auxiliary/overlapping_pub_trait_source.rs new file mode 100644 index 000000000..2a25d60ac --- /dev/null +++ b/src/test/ui/imports/auxiliary/overlapping_pub_trait_source.rs @@ -0,0 +1,13 @@ +/* This crate declares an item as both `prelude::*` and `m::Tr`. + * The compiler should always suggest `m::Tr`. */ + +pub struct S; + +pub mod prelude { + pub use crate::m::Tr as _; +} + +pub mod m { + pub trait Tr { fn method(&self); } + impl Tr for crate::S { fn method(&self) {} } +} diff --git a/src/test/ui/imports/auxiliary/two_macros.rs b/src/test/ui/imports/auxiliary/two_macros.rs new file mode 100644 index 000000000..92c211467 --- /dev/null +++ b/src/test/ui/imports/auxiliary/two_macros.rs @@ -0,0 +1,5 @@ +#[macro_export] +macro_rules! m { ($($t:tt)*) => { $($t)* } } + +#[macro_export] +macro_rules! n { ($($t:tt)*) => { $($t)* } } diff --git a/src/test/ui/imports/auxiliary/unnamed_pub_trait_source.rs b/src/test/ui/imports/auxiliary/unnamed_pub_trait_source.rs new file mode 100644 index 000000000..d73c9a795 --- /dev/null +++ b/src/test/ui/imports/auxiliary/unnamed_pub_trait_source.rs @@ -0,0 +1,13 @@ +/* This crate declares an item that is unnamed. + * Its only public path is through `prelude::*`. */ + +pub struct S; + +mod m { + pub trait Tr { fn method(&self); } + impl Tr for crate::S { fn method(&self) {} } +} + +pub mod prelude { + pub use crate::m::Tr as _; +} -- cgit v1.2.3