about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
2023-01-30Auto merge of #107197 - aliemjay:patch-2, r=jackh726bors-3/+2
assume MIR types are fully normalized in ascribe_user_type This FIXME was introduced in c6a17bf8bcfa60c8b0436251d2cf70d8eca4d198 but it should've been restricted to `ascribe_user_type_skip_wf`.
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-0/+2
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30errors: implement `IntoDiagnosticArg` for `&T`David Wood-13/+7
Implement `IntoDiagnosticArg` for `&'a T` when `T` implements `IntoDiagnosticArg` and `Clone`. Makes it easier to write diagnostic structs that borrow something which implements `IntoDiagnosticArg`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30Use `Mutability::{is_mut, is_not}`Maybe Waffle-2/+2
2023-01-29Auto merge of #107435 - matthiaskrgr:rollup-if5h6yu, r=matthiaskrgrbors-0/+4
Rollup of 8 pull requests Successful merges: - #106618 (Disable `linux_ext` in wasm32 and fortanix rustdoc builds.) - #107097 (Fix def-use dominance check) - #107154 (library/std/sys_common: Define MIN_ALIGN for m68k-unknown-linux-gnu) - #107397 (Gracefully exit if --keep-stage flag is used on a clean source tree) - #107401 (remove the usize field from CandidateSource::AliasBound) - #107413 (make more pleasant to read) - #107422 (Also erase substs for new infcx in pin move error) - #107425 (Check for missing space between fat arrow and range pattern) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-29Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obkbors-2/+6
Use stable metric for const eval limit instead of current terminator-based logic This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only. The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made). Also see: #103877
2023-01-28Also erase substs for new infcx in pin move errorNilstrieb-0/+4
The code originally correctly erased the regions of the type it passed to the newly created infcx. But after the `fn_sig` query was made to return an `EarlyBinder<T>`, some substs that were around were substituted there without erasing their regions. They were then passed into the newly cerated infcx, which caused the ICE.
2023-01-26add method_substs to CallKindKyle Matsuda-4/+2
2023-01-26fix up subst_identity vs skip_binder; add some FIXMEs as identified in reviewKyle Matsuda-1/+3
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-4/+4
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-4/+4
2023-01-26Rollup merge of #106971 - oli-obk:tait_error, r=davidtwcoMatthias Krüger-12/+0
Handle diagnostics customization on the fluent side (for one specific diagnostic) r? ```@davidtwco```
2023-01-25Rollup merge of #106897 - estebank:issue-99430, r=davidtwcoMatthias Krüger-5/+38
Tweak E0597 CC #99430
2023-01-25Rollup merge of #105345 - yanchen4791:issue-103582-fix, r=jackh726Matthias Krüger-19/+40
Add hint for missing lifetime bound on trait object when type alias is used Fix issue #103582. The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl. The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.
2023-01-23During MirBorrowck, ignore ConstEvalCounterBryan Garza-3/+3
2023-01-23Revert "Move CtfeLimit to mir_const's set of passes"Bryan Garza-2/+2
This reverts commit 332542a92223b2800ed372d2d461921147f29477.
2023-01-23Move CtfeLimit to mir_const's set of passesBryan Garza-2/+2
2023-01-23Create stable metric to measure long computation in Const EvalBryan Garza-2/+6
This patch adds a `MirPass` that tracks the number of back-edges and function calls in the CFG, adds a new MIR instruction to increment a counter every time they are encountered during Const Eval, and emit a warning if a configured limit is breached.
2023-01-23Add hint for missing lifetime bound on trait object when type alias is usedyanchen4791-19/+40
2023-01-23fix: use LocalDefId instead of HirId in trait resVincenzo Palazzo-7/+5
use LocalDefId instead of HirId in trait resolution to simplify the obligation clause resolution Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-22assume MIR types are fully normalizedAli MJ Al-Nasrawy-3/+2
2023-01-22Update universal_regions.rsSamuel Moelius-1/+1
2023-01-21Auto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillotbors-8/+12
Lazy dominator tree construction in borrowck Motivated by the observation that sometimes constructed dominator tree was never queried.
2023-01-19even more unify Projection/Opaque in outlives codeAli MJ Al-Nasrawy-2/+2
2023-01-18Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obkbors-1/+1
Do not filter substs in `remap_generic_params_to_declaration_params`. The relevant filtering should have been performed by borrowck. Fixes https://github.com/rust-lang/rust/issues/105826 r? types
2023-01-18Rollup merge of #106747 - yanchen4791:issue-105507-fix, r=estebankMatthias Krüger-4/+121
Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB Fix for issue #105507 The problem: When generic associated types (GATs) are from higher-ranked trait bounds (HRTB), they are implied 'static requirement (see [Implied 'static requirement from higher-ranked trait bounds](https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds) for more details). If the user did not explicitly specify the `'static` lifetime when using the GAT, the current error message will only point out the type `does not live long enough` where the type is used, but not where the GAT is specified and how to fix the problem. The solution: Add notes at the span where the problematic GATs are specified and suggestions of how to fix the problem by adding `'static` lifetime at the right spans.
2023-01-17Lazy dominator tree construction in borrowckTomasz Miąsko-8/+12
Motivated by the observation that sometimes constructed dominator tree was never queried.
2023-01-17Add 'static lifetime suggestion when GAT implied 'static requirement from HRTByanchen4791-4/+121
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-14/+14
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17rework min_choice algorithm of member constraintsAli MJ Al-Nasrawy-11/+24
See the inline comments for the description of the new algorithm.
2023-01-17Handle diagnostics customization on the fluent sideOli Scherer-12/+0
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-14/+14
2023-01-17Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorinoMatthias Krüger-7/+2
Unify `Opaque`/`Projection` handling in region outlives code They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias` r? types
2023-01-17Account for method call and indexing when looking for inner-most path in ↵Esteban Küber-1/+3
expression
2023-01-17Account for field access when looking for inner-most path in expressionEsteban Küber-1/+2
2023-01-17Account for `*` when looking for inner-most path in expressionEsteban Küber-1/+3
2023-01-16Rollup merge of #106940 - oli-obk:tait_error, r=compiler-errorsMatthias Krüger-12/+21
Improve a TAIT error and add an error code plus documentation cc https://github.com/rust-lang/rust/issues/106858
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-12/+21
2023-01-15Tweak E0597Esteban Küber-5/+33
CC #99430
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-27/+21
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-5/+1
2023-01-14Fix some missed double spaces.André Vennberg-1/+1
2023-01-14Removed various double spaces in compiler source comments.André Vennberg-1/+1
2023-01-13Unify Opaque/Projection handling in region outlives codeMichael Goulet-7/+2
2023-01-13Rollup merge of #106641 - chenyukang:yukang/fix-105761-segguest-this, r=estebankMatthias Krüger-5/+145
Provide help on closures capturing self causing borrow checker errors Fixes #105761 r? ````@estebank````
2023-01-12Fix ICE formattingEsteban Küber-1/+1
2023-01-12take care when there is no args in method callyukang-14/+12
2023-01-12Provide help on closures capturing self causing borrow checker errorsyukang-5/+147
2023-01-11Do not filter substs in `remap_generic_params_to_declaration_params`.Camille GILLOT-1/+1
The relevant filtering should have been performed by borrowck.
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-3/+3