Auto merge of #9610 - Jarcho:fix-9608, r=Alexendoo
Don't suggest moving tuple structs with a significant drop to late evaluation fixes #9608 changelog: Don't suggest moving tuple structs with a significant drop to late evaluation
This commit is contained in:
commit
cf72565a12
|
@ -120,7 +120,7 @@ fn expr_eagerness<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> EagernessS
|
||||||
.expr_ty(e)
|
.expr_ty(e)
|
||||||
.has_significant_drop(self.cx.tcx, self.cx.param_env)
|
.has_significant_drop(self.cx.tcx, self.cx.param_env)
|
||||||
{
|
{
|
||||||
self.eagerness = Lazy;
|
self.eagerness = ForceNoChange;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -225,4 +225,15 @@ mod issue8239 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod issue9608 {
|
||||||
|
fn sig_drop() {
|
||||||
|
enum X {
|
||||||
|
X(std::fs::File),
|
||||||
|
Y(u32),
|
||||||
|
}
|
||||||
|
|
||||||
|
let _ = None.unwrap_or(X::Y(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -225,4 +225,15 @@ mod issue8239 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod issue9608 {
|
||||||
|
fn sig_drop() {
|
||||||
|
enum X {
|
||||||
|
X(std::fs::File),
|
||||||
|
Y(u32),
|
||||||
|
}
|
||||||
|
|
||||||
|
let _ = None.unwrap_or(X::Y(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Reference in New Issue