Check that visibility upgrade path is hit

This commit is contained in:
Jonas Schievink
2020-07-22 14:01:50 +02:00
parent c07eaf868d
commit dce9987436
2 changed files with 8 additions and 4 deletions
+6 -1
View File
@@ -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
}
}
};
+2 -3
View File
@@ -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#"