]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #6144 - rust-lang:float-cmp-ref, r=ebroto
bors [Fri, 9 Oct 2020 22:28:00 +0000 (22:28 +0000)]
Auto merge of #6144 - rust-lang:float-cmp-ref, r=ebroto

allow refs in our constant folder

This helps with #3804 (but won't completely fix it).

---

changelog: none

3 years agoAuto merge of #6152 - flip1995:ice_6139, r=ebroto
bors [Fri, 9 Oct 2020 20:39:26 +0000 (20:39 +0000)]
Auto merge of #6152 - flip1995:ice_6139, r=ebroto

Fixes ICE 6139

Fixes #6139

Kind of hacky, but this should be fine.

changelog: none

3 years ago(Hacky) Fix for ICE #6139
flip1995 [Fri, 9 Oct 2020 20:22:21 +0000 (22:22 +0200)]
(Hacky) Fix for ICE #6139

3 years agoAdd regression test for ICE 6139
flip1995 [Fri, 9 Oct 2020 20:21:47 +0000 (22:21 +0200)]
Add regression test for ICE 6139

3 years agoallow refs in our constant handling
Andre Bogus [Thu, 8 Oct 2020 22:49:27 +0000 (00:49 +0200)]
allow refs in our constant handling

3 years agoAuto merge of #6130 - Ambroisie:lint-ptr-eq, r=Manishearth
bors [Fri, 9 Oct 2020 16:46:09 +0000 (16:46 +0000)]
Auto merge of #6130 - Ambroisie:lint-ptr-eq, r=Manishearth

New lint: Recommend using `ptr::eq` when possible

This is based almost entirely on the code available in the previous PR #4596. I merely updated the code to make it compile.

Fixes #3661.

- [ ] I'm not sure about the lint name, but it was the one used in the original PR.
- [X] Added passing UI tests (including committed `.stderr` file)
- [X] `cargo test` passes locally
- [X] Executed `cargo dev update_lints`
- [X] Added lint documentation
- [X] Run `cargo dev fmt`

---

changelog: none

3 years agoAuto merge of #6150 - flip1995:backport_doc_update, r=ebroto
bors [Fri, 9 Oct 2020 13:44:01 +0000 (13:44 +0000)]
Auto merge of #6150 - flip1995:backport_doc_update, r=ebroto

Update backport documentation to the subtree workflow

changelog: none

3 years agoAuto merge of #6149 - flip1995:update_actions, r=ebroto
bors [Fri, 9 Oct 2020 13:23:01 +0000 (13:23 +0000)]
Auto merge of #6149 - flip1995:update_actions, r=ebroto

Remove deprecated set-env from GHA

This updates all of our action dependencies and removes every usage of `set-env`. `set-env` and `add-path` has been deprecated: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

changelog: none

3 years agoAuto merge of #6148 - flip1995:release_doc, r=ebroto
bors [Fri, 9 Oct 2020 13:02:25 +0000 (13:02 +0000)]
Auto merge of #6148 - flip1995:release_doc, r=ebroto

Update release documentation

When updating the beta branch, we want to reset, instead of rebase. Otherwise we might produce again new commits on the beta branch, that aren't on the master branch.

changelog: none

3 years agoAuto merge of #6131 - Ambroisie:fix-doc-tools, r=flip1995
bors [Fri, 9 Oct 2020 12:41:08 +0000 (12:41 +0000)]
Auto merge of #6131 - Ambroisie:fix-doc-tools, r=flip1995

Rename tables to typecheck_result()

While working on #6130, I noticed that part of the documentation was updated to use `LateContext::typeck_results`, but the paragraph still referred to the old `tables` field of `LateContext`.

---

*Please keep the line below*
changelog: none

3 years agoAuto merge of #6146 - woshilapin:patch-1, r=flip1995
bors [Fri, 9 Oct 2020 12:20:29 +0000 (12:20 +0000)]
Auto merge of #6146 - woshilapin:patch-1, r=flip1995

clippy_lint: Fix doc on 'option_if_let_else'

changelog: none

3 years agoUpdate backport documentation to the subtree workflow
flip1995 [Fri, 9 Oct 2020 12:14:49 +0000 (14:14 +0200)]
Update backport documentation to the subtree workflow

3 years agoUse defaults.run.shell instead of setting shell every time
flip1995 [Fri, 9 Oct 2020 09:53:10 +0000 (11:53 +0200)]
Use defaults.run.shell instead of setting shell every time

3 years agoRemove all usage of set-env
flip1995 [Fri, 9 Oct 2020 08:40:04 +0000 (10:40 +0200)]
Remove all usage of set-env

3 years agoAuto merge of #6136 - dtolnay:serve, r=flip1995
bors [Fri, 9 Oct 2020 08:58:19 +0000 (08:58 +0000)]
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

3 years agoAuto merge of #6115 - ebroto:changelog_1_48, r=flip1995
bors [Fri, 9 Oct 2020 08:09:23 +0000 (08:09 +0000)]
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`

3 years agoclippy_lint: Fix doc on 'option_if_let_else'
Jean SIMARD [Fri, 9 Oct 2020 07:47:53 +0000 (09:47 +0200)]
clippy_lint: Fix doc on 'option_if_let_else'

- a typo in `expresion`
- a useless double space
- Some back-tick quotes for 'if let'

3 years agoUpdate release documentation
flip1995 [Fri, 9 Oct 2020 07:40:57 +0000 (09:40 +0200)]
Update release documentation

3 years agoUpdate actions due to deprecation of set-env and add-path
flip1995 [Fri, 9 Oct 2020 07:17:48 +0000 (09:17 +0200)]
Update actions due to deprecation of set-env and add-path

3 years agoAuto merge of #6145 - flip1995:backport_remerge, r=flip1995
bors [Fri, 9 Oct 2020 06:53:55 +0000 (06:53 +0000)]
Auto merge of #6145 - flip1995:backport_remerge, r=flip1995

Backport remerge

Step 1 in the release process.

r? `@ghost`

changelog: none

3 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Fri, 9 Oct 2020 06:52:06 +0000 (08:52 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

3 years agoAuto merge of #6133 - JPTIZ:no-box-for-c-ffi, r=ebroto
bors [Thu, 8 Oct 2020 22:50:29 +0000 (22:50 +0000)]
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.

3 years agotests: Add test function that does not specify ABI
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 21:50:52 +0000 (18:50 -0300)]
tests: Add test function that does not specify ABI

3 years agoAuto merge of #6117 - dtolnay:string_lit_as_bytes, r=ebroto
bors [Thu, 8 Oct 2020 21:33:32 +0000 (21:33 +0000)]
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

3 years agoAuto merge of #6138 - giraffate:note_that_we_follow_rustc_no_merge_policy, r=Manishearth
bors [Thu, 8 Oct 2020 16:56:14 +0000 (16:56 +0000)]
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

3 years agoAdd note that we follow a rustc no merge-commit policy
Takayuki Nakata [Thu, 8 Oct 2020 14:13:06 +0000 (23:13 +0900)]
Add note that we follow a rustc no merge-commit policy

3 years agoClippy dev subcommand to build and serve website
David Tolnay [Thu, 8 Oct 2020 12:18:22 +0000 (05:18 -0700)]
Clippy dev subcommand to build and serve website

3 years agoclippy_lint: extern definition is in Rust, not C
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 12:07:24 +0000 (09:07 -0300)]
clippy_lint: extern definition is in Rust, not C

3 years agoclippy_lint: Fix typo (now -> not)
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 12:06:19 +0000 (09:06 -0300)]
clippy_lint: Fix typo (now -> not)

3 years agoclippy_lint: Extend BoxedLocal ignored ABI to all non-rust ABIs.
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 12:03:11 +0000 (09:03 -0300)]
clippy_lint: Extend BoxedLocal ignored ABI to all non-rust ABIs.

3 years agoMake clippy_lints's doc tests succeed
David Tolnay [Thu, 8 Oct 2020 11:54:17 +0000 (04:54 -0700)]
Make clippy_lints's doc tests succeed

3 years agoDocument string_lit_as_bytes known problems
David Tolnay [Thu, 8 Oct 2020 11:50:24 +0000 (04:50 -0700)]
Document string_lit_as_bytes known problems

3 years agoAuto merge of #6132 - rust-lang:regex-unicode, r=ebroto
bors [Thu, 8 Oct 2020 08:48:12 +0000 (08:48 +0000)]
Auto merge of #6132 - rust-lang:regex-unicode, r=ebroto

Fix unicode regexen with bytes::Regex

fixes #6005

The rationale for this is that since we wrote that lint, `bytes::Regex` was extended to be able to use unicode character classes.

---

changelog: [`invalid_regex`]: allow unicode character classes in bytes regex.

3 years agoclippy_lint: Test for BoxedLocal false-positive in C-FFI and fix C-FFI Abi comparison.
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 01:49:50 +0000 (22:49 -0300)]
clippy_lint: Test for BoxedLocal false-positive in C-FFI and fix C-FFI Abi comparison.

3 years agoclippy_lints: Do not warn against Box parameter in C FFI
João Paulo Taylor Ienczak Zanette [Thu, 8 Oct 2020 00:41:54 +0000 (21:41 -0300)]
clippy_lints: Do not warn against Box parameter in C FFI

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 Cdecl.

3 years agoAuto merge of #6128 - dtolnay:rc_buffer, r=yaahc
bors [Wed, 7 Oct 2020 23:10:34 +0000 (23:10 +0000)]
Auto merge of #6128 - dtolnay:rc_buffer, r=yaahc

Downgrade rc_buffer to restriction

I think Arc\<Vec\<T\>\> and Arc\<String\> and similar are a totally reasonable data structure, as observed by others in the comments on [#6044](https://github.com/rust-lang/rust-clippy/pull/6044#event-3799579830) as well. Doing `Arc::make_mut(&mut self.vec).push(...)` or `Arc::make_mut(&mut self.string).push_str("...")` is a terrific and well performing copy-on-write pattern. Linting this with an enabled-by-default <kbd>performance</kbd> lint strikes me as an unacceptable false positive balance.

As of #6090 the documentation of this lint now contains:

> **Known problems:** This pattern can be desirable ...

which should indicate that we shouldn't be linting against correct, reasonable, well-performing patterns with an enabled-by-default lint.

Mentioning #6044, #6090.
r? `@yaahc,` who reviewed the lint.

---

changelog: Remove rc_buffer from default set of enabled lints

3 years agoFix unicode regexen with bytes::Regex
Andre Bogus [Wed, 7 Oct 2020 23:07:00 +0000 (01:07 +0200)]
Fix unicode regexen with bytes::Regex

fixes #6005

3 years agofixup! New lint: Recommend using `ptr::eq` when possible
Bruno BELANYI [Wed, 7 Oct 2020 15:11:11 +0000 (17:11 +0200)]
fixup! New lint: Recommend using `ptr::eq` when possible

Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
3 years agofixup! Rename tables to typecheck_result()
Bruno BELANYI [Wed, 7 Oct 2020 15:10:31 +0000 (17:10 +0200)]
fixup! Rename tables to typecheck_result()

Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
3 years agoRename tables to typecheck_result()
Bruno BELANYI [Wed, 7 Oct 2020 09:59:20 +0000 (11:59 +0200)]
Rename tables to typecheck_result()

3 years agofixup! New lint: Recommend using `ptr::eq` when possible
Bruno BELANYI [Wed, 7 Oct 2020 09:54:00 +0000 (11:54 +0200)]
fixup! New lint: Recommend using `ptr::eq` when possible

Add missing modified files.

3 years agoNew lint: Recommend using `ptr::eq` when possible
Bruno BELANYI [Wed, 7 Oct 2020 09:37:32 +0000 (11:37 +0200)]
New lint: Recommend using `ptr::eq` when possible

This is based almost entirely on the code available in the previous PR #4596.

3 years agoAuto merge of #6120 - phansch:replace-lazy-static, r=Manishearth
bors [Wed, 7 Oct 2020 04:58:13 +0000 (04:58 +0000)]
Auto merge of #6120 - phansch:replace-lazy-static, r=Manishearth

Replace some lazy_static usage with once_cell feature

This replaces some `lazy_static` usage with [`SyncLazy`](https://doc.rust-lang.org/nightly/std/lazy/struct.SyncLazy.html) of the unstable `once_cell` feature.

changelog: none

3 years agoDowngrade rc_buffer to restriction
David Tolnay [Wed, 7 Oct 2020 02:46:03 +0000 (19:46 -0700)]
Downgrade rc_buffer to restriction

3 years agoDowngrade string_lit_as_bytes to nursery
David Tolnay [Mon, 5 Oct 2020 19:19:35 +0000 (12:19 -0700)]
Downgrade string_lit_as_bytes to nursery

3 years agoAuto merge of #6124 - pickfire:patch-1, r=flip1995
bors [Tue, 6 Oct 2020 23:22:28 +0000 (23:22 +0000)]
Auto merge of #6124 - pickfire:patch-1, r=flip1995

Use more concrete explanation for methods

*Please keep the line below*
changelog: none

3 years agoAuto merge of #6127 - ebroto:reinstate_forbid_restriction, r=flip1995
bors [Tue, 6 Oct 2020 22:33:57 +0000 (22:33 +0000)]
Auto merge of #6127 - ebroto:reinstate_forbid_restriction, r=flip1995

Reinstate test for forbid(clippy::restriction)

In [this commit](https://github.com/rust-lang/rust-clippy/pull/6126/commits/5747c15961da9d2d0b0dd775174d39f3b5961597) coming from rust-lang/rust (#6126) the test for `#![forbid(clippy::restriction)]` was removed because some restriction lints were being allowed after the forbid.

This change reinstates the test for `forbid` by using a separate file.

changelog: none

r? `@flip1995`

3 years agoReinstate test for forbid blanket restriction
Eduardo Broto [Tue, 6 Oct 2020 22:02:28 +0000 (00:02 +0200)]
Reinstate test for forbid blanket restriction

3 years agoAuto merge of #6126 - flip1995:rustup, r=flip1995
bors [Tue, 6 Oct 2020 21:34:50 +0000 (21:34 +0000)]
Auto merge of #6126 - flip1995:rustup, r=flip1995

Rustup

Supersedes #6121. There was another breakage.

r? `@ghost`

changelog: none

3 years agoRun fmt
flip1995 [Tue, 6 Oct 2020 21:32:38 +0000 (23:32 +0200)]
Run fmt

3 years agoUse more concrete explanation for methods
Ivan Tham [Tue, 6 Oct 2020 15:58:32 +0000 (23:58 +0800)]
Use more concrete explanation for methods

Show some code rather than "a single method call".

3 years agoclippy_lints: Replace lazy_static with SyncLazy
Philipp Hansch [Tue, 6 Oct 2020 06:26:16 +0000 (08:26 +0200)]
clippy_lints: Replace lazy_static with SyncLazy

3 years agoFix tools
Matthew Jasper [Tue, 30 Jun 2020 21:41:57 +0000 (22:41 +0100)]
Fix tools

3 years agoRollup merge of #77560 - rschoon:fix-litkind-rc-bytebuf, r=lcnr
Yuki Okushi [Tue, 6 Oct 2020 07:26:11 +0000 (16:26 +0900)]
Rollup merge of #77560 - rschoon:fix-litkind-rc-bytebuf, r=lcnr

Fix LitKind's byte buffer to use refcounted slice

While working on adding a new lint for clippy (see https://github.com/rust-lang/rust-clippy/pull/6044) for avoiding shared ownership of "mutable buffer" types (such as using `Rc<Vec<T>>` instead of `Rc<[T]>`), I noticed a type exported from rustc_ast and used by clippy gets caught by the lint. This PR fixes the exported type.

This PR includes the actual change to clippy too, but I will open a PR directly against clippy for that part (although it will currently fail to build there).

3 years agoRollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-override-forbid-in...
Yuki Okushi [Tue, 6 Oct 2020 07:26:04 +0000 (16:26 +0900)]
Rollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-override-forbid-in-same-scope, r=petrochenkov

Disallow overriding forbid in same scope

Rebased #73379.

Fixes #70819.

3 years agoAuto merge of #6078 - ebroto:unnecessary_sort_by_take_2, r=phansch
bors [Tue, 6 Oct 2020 06:59:33 +0000 (06:59 +0000)]
Auto merge of #6078 - ebroto:unnecessary_sort_by_take_2, r=phansch

unnecessary sort by: avoid dereferencing the suggested closure parameter

This change tries to simplify the solution for problematic cases but is less restrictive than  #6006.

* We can't dereference shared references to non-Copy types, so the new suggestion does not do that. Note that this implies that the suggested closure parameter will be a reference.
* We can't take a reference to the closure parameter in the returned key, so we don't lint in those cases. This can happen either because the key borrows from the parameter (e.g. `|a| a.borrows()`), or because we suggest `|a| Reverse(a)`. If we did we would hit this error:
```
error: lifetime may not live long enough
  --> /home/ebroto/src/ebroto-clippy/tests/ui/unnecessary_sort_by.fixed:19:25
   |
19 |     vec.sort_by_key(|b| Reverse(b));
   |                      -- ^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
   |                      ||
   |                      |return type of closure is Reverse<&'2 isize>
   |                      has type `&'1 isize`

error: aborting due to previous error
```

Note that Clippy does not currently have the (MIR-based) machinery necessary to check that what is borrowed is actually the closure parameter.

changelog: [`unnecessary_sort_by`]: avoid dereferencing the suggested closure parameter

Fixes #6001

3 years agointegration tests: Replace lazy_static with SyncLazy
Philipp Hansch [Tue, 6 Oct 2020 06:20:18 +0000 (08:20 +0200)]
integration tests: Replace lazy_static with SyncLazy

3 years agoclippy_dev: Replace lazy_static with SyncLazy
Philipp Hansch [Tue, 6 Oct 2020 06:18:11 +0000 (08:18 +0200)]
clippy_dev: Replace lazy_static with SyncLazy

3 years agoRemove "thanks" section
Eduardo Broto [Mon, 5 Oct 2020 22:09:45 +0000 (00:09 +0200)]
Remove "thanks" section

3 years agoAuto merge of #6114 - FliegendeWurst:no-mistyped-fraction, r=Manishearth
bors [Mon, 5 Oct 2020 21:17:37 +0000 (21:17 +0000)]
Auto merge of #6114 - FliegendeWurst:no-mistyped-fraction, r=Manishearth

Do not lint float fractions in `mistyped_literal_suffixes`

As suggested in https://github.com/rust-lang/rust-clippy/issues/4706#issuecomment-544797928, the fractional part is now ignored (the integer part is checked instead).

Fixes: #4706
changelog: `mistyped_literal_suffixes` no longer warns on the fractional part of a float (e.g. 713.23_64)

3 years agoAuto merge of #6118 - ebroto:rustup, r=ebroto
bors [Mon, 5 Oct 2020 20:44:31 +0000 (20:44 +0000)]
Auto merge of #6118 - ebroto:rustup, r=ebroto

Rustup

changelog: none

r? `@ghost`

3 years agoFix rustup fallout
Eduardo Broto [Mon, 5 Oct 2020 20:32:04 +0000 (22:32 +0200)]
Fix rustup fallout

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
Eduardo Broto [Mon, 5 Oct 2020 20:13:44 +0000 (22:13 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAdd changelog for 1.48 beta
Eduardo Broto [Mon, 5 Oct 2020 14:51:17 +0000 (16:51 +0200)]
Add changelog for 1.48 beta

3 years agoFix test formatting
FliegendeWurst [Mon, 5 Oct 2020 10:23:01 +0000 (12:23 +0200)]
Fix test formatting

3 years agoDo not lint float fractions in `mistyped_literal_suffixes` (fixes #4706)
FliegendeWurst [Mon, 5 Oct 2020 10:08:57 +0000 (12:08 +0200)]
Do not lint float fractions in `mistyped_literal_suffixes` (fixes #4706)

3 years agoclippy: `(Body, DefId)` -> `Body`
Dylan MacKenzie [Sun, 4 Oct 2020 22:23:20 +0000 (15:23 -0700)]
clippy: `(Body, DefId)` -> `Body`

3 years agoChange clippy's Constant back to refcount clone byte strings
Robin Schoonover [Sun, 4 Oct 2020 21:53:37 +0000 (15:53 -0600)]
Change clippy's Constant back to refcount clone byte strings

3 years agoPrevent forbid from being ignored if overriden at the same level.
Felix S. Klock II [Mon, 15 Jun 2020 18:17:35 +0000 (14:17 -0400)]
Prevent forbid from being ignored if overriden at the same level.

That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to
forbidding foo.

3 years agoAuto merge of #6111 - flip1995:rustup, r=flip1995
bors [Sun, 4 Oct 2020 12:04:31 +0000 (12:04 +0000)]
Auto merge of #6111 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: Deprecate [`drop_bounds`] lint. This lint was uplifted to rustc with the same name.

3 years agoAuto merge of #6105 - bugadani:sus-char, r=ebroto
bors [Fri, 2 Oct 2020 22:22:37 +0000 (22:22 +0000)]
Auto merge of #6105 - bugadani:sus-char, r=ebroto

Lint for invisible Unicode characters other than ZWSP

This PR extends the existing `zero_width_space` lint to look for other invisible characters as well (in this case, `\\u{ad}` soft hyphen.

I feel like this lint is the logical place to add the check, but I also realize the lint name is not particularly flexible, but I also understand that it shouldn't be renamed for compatibility reasons.

Open questions:
 - What other characters should trigger the lint?
 - What should be done with the lint name?
 - How to indicate the change in functionality?

Motivation behind this PR: https://github.com/rust-lang/rust/issues/77417 - I managed to shoot myself in the foot by an invisible character pasted into my test case.

changelog: rename [`zero_width_space`] to [`invisible_characters`] and add SHY and WJ to the list.

3 years agoAdd WJ
Dániel Buga [Fri, 2 Oct 2020 22:07:56 +0000 (00:07 +0200)]
Add WJ

3 years agoRename lint to invisible_characters
Dániel Buga [Fri, 2 Oct 2020 22:03:33 +0000 (00:03 +0200)]
Rename lint to invisible_characters

3 years agoAuto merge of #6098 - longlb:interior_mut_const, r=ebroto
bors [Fri, 2 Oct 2020 21:21:49 +0000 (21:21 +0000)]
Auto merge of #6098 - longlb:interior_mut_const, r=ebroto

Downgrade interior_mutable_const lints to warn by default

This change updates the two lints in the file non_copy_const.rs to be warn by default rather than deny by default. It also updates the known problems for declare_interior_mutable_const to mention some issues that are affected by the lints.

This is a repeat pull request since I botched the first one (#6012). Apart from my messing up the commits of that one, I also had a problem where the stderr of the tests didn't change despite me changing both lints to warn by default. Is this normal behaviour for some lints or do I need to adjust the tests to accommodate the change?

fixes #5863
changelog: none

3 years agochanged non_copy_const lints to warn by default
Long Louis Bui [Wed, 30 Sep 2020 19:13:12 +0000 (12:13 -0700)]
changed non_copy_const lints to warn by default

3 years agoDeprecate clippy lint
Michael Howell [Fri, 2 Oct 2020 18:34:14 +0000 (11:34 -0700)]
Deprecate clippy lint

3 years agoRun update_lints
Dániel Buga [Fri, 2 Oct 2020 10:02:54 +0000 (12:02 +0200)]
Run update_lints

3 years agoLook for soft hyphens as well
Dániel Buga [Fri, 2 Oct 2020 09:54:31 +0000 (11:54 +0200)]
Look for soft hyphens as well

3 years agoAuto merge of #6104 - mikerite:fix-6096, r=ebroto
bors [Fri, 2 Oct 2020 08:36:54 +0000 (08:36 +0000)]
Auto merge of #6104 - mikerite:fix-6096, r=ebroto

Allow exponent separator

Fixes #6096

changelog: Fixed bug in `clippy::inconsistent_digit_grouping` when floating point exponent is used

3 years agoAllow exponent separator
Michael Wright [Fri, 2 Oct 2020 03:43:43 +0000 (05:43 +0200)]
Allow exponent separator

Fixes #6096

3 years agoAuto merge of #6102 - giraffate:no_lint_when_invalid_suggestion_in_needless_range_loo...
bors [Thu, 1 Oct 2020 16:29:08 +0000 (16:29 +0000)]
Auto merge of #6102 - giraffate:no_lint_when_invalid_suggestion_in_needless_range_loop, r=flip1995

Don't emit a lint for the suggestion leading to errors in `needless_range_loop`

Fix #5945

changelog: Don't emit a lint for the suggestion leading to errors in `needless_range_loop`

3 years agoDon't emit a lint for the suggestion leading to errors in `needless_range_loop`
Takayuki Nakata [Thu, 1 Oct 2020 14:53:05 +0000 (23:53 +0900)]
Don't emit a lint for the suggestion leading to errors in `needless_range_loop`

3 years agoFix rustup fallout
flip1995 [Thu, 1 Oct 2020 14:40:59 +0000 (16:40 +0200)]
Fix rustup fallout

3 years agoAuto merge of #5978 - montrivo:needless-lifetime, r=ebroto
bors [Thu, 1 Oct 2020 13:43:24 +0000 (13:43 +0000)]
Auto merge of #5978 - montrivo:needless-lifetime, r=ebroto

needless-lifetime - nested elision sites

Closes #2944

changelog: fix needless-lifetime nested elision site FPs

3 years agoAuto merge of #6092 - jethrogb:jb/inline-asm-syntax-lint, r=ebroto
bors [Wed, 30 Sep 2020 21:44:29 +0000 (21:44 +0000)]
Auto merge of #6092 - jethrogb:jb/inline-asm-syntax-lint, r=ebroto

Add lint for inline assembly syntax style preference

changelog: Add lint for inline assembly syntax style preference

3 years agoUpdate tests/ui/asm_syntax.rs
Eduardo Broto [Wed, 30 Sep 2020 21:30:49 +0000 (23:30 +0200)]
Update tests/ui/asm_syntax.rs

Use a single `only` header command in asm_syntax test

3 years agoAdd lint for inline assembly syntax style preference
Jethro Beekman [Mon, 28 Sep 2020 13:30:47 +0000 (15:30 +0200)]
Add lint for inline assembly syntax style preference

3 years agoneedless-lifetime / pr remarks
Tim Nielens [Tue, 29 Sep 2020 22:33:46 +0000 (00:33 +0200)]
needless-lifetime / pr remarks

3 years agoneedless-lifetime / add known problem item
Tim Nielens [Tue, 29 Sep 2020 22:08:19 +0000 (00:08 +0200)]
needless-lifetime / add known problem item

3 years agoneedless-lifetime / fix master merge
Tim Nielens [Tue, 29 Sep 2020 21:06:08 +0000 (23:06 +0200)]
needless-lifetime / fix master merge

3 years agoMerge branch 'master' into needless-lifetime
Tim Nielens [Tue, 29 Sep 2020 20:51:59 +0000 (22:51 +0200)]
Merge branch 'master' into needless-lifetime

3 years agoAuto merge of #6093 - ebroto:6089_renamed_lifetimes, r=Manishearth
bors [Tue, 29 Sep 2020 08:41:39 +0000 (08:41 +0000)]
Auto merge of #6093 - ebroto:6089_renamed_lifetimes, r=Manishearth

needless arbitrary self: handle macros

This fixes two cases related to macros:

* If the parameter comes from expansion, do not lint as the user has no possibility of changing it. This is not directly related to the fixed issue, but we should probably do that.
* If *only* the lifetime name comes from expansion, lint, but allow the user decide the name of the lifetime. In the related issue, the lifetime was unnamed and then renamed by `async_trait`, so just removing the name in the suggestion would work, but in the general case a macro can rename a lifetime that was named differently, and we can't reliably know that name anymore.

As a hint for the reviewer, the expanded code for the test can be checked with this command (from the root dir of the repo):
```sh
rustc -L target/debug/test_build_base/needless_arbitrary_self_type_unfixable.stage-id.aux -Zunpretty=expanded tests/ui/needless_arbitrary_self_type_unfixable.rs
```

changelog: [`needless_arbitrary_self_type`]: handle macros

Fixes #6089

3 years agoAuto merge of #6094 - ebroto:rustup, r=ebroto
bors [Tue, 29 Sep 2020 03:27:59 +0000 (03:27 +0000)]
Auto merge of #6094 - ebroto:rustup, r=ebroto

Rustup

changelog: none

r? `@ghost`

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
Eduardo Broto [Mon, 28 Sep 2020 21:05:40 +0000 (23:05 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoneedless arbitrary self: handle macros
Eduardo Broto [Mon, 28 Sep 2020 17:14:39 +0000 (19:14 +0200)]
needless arbitrary self: handle macros

3 years agoRollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
Ralf Jung [Mon, 28 Sep 2020 16:39:40 +0000 (18:39 +0200)]
Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk

Add option to pass a custom codegen backend from a driver

This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.

This PR may also help with https://github.com/rust-lang/miri/pull/1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.

cc @nbaksalyar (headcrab)
cc @RalfJung (miri)

3 years agoAuto merge of #6091 - ebroto:rustup, r=ebroto
bors [Sun, 27 Sep 2020 13:33:48 +0000 (13:33 +0000)]
Auto merge of #6091 - ebroto:rustup, r=ebroto

Rustup

changelog: none

r? `@ghost`

3 years agoFix dogfood
Eduardo Broto [Sun, 27 Sep 2020 13:20:19 +0000 (15:20 +0200)]
Fix dogfood

3 years agoRun cargo dev fmt
Eduardo Broto [Sun, 27 Sep 2020 13:17:13 +0000 (15:17 +0200)]
Run cargo dev fmt

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
Eduardo Broto [Sun, 27 Sep 2020 13:09:52 +0000 (15:09 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup