summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/coherence
AgeCommit message (Collapse)AuthorLines
2023-04-12region error cleanuplcnr-4/+2
- require `TypeErrCtxt` to always result in an error - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - merge `process_registered_region_obligations` into `resolve_regions`
2023-04-09Small clippy::correctness fixesNilstrieb-1/+1
Nothing was really incorrect before, but it did get nicer.
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-2/+1
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-23Auto merge of #109202 - compiler-errors:new-solver-fast-reject-faster-2, r=lcnrbors-13/+3
Don't pass `TreatProjections` separately to `fast_reject` Don't pass `TreatProjections` separately to `fast_reject`, and instead use the original approach of switching on two variants of `TreatParams` (undoes this: https://github.com/rust-lang/rust/pull/108830#pullrequestreview-1330371417). Fixes the regression introduced in https://github.com/rust-lang/rust/pull/108830#issuecomment-1468116419
2023-03-23Don't split up TreatProjections and TreatParams anymoreMichael Goulet-13/+3
2023-03-23Rollup merge of #107718 - Zoxc:z-time, r=nnethercoteMatthias Krüger-2/+2
Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes` This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
2023-03-22Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errorsbors-15/+18
a general type system cleanup removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context. changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR. also removes some other small - and imo unnecessary - helpers. r? types
2023-03-21Reduce output spamJohn Kåre Alsaker-2/+2
2023-03-21Use local key in providersMichael Goulet-9/+4
2023-03-21remove some trait solver helperslcnr-15/+18
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
2023-03-15always make `define_opaque_types` explicitlcnr-4/+7
2023-03-13Better names?Michael Goulet-5/+8
2023-03-13Treat projections with infer as placeholder during fast reject in new solverMichael Goulet-3/+10
2023-03-09Remove body_def_id from InheritedMichael Goulet-2/+2
2023-03-08Dedup copy field errors for identical typesMichael Goulet-0/+8
2023-03-08may not => cannotMichael Goulet-1/+1
2023-03-06emit the suspicious_auto_trait_impls for negative impls as wellMu42-4/+0
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-1/+1
r=compiler-errors,davidtwco,estebank,oli-obk diagnostics: if AssocFn has self argument, describe as method Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods. For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods> > Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation. In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-22Remove type-traversal trait aliasesAlan Egerton-3/+4
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-1/+1
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
2023-02-17Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstriebbors-7/+7
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref r? `@ghost`
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-6/+6
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-6/+6
2023-02-15Copy `ty::AssocItem` all other the placeMaybe Waffle-7/+7
2023-02-14Move query out of path.Camille GILLOT-2/+7
2023-02-14Even less HIR.Camille GILLOT-19/+20
2023-02-14Do not fetch HIR for inherent impls.Camille GILLOT-56/+36
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-02-13Rollup merge of #107942 - compiler-errors:tighter-inherent-impl-bad-spans, ↵Matthias Krüger-16/+17
r=Nilstrieb Tighter spans for bad inherent `impl` self types Self-explanatory
2023-02-13Tighter spans for bad inherent impl typesMichael Goulet-16/+17
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-02-06Modify existing bounds if they existEdward Shen-0/+1
2023-02-03Autotrait bounds on dyn-safe trait methodsDavid Tolnay-0/+22
2023-02-03Disallow impl autotrait for trait objectDavid Tolnay-40/+161
2023-01-30Rollup merge of #107125 - ↵Matthias Krüger-4/+2
WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb Add and use expect methods to hir. [The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462). r? `@Nilstrieb` tbh I'm not even sure if it's worth it
2023-01-28Rename `is_object_safe` to `check_is_object_safe` to hint side effectsGary Guo-1/+1
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-0/+1
2023-01-23fix: use LocalDefId instead of HirId in trait resVincenzo Palazzo-7/+4
use LocalDefId instead of HirId in trait resolution to simplify the obligation clause resolution Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-20Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnrbors-44/+66
Check ADT fields for copy implementations considering regions Fixes #88901 r? `@ghost`
2023-01-20Add and use expect methods to hir.Maybe Waffle-4/+2
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-14/+10
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-3/+3
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-2/+2
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-2/+2
2023-01-17`rustc_hir_analysis`: remove `ref` patternsMaybe Waffle-9/+8
2023-01-17`rustc_hir_analysis`: some general code improvementsMaybe Waffle-5/+2
2023-01-14fix various subst_identity vs skip_binderKyle Matsuda-2/+3
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-7/+5
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata