Commit Graph

136047 Commits

Author SHA1 Message Date
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
Dylan DPC 96c11f98d7
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 😆

fixes #80531

r? `@varkor`
2020-12-31 22:21:00 +01:00
Dylan DPC 33806d2599
Rollup merge of #80548 - JohnTitor:wfcheck-foreign-fn-ice, r=davidtwco
FIx ICE on wf check for foreign fns

Fixes #80468

r? `@davidtwco` `@lcnr`
2020-12-31 22:20:59 +01:00
Dylan DPC 30c4e6da85
Rollup merge of #80532 - tmiasko:rm;, r=Mark-Simulacrum
remove unnecessary trailing semicolon from bootstrap
2020-12-31 22:20:56 +01:00
Dylan DPC 408573d031
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``
2020-12-31 22:20:55 +01:00
Dylan DPC 1f431f9066
Rollup merge of #80519 - max-heller:issue-80512-fix, r=varkor
Take type defaults into account in suggestions to reorder generic parameters

Fixes #80512
2020-12-31 22:20:53 +01:00
Dylan DPC 5bffc265b0
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
2020-12-31 22:20:51 +01:00
Dylan DPC 7d247c9246
Rollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514
rustdoc: Render visibilities succinctly

Fixes #79139.

r? `@jyn514`
2020-12-31 22:20:49 +01:00
Dylan DPC 55cfcd596f
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?
2020-12-31 22:20:43 +01:00
Camelid 2c405aea5d 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.
2020-12-31 12:47:09 -08:00
Camelid 5604a18a60 Add `@!has` checks to ensure private items don't have `pub` 2020-12-31 12:08:20 -08:00
Camelid dda887a02c Add FIXME for visibility of a module 2020-12-31 12:00:23 -08:00
Camelid 0506789014 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
2020-12-31 11:54:32 -08:00
Mara Bos 3cbdbe8dcd Enable Pat2021 in edition 2021. 2020-12-31 19:39:44 +01:00
Mara Bos 3d9d0e9d3e Require `-Z unstable-options` for unstable editions. 2020-12-31 19:06:09 +01:00
Mara Bos c574ded57d Consistently call editions "Rust 20xx" in messages. 2020-12-31 19:06:09 +01:00
Mara Bos f16ef7d7ce Add edition 2021. 2020-12-31 19:06:09 +01:00
Manish Goregaokar 375e7c5864 More inline, doc fixes 2020-12-31 16:49:44 +00:00
Manish Goregaokar 8f3cb7d75d Make [A]Rc::allocate_for_layout() use try_allocate_for_layout() 2020-12-31 16:36:28 +00:00
Matthias Krüger 59397d6abb make clippy version number correspond to rustc version number.
clippy 0.1.50 corresponds to rustc 1.50.x

This bumps the clippy version number from 0.0.212 to 0.1.50

Fixes #6499
2020-12-31 16:29:26 +01:00
bors 44e3daf5ee 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`
2020-12-31 14:52:26 +00:00
Bastian Kauschke 2aef46b17b support pattern as const parents in type_of 2020-12-31 14:10:49 +01:00
Mara Bos 929a64fd4c
Improve library tracking issue template 2020-12-31 13:52:39 +01:00
bors b33e234155 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.
2020-12-31 12:00:43 +00:00
Clément Renault 8b53be6604
Replace the tracking issue for the slice_group_by feature 2020-12-31 12:13:03 +01:00
Clément Renault a2d55d70c4
Add an extra example to the two methods 2020-12-31 11:57:40 +01:00
Pietro Albini 8e0ab0fb5e
bootstrap: use the correct paths during ./x.py install 2020-12-31 11:38:32 +01:00
Pietro Albini 1fab57491d
bootstrap: change the dist outputs to GeneratedTarball
The struct will allow to store more context on the generated tarballs.
2020-12-31 11:38:05 +01:00
Pietro Albini aac429ffd3
bootstrap: never delete the tarball temporary directory
Files in the temporary directory are used by ./x.py install.
2020-12-31 11:34:38 +01:00
Dániel Buga 854b9d1727 Collect links into a single vector 2020-12-31 10:41:29 +01:00
Dániel Buga cb4317de00 Always provide a range
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-12-31 10:41:25 +01:00
Dániel Buga 2b70da1661 Remove unnecessary scope
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-12-31 10:41:15 +01:00
Dániel Buga 08f7b0a422 Use ranges returned by pulldown
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-12-31 10:40:37 +01:00
bors a6bd5246da Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514
Rustdoc render public underscore_imports as Re-exports

Fixes #61592
2020-12-31 09:07:52 +00:00
bors cb4553bdae Rustdoc render public underscore_imports as Re-exports
Fixes #61592
2020-12-31 09:07:51 +00:00
Manish Goregaokar 589aa8e29c Reuse Box::try_new_*_in() in Box::new_*_in() 2020-12-31 08:43:30 +00:00
Manish Goregaokar bb15fa1da0 Add fallible Arc APIs (`Arc::try_new_*`) 2020-12-31 08:31:55 +00:00
Manish Goregaokar 973fa8e30e Add fallible Rc APIs (`Rc::try_new_*`) 2020-12-31 08:15:38 +00:00
Manish Goregaokar dd2c6c318b Add fallible box APIs (`Box::try_new_*`) 2020-12-31 08:14:38 +00:00
Manish Goregaokar d116f48788 Add fallible box allocator APIs (`Box::try_new_*_in()`) 2020-12-31 08:14:38 +00:00
bors 8b002d5c34 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
2020-12-31 06:14:41 +00:00
bors 923e3d2400 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.
2020-12-31 03:17:50 +00:00