]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514
bors [Sat, 2 Jan 2021 18:13:48 +0000 (18:13 +0000)]
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 9c36491538476dd3ff5ec834944aacdaceb12f30 (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`

3 years agoAuto merge of #80550 - bugadani:markdown-refactor, r=jyn514
bors [Sat, 2 Jan 2021 15:31:53 +0000 (15:31 +0000)]
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.

3 years agoAuto merge of #80615 - m-ou-se:rollup-xz67at2, r=m-ou-se
bors [Sat, 2 Jan 2021 12:40:32 +0000 (12:40 +0000)]
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

3 years agoRollup merge of #80613 - bugadani:issue-80607, r=matthewjasper
Mara Bos [Sat, 2 Jan 2021 11:29:15 +0000 (11:29 +0000)]
Rollup merge of #80613 - bugadani:issue-80607, r=matthewjasper

Diag: print enum variant instead of enum type

Closes #80607

3 years agoRollup merge of #80599 - lqd:issue_805889, r=varkor
Mara Bos [Sat, 2 Jan 2021 11:29:14 +0000 (11:29 +0000)]
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`

3 years agoRollup merge of #80578 - RalfJung:panic-lint-description, r=lcnr
Mara Bos [Sat, 2 Jan 2021 11:29:12 +0000 (11:29 +0000)]
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`

3 years agoRollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-Simulacrum
Mara Bos [Sat, 2 Jan 2021 11:29:10 +0000 (11:29 +0000)]
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`

3 years agoRollup merge of #80555 - rust-lang:libs-tracking-issue, r=KodrAus
Mara Bos [Sat, 2 Jan 2021 11:29:09 +0000 (11:29 +0000)]
Rollup merge of #80555 - rust-lang:libs-tracking-issue, r=KodrAus

Improve library tracking issue template

r? `@KodrAus`

3 years agoRollup merge of #80546 - matthiaskrgr:rustdoclippy, r=LingMan
Mara Bos [Sat, 2 Jan 2021 11:29:07 +0000 (11:29 +0000)]
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

3 years agoPrint actual enum variant
Dániel Buga [Sat, 2 Jan 2021 10:06:30 +0000 (11:06 +0100)]
Print actual enum variant

3 years agoAdd test for #80607 with undesired output
Dániel Buga [Sat, 2 Jan 2021 09:58:50 +0000 (10:58 +0100)]
Add test for #80607 with undesired output

3 years agoAuto merge of #80115 - tgnottingham:specialize_opaque_u8_sequences, r=oli-obk
bors [Sat, 2 Jan 2021 09:52:26 +0000 (09:52 +0000)]
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.

3 years agoOnly use locate for borrowed strings
Dániel Buga [Thu, 31 Dec 2020 09:38:12 +0000 (10:38 +0100)]
Only use locate for borrowed strings

3 years agoAuto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmaster
bors [Sat, 2 Jan 2021 06:58:59 +0000 (06:58 +0000)]
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~

3 years agorustc_serialize: specialize opaque decoding of some u8 sequences
Tyson Nottingham [Thu, 17 Dec 2020 05:03:45 +0000 (21:03 -0800)]
rustc_serialize: specialize opaque decoding of some u8 sequences

3 years agorustc_serialize: have read_raw_bytes take MaybeUninit<u8> slice
Tyson Nottingham [Thu, 17 Dec 2020 03:46:19 +0000 (19:46 -0800)]
rustc_serialize: have read_raw_bytes take MaybeUninit<u8> slice

3 years agorustc_serialize: specialize opaque encoding of some u8 sequences
Tyson Nottingham [Thu, 17 Dec 2020 03:03:31 +0000 (19:03 -0800)]
rustc_serialize: specialize opaque encoding of some u8 sequences

3 years agoAuto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster
bors [Sat, 2 Jan 2021 04:12:48 +0000 (04:12 +0000)]
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 :)

3 years agoAuto merge of #77832 - camelid:remove-manual-link-resolves, r=jyn514
bors [Sat, 2 Jan 2021 01:31:03 +0000 (01:31 +0000)]
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`

3 years agoAuto merge of #80581 - jyn514:ci-llvm, r=Mark-Simulacrum
bors [Fri, 1 Jan 2021 22:44:52 +0000 (22:44 +0000)]
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`

3 years agoconst_generics_defaults: don't use todo
Rémy Rakic [Fri, 1 Jan 2021 21:35:56 +0000 (22:35 +0100)]
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.

3 years agoclippy fixes for librustdoc
Matthias Krüger [Thu, 31 Dec 2020 01:49:44 +0000 (02:49 +0100)]
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

3 years agoAuto merge of #80569 - notriddle:patch-3, r=jyn514
bors [Fri, 1 Jan 2021 20:01:45 +0000 (20:01 +0000)]
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).

3 years agoAuto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomez
bors [Fri, 1 Jan 2021 16:12:27 +0000 (16:12 +0000)]
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`

3 years agoGive a better error for download-ci-llvm if .xz is not supported
Joshua Nelson [Fri, 1 Jan 2021 15:22:25 +0000 (10:22 -0500)]
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
```

3 years agoimprove unconditional_panic description
Ralf Jung [Fri, 1 Jan 2021 13:44:19 +0000 (14:44 +0100)]
improve unconditional_panic description

3 years agoAuto merge of #80547 - lqd:const_generics_defaults, r=varkor
bors [Fri, 1 Jan 2021 13:17:42 +0000 (13:17 +0000)]
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`

3 years agoAuto merge of #80310 - Manishearth:box-try-alloc, r=kennytm
bors [Fri, 1 Jan 2021 10:29:43 +0000 (10:29 +0000)]
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`

3 years agomake `const_generics_defaults` use the unstable syntax mechanism
Rémy Rakic [Thu, 31 Dec 2020 17:32:06 +0000 (18:32 +0100)]
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

3 years agoadjust const generics defaults FIXMEs to the new feature gate
Rémy Rakic [Thu, 31 Dec 2020 01:50:23 +0000 (02:50 +0100)]
adjust const generics defaults FIXMEs to the new feature gate

3 years agoupdate `min_const_generics` tests using default values for const params
Rémy Rakic [Thu, 31 Dec 2020 01:04:52 +0000 (02:04 +0100)]
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 .

3 years agoadd test for the `const_generics_defaults` feature gate
Rémy Rakic [Thu, 31 Dec 2020 01:03:15 +0000 (02:03 +0100)]
add test for the `const_generics_defaults` feature gate

3 years agomark `const_generics_defaults` as an incomplete feature
Rémy Rakic [Thu, 31 Dec 2020 01:02:49 +0000 (02:02 +0100)]
mark `const_generics_defaults` as an incomplete feature

3 years agofix typo in feature gates file
Rémy Rakic [Thu, 31 Dec 2020 01:01:57 +0000 (02:01 +0100)]
fix typo in feature gates file

3 years agofirst pass at default values for const generics
Julian Knodt [Thu, 31 Dec 2020 00:58:27 +0000 (01:58 +0100)]
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

3 years agoAuto merge of #80539 - JohnTitor:ui-test-root-cleanup, r=petrochenkov
bors [Fri, 1 Jan 2021 07:46:11 +0000 (07:46 +0000)]
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`

3 years agoClean bootstrap artifacts on `x.py clean`
Joshua Nelson [Fri, 1 Jan 2021 05:02:54 +0000 (00:02 -0500)]
Clean bootstrap artifacts on `x.py clean`

3 years agoMerge remote-tracking branch 'origin/master' into frewsxcv-san
Corey Farwell [Fri, 1 Jan 2021 04:27:33 +0000 (23:27 -0500)]
Merge remote-tracking branch 'origin/master' into frewsxcv-san

3 years agoAuto merge of #79576 - m-ou-se:2021, r=Mark-Simulacrum
bors [Fri, 1 Jan 2021 03:41:31 +0000 (03:41 +0000)]
Auto merge of #79576 - m-ou-se:2021, r=Mark-Simulacrum

Add edition 2021.

:fireworks: Happy new ~~year~~ Rust. :champagne:

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.
```

3 years agoAuto merge of #80566 - Dylan-DPC:rollup-rns6est, r=Dylan-DPC
bors [Fri, 1 Jan 2021 00:59:12 +0000 (00:59 +0000)]
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

3 years agoUse Array.prototype.filter instead of open-coding
Michael Howell [Fri, 1 Jan 2021 00:51:46 +0000 (17:51 -0700)]
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>
3 years agoReduce `ROOT_ENTRY_LIMIT` to 1500
Yuki Okushi [Wed, 30 Dec 2020 23:26:24 +0000 (08:26 +0900)]
Reduce `ROOT_ENTRY_LIMIT` to 1500

3 years agoMove feature gate-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:25:10 +0000 (08:25 +0900)]
Move feature gate-related tests

3 years agoMove rmeta-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:23:00 +0000 (08:23 +0900)]
Move rmeta-related tests

3 years agoMove builtin-superkinds-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:15:53 +0000 (08:15 +0900)]
Move builtin-superkinds-related tests

3 years agoMove block-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:09:22 +0000 (08:09 +0900)]
Move block-related tests

3 years agoRollup merge of #80551 - lcnr:const-arg-wildcard, r=varkor
Dylan DPC [Thu, 31 Dec 2020 21:21:00 +0000 (22:21 +0100)]
Rollup merge of #80551 - lcnr:const-arg-wildcard, r=varkor

support pattern as const parents in type_of

nice to know that there's still stuff about rust i didn't know about :laughing:

fixes #80531

r? `@varkor`

3 years agoRollup merge of #80548 - JohnTitor:wfcheck-foreign-fn-ice, r=davidtwco
Dylan DPC [Thu, 31 Dec 2020 21:20:59 +0000 (22:20 +0100)]
Rollup merge of #80548 - JohnTitor:wfcheck-foreign-fn-ice, r=davidtwco

FIx ICE on wf check for foreign fns

Fixes #80468

r? `@davidtwco` `@lcnr`

3 years agoRollup merge of #80532 - tmiasko:rm;, r=Mark-Simulacrum
Dylan DPC [Thu, 31 Dec 2020 21:20:56 +0000 (22:20 +0100)]
Rollup merge of #80532 - tmiasko:rm;, r=Mark-Simulacrum

remove unnecessary trailing semicolon from bootstrap

3 years agoRollup merge of #80526 - tmandry:up-llvm, r=nikic
Dylan DPC [Thu, 31 Dec 2020 21:20:55 +0000 (22:20 +0100)]
Rollup merge of #80526 - tmandry:up-llvm, r=nikic

Update LLVM

- [GlobalISel][IRTranslator] Fix a crash when the use of an extractvalue is a non-dominated metadata use.
- [asan] Use dynamic shadow memory position on Apple Silicon macOS

r? ``@cuviper``

3 years agoRollup merge of #80519 - max-heller:issue-80512-fix, r=varkor
Dylan DPC [Thu, 31 Dec 2020 21:20:53 +0000 (22:20 +0100)]
Rollup merge of #80519 - max-heller:issue-80512-fix, r=varkor

Take type defaults into account in suggestions to reorder generic parameters

Fixes #80512

3 years agoRollup merge of #80514 - pietroalbini:fix-install, r=Mark-Simulacrum
Dylan DPC [Thu, 31 Dec 2020 21:20:51 +0000 (22:20 +0100)]
Rollup merge of #80514 - pietroalbini:fix-install, r=Mark-Simulacrum

Fix broken ./x.py install

During my tarball refactorings in https://github.com/rust-lang/rust/pull/79788 I changed the directory layout used by the tarball generation code, and that broke the other parts of rustbuild which hardcoded the paths of those directories. Namely, `./x.py install` relied on the uncompressed copy of the tarball left behind by `fabricate`/`rust-installer`, causing https://github.com/rust-lang/rust/issues/80494.

While the easy fix for https://github.com/rust-lang/rust/issues/80494 would've been to just update the hardcoded paths to match the new structure, that fix would leave us in the same situation if we were to change the directory layout again in the future. Instead I refactored the code to return a `GeneratedTarball` struct as the output of all the dist steps, and I put all the paths the rest of rustbuild needs to care about in its fields. That way, future changes to `src/bootstrap/tarball.rs` will not break other stuff.

This PR is best reviewed commit-by-commit.
r? `@Mark-Simulacrum`
`@rustbot` modify labels: beta-nominated beta-accepted T-release

3 years agoRollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514
Dylan DPC [Thu, 31 Dec 2020 21:20:49 +0000 (22:20 +0100)]
Rollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514

rustdoc: Render visibilities succinctly

Fixes #79139.

r? `@jyn514`

3 years agoRollup merge of #80323 - camelid:codegen-base-docs, r=nagisa
Dylan DPC [Thu, 31 Dec 2020 21:20:43 +0000 (22:20 +0100)]
Rollup merge of #80323 - camelid:codegen-base-docs, r=nagisa

Update and improve `rustc_codegen_{llvm,ssa}` docs

Fixes #75342.

These docs were very out of date and misleading. They even said that
they codegen'd the *AST*!

For some reason, the `rustc_codegen_ssa::base` docs were exactly
identical to the `rustc_codegen_llvm::base` docs. They didn't really
make sense, because they had LLVM-specific information even though
`rustc_codegen_ssa` is supposed to be somewhat generic. So I removed
them as they were misleading.

r? ``@pnkfelix`` maybe?

3 years agoFix tests that incorrectly used `!@has` instead of `@!has`
Camelid [Thu, 31 Dec 2020 20:47:09 +0000 (12:47 -0800)]
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.

3 years agoAdd `@!has` checks to ensure private items don't have `pub`
Camelid [Thu, 31 Dec 2020 20:04:13 +0000 (12:04 -0800)]
Add `@!has` checks to ensure private items don't have `pub`

3 years agoAdd FIXME for visibility of a module
Camelid [Thu, 31 Dec 2020 20:00:23 +0000 (12:00 -0800)]
Add FIXME for visibility of a module

3 years agoRemove many unnecessary manual link resolves from library
Camelid [Sun, 11 Oct 2020 20:36:41 +0000 (13:36 -0700)]
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

3 years agoEnable Pat2021 in edition 2021.
Mara Bos [Thu, 31 Dec 2020 18:09:28 +0000 (19:09 +0100)]
Enable Pat2021 in edition 2021.

3 years agoRequire `-Z unstable-options` for unstable editions.
Mara Bos [Thu, 24 Dec 2020 15:48:41 +0000 (16:48 +0100)]
Require `-Z unstable-options` for unstable editions.

3 years agoConsistently call editions "Rust 20xx" in messages.
Mara Bos [Mon, 30 Nov 2020 21:11:29 +0000 (22:11 +0100)]
Consistently call editions "Rust 20xx" in messages.

3 years agoAdd edition 2021.
Mara Bos [Wed, 30 Dec 2020 13:33:46 +0000 (14:33 +0100)]
Add edition 2021.

3 years agoMore inline, doc fixes
Manish Goregaokar [Thu, 31 Dec 2020 16:48:51 +0000 (16:48 +0000)]
More inline, doc fixes

3 years agoMake [A]Rc::allocate_for_layout() use try_allocate_for_layout()
Manish Goregaokar [Thu, 31 Dec 2020 16:36:28 +0000 (16:36 +0000)]
Make [A]Rc::allocate_for_layout() use try_allocate_for_layout()

3 years agoAuto merge of #80459 - mark-i-m:or-pat-reg, r=petrochenkov
bors [Thu, 31 Dec 2020 14:52:26 +0000 (14:52 +0000)]
Auto merge of #80459 - mark-i-m:or-pat-reg, r=petrochenkov

Implement edition-based macro :pat feature

This PR does two things:
1. Fixes the perf regression from https://github.com/rust-lang/rust/pull/80100#issuecomment-750893149
2. Implements `:pat2018` and `:pat2021` matchers, as described by `@joshtriplett`  in https://github.com/rust-lang/rust/issues/54883#issuecomment-745509090 behind the feature gate `edition_macro_pat`.

r? `@petrochenkov`

cc `@Mark-Simulacrum`

3 years agosupport pattern as const parents in type_of
Bastian Kauschke [Thu, 31 Dec 2020 09:55:20 +0000 (10:55 +0100)]
support pattern as const parents in type_of

3 years agoImprove library tracking issue template
Mara Bos [Thu, 31 Dec 2020 12:52:39 +0000 (13:52 +0100)]
Improve library tracking issue template

3 years agoAuto merge of #79895 - Kerollmops:slice-group-by, r=m-ou-se
bors [Thu, 31 Dec 2020 12:00:43 +0000 (12:00 +0000)]
Auto merge of #79895 - Kerollmops:slice-group-by, r=m-ou-se

The return of the GroupBy and GroupByMut iterators on slice

According to https://github.com/rust-lang/rfcs/pull/2477#issuecomment-742034372, I am opening this PR again, this time I implemented it in safe Rust only, it is therefore much easier to read and is completely safe.

This PR proposes to add two new methods to the slice, the `group_by` and `group_by_mut`. These two methods provide a way to iterate over non-overlapping sub-slices of a base slice that are separated by the predicate given by the user (e.g. `Partial::eq`, `|a, b| a.abs() < b.abs()`).

```rust
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];

let mut iter = slice.group_by(|a, b| a == b);
assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
assert_eq!(iter.next(), Some(&[3, 3][..]));
assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
assert_eq!(iter.next(), None);
```

[An RFC](https://github.com/rust-lang/rfcs/pull/2477) was open 2 years ago but wasn't necessary.

3 years agoReplace the tracking issue for the slice_group_by feature
Clément Renault [Thu, 31 Dec 2020 11:13:03 +0000 (12:13 +0100)]
Replace the tracking issue for the slice_group_by feature

3 years agoAdd an extra example to the two methods
Clément Renault [Thu, 31 Dec 2020 10:57:40 +0000 (11:57 +0100)]
Add an extra example to the two methods

3 years agobootstrap: use the correct paths during ./x.py install
Pietro Albini [Wed, 30 Dec 2020 13:00:24 +0000 (14:00 +0100)]
bootstrap: use the correct paths during ./x.py install

3 years agobootstrap: change the dist outputs to GeneratedTarball
Pietro Albini [Wed, 30 Dec 2020 11:20:13 +0000 (12:20 +0100)]
bootstrap: change the dist outputs to GeneratedTarball

The struct will allow to store more context on the generated tarballs.

3 years agobootstrap: never delete the tarball temporary directory
Pietro Albini [Wed, 30 Dec 2020 11:10:31 +0000 (12:10 +0100)]
bootstrap: never delete the tarball temporary directory

Files in the temporary directory are used by ./x.py install.

3 years agoCollect links into a single vector
Dániel Buga [Thu, 31 Dec 2020 09:26:24 +0000 (10:26 +0100)]
Collect links into a single vector

3 years agoAlways provide a range
Dániel Buga [Thu, 31 Dec 2020 09:11:50 +0000 (10:11 +0100)]
Always provide a range

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRemove unnecessary scope
Dániel Buga [Thu, 31 Dec 2020 09:07:57 +0000 (10:07 +0100)]
Remove unnecessary scope

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoUse ranges returned by pulldown
Dániel Buga [Thu, 31 Dec 2020 09:07:19 +0000 (10:07 +0100)]
Use ranges returned by pulldown

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoAuto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514
bors [Thu, 31 Dec 2020 09:07:52 +0000 (09:07 +0000)]
Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514

Rustdoc render public underscore_imports as Re-exports

Fixes #61592

3 years agoRustdoc render public underscore_imports as Re-exports
bors [Thu, 31 Dec 2020 09:07:51 +0000 (09:07 +0000)]
Rustdoc render public underscore_imports as Re-exports

Fixes #61592

3 years agoReuse Box::try_new_*_in() in Box::new_*_in()
Manish Goregaokar [Thu, 31 Dec 2020 08:43:30 +0000 (08:43 +0000)]
Reuse Box::try_new_*_in() in Box::new_*_in()

3 years agoAdd fallible Arc APIs (`Arc::try_new_*`)
Manish Goregaokar [Thu, 31 Dec 2020 08:30:23 +0000 (08:30 +0000)]
Add fallible Arc APIs (`Arc::try_new_*`)

3 years agoAdd fallible Rc APIs (`Rc::try_new_*`)
Manish Goregaokar [Thu, 31 Dec 2020 08:14:16 +0000 (08:14 +0000)]
Add fallible Rc APIs (`Rc::try_new_*`)

3 years agoAdd fallible box APIs (`Box::try_new_*`)
Manish Goregaokar [Thu, 31 Dec 2020 06:40:17 +0000 (06:40 +0000)]
Add fallible box APIs (`Box::try_new_*`)

3 years agoAdd fallible box allocator APIs (`Box::try_new_*_in()`)
Manish Goregaokar [Tue, 22 Dec 2020 20:10:18 +0000 (12:10 -0800)]
Add fallible box allocator APIs (`Box::try_new_*_in()`)

3 years agoAuto merge of #79150 - m-ou-se:bye-bye-doc-comment-hack, r=jyn514
bors [Thu, 31 Dec 2020 06:14:41 +0000 (06:14 +0000)]
Auto merge of #79150 - m-ou-se:bye-bye-doc-comment-hack, r=jyn514

Remove all doc_comment!{} hacks by using #[doc = expr] where needed.

This replaces about 200 cases of

`````rust
        doc_comment! {
            concat!("The smallest value that can be represented by this integer type.

# Examples

Basic usage:

```
", $Feature, "assert_eq!(", stringify!($SelfT), "::MIN, ", stringify!($Min), ");",
$EndFeature, "
```"),
            #[stable(feature = "assoc_int_consts", since = "1.43.0")]
            pub const MIN: Self = !0 ^ ((!0 as $UnsignedT) >> 1) as Self;
        }
`````
by
```rust
        /// The smallest value that can be represented by this integer type.
        ///
        /// # Examples
        ///
        /// Basic usage:
        ///
        /// ```
        #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN, ", stringify!($Min), ");")]
        /// ```
        #[stable(feature = "assoc_int_consts", since = "1.43.0")]
        pub const MIN: Self = !0 ^ ((!0 as $UnsignedT) >> 1) as Self;
```

---

**Note:** For a usable diff, make sure to enable 'ignore whitspace': https://github.com/rust-lang/rust/pull/79150/files?diff=unified&w=1

3 years agoAuto merge of #80500 - jyn514:track-caller, r=nagisa
bors [Thu, 31 Dec 2020 03:17:50 +0000 (03:17 +0000)]
Auto merge of #80500 - jyn514:track-caller, r=nagisa

Add `#[track_caller]` to `bug!` and `register_renamed`

Before:

```
thread 'rustc' panicked at 'compiler/rustc_lint/src/context.rs:267:18: invalid lint renaming of broken_intra_doc_links to rustdoc::broken_intra_doc_links', compiler/rustc_middle/src/util/bug.rs:34:26
```

After:

```
thread 'rustc' panicked at 'src/librustdoc/core.rs:455:24: invalid lint renaming of broken_intra_doc_links to rustdoc::broken_intra_doc_links', compiler/rustc_middle/src/util/bug.rs:35:26
```

The reason I added it to `register_renamed` too is that any panic in
that function will be the caller's fault.

3 years agoFIx ICE on wf check for foreign fns
Yuki Okushi [Thu, 31 Dec 2020 02:25:53 +0000 (11:25 +0900)]
FIx ICE on wf check for foreign fns

3 years agoAdd note on panic behavior
Camelid [Thu, 31 Dec 2020 01:39:03 +0000 (17:39 -0800)]
Add note on panic behavior

3 years agoSmall refactor
Camelid [Thu, 31 Dec 2020 00:41:18 +0000 (16:41 -0800)]
Small refactor

3 years agoRemove FIXME
Camelid [Thu, 31 Dec 2020 00:29:47 +0000 (16:29 -0800)]
Remove FIXME

Co-authored-by: Joshua Nelson <jyn514@gmail.com>
3 years agoUpdate `find_nearest_parent_module`
Camelid [Thu, 31 Dec 2020 00:38:25 +0000 (16:38 -0800)]
Update `find_nearest_parent_module`

3 years agoAuto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum
bors [Thu, 31 Dec 2020 00:23:13 +0000 (00:23 +0000)]
Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum

Only produce .xz tarballs on CI

This PR adds a `./configure` option to choose which tarball compression formats to produce, and changes our CI configuration to only produce `.xz` tarballs. The release process will then recompress everything into `.gz` when producing a release.

This will drastically reduce our storage costs for CI artifacts, as we'd stop storing the same data twice. **Stable, beta and nightly releases will not be affected by this at all.**

Before landing this we'll need to increase the VM size of our release process, to recompress everything in a reasonable amount of time.
r? `@Mark-Simulacrum`

3 years agoMove cast-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:05:46 +0000 (08:05 +0900)]
Move cast-related tests

3 years agoMove binop-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:04:03 +0000 (08:04 +0900)]
Move binop-related tests

3 years agoMove array-slice-vec-related tests
Yuki Okushi [Wed, 30 Dec 2020 23:01:58 +0000 (08:01 +0900)]
Move array-slice-vec-related tests

3 years agoMove parser-related tests
Yuki Okushi [Wed, 30 Dec 2020 22:53:54 +0000 (07:53 +0900)]
Move parser-related tests

3 years agoFix typos.
Mara Bos [Wed, 30 Dec 2020 22:23:02 +0000 (23:23 +0100)]
Fix typos.

3 years agoDon't use doc_comment!{} hack in nonzero_leading_trailing_zeros!{}.
Mara Bos [Wed, 30 Dec 2020 21:36:17 +0000 (22:36 +0100)]
Don't use doc_comment!{} hack in nonzero_leading_trailing_zeros!{}.

3 years agoRemove all doc_comment!{} hacks by using #[doc = expr] where needed.
Mara Bos [Tue, 17 Nov 2020 22:57:29 +0000 (23:57 +0100)]
Remove all doc_comment!{} hacks by using #[doc = expr] where needed.

3 years agoAuto merge of #80530 - m-ou-se:rollup-zit69ko, r=m-ou-se
bors [Wed, 30 Dec 2020 21:25:15 +0000 (21:25 +0000)]
Auto merge of #80530 - m-ou-se:rollup-zit69ko, r=m-ou-se

Rollup of 9 pull requests

Successful merges:

 - #78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength)
 - #79479 (Add `Iterator::intersperse`)
 - #80128 (Edit rustc_ast::ast::FieldPat docs)
 - #80424 (Don't give an error when creating a file for the first time)
 - #80458 (Some Promotion Refactoring)
 - #80488 (Do not create dangling &T in Weak<T>::drop)
 - #80491 (Miri: make size/align_of_val work for dangling raw ptrs)
 - #80495 (Rename kw::Invalid -> kw::Empty)
 - #80513 (Add regression test for #80062)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup