mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-03 01:16:14 +03:00
Check that visibility upgrade path is hit
This commit is contained in:
@@ -625,7 +625,12 @@ fn update_recursive(
|
||||
panic!("`Tr as _` imports with unrelated visibilities {:?} and {:?} (trait {:?})", old_vis, vis, tr);
|
||||
});
|
||||
|
||||
max_vis != old_vis
|
||||
if max_vis == old_vis {
|
||||
false
|
||||
} else {
|
||||
mark::hit!(upgrade_underscore_visibility);
|
||||
true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -619,6 +619,7 @@ mod reex {
|
||||
|
||||
#[test]
|
||||
fn underscore_pub_crate_reexport() {
|
||||
mark::check!(upgrade_underscore_visibility);
|
||||
check(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:lib
|
||||
@@ -629,9 +630,7 @@ fn underscore_pub_crate_reexport() {
|
||||
pub use tr::Tr as _;
|
||||
|
||||
mod tr {
|
||||
pub trait Tr {
|
||||
fn method(&self) {}
|
||||
}
|
||||
pub trait Tr {}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
|
||||
Reference in New Issue
Block a user