mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
![]() 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. |
||
---|---|---|
.. | ||
constraints | ||
diagnostics | ||
region_infer | ||
type_check | ||
borrow_set.rs | ||
borrowck_errors.rs | ||
constraint_generation.rs | ||
consumers.rs | ||
dataflow.rs | ||
def_use.rs | ||
facts.rs | ||
invalidation.rs | ||
lib.rs | ||
location.rs | ||
member_constraints.rs | ||
nll.rs | ||
path_utils.rs | ||
place_ext.rs | ||
places_conflict.rs | ||
prefixes.rs | ||
renumber.rs | ||
session_diagnostics.rs | ||
universal_regions.rs | ||
used_muts.rs |