Check that visibility upgrade path is hit
This commit is contained in:
parent
c07eaf868d
commit
dce9987436
2 changed files with 8 additions and 4 deletions
|
|
@ -625,7 +625,12 @@ impl DefCollector<'_> {
|
|||
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 @@ use crate::reex::*;
|
|||
|
||||
#[test]
|
||||
fn underscore_pub_crate_reexport() {
|
||||
mark::check!(upgrade_underscore_visibility);
|
||||
check(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:lib
|
||||
|
|
@ -629,9 +630,7 @@ use tr::Tr as _;
|
|||
pub use tr::Tr as _;
|
||||
|
||||
mod tr {
|
||||
pub trait Tr {
|
||||
fn method(&self) {}
|
||||
}
|
||||
pub trait Tr {}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue