summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/sty.rs
AgeCommit message (Collapse)AuthorLines
2022-09-15derive various Lift impl instead of hand rolling themOli Scherer-10/+10
2022-09-12Rename some variantsMichael Goulet-3/+3
2022-09-12Typecheck dyn* coercionsEric Holk-2/+10
Also changes things to treat dyn* as a sized type, unlike dyn Trait.
2022-09-10Auto merge of #98559 - jackh726:remove-reempty, r=oli-obkbors-7/+1
Remove ReEmpty r? rust-lang/types
2022-09-09Lower RPITIT to ImplTraitPlaceholder itemMichael Goulet-1/+4
2022-09-08Remove ReEmptyJack Huey-7/+1
2022-09-01Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1Gabriel Bustamante-0/+6
2022-08-26Suggest returning closure as impl FnMichael Goulet-0/+4
2022-08-17Make same_type_modulo_infer a proper TypeRelationMichael Goulet-0/+4
2022-08-03Change sized_constraints to return EarlyBinderJack Huey-1/+1
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-4/+5
2022-07-30Rollup merge of #99900 - lcnr:hash-stable-fun, r=cjgillotDylan DPC-1/+6
remove some manual hash stable impls
2022-07-29remove some manual hash stable implslcnr-1/+6
2022-07-28anonymize all bound vars, not just regionslcnr-0/+23
2022-07-19Use LocalDefId in OpaqueTypeKeyMichael Goulet-7/+0
2022-07-12Rollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnrDylan DPC-0/+4
Some more `EarlyBinder` cleanups First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory r? rust-lang/types
2022-07-09Auto merge of #99028 - tmiasko:inline, r=estebankbors-0/+1
Miscellaneous inlining improvements Add `#[inline]` to a few trivial non-generic methods from a perf report that otherwise wouldn't be candidates for inlining.
2022-07-07Move EarlyBinder calls in rustc_typeck::outlives a bit further upJack Huey-0/+4
2022-07-07Move is_free and is_free_or_static to Region, change resolve_var to ↵Jack Huey-0/+13
resolve_region, and remove RootEmptyRegion
2022-07-07Miscellaneous inlining improvementsTomasz Miąsko-0/+1
Add `#[inline]` to a few trivial non-generic methods from a perf report that otherwise wouldn't be candidates for inlining.
2022-07-06Update TypeVisitor pathsAlan Egerton-3/+3
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-7/+7
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-11/+11
2022-06-19Move RegionKind to rustc_type_irJack Huey-149/+13
2022-06-08Folding revamp.Nicholas Nethercote-1/+2
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-03Replace `&Vec<_>`s with `&[_]`sMaybe Waffle-0/+7
2022-05-28Make TyCtxt implement Interner, make HashStable generic and move to ↵Michael Goulet-1/+1
rustc_type_ir
2022-05-28Fix TyKind lint, make consts no longer fn, etcMichael Goulet-200/+4
2022-05-28Initial fixes on top of type interner commitMichael Goulet-3/+1
2022-05-28Move things to rustc_type_irWilco Kusee-5/+31
2022-05-27fix commentlcnr-1/+1
2022-05-14Add bound_explicit_item_bounds and bound_item_boundsJack Huey-0/+24
2022-05-13Add bound_fn_sigJack Huey-1/+1
2022-05-13Add bound_type_ofJack Huey-1/+1
2022-05-10Introduce EarlyBinderJack Huey-3/+44
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-32/+34
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-02fix most compiler/ doctestsElliot Roberts-32/+34
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-26add hacky closure to struct_tail_with_normalize in order to allow us to walk ↵b-naber-1/+1
valtrees in lockstep with the type
2022-03-30get clippy to compile againlcnr-4/+1
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-0/+7
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-26Fix perf issue for auto trait selectionGuillaume Gomez-0/+9
2022-03-20fix two comments referring to moved code (rustc_mir_transform::generator)Audun Halland-1/+1
2022-03-15Auto merge of #94928 - lcnr:inline-as_substs, r=michaelwoeristerbors-0/+1
inline `tuple_fields` more https://github.com/rust-lang/rust/pull/93505 fun, after this i have no idea what might be causing the perf impact.
2022-03-14Rollup merge of #93977 - compiler-errors:sized-generic-metadata, r=wesleywiserMatthias Krüger-10/+13
Type params and assoc types have unit metadata if they are sized Extend the logic in `Pointee` projection to ensure that we can satisfy `<T as Pointee>::Metadata = ()` if `T: Sized`. cc: `@SimonSapin` and #93959
2022-03-14inline `tuple_fields`lcnr-0/+1
2022-03-12Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-deadbors-7/+7
Improve `AdtDef` interning. This commit makes `AdtDef` use `Interned`. Much of the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`. r? `@fee1-dead`
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-7/+7
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-11Auto merge of #94276 - scottmcm:primitive-clone, r=oli-obkbors-0/+51
mir-opt: Replace clone on primitives with copy We can't do it for everything, but it would be nice to at least stop making calls to clone methods in debug from things like derived-clones. r? `@ghost`
2022-03-10Rollup merge of #94746 - notriddle:notriddle/method-rustc-on-unimplemented, ↵Matthias Krüger-0/+9
r=davidtwco diagnostics: use rustc_on_unimplemented to recommend `[].iter()` To make this work, the `#[rustc_on_unimplemented]` data needs to be used to report method resolution errors, which is most of what this commit does. Fixes #94581