Note about object lifetime defaults in does not live long enough error
This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose.
This commit is contained in:
@@ -341,7 +341,11 @@ pub enum ConstraintCategory<'tcx> {
|
||||
UseAsConst,
|
||||
UseAsStatic,
|
||||
TypeAnnotation,
|
||||
Cast,
|
||||
Cast {
|
||||
/// Whether this is an unsizing cast and if yes, this contains the target type.
|
||||
/// Region variables are erased to ReErased.
|
||||
unsize_to: Option<Ty<'tcx>>,
|
||||
},
|
||||
|
||||
/// A constraint that came from checking the body of a closure.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user