about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/util.rs
AgeCommit message (Collapse)AuthorLines
2023-04-03fix(middle): emit error rather than delay bug when reaching limitbohan-5/+9
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-2/+2
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-29Support TLS access into dylibs on WindowsJohn Kåre Alsaker-0/+22
2023-03-21Use local key in providersMichael Goulet-4/+3
2023-03-15Auto merge of #108282 - cjgillot:mir-checked-sh, r=tmiaskobors-12/+12
Implement checked Shl/Shr at MIR building. This does not require any special handling by codegen backends, as the overflow behaviour is entirely determined by the rhs (shift amount). This allows MIR ConstProp to remove the overflow check for constant shifts. ~There is an existing different behaviour between cg_llvm and cg_clif (cc `@bjorn3).` I took cg_llvm's one as reference: overflow if `rhs < 0 || rhs > number_of_bits_in_lhs_ty`.~ EDIT: `cg_llvm` and `cg_clif` implement the overflow check differently. This PR uses `cg_llvm`'s implementation based on a `BitAnd` instead of `cg_clif`'s one based on an unsigned comparison.
2023-03-13Better names?Michael Goulet-1/+1
2023-03-13Treat projections with infer as placeholder during fast reject in new solverMichael Goulet-7/+14
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-2/+2
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-27Implement checked Shl/Shr at MIR building.Camille GILLOT-12/+12
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-0/+34
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-4/+4
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-0/+34
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-18Assume we can normalize trait default method RPITITs in param-env insteadMichael Goulet-1/+21
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-5/+5
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-4/+7
2023-02-16Auto merge of #108020 - nnethercote:opt-mk_region, r=compiler-errorsbors-3/+3
Optimize `mk_region` PR #107869 avoiding some interning under `mk_ty` by special-casing `Ty` variants with simple (integer) bodies. This PR does something similar for regions. r? `@compiler-errors`
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-3/+3
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-2/+2
2023-02-13Make folding traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-2/+2
2023-01-27Restrict amount of ignored locals.Camille GILLOT-1/+1
2023-01-27Compute generator saved locals on MIR.Camille GILLOT-2/+72
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-2/+12
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-8/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+4
2023-01-25Use `can_eq` to compare types for default assoc type errorNilstrieb-11/+0
This works correctly with inference variables.
2023-01-21rustc_metadata: Encode `doc(hidden)` flag to metadataVadim Petrochenkov-1/+2
To retrieve these flags rustdoc currently has to mass decode full attributes for items in the whole crate tree, so it's better to pre-compute it in advance. This is especially for short-term performance of https://github.com/rust-lang/rust/pull/107054 because resolver cannot use memoization of query results yet.
2023-01-17change item_bounds query to return EarlyBinder; remove bound_item_bounds queryKyle Matsuda-7/+0
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-14/+0
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-7/+0
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change const_param_default query to return EarlyBinder; remove ↵Kyle Matsuda-4/+0
bound_const_param_default query; add EarlyBinder to const_param_default in metadata
2022-12-28better names and a commentMichael Goulet-2/+2
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-19Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorinobors-0/+7
Address some `EarlyBinder` nits
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-1/+1
2022-12-13Combine identical alias armsMichael Goulet-19/+11
2022-12-13Combine projection and opaque into aliasMichael Goulet-14/+14
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-1/+1
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-12-13Remove instantiate_type_schemeMichael Goulet-3/+3
2022-12-13EarlyBinder nitsMichael Goulet-2/+9
2022-12-07Move closure/generator type info methods to TyCtxtMichael Goulet-0/+76
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-5/+5
2022-11-25Rename normalize_opaque_types to reveal_opaque_types_in_boundsMichael Goulet-3/+3
2022-11-24move some layout logic to rustc_target::abi::layouthkalbasi-17/+6
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-13/+8
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-14more dupe word typosRageking8-1/+1
2022-09-27rustdoc: Queryify `is_notable_trait`Noah Lev-2/+14
This might help with #102375.
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+1