]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011
bors [Sat, 26 Mar 2022 23:01:12 +0000 (23:01 +0000)]
Auto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011

proc-macro: Stop wrapping `ident` matchers into groups

`ident` is always a single token and can be treated in the same way as `tt`.
r? `@Aaron1011`

2 years agoAuto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC
bors [Sat, 26 Mar 2022 20:17:04 +0000 (20:17 +0000)]
Auto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC

add #[must_use] to functions of slice and its iterators.

Continuation of #92853.

Tracking issue: #89692.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 15:23:55 +0000 (16:23 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 15:19:47 +0000 (16:19 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 14:47:22 +0000 (15:47 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 14:37:48 +0000 (15:37 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoAuto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC
bors [Sat, 26 Mar 2022 12:01:58 +0000 (12:01 +0000)]
Auto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC

Remove mention of `HashMap<K, V>` not offering `iter_mut`

HashMap<K, V> does offer iter_mut. Fixes #94755.

r? rust-lang/libs
`@rustbot` label +A-docs +T-libs

2 years agoproc-macro: Stop wrapping `ident` matchers into groups
Vadim Petrochenkov [Sat, 1 Jan 2022 09:15:47 +0000 (17:15 +0800)]
proc-macro: Stop wrapping `ident` matchers into groups

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 09:24:25 +0000 (10:24 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoAuto merge of #95306 - est31:master, r=Dylan-DPC
bors [Sat, 26 Mar 2022 09:00:23 +0000 (09:00 +0000)]
Auto merge of #95306 - est31:master, r=Dylan-DPC

std::process docs: linkify references to output, spawn and status

2 years agoRemove mention of HashMap<K, V> not offering iter_mut
dlup [Sat, 26 Mar 2022 06:05:34 +0000 (02:05 -0400)]
Remove mention of HashMap<K, V> not offering iter_mut

2 years agoAuto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC
bors [Sat, 26 Mar 2022 06:00:41 +0000 (06:00 +0000)]
Auto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC

Prettify rustc_session with recent conveniences

No functional changes.

I felt like making something beautiful.

2 years agoAuto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett
bors [Sat, 26 Mar 2022 03:19:49 +0000 (03:19 +0000)]
Auto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett

Remove hermitkernel targets

RustyHermit now maintains custom json targets, which are distributed with the kernel: https://github.com/hermitcore/libhermit-rs/pull/395

See https://github.com/hermitcore/rusty-hermit/issues/197#issuecomment-1076667961
CC: `@stlankes,` `@bstrie`
2 years agoAuto merge of #95149 - cjgillot:once-diag, r=estebank
bors [Sat, 26 Mar 2022 00:54:54 +0000 (00:54 +0000)]
Auto merge of #95149 - cjgillot:once-diag, r=estebank

Remove `Session::one_time_diagnostic`

This is untracked mutable state, which modified the behaviour of queries.
It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes).

It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter.
A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics.

As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.

2 years agoAuto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
bors [Fri, 25 Mar 2022 22:16:44 +0000 (22:16 +0000)]
Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle

Reduce wait-for instructions for rustdoc GUI tests

r? `@notriddle`

2 years agoReplace wait-for instructions for rustdoc GUI tests with wait-for-css
Guillaume Gomez [Mon, 21 Mar 2022 14:50:05 +0000 (15:50 +0100)]
Replace wait-for instructions for rustdoc GUI tests with wait-for-css

2 years agoUpdate browser-ui-test version to 0.8.4
Guillaume Gomez [Fri, 25 Mar 2022 20:08:59 +0000 (21:08 +0100)]
Update browser-ui-test version to 0.8.4

2 years agoAuto merge of #95304 - michaelwoerister:retry-finalize-session-dir, r=oli-obk
bors [Fri, 25 Mar 2022 19:47:19 +0000 (19:47 +0000)]
Auto merge of #95304 - michaelwoerister:retry-finalize-session-dir, r=oli-obk

incr. comp.: Let compiler retry finalizing session directory a few times.

In my local testing this fixed issue https://github.com/rust-lang/rust/issues/86929. I wasn't able to come up with a regression test for it though.

2 years agoAuto merge of #95282 - RalfJung:miri, r=RalfJung
bors [Fri, 25 Mar 2022 16:45:08 +0000 (16:45 +0000)]
Auto merge of #95282 - RalfJung:miri, r=RalfJung

update Miri

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

2 years agoAuto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, r=oli-obk
bors [Fri, 25 Mar 2022 14:16:13 +0000 (14:16 +0000)]
Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, r=oli-obk

Swap DtorckConstraint to DropckConstraint

This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.

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

2 years agostd::process docs: linkify references to output, spawn and status
est31 [Fri, 25 Mar 2022 13:41:37 +0000 (14:41 +0100)]
std::process docs: linkify references to output, spawn and status

2 years agoincr. comp.: Let compiler retry finalizing session directory a few times.
Michael Woerister [Fri, 25 Mar 2022 13:14:22 +0000 (14:14 +0100)]
incr. comp.: Let compiler retry finalizing session directory a few times.

See https://github.com/rust-lang/rust/issues/86929.

2 years agoBless rustdoc tests.
Camille GILLOT [Fri, 25 Mar 2022 11:50:45 +0000 (12:50 +0100)]
Bless rustdoc tests.

2 years agoAuto merge of #95255 - petrochenkov:suggresolve, r=michaelwoerister
bors [Fri, 25 Mar 2022 11:35:19 +0000 (11:35 +0000)]
Auto merge of #95255 - petrochenkov:suggresolve, r=michaelwoerister

resolve: Do not build expensive suggestions if they are not actually used

And remove a bunch of (conditionally) unused parameters from path resolution functions.

This helps with performance issues in https://github.com/rust-lang/rust/pull/94857, and should be helpful in general even without that.

2 years agoRemove hermitkernel targets
Martin Kröning [Fri, 25 Mar 2022 10:46:34 +0000 (11:46 +0100)]
Remove hermitkernel targets

RustyHermit now maintains custom json targets, which are distributed with the kernel. [1]

[1]: https://github.com/hermitcore/libhermit-rs/pull/395

2 years agoAuto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakis
bors [Fri, 25 Mar 2022 09:09:48 +0000 (09:09 +0000)]
Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakis

Overlap inherent impls

r? `@nikomatsakis`

Closes #94526

2 years agoAuto merge of #95259 - nnethercote:more-macro-expansion-optimizations, r=petrochenkov
bors [Fri, 25 Mar 2022 06:28:58 +0000 (06:28 +0000)]
Auto merge of #95259 - nnethercote:more-macro-expansion-optimizations, r=petrochenkov

More macro expansion optimizations

A few nice wins for macro-heavy crates.

r? `@petrochenkov`

2 years agoUse a let-chain in _session::output (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:31:46 +0000 (22:31 -0700)]
Use a let-chain in _session::output (nfc)

2 years agoVigorously refactor _session::code_stats (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:30:38 +0000 (22:30 -0700)]
Vigorously refactor _session::code_stats (nfc)

2 years agoPrettify rustc_session fmt with capturing args (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:11:05 +0000 (22:11 -0700)]
Prettify rustc_session fmt with capturing args (nfc)

2 years agoAuto merge of #92361 - vacuus:doctest-run-test-out-lines, r=CraftSpider
bors [Fri, 25 Mar 2022 04:01:00 +0000 (04:01 +0000)]
Auto merge of #92361 - vacuus:doctest-run-test-out-lines, r=CraftSpider

Remove `collect` in `doctest::run_test`

2 years agoShrink `MatcherPosRepetition`.
Nicholas Nethercote [Wed, 23 Mar 2022 05:04:33 +0000 (16:04 +1100)]
Shrink `MatcherPosRepetition`.

Currently it copies a `KleeneOp` and a `Token` out of a
`SequenceRepetition`. It's better to store a reference to the
`SequenceRepetition`, which is now possible due to #95159 having changed
the lifetimes.

2 years agoShrink `NamedMatchVec` to one inline element.
Nicholas Nethercote [Wed, 23 Mar 2022 02:09:55 +0000 (13:09 +1100)]
Shrink `NamedMatchVec` to one inline element.

This counters the `NamedMatchVec` size increase from the previous
commit, leaving `NamedMatchVec` smaller than before.

2 years agoSplit `NamedMatch::MatchNonterminal` in two.
Nicholas Nethercote [Wed, 23 Mar 2022 00:46:22 +0000 (11:46 +1100)]
Split `NamedMatch::MatchNonterminal` in two.

The `Lrc` is only relevant within `transcribe()`. There, the `Lrc` is
helpful for the non-`NtTT` cases, because the entire nonterminal is
cloned. But for the `NtTT` cases the inner token tree is cloned (a full
clone) and so the `Lrc` is of no help.

This commit splits the `NtTT` and non-`NtTT` cases, avoiding the useless
`Lrc` in the former case, for the following effect on macro-heavy
crates.
- It reduces the total number of allocations a lot.
- It increases the size of some of the remaining allocations.
- It doesn't affect *peak* memory usage, because the larger allocations
  are short-lived.

This overall gives a speed win.

2 years agoAuto merge of #95291 - Dylan-DPC:rollup-vrb4wlw, r=Dylan-DPC
bors [Fri, 25 Mar 2022 01:20:01 +0000 (01:20 +0000)]
Auto merge of #95291 - Dylan-DPC:rollup-vrb4wlw, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #94391 (Fix ice when error reporting recursion errors)
 - #94655 (Clarify which kinds of MIR are allowed during which phases.)
 - #95179 (Try to evaluate in try unify and postpone resolution of constants that contain inference variables)
 - #95270 (debuginfo: Fix debuginfo for Box<T> where T is unsized.)
 - #95276 (add diagnostic items for clippy's `trim_split_whitespace`)

Failed merges:

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

2 years agoRollup merge of #95276 - FoseFx:clippy_trim_split_whitespace, r=flip1995
Dylan DPC [Fri, 25 Mar 2022 00:34:32 +0000 (01:34 +0100)]
Rollup merge of #95276 - FoseFx:clippy_trim_split_whitespace, r=flip1995

add diagnostic items for clippy's `trim_split_whitespace`

Adding the following diagnostic items:
 * str_split_whitespace,
 * str_trim,
 * str_trim_start,
 * str_trim_end

They are needed for https://github.com/rust-lang/rust-clippy/pull/8575

r? `@flip1995`

2 years agoRollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, r=wesleywiser
Dylan DPC [Fri, 25 Mar 2022 00:34:31 +0000 (01:34 +0100)]
Rollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, r=wesleywiser

debuginfo: Fix debuginfo for Box<T> where T is unsized.

Before this fix, the debuginfo for the fields was generated from the struct defintion of Box<T>, but (at least at the moment) the compiler pretends that Box<T> is just a (fat) pointer, so the fields need to be `pointer` and `vtable` instead of `__0: Unique<T>` and `__1: Allocator`.

This is meant as a temporary mitigation until we can make sure that simply treating Box as a regular struct in debuginfo does not cause too much breakage in the ecosystem.

r? ````@wesleywiser````

2 years agoRollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnr
Dylan DPC [Fri, 25 Mar 2022 00:34:30 +0000 (01:34 +0100)]
Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnr

Try to evaluate in try unify and postpone resolution of constants that contain inference variables

We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables.

r? `@lcnr`

2 years agoRollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obk
Dylan DPC [Fri, 25 Mar 2022 00:34:29 +0000 (01:34 +0100)]
Rollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obk

Clarify which kinds of MIR are allowed during which phases.

This enhances documentation with these details and extends the validator to check these requirements more thoroughly. Most of these conditions were already being checked.

There was also some disagreement between the `MirPhase` docs and validator as to what it meant for the `body.phase` field to have a certain value. This PR resolves those disagreements in favor of the `MirPhase` docs (which is what the pass manager implemented), adjusting the validator accordingly. The result is now that the `DropLowering` phase begins with the end of the elaborate drops pass, and lasts until the beginning of the generator lowring pass. This doesn't feel entirely natural to me, but as long as it's documented accurately it should be ok.

r? rust-lang/mir-opt

2 years agoRollup merge of #94391 - light4:issue-90319, r=estebank
Dylan DPC [Fri, 25 Mar 2022 00:34:28 +0000 (01:34 +0100)]
Rollup merge of #94391 - light4:issue-90319, r=estebank

Fix ice when error reporting recursion errors

Fixes: #90319, #92148, #93955
2 years agoresolve: Rename `CrateLint` to `Finalize`
Vadim Petrochenkov [Wed, 23 Mar 2022 23:55:22 +0000 (02:55 +0300)]
resolve: Rename `CrateLint` to `Finalize`

And `crate_lint`/`record_used` to `finalize`

2 years agoresolve: Stop passing unused spans and node ids to path resolution functions
Vadim Petrochenkov [Wed, 23 Mar 2022 21:32:00 +0000 (00:32 +0300)]
resolve: Stop passing unused spans and node ids to path resolution functions

2 years agoresolve: Optimize path resolution for rustdoc
Vadim Petrochenkov [Wed, 23 Mar 2022 21:03:12 +0000 (00:03 +0300)]
resolve: Optimize path resolution for rustdoc

Do not construct or pass unused data

2 years agoresolve: Do not build expensive suggestions if they are not actually used
Vadim Petrochenkov [Wed, 23 Mar 2022 19:47:19 +0000 (22:47 +0300)]
resolve: Do not build expensive suggestions if they are not actually used

Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.

2 years agoAuto merge of #95273 - flip1995:clippyup, r=manishearth
bors [Thu, 24 Mar 2022 22:52:34 +0000 (22:52 +0000)]
Auto merge of #95273 - flip1995:clippyup, r=manishearth

Update Clippy

r? `@Manishearth`

2 years agoImplement impl_subject_and_oblig instead of repeating the impls
Santiago Pastorino [Thu, 24 Mar 2022 21:41:30 +0000 (18:41 -0300)]
Implement impl_subject_and_oblig instead of repeating the impls

2 years agoWhere bounds are checked on inherent impls
Santiago Pastorino [Thu, 24 Mar 2022 20:47:10 +0000 (17:47 -0300)]
Where bounds are checked on inherent impls

2 years agoAuto merge of #94934 - Lireer:const-prop-lint, r=oli-obk
bors [Thu, 24 Mar 2022 20:22:27 +0000 (20:22 +0000)]
Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obk

Separate const prop lints from optimizations

r? `@oli-obk`

Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup.
Thanks to `@oli-obk` for mentoring me.

2 years agoSwap DtorckConstraint to DropckConstraint
InfRandomness [Thu, 24 Mar 2022 18:21:41 +0000 (19:21 +0100)]
Swap DtorckConstraint to DropckConstraint

This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.

2 years agoupdate Miri
Ralf Jung [Thu, 24 Mar 2022 19:05:27 +0000 (15:05 -0400)]
update Miri

2 years agoFix ice when error reporting recursion errors
lightning1141 [Sat, 26 Feb 2022 03:55:07 +0000 (11:55 +0800)]
Fix ice when error reporting recursion errors

Fixes: #90319, #92148, #93955
2 years agoAuto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_two, r=yaahc
bors [Thu, 24 Mar 2022 17:32:40 +0000 (17:32 +0000)]
Auto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_two, r=yaahc

Mark `uint::wrapping_next_power_of_two` as `#[inline]`

This brings it in line with `next_power_of_two` and `checked_next_power_of_two`

https://godbolt.org/z/Tr18GnqKj

<details>
<summary> Output as of `rustc 1.61.0-nightly (4ce374923 2022-02-28)` </summary>

```asm
example::npot:
        lea     eax, [rdi - 1]
        movzx   eax, al
        lzcnt   ecx, eax
        add     ecx, -24
        mov     al, -1
        shr     al, cl
        inc     al
        cmp     dil, 2
        movzx   ecx, al
        mov     eax, 1
        cmovae  eax, ecx
        ret

example::cnpot:
        lea     eax, [rdi - 1]
        movzx   eax, al
        lzcnt   ecx, eax
        add     ecx, -24
        mov     al, -1
        shr     al, cl
        xor     ecx, ecx
        cmp     dil, 2
        movzx   edx, al
        cmovb   edx, ecx
        inc     dl
        setne   al
        ret

example::wrapping_next_power_of_two:
        jmp     qword ptr [rip + _ZN4core3num20_$LT$impl$u20$u8$GT$26wrapping_next_power_of_two17hd879a85055735264E@GOTPCREL]
```

</details>

2 years agoadd diagnostic items for clippy's
Max Baumann [Thu, 24 Mar 2022 16:05:47 +0000 (17:05 +0100)]
add diagnostic items for clippy's

2 years agoNormalize both trait and inherent
Santiago Pastorino [Thu, 24 Mar 2022 17:17:54 +0000 (14:17 -0300)]
Normalize both trait and inherent

2 years agoExtract impl_subject_and_oglibations fn and make equate receive subjects
Santiago Pastorino [Thu, 24 Mar 2022 15:27:09 +0000 (12:27 -0300)]
Extract impl_subject_and_oglibations fn and make equate receive subjects

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Thu, 13 Jan 2022 13:57:57 +0000 (14:57 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoMerge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup
flip1995 [Thu, 24 Mar 2022 13:50:04 +0000 (14:50 +0100)]
Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup

2 years agoAuto merge of #8580 - flip1995:rustup, r=flip1995
bors [Thu, 24 Mar 2022 13:29:13 +0000 (13:29 +0000)]
Auto merge of #8580 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

Nice small sync with only typo fixes

changelog: none

2 years agoBump nightly version -> 2022-03-24
flip1995 [Thu, 24 Mar 2022 13:22:43 +0000 (14:22 +0100)]
Bump nightly version -> 2022-03-24

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 24 Mar 2022 13:13:37 +0000 (14:13 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #8579 - yoav-lavi:squashed-master, r=flip1995
bors [Thu, 24 Mar 2022 12:57:08 +0000 (12:57 +0000)]
Auto merge of #8579 - yoav-lavi:squashed-master, r=flip1995

`unnecessary_join` lint

changelog: Adds a lint called ``[`unnecessary_join`]`` that detects cases of `.collect::<Vec<String>>.join("")` or `.collect::<Vec<_>>.join("")` on an iterator, suggesting `.collect::<String>()` instead

Fixes: https://github.com/rust-lang/rust-clippy/issues/8570
This is a reopen of https://github.com/rust-lang/rust-clippy/pull/8573

changelog: add lint [`unnecessary_join`]

2 years agoAuto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnr
bors [Thu, 24 Mar 2022 12:50:00 +0000 (12:50 +0000)]
Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnr

Change Thir to lazily create constants

To allow `AbstractConst`s to work with the previous thir changes we made and those we want to make, i.e. to avoid problems due to `ValTree` and `ConstValue` conversions, we instead switch to a thir representation for constants that allows us to lazily create constants.

r? `@oli-obk`

2 years ago`unnecessary_join` lint
Yoav Lavi [Thu, 24 Mar 2022 12:18:18 +0000 (13:18 +0100)]
`unnecessary_join` lint

2 years agoupdate clippy stderr file
Oli Scherer [Thu, 24 Mar 2022 11:27:07 +0000 (11:27 +0000)]
update clippy stderr file

2 years agoAuto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obk
bors [Thu, 24 Mar 2022 10:24:54 +0000 (10:24 +0000)]
Auto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obk

Properly track `ImplObligations`

Instead of probing for all possible `impl`s that could have caused an
`ImplObligation`, keep track of its `DefId` and obligation spans for
accurate error reporting.

Follow to #89580. Addresses #89418.

2 years agodebuginfo: Fix debuginfo for Box<T> where T is unsized.
Michael Woerister [Thu, 24 Mar 2022 09:59:28 +0000 (10:59 +0100)]
debuginfo: Fix debuginfo for Box<T> where T is unsized.

Before this fix, the debuginfo for the fields was generated from the
struct defintion of Box<T>, but (at least at the moment) the compiler
pretends that Box<T> is just a (fat) pointer, so the fields need to be
`pointer` and `vtable` instead of `__0: Unique<T>` and `__1: Allocator`.

This is meant as a temporary mitigation until we can make sure that
simply treating Box as a regular struct in debuginfo does not cause too
much breakage in the ecosystem.

2 years agoAuto merge of #95233 - compiler-errors:chalk-up, r=jackh726
bors [Thu, 24 Mar 2022 06:05:30 +0000 (06:05 +0000)]
Auto merge of #95233 - compiler-errors:chalk-up, r=jackh726

Upgrade chalk to `0.80.0`

r? `@jackh726`

2 years agomake rustc work again
Michael Goulet [Thu, 24 Mar 2022 04:52:17 +0000 (21:52 -0700)]
make rustc work again

2 years agoProperly track `ImplObligation`s
Esteban Kuber [Wed, 13 Oct 2021 13:58:41 +0000 (13:58 +0000)]
Properly track `ImplObligation`s

Instead of probing for all possible impls that could have caused an
`ImplObligation`, keep track of its `DefId` and obligation spans for
accurate error reporting.

Follow up to #89580. Addresses #89418.

Remove some unnecessary clones.

Tweak output for auto trait impl obligations.

2 years agoAuto merge of #87667 - the8472:document-in-place-iter, r=yaahc
bors [Thu, 24 Mar 2022 01:43:21 +0000 (01:43 +0000)]
Auto merge of #87667 - the8472:document-in-place-iter, r=yaahc

add module-level documentation for vec's in-place iteration

As requested in the last libs team meeting and during previous reviews.

Feel free to point out any gaps you encounter, after all non-obvious things may with hindsight seem obvious to me.

r? `@yaahc`

CC `@steffahn`

2 years agoAuto merge of #95250 - matthiaskrgr:rollup-ma4zl69, r=matthiaskrgr
bors [Wed, 23 Mar 2022 23:02:17 +0000 (23:02 +0000)]
Auto merge of #95250 - matthiaskrgr:rollup-ma4zl69, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #94249 (Better errors when a Copy impl on a Struct is not self-consistent)
 - #95069 (Fix auto traits in rustdoc)
 - #95221 (interpret/memory: simplify check_and_deref_ptr)
 - #95225 (remove `[async output]` from `impl Future` pretty-printing)
 - #95238 (Stop emitting E0026 for struct enums with underscores)

Failed merges:

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

2 years agoClarify more MIR docs
Jakob Degen [Sun, 6 Mar 2022 20:53:23 +0000 (15:53 -0500)]
Clarify more MIR docs

2 years agoClarify which kinds of MIR are allowed during which phases.
Jakob Degen [Sun, 6 Mar 2022 01:37:04 +0000 (20:37 -0500)]
Clarify which kinds of MIR are allowed during which phases.

This enhances documentation with these details and extends the validator to check these requirements
more thoroughly. As a part of this, we add a new `Deaggregated` phase, and rename other phases so
that their names more naturally correspond to what they represent.

2 years agoRollup merge of #95238 - TaKO8Ki:stop-emitting-E0026-for-struct-enum-with-underscore...
Matthias Krüger [Wed, 23 Mar 2022 21:13:26 +0000 (22:13 +0100)]
Rollup merge of #95238 - TaKO8Ki:stop-emitting-E0026-for-struct-enum-with-underscore, r=estebank

Stop emitting E0026 for struct enums with underscores

This patch resolves a part of #83263;

r? `@estebank`

2 years agoRollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obk
Matthias Krüger [Wed, 23 Mar 2022 21:13:25 +0000 (22:13 +0100)]
Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obk

remove `[async output]` from `impl Future` pretty-printing

self-explanatory, guess it's not as helpful as I thought when I added it 4 months ago
re https://github.com/rust-lang/rust/issues/95089#issuecomment-1075482851

2 years agoRollup merge of #95221 - RalfJung:check_and_deref_ptr, r=oli-obk
Matthias Krüger [Wed, 23 Mar 2022 21:13:24 +0000 (22:13 +0100)]
Rollup merge of #95221 - RalfJung:check_and_deref_ptr, r=oli-obk

interpret/memory: simplify check_and_deref_ptr

*Finally* I saw a way to make this code simpler. The odd preprocessing in `let ptr_or_addr =` has bothered me since forever, but it actually became unnecessary in the last provenance refactoring. :)

This also leads to slightly more explicit error messages as a nice side-effect. :tada:

r? `@oli-obk`

2 years agoRollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obk
Matthias Krüger [Wed, 23 Mar 2022 21:13:23 +0000 (22:13 +0100)]
Rollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obk

Fix auto traits in rustdoc

Fixes #90324.

cc `@matthewjasper`
r? `@Aaron1011`

2 years agoRollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwco
Matthias Krüger [Wed, 23 Mar 2022 21:13:22 +0000 (22:13 +0100)]
Rollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwco

Better errors when a Copy impl on a Struct is not self-consistent

As discovered in a Zulip thread with `@nnethercote` and `@Mark-Simulacrum,` it's not immediately obvious why a field on an ADT doesn't implement `Copy`.  This PR attempts to give slightly more detailed information by spinning up a fulfillment context to try to dig down and discover transitive fulfillment errors that cause `is_copy_modulo_regions` to fail on a ADT field.

The error message still kinda sucks, but should only show up in the case that an existing error message was totally missing... so I think it's a good compromise for now?

2 years agoAuto merge of #95247 - cuviper:llvm14, r=nikic
bors [Wed, 23 Mar 2022 20:18:53 +0000 (20:18 +0000)]
Auto merge of #95247 - cuviper:llvm14, r=nikic

Update to LLVM 14.0.0 final

This is a simple rebase of the submodule onto the `llvmorg-14.0.0` release tag.

r? `@nikic`

2 years agofix some links, clarify documentation based on review feedback
The 8472 [Wed, 23 Mar 2022 19:57:49 +0000 (20:57 +0100)]
fix some links, clarify documentation based on review feedback

2 years agodont use a query for lit_to_constant
b-naber [Wed, 23 Mar 2022 18:41:35 +0000 (19:41 +0100)]
dont use a query for lit_to_constant

2 years agoUpdate to LLVM 14.0.0 final
Josh Stone [Wed, 23 Mar 2022 18:42:13 +0000 (11:42 -0700)]
Update to LLVM 14.0.0 final

2 years agoAddress rebase fallout
Oli Scherer [Wed, 23 Mar 2022 17:01:04 +0000 (17:01 +0000)]
Address rebase fallout

2 years agoAuto merge of #95220 - rust-lang:notriddle/ast-validation-semicolon, r=Dylan-DPC
bors [Wed, 23 Mar 2022 16:53:47 +0000 (16:53 +0000)]
Auto merge of #95220 - rust-lang:notriddle/ast-validation-semicolon, r=Dylan-DPC

diagnostics: do not suggest `fn foo({ <body> }`

Instead of suggesting that the body always replace the last character on the line, presuming it must be a semicolon, the parser should instead check what the last character is, and append the body if it is anything else.

Fixes #83104

2 years agoUpdate allocation id
Oli Scherer [Tue, 15 Mar 2022 16:30:54 +0000 (16:30 +0000)]
Update allocation id

2 years agoRemove line instead of just commenting out
Carl Scherer [Mon, 14 Mar 2022 16:26:09 +0000 (17:26 +0100)]
Remove line instead of just commenting out

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2 years agoremove optimizations from const_prop_lint
Carl Scherer [Fri, 11 Mar 2022 14:52:58 +0000 (14:52 +0000)]
remove optimizations from const_prop_lint

2 years agoseparate const prop lint from optimizations
Carl Scherer [Tue, 8 Mar 2022 17:20:31 +0000 (17:20 +0000)]
separate const prop lint from optimizations

2 years agoAuto merge of #94901 - fee1-dead:destructable, r=oli-obk
bors [Wed, 23 Mar 2022 14:04:38 +0000 (14:04 +0000)]
Auto merge of #94901 - fee1-dead:destructable, r=oli-obk

Rename `~const Drop` to `~const Destruct`

r? `@oli-obk`

Completely switching to `~const Destructible` would be rather complicated, so it seems best to add it for now and wait for it to be backported to beta in the next release.

The rationale is to prevent complications such as #92149 and #94803 by introducing an entirely new trait. And `~const Destructible` reads a bit better than `~const Drop`. Name Bikesheddable.

2 years agostop emitting E0026 for struct enums with underscores
Takayuki Maeda [Wed, 23 Mar 2022 13:54:02 +0000 (22:54 +0900)]
stop emitting E0026 for struct enums with underscores

2 years agoAuto merge of #95235 - asquared31415:ptr_eq_typo, r=Dylan-DPC
bors [Wed, 23 Mar 2022 11:21:04 +0000 (11:21 +0000)]
Auto merge of #95235 - asquared31415:ptr_eq_typo, r=Dylan-DPC

Fix `core::ptr::guaranteed_eq` and `guaranteed_ne` docs typo

2 years agoadd test for treating ExprKind::ConstParam as temp
b-naber [Wed, 23 Mar 2022 07:54:07 +0000 (08:54 +0100)]
add test for treating ExprKind::ConstParam as temp

2 years agouse NonHirLiteral instead of ScalarLiteral, move pattern related code to pat_is_poly...
b-naber [Wed, 23 Mar 2022 07:47:11 +0000 (08:47 +0100)]
use NonHirLiteral instead of ScalarLiteral, move pattern related code to pat_is_poly in IsThirPolymorphic

2 years agomove ExprKind::Repeat arm to expr_is_poly
b-naber [Wed, 16 Mar 2022 08:25:17 +0000 (09:25 +0100)]
move ExprKind::Repeat arm to expr_is_poly

2 years agouse ParamConst in ExprKind::ConstParam
b-naber [Tue, 15 Mar 2022 15:32:40 +0000 (16:32 +0100)]
use ParamConst in ExprKind::ConstParam

2 years agoremove thir::Visitor::visit_const
b-naber [Tue, 15 Mar 2022 15:20:46 +0000 (16:20 +0100)]
remove thir::Visitor::visit_const

2 years agochange thir to lazily create constants
b-naber [Fri, 11 Mar 2022 11:07:53 +0000 (12:07 +0100)]
change thir to lazily create constants

2 years agoAuto merge of #95232 - lnicola:rust-analyzer-2022-03-23, r=lnicola
bors [Wed, 23 Mar 2022 08:54:31 +0000 (08:54 +0000)]
Auto merge of #95232 - lnicola:rust-analyzer-2022-03-23, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

2 years agoptr::guaranteed_eq doc typo
asquared31415 [Wed, 23 Mar 2022 08:21:50 +0000 (04:21 -0400)]
ptr::guaranteed_eq doc typo

2 years agoupgrade chalk
Michael Goulet [Wed, 23 Mar 2022 06:39:11 +0000 (23:39 -0700)]
upgrade chalk