Commit graph

135901 commits

Author SHA1 Message Date
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
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
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
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
bors 929f66af9b Auto merge of #80115 - tgnottingham:specialize_opaque_u8_sequences, r=oli-obk
rustc_serialize: specialize opaque encoding and decoding of some u8 sequences

This specializes encoding and decoding of some contiguous u8 sequences to use a more efficient implementation. The default implementations process each u8 individually, but that isn't necessary for the opaque encoder and decoder. The opaque encoding for u8s is a no-op, so we can just copy entire sequences as-is, rather than process them byte by byte.

This also changes some encode and decode implementations for contiguous sequences to forward to the slice and vector implementations, so that they can take advantage of the new specialization when applicable.
2021-01-02 09:52:26 +00:00
Dániel Buga f07354333f Only use locate for borrowed strings 2021-01-02 10:39:16 +01:00
bors 5986dd878f Auto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmaster
Enable ASan, TSan, UBSan for aarch64-apple-darwin.

I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air.

~This requires https://github.com/rust-lang/llvm-project/pull/86~
2021-01-02 06:58:59 +00:00
Tyson Nottingham be79f493fb rustc_serialize: specialize opaque decoding of some u8 sequences 2021-01-01 22:49:16 -08:00
Tyson Nottingham 7c6274d464 rustc_serialize: have read_raw_bytes take MaybeUninit<u8> slice 2021-01-01 22:49:16 -08:00
Tyson Nottingham a4daa63a90 rustc_serialize: specialize opaque encoding of some u8 sequences 2021-01-01 22:49:14 -08:00
bors f6b6d5cf64 Auto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster
Add docs note about `Any::type_id` on smart pointers

Fixes #79868.

There's an issue I've run into a couple times while using values of type `Box<dyn Any>` - essentially, calling `value.type_id()` doesn't dereference to the trait object, but uses the implementation of `Any` for `Box<dyn Any>`, giving us the `TypeId` of the container instead of the object inside it.

I couldn't find any notes about this in the documentation and - while it could be inferred from existing knowledge of Rust and the blanket implemenation of `Any` - I think it'd be nice to have a note about it in the documentation for the `any` module.

Anyways, here's a first draft of a section about it. I'm happy to revise wording :)
2021-01-02 04:12:48 +00:00
bors 0876f59b97 Auto merge of #77832 - camelid:remove-manual-link-resolves, r=jyn514
Remove many unnecessary manual link resolves from library

Now that #76934 has merged, we can remove a lot of these! E.g, this is
no longer necessary:

    [`Vec<T>`]: Vec

cc `@jyn514`
2021-01-02 01:31:03 +00:00
bors 417fe47065 Auto merge of #80581 - jyn514:ci-llvm, r=Mark-Simulacrum
Give a better error for download-ci-llvm if .xz is not supported

Previously:

```
curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp6ptXJV https://ci-artifacts.rust-lang.org/rustc-builds/99ad5a1a2824fea1ecf60068fd3636beae7ea2da/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

Now:

```
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using a different version of python
Build completed unsuccessfully in 0:00:00
```

Follow-up to https://github.com/rust-lang/rust/pull/80435.

r? `@Mark-Simulacrum`
2021-01-01 22:44:52 +00:00
Rémy Rakic ea0f6396aa const_generics_defaults: don't use todo
So that at least it won't ICE for users whether or not they enable the gate. For developers the FIXMEs are enough.
2021-01-01 22:35:56 +01:00
Matthias Krüger a5807ac61c 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-01 21:19:10 +01:00
bors 17eec1433c Auto merge of #80569 - notriddle:patch-3, r=jyn514
Use Array.prototype.filter instead of open-coding

Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743 by `@jyn514`

Besides making main.js smaller (always a plus), this also performs better by using the optimized filter implementation in your browser's JavaScript engine (according to `@GuillaumeGomez,` an 84% performance improvement).
2021-01-01 20:01:45 +00:00
Skynoodle 91f436b456 Add suggestion to use raw identifiers when fixing snake-case lints 2021-01-01 18:38:30 +00:00
Skynoodle b919aa4c0f Add reserved identifier test cases for snake case lint 2021-01-01 18:38:29 +00:00
bors 206ee1eea3 Auto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomez
Fix tests that incorrectly used `!@has` instead of `@!has`

The command is ``@!has`,` not `!`@has`.` I don't think these checks were
doing anything before! Ideally we would accept `!`@has`` as well, or at
least fail tests that use `!`@has`.` The current behavior seems to be
silently ignoring the check, which is very confusing.

r? `@GuillaumeGomez`
2021-01-01 16:12:27 +00:00
Joshua Nelson b5019d6ec3 Give a better error for download-ci-llvm if .xz is not supported
Previously:

```
curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp6ptXJV https://ci-artifacts.rust-lang.org/rustc-builds/99ad5a1a2824fea1ecf60068fd3636beae7ea2da/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

Now:

```
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using a different version of python
Build completed unsuccessfully in 0:00:00
```
2021-01-01 10:41:56 -05:00
Mara Bos e5a1f22f48 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.
2021-01-01 16:21:31 +01:00
Ralf Jung b31400a226 improve unconditional_panic description 2021-01-01 15:00:27 +01:00