forked from Rust-GCC/gccrs
-
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.
Add globbing name resolution 2.0 test
Add a few test for globbing to highlight function call ambiguities. gcc/testsuite/ChangeLog: * rust/compile/name_resolution23.rs: New test. * rust/compile/name_resolution24.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// { dg-options "-frust-name-resolution-2.0" } | ||
|
||
mod a { | ||
pub mod b { | ||
pub fn foo() {} | ||
pub fn bar() {} | ||
pub fn baz() {} | ||
} | ||
pub fn baz() {} | ||
} | ||
|
||
use a::b::*; | ||
use a::baz; | ||
|
||
pub fn func() { | ||
baz(); | ||
foo(); | ||
bar(); | ||
} |
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,15 @@ | ||
// { dg-options "-frust-name-resolution-2.0" } | ||
|
||
mod a { | ||
pub mod b { | ||
pub fn baz() {} | ||
} | ||
pub fn baz() {} | ||
} | ||
|
||
use a::b::*; | ||
use a::*; | ||
|
||
pub fn func() { | ||
baz(); // { dg-error ".baz. is ambiguous .E0659." } | ||
} |