let mut labels = vec![(
span,
if &name == "_" {
- "cannot infer type".to_string()
+ "cannot infer type".to_owned()
} else {
format!("cannot infer type for `{}`", name)
},
// ```
labels.clear();
labels.push(
- (pattern.span, "consider giving this closure parameter a type".to_string()));
+ (pattern.span, "consider giving this closure parameter a type".to_owned()));
} else if let Some(pattern) = local_visitor.found_local_pattern {
if let Some(simple_ident) = pattern.simple_ident() {
match pattern.span.compiler_desugaring_kind() {
format!("consider giving `{}` a type", simple_ident))),
Some(CompilerDesugaringKind::ForLoop) => labels.push((
pattern.span,
- "the element type for this iterator is not specified".to_string(),
+ "the element type for this iterator is not specified".to_owned(),
)),
_ => {}
}
} else {
- labels.push((pattern.span, "consider giving the pattern a type".to_string()));
+ labels.push((pattern.span, "consider giving the pattern a type".to_owned()));
}
}
(None, None) => {
let (main_label_1, span_label_1) = if ty_sup.id == ty_sub.id {
(
- "this type is declared with multiple lifetimes...".to_string(),
- "...but data with one lifetime flows into the other here".to_string()
+ "this type is declared with multiple lifetimes...".to_owned(),
+ "...but data with one lifetime flows into the other here".to_owned()
)
} else {
(
- "these two types are declared with different lifetimes...".to_string(),
+ "these two types are declared with different lifetimes...".to_owned(),
format!(
"...but data{} flows{} here",
span_label_var1,
ty_sub.span,
ret_span,
"this parameter and the return type are declared \
- with different lifetimes...".to_string()
+ with different lifetimes...".to_owned()
,
format!("...but data{} is returned here", span_label_var1),
),
ty_sup.span,
ret_span,
"this parameter and the return type are declared \
- with different lifetimes...".to_string()
+ with different lifetimes...".to_owned()
,
format!("...but data{} is returned here", span_label_var1),
),
match *e {
Edge::Constraint(ref c) =>
dot::LabelText::label(format!("{:?}", self.map.get(c).unwrap())),
- Edge::EnclScope(..) => dot::LabelText::label("(enclosed)".to_string()),
+ Edge::EnclScope(..) => dot::LabelText::label("(enclosed)".to_owned()),
}
}
}