-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 6 pull requests #42022
Rollup of 6 pull requests #42022
Conversation
This commit extends the current unused macro linter to support directives like #[allow(unused_macros)] or #[deny(unused_macros)] directly next to the macro definition, or in one of the modules the macro is inside. Before, we only supported such directives at a per crate level, due to the crate's NodeId being passed to session.add_lint. We also had to implement handling of the macro's NodeId in the lint visitor.
Part of rust-lang#29378 . - In particular explains *why* we would use the builder instead of the free function. - Changes the parent-child explanation for a spawned-caller. - Add link to `io::Result` in `thread::Builder` - Corrects the `thread::Builder::spawn` documentation.
Make diagnostic note for existing method with unsatisfied trait bounds multiline for cleaner output. ``` = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>` `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>> [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator` Before: ``` = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`, `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator` ```
…r=arielb1 Make unsatisfied trait bounds note multiline Make diagnostic note for existing method with unsatisfied trait bounds multiline for cleaner output. ``` = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>` `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>> [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator` ``` Before: ``` = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`, `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator` ```
…sakis Add Vec::resize_default. As suggested by rust-lang#41758.
Add lint for unused macros Addresses parts of rust-lang#34938, to add a lint for unused macros. We now output warnings by default when we encounter a macro that we didn't use for expansion. Issues to be resolved before this PR is ready for merge: - [x] fix the NodeId issue described above - [x] remove all unused macros from rustc and the libraries or set `#[allow(unused_macros)]` next to them if they should be kept for some reason. This is needed for successful boostrap and bors to accept the PR. -> rust-lang#41934 - [x] ~~implement the full extent of rust-lang#34938, that means the macro match arm checking as well.~~ *let's not do this for now*
…umeGomez [Doc] Explain why `thread::yield_now` could be used. Part of rust-lang#29378. r? @steveklabnik
…eGomez [Doc] Implrove `thread::Builder`'s doc. Part of rust-lang#29378 . - Explains *why* we would use the builder instead ofthe free function. - Changes the parent-child explanation for a spawned-caller in `thread::Builder::spawn` - Adds a link to `io::Result` in `thread::Builder` - Corrects the return type doc in `thread::Builder::spawn` r? @rust-lang/docs
[Doc] Add links to the `thread::LocalKey` doc. Part of rust-lang#29378 . I do not know exactly what should be done for the `cleanup` part, if you have any idea I'll gladly do it. r? @rust-lang/docs
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. Due to 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. |
@bors r+ p=10 |
📌 Commit fb7309c has been approved by |
⌛ Testing commit fb7309c with merge c0f8f4e... |
💔 Test failed - status-appveyor |
@bors retry sccache machine was shut down? |
⌛ Testing commit fb7309c with merge 9581366... |
💔 Test failed - status-appveyor |
Legitimate (#41907) Compiling rustc v0.0.0 (file:///C:/projects/rust/src/librustc)
error: unused macro definition
--> src\librustc\util\common.rs:119:1
|
119 | / macro_rules! option_try(
120 | | ($e:expr) => (match $e { Some(e) => e, None => return None })
121 | | );
| |__^
|
= note: #[deny(unused_macros)] implied by #[deny(warnings)]
note: lint level defined here
--> src\librustc\lib.rs:23:9
|
23 | #![deny(warnings)]
| ^^^^^^^^
error: aborting due to previous error
error: Could not compile `rustc`.
Build failed, waiting for other jobs to finish...
error: build failed |
thread::yield_now
could be used. #41982, [Doc] Implrovethread::Builder
's doc. #41994, [Doc] Add links to thethread::LocalKey
doc. #41995