-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix privacy for items inside modules. Fix several tests.
gcc/rust/ChangeLog: * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_for_privacy_violation): Update privacy check function to check for item's privacy inside of modules. gcc/testsuite/ChangeLog: * rust/compile/issue-850.rs: Fix private enum. * rust/compile/iterators1.rs: Fix private enum. * rust/execute/torture/extern_mod4/modules/mod.rs: Fix private function. * rust/execute/torture/iter1.rs: Fix private enum. * rust/compile/issue-2636.rs: New test. Signed-off-by: dave <[email protected]>
- Loading branch information
Showing
6 changed files
with
33 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub mod module_a { | ||
const CONST_I32: i32 = 0; | ||
static BAR:i32 = CONST_I32; | ||
} | ||
|
||
fn main() { | ||
let a = module_a::CONST_I32; | ||
// { dg-error "definition is private in this context" "" { target *-*-* } .-1 } | ||
let b = module_a::BAR; | ||
// { dg-error "definition is private in this context" "" { target *-*-* } .-1 } | ||
} |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ mod option { | |
} | ||
|
||
mod result { | ||
enum Result<T, E> { | ||
pub enum Result<T, E> { | ||
Ok(T), | ||
Err(E), | ||
} | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn return_12() -> i32 { | ||
pub fn return_12() -> i32 { | ||
12 | ||
} |
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ mod option { | |
} | ||
|
||
mod result { | ||
enum Result<T, E> { | ||
pub enum Result<T, E> { | ||
Ok(T), | ||
Err(E), | ||
} | ||
|