Commit Graph

9289 Commits

Author SHA1 Message Date
Michael Wright
93ce686b5d Update ui stderr with improved rustc output
Related rust pull request: rust-lang/rust#76160
2020-09-03 04:58:14 +02:00
bors
7f27b12288 Auto merge of #5996 - Koxiaet:master, r=ebroto
Allow GraphQL in docs without backticks

changelog: Allow "GraphQL" in [`doc_markdown`] without backticks.
2020-09-02 12:24:31 +00:00
Koxiaet
22c9940613 Add tests for allowed non-backticked identifiers in doc 2020-09-02 12:51:44 +01:00
bors
a62bab2076 Auto merge of #6000 - ebroto:sync-from-rust, r=ebroto
Sync from rust

r? @ghost

changelog: none
2020-09-02 07:56:44 +00:00
Eduardo Broto
a5754a1fad Run cargo dev fmt 2020-09-02 08:57:00 +02:00
Eduardo Broto
da86067775 Merge remote-tracking branch 'upstream/master' into sync-from-rust 2020-09-02 08:53:29 +02:00
bors
48248af630 Auto merge of #5999 - rail-rain:fix_fp_transmute_ptr_to_ptr_in_consts, r=ebroto
Fix a fp in `transmute_ptr_to_ptr`

fixes #5959

changelog: Fix a false positive in `transmute_ptr_to_ptr` that the lint fires when `transmute` is used to cast a reference in const contexts although dereferencing raw pointers in consts is unstable.
2020-09-01 22:28:55 +00:00
bors
67e18c2d5c Auto merge of #5993 - taiki-e:default_trait_access, r=phansch
default_trait_access: Fix wrong suggestion

https://github.com/rust-lang/rust-clippy/issues/5975#issuecomment-683751131
> I think the underlying problem is clippy suggests code with complete parameters, not clippy triggers this lint even for complex types. AFAIK, If code compiles with `Default::default`, it doesn't need to specify any parameters, as type inference is working. (So, in this case, `default_trait_access` should suggest `RefCell::default`.)

Fixes #5975 Fixes #5990

changelog: `default_trait_access`: fixed wrong suggestion
2020-09-01 15:05:16 +00:00
Koxiaet
b30422114e
Allow GraphQL in doc without backticks 2020-09-01 14:05:19 +01:00
rail
afeb917fca Fix a fp in transmute_ptr_to_ptr
Avoid firing the lint when `transmute` in const contexts
as dereferencing raw pointers in consts is unstable. cc #5959
2020-09-01 11:51:32 +12:00
bors
066f105d67 Auto merge of #5992 - giraffate:fix_wrong_seggestion_in_collapsible_if, r=yaahc
Fix the wrong suggestion when using macro in `collapsible_if`

Fix #5962

changelog: Fix the wrong suggestion when using macro in `collapsible_if`
2020-08-31 19:41:13 +00:00
bors
8334a58c2f Auto merge of #5909 - khuey:async_yields_async, r=yaahc
Add a lint for an async block/closure that yields a type that is itself awaitable.

This catches bugs of the form

tokio::spawn(async move {
    let f = some_async_thing();
    f // Oh no I forgot to await f so that work will never complete.
});

See the two XXXkhuey comments and the unfixed `_l` structure for things that need more thought.

*Please keep the line below*
changelog: none
2020-08-31 19:20:30 +00:00
Taiki Endo
8b0aa6a00b default_trait_access: Fix wrong suggestion 2020-09-01 00:31:53 +09:00
Takayuki Nakata
001f9e45f2 Fix the wrong suggestion when using macro in collapsible_if 2020-09-01 00:05:53 +09:00
bors
001c1c51d2 Auto merge of #5984 - ebroto:5693_const_assoc_fn, r=flip1995
or_fn_call: ignore nullary associated const fns

The fix in #5889 was missing associated functions.

changelog: Ignore also `const fn` methods in [`or_fun_call`]

Fixes #5693
2020-08-31 10:43:58 +00:00
Aaron Hill
fdc48fb90c Fix clippy 2020-08-30 19:17:17 -04:00
bors
ab64d47c03 Auto merge of #5988 - camelid:patch-2, r=ebroto
Syntax-highlight `single_char_push_str` lint

It wasn't being syntax highlighted in the online lint index:

![image](https://user-images.githubusercontent.com/37223377/91666682-8fc02000-eab3-11ea-95fa-6671472712c8.png)

changelog: none
2020-08-30 20:21:00 +00:00
Camelid
17b2ba5ded Syntax-highlight single_char_push_str lint 2020-08-30 11:29:17 -07:00
Kyle Huey
04912ca115 Formatting changes requested by ThibsG. 2020-08-29 15:33:54 -07:00
Kyle Huey
c1d2b9376a Add a test for an async function. 2020-08-29 15:33:54 -07:00
Kyle Huey
4972989b61 Add a lint for an async block/closure that yields a type that is itself awaitable.
This catches bugs of the form

tokio::spawn(async move {
    let f = some_async_thing();
    f // Oh no I forgot to await f so that work will never complete.
});
2020-08-29 15:33:54 -07:00
Eduardo Broto
7a66e6502d or_fn_call: ignore nullary associated const fns 2020-08-29 01:20:49 +02:00
flip1995
282c59820b Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
bors
c88c614941 Auto merge of #5970 - ebroto:changelog_beta_1_47, r=flip1995
Update changelog to beta 1.47

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

changelog: none
2020-08-28 13:08:29 +00:00
bors
3d0b0e66af Auto merge of #5774 - ThibsG:FixNewRetNoSelf, r=ebroto
Fix FP in `new_ret_no_self`: trigger in trait def instead of impl block

Lint in trait def instead of impl block.

Fixes: #5435

changelog: none
2020-08-28 11:54:07 +00:00
Thibaud
73b1ee1a61
Update clippy_lints/src/methods/mod.rs
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:33:05 +02:00
Thibaud
ffaadae8e4
Update clippy_lints/src/utils/mod.rs
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:31:29 +02:00
Thibaud
e8be047c5b
Update clippy_lints/src/utils/mod.rs
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:31:12 +02:00
bors
07c5e9edb5 Auto merge of #5971 - giraffate:fix_fp_in_to_string_in_display, r=ebroto
Fix FP in `to_string_in_display`

Don't emit a lint when `.to_string()` on anything that is not `self`

Fix #5967

changelog: Fix FP in `to_string_in_display` when calling `.to_string()` on anything that is not `self`
2020-08-27 23:26:52 +00:00
ThibsG
504612622f Merge logic of looking for Self type 2020-08-27 18:31:31 +02:00
ThibsG
3cb75c2e5c Remove expansion restriction + fix doc and tests naming 2020-08-27 18:25:38 +02:00
ThibsG
2a3ee5fa85 Fix FP in new_ret_no_self: trigger in trait def instead of impl block 2020-08-27 18:25:38 +02:00
Takayuki Nakata
04bff17668 Fix FP in to_string_in_display
Don't emit a lint when `.to_string()` on anything that is not `self`
2020-08-27 23:37:47 +09:00
Eduardo Broto
baf62e7a38 Update changelog to beta 1.47 2020-08-27 14:48:07 +02:00
bors
dead45fd5b Auto merge of #5957 - xvschneider:AddUnwrapInsideResultLint, r=yaahc
Adding new lint to prevent usage of 'unwrap' inside functions that re…

### Change
Adding a new lint that will emit a warning when using "unwrap" or "expect" inside a function that returns result.
### Motivation
These functions promote recoverable errors to non-recoverable errors which may be undesirable in code bases which wish to avoid panics.
### Test plan
Running:
`TESTNAME=unwrap_in_result cargo uitest
`---

changelog: none
2020-08-26 23:38:34 +00:00
Jane Lusby
91024f1fde Add new lint to prevent usage of unwrap in fns that return result 2020-08-26 16:31:49 -07:00
bors
e45c59e922 Auto merge of #5968 - rail-rain:fix_use_snippet_with_applicability, r=flip1995
Fix the wrong use of `snippet_with_applicability`

For the context, please see https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680749728 and https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680783381.

---

changelog: none
2020-08-26 22:52:47 +00:00
rail
edc05da57d Fix the wrong use of snippet_with_applicability
This includes a workaround of the issue #5822,
the cause of this little mistake.
2020-08-27 10:24:16 +12:00
bors
64c4bb0d2b Auto merge of #5966 - 1c3t3a:1c3t3a-dev-5819-fix, r=Manishearth
Corrects the float_equality_without_abs lint

Fixes an issue in the `float_equality_without_abs` lint. The lint suggestion was configured in a way that it lints the whole error and not just the subtraction part. In the current configuration the lint would suggest to change the expression in a wrong way, e.g.
```rust
let _ = (a - b) < f32::EPSILON; // before
let _ = (a - b).abs(); // after
```
This was dicovered by @flip1995. (See discussion of PR #5952).

Also the suggestion is now formatted via `utils::sugg`.
changelog: none
2020-08-26 18:15:42 +00:00
Bastian
2d853148d7 Changed the location of the suggestion as well as the way the suggestion is assembled 2020-08-26 16:39:30 +02:00
bors
894581b872 Auto merge of #5946 - mikerite:fix-5729, r=flip1995
Fix `let_and_return` bad suggestion

Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.

This is similar to the problem in issue #4437.

Closes #5729

changelog: Fix `let_and_return` bad suggestion
2020-08-26 12:01:32 +00:00
bors
9ef44799bf Auto merge of #5949 - rail-rain:fix_fp_borrow_interior_mutable_const, r=oli-obk
Fix fp in `borrow_interior_mutable_const`

fixes #5796

changelog: fix false positive in `borrow_interior_mutable_const` when referencing a field behind a pointer.
2020-08-26 11:06:37 +00:00
bors
23db5426e6 Auto merge of #5964 - matsujika:matsujika-patch-1, r=ebroto
Fix typo

changelog: none
2020-08-26 07:53:07 +00:00
Hirochika Matsumoto
9d18c24b56 Fix typo 2020-08-26 16:03:35 +09:00
bors
ad7a03cbaa Auto merge of #5951 - ThibsG:FixMacroCloneOnRefPtr2076, r=ebroto
Fix incorrect suggestion when `clone_on_ref_ptr` is triggered in macros

In the lint `clone_on_ref_ptr`, if the `span` is in a macro, don't expand it for suggestion.

Fixes: #2076

changelog: none

r? @ebroto
2020-08-25 21:48:19 +00:00
Thibaud
370fc45a0a
Update clippy_lints/src/methods/mod.rs
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-25 22:20:35 +02:00
bors
e191151001 Auto merge of #5961 - scottmcm:master, r=Manishearth
Re-enable len_zero for ranges now that `is_empty` is stable on them

Fixes #5956

Completed stabilization PR: https://github.com/rust-lang/rust/pull/75132

changelog: len_zero: re-enable linting ranges now that range_is_empty is stable
2020-08-25 19:30:05 +00:00
Scott McMurray
3b1e5d6ff7 Re-enable len_zero for ranges now that is_empty is stable on them 2020-08-25 12:17:03 -07:00
bors
f326668577 Auto merge of #5958 - mikerite:fix-fmt-20200825, r=flip1995
Various fmt test improvements

Various fmt test improvements.

changelog: none
2020-08-25 17:15:51 +00:00
bors
f9015592f3 Auto merge of #5952 - 1c3t3a:1c3t3a-dev-5819, r=Manishearth
Added a lint which corrects expressions like (a - b) < f32::EPSILON, according to #5819

Fixes #5819
changelog: none
2020-08-25 16:54:48 +00:00