impl fmt::Display for ConstraintCategory {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ // Must end with a space. Allows for empty names to be provided.
match self {
- ConstraintCategory::Assignment => write!(f, "assignment"),
- ConstraintCategory::Return => write!(f, "return"),
- ConstraintCategory::Cast => write!(f, "cast"),
- ConstraintCategory::CallArgument => write!(f, "argument"),
- _ => write!(f, "free region"),
+ ConstraintCategory::Assignment => write!(f, "assignment "),
+ ConstraintCategory::Return => write!(f, "return "),
+ ConstraintCategory::Cast => write!(f, "cast "),
+ ConstraintCategory::CallArgument => write!(f, "argument "),
+ _ => write!(f, ""),
}
}
}
},
_ => {
diag.span_label(span, format!(
- "{} requires that `{}` must outlive `{}`",
+ "{}requires that `{}` must outlive `{}`",
category, fr_name, outlived_fr_name,
));
},
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
| ----------^^^^^-----------------
| | | |
- | | | free region requires that `'1` must outlive `'2`
+ | | | requires that `'1` must outlive `'2`
| | has type `&'1 i32`
| lifetime `'2` appears in return type
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| - let's call the lifetime of this reference `'1`
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^ free region requires that `'1` must outlive `'static`
+ | ^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:21:9
|
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^ free region requires that `'a` must outlive `'static`
+ | ^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors
--> $DIR/issue-10291.rs:12:5
|
LL | drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ free region requires that `'x` must outlive `'static`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'x` must outlive `'static`
error: aborting due to previous error
| ||_________^
LL | ||| x.push(())
LL | ||| }
- | |||_________^ free region requires that `'1` must outlive `'2`
+ | |||_________^ requires that `'1` must outlive `'2`
LL | || };
| || -
| ||_____|
--> $DIR/issue-52213.rs:13:11
|
LL | ((u,),) => u,
- | ^ free region requires that `'a` must outlive `'b`
+ | ^ requires that `'a` must outlive `'b`
error: aborting due to previous error
--> $DIR/escape-argument-callee.rs:36:45
|
LL | let mut closure = expect_sig(|p, y| *p = y);
- | - - ^^^^^^ free region requires that `'1` must outlive `'2`
+ | - - ^^^^^^ requires that `'1` must outlive `'2`
| | |
| | has type `&'1 i32`
| has type `&mut &'2 i32`
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
|
LL | &*x
- | ^^^ free region requires that `'a` must outlive `'static`
+ | ^^^ requires that `'a` must outlive `'static`
error: aborting due to previous error