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

Bad error message for "relative paths are not supported in visibilities" error #95638

Closed
asquared31415 opened this issue Apr 4, 2022 · 0 comments · Fixed by #95936
Closed
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@asquared31415
Copy link
Contributor

Given the following code:

mod a {
  pub(in a) fn foo() {}
}

fn main() {}

When compiled using Edition 2018 or 2021

error: relative paths are not supported in visibilities on 2018 edition
 --> src/main.rs:2:10
  |
2 |   pub(in a) fn foo() {}
  |          ^ help: try: `crate::a`

error: aborting due to previous error

This error message is misleading and should likely be changed to "only supported in 2015 edition" or "not supported in 2018 edition or later"

error: relative paths are not supported in visibilities in 2018 edition or later
 --> src/main.rs:2:10
  |
2 |   pub(in a) fn foo() {}
  |          ^ help: try: `crate::a`

error: aborting due to previous error
@asquared31415 asquared31415 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 4, 2022
@TaKO8Ki TaKO8Ki self-assigned this Apr 11, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 12, 2022
…ssage, r=Dylan-DPC

Fix a bad error message for `relative paths are not supported in visibilities` error

closes rust-lang#95638
@bors bors closed this as completed in c3d6082 Apr 12, 2022
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 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