about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check
AgeCommit message (Collapse)AuthorLines
2022-11-01Don't remap early-bound RPITIT regions that originate from implMichael Goulet-1/+7
2022-11-01Auto merge of #103590 - compiler-errors:ocx-more, r=lcnrbors-18/+6
(almost) Always use `ObligationCtxt` when dealing with canonical queries Hope this is a step in the right direction. cc rust-lang/types-team#50. r? `@lcnr`
2022-10-31Use AdtDef to check enum.Camille GILLOT-59/+62
2022-10-31Use AdtDef in wfcheck.Camille GILLOT-79/+28
2022-10-29Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errorsGuillaume Gomez-3/+3
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions` This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3 r? `@compiler-errors`
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-61/+61
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-28Rollup merge of #103608 - compiler-errors:rpitit-early-lt, r=cjgillotMatthias Krüger-1/+1
Remap early bound lifetimes in return-position `impl Trait` in traits too Fixes part of #103457 r? ``@cjgillot,`` though feel free to reassign, just thought you'd have sufficient context to review.
2022-10-27remove _types from ocx method namesMichael Goulet-9/+6
2022-10-27Address some more nitsMichael Goulet-12/+3
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-3/+3
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-27Rollup merge of #103586 - compiler-errors:issue-103573, r=jackh726Matthias Krüger-0/+4
Process registered region obligation in `resolve_regions_with_wf_tys` Fixes #103573
2022-10-27Remap early bound lifetimes tooMichael Goulet-1/+1
2022-10-26Process registered region obligation in resolve_regions_with_wf_tysMichael Goulet-0/+4
2022-10-26Rollup merge of #95710 - ↵Dylan DPC-1/+1
fee1-dead-contrib:stabilize_arbitrary_enum_discriminant, r=joshtriplett Stabilize arbitrary_enum_discriminant, take 2 Documentation has been updated in https://github.com/rust-lang/reference/pull/1055. cc #86860 for previous stabilization report. Not yet marks https://github.com/rust-lang/rust/issues/60553 as done: need documentation in the rust reference.
2022-10-24Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tysMichael Goulet-2/+10
2022-10-23Rollup merge of #103123 - compiler-errors:early-binder-iter, r=cjgillotMatthias Krüger-12/+4
Introduce `subst_iter` and `subst_iter_copied` on `EarlyBinder` Makes working with bounds lists a bit easier, which I seem to do a lot. Specifically, means that we don't need to do `.transpose_iter().map(|(pred, _)| *pred)` every time we want to iterate through an `EarlyBinder<&'tcx [(Predicate, Span)]>` (and even then, still have to call `subst` later), which was a very awkward idiom imo.
2022-10-22Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obkbors-7/+2
stop using `ty::UnevaluatedConst` directly best reviewed commit by commit. simplifies #99798 because we now don't have to expand `ty::UnevaluatedConst` to `ty::Const`. I also remember some other places where using `ty::UnevaluatedConst` directly was annoying and caused issues, though I don't quite remember what they were rn '^^ r? `@oli-obk` cc `@JulianKnodt`
2022-10-22Introduce subst_iter and subst_iter_copied on EarlyBinderMichael Goulet-12/+4
2022-10-22Stabilize arbitrary_enum_discriminant, take 2Deadbeef-1/+1
2022-10-21Require Drop impls to have the same constness on its bounds as the bounds on ↵Oli Scherer-7/+1
the struct have
2022-10-20rustc_hir_typeck: fix paths and partially mv fileslcnr-896/+24
2022-10-20rustc_hir_typeck: move whole fileslcnr-31198/+0
2022-10-20Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726bors-0/+1
Require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes fixes #96996 cc `@aliemjay`
2022-10-19Rollup merge of #103223 - compiler-errors:deref-sugg-slow, r=wesleywiserMatthias Krüger-5/+6
Use already checked RHS ty for LHS deref suggestions There's no reason to do the `check_lhs_assignable` and RHS `check_expr_with_hint` in that order, so invert them and use the typeck results to avoid exponential blowup on error. Fixes #103219
2022-10-19Rollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiserDylan DPC-2/+6
Let expressions on RHS shouldn't be terminating scopes Fixes #100276. Before this PR, we were unconditionally marking the RHS of short-circuiting binary expressions as a terminating scope. In the case of a let chain where the `let` expression was on the RHS, this meant that temporaries within the `let` expr would only live until the end of the expression. Since this only affected the RHS, this led to surprising behavior ([example](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d1b0a5d1f01882f9c89c2194a75eb19f)). After this PR, we only mark the RHS as a terminating scope if it is not a `let` expression.
2022-10-19Use already checked RHS ty for LHS deref suggestionsMichael Goulet-5/+6
2022-10-19instantiate -> constructMichael Goulet-4/+2
2022-10-19Generalize call suggestion for unsatisfied predicateMichael Goulet-7/+3
2022-10-19Standardize arg suggestions between typeck and trait selectionMichael Goulet-1/+1
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-7/+2
2022-10-17Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnrMatthias Krüger-2/+87
Suggest parentheses for possible range method calling Fixes #102396
2022-10-17trivial fix for comments feedbackyukang-9/+17
2022-10-16Don't consider `Let` exprs terminating scopesNathan Whitaker-2/+6
2022-10-15typosMichael Goulet-9/+9
2022-10-15Equate full fn signatures to infer all region variablesMichael Goulet-13/+33
2022-10-15Fix subst issues with RPITITMichael Goulet-6/+31
2022-10-15Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholkbors-81/+67
Make `dyn*` casts into a coercion, allow `dyn*` upcasting I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways. 1. Make `dyn*` into a coercion instead of a cast 2. Enable `dyn*` upcasting since we basically get it for free 3. Simplify some of the cast checking code since we're using the coercion path now r? `@eholk` but feel free to reassign cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-3/+3
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14Require lifetime bounds for opaque types in order to allow hidden types to ↵Oli Scherer-0/+1
capture said lifetimes
2022-10-14Address nits, add test for implicit dyn-star coercion without feature gateMichael Goulet-1/+3
2022-10-14Remove CastCheckResult since it's unusedMichael Goulet-26/+5
2022-10-14float and int vars are trivially copyMichael Goulet-0/+4
2022-10-14more dupe word typosRageking8-3/+3
2022-10-14Allow dyn* upcastingMichael Goulet-2/+10
2022-10-14Make dyn* cast into a coercionMichael Goulet-58/+55
2022-10-14Auto merge of #103026 - matthiaskrgr:rollup-gfmlfkt, r=matthiaskrgrbors-5/+15
Rollup of 7 pull requests Successful merges: - #103000 (Add suggestion to the "missing native library" error) - #103006 (rustdoc: don't ICE on `TyKind::Typeof`) - #103008 (replace ReErased with fresh region vars in opaque types) - #103011 (Improve rustdoc `unsafe-fn` GUI test) - #103013 (Add new bootstrap entrypoints to triagebot) - #103016 (Ensure enum cast moves) - #103021 (Add links to relevant pages to find constraint information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-14Rollup merge of #103008 - aliemjay:opaque-parent-substs, r=oli-obkMatthias Krüger-5/+15
replace ReErased with fresh region vars in opaque types See inline comments. Prior art #102943. cc ``@compiler-errors`` ``@oli-obk`` Fixes #100267 Fixes #101940 Fixes #102649 Fixes #102510
2022-10-13Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errorsbors-24/+27
Check hidden types in dead code fixes #99490 r? `@compiler-errors` best reviewed commit by commit
2022-10-13replace ReErased with fresh region vars in opaque typesAli MJ Al-Nasrawy-5/+15
2022-10-13Rollup merge of #102765 - TaKO8Ki:follow-up-to-102708, r=compiler-errorsDylan DPC-0/+12
Suggest `==` to the first expr which has `ExprKind::Assign` kind follow-up to #102708 [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4241dc33ed8af02e1ef530d6b14903fd)