Skip to content

Commit 70e175b

Browse files
author
hyd-dev
committed
Add missing newline to error message of the default OOM hook
1 parent 25f6938 commit 70e175b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/std/src/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ pub fn take_alloc_error_hook() -> fn(Layout) {
316316
}
317317

318318
fn default_alloc_error_hook(layout: Layout) {
319-
dumb_print(format_args!("memory allocation of {} bytes failed", layout.size()));
319+
dumb_print(format_args!("memory allocation of {} bytes failed\n", layout.size()));
320320
}
321321

322322
#[cfg(not(test))]

src/test/ui/default-alloc-error-hook.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ fn main() {
1616
let me = env::current_exe().unwrap();
1717
let output = Command::new(&me).arg("next").output().unwrap();
1818
assert!(!output.status.success(), "{:?} is a success", output.status);
19-
assert_eq!(str::from_utf8(&output.stderr).unwrap(), "memory allocation of 42 bytes failed");
19+
assert_eq!(str::from_utf8(&output.stderr).unwrap(), "memory allocation of 42 bytes failed\n");
2020
}

0 commit comments

Comments
 (0)