rustc_mir: use the right type for associated const literals.
This commit is contained in:
parent
9107ec1acd
commit
2ff337a8e2
2 changed files with 6 additions and 6 deletions
|
@ -927,7 +927,7 @@ fn convert_path_expr<'a, 'tcx>(
|
|||
ExprKind::Literal {
|
||||
literal: cx.tcx.mk_const(ty::Const {
|
||||
val: ConstValue::Unevaluated(def_id, substs),
|
||||
ty: cx.tcx.type_of(def_id),
|
||||
ty: cx.tables().node_type(expr.hir_id),
|
||||
}),
|
||||
user_ty,
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ error[E0597]: `o2` does not live long enough
|
|||
--> $DIR/dropck_trait_cycle_checked.rs:111:13
|
||||
|
|
||||
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
|
||||
| -------- cast requires that `o2` is borrowed for `'static`
|
||||
| -------- cast requires that `o2` is borrowed for `'static`
|
||||
LL | o1.set0(&o2);
|
||||
| ^^^ borrowed value does not live long enough
|
||||
...
|
||||
|
@ -13,7 +13,7 @@ error[E0597]: `o3` does not live long enough
|
|||
--> $DIR/dropck_trait_cycle_checked.rs:112:13
|
||||
|
|
||||
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
|
||||
| -------- cast requires that `o3` is borrowed for `'static`
|
||||
| -------- cast requires that `o3` is borrowed for `'static`
|
||||
LL | o1.set0(&o2);
|
||||
LL | o1.set1(&o3);
|
||||
| ^^^ borrowed value does not live long enough
|
||||
|
@ -37,7 +37,7 @@ error[E0597]: `o3` does not live long enough
|
|||
--> $DIR/dropck_trait_cycle_checked.rs:114:13
|
||||
|
|
||||
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
|
||||
| -------- cast requires that `o3` is borrowed for `'static`
|
||||
| -------- cast requires that `o3` is borrowed for `'static`
|
||||
...
|
||||
LL | o2.set1(&o3);
|
||||
| ^^^ borrowed value does not live long enough
|
||||
|
@ -49,7 +49,7 @@ error[E0597]: `o1` does not live long enough
|
|||
--> $DIR/dropck_trait_cycle_checked.rs:115:13
|
||||
|
|
||||
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
|
||||
| -------- cast requires that `o1` is borrowed for `'static`
|
||||
| -------- cast requires that `o1` is borrowed for `'static`
|
||||
...
|
||||
LL | o3.set0(&o1);
|
||||
| ^^^ borrowed value does not live long enough
|
||||
|
@ -61,7 +61,7 @@ error[E0597]: `o2` does not live long enough
|
|||
--> $DIR/dropck_trait_cycle_checked.rs:116:13
|
||||
|
|
||||
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
|
||||
| -------- cast requires that `o2` is borrowed for `'static`
|
||||
| -------- cast requires that `o2` is borrowed for `'static`
|
||||
...
|
||||
LL | o3.set1(&o2);
|
||||
| ^^^ borrowed value does not live long enough
|
||||
|
|
Loading…
Add table
Reference in a new issue