]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #81768 - calebcartwright:bump-rls-rustfmt, r=Xanewok
bors [Wed, 10 Feb 2021 10:00:01 +0000 (10:00 +0000)]
Auto merge of #81768 - calebcartwright:bump-rls-rustfmt, r=Xanewok

update RLS and rustfmt

Fixes #81582 and fixes #81583

r? `@Xanewok`

I was originally surprised by the size of lockfile diff, though after looking at the RLS changes it makes a bit more sense to me now

3 years agoFix assosiated typo
Daniel Egger [Wed, 10 Feb 2021 08:36:26 +0000 (09:36 +0100)]
Fix assosiated typo

Introduced in d3c4dbd85d63c8bdfa362d7cac8b3e8cbca51272, noticed only
after the fact, sorry. 😅

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
3 years agoOnly initialize what is used
Dániel Buga [Sun, 17 Jan 2021 19:20:16 +0000 (20:20 +0100)]
Only initialize what is used

3 years agoAuto merge of #81929 - pietroalbini:pgo-bootstrap, r=Mark-Simulacrum
bors [Wed, 10 Feb 2021 07:10:43 +0000 (07:10 +0000)]
Auto merge of #81929 - pietroalbini:pgo-bootstrap, r=Mark-Simulacrum

Allow unstable features in some PGO benchmarks

Some of the benchmarks we're using for PGO require unstable features (such as compiling the standard library and some rustc-perf benchmarks), breaking CI on the beta and stable branches. For the past two releases we cherry-picked a commit directly onto the beta branch that unconditionally sets `RUSTC_BOOTSTRAP=1`, and this PR backports a similar change to the master branch.

The difference between this commit and the one we backported previously (483c1a83ca7cf53fd8f3432edb32cbe70ba39d45) is that this is more scoped in which benchmarks we allow unstable features, to prevent unintentionally enabling unstable features.

r? `@Mark-Simulacrum`

3 years agoBTree: remove outdated traces of coercions
Stein Somers [Wed, 10 Feb 2021 06:48:13 +0000 (07:48 +0100)]
BTree: remove outdated traces of coercions

3 years agocomma...
Ellen [Wed, 10 Feb 2021 05:29:45 +0000 (05:29 +0000)]
comma...

3 years agoFix comment smol mistakes
Ellen [Wed, 10 Feb 2021 05:23:02 +0000 (05:23 +0000)]
Fix comment smol mistakes

3 years agoComments :3
Ellen [Wed, 10 Feb 2021 05:15:35 +0000 (05:15 +0000)]
Comments :3

3 years agobootstrap: Locate llvm-dwp based on llvm-config bindir
David Tolnay [Wed, 10 Feb 2021 03:04:29 +0000 (19:04 -0800)]
bootstrap: Locate llvm-dwp based on llvm-config bindir

3 years agoRELEASES.md 1.50: Group platform support notes together
Josh Triplett [Wed, 10 Feb 2021 03:45:32 +0000 (19:45 -0800)]
RELEASES.md 1.50: Group platform support notes together

Move the note about dropping cloudabi next to the other platform support
changes.

3 years agoAuto merge of #81952 - JohnTitor:rollup-i28kgfb, r=JohnTitor
bors [Wed, 10 Feb 2021 03:30:17 +0000 (03:30 +0000)]
Auto merge of #81952 - JohnTitor:rollup-i28kgfb, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #79849 (Clarify docs regarding sleep of zero duration)
 - #80438 (Add `Box::into_inner`.)
 - #81466 (Add suggest mut method for loop)
 - #81687 (Make Vec::split_at_spare_mut public)
 - #81904 (Bump stabilization version for const int methods)
 - #81909 ([compiler/rustc_typeck/src/check/expr.rs] Remove unnecessary refs in pattern matching)
 - #81910 (Use format string in bootstrap panic instead of a string directly)
 - #81913 (Rename HIR UnOp variants)
 - #81925 (Add long explanation for E0547)
 - #81926 (add suggestion to use the `async_recursion` crate)
 - #81951 (Update cargo)

Failed merges:

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

3 years agoRollup merge of #81951 - ehuss:update-cargo, r=ehuss
Yuki Okushi [Wed, 10 Feb 2021 03:24:32 +0000 (12:24 +0900)]
Rollup merge of #81951 - ehuss:update-cargo, r=ehuss

Update cargo

5 commits in 34170fcd6e0947808a1ac63ac85ffc0da7dace2f..ab64d1393b5b77c66b6534ef5023a1b89ee7bf64
2021-02-04 15:52:52 +0000 to 2021-02-10 00:19:10 +0000
- Allow `true` and `false` as options for `strip` option (rust-lang/cargo#9153)
- Change git dependencies to use `HEAD` by default (rust-lang/cargo#9133)
- appendix auth gcm link to new repo (which is xplat) (rust-lang/cargo#9152)
- Fix warnings of the new non_fmt_panic lint (rust-lang/cargo#9148)
- Fix panic with doc collision orphan. (rust-lang/cargo#9142)

3 years agoRollup merge of #81926 - henryboisdequin:fix-81907, r=estebank
Yuki Okushi [Wed, 10 Feb 2021 03:24:30 +0000 (12:24 +0900)]
Rollup merge of #81926 - henryboisdequin:fix-81907, r=estebank

add suggestion to use the `async_recursion` crate

Closes #81907

CC `@estebank`

3 years agoRollup merge of #81925 - jesusprubio:add-long-explanation-e0547, r=GuillaumeGomez
Yuki Okushi [Wed, 10 Feb 2021 03:24:29 +0000 (12:24 +0900)]
Rollup merge of #81925 - jesusprubio:add-long-explanation-e0547, r=GuillaumeGomez

Add long explanation for E0547

Helps with #61137

3 years agoRollup merge of #81913 - osa1:rename_unop_variants, r=matthewjasper
Yuki Okushi [Wed, 10 Feb 2021 03:24:28 +0000 (12:24 +0900)]
Rollup merge of #81913 - osa1:rename_unop_variants, r=matthewjasper

Rename HIR UnOp variants

This renames the variants in HIR UnOp from

    enum UnOp {
        UnDeref,
        UnNot,
        UnNeg,
    }

to

    enum UnOp {
        Deref,
        Not,
        Neg,
    }

Motivations:

- This is more consistent with the rest of the code base where most enum
  variants don't have a prefix.

- These variants are never used without the `UnOp` prefix so the extra
  `Un` prefix doesn't help with readability. E.g. we don't have any
  `UnDeref`s in the code, we only have `UnOp::UnDeref`.

- MIR `UnOp` type variants don't have a prefix so this is more
  consistent with MIR types.

- "un" prefix reads like "inverse" or "reverse", so as a beginner in
  rustc code base when I see "UnDeref" what comes to my mind is
  something like `&*` instead of just `*`.

3 years agoRollup merge of #81910 - jyn514:bootstrap-1.52, r=jackh726
Yuki Okushi [Wed, 10 Feb 2021 03:24:26 +0000 (12:24 +0900)]
Rollup merge of #81910 - jyn514:bootstrap-1.52, r=jackh726

Use format string in bootstrap panic instead of a string directly

This fixes the following warning when compiling with nightly:

```
warning: panic message is not a string literal
    --> src/bootstrap/builder.rs:1515:24
     |
1515 |                 panic!(out);
     |                        ^^^
     |
     = note: `#[warn(non_fmt_panic)]` on by default
     = note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
     |
1515 |                 panic!("{}", out);
     |                        ^^^^^
help: or use std::panic::panic_any instead
     |
1515 |                 std::panic::panic_any(out);
     |                 ^^^^^^^^^^^^^^^^^^^^^^
```

Found while working on https://github.com/rust-lang/rust/pull/79540. cc https://github.com/rust-lang/rust/pull/81645, which landed in 1.51.

3 years agoRollup merge of #81909 - wcampbell0x2a:remove-unnecessary-refs, r=estebank
Yuki Okushi [Wed, 10 Feb 2021 03:24:25 +0000 (12:24 +0900)]
Rollup merge of #81909 - wcampbell0x2a:remove-unnecessary-refs, r=estebank

[compiler/rustc_typeck/src/check/expr.rs] Remove unnecessary refs in pattern matching

3 years agoRollup merge of #81904 - jhpratt:const_int_fn-stabilization, r=jyn514
Yuki Okushi [Wed, 10 Feb 2021 03:24:23 +0000 (12:24 +0900)]
Rollup merge of #81904 - jhpratt:const_int_fn-stabilization, r=jyn514

Bump stabilization version for const int methods

These methods missed the beta cutoff. See #80962 for details.

`@rustbot` modify labels to +A-const-fn, +A-intrinsics

r? `@m-ou-se`

3 years agoRollup merge of #81687 - WaffleLapkin:split_at_spare, r=KodrAus
Yuki Okushi [Wed, 10 Feb 2021 03:24:22 +0000 (12:24 +0900)]
Rollup merge of #81687 - WaffleLapkin:split_at_spare, r=KodrAus

Make Vec::split_at_spare_mut public

This PR introduces a new method to the public API, under
`vec_split_at_spare` feature gate:

```rust
impl<T, A: Allocator> impl Vec<T, A> {
    pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]);
}
```

The method returns 2 slices, one slice references the content of the vector,
and the other references the remaining spare capacity.

The method was previously implemented while adding `Vec::extend_from_within` in #79015,
and used to implement `Vec::spare_capacity_mut` (as the later is just a
subset of former one).

See also previous [discussion in `Vec::spare_capacity_mut` tracking issue](https://github.com/rust-lang/rust/issues/75017#issuecomment-770381335).

## Unresolved questions

- [ ] Should we consider changing the name? `split_at_spare_mut` doesn't seem like an intuitive name
- [ ] Should we deprecate `Vec::spare_capacity_mut`? Any usecase of `Vec::spare_capacity_mut` can be replaced with `Vec::split_at_spare_mut` (but not vise-versa)

r? `@KodrAus`

3 years agoRollup merge of #81466 - sasurau4:fix/enhance-sugget-mut-method-for-loop, r=oli-obk
Yuki Okushi [Wed, 10 Feb 2021 03:24:21 +0000 (12:24 +0900)]
Rollup merge of #81466 - sasurau4:fix/enhance-sugget-mut-method-for-loop, r=oli-obk

Add suggest mut method for loop

Part of #49839

This PR focus on [the comment case](https://github.com/rust-lang/rust/issues/49839#issuecomment-761930746)

3 years agoRollup merge of #80438 - crlf0710:box_into_inner, r=m-ou-se
Yuki Okushi [Wed, 10 Feb 2021 03:24:19 +0000 (12:24 +0900)]
Rollup merge of #80438 - crlf0710:box_into_inner, r=m-ou-se

Add `Box::into_inner`.

This adds a `Box::into_inner` method to the `Box` type. <del>I actually suggest deprecating the compiler magic of `*b` if this gets stablized in the future.</del>

r? `@m-ou-se`

3 years agoRollup merge of #79849 - Digital-Chaos:sleep-zero, r=m-ou-se
Yuki Okushi [Wed, 10 Feb 2021 03:24:18 +0000 (12:24 +0900)]
Rollup merge of #79849 - Digital-Chaos:sleep-zero, r=m-ou-se

Clarify docs regarding sleep of zero duration

Clarify that the behaviour of sleep() when given a duration of zero is actually platform specific.

3 years agoUpdate cargo
Eric Huss [Wed, 10 Feb 2021 02:59:47 +0000 (18:59 -0800)]
Update cargo

3 years agoremove unused backtrace refs
Caleb Cartwright [Wed, 10 Feb 2021 01:56:18 +0000 (19:56 -0600)]
remove unused backtrace refs

3 years agoupdate RLS and rustfmt
Caleb Cartwright [Wed, 10 Feb 2021 01:52:54 +0000 (19:52 -0600)]
update RLS and rustfmt

3 years agoUse ItemCtxt::to_ty
Cameron Steffen [Wed, 10 Feb 2021 01:05:18 +0000 (19:05 -0600)]
Use ItemCtxt::to_ty

3 years agoAuto merge of #81411 - Skgland:deprecate_expr_method_call, r=varkor
bors [Wed, 10 Feb 2021 00:25:11 +0000 (00:25 +0000)]
Auto merge of #81411 - Skgland:deprecate_expr_method_call, r=varkor

Remove usages of `expr_method_call` in derive(Ord,PartialOrd,RustcEncode,RustcDecode)

Preparing for deprecation of `expr_method_call`  (#81295), by removing the remaining usages not covered by (#81294).

I am not sure about the changes to `derive(RustcEncode,RustcDecode)`

3 years agoBorrow builder only once in debug derive
Tomasz Miąsko [Wed, 10 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Borrow builder only once in debug derive

3 years agoupdate tracking issue for vec_split_at_spare
Ashley Mannix [Tue, 9 Feb 2021 23:50:59 +0000 (09:50 +1000)]
update tracking issue for vec_split_at_spare

3 years agoAuto merge of #81132 - bugadani:map-prealloc, r=matthewjasper
bors [Tue, 9 Feb 2021 21:28:58 +0000 (21:28 +0000)]
Auto merge of #81132 - bugadani:map-prealloc, r=matthewjasper

Borrowck: refactor visited map to a bitset

This PR refactors `Borrows`  and the `precompute_borrows_out_of_scope` function so that this initial phase has a much reduced memory pressure. This is achieved by reducing what is stored on the heap, and also reusing heap memory as much as possible.

3 years agoAdd attr-on-params test
Ryan Levick [Tue, 9 Feb 2021 21:17:10 +0000 (22:17 +0100)]
Add attr-on-params test

3 years agoVisit more targets when checking attrs
Ryan Levick [Fri, 8 Jan 2021 09:00:39 +0000 (10:00 +0100)]
Visit more targets when checking attrs

3 years agoAuto merge of #81892 - jyn514:no-inline, r=cjgillot
bors [Tue, 9 Feb 2021 18:37:33 +0000 (18:37 +0000)]
Auto merge of #81892 - jyn514:no-inline, r=cjgillot

[experiment] remove `#[inline]` from rustc_query_system::plumbing

These functions have a ton of generic parameters and are instantiated
over and over again. Hopefully this will reduce binary bloat and speed
up bootstrapping times.

r? `@cjgillot`

3 years agosplit guard into read and write types
The8472 [Tue, 9 Feb 2021 17:49:29 +0000 (18:49 +0100)]
split guard into read and write types

3 years agoAuto merge of #79540 - jyn514:no-xpy, r=Mark-Simulacrum
bors [Tue, 9 Feb 2021 15:28:28 +0000 (15:28 +0000)]
Auto merge of #79540 - jyn514:no-xpy, r=Mark-Simulacrum

Allow building rustdoc without first building rustc (MVP)

 ## Motivation

The compile times for rustc are extremely long and a major issue for
recruiting new contributors to rustdoc. People interested in joining
often give up after running into issues with submodules or python
versions. stage1 rustdoc fundamentally doesn't care about bootstrapping
or stages, it just needs `rustc_private` available.

## Summary of Changes

- Add an opt-in `[rust] download_rustc` option
- Determine the version of the compiler to download using `log --author=bors`
- Do no work for any component other than `Rustdoc` for any stage. Instead, copy the CI artifacts from the downloaded sysroot stage0/ to stage0-sysroot/ or stage1/ in `Sysroot`. This is done with an `ENABLE_DOWNLOAD_STAGE1` constant which is off by default.
- Don't download different versions of rustfmt or cargo - those should still use the beta version (rustfmt especially).

The vast majority of work is done in bootstrap.py, which downloads the artifacts and extracts them to stage0/ in place of the beta compiler. Rustbuild just takes care of copying the artifacts to stage1 if necessary.

## Future work

- I turned off verification for the commit tarballs because the .sha256 URLs gave a 404. This seems not ideal, it would be nice to start signing them.
- This will break if you rebase an old enough branch (I think commits are kept at most 160 days?). This doesn't need to be supported, but it would be nice to give a reasonable error. https://github.com/rust-lang/rust/pull/79540#issuecomment-751481291
- Right now, every time you rebase, stage0 tools (bootstrap, tidy, ...) will have to be recompiled. Additionally running `x.py setup tools` will compile rustbuild twice. Instead, this should download a separate beta compiler for stage0 and only use CI artifacts for stage1 onward. https://github.com/rust-lang/rust/pull/79540#issuecomment-757047321
- Add `x.py setup tools` to enable this conveniently (it doesn't make sense to use this for compiler developers). https://github.com/jyn514/rust/commit/cb5d8c85226c501bf9deb39082a08af0ebfae850
- Compile a new version of tracing so that rustdoc still gets debug logging (since CI artifacts always disable `debug` and `trace` logging). https://github.com/rust-lang/rust/pull/79540#issuecomment-742756411, https://github.com/jyn514/rust/commit/6a5d5124209bec7652e745725a995bd77bb3f881
- Right now only rustdoc is ever rebuilt. This is not ideal and should probably at least compile compiler tools (rustfmt, clippy, miri). https://github.com/rust-lang/rust/pull/79540#issuecomment-775634693
- Using `git log --author=bors` sometimes breaks. This should use `git merge-base` instead. https://github.com/rust-lang/rust/pull/79540#discussion_r572572280
- It would be nice to support cross-compiling the standard library. Right now this gives an assertion failure I think.

Some of this work has already been done in (the history for) https://github.com/jyn514/rust/commit/673476c785bc1fbff175cb7f49ad487c7a2b0337.

3 years agoci: allow unstable features in some PGO benchmarks
Pietro Albini [Tue, 29 Dec 2020 20:18:40 +0000 (15:18 -0500)]
ci: allow unstable features in some PGO benchmarks

3 years agoOrganize trait test files
Bram van den Heuvel [Mon, 8 Feb 2021 22:15:45 +0000 (23:15 +0100)]
Organize trait test files

3 years agoUpdate compiler/rustc_error_codes/src/error_codes/E0547.md
Jesús Rubio [Tue, 9 Feb 2021 13:13:40 +0000 (14:13 +0100)]
Update compiler/rustc_error_codes/src/error_codes/E0547.md

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
3 years agoadd suggestion to use the `async_recursion` crate
Henry Boisdequin [Tue, 9 Feb 2021 13:13:39 +0000 (18:43 +0530)]
add suggestion to use the `async_recursion` crate

3 years agoLost text re-added
Jesus Rubio [Tue, 9 Feb 2021 13:09:19 +0000 (14:09 +0100)]
Lost text re-added

3 years agoBTreeMap: disentangle Drop implementation from IntoIter
Stein Somers [Fri, 22 Jan 2021 16:03:52 +0000 (17:03 +0100)]
BTreeMap: disentangle Drop implementation from IntoIter

3 years agofix derive(RustcEncodable, RustcDecodable)
Skgland [Thu, 4 Feb 2021 21:49:50 +0000 (22:49 +0100)]
fix derive(RustcEncodable, RustcDecodable)

3 years agouse ufcs in derive(RustDecodable)
Skgland [Tue, 26 Jan 2021 14:06:01 +0000 (15:06 +0100)]
use ufcs in derive(RustDecodable)

3 years agouse ufcs in derive(RustEncodable)
Skgland [Tue, 26 Jan 2021 14:05:11 +0000 (15:05 +0100)]
use ufcs in derive(RustEncodable)

3 years agoadd method to construct def site path as a vec of idents
Skgland [Tue, 26 Jan 2021 14:04:09 +0000 (15:04 +0100)]
add method to construct def site path as a vec of idents

like std_path but used dummy span for all path elements and does not perpend kw:DollarCrate

3 years agouse ufcs in derive(Ord) and derive(PartialOrd)
Skgland [Tue, 9 Feb 2021 12:41:34 +0000 (13:41 +0100)]
use ufcs in derive(Ord) and derive(PartialOrd)

3 years agoBTreeMap: fix internal comments
Stein Somers [Mon, 25 Jan 2021 09:04:09 +0000 (10:04 +0100)]
BTreeMap: fix internal comments

3 years agoAuto merge of #81916 - RalfJung:miri, r=RalfJung
bors [Tue, 9 Feb 2021 11:38:47 +0000 (11:38 +0000)]
Auto merge of #81916 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/81868
Cc `@rust-lang/miri` r? `@ghost`

3 years agoRunning ./x.py fmt
Kevin Per [Tue, 9 Feb 2021 10:28:49 +0000 (10:28 +0000)]
Running ./x.py fmt

3 years agoupdate Miri
Ralf Jung [Tue, 9 Feb 2021 10:05:42 +0000 (11:05 +0100)]
update Miri

3 years agoFix const generics in GAT
Ellen [Tue, 9 Feb 2021 08:57:42 +0000 (08:57 +0000)]
Fix const generics in GAT

3 years agoAuto merge of #81384 - tmiasko:partial-ord, r=petrochenkov
bors [Tue, 9 Feb 2021 08:47:38 +0000 (08:47 +0000)]
Auto merge of #81384 - tmiasko:partial-ord, r=petrochenkov

Fix derived PartialOrd operators

The derived implementation of `partial_cmp` compares matching fields one
by one, stopping the computation when the result of a comparison is not
equal to `Some(Equal)`.

On the other hand the derived implementation for `lt`, `le`, `gt` and
`ge` continues the computation when the result of a field comparison is
`None`, consequently those operators are not transitive and inconsistent
with `partial_cmp`.

Fix the inconsistency by using the default implementation that fall-backs
to the `partial_cmp`. This also avoids creating very deeply nested
closures that were quite costly to compile.

Fixes #81373.
Helps with #81278, #80118.

3 years agoFixing codestyle
Kevin Per [Tue, 9 Feb 2021 08:42:08 +0000 (08:42 +0000)]
Fixing codestyle

3 years agoRename HIR UnOp variants
Ömer Sinan Ağacan [Tue, 9 Feb 2021 08:15:53 +0000 (11:15 +0300)]
Rename HIR UnOp variants

This renames the variants in HIR UnOp from

    enum UnOp {
        UnDeref,
        UnNot,
        UnNeg,
    }

to

    enum UnOp {
        Deref,
        Not,
        Neg,
    }

Motivations:

- This is more consistent with the rest of the code base where most enum
  variants don't have a prefix.

- These variants are never used without the `UnOp` prefix so the extra
  `Un` prefix doesn't help with readability. E.g. we don't have any
  `UnDeref`s in the code, we only have `UnOp::UnDeref`.

- MIR `UnOp` type variants don't have a prefix so this is more
  consistent with MIR types.

- "un" prefix reads like "inverse" or "reverse", so as a beginner in
  rustc code base when I see "UnDeref" what comes to my mind is
  something like "&*" instead of just "*".

3 years agoFixing bad suggestion for `_` in `const` type when a function #81885
Kevin Per [Tue, 9 Feb 2021 08:35:58 +0000 (08:35 +0000)]
Fixing bad suggestion for `_` in `const` type when a function #81885

3 years agoMark migration code that relies on Deref unreachable
Aman Arora [Fri, 5 Feb 2021 00:55:16 +0000 (19:55 -0500)]
Mark migration code that relies on Deref unreachable

3 years agoTests for precise lint analysis
Aman Arora [Thu, 4 Feb 2021 23:50:32 +0000 (18:50 -0500)]
Tests for precise lint analysis

3 years agoImplement the precise analysis pass for lint `disjoint_capture_drop_reorder`
Aman Arora [Sun, 27 Dec 2020 06:13:51 +0000 (01:13 -0500)]
Implement the precise analysis pass for lint `disjoint_capture_drop_reorder`

3 years agoAuto merge of #81905 - Dylan-DPC:rollup-mxpz1j7, r=Dylan-DPC
bors [Tue, 9 Feb 2021 05:57:18 +0000 (05:57 +0000)]
Auto merge of #81905 - Dylan-DPC:rollup-mxpz1j7, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #72209 (Add checking for no_mangle to unsafe_code lint)
 - #80732 (Allow Trait inheritance with cycles on associated types take 2)
 - #81697 (Add "every" as a doc alias for "all".)
 - #81826 (Prefer match over combinators to make some Box methods inlineable)
 - #81834 (Resolve typedef in HashMap lldb pretty-printer only if possible)
 - #81841 ([rustbuild] Output rustdoc-json-types docs )
 - #81849 (Expand the docs for ops::ControlFlow a bit)
 - #81876 (parser: Fix panic in 'const impl' recovery)
 - #81882 (:arrow_up: rust-analyzer)
 - #81888 (Fix pretty printer macro_rules with semicolon.)
 - #81896 (Remove outdated comment in windows' mutex.rs)

Failed merges:

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

3 years agoUse `log --author=bors` instead of `merge-base`
Joshua Nelson [Fri, 22 Jan 2021 06:00:51 +0000 (01:00 -0500)]
Use `log --author=bors` instead of `merge-base`

3 years agoAbsolute bare minimum for downloading rustc from CI
Joshua Nelson [Fri, 22 Jan 2021 05:31:17 +0000 (00:31 -0500)]
Absolute bare minimum for downloading rustc from CI

- Use the same compiler for stage0 and stage1. This should be fixed at
  some point (so bootstrap isn't constantly rebuilt).
- Make sure `x.py build` and `x.py check` work.
- Use `git merge-base` to determine the most recent commit to download.
- Copy stage0 to the various sysroots in `Sysroot`, and delegate to
  Sysroot in Assemble. Leave all other code unchanged.
- Rename date -> key

  This can also be a commit hash, so 'date' is no longer a good name.

- Add the commented-out option to config.toml.example
- Disable all steps by default when `download-rustc` is enabled

  Most steps don't make sense when downloading a compiler, because they'll
  be pre-built in the sysroot. Only enable the ones that might be useful,
  in particular Rustdoc and all `check` steps.

  At some point, this should probably enable other tools, but rustdoc is
  enough to test out `download-rustc`.

- Don't print 'Skipping' twice in a row

  Bootstrap forcibly enables a dry run if it isn't already set, so
  previously it would print the message twice:

  ```
  Skipping bootstrap::compile::Std because it is not enabled for `download-rustc`
  Skipping bootstrap::compile::Std because it is not enabled for `download-rustc`
  ```

  Now it correctly only prints once.

 ## Future work

- Add FIXME about supporting beta commits
- Debug logging will never work. This should be fixed.

3 years agoUse format string in bootstrap panic instead of a string directly
Joshua Nelson [Tue, 9 Feb 2021 03:51:21 +0000 (22:51 -0500)]
Use format string in bootstrap panic instead of a string directly

This fixes the following warning when compiling with nightly:

```
warning: panic message is not a string literal
    --> src/bootstrap/builder.rs:1515:24
     |
1515 |                 panic!(out);
     |                        ^^^
     |
     = note: `#[warn(non_fmt_panic)]` on by default
     = note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
     |
1515 |                 panic!("{}", out);
     |                        ^^^^^
help: or use std::panic::panic_any instead
     |
1515 |                 std::panic::panic_any(out);
     |                 ^^^^^^^^^^^^^^^^^^^^^^
```

3 years agoAuto merge of #81901 - Mark-Simulacrum:use-string-not-cow, r=jackh726
bors [Tue, 9 Feb 2021 03:06:42 +0000 (03:06 +0000)]
Auto merge of #81901 - Mark-Simulacrum:use-string-not-cow, r=jackh726

Switch query descriptions to just String

In practice we never used the borrowed variant anyway.

3 years agoRemove unnecessary refs in pattern matching
wcampbell [Tue, 9 Feb 2021 03:02:35 +0000 (22:02 -0500)]
Remove unnecessary refs in pattern matching

Signed-off-by: wcampbell <wcampbell1995@gmail.com>
3 years agoAdd `Box::into_inner`.
Charles Lew [Mon, 28 Dec 2020 12:47:19 +0000 (20:47 +0800)]
Add `Box::into_inner`.

3 years agoRollup merge of #81896 - m-ou-se:oudated-comment, r=Mark-Simulacrum
Dylan DPC [Tue, 9 Feb 2021 01:40:06 +0000 (02:40 +0100)]
Rollup merge of #81896 - m-ou-se:oudated-comment, r=Mark-Simulacrum

Remove outdated comment in windows' mutex.rs

After https://github.com/rust-lang/rust/pull/81250, this `Mutex` no longer falls back to the `ReentrantMutex` implementation, so this comment is no longer relevant.

3 years agoRollup merge of #81888 - ehuss:macro_rules-pp, r=petrochenkov
Dylan DPC [Tue, 9 Feb 2021 01:40:05 +0000 (02:40 +0100)]
Rollup merge of #81888 - ehuss:macro_rules-pp, r=petrochenkov

Fix pretty printer macro_rules with semicolon.

The pretty printer was not including the trailing semicolon for a macro_rules definition that used parenthesis or brackets, which results in invalid code. This adds the semicolon in those two cases.

3 years agoRollup merge of #81882 - lnicola:rust-analyzer-2021-02-08, r=jonas-schievink
Dylan DPC [Tue, 9 Feb 2021 01:40:03 +0000 (02:40 +0100)]
Rollup merge of #81882 - lnicola:rust-analyzer-2021-02-08, r=jonas-schievink

:arrow_up: rust-analyzer

r? `@jonas-schievink`

3 years agoRollup merge of #81876 - osa1:issue81806, r=matthewjasper
Dylan DPC [Tue, 9 Feb 2021 01:40:01 +0000 (02:40 +0100)]
Rollup merge of #81876 - osa1:issue81806, r=matthewjasper

parser: Fix panic in 'const impl' recovery

The panic happens when in recovery parsing a full `impl`
(`parse_item_impl`) fails and we drop the `DiagnosticBuilder` for the
recovery suggestion and return the `parse_item_impl` error.

We now raise the original error "expected identifier found `impl`" when
parsing the `impl` fails.

Note that the regression test is slightly simplified version of the
original repro in #81806, to make the error output smaller and more
resilient to unrelated changes in parser error messages.

Fixes #81806

3 years agoRollup merge of #81849 - scottmcm:control-flow-comments, r=Mark-Simulacrum
Dylan DPC [Tue, 9 Feb 2021 01:39:59 +0000 (02:39 +0100)]
Rollup merge of #81849 - scottmcm:control-flow-comments, r=Mark-Simulacrum

Expand the docs for ops::ControlFlow a bit

Since I was writing some examples for an RFC anyway.

And I almost made the mistake of reordering the variants, so added a note and a test about that.

3 years agoRollup merge of #81841 - aDotInTheVoid:rdj_docs, r=jyn514
Dylan DPC [Tue, 9 Feb 2021 01:39:57 +0000 (02:39 +0100)]
Rollup merge of #81841 - aDotInTheVoid:rdj_docs, r=jyn514

[rustbuild] Output rustdoc-json-types docs

`@rustbot` modify labels +A-rustdoc-json +T-doc +T-rustdoc +A-rustbuild +A-contributor-roadblock

3 years agoRollup merge of #81834 - ortem:fix-LLDB-hashmap-pretty-printers, r=Mark-Simulacrum
Dylan DPC [Tue, 9 Feb 2021 01:39:55 +0000 (02:39 +0100)]
Rollup merge of #81834 - ortem:fix-LLDB-hashmap-pretty-printers, r=Mark-Simulacrum

Resolve typedef in HashMap lldb pretty-printer only if possible

Fixes https://github.com/rust-lang/rust/issues/81814

Previously, `GetTypedefedType` was invoked unconditionally.
But this did not work in case of `rust-lldb` without Rust patches since there was no typedef.

3 years agoRollup merge of #81826 - tesuji:inline-box-zeros, r=Amanieu
Dylan DPC [Tue, 9 Feb 2021 01:39:53 +0000 (02:39 +0100)]
Rollup merge of #81826 - tesuji:inline-box-zeros, r=Amanieu

Prefer match over combinators to make some Box methods inlineable

Hopefully this patch would make two snippets generated identical code: <https://rust.godbolt.org/z/fjrj4E>.

3 years agoRollup merge of #81697 - xfix:every-doc-alias, r=Mark-Simulacrum
Dylan DPC [Tue, 9 Feb 2021 01:39:51 +0000 (02:39 +0100)]
Rollup merge of #81697 - xfix:every-doc-alias, r=Mark-Simulacrum

Add "every" as a doc alias for "all".

This matches [Array#every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) in JavaScript.

Oddly enough, `core::iter::Iterator::all` appears twice. This appears to be a rustdoc bug which I decided to fill in as #81696.

![image](https://user-images.githubusercontent.com/1297598/106717890-94f43e80-6600-11eb-9428-2cd425823df9.png)

3 years agoRollup merge of #80732 - spastorino:trait-inheritance-self2, r=nikomatsakis
Dylan DPC [Tue, 9 Feb 2021 01:39:50 +0000 (02:39 +0100)]
Rollup merge of #80732 - spastorino:trait-inheritance-self2, r=nikomatsakis

Allow Trait inheritance with cycles on associated types take 2

This reverts the revert of #79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in #80648 and #79811.
For easier review I'd say, check only the last commit, the first one is just a revert of the revert of #79209 which was already approved.

This also could be considered part or the actual fix of #79560 but I guess for that to be closed and fixed completely we would need to land #80648 and #79811 too.

r? `@nikomatsakis`
cc `@Aaron1011`

3 years agoRollup merge of #72209 - Nemo157:lint-no-mangle-in-unsafe-code, r=nikomatsakis
Dylan DPC [Tue, 9 Feb 2021 01:39:45 +0000 (02:39 +0100)]
Rollup merge of #72209 - Nemo157:lint-no-mangle-in-unsafe-code, r=nikomatsakis

Add checking for no_mangle to unsafe_code lint

fixes #72188

r? `@estebank`

3 years agoBump stabilization version for const int methods
Jacob Pratt [Tue, 9 Feb 2021 00:22:08 +0000 (19:22 -0500)]
Bump stabilization version for const int methods

These methods missed the beta cutoff

3 years ago./x.py test --bless
Tomasz Miąsko [Tue, 9 Feb 2021 00:00:00 +0000 (00:00 +0000)]
./x.py test --bless

3 years agoFix derived PartialOrd operators
Tomasz Miąsko [Mon, 25 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Fix derived PartialOrd operators

The derived implementation of `partial_cmp` compares matching fields one
by one, stopping the computation when the result of a comparison is not
equal to `Some(Equal)`.

On the other hand the derived implementation for `lt`, `le`, `gt` and
`ge` continues the computation when the result of a field comparison is
`None`, consequently those operators are not transitive and inconsistent
with `partial_cmp`.

Fix the inconsistency by using the default implementation that fall-backs
to the `partial_cmp`. This also avoids creating very deeply nested
closures that were quite costly to compile.

3 years agospecialize slice::clone_from_slice() for T: Copy
The8472 [Sun, 7 Feb 2021 14:50:31 +0000 (15:50 +0100)]
specialize slice::clone_from_slice() for T: Copy

3 years agoAuto merge of #81361 - ssomers:btree_drainy_refactor_7, r=Mark-Simulacrum
bors [Mon, 8 Feb 2021 23:37:06 +0000 (23:37 +0000)]
Auto merge of #81361 - ssomers:btree_drainy_refactor_7, r=Mark-Simulacrum

BTreeMap: lightly refactor the split_off implementation

r? `@Mark-Simulacrum`

3 years agointroduce StaticRWLock wrapper to make methods safe
The8472 [Mon, 8 Feb 2021 22:34:23 +0000 (23:34 +0100)]
introduce StaticRWLock wrapper to make methods safe

3 years agoavoid &mut on the read path since it now allows concurrent readers
The8472 [Mon, 8 Feb 2021 22:31:49 +0000 (23:31 +0100)]
avoid &mut on the read path since it now allows concurrent readers

3 years agoSwitch query descriptions to just String
Mark Rousskov [Mon, 8 Feb 2021 22:20:41 +0000 (17:20 -0500)]
Switch query descriptions to just String

In practice we never used the borrowed variant anyway.

3 years agoRemove outdated comment.
Mara Bos [Mon, 8 Feb 2021 21:27:34 +0000 (22:27 +0100)]
Remove outdated comment.

3 years agoAllow default hash types in conversion
Rune Tynan [Mon, 8 Feb 2021 21:17:00 +0000 (16:17 -0500)]
Allow default hash types in conversion

3 years agoVec -> HashSet
Rune Tynan [Mon, 8 Feb 2021 21:04:14 +0000 (16:04 -0500)]
Vec -> HashSet

3 years agoAuto merge of #81889 - m-ou-se:rollup-k63log3, r=m-ou-se
bors [Mon, 8 Feb 2021 20:52:54 +0000 (20:52 +0000)]
Auto merge of #81889 - m-ou-se:rollup-k63log3, r=m-ou-se

Rollup of 9 pull requests

Successful merges:

 - #71531 (Move treat err as bug tests to ui)
 - #81356 (libtest: allow multiple filters)
 - #81735 (faster few span methods)
 - #81779 (improve error message for disallowed ptr-to-int casts in const eval)
 - #81817 (Add option to emit compiler stderr per bitwidth.)
 - #81828 (parse_format: treat r" as a literal)
 - #81840 (fix formatting of std::iter::Map)
 - #81861 (Show MIR bytes separately in -Zmeta-stats output)
 - #81865 (Clean up weird Option mapping)

Failed merges:

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

3 years agoAdd comment + move derive helper
Rune Tynan [Mon, 8 Feb 2021 20:45:50 +0000 (15:45 -0500)]
Add comment + move derive helper

3 years agoFix pretty printer macro_rules with semicolon.
Eric Huss [Mon, 8 Feb 2021 18:03:57 +0000 (10:03 -0800)]
Fix pretty printer macro_rules with semicolon.

3 years ago[experiment] remove `#[inline]` from rustc_query_system::plumbing
Joshua Nelson [Mon, 8 Feb 2021 19:57:15 +0000 (14:57 -0500)]
[experiment] remove `#[inline]` from rustc_query_system::plumbing

These functions have a ton of generic parameters and are instantiated
over and over again. Hopefully this will reduce binary bloat and speed
up bootstrapping times.

3 years agoAnonymize late bound regions on transitive bounds that define assoc type
Santiago Pastorino [Fri, 5 Feb 2021 18:52:57 +0000 (15:52 -0300)]
Anonymize late bound regions on transitive bounds that define assoc type

3 years agoRemove RCs from Borrows
Dániel Buga [Sun, 7 Feb 2021 21:32:50 +0000 (22:32 +0100)]
Remove RCs from Borrows

3 years agoMake `header` a vec of modifiers, make FunctionPointer consistent with Function and...
Rune Tynan [Mon, 8 Feb 2021 18:48:10 +0000 (13:48 -0500)]
Make `header` a vec of modifiers, make FunctionPointer consistent with Function and Method.

3 years agoRevert "Get rid of custom pretty-printing in rustdoc"
LeSeulArtichaut [Sat, 6 Feb 2021 15:38:14 +0000 (16:38 +0100)]
Revert "Get rid of custom pretty-printing in rustdoc"

This reverts commit 31375d2074aeed0c6f173aa200f0bd3bf6d36756.

3 years agoRollup merge of #81865 - bugadani:typeck2, r=jyn514
Mara Bos [Mon, 8 Feb 2021 18:28:25 +0000 (19:28 +0100)]
Rollup merge of #81865 - bugadani:typeck2, r=jyn514

Clean up weird Option mapping

3 years agoRollup merge of #81861 - tmiasko:mir-bytes, r=wesleywiser
Mara Bos [Mon, 8 Feb 2021 18:28:23 +0000 (19:28 +0100)]
Rollup merge of #81861 - tmiasko:mir-bytes, r=wesleywiser

Show MIR bytes separately in -Zmeta-stats output

The size of serialized MIR is substantial enough to deserve its own category.

3 years agoRollup merge of #81840 - ibraheemdev:patch-1, r=dtolnay
Mara Bos [Mon, 8 Feb 2021 18:28:22 +0000 (19:28 +0100)]
Rollup merge of #81840 - ibraheemdev:patch-1, r=dtolnay

fix formatting of std::iter::Map

3 years agoRollup merge of #81828 - davidhewitt:capture-raw-format-strings, r=estebank
Mara Bos [Mon, 8 Feb 2021 18:28:20 +0000 (19:28 +0100)]
Rollup merge of #81828 - davidhewitt:capture-raw-format-strings, r=estebank

parse_format: treat r" as a literal

This PR changes `format_args!` internal parsing machinery to treat raw strings starting `r"` as a literal.

Currently `"` and `r#` are recognised as valid starting combinations for string literals, but `r"` is not.

This was noticed when debugging https://github.com/rust-lang/rust/issues/67984#issuecomment-753413156

As well as fixing the behavior observed in that comment, this improves diagnostic spans for `r"` formatting strings.

3 years agoRollup merge of #81817 - hameerabbasi:mcp-635, r=oli-obk
Mara Bos [Mon, 8 Feb 2021 18:28:18 +0000 (19:28 +0100)]
Rollup merge of #81817 - hameerabbasi:mcp-635, r=oli-obk

Add option to emit compiler stderr per bitwidth.

See rust-lang/compiler-team#365

r? `@oli-obk`