Commit Graph

129168 Commits

Author SHA1 Message Date
Yuki Okushi
2224e26578 Clarify the debug-related values should take boolean
They should take boolean values and the current placeholders are confusing, at least for me.
2020-10-10 23:36:55 +09:00
bors
7b06cb1052 Auto merge of #77747 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update.

This includes a `Cargo.lock` update: 7ea42be

r? `@Manishearth`
2020-10-09 17:14:39 +00:00
bors
be719d11e5 Auto merge of #77609 - ortem:fix-lldb-commands, r=Mark-Simulacrum
Remove redundant backslashes from `lldb_commands`
2020-10-09 15:18:41 +00:00
bors
53a4c3b0ba Auto merge of #77690 - est31:llvm_8_required, r=matthewjasper
Simplify some code in rustc_llvm/build.rs now that LLVM 8 is required

LLVM 8 is required since 8506bb0060
so this is safe to do.
2020-10-09 12:23:49 +00:00
flip1995
7ea42be036
Update Cargo.lock 2020-10-09 12:46:26 +02:00
flip1995
6b8d25ecda
Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyup 2020-10-09 12:45:29 +02:00
bors
6b8b396aee Auto merge of #77698 - vandenheuvel:chalkup, r=jackh726
Update chalk to 0.32.0

r? `@jackh726`
2020-10-09 10:32:52 +00:00
bors
2f6439ae6a Auto merge of #6136 - dtolnay:serve, r=flip1995
Clippy dev subcommand to build and serve website

This PR adds `clippy dev serve` which will pop open a browser with a local rendered 'ALL the Clippy Lints' website, and re-render as you edit stuff.

---

changelog: none
2020-10-09 08:58:19 +00:00
bors
fc3d8e3fcc Auto merge of #77687 - est31:hash_shorter_path, r=davidtwco
Use shorter path for std:#️⃣:Hash
2020-10-09 08:09:32 +00:00
bors
6fb3b2c160 Auto merge of #6115 - ebroto:changelog_1_48, r=flip1995
Add changelog for 1.48 beta

[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_1_48/CHANGELOG.md)

I've not added the PRs fixing `same_item_push` because those were backported, namely:
* [#5908](https://github.com/rust-lang/rust-clippy/pull/5908)
* [#5997](https://github.com/rust-lang/rust-clippy/pull/5997)
* [#6016](https://github.com/rust-lang/rust-clippy/pull/6016)

The following PR was reverted, so I've ignored it too:
* [#5984](https://github.com/rust-lang/rust-clippy/pull/5984)

~~Also, I took the liberty of adding a "Thanks" section, naming all the contributors to this release. I think they deserve visibility in the changelog. Please tell me if we want to add this or maybe it's redundant given we link to the PRs?~~

changelog: none

r? `@flip1995`
2020-10-09 08:09:23 +00:00
bors
195cc9be94 Auto merge of #6145 - flip1995:backport_remerge, r=flip1995
Backport remerge

Step 1 in the release process.

r? `@ghost`

changelog: none
2020-10-09 06:53:55 +00:00
flip1995
58375283e8
Merge remote-tracking branch 'upstream/beta' into backport_remerge 2020-10-09 08:52:06 +02:00
bors
9a74fb726e Auto merge of #77627 - richkadel:rust-demangler, r=tmandry
rust-demangler tool strips crate disambiguators with < 16 digits

Addresses Issue #77615.
2020-10-09 06:15:09 +00:00
bors
2359ecc71f Auto merge of #77578 - euclio:max-suggestion, r=davidtwco
suggest `MAX` constant if -1 is assigned to unsigned type

Fixes #76413.
Fixes #77416.
2020-10-09 04:22:18 +00:00
bors
9ba1d21868 Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez
Resolve intra-doc links on additional documentation for re-exports in lexical scope

Fixes https://github.com/rust-lang/rust/issues/77254.

- Preserve the parent module of `DocFragment`s
  + Add `parent_module` to `DocFragment`
  + Require the `parent_module` of the item being inlined
  + Preserve the hir_id for ExternCrates so rustdoc can find the parent module later
  + Take an optional `parent_module` for `build_impl` and `merge_attrs`.
    Preserve the difference between parent modules for each doc-comment.
  + Support a single additional re-exports in from_ast. Originally this took a vec but I ended up not using it.
  + Don't require the parent_module for all `impl`s, just inlined items

    In particular, this will be `None` whenever the attribute is not on a
    re-export.

  + Only store the parent_module, not the HirId

    When re-exporting a re-export, the HirId is not available. Fortunately,
    `collect_intra_doc_links` doesn't actually need all the info from a
    HirId, just the parent module.

- Introduce `Divider`

  This distinguishes between documentation on the original from docs on  the re-export.

- Use the new module information for intra-doc links

  + Make the parent module conditional on whether the docs are on a re-export
  + Make `resolve_link` take `&Item` instead of `&mut Item`

    Previously the borrow checker gave an error about multiple mutable
    borrows, because `dox` borrowed from `item`.

  + Fix `crate::` for re-exports

    `crate` means something different depending on where the attribute
    came from.

  + Make it work for `#[doc]` attributes too

    This required combining several attributes as one so they would keep
    the links.

r? `@GuillaumeGomez`
2020-10-09 02:27:33 +00:00
bors
03ef8a081e Auto merge of #76260 - xd009642:rfc/2867, r=jonas-schievink
Implementation of RFC2867

https://github.com/rust-lang/rust/issues/74727

So I've started work on this, I think my next steps are to make use of the `instruction_set` value in the llvm codegen but this is the point where I begin to get a bit lost. I'm looking at the code but it would be nice to have some guidance on what I've currently done and what I'm doing next 😄
2020-10-09 00:29:47 +00:00
xd009642
bdb3f7716b Fix typo in error code 2020-10-08 23:56:59 +01:00
bors
e651a04fab Auto merge of #6133 - JPTIZ:no-box-for-c-ffi, r=ebroto
clippy_lints: Do not warn against Box parameter in C FFI

changelog: [`boxed_local`]: don't lint in `extern fn` arguments

Fixes #5542.

When using C FFI, to handle pointers in parameters it is needed to
declare them as `Box` in its Rust-side signature. However, the current
linter warns against the usage of Box stating that "local variable
doesn't need to be boxed here".

This commit fixes it by ignoring functions whose Abi is C.
2020-10-08 22:50:29 +00:00
bors
8a84c4f9c8 Auto merge of #77723 - jonas-schievink:rollup-htz44r4, r=jonas-schievink
Rollup of 8 pull requests

Successful merges:

 - #76750 (Don't discourage implementing `core::fmt::Write`)
 - #77449 (BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic)
 - #77660 ((docs): make mutex error comment consistent with codebase)
 - #77663 (Add compile fail test for issue 27675)
 - #77673 (Remove unnecessary lamda on emitter map.)
 - #77701 (Make `max_log_info` easily greppable (for figuring out why debug logging is disabled))
 - #77702 (Remove not needed lambda.)
 - #77710 (Update submodule llvm to get LVI bugfix)

Failed merges:

r? `@ghost`
2020-10-08 22:37:37 +00:00
xd009642
a6e2b636e6 Implement the instruction_set attribute 2020-10-08 23:32:20 +01:00
João Paulo Taylor Ienczak Zanette
b709b87363 tests: Add test function that does not specify ABI 2020-10-08 18:50:52 -03:00
bors
265e4841b7 Auto merge of #6117 - dtolnay:string_lit_as_bytes, r=ebroto
Downgrade string_lit_as_bytes to nursery

Between #1402 (regarding `to_owned`) and #4494 (regarding `impl Read`), as well as other confusion I've seen hit in my work codebase involving string_lit_as_bytes (`"...".as_bytes().into()`), I don't think this lint is at a quality to be enabled by default.

I would consider re-enabling this lint after it is updated to understand when the surrounding type information is sufficient to unsize `b"..."` to &\[u8\] without causing a type error.

As currently implemented, this lint is pushing people to write `&b"_"[..]` which is not an improvement over `"_".as_bytes()` as far as I am concerned.

---

changelog: Remove string_lit_as_bytes from default set of enabled lints
2020-10-08 21:33:32 +00:00
Jonas Schievink
d252848c2e
Rollup merge of #77710 - fortanix:raoul/bugfix-lvi, r=nikic
Update submodule llvm to get LVI bugfix

The LLVM LVI mitigations used register %rcs as a clobber register. This is problematic when rust uses this register to return (part of) function values. The problem was fixed upstream in:

    https://reviews.llvm.org/D88924
    https://reviews.llvm.org/D88925

PR https://github.com/rust-lang/llvm-project/pull/79 merged it in the llvm_project. This PR updates the submodule

Bug report: https://bugs.llvm.org/show_bug.cgi?id=47740
Fixes #77607

cc: @jethrogb
2020-10-08 23:23:19 +02:00
Jonas Schievink
dd09561311
Rollup merge of #77702 - heckad:patch-3, r=lcnr
Remove not needed lambda.
2020-10-08 23:23:17 +02:00
Jonas Schievink
044484078b
Rollup merge of #77701 - jyn514:debug-logging, r=Mark-Simulacrum
Make `max_log_info` easily greppable (for figuring out why debug logging is disabled)

Follow-up to https://github.com/rust-lang/rust/pull/77678#issuecomment-705545608. I'll make a PR to the dev-guide shortly changing `debug = true` to `debug-logging = true` and using this text.

Ideally wouldn't be merged before https://github.com/rust-lang/rust/pull/77678, but it practice it won't hurt anything.

r? @Mark-Simulacrum
2020-10-08 23:23:15 +02:00
Jonas Schievink
48c1ca15bb
Rollup merge of #77673 - heckad:patch-2, r=lcnr
Remove unnecessary lamda on emitter map.
2020-10-08 23:23:13 +02:00
Jonas Schievink
b1e856ad43
Rollup merge of #77663 - HeroicKatora:regression-tests-27675-object-safe, r=Aaron1011
Add compile fail test for issue 27675

A recently merged PR (#73905) strengthened the checks on bounds of associated items. This rejects the attack path of #27675 which consisted of constructing a `dyn Trait<Item=T>` where `T` would not fulfill the bounds required on `Item` of the `Trait` behind the dyn object.

This regression test, extracted from [the weaponized instance](https://github.com/rust-lang/rust/issues/27675#issuecomment-696956878), checks that this is rejected.
2020-10-08 23:23:12 +02:00
Jonas Schievink
7edb7e7ec0
Rollup merge of #77660 - nilslice:patch-1, r=jyn514
(docs): make mutex error comment consistent with codebase

Although exceptionally minor, I found this stands out from other error reporting language used in doc comments. With the existence of the `failure` crate, I suppose this could be slightly ambiguous. In any case, this change brings the particular comment into a consistent state with other mentions of returning errors.
2020-10-08 23:23:10 +02:00
Jonas Schievink
738a41b363
Rollup merge of #77449 - ssomers:btree_drain_filter_size_hint, r=Mark-Simulacrum
BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic

The `size_hint` of the `DrainFilter` iterator doesn't adjust as you iterate. This hardly seems important to me, but there has been a comparable PR #64383 in the past. I guess a scenario is that you first iterate half the map manually and keep most of the key/value pairs in the map, and then tell the predicate to drain most of the key/value pairs and `.collect` the iterator over the remaining half of the map.

I am totally ambivalent whether this is better or not.

r? @Mark-Simulacrum
2020-10-08 23:23:08 +02:00
Jonas Schievink
2766b725d3
Rollup merge of #76750 - camelid:dont-discourage-core-fmt-write, r=Mark-Simulacrum
Don't discourage implementing `core::fmt::Write`

Fixes #76729.

Explain when you should use it and when you should not.
2020-10-08 23:23:07 +02:00
bors
3525087ada Auto merge of #77110 - lzutao:e0596-amp_mut, r=davidtwco
Suggest removing `&mut` from a `&mut borrow`

Modify the code added in #54720.

Closes  #75871
2020-10-08 20:43:01 +00:00
Rich Kadel
796e6ac81c rust-demangler tool strips crate disambiguators with < 16 digits
Addresses Issue #77615.
2020-10-08 11:28:01 -07:00
Camelid
c17d067018 Don't discourage implementing core::fmt::Write
Explain when you should use it and when you should not.
2020-10-08 10:49:44 -07:00
bors
6b8d7911a1 Auto merge of #77346 - Caduser2020:master, r=Mark-Simulacrum
`#[deny(unsafe_op_in_unsafe_fn)]` in sys/sgx

This is part of #73904.

Enclose unsafe operations in unsafe blocks in `libstd/sys/sgx`.
2020-10-08 17:36:25 +00:00
Andy Russell
ced11a83cb
suggest MAX constant if -1 is assigned to unsigned type 2020-10-08 13:11:31 -04:00
bors
6bfc19c687 Auto merge of #6138 - giraffate:note_that_we_follow_rustc_no_merge_policy, r=Manishearth
Add note that we follow a rustc no merge-commit policy

I think it would be better to add a note that we follow a rustc no merge-commit policy. For example, it was mentioned at https://github.com/rust-lang/rust-clippy/pull/5694#issuecomment-641871096.

changelog: none
2020-10-08 16:56:14 +00:00
Raoul Strackx
8ab2ba1fe9 Update submodule llvm to get LVI bugfix 2020-10-08 17:43:26 +02:00
Caduser2020
1fb0a1d501 #[deny(unsafe_op_in_unsafe_fn)] in sys/sgx
Run `./x.py` fmt

Add reference link

Fix reference link

Apply review suggestions.
2020-10-08 10:09:18 -05:00
Lzu Tao
ab226bda9a Suggest removing &mut from borrow of &mut
Fix a typo: minding -> binding
Add test for &mut &mut
2020-10-08 14:26:21 +00:00
Takayuki Nakata
fd61686ad5 Add note that we follow a rustc no merge-commit policy 2020-10-08 23:13:06 +09:00
David Tolnay
e6a71066c8
Clippy dev subcommand to build and serve website 2020-10-08 06:43:02 -07:00
bors
ccea570488 Auto merge of #77678 - jyn514:tracing, r=Mark-Simulacrum
Upgrade to tracing-subscriber 0.2.13

The primary motivation is to get the changes from
https://github.com/tokio-rs/tracing/pull/990. Example output:

```
$ RUSTDOC_LOG=debug rustdoc +rustc2
warning: some trace filter directives would enable traces that are disabled statically
 | `debug` would enable the DEBUG level for all targets
 = note: the static max level is `info`
 = help: to enable DEBUG logging, remove the `max_level_info` feature
```

r? `@Mark-Simulacrum`
cc `@hawkw` ❤️
2020-10-08 13:38:29 +00:00
Kazantcev Andrey
3450cf61e0
Remove not needed lambda. 2020-10-08 16:22:31 +03:00
Joshua Nelson
a28f425ad7 Make max_log_info easily greppable 2020-10-08 09:16:27 -04:00
João Paulo Taylor Ienczak Zanette
5ae0f2644d clippy_lint: extern definition is in Rust, not C 2020-10-08 09:07:24 -03:00
João Paulo Taylor Ienczak Zanette
418cde0389 clippy_lint: Fix typo (now -> not) 2020-10-08 09:06:19 -03:00
João Paulo Taylor Ienczak Zanette
cc26924cce clippy_lint: Extend BoxedLocal ignored ABI to all non-rust ABIs. 2020-10-08 09:03:11 -03:00
David Tolnay
c81bea45f4
Make clippy_lints's doc tests succeed 2020-10-08 04:54:17 -07:00
David Tolnay
3a6f59ecae
Document string_lit_as_bytes known problems 2020-10-08 04:50:24 -07:00
bors
382848989f Auto merge of #77581 - ecstatic-morse:dataflow-dump-mir-graphviz, r=davidtwco
Use `pretty::create_dump_file` for dumping dataflow results

The old code wasn't incorporating promoteds into the path, meaning other `dot` files could get clobbered. Use the MIR dump infrastructure to generate paths so that this doesn't occur in the future.
2020-10-08 11:42:24 +00:00