Commit graph

132783 commits

Author SHA1 Message Date
bors
f92b931045 Auto merge of #77856 - GuillaumeGomez:automatic-links-lint, r=jyn514,ollie27
Add non_autolinks lint

Part of #77501.

r? `@jyn514`
2020-11-06 04:17:41 +00:00
Guillaume Gomez
99200f760b Fix even more URLs 2020-11-05 20:11:29 +01:00
bors
9d78d1d027 Auto merge of #78774 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update

r? `@Manishearth`
2020-11-05 17:57:31 +00:00
flip1995
46c714f641
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup 2020-11-05 14:29:48 +01:00
bors
b1d9f31e04 Auto merge of #78638 - vn-ki:bindigs-after-at-issue-69971, r=oli-obk
reverse binding order in matches to allow the subbinding of copyable fields in bindings after @

Fixes #69971

### TODO

- [x] Regression tests

r? `@oli-obk`
2020-11-05 13:26:08 +00:00
bors
b20d4c155d Auto merge of #6296 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2020-11-05 13:14:26 +00:00
bors
f7801d6c7c Auto merge of #78767 - m-ou-se:rollup-eu5wgxl, r=m-ou-se
Rollup of 15 pull requests

Successful merges:

 - #76718 (Move Vec UI tests to unit tests when possible)
 - #78093 (Clean up docs for 'as' keyword)
 - #78425 (Move f64::NAN ui tests into `library`)
 - #78465 (Change as_str → to_string in proc_macro::Ident::span() docs)
 - #78584 (Add keyboard handling to the theme picker menu)
 - #78716 (Array trait impl comment/doc fixes)
 - #78727 ((rustdoc) fix test for trait impl display)
 - #78733 (fix a couple of clippy warnings:)
 - #78735 (Simplify the implementation of `get_mut` (no unsafe))
 - #78738 (Move range in ui test to ops test in library/core)
 - #78739 (Fix ICE on type error in async function)
 - #78742 (make intern_const_alloc_recursive return error)
 - #78756 (Update cargo)
 - #78757 (Improve and clean up some intra-doc links)
 - #78758 (Fixed typo in comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-05 10:22:20 +00:00
Mara Bos
8416e13d88
Rollup merge of #78758 - eltociear:patch-1, r=jyn514
Fixed typo in comment

paramter -> parameter
2020-11-05 10:30:04 +01:00
Mara Bos
f383e4f1d9
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514
Improve and clean up some intra-doc links
2020-11-05 10:30:02 +01:00
Mara Bos
679c4c7015
Rollup merge of #78756 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62
2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000
- Implement weak dependency features. (rust-lang/cargo#8818)
- Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823)
- fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828)
- Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826)
- Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824)
- vendor: correct the path to cargo config (rust-lang/cargo#8822)
- Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)
2020-11-05 10:30:01 +01:00
Mara Bos
5ffccc4dfa
Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obk
make intern_const_alloc_recursive return error

fix #78655

r? ``@oli-obk``
2020-11-05 10:29:59 +01:00
Mara Bos
171d29c9c5
Rollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis
Fix ICE on type error in async function

Fixes #78654
2020-11-05 10:29:57 +01:00
Mara Bos
86e6afafe1
Rollup merge of #78738 - sasurau4:test/move-range-test-to-library-core, r=jyn514
Move range in ui test to ops test in library/core

Helps with #76268

r? ````@matklad````
2020-11-05 10:29:56 +01:00
Mara Bos
29fad213b2
Rollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getmut, r=RalfJung
Simplify the implementation of `get_mut` (no unsafe)

Quick PR to reduce one use of `unsafe` pointed out in the previous PR

r? ````@RalfJung````
2020-11-05 10:29:54 +01:00
Mara Bos
8640360870
Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514
fix a couple of clippy warnings:

filter_next
manual_strip
redundant_static_lifetimes
single_char_pattern
unnecessary_cast
unused_unit
op_ref
redundant_closure
useless_conversion
2020-11-05 10:29:53 +01:00
Mara Bos
9bbb052af8
Rollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez
(rustdoc) fix test for trait impl display

The test checks that parameters and return values with `impl Trait` types are correctly generated in rustdoc's output.

In essence, the previous version of the test checked the absence of values that would never be generated by rustdoc, so it could basically never fail. These values were adjusted to the expected output and are now required to exist in rustdoc's output. See https://github.com/rust-lang/rust/issues/55201#issuecomment-716182474 for a detailed explanation of the reasoning behind the changes.

Note that the output of rustdoc for `impl Trait`s in parameters and return values did not change since the inital test creation, so this PR only modifies the test.

Closes #55201
2020-11-05 10:29:50 +01:00
Mara Bos
43e1b58bcc
Rollup merge of #78716 - est31:array_traits, r=Dylan-DPC
Array trait impl comment/doc fixes

Two small doc/comment fixes regarding trait implementations on arrays.
2020-11-05 10:29:46 +01:00
Mara Bos
cbf74bc4ca
Rollup merge of #78584 - notriddle:master, r=GuillaumeGomez
Add keyboard handling to the theme picker menu

This PR is mostly designed to bring the theme picker closer to feature parity with the menu bar from docs.rs. Though the rustdoc theme picker is technically already usable from the keyboard, it's really weird that arrow keys work on some of the menus, but not all of them, in the exact same page.
2020-11-05 10:29:45 +01:00
Mara Bos
6d7098f543
Rollup merge of #78465 - est31:proc_macro_to_string, r=jyn514
Change as_str → to_string in proc_macro::Ident::span() docs

There is no `as_str` function on Ident any more.

Also change it to an intra doc link while we're at it.
2020-11-05 10:29:42 +01:00
Mara Bos
99229337a8
Rollup merge of #78425 - chansuke:move_nan, r=jyn514
Move f64::NAN ui tests into `library`

This is a partial fix of #76268.

r? ```@matklad```
2020-11-05 10:29:40 +01:00
Mara Bos
10d2843604
Rollup merge of #78093 - camelid:as-cleanup, r=jyn514
Clean up docs for 'as' keyword
2020-11-05 10:29:38 +01:00
Mara Bos
55f4b802fb
Rollup merge of #76718 - poliorcetics:vec-ui-to-unit-test, r=jyn514
Move Vec UI tests to unit tests when possible

Helps with #76268.

I'm moving the tests using `Vec` or `VecDeque`.

````@rustbot```` modify labels: A-testsuite C-cleanup T-libs
2020-11-05 10:29:35 +01:00
Guillaume Gomez
16ed8501ef Fix more URLs 2020-11-05 10:23:39 +01:00
Guillaume Gomez
9d114506c6 Rename lint to non_autolinks 2020-11-05 10:22:08 +01:00
Guillaume Gomez
6be97e2250 Improve lint even more 2020-11-05 10:22:08 +01:00
Guillaume Gomez
1fb404bebe Don't check for URLs inside codeblocks 2020-11-05 10:22:08 +01:00
Guillaume Gomez
fce2be0ea7 Update URLs used in the lint example 2020-11-05 10:22:08 +01:00
Guillaume Gomez
60caf51b0d Rename automatic_links to url_improvements 2020-11-05 10:22:08 +01:00
Guillaume Gomez
55b4d21e25 Fix automatic_links warnings 2020-11-05 10:22:08 +01:00
Guillaume Gomez
7f839b2ece Improve automatic_links globally 2020-11-05 10:22:08 +01:00
Guillaume Gomez
f467b8d77c Extend automatic_links lint to take into account URLs without link syntax 2020-11-05 10:22:08 +01:00
Guillaume Gomez
6bc8965c41 Add tests for automatic_links lint 2020-11-05 10:22:08 +01:00
Guillaume Gomez
a54f043733 Add documentation for automatic_links lint 2020-11-05 10:22:08 +01:00
Guillaume Gomez
2980367030 Add new lint for automatic_links improvements 2020-11-05 10:22:08 +01:00
Vishnunarayan K I
a15ee4d7c8 update dangling-alloc-id-ice test 2020-11-05 13:24:21 +05:30
bors
8c20701219 Auto merge of #78754 - pietroalbini:checkout-v2, r=Mark-Simulacrum
Bump actions/checkout to version 2

This was recommended by GitHub Support to try reducing the things that could've caused #78743. I checked the changelog and there should be no practical impact for us (we already set an explicit fetch-depth).

r? `@Mark-Simulacrum`
2020-11-05 05:14:53 +00:00
chansuke
f9b139f9c4 Add mod nan for test 2020-11-05 12:57:18 +09:00
Ikko Ashimine
873ebcb243
Fixed typo in comment
paramter -> parameter
2020-11-05 12:08:32 +09:00
Camelid
677b2acb48 Add missing comma
'Note however,' -> 'Note, however,'
2020-11-04 18:57:54 -08:00
Camelid
bbdb1f0f66 Clean up some intra-doc links 2020-11-04 18:57:52 -08:00
Camelid
3084a55d54 Don't use crate in link text
`crate::` -> `core::`

It looks weird to have `crate::` in the link text and we use the actual
crate name everywhere else.

If anyone is curious, I used this Vim command to update all the links:

    %s/\(\s\)\[`crate::\(.*\)`\]/\1[`core::\2`](crate::\2)/g
2020-11-04 18:44:40 -08:00
Eric Huss
bdbcaf02c5 Update cargo 2020-11-04 16:15:18 -08:00
Camelid
d8afe98eba Clean up docs for 'as' keyword 2020-11-04 16:05:55 -08:00
chansuke
97d5a1be3f Fix format 2020-11-05 08:40:04 +09:00
chansuke
5855fb7b79 Move f64::NAN ui tests into library 2020-11-05 08:32:07 +09:00
Pietro Albini
308dbdd9fe
ci: bump actions/checkout to version 2
This was recommended by GitHub Support to try reducing the things that
could've caused #78743. I checked the changelog and there should be no
practical impact for us (we already set an explicit fetch-depth).
2020-11-05 00:05:20 +01:00
bors
0c1531a5c4 Auto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis
Provide diagnostic suggestion in ExprUseVisitor Delegate

The [Delegate trait](981346fc07/compiler/rustc_typeck/src/expr_use_visitor.rs (L28-L38)) currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

 Closes: https://github.com/rust-lang/project-rfc-2229/issues/20

r? `@ghost`
2020-11-04 22:45:15 +00:00
bors
0fb00251a5 Auto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis
Provide diagnostic suggestion in ExprUseVisitor Delegate

The [Delegate trait](981346fc07/compiler/rustc_typeck/src/expr_use_visitor.rs (L28-L38)) currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

 Closes: https://github.com/rust-lang/project-rfc-2229/issues/20

r? `@ghost`
2020-11-04 22:45:15 +00:00
bors
0d2f1aef02 Auto merge of #6247 - giraffate:fix_suggestion_to_add_space_in_unused_unit, r=ebroto
Fix suggestion to add unneeded space in `unused_unit`

Fix https://github.com/rust-lang/rust-clippy/issues/6230

changelog: Fix suggestion to add unneeded space in `unused_unit`
2020-11-04 22:42:10 +00:00
bors
5b52474ae6 Auto merge of #5911 - hegza:issue-568, r=ebroto
Add lint for 'field_reassign_with_default` #568

changelog: Add lint for field_reassign_with_default that checks if mutable object + field modification is used to edit a binding initialized with Default::default() instead of struct constructor.

Fixes #568

Notes:
- Checks for reassignment of one or more fields of a binding initialized with Default::default().
- Implemented using EarlyLintPass, might be future proofed better with LateLintPass.
- Does not trigger if Default::default() is used via another type implementing Default.
- This is a re-open of [PR#4761](https://github.com/rust-lang/rust-clippy/pull/4761), but I couldn't figure out how to re-open that one so here's a new one with the requested changes :S
2020-11-04 22:21:44 +00:00