Commit Graph

136316 Commits

Author SHA1 Message Date
Oli Scherer
8968c8a103
Dangling pointers point to everything and nothing
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-01-03 15:19:07 +01:00
Oli Scherer
e5e4a851c4
Grammar fixes
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-01-03 15:15:23 +01:00
Guillaume Gomez
8b6304ed62 Inline resetMouseMoved function directly into "mousemove" event handler 2021-01-03 15:02:49 +01:00
Guillaume Gomez
22fc4544ad Replace some loops with "onEachLazy" call 2021-01-03 15:02:49 +01:00
Aaron Hill
21b8f2ecde
Make ExpnData fields krate and orig_id private
These fields are only used by hygiene serialized, and should not be
accessed by anything outside of `rustc_span`.
2021-01-03 08:58:43 -05:00
Guillaume Gomez
7bc1eb4506 Create a "is_ignore" variable instead of doing the comparison multiple times 2021-01-03 14:56:56 +01:00
oli
a137ff1706 Update now-more-precise operation with a preciser message 2021-01-03 13:45:16 +00:00
Oli Scherer
e5330a4f52 Apply suggestions from code review
comment nits

Co-authored-by: Ralf Jung <post@ralfj.de>
2021-01-03 13:32:56 +00:00
Ralf Jung
afa7408041 use PlaceRef more consistently instead of loosely coupled local+projection 2021-01-03 14:14:55 +01:00
Dániel Buga
4d3227fe1c Move variable into condition where it's used 2021-01-03 13:55:43 +01:00
Dániel Buga
250fb72d1b No need to collect result of get_item_attrs 2021-01-03 13:55:40 +01:00
Guillaume Gomez
da3eef61f5 Detect invalid rustdoc test commands 2021-01-03 13:53:11 +01:00
Matthias Krüger
e2272cdffc remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
bors
bcd6975079 Auto merge of #80590 - camelid:bool-never-docs, r=nagisa
Update `bool` and `!` docs
2021-01-03 12:21:12 +00:00
Dániel Buga
675059a9eb Clean up convoluted macros_only logic 2021-01-03 12:47:38 +01:00
bors
18cb4ad3b9 Auto merge of #80247 - tmiasko:indent, r=bjorn3
Fix indentation of -Z meta-stats output
2021-01-03 09:16:24 +00:00
LingMan
af7134e7de Move variable into the only branch where it is relevant
At the `if` branch `filter` (the `let` binding) is `None` iff `filter` (the parameter) was `None`.
We can branch on the parameter, move the binding into the `if`, and the complexity of handling
`Option<Option<_>` largely dissolves.
2021-01-03 10:07:22 +01:00
bors
e821a6ef78 Auto merge of #80261 - GuillaumeGomez:attr-rework, r=jyn514
rustdoc DocFragment rework

Kind of a follow-up of #80119.

A few things are happening in this PR. I'm not sure about the impact on perf though so I'm very interested about that too (if the perf is worse, then we can just close this PR).

The idea here is mostly about reducing the memory usage by relying even more on `Symbol` instead of `String`. The only issue is that `DocFragment` has 3 modifications performed on it:
 1. Unindenting
 2. Collapsing similar comments into one
 3. "Beautifying" (weird JS-like comments handling).

To do so, I saved the information about unindent and the "collapse" is now on-demand (which is why I'm not sure the perf will be better, it has to be run multiple times...).

r? `@jyn514`
2021-01-03 06:29:42 +00:00
LingMan
203d5025bb Use Option::filter instead of open-coding it 2021-01-03 05:53:15 +01:00
bors
05dfaba442 Auto merge of #79827 - tmiasko:size-align, r=kennytm
Describe why `size_align` have not been inlined so far

although it is used only in one place.
2021-01-03 03:43:29 +00:00
bors
18d855b8f6 Auto merge of #80623 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update.

This includes a Cargo.lock update for the recent Clippy version bump.

r? `@Manishearth`
2021-01-03 00:55:26 +00:00
bors
c7d6c3dfdc Auto merge of #80592 - Skynoodle:snake-case-lint-reserved-identifier, r=davidtwco
Suggest renaming or escaping when fixing non-snake-case identifiers which would conflict with keywords

Fixes #80575
2021-01-02 22:06:17 +00:00
Matthias Krüger
8a90626a46 reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats) 2021-01-02 20:09:17 +01:00
Guillaume Gomez
df2df14424 Simplify docfragment transformation in unindent tests 2021-01-02 19:16:27 +01:00
Guillaume Gomez
d0e7523a32 Remove unused collapse pass 2021-01-02 19:16:27 +01:00
Guillaume Gomez
4ba1928fa2 Improve code for DocFragment rework 2021-01-02 19:16:27 +01:00
bors
fde6927395 Auto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514
Fix search section position on small devices

Fixes #79526.

This is exactly the same issue fixed in 9c36491538 (in https://github.com/rust-lang/rust/pull/79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input.

r? `@jyn514`
2021-01-02 18:13:48 +00:00
flip1995
5dd64b3cd6
Use bootstrap rustc for versioncheck in Clippy 2021-01-02 18:12:28 +01:00
Guillaume Gomez
0ab6c90699 Update rustdoc-ui test output 2021-01-02 16:55:12 +01:00
Guillaume Gomez
122b141f58 End of rework of Attributes struct 2021-01-02 16:55:12 +01:00
Guillaume Gomez
c4739bc920 Rework DocFragment 2021-01-02 16:55:12 +01:00
flip1995
d35d827bc8
Update Cargo.lock 2021-01-02 16:47:58 +01:00
Skynoodle
750c52af73 Add snake case lint note about keyword identifiers which cannot be raw 2021-01-02 15:46:41 +00:00
bors
fd85ca02f6 Auto merge of #80550 - bugadani:markdown-refactor, r=jyn514
Cleanup markdown span handling, take 2

This PR includes the cleanups made in #80244 except for the removal of `locate()`.

While the biggest conceptual part in #80244 was the removal of `locate()`, it introduced a diagnostic regression.

Additional cleanup:
 - Use `RefCell` to avoid building two separate vectors for the links

Work to do:
- [ ] Decide if `locate()` can be simplified by assuming `s` is always in `md`
- [ ] Should probably add some tests that still provide the undesired diagnostics causing #80381

cc `@jyn514` This is the best I can do without patching Pulldown to provide multiple ranges for reference-style links. Also, since `locate` is probably more efficient than `rfind` (at least it's constant time), I decided to not check the link type and just cover every &str as it was before.
2021-01-02 15:31:53 +00:00
flip1995
100c7935bd
Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyup 2021-01-02 16:29:43 +01:00
bors
1fcc74cc9e Auto merge of #6536 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2021-01-02 15:28:08 +00:00
flip1995
e4fbc5f423
Bump Clippy version to 0.1.51 2021-01-02 16:26:10 +01:00
flip1995
106ca96653
Use rustc --version in versioncheck 2021-01-02 16:20:43 +01:00
flip1995
db268f8ef8
Bump nightly version to 2021-01-02 2021-01-02 16:05:54 +01:00
flip1995
d93692efa2
Merge remote-tracking branch 'upstream/master' into rustup 2021-01-02 16:03:26 +01:00
bors
b1965283fd Auto merge of #6530 - m-ou-se:2021, r=phansch
Initial support for Rust 2021.

Clippy treated Rust 2021 as Rust 2015, because 2018 was checked with `==` instead of `>=`. This fixes that, such that 2018-specific things are also enabled for 2021.

changelog: Added support for Rust 2021.
2021-01-02 13:12:15 +00:00
bors
90ccf4f5ad Auto merge of #80615 - m-ou-se:rollup-xz67at2, r=m-ou-se
Rollup of 6 pull requests

Successful merges:

 - #80546 (clippy fixes for librustdoc)
 - #80555 (Improve library tracking issue template)
 - #80574 (Clean bootstrap artifacts on `x.py clean`)
 - #80578 (improve unconditional_panic description)
 - #80599 (`const_generics_defaults`: don't ICE in the unimplemented parts)
 - #80613 (Diag: print enum variant instead of enum type)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-02 12:40:32 +00:00
Mara Bos
4172756c80
Rollup merge of #80613 - bugadani:issue-80607, r=matthewjasper
Diag: print enum variant instead of enum type

Closes #80607
2021-01-02 11:29:15 +00:00
Mara Bos
7a1b01ec02
Rollup merge of #80599 - lqd:issue_805889, r=varkor
`const_generics_defaults`: don't ICE in the unimplemented parts

The thought was that we could use `todo!`s to ensure we wouldn't forget to implement parts of the experimental gate.

However, that can also lead to a suboptimal experience for users as shown in #80589 having both the error/warning about the experimental feature, and the ICE.

Fixes #80589

r? `@varkor`
2021-01-02 11:29:14 +00:00
Mara Bos
bb703058b7
Rollup merge of #80578 - RalfJung:panic-lint-description, r=lcnr
improve unconditional_panic description

The fact that the lint is triggered by the ConstProp pass is an implementation detail, I do not think that this should be mentioned in the description.

Cc `@oli-obk` `@ehuss`
2021-01-02 11:29:12 +00:00
Mara Bos
4890c06fc4
Rollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-Simulacrum
Clean bootstrap artifacts on `x.py clean`

Closes https://github.com/rust-lang/rust/issues/76519

r? `@Mark-Simulacrum`
2021-01-02 11:29:10 +00:00
Mara Bos
1ab3466fe9
Rollup merge of #80555 - rust-lang:libs-tracking-issue, r=KodrAus
Improve library tracking issue template

r? `@KodrAus`
2021-01-02 11:29:09 +00:00
Mara Bos
29c1bc9723
Rollup merge of #80546 - matthiaskrgr:rustdoclippy, r=LingMan
clippy fixes for librustdoc

fixes clippy warnings of type:
match_like_matches_macro
or_fun_call
op_ref
needless_return
let_and_return
single_char_add_str
useless_format
unnecessary_sort_by
match_ref_pats
redundant_field_names
2021-01-02 11:29:07 +00:00
Dániel Buga
e0300716ef Print actual enum variant 2021-01-02 11:06:30 +01:00
Dániel Buga
eb0d5be441 Add test for #80607 with undesired output 2021-01-02 10:59:21 +01:00