Skip to content

gccrs: Fix multiple glob imports in a use decl#4707

Open
powerboat9 wants to merge 1 commit into
Rust-GCC:masterfrom
powerboat9:multi-glob
Open

gccrs: Fix multiple glob imports in a use decl#4707
powerboat9 wants to merge 1 commit into
Rust-GCC:masterfrom
powerboat9:multi-glob

Conversation

@powerboat9

Copy link
Copy Markdown
Collaborator

Also removes some dead code in flatten, since I saw it while working on this PR and it's too small to be its own patch.

Fixes #4702

@powerboat9

Copy link
Copy Markdown
Collaborator Author

Seems to pair us down to

./test-rust/rust/library/core/src/iter/adapters/chain.rs:211:33: error: identifier ‘None’ is bound more than once in the same pattern [E0416]
  211 |             Chain { a: None, b: None } => (0, Some(0)),
      |                                 ^~~~
./test-rust/rust/library/core/src/iter/adapters/zip.rs:153:20: error: identifier ‘None’ is bound more than once in the same pattern [E0416]
  153 |             (None, None) => None,
      |                    ^~~~
./test-rust/rust/library/core/src/iter/adapters/zip.rs:169:20: error: identifier ‘None’ is bound more than once in the same pattern [E0416]
  169 |             (None, None) => None,
      |                    ^~~~
./test-rust/rust/library/core/src/iter/traits/iterator.rs:3237:46: error: variable ‘None’ is not bound in all patterns [E0408]
 3237 |             if let Some(Ordering::Greater) | None = compare(&last, &curr) {
      |                                              ^~~~
./test-rust/rust/library/core/src/slice/iter.rs:1974:3: error: could not resolve type path ‘N’ [E0412]
 1974 | #[derive(Debug, Clone, Copy)]
      |   ^~~~~~
./test-rust/rust/library/core/src/slice/iter.rs:1974:3: error: could not resolve type path ‘N’ [E0412]
./test-rust/rust/library/core/src/slice/iter.rs:1974:3: error: could not resolve type path ‘N’ [E0412]
./test-rust/rust/library/core/src/slice/iter.rs:2096:3: error: could not resolve type path ‘N’ [E0412]
 2096 | #[derive(Debug)]
      |   ^~~~~~
./test-rust/rust/library/core/src/slice/iter.rs:2218:3: error: could not resolve type path ‘N’ [E0412]
 2218 | #[derive(Debug)]
      |   ^~~~~~

for compiling core 1.49 (not including errors detected in later phases, of course).

Also removes some dead code in flatten, since I saw it while working on
this PR and it's too small to be its own patch.

gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc
	(Early::resolve_glob_import): Handle glob imports that appear
	after other imports in a use declaration.
	* resolve/rust-early-name-resolver-2.0.h
	(Early::ImportMappings::insert): Remove member functions, as
	they're both broken and unused.
	* resolve/rust-toplevel-name-resolver-2.0.cc (flatten): Remove
	redundant break statement.

gcc/testsuite/ChangeLog:

	* rust/compile/glob_import_brace.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combined glob imports

1 participant