Skip to content

Commit 46b885f

Browse files
committed
Fix stylistic mistakes
1 parent 22d3f66 commit 46b885f

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/librustc/mir/interpret/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,12 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
380380
Layout(_) =>
381381
"rustc layout computation failed",
382382
UnterminatedCString(_) =>
383-
"attempted to get length of a null terminated string, but no null found before end
383+
"attempted to get length of a null terminated string, but no null found before end \
384384
of allocation",
385385
HeapAllocZeroBytes =>
386386
"tried to re-, de- or allocate zero bytes on the heap",
387387
HeapAllocNonPowerOfTwoAlignment(_) =>
388-
"tried to re-, de-, or allocate heap memory with alignment that is not a power of
388+
"tried to re-, de-, or allocate heap memory with alignment that is not a power of \
389389
two",
390390
Unreachable =>
391391
"entered unreachable code",

src/librustc_mir/interpret/eval_context.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,11 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
392392
Ok(Value::new_slice(Scalar::Ptr(ptr), s.len() as u64, self.tcx.tcx))
393393
}
394394

395-
pub(super) fn resolve(&self, def_id: DefId, substs: &'tcx Substs<'tcx>)
396-
-> EvalResult<'tcx, ty::Instance<'tcx>> {
395+
pub(super) fn resolve(
396+
&self,
397+
def_id: DefId,
398+
substs: &'tcx Substs<'tcx>
399+
) -> EvalResult<'tcx, ty::Instance<'tcx>> {
397400
trace!("resolve: {:?}, {:#?}", def_id, substs);
398401
trace!("substs: {:#?}", self.substs());
399402
trace!("param_env: {:#?}", self.param_env);
@@ -422,7 +425,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
422425
let did = instance.def_id();
423426
if did.is_local()
424427
&& self.tcx.has_typeck_tables(did)
425-
&& self.tcx.typeck_tables_of(did).tainted_by_errors {
428+
&& self.tcx.typeck_tables_of(did).tainted_by_errors
429+
{
426430
return err!(TypeckError);
427431
}
428432
trace!("load mir {:?}", instance);
@@ -777,7 +781,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
777781
last_span = Some(span);
778782
}
779783
let location = if self.tcx.def_key(instance.def_id()).disambiguated_data.data
780-
== DefPathData::ClosureExpr {
784+
== DefPathData::ClosureExpr
785+
{
781786
"closure".to_owned()
782787
} else {
783788
instance.to_string()

src/librustc_mir/interpret/place.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
773773
/// Turn a place that is a dyn trait (i.e., PlaceExtra::Vtable and the appropriate layout)
774774
/// or a slice into the specific fixed-size place and layout that is given by the vtable/len.
775775
/// This "unpacks" the existential quantifier, so to speak.
776-
pub fn unpack_unsized_mplace(&self, mplace: MPlaceTy<'tcx>)
777-
-> EvalResult<'tcx, MPlaceTy<'tcx>> {
776+
pub fn unpack_unsized_mplace(
777+
&self,
778+
mplace: MPlaceTy<'tcx>
779+
) -> EvalResult<'tcx, MPlaceTy<'tcx>> {
778780
trace!("Unpacking {:?} ({:?})", *mplace, mplace.layout.ty);
779781
let layout = match mplace.extra {
780782
PlaceExtra::Vtable(vtable) => {

0 commit comments

Comments
 (0)