about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/util.rs
AgeCommit message (Collapse)AuthorLines
2023-12-15Annotate some more bugsMichael Goulet-5/+2
2023-12-10fix clippyDeadbeef-1/+2
2023-12-09s/const_effect/host_effectMichael Goulet-5/+6
2023-12-08Implement `async gen` blocksMichael Goulet-0/+2
2023-12-07Fix const drop checkingMichael Goulet-3/+3
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-28Add with_opt_const_effect_param helper, simplifyMichael Goulet-0/+17
2023-11-28Fix PartialEq args when #[const_trait] is enabledMichael Goulet-0/+34
2023-11-26merge `DefKind::Coroutine` into `DefKind::Closure`bohan-15/+16
2023-11-25Rollup merge of #118288 - compiler-errors:is_some_and, r=lqd,dtolnayMichael Goulet-1/+1
Use `is_{some,ok}_and` more in the compiler slightly more fluent-reading code
2023-11-25is_{some,ok}_andMichael Goulet-1/+1
2023-11-23remove unused pub fnklensy-16/+0
2023-11-14finish `RegionKind` renamelcnr-10/+12
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-1/+1
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-02only erase param env regions where neededlcnr-1/+1
2023-11-02dropck_outlives check generator witness needs_droplcnr-4/+6
2023-11-01Auto merge of #116692 - Nadrieril:half-open-ranges, r=cjgillotbors-35/+43
Match usize/isize exhaustively with half-open ranges The long-awaited finale to the saga of [exhaustiveness checking for integers](https://github.com/rust-lang/rust/pull/50912)! ```rust match 0usize { 0.. => {} // exhaustive! } match 0usize { 0..usize::MAX => {} // helpful error message! } ``` Features: - Half-open ranges behave as expected for `usize`/`isize`; - Trying to use `0..usize::MAX` will tell you that `usize::MAX..` is missing and explain why. No more unhelpful "`_` is missing"; - Everything else stays the same. This should unblock https://github.com/rust-lang/rust/issues/37854. Review-wise: - I recommend looking commit-by-commit; - This regresses perf because of the added complexity in `IntRange`; hopefully not too much; - I measured each `#[inline]`, they all help a bit with the perf regression (tho I don't get why); - I did not touch MIR building; I expect there's an easy PR there that would skip unnecessary comparisons when the range is half-open.
2023-10-29Ignore RPIT duplicated lifetimes in opaque_types_defined_byMichael Goulet-1/+1
2023-10-27Abstract over `PatRange` boundary valueNadrieril-35/+43
2023-10-26Add hir::GeneratorKind::GenOli Scherer-0/+2
2023-10-20Rename `CoroutineKind::Gen` to `::Coroutine`Oli Scherer-2/+2
2023-10-20s/generator/coroutine/Oli Scherer-18/+18
2023-10-20s/Generator/Coroutine/Oli Scherer-18/+18
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+1
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-16/+6
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-1/+1
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-1/+1
2023-07-18some additional refactorlcnr-9/+9
also, treat placeholders equal to params
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-44/+44
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-1/+2
2023-07-06add helper methods for accessing struct tailLukas Markeffsky-2/+2
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-11/+11
2023-07-05Deal with falloutBoxy-1/+1
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-2/+2
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-1/+1
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-19Store generator field names in GeneratorLayout.Camille GILLOT-44/+0
2023-06-19Make closure_saved_names_of_captured_variables a query.Camille GILLOT-32/+0
2023-06-19s/Clause/ClauseKindMichael Goulet-1/+1
2023-06-08Rollup merge of #109953 - thomcc:thomcc/typeid128, r=WaffleLapkinMatthias Krüger-2/+2
Use 128 bits for TypeId hash Preliminary/Draft impl of https://github.com/rust-lang/compiler-team/issues/608 Prior art (probably incomplete list) - https://github.com/rust-lang/rust/pull/75923 - https://github.com/rust-lang/rust/pull/95845
2023-06-06remove `has_error_field` helper methodlcnr-12/+0
2023-06-04Use 128 bits for TypeId hashThom Chiovoloni-2/+2
- Switch TypeId to 128 bits - Hack around the fact that tracing-subscriber dislikes how TypeId is hashed - Remove lowering of type_id128 from rustc_codegen_llvm - Remove unnecessary `type_id128` intrinsic (just change return type of `type_id`) - Only hash the lower 64 bits of the TypeId - Reword comment
2023-05-31Auto merge of #111076 - ↵bors-1/+21
notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot diagnostics: exclude indirect private deps from trait impl suggest Fixes #88696
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-1/+1
2023-05-25Use De Morgan's law to simplify logicMichael Howell-6/+6
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2023-05-25remove outdated comment from `is_user_visible_dep` docsMichael Howell-4/+0
2023-05-25diagnostics: don't crash if an injected crate shows up in suggestionsMichael Howell-1/+4
2023-05-25diagnostics: exclude indirect private deps from trait impl suggestMichael Howell-1/+22
Fixes #88696
2023-05-25Check that opaque is a defining use, prefer pre-defined opaquesMichael Goulet-0/+36
2023-05-16Rollup merge of #111533 - clubby789:drop-tracking-error, r=oli-obkMatthias Krüger-3/+3
Handle error body in generator layout Fixes #111468 I feel like making this query return `Option<GeneratorLayout>` might be better but had some issues with that approach