Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve diagnostics for multiple use wildcards #80333

Closed
pickfire opened this issue Dec 23, 2020 · 0 comments · Fixed by #80535
Closed

Improve diagnostics for multiple use wildcards #80333

pickfire opened this issue Dec 23, 2020 · 0 comments · Fixed by #80535
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pickfire
Copy link
Contributor

pickfire commented Dec 23, 2020

I tried this code:

use hello::schema::*::dsl::*;

I expected to see this happen: Import from wildcard of wildcard

Instead, this happened: It errors saying expected semicolon, then I realized that multiple * is not supported, but the error message should show that only one wildcard is supported.

 --> src/main.rs:4:25
  |
4 |     use hello::schema::*::dsl::*;
  |                         ^^ expected `;`

And then I tried

use hello::schema::{users, posts, comments}::dsl::*;

But I got another error

error: expected `;`, found `::`
 --> src/main.rs:4:48
  |
4 |     use hello::schema::{users, posts, comments}::dsl::*;
  |                                                ^^ expected `;`

Which I guess using only one wildcard isn't true.

Meta

rustc --version --verbose:

rustc 1.48.0 (7eac88abb 2020-11-16)
binary: rustc
commit-hash: 7eac88abb2e57e752f3302f02be5f3ce3d7adfb4
commit-date: 2020-11-16
host: x86_64-unknown-linux-gnu
release: 1.48.0
LLVM version: 11.0
@pickfire pickfire added the C-bug Category: This is a bug. label Dec 23, 2020
@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed C-bug Category: This is a bug. labels Dec 24, 2020
@camelid camelid changed the title Multiple use wildcard Improve diagnostics for multiple use wildcards Dec 24, 2020
@bors bors closed this as completed in 3d8608a Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants