@@ -34,13 +34,13 @@ pub(crate) enum RegionNameSource {
34
34
/// The `'static` region.
35
35
Static ,
36
36
/// The free region corresponding to the environment of a closure.
37
- SynthesizedFreeEnvRegion ( Span , & ' static str ) ,
37
+ SynthesizedFreeEnvRegion ( Span , String ) ,
38
38
/// The region corresponding to an argument.
39
39
AnonRegionFromArgument ( RegionNameHighlight ) ,
40
40
/// The region corresponding to a closure upvar.
41
- AnonRegionFromUpvar ( Span , Symbol ) ,
41
+ AnonRegionFromUpvar ( Span , String ) ,
42
42
/// The region corresponding to the return type of a closure.
43
- AnonRegionFromOutput ( RegionNameHighlight , & ' static str ) ,
43
+ AnonRegionFromOutput ( RegionNameHighlight , String ) ,
44
44
/// The region from a type yielded by a generator.
45
45
AnonRegionFromYieldTy ( Span , String ) ,
46
46
/// An anonymous region from an async fn.
@@ -110,7 +110,7 @@ impl RegionName {
110
110
}
111
111
RegionNameSource :: SynthesizedFreeEnvRegion ( span, note) => {
112
112
diag. span_label ( * span, format ! ( "lifetime `{self}` represents this closure's body" ) ) ;
113
- diag. note ( * note) ;
113
+ diag. note ( note) ;
114
114
}
115
115
RegionNameSource :: AnonRegionFromArgument ( RegionNameHighlight :: CannotMatchHirTy (
116
116
span,
@@ -350,7 +350,10 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
350
350
351
351
Some ( RegionName {
352
352
name : region_name,
353
- source : RegionNameSource :: SynthesizedFreeEnvRegion ( fn_decl_span, note) ,
353
+ source : RegionNameSource :: SynthesizedFreeEnvRegion (
354
+ fn_decl_span,
355
+ note. to_string ( ) ,
356
+ ) ,
354
357
} )
355
358
}
356
359
@@ -675,7 +678,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
675
678
676
679
Some ( RegionName {
677
680
name : region_name,
678
- source : RegionNameSource :: AnonRegionFromUpvar ( upvar_span, upvar_name) ,
681
+ source : RegionNameSource :: AnonRegionFromUpvar ( upvar_span, upvar_name. to_string ( ) ) ,
679
682
} )
680
683
}
681
684
@@ -753,7 +756,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
753
756
754
757
Some ( RegionName {
755
758
name : self . synthesize_region_name ( ) ,
756
- source : RegionNameSource :: AnonRegionFromOutput ( highlight, mir_description) ,
759
+ source : RegionNameSource :: AnonRegionFromOutput ( highlight, mir_description. to_string ( ) ) ,
757
760
} )
758
761
}
759
762
0 commit comments