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

Clarify use_decl module resolution docs. #8639

Closed
wants to merge 1 commit into from

Conversation

brandonson
Copy link
Contributor

Attempt #2 of this pull request since my tired mind decided messing up my repo, then deleting and re-forking was a good idea. This is identical to the second last commit in that PR. (The one before I ruined everything.)

This is an improvement to use_decl docs, which will hopefully improve understanding of how resolution works and where extern mod and module declarations should go to make them visible to use declarations.

@catamorphism
Copy link
Contributor

@singingboyo Looks like one of the doc tests failed. Maybe mark it as notrust?

@brandonson
Copy link
Contributor Author

Marked the new example .xfail-test, since I couldn't get it to just ignore unused imports.

It does compile if unused-imports is set to warn, but the doc tests deny unused imports.

@thestinger
Copy link
Contributor

@singingboyo: you could use the ability to ignore lines to wrap the code in a function and set #[allow(unused-imports)]

@brandonson
Copy link
Contributor Author

Turns out there's no need for a wrapper function, just needed a semi-colon after #[allow(unused_imports)] that I didn't have. Didn't error without it the way I'd expect though...

It's all squashed to a single, working commit now.

@thestinger
Copy link
Contributor

@singingboyo: yeah it's a bit strange, with the semi-colon it applies to the enclosing scope (in this case - a fn main generated as a wrapper in the test) instead of the following item.

bors added a commit that referenced this pull request Aug 23, 2013
Attempt #2 of [this pull request](#8597) since my tired mind decided messing up my repo, then deleting and re-forking was a good idea.  This is identical to the second last commit in that PR.  (The one before I ruined everything.)

This is an improvement to use_decl docs, which will hopefully improve understanding of how resolution works and where `extern mod` and module declarations should go to make them visible to use declarations.
@bors bors closed this Aug 23, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2022
…, r=dswij

`trivially_copy_pass_by_ref` fixes

fixes rust-lang#5953
fixes rust-lang#2961

The fix for rust-lang#5953 is overly aggressive, but the suggestion is so bad that it's worth the false negatives. Basically three things together:
* It's not obviously wrong
* It compiles
* It may actually work when tested

changelog: Don't lint `trivially_copy_pass_by_ref` when unsafe pointers are used.
changelog: Better track lifetimes when linting `trivially_copy_pass_by_ref`.
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.

4 participants