about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2022-03-26Auto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPCbors-120/+85
Prettify rustc_session with recent conveniences No functional changes. I felt like making something beautiful.
2022-03-26Auto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplettbors-62/+0
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-26Auto merge of #95149 - cjgillot:once-diag, r=estebankbors-252/+169
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-25Auto merge of #95304 - michaelwoerister:retry-finalize-session-dir, r=oli-obkbors-2/+23
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-25Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, ↵bors-19/+19
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-25incr. comp.: Let compiler retry finalizing session directory a few times.Michael Woerister-2/+23
See https://github.com/rust-lang/rust/issues/86929.
2022-03-25Auto merge of #95255 - petrochenkov:suggresolve, r=michaelwoeristerbors-600/+415
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-25Remove hermitkernel targetsMartin Kröning-62/+0
RustyHermit now maintains custom json targets, which are distributed with the kernel. [1] [1]: https://github.com/hermitcore/libhermit-rs/pull/395
2022-03-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-65/+130
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-25Auto merge of #95259 - nnethercote:more-macro-expansion-optimizations, ↵bors-86/+101
r=petrochenkov More macro expansion optimizations A few nice wins for macro-heavy crates. r? `@petrochenkov`
2022-03-24Use a let-chain in _session::output (nfc)Jubilee Young-15/+10
2022-03-24Vigorously refactor _session::code_stats (nfc)Jubilee Young-19/+11
2022-03-24Prettify rustc_session fmt with capturing args (nfc)Jubilee Young-86/+64
2022-03-25Shrink `MatcherPosRepetition`.Nicholas Nethercote-15/+13
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-25Shrink `NamedMatchVec` to one inline element.Nicholas Nethercote-2/+5
This counters the `NamedMatchVec` size increase from the previous commit, leaving `NamedMatchVec` smaller than before.
2022-03-25Split `NamedMatch::MatchNonterminal` in two.Nicholas Nethercote-71/+81
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-25Rollup merge of #95276 - FoseFx:clippy_trim_split_whitespace, r=flip1995Dylan DPC-0/+4
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-25Rollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, ↵Dylan DPC-1/+18
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-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-92/+163
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-25Rollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obkDylan DPC-52/+113
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-25Rollup merge of #94391 - light4:issue-90319, r=estebankDylan DPC-14/+40
Fix ice when error reporting recursion errors Fixes: #90319, #92148, #93955
2022-03-25resolve: Rename `CrateLint` to `Finalize`Vadim Petrochenkov-170/+147
And `crate_lint`/`record_used` to `finalize`
2022-03-25resolve: Stop passing unused spans and node ids to path resolution functionsVadim Petrochenkov-267/+188
2022-03-25resolve: Optimize path resolution for rustdocVadim Petrochenkov-59/+16
Do not construct or pass unused data
2022-03-25resolve: Do not build expensive suggestions if they are not actually usedVadim Petrochenkov-255/+215
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-24Implement impl_subject_and_oblig instead of repeating the implsSantiago Pastorino-74/+26
2022-03-24Where bounds are checked on inherent implsSantiago Pastorino-2/+36
2022-03-24Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obkbors-177/+1060
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-24Swap DtorckConstraint to DropckConstraintInfRandomness-19/+19
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-25Fix ice when error reporting recursion errorslightning1141-14/+40
Fixes: #90319, #92148, #93955
2022-03-24add diagnostic items for clippy'sMax Baumann-0/+4
2022-03-24Normalize both trait and inherentSantiago Pastorino-16/+9
2022-03-24Extract impl_subject_and_oglibations fn and make equate receive subjectsSantiago Pastorino-46/+93
2022-03-24Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnrbors-155/+304
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-24Auto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obkbors-166/+337
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.
2022-03-24debuginfo: Fix debuginfo for Box<T> where T is unsized.Michael Woerister-1/+18
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.
2022-03-24Auto merge of #95233 - compiler-errors:chalk-up, r=jackh726bors-14/+41
Upgrade chalk to `0.80.0` r? `@jackh726`
2022-03-23make rustc work againMichael Goulet-10/+37
2022-03-24Properly track `ImplObligation`sEsteban Kuber-166/+337
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.
2022-03-23Clarify more MIR docsJakob Degen-0/+15
2022-03-23Clarify which kinds of MIR are allowed during which phases.Jakob Degen-52/+98
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.
2022-03-23Rollup merge of #95238 - ↵Matthias Krüger-2/+4
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`
2022-03-23Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obkMatthias Krüger-16/+21
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
2022-03-23Rollup merge of #95221 - RalfJung:check_and_deref_ptr, r=oli-obkMatthias Krüger-15/+5
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`
2022-03-23Rollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obkMatthias Krüger-2/+2
Fix auto traits in rustdoc Fixes #90324. cc `@matthewjasper` r? `@Aaron1011`
2022-03-23Rollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwcoMatthias Krüger-4/+36
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?
2022-03-23dont use a query for lit_to_constantb-naber-18/+9
2022-03-23Address rebase falloutOli Scherer-3/+3
2022-03-23Auto merge of #95220 - rust-lang:notriddle/ast-validation-semicolon, r=Dylan-DPCbors-1/+8
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
2022-03-23remove optimizations from const_prop_lintCarl Scherer-281/+21