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

Diagnostics for E0364 and E0365 #27071

Merged
merged 1 commit into from
Jul 17, 2015
Merged

Conversation

AlisdairO
Copy link
Contributor

Added some detailed diagnostics for E0364 and E0365.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@AlisdairO
Copy link
Contributor Author

Part of #24407.

r? @Manishearth

re-exporting are themselves marked with 'pub':

```
mod foo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be pub mod?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, it doesn't need to be.

@Manishearth
Copy link
Member

This looks great! Just some nits and we should be good to go.

Thanks!

@Manishearth
Copy link
Member

Oh, also, the inline error messages could do with some love. A more verbose message, and a span_note saying "perhaps add pub " might work. This can be done in a separate PR if you'd like.


E0364: r##"
Private items cannot be publicly re-exported. This error indicates
that you attempted to write a 'pub use' against a type or value that was
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attempted to pub use an item that was

Since these diagnostic messages eventually get parsed as markdown, inline code must be delimited by ` (U+0060 GRAVE ACCENT), not ' (U+0027 APOSTROPHE).

@AlisdairO
Copy link
Contributor Author

Thanks for the comments, I think that should address them!

@nagisa
Copy link
Member

nagisa commented Jul 16, 2015

I think something like

attempted to pub use an item that was

sounds much more natural than

attempted to write a pub use against a type or value that was

but that’s mostly up to you if you really want to keep the current version.

@AlisdairO
Copy link
Contributor Author

Good point - also apologies, forgot to make tidy before the second commit. I'll fix it up in the morning!

@AlisdairO
Copy link
Contributor Author

Actually I just squeezed it in tonight :-)

@bors
Copy link
Contributor

bors commented Jul 17, 2015

☔ The latest upstream changes (presumably #27066) made this pull request unmergeable. Please resolve the merge conflicts.

@Manishearth
Copy link
Member

Might want to rebase to master and squash your commits into one (let me know if you need help with that 😄 )

@AlisdairO
Copy link
Contributor Author

That should do it I think!

@Manishearth
Copy link
Member

@bors r+ rollup

Thanks!

@bors
Copy link
Contributor

bors commented Jul 17, 2015

📌 Commit 94b1ca8 has been approved by Manishearth

@Manishearth
Copy link
Member

If you want a good next bug to work on, try the stuff I mentioned here 😄

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 17, 2015
Added some detailed diagnostics for E0364 and E0365.
@AlisdairO
Copy link
Contributor Author

@Manishearth : I already included those in this PR I think :)

let msg = format!("`{}` is private", source);
let msg = format!("`{}` is private, and cannot be reexported",
token::get_name(source));
let note_msg = format!("Consider declaring module {} as `pub mod`",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"module {} as a pub mod"

@Manishearth
Copy link
Member

Oh wow I totally missed that in my second read-through because I stopped when I reached the bottom of the first file :)

nice work! small nit, but I'll fix it in my rollup branch

@AlisdairO
Copy link
Contributor Author

Fab, thanks :)

bors added a commit that referenced this pull request Jul 17, 2015
@bors bors merged commit 94b1ca8 into rust-lang:master Jul 17, 2015
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.

6 participants