summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
AgeCommit message (Collapse)AuthorLines
2022-04-24Backport fixes -- drop uses of NodeIdHashingModeMark Rousskov-6/+2
2022-04-24Remove NodeIdHashingMode.Camille GILLOT-64/+3
2022-04-01Auto merge of #94883 - cjgillot:flat-metadata, r=oli-obkbors-11/+13
Encode even more metadata through tables instead of EntryKind This should move us closer to getting rid of `EntryKind`.
2022-04-01Rollup merge of #95260 - compiler-errors:fn, r=davidtwcoMatthias Krüger-3/+15
Better suggestions for `Fn`-family trait selection errors 1. Suppress suggestions to add `std::ops::Fn{,Mut,Once}` bounds when a type already implements `Fn{,Mut,Once}` 2. Add a note that points out that a type does in fact implement `Fn{,Mut,Once}`, but the arguments vary (either by number or by actual arguments) 3. Add a note that points out that a type does in fact implement `Fn{,Mut,Once}`, but not the right one (e.g. implements `FnMut`, but `Fn` is required). Fixes #95147
2022-03-31Merge impl_constness and is_const_fn_raw.Camille GILLOT-0/+11
2022-03-31Create trait_def table.Camille GILLOT-11/+2
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-8/+8
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-31Rollup merge of #95263 - compiler-errors:async-block-pretty, r=jackh726Dylan DPC-7/+20
Restore `impl Future<Output = Type>` to async blocks I was sad when I undid some of the code I wrote in #91096 in the PR #95225, so I fixed it here to not print `[async output]`. This PR "manually" normalizes the associated type `<[generator] as Generator>::Return` type which appears very frequently in `impl Future` types that result from async block desugaring.
2022-03-30Restore `impl Future<Output = Type>` to async blocksMichael Goulet-7/+20
2022-03-31Auto merge of #95501 - Dylan-DPC:rollup-arx6sdc, r=Dylan-DPCbors-0/+47
Rollup of 6 pull requests Successful merges: - #93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically) - #94806 (Fix `cargo run tidy`) - #94869 (Add the generic_associated_types_extended feature) - #95011 (async: Give predictable name to binding generated from .await expressions.) - #95251 (Reduce max hash in raw strings from u16 to u8) - #95298 (Fix double drop of allocator in IntoIter impl of Vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-31Rollup merge of #94869 - jackh726:gats_extended, r=compiler-errorsDylan DPC-0/+47
Add the generic_associated_types_extended feature Right now, this only ignore obligations that reference new placeholders in `poly_project_and_unify_type`. In the future, this might do other things, like allowing object-safe GATs. **This feature is *incomplete* and quite likely unsound. This is mostly just for testing out potential future APIs using a "relaxed" set of rules until we figure out *proper* rules.** Also drive by cleanup of adding a `ProjectAndUnifyResult` enum instead of using a `Result<Result<Option>>`. r? `@nikomatsakis`
2022-03-30Auto merge of #95436 - cjgillot:static-mut, r=oli-obkbors-3/+10
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-30Add the generic_associated_types_extended featureJack Huey-0/+47
2022-03-30a few mode feedback fixes per @bjorn3Yuri Astrakhan-1/+1
2022-03-30Spellchecking compiler commentsYuri Astrakhan-9/+9
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30get clippy to compile againlcnr-4/+1
2022-03-30rework implementation for inherent impls for builtin typeslcnr-0/+34
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-3/+10
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-28Remove opaque type obligation and just register opaque types as they are ↵Oli Scherer-20/+0
encountered. This also registers obligations for the hidden type immediately.
2022-03-28Have the spans of TAIT type conflict errors point to the actual site instead ↵Oli Scherer-0/+32
of the owning function
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-26/+68
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-26Fix perf issue for auto trait selectionGuillaume Gomez-0/+9
2022-03-25Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, ↵bors-1/+1
r=oli-obk Swap DtorckConstraint to DropckConstraint This change was made as per suspicion that this struct was never renamed after consistent use of DropCk. This also clarifies the meaning behind the name of this structure. Fixes https://github.com/rust-lang/rust/issues/94310
2022-03-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-1/+32
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-1/+1
Try to evaluate in try unify and postpone resolution of constants that contain inference variables We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables. r? `@lcnr`
2022-03-24Swap DtorckConstraint to DropckConstraintInfRandomness-1/+1
This change was made as per suspicion that this struct was never renamed after consistent use of DropCk. This also clarifies the meaning behind the name of this structure.
2022-03-24Extract impl_subject_and_oglibations fn and make equate receive subjectsSantiago Pastorino-2/+27
2022-03-23Better suggestions for Fn trait selection errorsMichael Goulet-3/+15
2022-03-23Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obkMatthias Krüger-16/+20
remove `[async output]` from `impl Future` pretty-printing self-explanatory, guess it's not as helpful as I thought when I added it 4 months ago re https://github.com/rust-lang/rust/issues/95089#issuecomment-1075482851
2022-03-22remove [async output] from impl FutureMichael Goulet-16/+20
2022-03-21try to evaluate in try_unifyb-naber-1/+1
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-0/+1
2022-03-20fix two comments referring to moved code (rustc_mir_transform::generator)Audun Halland-1/+1
2022-03-20Extract ImplSubject informationSantiago Pastorino-0/+6
2022-03-18Rollup merge of #95039 - spastorino:overlap-super-predicates, r=nikomatsakisMatthias Krüger-0/+7
Make negative coherence work when there's impl negative on super predicates r? `@nikomatsakis`
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-3/+3
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-17Add comments on PolaritySantiago Pastorino-0/+7
2022-03-16rustc_error: make ErrorReported impossible to constructmark-10/+23
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-3/+3
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-15Rollup merge of #94958 - est31:pluralize, r=oli-obkMatthias Krüger-1/+1
Support other types of pluralization in pluralize macro
2022-03-15Support other types of pluralization in pluralize macroest31-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-13Auto merge of #94897 - camelid:query-doc-hidden, r=cjgillotbors-11/+11
Queryify `is_doc_hidden` It came up hot on some profiling of rustdoc I did, so hopefully turning it into a query will help.
2022-03-12Queryify `is_doc_hidden`Noah Lev-11/+11
It came up hot on some profiling of rustdoc I did, so hopefully turning it into a query will help.
2022-03-12Auto merge of #94711 - ouz-a:master3, r=oli-obkbors-1/+1
Return early to fix ICE This fixes #94627, ICE happens because compiler tries to suggest constraining type parameter but the only constraint is implicit `std::Sized` one, so it gets removed and there is nothing to suggest resulting in ICE.
2022-03-12don't call multipart_suggestionouz-a-7/+1
2022-03-12Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-deadbors-192/+192
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-192/+192
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`.