Commit Graph

165098 Commits

Author SHA1 Message Date
DrMeepster
ece64ed3f5 check the the right field 2022-03-26 00:08:51 -07:00
DrMeepster
e9f08e709d fix wrong header command 2022-03-25 23:46:37 -07:00
DrMeepster
46dadfc142 widen special case on deref to all non-zst allocators 2022-03-25 23:16:23 -07:00
bors
d4acac935b 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`
2022-03-26 03:19:49 +00:00
bors
c74925438c 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.
2022-03-26 00:54:54 +00:00
bors
a2ebd5a1f1 Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
Reduce wait-for instructions for rustdoc GUI tests

r? `@notriddle`
2022-03-25 22:16:44 +00:00
Guillaume Gomez
e0a697aad4 Replace wait-for instructions for rustdoc GUI tests with wait-for-css 2022-03-25 21:32:16 +01:00
Guillaume Gomez
98d51960c4 Update browser-ui-test version to 0.8.4 2022-03-25 21:12:31 +01:00
bors
d53246fedd 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.
2022-03-25 19:47:19 +00:00
bors
3fe3b89cd5 Auto merge of #95282 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/95258
r? `@ghost`
2022-03-25 16:45:08 +00:00
bors
09be68c869 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
2022-03-25 14:16:13 +00:00
Michael Woerister
e5b9430578 incr. comp.: Let compiler retry finalizing session directory a few times.
See https://github.com/rust-lang/rust/issues/86929.
2022-03-25 14:14:26 +01:00
Camille GILLOT
f7d5b7afb7 Bless rustdoc tests. 2022-03-25 12:50:48 +01:00
bors
903427b2e8 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.
2022-03-25 11:35:19 +00:00
Martin Kröning
335d196498 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
2022-03-25 11:52:11 +01:00
bors
e70e211e99 Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakis
Overlap inherent impls

r? `@nikomatsakis`

Closes #94526
2022-03-25 09:09:48 +00:00
bors
8a0c55046c 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`
2022-03-25 06:28:58 +00:00
bors
4ce257ff19 Auto merge of #92361 - vacuus:doctest-run-test-out-lines, r=CraftSpider
Remove `collect` in `doctest::run_test`
2022-03-25 04:01:00 +00:00
Nicholas Nethercote
fdec26ddad 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.
2022-03-25 12:35:56 +11:00
Nicholas Nethercote
cad5f1e774 Shrink NamedMatchVec to one inline element.
This counters the `NamedMatchVec` size increase from the previous
commit, leaving `NamedMatchVec` smaller than before.
2022-03-25 12:35:56 +11:00
Nicholas Nethercote
6817442ec7 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.
2022-03-25 12:35:52 +11:00
bors
661e8beec1 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
2022-03-25 01:20:01 +00:00
Dylan DPC
3716c4275f
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`
2022-03-25 01:34:32 +01:00
Dylan DPC
e039dc813b
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````
2022-03-25 01:34:31 +01:00
Dylan DPC
1fcb8fc3e0
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`
2022-03-25 01:34:30 +01:00
Dylan DPC
c66e0c8726
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
2022-03-25 01:34:29 +01:00
Dylan DPC
d1d4613ead
Rollup merge of #94391 - light4:issue-90319, r=estebank
Fix ice when error reporting recursion errors

Fixes: #90319, #92148, #93955
2022-03-25 01:34:28 +01:00
Vadim Petrochenkov
1ad64a23d4 resolve: Rename CrateLint to Finalize
And `crate_lint`/`record_used` to `finalize`
2022-03-25 02:03:54 +03:00
Vadim Petrochenkov
74d079d566 resolve: Stop passing unused spans and node ids to path resolution functions 2022-03-25 02:03:54 +03:00
Vadim Petrochenkov
15a8b981e0 resolve: Optimize path resolution for rustdoc
Do not construct or pass unused data
2022-03-25 02:03:54 +03:00
Vadim Petrochenkov
0749ec67bc 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`.
2022-03-25 02:03:54 +03:00
bors
7941b3f147 Auto merge of #95273 - flip1995:clippyup, r=manishearth
Update Clippy

r? `@Manishearth`
2022-03-24 22:52:34 +00:00
Santiago Pastorino
42e986f77b
Implement impl_subject_and_oblig instead of repeating the impls 2022-03-24 18:41:30 -03:00
Santiago Pastorino
d96faef913
Where bounds are checked on inherent impls 2022-03-24 17:47:10 -03:00
bors
63b8f01bb5 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.
2022-03-24 20:22:27 +00:00
InfRandomness
645620b3b3 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.
2022-03-24 20:35:35 +01:00
Ralf Jung
189409bea9 update Miri 2022-03-24 15:05:35 -04:00
lightning1141
85e67b9a59
Fix ice when error reporting recursion errors
Fixes: #90319, #92148, #93955
2022-03-25 02:53:30 +08:00
bors
4b133a7e27 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>
2022-03-24 17:32:40 +00:00
Max Baumann
64ad96dd9a
add diagnostic items for clippy's 2022-03-24 18:18:44 +01:00
Santiago Pastorino
f4bd1e14bd
Normalize both trait and inherent 2022-03-24 14:17:54 -03:00
Santiago Pastorino
22b311bd82
Extract impl_subject_and_oglibations fn and make equate receive subjects 2022-03-24 12:44:06 -03:00
flip1995
3365e9a120
Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup 2022-03-24 14:50:04 +01:00
bors
d0cf3481a8 Auto merge of #8580 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

Nice small sync with only typo fixes

changelog: none
2022-03-24 13:29:13 +00:00
flip1995
c995a8b501
Bump nightly version -> 2022-03-24 2022-03-24 14:22:43 +01:00
flip1995
1147b2c481
Merge remote-tracking branch 'upstream/master' into rustup 2022-03-24 14:22:35 +01:00
bors
e29b3b55a4 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`]
2022-03-24 12:57:08 +00:00
bors
8d8135f003 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`
2022-03-24 12:50:00 +00:00
Yoav Lavi
b60a7fb7b6
unnecessary_join lint 2022-03-24 13:18:18 +01:00
Oli Scherer
440946af11 update clippy stderr file 2022-03-24 11:27:07 +00:00