about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/collect.rs
AgeCommit message (Collapse)AuthorLines
2023-12-23Give `DiagnosticBuilder` a default type.Nicholas Nethercote-2/+2
`IntoDiagnostic` defaults to `ErrorGuaranteed`, because errors are the most common diagnostic level. It makes sense to do likewise for the closely-related (and much more widely used) `DiagnosticBuilder` type, letting us write `DiagnosticBuilder<'a, ErrorGuaranteed>` as just `DiagnosticBuilder<'a>`. This cuts over 200 lines of code due to many multi-line things becoming single line things.
2023-12-20Give `VariantData::Struct` named fields, to clairfy `recovered`.Alona Enraght-Moony-1/+1
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-1/+1
2023-12-15Annotate some bugsMichael Goulet-2/+2
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-7/+6
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-05Remove `#[rustc_host]`, use internal desugaringDeadbeef-1/+1
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-5/+5
cleanup
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-3/+3
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-17rename bound region instantiationlcnr-1/+1
- `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased` - `replace_late_bound_regions_X` -> `instantiate_bound_regions_X`
2023-11-14finish `RegionKind` renamelcnr-1/+1
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-10-23Let's see what those opaque types actually areMichael Goulet-4/+6
2023-10-20s/generator/coroutine/Oli Scherer-3/+3
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-13/+18
2023-09-28don't clone copy typesMatthias Krüger-1/+1
2023-09-26Don't store lazyness in DefKindMichael Goulet-0/+1
2023-08-30rustc_layout_scalar_valid_range makes ctors unsafeMichael Goulet-8/+9
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-0/+1
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-2/+2
2023-08-07Fix ICEDeadbeef-17/+48
2023-08-06lower impl const to bind to host effect paramDeadbeef-27/+18
2023-07-25inline format!() args from rustc_codegen_llvm to the end (4)Matthias Krüger-9/+7
r? @WaffleLapkin
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-20/+17
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+9
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-8/+9
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-1/+1
2023-07-01Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errorsbors-1/+1
change snapshot tracking in fulfillment contexts use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-06-29change snapshot tracking in fulfillment contextslcnr-1/+1
2023-06-20Auto merge of #112320 - compiler-errors:do-not-impl-via-obj, r=lcnrbors-0/+46
Add `implement_via_object` to `rustc_deny_explicit_impl` to control object candidate assembly Some built-in traits are special, since they are used to prove facts about the program that are important for later phases of compilation such as codegen and CTFE. For example, the `Unsize` trait is used to assert to the compiler that we are able to unsize a type into another type. It doesn't have any methods because it doesn't actually *instruct* the compiler how to do this unsizing, but this is later used (alongside an exhaustive match of combinations of unsizeable types) during codegen to generate unsize coercion code. Due to this, these built-in traits are incompatible with the type erasure provided by object types. For example, the existence of `dyn Unsize<T>` does not mean that the compiler is able to unsize `Box<dyn Unsize<T>>` into `Box<T>`, since `Unsize` is a *witness* to the fact that a type can be unsized, and it doesn't actually encode that unsizing operation in its vtable as mentioned above. The old trait solver gets around this fact by having complex control flow that never considers object bounds for certain built-in traits: https://github.com/rust-lang/rust/blob/2f896da247e0ee8f0bef7cd7c54cfbea255b9f68/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs#L61-L132 However, candidate assembly in the new solver is much more lovely, and I'd hate to add this list of opt-out cases into the new solver. Instead of maintaining this complex and hard-coded control flow, instead we can make this a property of the trait via a built-in attribute. We already have such a build attribute that's applied to every single trait that we care about: `rustc_deny_explicit_impl`. This PR adds `implement_via_object` as a meta-item to that attribute that allows us to opt a trait out of object-bound candidate assembly as well. r? `@lcnr`
2023-06-20Merge attrs, better validationMichael Goulet-2/+44
2023-06-20Make rustc_deny_explicit_impl only local as wellMichael Goulet-1/+3
2023-06-20Add rustc_do_not_implement_via_objectMichael Goulet-0/+2
2023-06-11properly check associated consts for infer placeholdersMichael Goulet-11/+16
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-1/+1
2023-05-30Rollup merge of #112060 - lcnr:early-binder, r=jackh726Nilstrieb-2/+2
`EarlyBinder::new` -> `EarlyBinder::bind` for consistency with `Binder::bind`. it may make sense to also add `EarlyBinder::dummy` in places where we know that no parameters exist, but I left that out of this PR. r? `@jackh726` `@kylematsuda`
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-1/+1
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-2/+2
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-2/+2
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-2/+2
2023-05-17Retire is_foreign_item query.Camille GILLOT-5/+0
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-12Require `impl Trait` in associated types to appear in method signaturesOli Scherer-1/+1
2023-05-03Rename things to reflect that they're not item specificMichael Goulet-2/+2
2023-04-26Make some region folders a little stricter.Nicholas Nethercote-2/+4
Because certain regions cannot occur in them.
2023-04-22Don't infer fn return type to return itselfMichael Goulet-11/+20
2023-04-20Remove opt_const_param_of.Camille GILLOT-1/+0
2023-04-16use matches! macro in more placesMatthias Krüger-4/+1
2023-04-11Split implied and super predicate queriesMichael Goulet-3/+4
2023-04-11Split super_predicates_that_define_assoc_type query from super_predicates_ofMichael Goulet-2/+3
2023-04-08Migrate `rustc_hir_analysis` to session diagnosticObei Sideg-110/+55
Part 3: Finishing `collect.rs` file