about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
AgeCommit message (Collapse)AuthorLines
2022-08-29Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obkMatthias Krüger-1/+1
Replace `Body::basic_blocks()` with field access Since the refactoring in #98930, it is possible to borrow the basic blocks independently from other parts of MIR by accessing the `basic_blocks` field directly. Replace unnecessary `Body::basic_blocks()` method with a direct field access, which has an additional benefit of borrowing the basic blocks only.
2022-08-26Migrate rustc_ty_utils to use SessionDiagnosticPeter Medus-94/+158
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-1/+1
2022-08-24Store blocks in `Thir`.Nicholas Nethercote-6/+9
Like expressions, statements, and match arms. This shrinks `thir::Stmt` and is a precursor to further shrinking `thir::Expr`.
2022-08-17implied_bounds: clarify our assumptionslcnr-0/+62
2022-08-07Built-in implementation of Tuple traitMichael Goulet-1/+2
2022-08-03Add bound_impl_subject and bound_return_tyJack Huey-3/+1
2022-08-03Change sized_constraints to return EarlyBinderJack Huey-1/+2
2022-08-01Remove trait_of_item query.Camille GILLOT-8/+0
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-17/+8
2022-08-01Remove visibility from AssocItem.Camille GILLOT-8/+2
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-8/+8
2022-07-29Rename local_did to def_idMiguel Guarniz-4/+8
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-3/+4
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-22Do not resolve associated const when there is no provided valueMichael Goulet-0/+5
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-1/+1
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-2/+396
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-14Fix overlapping implskadmin-2/+2
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12Move abstract const to rustc_middle::tykadmin-2/+396
2022-07-06Update TypeVisitor pathsAlan Egerton-1/+1
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+2
2022-07-04remove an unused `DefId`lcnr-1/+1
2022-06-30Recover when failing to normalize closure signature.Camille GILLOT-2/+2
2022-06-29Improve doc comment of destructure_constDominik Stolz-2/+2
2022-06-28Address code review commentsDominik Stolz-63/+56
2022-06-28Make consts mod privateDominik Stolz-1/+1
2022-06-28Improve pretty printing of valtrees for referencesDominik Stolz-0/+86
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-2/+0
2022-06-11Auto merge of #95880 - cjgillot:def-ident-span, r=petrochenkovbors-17/+0
Handle `def_ident_span` like `def_span`. `def_ident_span` had an ad-hoc status in the compiler. This PR refactors it to be a first-class citizen like `def_span`: - it gets encoded in the main metadata loop, instead of the visitor; - its implementation is updated to mirror the one of `def_span`. We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.
2022-06-10Implement def_ident_span in rustc_middle.Camille GILLOT-17/+0
2022-06-08Auto merge of #97860 - Dylan-DPC:rollup-t3vxos8, r=Dylan-DPCbors-5/+9
Rollup of 5 pull requests Successful merges: - #97595 (Remove unwrap from get_vtable) - #97597 (Preserve unused pointer to address casts) - #97819 (Recover `import` instead of `use` in item) - #97823 (Recover missing comma after match arm) - #97851 (Use repr(C) when depending on struct layout in ptr tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-08Rollup merge of #97595 - ouz-a:issue-97381, r=compiler-errorsDylan DPC-5/+9
Remove unwrap from get_vtable This avoids ICE on issue #97381 I think the bug is a bit deeper though, it compiles fine when `v` is `&v` which makes me think `Deref` is causing some issue with borrowck but it's fine I guess since this thing crashes since `nightly-2020-09-17` 😅
2022-06-08Folding revamp.Nicholas Nethercote-1/+3
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2022-06-05get_vtable returns opt instd of unwrppingouz-a-5/+9
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-05-30Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errorsbors-2/+2
Replace `#[default_method_body_is_const]` with `#[const_trait]` pulled out of #96077 related issues: #67792 and #92158 cc `@fee1-dead` This is groundwork to only allowing `impl const Trait` for traits that are marked with `#[const_trait]`. This is necessary to prevent adding a new default method from becoming a breaking change (as it could be a non-const fn).
2022-05-30Add a helper function for checking whether a default function in a trait can ↵Oli Scherer-2/+4
be treated as `const`
2022-05-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-3/+1
2022-05-28Move things to rustc_type_irWilco Kusee-1/+1
2022-05-17Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwcobors-7/+1
Add a query for checking whether a function is an intrinsic. work towards #93145 This will reduce churn when we add more ways to declare intrinsics r? `@scottmcm`
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-7/+1
2022-05-14Auto merge of #96883 - jackh726:early-binder-2, r=oli-obkbors-6/+8
Add EarlyBinder Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk. Either way, tracking when we have or haven't already substituted out these in rustc can be helpful. As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted. r? `@nikomatsakis`
2022-05-13Add bound_type_ofJack Huey-2/+2
2022-05-11Gracefully fail to resolve associated items instead of `delay_span_bug`.Camille GILLOT-1/+17
2022-05-10Introduce EarlyBinderJack Huey-6/+8
2022-04-10Avoid accessing HIR from MIR queries.Camille GILLOT-6/+1
2022-04-01Auto merge of #94883 - cjgillot:flat-metadata, r=oli-obkbors-10/+0
Encode even more metadata through tables instead of EntryKind This should move us closer to getting rid of `EntryKind`.
2022-03-31Merge impl_constness and is_const_fn_raw.Camille GILLOT-10/+0
2022-03-31Specialize suggestion for Option<T>Michael Goulet-23/+47