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

Rollup of 8 pull requests #42032

Closed
wants to merge 23 commits into from

Conversation

est31 and others added 23 commits May 13, 2017 16:02
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`
```
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
…umeGomez

rustdoc: Display `extern "C" fn` instead of `extern fn`

It was decided in rust-lang/style-team#52 to be explicit about the ABI so rustdoc should follow suit.
Fix regression in `macro_rules!` name matching

Fixes rust-lang#41803.
r? @nrc
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@Mark-Simulacrum
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Contributor

bors commented May 16, 2017

📌 Commit 747f7d2 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented May 16, 2017

⌛ Testing commit 747f7d2 with merge be3a003...

@bors
Copy link
Contributor

bors commented May 16, 2017

💔 Test failed - status-appveyor

@est31
Copy link
Member

est31 commented May 16, 2017

Dist RLS stage2 (x86_64-pc-windows-gnu)
Dist mingw (x86_64-pc-windows-gnu)
thread 'main' panicked at 'failed to copy `C:\projects\rust\mingw64\bin\libstdc++-6.dll` to `C:\projects\rust\build\tmp/dist\bin/libstdc++-6.dll`: The system cannot find the path specified. (os error 3)', src\bootstrap\util.rs:47
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Build completed unsuccessfully in 1:12:20
Command exited with code 101
cat %CD%\sccache.log || exit 0

seems like some sscache error?

@Mark-Simulacrum
Copy link
Member Author

Hmm... No, I think that's a dist failure... probably related to #41932.

@Mark-Simulacrum Mark-Simulacrum deleted the rollup branch May 16, 2017 14:18
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants