Migrate SuggestBoxingForReturnImplTrait, Fix typo in infer_fn_consider_casting
This commit is contained in:
parent
d56b304bc8
commit
23b8567a78
3 changed files with 38 additions and 21 deletions
|
@ -1261,7 +1261,7 @@ pub struct FnItemsAreDistinct;
|
|||
pub struct FnUniqTypes;
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[help(infer_fn_uniq_types)]
|
||||
#[help(infer_fn_consider_casting)]
|
||||
pub struct FnConsiderCasting {
|
||||
pub casting: String,
|
||||
}
|
||||
|
@ -1317,3 +1317,21 @@ pub enum SuggestAccessingField<'a> {
|
|||
ty: Ty<'a>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum SuggestBoxingForReturnImplTrait {
|
||||
#[multipart_suggestion(infer_sbfrit_change_return_type, applicability = "maybe-incorrect")]
|
||||
ChangeReturnType {
|
||||
#[suggestion_part(code = "Box<dyn")]
|
||||
start_sp: Span,
|
||||
#[suggestion_part(code = ">")]
|
||||
end_sp: Span,
|
||||
},
|
||||
#[multipart_suggestion(infer_sbfrit_box_return_expr, applicability = "maybe-incorrect")]
|
||||
BoxReturnExpr {
|
||||
#[suggestion_part(code = "Box::new(")]
|
||||
starts: Vec<Span>,
|
||||
#[suggestion_part(code = ")")]
|
||||
ends: Vec<Span>,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue