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 10 pull requests #82443

Merged
merged 37 commits into from
Feb 23, 2021
Merged

Rollup of 10 pull requests #82443

merged 37 commits into from
Feb 23, 2021

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

sledgehammervampire and others added 30 commits February 8, 2021 13:24
Before this change, the suggestion was `std::panic::panic_any(123]`,
changing the opening brace but not the closing one.
An attempt to compute HIR stats for crates with nested foreign items results in an ICE.

```
fn main() {
    extern "C" { fn f(); }
}
```

```
thread 'rustc' panicked at 'visit_nested_xxx must be manually implemented in this visitor'
```

Provide required implementation of visitor method.
Changes from 81473 extended the dead code lint with an ability to detect
fields that are written to but never read from. The implementation skips
over fields on the left hand side of an assignment, without marking them
as live.

A field access might involve an automatic dereference and de-facto read
the field. Conservatively mark expressions with deref adjustments as
live to avoid generating false positive warnings.
Update conflict_errors.rs

Add deref definition location
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
I left some of them so this change doesn't balloon in size and because
removing the RefCell in `DocContext.resolver` would require compiler
changes.

Thanks to `@jyn514` for making this a lot easier with rust-lang#82020!
…1011

Point out implicit deref coercions in borrow

Fixes rust-lang#81365

`@Aaron1011` I'm not sure why my code shows the note even in an implicit `Deref` call. See the output for `issue-81365-8.rs`.
Improve non_fmt_panic lint.

This change:
- fixes the span used by this lint in the case the panic argument is a single macro expansion (e.g. `panic!(a!())`);
- adds a suggestion for `panic!(format!(..))` to remove `format!()` instead of adding `"{}", ` or using `panic_any` like it does now; and
- fixes the incorrect suggestion to replace `panic![123]` by `panic_any(123]`.

Fixes rust-lang#82109.
Fixes rust-lang#82110.
Fixes rust-lang#82111.

Example output:
```
warning: panic message is not a string literal
 --> src/main.rs:8:12
  |
8 |     panic!(format!("error: {}", "oh no"));
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(non_fmt_panic)]` on by default
  = note: this is no longer accepted in Rust 2021
  = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
  |
8 |     panic!("error: {}", "oh no");
  |           --                  --

```

r? `@estebank`
Implement -Z hir-stats for nested foreign items

An attempt to compute HIR stats for crates with nested foreign items results in an ICE.

```rust
fn main() {
    extern "C" { fn f(); }
}
```

```
thread 'rustc' panicked at 'visit_nested_xxx must be manually implemented in this visitor'
```

Provide required implementation of visitor method.
Support `pub` on `macro_rules`

This rebases and updates `since` version of rust-lang#78166 from ``@petrochenkov``

r? ``@nikomatsakis``
Consider auto derefs before warning about write only fields

Changes from rust-lang#81473 extended the dead code lint with an ability to detect
fields that are written to but never read from. The implementation skips
over fields on the left hand side of an assignment, without marking them
as live.

A field access might involve an automatic dereference and de-facto read
the field. Conservatively mark expressions with deref adjustments as
live to avoid generating false positive warnings.

Closes rust-lang#81626.
Remove many RefCells from DocContext

I left some of them so this change doesn't balloon in size and because
removing the RefCell in `DocContext.resolver` would require compiler
changes.

Thanks to `@jyn514` for making this a lot easier with rust-lang#82020!

r? `@jyn514`
Lower condition of `if` expression before it's "then" block

Fix rust-lang#82290, fix rust-lang#82250.
…s, r=jyn514

Jsondocck improvements

Adds 2 new commands, ```@is``` and ```@set`.``

```@is``` works like ```@has`,`` except instead of checking if any value matches, it checks that there is exactly one value, and it matches. This allows more precise testing.

```@set``` gets a value, and saves it to be used later. This makes it possible to check that an item appears in the correct module.

Once this lands, the rest of the test suite can be upgraded to use these.

cc ``@CraftSpider``

 ``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json +A-testsuite
Fix mir-cfg dumps

Fixes rust-lang#81918
Fixes rust-lang#82326 (duplicate)
Fixes rust-lang#82325

---

r? ``@oli-obk``
@rustbot rustbot added the rollup A PR which is a rollup label Feb 23, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 23, 2021

📌 Commit 51511c7 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 23, 2021
@bors
Copy link
Contributor

bors commented Feb 23, 2021

⌛ Testing commit 51511c7 with merge fe1bf8e...

@bors
Copy link
Contributor

bors commented Feb 23, 2021

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing fe1bf8e to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.