Skip to content

Commit 37db3db

Browse files
committed
Fixed long strings
1 parent 22beeb4 commit 37db3db

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/librustc/mir/interpret/error.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
325325
ReadForeignStatic =>
326326
"tried to read from foreign (extern) static",
327327
InvalidPointerMath =>
328-
"attempted to do invalid arithmetic on pointers that would leak base addresses, e.g. comparing pointers into different allocations",
328+
"attempted to do invalid arithmetic on pointers that would leak base addresses, \
329+
e.g. comparing pointers into different allocations",
329330
ReadUndefBytes =>
330331
"attempted to read undefined bytes",
331332
DeadLocal =>
@@ -379,11 +380,13 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
379380
Layout(_) =>
380381
"rustc layout computation failed",
381382
UnterminatedCString(_) =>
382-
"attempted to get length of a null terminated string, but no null found before end of allocation",
383+
"attempted to get length of a null terminated string, but no null found before end
384+
of allocation",
383385
HeapAllocZeroBytes =>
384386
"tried to re-, de- or allocate zero bytes on the heap",
385387
HeapAllocNonPowerOfTwoAlignment(_) =>
386-
"tried to re-, de-, or allocate heap memory with alignment that is not a power of two",
388+
"tried to re-, de-, or allocate heap memory with alignment that is not a power of
389+
two",
387390
Unreachable =>
388391
"entered unreachable code",
389392
Panic { .. } =>
@@ -445,8 +448,8 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
445448
kind, ptr, len, lock)
446449
}
447450
InvalidMemoryLockRelease { ptr, len, frame, ref lock } => {
448-
write!(f, "frame {} tried to release memory write lock at {:?}, size {}, but cannot release lock {:?}",
449-
frame, ptr, len, lock)
451+
write!(f, "frame {} tried to release memory write lock at {:?}, size {}, but \
452+
cannot release lock {:?}", frame, ptr, len, lock)
450453
}
451454
DeallocatedLockedMemory { ptr, ref lock } => {
452455
write!(f, "tried to deallocate memory at {:?} in conflict with lock {:?}",
@@ -457,7 +460,8 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
457460
}
458461
NoMirFor(ref func) => write!(f, "no mir for `{}`", func),
459462
FunctionPointerTyMismatch(sig, got) =>
460-
write!(f, "tried to call a function with sig {} through a function pointer of type {}", sig, got),
463+
write!(f, "tried to call a function with sig {} through a \
464+
function pointer of type {}", sig, got),
461465
BoundsCheck { ref len, ref index } =>
462466
write!(f, "index out of bounds: the len is {:?} but the index is {:?}", len, index),
463467
ReallocatedWrongMemoryKind(ref old, ref new) =>
@@ -480,7 +484,8 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
480484
MachineError(ref inner) =>
481485
write!(f, "{}", inner),
482486
IncorrectAllocationInformation(size, size2, align, align2) =>
483-
write!(f, "incorrect alloc info: expected size {} and align {}, got size {} and align {}", size.bytes(), align.abi(), size2.bytes(), align2.abi()),
487+
write!(f, "incorrect alloc info: expected size {} and align {}, got size {} and \
488+
align {}", size.bytes(), align.abi(), size2.bytes(), align2.abi()),
484489
Panic { ref msg, line, col, ref file } =>
485490
write!(f, "the evaluated program panicked at '{}', {}:{}:{}", msg, file, line, col),
486491
_ => write!(f, "{}", self.description()),

0 commit comments

Comments
 (0)