Commit Graph

135836 Commits

Author SHA1 Message Date
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
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
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
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
Ralf Jung b31400a226 improve unconditional_panic description 2021-01-01 15:00:27 +01:00
bors a609fb45ef Auto merge of #80547 - lqd:const_generics_defaults, r=varkor
In which we start to parse const generics defaults

As discussed in this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const.20generic.20defaults), this PR extracts the parsing parts from `@JulianKnodt's` PR #75384 for a better user-experience using the newly stabilized `min_const_generics` (albeit temporary) as shown in #80507: trying to use default values on const generics currently results in parse errors, as if the user didn't use the correct syntax (which is somewhat true but also misleading).

This PR extracts (and slightly modifies in a couple places) `@JulianKnodt's` parsing code (with attribution if I've done everything correctly), AST and HIR changes, and feature gate setup.

This feature is now marked as "incomplete" and thus will also print out the expected "const generics default values are unstable" error instead of a syntax error. Note that, as I've only extracted the parsing part, the actual feature will not work at all if enabled. There will be ICEs, and inference errors on the const generics default values themselves.

Fixes #80507.

Once this merges, I'll:
- modify the const generics tracking issue to refer to the `const_generics_defaults` gate rather than the older temporary name it uses there.
- create the GH `F-const_generics_defaults` label

r? `@varkor`
2021-01-01 13:17:42 +00:00
bors 18d27b2c94 Auto merge of #80310 - Manishearth:box-try-alloc, r=kennytm
Add fallible Box, Arc, and Rc allocator APIs

cc https://github.com/rust-lang/rust/issues/48043

It was suggested in https://github.com/rust-lang/rust/issues/48043#issuecomment-748008486 that `Box::try_*` follows the spirit of RFC 2116. This PR is an attempt to add the relevant APIs, tied to the same feature gate. Happy to make any changes or turn this into an RFC if necessary.

cc `@rust-lang/wg-allocators`
2021-01-01 10:29:43 +00:00
Rémy Rakic 942b7ce2c1 make `const_generics_defaults` use the unstable syntax mechanism
This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
2021-01-01 11:01:01 +01:00
Rémy Rakic 1fc3c4c16d adjust const generics defaults FIXMEs to the new feature gate 2021-01-01 11:01:01 +01:00
Rémy Rakic 907ba75eb0 update `min_const_generics` tests using default values for const params
The `const_generics_defaults` now handles them, and they correctly parse, so we can update these tests expecting a parser error .
2021-01-01 10:55:17 +01:00
Rémy Rakic 64244b2201 add test for the `const_generics_defaults` feature gate 2021-01-01 10:55:16 +01:00
Rémy Rakic ea8fa36bb4 mark `const_generics_defaults` as an incomplete feature 2021-01-01 10:55:16 +01:00
Rémy Rakic 5f4bb468c1 fix typo in feature gates file 2021-01-01 10:55:16 +01:00
Julian Knodt 61f33bfd29 first pass at default values for const generics
- Adds optional default values to const generic parameters in the AST
  and HIR
- Parses these optional default values
- Adds a `const_generics_defaults` feature gate
2021-01-01 10:55:10 +01:00
bors e1fc9ff4a7 Auto merge of #80539 - JohnTitor:ui-test-root-cleanup, r=petrochenkov
Reduce the entry on `src/test/ui` (UI test root)

CC #73494, similar to #79776.

r? `@petrochenkov`
2021-01-01 07:46:11 +00:00
Joshua Nelson 139ef750ee Clean bootstrap artifacts on `x.py clean` 2021-01-01 00:02:54 -05:00
Corey Farwell d482de30ea Merge remote-tracking branch 'origin/master' into frewsxcv-san 2020-12-31 23:27:33 -05:00
bors f8ab56bf32 Auto merge of #79576 - m-ou-se:2021, r=Mark-Simulacrum
Add edition 2021.

🎆 Happy new ~~year~~ Rust. 🍾

This adds --edition=2021, and updates suggestions about 2018 to say "2018 *or later*".

Related Cargo PR: https://github.com/rust-lang/cargo/pull/8922

---

Edit: This adds the new edition as *unstable*. Without `-Z unstable-options`, `--edition=2021` results in:
```
$ rustc --edition=2021
error: edition 2021 is unstable and only available with -Z unstable-options.
```
2021-01-01 03:41:31 +00:00
bors 99ad5a1a28 Auto merge of #80566 - Dylan-DPC:rollup-rns6est, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #80323 (Update and improve `rustc_codegen_{llvm,ssa}` docs)
 - #80368 (rustdoc: Render visibilities succinctly)
 - #80514 (Fix broken ./x.py install)
 - #80519 (Take type defaults into account in suggestions to reorder generic parameters)
 - #80526 (Update LLVM)
 - #80532 (remove unnecessary trailing semicolon from bootstrap)
 - #80548 (FIx ICE on wf check for foreign fns)
 - #80551 (support pattern as const parents in type_of)

Failed merges:

 - #80547 (In which we start to parse const generics defaults)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-01 00:59:12 +00:00
Michael Howell a3958d039d
Use Array.prototype.filter instead of open-coding
Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-12-31 17:51:46 -07:00
Yuki Okushi 9fb9f290b4 Reduce `ROOT_ENTRY_LIMIT` to 1500 2021-01-01 09:23:11 +09:00
Yuki Okushi 4530da7ff0 Move feature gate-related tests 2021-01-01 09:23:11 +09:00
Yuki Okushi 97031b12cf Move rmeta-related tests 2021-01-01 09:23:10 +09:00
Yuki Okushi a73ad6b22a Move builtin-superkinds-related tests 2021-01-01 09:23:10 +09:00
Yuki Okushi 049971c990 Move block-related tests 2021-01-01 09:23:10 +09:00