forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
increase the accuracy of effective visibilities calculation
- Loading branch information
Showing
4 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#![feature(rustc_attrs)] | ||
#![allow(private_in_public)] | ||
|
||
struct SemiPriv; | ||
|
||
mod m { | ||
#[rustc_effective_visibility] | ||
struct Priv; | ||
//~^ ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
//~| ERROR not in the table | ||
|
||
#[rustc_effective_visibility] | ||
pub fn foo() {} //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
|
||
#[rustc_effective_visibility] | ||
impl crate::SemiPriv { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
pub fn f(_: Priv) {} | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: Direct: pub(self), Reexported: pub(self), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
--> $DIR/effective_visibilities_full_priv.rs:8:5 | ||
| | ||
LL | struct Priv; | ||
| ^^^^^^^^^^^ | ||
|
||
error: not in the table | ||
--> $DIR/effective_visibilities_full_priv.rs:8:5 | ||
| | ||
LL | struct Priv; | ||
| ^^^^^^^^^^^ | ||
|
||
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
--> $DIR/effective_visibilities_full_priv.rs:13:5 | ||
| | ||
LL | pub fn foo() {} | ||
| ^^^^^^^^^^^^ | ||
|
||
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate) | ||
--> $DIR/effective_visibilities_full_priv.rs:16:5 | ||
| | ||
LL | impl crate::SemiPriv { | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|