diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-16 21:59:49 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-21 23:59:35 +0200 |
| commit | 8752a560b9f50e04c38ab75e2b5c37d03d3214d9 (patch) | |
| tree | 3b02e3fbd070774813f058c6c7b240ae5fba1c42 /src | |
| parent | 1d2726726f8f3128e98191e4c6cb94bd76d0ddd4 (diff) | |
Lift: take self by value
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/clean/utils.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 91941b00be2..bfc74705818 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1563,7 +1563,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> { ty::Str => Primitive(PrimitiveType::Str), ty::Slice(ty) => Slice(box ty.clean(cx)), ty::Array(ty, n) => { - let mut n = cx.tcx.lift(&n).expect("array lift failed"); + let mut n = cx.tcx.lift(n).expect("array lift failed"); n = n.eval(cx.tcx, ty::ParamEnv::reveal_all()); let n = print_const(cx, n); Array(box ty.clean(cx), n) @@ -1573,7 +1573,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> { BorrowedRef { lifetime: r.clean(cx), mutability: mutbl, type_: box ty.clean(cx) } } ty::FnDef(..) | ty::FnPtr(_) => { - let ty = cx.tcx.lift(self).expect("FnPtr lift failed"); + let ty = cx.tcx.lift(*self).expect("FnPtr lift failed"); let sig = ty.fn_sig(cx.tcx); let def_id = DefId::local(CRATE_DEF_INDEX); BareFunction(box BareFunctionDecl { @@ -1675,7 +1675,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> { ty::Opaque(def_id, substs) => { // Grab the "TraitA + TraitB" from `impl TraitA + TraitB`, // by looking up the bounds associated with the def_id. - let substs = cx.tcx.lift(&substs).expect("Opaque lift failed"); + let substs = cx.tcx.lift(substs).expect("Opaque lift failed"); let bounds = cx .tcx .explicit_item_bounds(def_id) diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 9a7f1964a11..b0ed233f5ec 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -503,7 +503,7 @@ fn print_const_with_custom_print_scalar(cx: &DocContext<'_>, ct: &'tcx ty::Const format!("{}{}", format_integer_with_underscore_sep(&data.to_string()), ui.name_str()) } (ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data, .. })), ty::Int(i)) => { - let ty = cx.tcx.lift(&ct.ty).unwrap(); + let ty = cx.tcx.lift(ct.ty).unwrap(); let size = cx.tcx.layout_of(ty::ParamEnv::empty().and(ty)).unwrap().size; let sign_extended_data = sign_extend(data, size) as i128; |
