rust/compiler/rustc_borrowck/src
Matthias Krüger d26e07b91a
Rollup merge of #106747 - yanchen4791:issue-105507-fix, r=estebank
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-18 06:59:20 +01:00
..
constraints Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obk 2022-12-20 07:27:01 +00:00
diagnostics Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB 2023-01-17 11:52:45 -08:00
region_infer Rollup merge of #106747 - yanchen4791:issue-105507-fix, r=estebank 2023-01-18 06:59:20 +01:00
type_check Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
borrow_set.rs rustc_borrowck: remove ref patterns 2022-12-06 14:45:58 +00:00
borrowck_errors.rs Detect closures assigned to binding in block 2023-01-05 21:29:36 +00:00
constraint_generation.rs lint auto pass 2022-11-09 20:42:16 +08:00
consumers.rs Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
dataflow.rs A few small cleanups for newtype_index 2022-12-18 21:47:28 +01:00
def_use.rs lint auto pass 2022-11-09 20:42:16 +08:00
facts.rs Use fmt named parameters in rustc_borrowck 2023-01-06 19:34:45 -05:00
invalidation.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lib.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
location.rs A few small cleanups for newtype_index 2022-12-18 21:47:28 +01:00
member_constraints.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
nll.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
path_utils.rs lint auto pass 2022-11-09 20:42:16 +08:00
place_ext.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
places_conflict.rs Removed various double spaces in compiler source comments. 2023-01-14 17:34:59 +01:00
prefixes.rs lint auto pass 2022-11-09 20:42:16 +08:00
renumber.rs lint auto pass 2022-11-09 20:42:16 +08:00
session_diagnostics.rs Improve a TAIT error and add an error code plus documentation 2023-01-16 16:54:14 +00:00
universal_regions.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
used_muts.rs lint auto pass 2022-11-09 20:42:16 +08:00