-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: Add missing name resolution to static items in blocks
We need to add name resolution and hir lowering for items as part of blocks in order to typecheck and compile them correctly. Fixes Rust-GCC#3550 gcc/rust/ChangeLog: * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): hir lowering * hir/rust-ast-lower-stmt.h: likewise * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): name resolution * resolve/rust-ast-resolve-stmt.h: likewise gcc/testsuite/ChangeLog: * rust/compile/issue-3350.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
5 changed files
with
39 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
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
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,10 @@ | ||
static FOO: i32 = 0; | ||
|
||
pub fn bar() -> i32 { | ||
FOO | ||
} | ||
|
||
pub fn baz() -> i32 { | ||
static QUX: i32 = 0; | ||
QUX | ||
} |