Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup #368

Merged
merged 46 commits into from
May 9, 2018
Merged

Rustup #368

merged 46 commits into from
May 9, 2018

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 1, 2018

cc @bjorn3

@bjorn3
Copy link
Member

bjorn3 commented May 1, 2018

Appveyor:

cargo build --locked --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: the lock file needs to be updated but --locked was passed to prevent this
Command exited with code 101

@oli-obk
Copy link
Contributor Author

oli-obk commented May 1, 2018

that's easy to fix... travis is failing with

3:TRACE:miri::fn_call: eval_fn_call: Instance {
    def: Item(
        DefId(1/0:4419 ~ std[c420]::rt[0]::lang_start_internal[0])
    ),
    substs: Slice(
        []
    )
}, Some(
    (
        Ptr {
            ptr: Pointer {
                primval: Ptr(
                    MemoryPointer {
                        alloc_id: AllocId(
                            550
                        ),
                        offset: 0
                    }
                )
            },
            align: Align {
                abi_pow2: 3,
                pref_pow2: 3
            },
            extra: None
        },
        bb1
    )
)
error: internal compiler error: no mir for `std::rt::lang_start_internal`

and I can reproduce locally :(

miri/fn_call.rs Outdated
@@ -4,6 +4,7 @@ use rustc::hir::def_id::{DefId, CRATE_DEF_INDEX};
use rustc::mir;
use rustc_target::spec::abi::Abi;
use rustc_data_structures::indexed_vec::Idx;
use rustc_target::spec::abi::Abi;
Copy link
Member

@bjorn3 bjorn3 May 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of two lines above

@bjorn3
Copy link
Member

bjorn3 commented May 6, 2018

that's easy to fix... travis is failing with

3:TRACE:miri::fn_call: eval_fn_call: Instance {

(...)

)
error: internal compiler error: no mir for `std::rt::lang_start_internal`

and I can reproduce locally :(

That is because std::rt::lang_start_internal doesn't have mir available, while std::rt::lang_start does, because it is generic. Because std::rt::lang_start has mir available, https://github.com/solson/miri/pull/368/files#diff-9dbaba2e8bdecf323e7bade8fa7fcb97L135 thinks it is fine to use it as wrapper.

Reproduction using modified priroda, to use the same logic as miri for the first frame: https://screenshots.firefox.com/HDUYaPBZm1sfgpdk/localhost

@bjorn3
Copy link
Member

bjorn3 commented May 6, 2018

With -Zalways-encode-mir i am getting:

error: no mir for `alloc::alloc::::__rust_alloc`

error[E0080]: constant evaluation error
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/alloc.rs:78:19
   |
78 |         let ptr = __rust_alloc(layout.size(), layout.align());
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no mir for `alloc::alloc::::__rust_alloc`
   |
note: inside call to `<std::heap::Global as std::heap::GlobalAlloc>::alloc`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/alloc.rs:112:22
   |
112|         NonNull::new(GlobalAlloc::alloc(self, layout)).ok_or(AllocErr)
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::heap::Global as std::heap::Alloc>::alloc`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:102:21
   |
102|                     a.alloc(Layout::from_size_align(alloc_size, align).unwrap())
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<alloc::raw_vec::RawVec<T, A>><u8, std::heap::Global>::allocate_in`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:146:9
   |
146|         RawVec::allocate_in(cap, false, Global)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<alloc::raw_vec::RawVec<T>><u8>::with_capacity`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/vec.rs:365:18
   |
365|             buf: RawVec::with_capacity(capacity),
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::vec::Vec<T>><u8>::with_capacity`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/slice.rs:168:26
   |
168|         let mut vector = Vec::with_capacity(s.len());
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::slice::hack::to_vec::<u8>`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/slice.rs:374:9
   |
374|         hack::to_vec(self)
   |         ^^^^^^^^^^^^^^^^^^
note: inside call to `std::slice::<impl [T]><u8>::to_vec`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/slice.rs:620:9
   |
620|         self.to_vec()
   |         ^^^^^^^^^^^^^
note: inside call to `std::slice::<impl std::borrow::ToOwned for [T]><u8>::to_owned`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/str.rs:150:46
   |
150|         unsafe { String::from_utf8_unchecked(self.as_bytes().to_owned()) }
   |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::str::<impl std::borrow::ToOwned for str>::to_owned`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:50:39
   |
50 |         let thread = Thread::new(Some("main".to_owned()));
   |                                       ^^^^^^^^^^^^^^^^^
note: inside call to `std::rt::lang_start_internal`
  --> /home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
   |
74 |     lang_start_internal(&move || main().report(), argc, argv)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.

@oli-obk
Copy link
Contributor Author

oli-obk commented May 6, 2018

O.m.g. so obvious in hindsight!

Variants::Tagged { ref tag, .. } => {
assert_eq!(i, 0);
return Ok(tag.value.to_ty(tcx))
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be duplicated, just write tag: ref discr like the NicheFilling case does with niche.

@bjorn3
Copy link
Member

bjorn3 commented May 7, 2018

Error when validate_op is enabled:

error: internal compiler error: librustc_mir/interpret/eval_context.rs:1334: unsized primval ptr read from std::heap::Opaque

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:467
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::session::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::session::opt_span_bug_fmt
  13: rustc::session::bug_fmt
  14: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::read_ptr
             at ./<bug macros>:4
  15: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::try_read_value
             at /checkout/src/librustc_mir/interpret/eval_context.rs:1404
  16: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::read_value
             at /checkout/src/librustc_mir/interpret/eval_context.rs:1303
  17: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::follow_by_ref_value
             at /checkout/src/librustc_mir/interpret/eval_context.rs:1066
  18: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::validation::EvalContextExt<'tcx>>::validate
             at miri/validation.rs:647
  19: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::validation::EvalContextExt<'tcx>>::validation_op
             at miri/validation.rs:221
  20: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'mir, 'tcx>>::validation_op
             at miri/lib.rs:452
  21: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::statement
             at /checkout/src/librustc_mir/interpret/step.rs:85
  22: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::step
             at /checkout/src/librustc_mir/interpret/step.rs:35
  23: miri::eval_main::run_main
             at miri/lib.rs:157
  24: miri::eval_main
             at miri/lib.rs:170
  25: miri::after_analysis
             at miri/bin/miri.rs:147
  26: <miri::MiriCompilerCalls as rustc_driver::CompilerCalls<'a>>::build_controller::{{closure}}
             at miri/bin/miri.rs:88
  27: rustc::ty::context::tls::with_context
  28: rustc_driver::driver::compile_input::{{closure}}
  29: rustc::ty::context::tls::enter_context
  30: <std::thread::local::LocalKey<T>>::with
  31: rustc::ty::context::TyCtxt::create_and_enter
  32: rustc_driver::driver::compile_input
  33: rustc_driver::run_compiler_impl
  34: <scoped_tls::ScopedKey<T>>::set
  35: syntax::with_globals
  36: rustc_driver::run_compiler
  37: miri::main
             at miri/bin/miri.rs:237
  38: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  39: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  40: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  41: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  42: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  43: main
  44: __libc_start_main
  45: _start

@RalfJung
Copy link
Member

RalfJung commented May 7, 2018

Yeah I suggest to just disable validation for now.

@bjorn3
Copy link
Member

bjorn3 commented May 9, 2018

Four run-pass-fullmir tests failed all of them inside memchr while trying to print:

error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'/n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
[...]
failures:

---- [ui] run-pass-fullmir/catch.rs stdout ----
	normalized stdout:


expected stdout:
1


diff of stdout:

-1
-

The actual stdout differed from the expected stdout.
Actual stdout saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/catch.stdout
normalized stderr:
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'/n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1168:38
    |
1168|                 write_prefix(self)?; self.buf.write_str(buf)
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::pad_integral`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/num.rs:256:13
    |
256 |             f.pad_integral(is_nonnegative, "", buf_slice)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `core::fmt::num::<impl std::fmt::Display for i32>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
    |
1102|         (value.formatter)(value.value, self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::run`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
    |
1049|                 formatter.run(arg)?;
    |                 ^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> $DIR/catch.rs:7:5
    |
7   |     println!("{}", i);
    |     ^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.


expected stderr:


diff of stderr:

+error: a raw memory access tried to access part of a pointer value as raw bytes
+
+error[E0080]: constant evaluation error
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
+    |
+106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
+    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
+    |
+note: inside call to `core::slice::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
+    |
+53  |         ::core::slice::memchr::memrchr(needle, haystack)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
+    |
+56  |     memrchr_specific(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
+    |
+55  |     ::sys::memchr::memrchr(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
+    |
+905 |         let i = match memchr::memrchr(b'/n', buf) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
+    |
+465 |         self.inner.borrow_mut().write(buf)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
+    |
+1111|             match self.write(buf) {
+    |                   ^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
+    |
+1171|                 match self.inner.write_all(s.as_bytes()) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1168:38
+    |
+1168|                 write_prefix(self)?; self.buf.write_str(buf)
+    |                                      ^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::Formatter::pad_integral`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/num.rs:256:13
+    |
+256 |             f.pad_integral(is_nonnegative, "", buf_slice)
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `core::fmt::num::<impl std::fmt::Display for i32>::fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
+    |
+1102|         (value.formatter)(value.value, self)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::Formatter::run`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
+    |
+1049|                 formatter.run(arg)?;
+    |                 ^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
+    |
+1182|         match fmt::write(&mut output, fmt) {
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
+    |
+459 |         self.lock().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
+    |
+686 |         global_s().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
+    |
+294 |               Ok(f(match *slot.get() {
+    |  ________________^
+295 | |                 Some(ref inner) => inner,
+296 | |                 None => self.init(slot),
+297 | |             }))
+    | |______________^
+note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
+    |
+680 |       let result = local_s.try_with(|s| {
+    |  __________________^
+681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
+682 | |             if let Some(w) = borrowed.as_mut() {
+683 | |                 return w.write_fmt(args);
+...   |
+686 | |         global_s().write_fmt(args)
+687 | |     }).unwrap_or_else(|_| {
+    | |______^
+note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
+    |
+701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::io::_print`
+   --> $DIR/catch.rs:7:5
+    |
+7   |     println!("{}", i);
+    |     ^^^^^^^^^^^^^^^^^^
+note: inside call to `main`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |                                  ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |                                                                           ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
+    |
+136 |     f()
+    |     ^^^
+note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
+    |
+310 |             ptr::write(&mut (*data).r, f());
+    |                                        ^^^
+note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
+    |
+306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
+307 | |         unsafe {
+308 | |             let data = data as *mut Data<F, R>;
+309 | |             let f = ptr::read(&mut (*data).f);
+310 | |             ptr::write(&mut (*data).r, f());
+311 | |         }
+312 | |     }
+    | |_____^
+note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
+    |
+374 |         panicking::try(f)
+    |         ^^^^^^^^^^^^^^^^^
+note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
+    |
+58  |           let exit_code = panic::catch_unwind(|| {
+    |  _________________________^
+59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+60  | |         });
+    | |__________^
+note: inside call to `std::rt::lang_start_internal`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
+

The actual stderr differed from the expected stderr.
Actual stderr saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/catch.stderr
To update references, run this command from build directory:
tests/run-pass-fullmir/update-references.sh '/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf' 'catch.rs'

error: 2 errors occurred comparing output.
status: exit code: 101
command: "target/debug/miri" "tests/run-pass-fullmir/catch.rs" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf" "--target=x86_64-apple-darwin" "-C" "prefer-dynamic" "-o" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/catch.stage-id" "-Zmiri-start-fn" "--sysroot" "/Users/bjorn/.xargo/HOST" "-Zmir-opt-level=0" "-Zmir-emit-validate=1" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/catch.stage-id.aux" "-A" "unused"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'\n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1168:38
    |
1168|                 write_prefix(self)?; self.buf.write_str(buf)
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::pad_integral`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/num.rs:256:13
    |
256 |             f.pad_integral(is_nonnegative, "", buf_slice)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `core::fmt::num::<impl std::fmt::Display for i32>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
    |
1102|         (value.formatter)(value.value, self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::run`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
    |
1049|                 formatter.run(arg)?;
    |                 ^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> tests/run-pass-fullmir/catch.rs:7:5
    |
7   |     println!("{}", i);
    |     ^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.

------------------------------------------

thread '[ui] run-pass-fullmir/catch.rs' panicked at 'explicit panic', /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: rand::prng::isaac64::Isaac64Rng::init::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:397
   6: compiletest_rs::runtest::TestCx::compare_output::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539
   7: compiletest_rs::runtest::TestCx::fatal_proc_rec
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:1639
   8: compiletest_rs::runtest::TestCx::run_ui_test
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2238
   9: compiletest_rs::runtest::TestCx::run_revision
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:140
  10: core::alloc::Layout::for_value
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:80
  11: compiletest_rs::make_test_closure::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/lib.rs:275
  12: <compiletest_rs::common::TestPaths as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:638
  13: <F as alloc::boxed::FnBox<A>>::call_box
  14: __rust_maybe_catch_panic

---- [ui] run-pass-fullmir/format.rs stdout ----
	normalized stdout:


expected stdout:
Hello 13


diff of stdout:

-Hello 13
-

The actual stdout differed from the expected stdout.
Actual stdout saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/format.stdout
normalized stderr:
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'/n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1048:17
    |
1048|                 formatter.buf.write_str(*piece)?;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> $DIR/format.rs:3:5
    |
3   |     println!("Hello {}", 13);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.


expected stderr:


diff of stderr:

+error: a raw memory access tried to access part of a pointer value as raw bytes
+
+error[E0080]: constant evaluation error
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
+    |
+106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
+    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
+    |
+note: inside call to `core::slice::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
+    |
+53  |         ::core::slice::memchr::memrchr(needle, haystack)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
+    |
+56  |     memrchr_specific(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
+    |
+55  |     ::sys::memchr::memrchr(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
+    |
+905 |         let i = match memchr::memrchr(b'/n', buf) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
+    |
+465 |         self.inner.borrow_mut().write(buf)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
+    |
+1111|             match self.write(buf) {
+    |                   ^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
+    |
+1171|                 match self.inner.write_all(s.as_bytes()) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1048:17
+    |
+1048|                 formatter.buf.write_str(*piece)?;
+    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
+    |
+1182|         match fmt::write(&mut output, fmt) {
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
+    |
+459 |         self.lock().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
+    |
+686 |         global_s().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
+    |
+294 |               Ok(f(match *slot.get() {
+    |  ________________^
+295 | |                 Some(ref inner) => inner,
+296 | |                 None => self.init(slot),
+297 | |             }))
+    | |______________^
+note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
+    |
+680 |       let result = local_s.try_with(|s| {
+    |  __________________^
+681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
+682 | |             if let Some(w) = borrowed.as_mut() {
+683 | |                 return w.write_fmt(args);
+...   |
+686 | |         global_s().write_fmt(args)
+687 | |     }).unwrap_or_else(|_| {
+    | |______^
+note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
+    |
+701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::io::_print`
+   --> $DIR/format.rs:3:5
+    |
+3   |     println!("Hello {}", 13);
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `main`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |                                  ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |                                                                           ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
+    |
+136 |     f()
+    |     ^^^
+note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
+    |
+310 |             ptr::write(&mut (*data).r, f());
+    |                                        ^^^
+note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
+    |
+306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
+307 | |         unsafe {
+308 | |             let data = data as *mut Data<F, R>;
+309 | |             let f = ptr::read(&mut (*data).f);
+310 | |             ptr::write(&mut (*data).r, f());
+311 | |         }
+312 | |     }
+    | |_____^
+note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
+    |
+374 |         panicking::try(f)
+    |         ^^^^^^^^^^^^^^^^^
+note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
+    |
+58  |           let exit_code = panic::catch_unwind(|| {
+    |  _________________________^
+59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+60  | |         });
+    | |__________^
+note: inside call to `std::rt::lang_start_internal`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
+

The actual stderr differed from the expected stderr.
Actual stderr saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/format.stderr
To update references, run this command from build directory:
tests/run-pass-fullmir/update-references.sh '/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf' 'format.rs'

error: 2 errors occurred comparing output.
status: exit code: 101
command: "target/debug/miri" "tests/run-pass-fullmir/format.rs" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf" "--target=x86_64-apple-darwin" "-C" "prefer-dynamic" "-o" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/format.stage-id" "-Zmiri-start-fn" "--sysroot" "/Users/bjorn/.xargo/HOST" "-Zmir-opt-level=0" "-Zmir-emit-validate=1" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/format.stage-id.aux" "-A" "unused"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'\n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1048:17
    |
1048|                 formatter.buf.write_str(*piece)?;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> tests/run-pass-fullmir/format.rs:3:5
    |
3   |     println!("Hello {}", 13);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.

------------------------------------------

thread '[ui] run-pass-fullmir/format.rs' panicked at 'explicit panic', /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: rand::prng::isaac64::Isaac64Rng::init::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:397
   6: compiletest_rs::runtest::TestCx::compare_output::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539
   7: compiletest_rs::runtest::TestCx::fatal_proc_rec
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:1639
   8: compiletest_rs::runtest::TestCx::run_ui_test
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2238
   9: compiletest_rs::runtest::TestCx::run_revision
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:140
  10: core::alloc::Layout::for_value
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:80
  11: compiletest_rs::make_test_closure::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/lib.rs:275
  12: <compiletest_rs::common::TestPaths as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:638
  13: <F as alloc::boxed::FnBox<A>>::call_box
  14: __rust_maybe_catch_panic

---- [ui] run-pass-fullmir/hello.rs stdout ----
	normalized stdout:


expected stdout:
Hello, world!


diff of stdout:

-Hello, world!
-

The actual stdout differed from the expected stdout.
Actual stdout saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/hello.stdout
normalized stderr:
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'/n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1056:9
    |
1056|         formatter.buf.write_str(*piece)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> $DIR/hello.rs:3:5
    |
3   |     println!("Hello, world!");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.


expected stderr:


diff of stderr:

+error: a raw memory access tried to access part of a pointer value as raw bytes
+
+error[E0080]: constant evaluation error
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
+    |
+106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
+    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
+    |
+note: inside call to `core::slice::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
+    |
+53  |         ::core::slice::memchr::memrchr(needle, haystack)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
+    |
+56  |     memrchr_specific(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
+    |
+55  |     ::sys::memchr::memrchr(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
+    |
+905 |         let i = match memchr::memrchr(b'/n', buf) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
+    |
+465 |         self.inner.borrow_mut().write(buf)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
+    |
+1111|             match self.write(buf) {
+    |                   ^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
+    |
+1171|                 match self.inner.write_all(s.as_bytes()) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1056:9
+    |
+1056|         formatter.buf.write_str(*piece)?;
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
+    |
+1182|         match fmt::write(&mut output, fmt) {
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
+    |
+459 |         self.lock().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
+    |
+686 |         global_s().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
+    |
+294 |               Ok(f(match *slot.get() {
+    |  ________________^
+295 | |                 Some(ref inner) => inner,
+296 | |                 None => self.init(slot),
+297 | |             }))
+    | |______________^
+note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
+    |
+680 |       let result = local_s.try_with(|s| {
+    |  __________________^
+681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
+682 | |             if let Some(w) = borrowed.as_mut() {
+683 | |                 return w.write_fmt(args);
+...   |
+686 | |         global_s().write_fmt(args)
+687 | |     }).unwrap_or_else(|_| {
+    | |______^
+note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
+    |
+701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::io::_print`
+   --> $DIR/hello.rs:3:5
+    |
+3   |     println!("Hello, world!");
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `main`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |                                  ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |                                                                           ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
+    |
+136 |     f()
+    |     ^^^
+note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
+    |
+310 |             ptr::write(&mut (*data).r, f());
+    |                                        ^^^
+note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
+    |
+306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
+307 | |         unsafe {
+308 | |             let data = data as *mut Data<F, R>;
+309 | |             let f = ptr::read(&mut (*data).f);
+310 | |             ptr::write(&mut (*data).r, f());
+311 | |         }
+312 | |     }
+    | |_____^
+note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
+    |
+374 |         panicking::try(f)
+    |         ^^^^^^^^^^^^^^^^^
+note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
+    |
+58  |           let exit_code = panic::catch_unwind(|| {
+    |  _________________________^
+59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+60  | |         });
+    | |__________^
+note: inside call to `std::rt::lang_start_internal`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
+

The actual stderr differed from the expected stderr.
Actual stderr saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/hello.stderr
To update references, run this command from build directory:
tests/run-pass-fullmir/update-references.sh '/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf' 'hello.rs'

error: 2 errors occurred comparing output.
status: exit code: 101
command: "target/debug/miri" "tests/run-pass-fullmir/hello.rs" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf" "--target=x86_64-apple-darwin" "-C" "prefer-dynamic" "-o" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/hello.stage-id" "-Zmiri-start-fn" "--sysroot" "/Users/bjorn/.xargo/HOST" "-Zmir-opt-level=0" "-Zmir-emit-validate=1" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/hello.stage-id.aux" "-A" "unused"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'\n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1056:9
    |
1056|         formatter.buf.write_str(*piece)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> tests/run-pass-fullmir/hello.rs:3:5
    |
3   |     println!("Hello, world!");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.

------------------------------------------

thread '[ui] run-pass-fullmir/hello.rs' panicked at 'explicit panic', /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: rand::prng::isaac64::Isaac64Rng::init::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:397
   6: compiletest_rs::runtest::TestCx::compare_output::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539
   7: compiletest_rs::runtest::TestCx::fatal_proc_rec
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:1639
   8: compiletest_rs::runtest::TestCx::run_ui_test
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2238
   9: compiletest_rs::runtest::TestCx::run_revision
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:140
  10: core::alloc::Layout::for_value
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:80
  11: compiletest_rs::make_test_closure::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/lib.rs:275
  12: <compiletest_rs::common::TestPaths as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:638
  13: <F as alloc::boxed::FnBox<A>>::call_box
  14: __rust_maybe_catch_panic

---- [ui] run-pass-fullmir/issue-3794.rs stdout ----
	normalized stdout:


expected stdout:
S { s: 5 }
S { s: 5 }


diff of stdout:

-S { s: 5 }
-S { s: 5 }
-

The actual stdout differed from the expected stdout.
Actual stdout saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/issue-3794.stdout
normalized stderr:
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'/n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1368:9
    |
1368|         self.buf.write_str(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/builders.rs:99:18
    |
99  |     let result = fmt.write_str(name);
    |                  ^^^^^^^^^^^^^^^^^^^
note: inside call to `core::fmt::builders::debug_struct_new`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1603:9
    |
1603|         builders::debug_struct_new(self, name)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::debug_struct`
   --> $DIR/issue-3794.rs:18:10
    |
18  | #[derive(Debug)]
    |          ^^^^^
note: inside call to `<S as std::fmt::Debug>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1774:77
    |
1774|             fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
    |                                                                             ^
note: inside call to `<&'a T as std::fmt::Debug><S>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
    |
1102|         (value.formatter)(value.value, self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::run`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
    |
1049|                 formatter.run(arg)?;
    |                 ^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> $DIR/issue-3794.rs:25:9
    |
25  |         println!("{:?}", self);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<S as T>::print`
   --> $DIR/issue-3794.rs:34:5
    |
34  |     s.print();
    |     ^^^^^^^^^
note: inside call to `print_s`
   --> $DIR/issue-3794.rs:39:5
    |
39  |     print_s(&*s);
    |     ^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.


expected stderr:


diff of stderr:

+error: a raw memory access tried to access part of a pointer value as raw bytes
+
+error[E0080]: constant evaluation error
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
+    |
+106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
+    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
+    |
+note: inside call to `core::slice::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
+    |
+53  |         ::core::slice::memchr::memrchr(needle, haystack)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
+    |
+56  |     memrchr_specific(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::sys::unix::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
+    |
+55  |     ::sys::memchr::memrchr(needle, haystack)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::memchr::memrchr`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
+    |
+905 |         let i = match memchr::memrchr(b'/n', buf) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
+    |
+465 |         self.inner.borrow_mut().write(buf)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
+    |
+1111|             match self.write(buf) {
+    |                   ^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
+    |
+1171|                 match self.inner.write_all(s.as_bytes()) {
+    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1368:9
+    |
+1368|         self.buf.write_str(data)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::Formatter::write_str`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/builders.rs:99:18
+    |
+99  |     let result = fmt.write_str(name);
+    |                  ^^^^^^^^^^^^^^^^^^^
+note: inside call to `core::fmt::builders::debug_struct_new`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1603:9
+    |
+1603|         builders::debug_struct_new(self, name)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::Formatter::debug_struct`
+   --> $DIR/issue-3794.rs:18:10
+    |
+18  | #[derive(Debug)]
+    |          ^^^^^
+note: inside call to `<S as std::fmt::Debug>::fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1774:77
+    |
+1774|             fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
+    |                                                                             ^
+note: inside call to `<&'a T as std::fmt::Debug><S>::fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
+    |
+1102|         (value.formatter)(value.value, self)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::Formatter::run`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
+    |
+1049|                 formatter.run(arg)?;
+    |                 ^^^^^^^^^^^^^^^^^^
+note: inside call to `std::fmt::write`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
+    |
+1182|         match fmt::write(&mut output, fmt) {
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
+    |
+459 |         self.lock().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
+    |
+686 |         global_s().write_fmt(args)
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
+    |
+294 |               Ok(f(match *slot.get() {
+    |  ________________^
+295 | |                 Some(ref inner) => inner,
+296 | |                 None => self.init(slot),
+297 | |             }))
+    | |______________^
+note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
+    |
+680 |       let result = local_s.try_with(|s| {
+    |  __________________^
+681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
+682 | |             if let Some(w) = borrowed.as_mut() {
+683 | |                 return w.write_fmt(args);
+...   |
+686 | |         global_s().write_fmt(args)
+687 | |     }).unwrap_or_else(|_| {
+    | |______^
+note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
+    |
+701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `std::io::_print`
+   --> $DIR/issue-3794.rs:25:9
+    |
+25  |         println!("{:?}", self);
+    |         ^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `<S as T>::print`
+   --> $DIR/issue-3794.rs:34:5
+    |
+34  |     s.print();
+    |     ^^^^^^^^^
+note: inside call to `print_s`
+   --> $DIR/issue-3794.rs:39:5
+    |
+39  |     print_s(&*s);
+    |     ^^^^^^^^^^^^
+note: inside call to `main`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |                                  ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |                                                                           ^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
+    |
+136 |     f()
+    |     ^^^
+note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
+    |
+59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside call to `closure`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
+    |
+310 |             ptr::write(&mut (*data).r, f());
+    |                                        ^^^
+note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
+    |
+306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
+307 | |         unsafe {
+308 | |             let data = data as *mut Data<F, R>;
+309 | |             let f = ptr::read(&mut (*data).f);
+310 | |             ptr::write(&mut (*data).r, f());
+311 | |         }
+312 | |     }
+    | |_____^
+note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
+    |
+374 |         panicking::try(f)
+    |         ^^^^^^^^^^^^^^^^^
+note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
+    |
+58  |           let exit_code = panic::catch_unwind(|| {
+    |  _________________________^
+59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
+60  | |         });
+    | |__________^
+note: inside call to `std::rt::lang_start_internal`
+   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
+    |
+74  |     lang_start_internal(&move || main().report(), argc, argv)
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
+

The actual stderr differed from the expected stderr.
Actual stderr saved to /var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/issue-3794.stderr
To update references, run this command from build directory:
tests/run-pass-fullmir/update-references.sh '/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf' 'issue-3794.rs'

error: 2 errors occurred comparing output.
status: exit code: 101
command: "target/debug/miri" "tests/run-pass-fullmir/issue-3794.rs" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf" "--target=x86_64-apple-darwin" "-C" "prefer-dynamic" "-o" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/issue-3794.stage-id" "-Zmiri-start-fn" "--sysroot" "/Users/bjorn/.xargo/HOST" "-Zmir-opt-level=0" "-Zmir-emit-validate=1" "-L" "/var/folders/pr/dsmnz7795h18nncdpws5d9h00000gp/T/compiletestzLhrNf/issue-3794.stage-id.aux" "-A" "unused"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: a raw memory access tried to access part of a pointer value as raw bytes

error[E0080]: constant evaluation error
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
    |
106 |     let end_align = (ptr as usize + len) & (usize_bytes - 1);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
    |
note: inside call to `core::slice::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
    |
53  |         ::core::slice::memchr::memrchr(needle, haystack)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
    |
56  |     memrchr_specific(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
    |
55  |     ::sys::memchr::memrchr(needle, haystack)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
    |
905 |         let i = match memchr::memrchr(b'\n', buf) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
    |
465 |         self.inner.borrow_mut().write(buf)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
    |
1111|             match self.write(buf) {
    |                   ^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_all`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1171:23
    |
1171|                 match self.inner.write_all(s.as_bytes()) {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Write::write_fmt::Adaptor<'a, T> as std::fmt::Write><std::io::StdoutLock>::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1368:9
    |
1368|         self.buf.write_str(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::write_str`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/builders.rs:99:18
    |
99  |     let result = fmt.write_str(name);
    |                  ^^^^^^^^^^^^^^^^^^^
note: inside call to `core::fmt::builders::debug_struct_new`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1603:9
    |
1603|         builders::debug_struct_new(self, name)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::debug_struct`
   --> tests/run-pass-fullmir/issue-3794.rs:18:10
    |
18  | #[derive(Debug)]
    |          ^^^^^
note: inside call to `<S as std::fmt::Debug>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1774:77
    |
1774|             fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
    |                                                                             ^
note: inside call to `<&'a T as std::fmt::Debug><S>::fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1102:9
    |
1102|         (value.formatter)(value.value, self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::Formatter::run`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/fmt/mod.rs:1049:17
    |
1049|                 formatter.run(arg)?;
    |                 ^^^^^^^^^^^^^^^^^^
note: inside call to `std::fmt::write`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1182:15
    |
1182|         match fmt::write(&mut output, fmt) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:459:9
    |
459 |         self.lock().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::Stdout as std::io::Write>::write_fmt`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:686:9
    |
686 |         global_s().write_fmt(args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/thread/local.rs:294:16
    |
294 |               Ok(f(match *slot.get() {
    |  ________________^
295 | |                 Some(ref inner) => inner,
296 | |                 None => self.init(slot),
297 | |             }))
    | |______________^
note: inside call to `<std::thread::LocalKey<T>><std::cell::RefCell<std::option::Option<std::boxed::Box<std::io::Write + std::marker::Send>>>>::try_with::<[closure@DefId(1/1:997 ~ std[d95f]::io[0]::stdio[0]::print_to[0]::{{closure}}[0]) 0:&std::fmt::Arguments, 1:&fn() -> std::io::Stdout], std::result::Result<(), std::io::Error>>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:680:18
    |
680 |       let result = local_s.try_with(|s| {
    |  __________________^
681 | |         if let Ok(mut borrowed) = s.try_borrow_mut() {
682 | |             if let Some(w) = borrowed.as_mut() {
683 | |                 return w.write_fmt(args);
...   |
686 | |         global_s().write_fmt(args)
687 | |     }).unwrap_or_else(|_| {
    | |______^
note: inside call to `std::io::stdio::print_to::<std::io::Stdout>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:701:5
    |
701 |     print_to(args, &LOCAL_STDOUT, stdout, "stdout");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::io::_print`
   --> tests/run-pass-fullmir/issue-3794.rs:25:9
    |
25  |         println!("{:?}", self);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<S as T>::print`
   --> tests/run-pass-fullmir/issue-3794.rs:34:5
    |
34  |     s.print();
    |     ^^^^^^^^^
note: inside call to `print_s`
   --> tests/run-pass-fullmir/issue-3794.rs:39:5
    |
39  |     print_s(&*s);
    |     ^^^^^^^^^^^^
note: inside call to `main`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:34
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |                                  ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:75
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |                                                                           ^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:136:5
    |
136 |     f()
    |     ^^^
note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1795 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:59:13
    |
59  |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `closure`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:310:40
    |
310 |             ptr::write(&mut (*data).r, f());
    |                                        ^^^
note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panicking.rs:306:5
    |
306 | /     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
307 | |         unsafe {
308 | |             let data = data as *mut Data<F, R>;
309 | |             let f = ptr::read(&mut (*data).f);
310 | |             ptr::write(&mut (*data).r, f());
311 | |         }
312 | |     }
    | |_____^
note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/panic.rs:374:9
    |
374 |         panicking::try(f)
    |         ^^^^^^^^^^^^^^^^^
note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1794 ~ std[d95f]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:58:25
    |
58  |           let exit_code = panic::catch_unwind(|| {
    |  _________________________^
59  | |             ::sys_common::backtrace::__rust_begin_short_backtrace(move || main())
60  | |         });
    | |__________^
note: inside call to `std::rt::lang_start_internal`
   --> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:74:5
    |
74  |     lang_start_internal(&move || main().report(), argc, argv)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.

------------------------------------------

thread '[ui] run-pass-fullmir/issue-3794.rs' panicked at 'explicit panic', /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: rand::prng::isaac64::Isaac64Rng::init::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:397
   6: compiletest_rs::runtest::TestCx::compare_output::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2539
   7: compiletest_rs::runtest::TestCx::fatal_proc_rec
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:1639
   8: compiletest_rs::runtest::TestCx::run_ui_test
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:2238
   9: compiletest_rs::runtest::TestCx::run_revision
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:140
  10: core::alloc::Layout::for_value
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/runtest.rs:80
  11: compiletest_rs::make_test_closure::{{closure}}
             at /Users/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.9/src/lib.rs:275
  12: <compiletest_rs::common::TestPaths as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:638
  13: <F as alloc::boxed::FnBox<A>>::call_box
  14: __rust_maybe_catch_panic


failures:
    [ui] run-pass-fullmir/catch.rs
    [ui] run-pass-fullmir/format.rs
    [ui] run-pass-fullmir/hello.rs
    [ui] run-pass-fullmir/issue-3794.rs

test result: FAILED. 12 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out

test run_pass_miri_noopt ... FAILED

Edit: submitted rust-lang/rust#50567

@oli-obk
Copy link
Contributor Author

oli-obk commented May 9, 2018

WE ARE BACK IN BUSINESS

Rule 39 applies, because this is cool!

@oli-obk oli-obk merged commit 1996a1f into master May 9, 2018
@oli-obk oli-obk deleted the rustup branch May 9, 2018 12:30
@bjorn3
Copy link
Member

bjorn3 commented May 9, 2018

Hooray!!! Will update priroda soon!

Edit: updated

@RalfJung
Copy link
Member

RalfJung commented May 9, 2018

Wow, awesome. Thanks a ton :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants