about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-03-29Add type for slices in ValTreesb-naber-2/+30
2022-03-28Remove opaque type obligation and just register opaque types as they are ↵Oli Scherer-20/+0
encountered. This also registers obligations for the hidden type immediately.
2022-03-28Have the spans of TAIT type conflict errors point to the actual site instead ↵Oli Scherer-2/+34
of the owning function
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-26/+74
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-28Auto merge of #95333 - GuillaumeGomez:auto-trait-perf-issue, r=oli-obkbors-0/+9
Fix perf issue for auto trait selection Follow-up of https://github.com/rust-lang/rust/pull/95069 which fixes the perf issue introduced by it. r? `@oli-obk`
2022-03-27Rollup merge of #95120 - smoelius:backward-switch-int, r=ecstatic-morseDylan DPC-0/+95
Implement `apply_switch_int_edge_effects` for backward analyses See #94576 for some discussion. r? `@ecstatic-morse`
2022-03-26Do not use ParamEnv::and to cache param-env with candidateMichael Goulet-3/+10
2022-03-26Fix perf issue for auto trait selectionGuillaume Gomez-0/+9
2022-03-26Address review commentsSamuel E. Moelius III-0/+95
* Add lazily computed `switch_sources` data structure * Don't assume a target has only one associated value
2022-03-26Auto merge of #95149 - cjgillot:once-diag, r=estebankbors-63/+26
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 #95280 - InfRandomness:infrandomness/Dtorck_clarification, ↵bors-10/+10
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-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-3/+40
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-5/+16
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-17/+54
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-2/+15
Fix ice when error reporting recursion errors Fixes: #90319, #92148, #93955
2022-03-24Swap DtorckConstraint to DropckConstraintInfRandomness-10/+10
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-2/+15
Fixes: #90319, #92148, #93955
2022-03-24Extract impl_subject_and_oglibations fn and make equate receive subjectsSantiago Pastorino-2/+27
2022-03-24Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnrbors-18/+34
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-7/+20
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-23Better suggestions for Fn trait selection errorsMichael Goulet-3/+15
2022-03-24Properly track `ImplObligation`sEsteban Kuber-7/+20
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-17/+39
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 #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-23dont use a query for lit_to_constantb-naber-4/+0
2022-03-23use NonHirLiteral instead of ScalarLiteral, move pattern related code to ↵b-naber-3/+3
pat_is_poly in IsThirPolymorphic
2022-03-23use ParamConst in ExprKind::ConstParamb-naber-2/+2
2022-03-23remove thir::Visitor::visit_constb-naber-12/+4
2022-03-23change thir to lazily create constantsb-naber-8/+36
2022-03-22remove [async output] from impl FutureMichael Goulet-16/+21
2022-03-22erase region in ParamEnvAnd and make ConstUnifyCtxt privateb-naber-1/+4
2022-03-22impl_header -> impl_subjectSantiago Pastorino-1/+1
2022-03-22fix previous failures and address reviewb-naber-1/+1
2022-03-21stall on on constants that contain infer vars in const_eval_resolveb-naber-0/+8
2022-03-21try to evaluate in try_unifyb-naber-5/+5
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-12/+15
2022-03-20fix two comments referring to moved code (rustc_mir_transform::generator)Audun Halland-1/+1
2022-03-20Filter OnceNote in diagnostic infra.Camille GILLOT-63/+26
2022-03-20Extract ImplSubject informationSantiago Pastorino-2/+14
2022-03-18Rollup merge of #95039 - spastorino:overlap-super-predicates, r=nikomatsakisMatthias Krüger-0/+7
Make negative coherence work when there's impl negative on super predicates r? `@nikomatsakis`
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-4/+4
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-17Add comments on PolaritySantiago Pastorino-0/+7
2022-03-16rustc_error: make ErrorReported impossible to constructmark-28/+53
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-4/+4
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-15Rollup merge of #94958 - est31:pluralize, r=oli-obkMatthias Krüger-2/+2
Support other types of pluralization in pluralize macro
2022-03-15Rollup merge of #94947 - Dylan-DPC:fix/typos, r=oli-obkMatthias Krüger-2/+2
fix typos Rework of #94603 which got closed as I was trying to unmerge and repush. This is a subset of changes from the original pr as I sed'd whatever typos I remembered from the original PR thanks to `@cuishuang` for the original PR
2022-03-15Support other types of pluralization in pluralize macroest31-2/+2
2022-03-15Auto merge of #94928 - lcnr:inline-as_substs, r=michaelwoeristerbors-0/+1
inline `tuple_fields` more https://github.com/rust-lang/rust/pull/93505 fun, after this i have no idea what might be causing the perf impact.
2022-03-15fix typosDylan DPC-2/+2