Git Product home page Git Product logo

rustc_codegen_cranelift's Introduction

Cranelift codegen backend for rust

The goal of this project is to create an alternative codegen backend for the rust compiler based on Cranelift. This has the potential to improve compilation times in debug mode. If your project doesn't use any of the things listed under "Not yet supported", it should work fine. If not please open an issue.

Download using Rustup

The Cranelift codegen backend is distributed in nightly builds on Linux and x86_64 macOS. If you want to install it using Rustup, you can do that by running:

$ rustup component add rustc-codegen-cranelift-preview --toolchain nightly

Once it is installed, you can enable it with one of the following approaches:

  • CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly build -Zcodegen-backend
  • RUSTFLAGS="-Zcodegen-backend=cranelift" cargo +nightly build
  • Add the following to .cargo/config.toml:
    [unstable]
    codegen-backend = true
    
    [profile.dev]
    codegen-backend = "cranelift"
  • Add the following to Cargo.toml:
    # This line needs to come before anything else in Cargo.toml
    cargo-features = ["codegen-backend"]
    
    [profile.dev]
    codegen-backend = "cranelift"

Precompiled builds

You can also download a pre-built version from the releases page. Extract the dist directory in the archive anywhere you want. If you want to use cargo clif build instead of having to specify the full path to the cargo-clif executable, you can add the bin subdirectory of the extracted dist directory to your PATH. (tutorial for Windows, and for Linux/MacOS).

Building and testing

If you want to build the backend manually, you can download it from GitHub and build it yourself:

$ git clone https://github.com/rust-lang/rustc_codegen_cranelift
$ cd rustc_codegen_cranelift
$ ./y.sh prepare
$ ./y.sh build

To run the test suite replace the last command with:

$ ./test.sh

For more docs on how to build and test see build_system/usage.txt or the help message of ./y.sh.

Platform support

OS \ architecture x86_64 AArch64 Riscv64 s390x (System-Z)
Linux 1 1
FreeBSD 1
AIX 2 N/A N/A 2
Other unixes
macOS 3 N/A N/A
Windows 1 N/A N/A

✅: Fully supported and tested ❓: Maybe supported, not tested ❌: Not supported at all

Not all targets are available as rustup component for nightly. See notes in the platform support matrix.

Usage

rustc_codegen_cranelift can be used as a near-drop-in replacement for cargo build or cargo run for existing projects.

Assuming $cg_clif_dir is the directory you cloned this repo into and you followed the instructions (y.sh prepare and y.sh build or test.sh).

In the directory with your project (where you can do the usual cargo build), run:

$ $cg_clif_dir/dist/cargo-clif build

This will build your project with rustc_codegen_cranelift instead of the usual LLVM backend.

For additional ways to use rustc_codegen_cranelift like the JIT mode see usage.md.

Building and testing with changes in rustc code

See rustc_testing.md.

Not yet supported

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Footnotes

  1. Not available as rustup component for nightly. You can build it yourself. 2 3 4

  2. XCOFF object file format is not supported. 2

  3. Tracked in #1248.

rustc_codegen_cranelift's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rustc_codegen_cranelift's Issues

Remove the need for core/std patches

  • 0001-Disable-stdsimd.patch (8c2577c removed patch, but doesn't fix stdsimd) (assumes llvm intrinsics, #171)
  • 0002-Disable-u128-and-i128-in-libcore.patch (blocked on bytecodealliance/cranelift#354) (mostly removed in 57feadc by letting u128 and i128 taking or returning function trap, more removed in 8506784)
  • 0003-Disable-inline-assembly-in-hint-spin_loop.patch (inline assembly, should probably become an intrinsic) (1e07410)
  • 0006-alloc-Disable-some-unsupported-stuff.patch (blocked on bytecodealliance/cranelift#354) (e09ae25)
  • 0009-Workaround-missing-saturating_sub-intrinsic-impl.patch (blocked on #1) (???)
  • 0011-Workaround-for-libstd-crash.patch (05307af)
  • 0013-Patch-away-bswap-usage.patch (blocked on #1) (db5ffde)
  • 0014-Don-t-use-OS-TLS.patch (05307af)
  • 0015-Remove-usage-of-unsized-locals.patch (blocked on #15) (dcc86d3)
  • 0016-Disable-cpuid-intrinsic.patch (blocked on implementing x86 intrinsic cpuid) (#1070)
  • 0017-Fix-libtest-compilation.patch (blocked on #15) (dcc86d3 and c5b5b2b)
  • 0018-test-Force-single-thread-mode.patch (blocked on #388)
  • 0022-core-Disable-not-compiling-tests.patch (blocked on #806)
  • 0023-core-Ignore-failing-tests.patch (blocked on #806)
  • 0024-libstd-Revert-arg-initialization-on-linux-to-not-req.patch (blocked on implementing #[link_section]) (5c6bf83)
  • 0025-Remove-usage-of-extern_weak-in-thread_local_dtor.patch (#1074)

Load dylibs in JIT

Otherwise you can't call functions from other crates within a JITed crate.

Constants not correctly aligned

fn main() {
    let slice = &[0, 1] as &[i32];
    unsafe { std::slice::from_raw_parts(slice as *const [i32] as *const i32, 1); }
}
thread 'main' panicked at 'attempt to create unaligned slice', sysroot_src/src/libcore/slice/mod.rs:4892:5

Able to successfully build libcore.

I attempted to build libcore with rustc_codegen_cranelift and it appeared to succeed. The readme states to make an issue if it doesn't fail, so here it is.

Implement a subset of all intrinsics

Constants

  • size_of
  • min_align_of
  • needs_drop
  • type_id
  • type_name

Needed for libcore and libstd

  • abort
  • copy
  • copy_nonoverlapping
  • transmute
  • uninit
  • offset
  • unchecked_*
  • overflowing_*
  • *_with_overflow
  • disciminant_value
  • assume
  • (un)likely
  • ctlz_nonzero
  • size_of_val
  • min_align_of_val
  • arith_offset
  • bitreverse
  • bswap
  • saturating_sub

Needed for liballoc

  • write_bytes

Atomics

They are not atomic yet.

  • atomic_cxchg_*
  • atomic_fence_*
  • atomic_load_*
  • atomic_store_*
  • atomic_xadd_*
  • atomic_xsub_*

Needed for libtest

  • fabsf64
  • maxnumf64
  • sqrtf64
  • floorf64
  • minnumf64
  • try (libtest needs panic_unwind)

Misc

  • volatile_{load,store}
  • pref_align_of
  • powif64
  • truncf64
  • fmaf64
  • roundf64
  • logf64
  • sinf64
  • f*_fast
  • volatile_copy_memory

CastKind::ClosureFnPointer implemented wrong

test compile
set is_pic
target x86_64-apple-darwin

function u0:0() system_v {
; symbol _ZN22closure_to_fn_coercion4main17hcc5f764723193903E
; instance Instance { def: Item(DefId(0/0:3 ~ closure_to_fn_coercion[317d]::main[0])), substs: [] }
; sig ([]; c_variadic: false)->()

; ssa {_4: (empty), _0: NOT_SSA, _2: NOT_SSA, _3: NOT_SSA, _1: (empty)}
; msg   loc.idx    param    pass mode            ssa flags  ty
; ret    _0      -          NoPass               NOT_SSA    ()
; zst    _2: [closure@rust/src/test/run-pass/functions-closures/closure-to-fn-coercion.rs:4:29: 4:42] size=0 align=1, 8

    ss0 = explicit_slot 1 ; _3: u8 size=1 align=1,1
    sig0 = (i64, i8) -> i8 system_v
    sig1 = (i8) -> i8 system_v
    fn0 = colocated u0:9 sig0 ; Instance { def: ClosureOnceShim { call_once: DefId(2/0:1000 ~ core[5e67]::ops[0]::function[0]::FnOnce[0]::call_once[0]) }, substs: [[closure@rust/src/test/run-pass/functions-closures/closure-to-fn-coercion.rs:4:29: 4:42], (u8,)] }

                                ebb0:
                                    v0 = iconst.i64 45
                                    v1 = stack_addr.i64 ss0
                                    jump ebb1

                                ebb1:
                                    nop 
; _1 = move _2 as fn(u8) -> u8 (ClosureFnPointer)
@0001                               v2 = func_addr.i64 fn0
; _4 = _1
; 
; _3 = move _4(const 31u8)
@0004                               v3 = iconst.i8 31
@0004                               v4 = call_indirect sig1, v2(v3)
@0004                               store v4, v1
@0004                               jump ebb2

                                ebb2:
@0004                               nop 
; 
; return
@0007                               return
}

The signature of fn0 doesn't match the expected signature. Somehow fn0 has a signature with a self param, while it shouldn't.

thread::spawn panicking

fn main() {
    std::thread::spawn(|| {});
}
thread panicked while processing panic. aborting.
thread 'main' panicked at 'assertion failed: c.borrow().is_none()', ./test.sh: line 29: 75646 Illegal instruction: 4  ./target/out/std_example

std::arch SIMD intrinsics

Currently the SIMD intrinsics are implemented in stdsimd using link_llvm_intrinsics to directly call the llvm intrinsics via their C ABI, and using a handful of "generic" simd intrinsics.

Is there a way to directly call Cretonne intrinsics?
Is there a cfg() macro available to detect whether the codegen backend is LLVM or Cranelift ?

Std support

Unimplemented stuff

     14 Drop for trait object
      1 load_value_pair TyLayout { ty: alloc_crate::boxed::Box<dyn alloc_crate::boxed::FnBox<(), Output=()>>, details: LayoutDetails { variants: Single { index: 0 }, fields: Arbitrary { offsets: [Size { raw: 0 }], memory_index: [0] }, abi: ScalarPair(Scalar { value: Pointer, valid_range: 1..=18446744073709551615 }, Scalar { value: Pointer, valid_range: 1..=18446744073709551615 }), align: Align { abi_pow2: 3, pref_pow2: 3 }, size: Size { raw: 16 } } }
      1 Non scalars are not yet supported for "C" abi (core::option::Option<unsafe extern "C" fn(*mut libc::c_void)>) is_return: false
Edit: hiding this because it is fixed in 1717cc4
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: IncompatibleDeclaration("__rdl_alloc")', libcore/result.rs:1009:5
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
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             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:480
   6: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   7: rust_begin_unwind
             at libstd/panicking.rs:325
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   9: core::result::unwrap_failed
             at /rustc/65204a97d4876b897df0a70c0b9248b57e2bf057/src/libcore/macros.rs:26
  10: <core::result::Result<T, E>>::unwrap
             at /rustc/65204a97d4876b897df0a70c0b9248b57e2bf057/src/libcore/result.rs:808
  11: rustc_codegen_cranelift::allocator::codegen
             at src/allocator.rs:52
  12: rustc_codegen_cranelift::codegen_mono_items
             at src/lib.rs:498
  13: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
             at src/lib.rs:395

Edit2: Patched out variadic functions

Make rustc test suite pass

cc #247

I got a branch to test it at https://github.com/bjorn3/rustc_codegen_cranelift/tree/wip_test_rustc_testsuite.

Excluding the following tests: src/test/run-pass/{asm-*,abi-*,extern/,panic-runtime/,panics/,unsized-locals/,proc-macro/,threads-sendsync/,thinlto/,simd/}

The following run-pass tests fail:

failures:
    [run-pass] run-pass/allocator/custom.rs
    [run-pass] run-pass/allocator/xcrate-use.rs
    [run-pass] run-pass/allocator/xcrate-use2.rs
    [run-pass] run-pass/arbitrary_self_types_pointers_and_wrappers.rs
    [run-pass] run-pass/arbitrary_self_types_stdlib_pointers.rs
    [run-pass] run-pass/array-slice-vec/box-of-array-of-drop-1.rs
    [run-pass] run-pass/array-slice-vec/box-of-array-of-drop-2.rs
    [run-pass] run-pass/array-slice-vec/check-static-mut-slices.rs
    [run-pass] run-pass/array-slice-vec/check-static-slice.rs
    [run-pass] run-pass/array-slice-vec/estr-slice.rs
    [run-pass] run-pass/array-slice-vec/evec-slice.rs
    [run-pass] run-pass/array-slice-vec/nested-vec-2.rs
    [run-pass] run-pass/array-slice-vec/nested-vec-3.rs
    [run-pass] run-pass/array-slice-vec/rcvr-borrowed-to-slice.rs
    [run-pass] run-pass/array-slice-vec/repeated-vector-syntax.rs
    [run-pass] run-pass/array-slice-vec/slice-panic-1.rs
    [run-pass] run-pass/array-slice-vec/slice-panic-2.rs
    [run-pass] run-pass/associated-consts/associated-const-cross-crate-const-eval.rs
    [run-pass] run-pass/associated-consts/associated-const-cross-crate-defaults.rs
    [run-pass] run-pass/associated-consts/associated-const-cross-crate.rs
    [run-pass] run-pass/associated-consts/associated-const-match-patterns.rs
    [run-pass] run-pass/associated-types/associated-types-cc.rs
    [run-pass] run-pass/associated-types/associated-types-project-from-type-param-via-bound-in-where.rs
    [run-pass] run-pass/async-await.rs
    [run-pass] run-pass/atomic-access-bool.rs
    [run-pass] run-pass/attr-before-view-item.rs
    [run-pass] run-pass/attr-before-view-item2.rs
    [run-pass] run-pass/augmented-assignments-feature-gate-cross.rs
    [run-pass] run-pass/auto-instantiate.rs
    [run-pass] run-pass/backtrace-debuginfo.rs
    [run-pass] run-pass/backtrace.rs
    [run-pass] run-pass/binding/fn-arg-incomplete-pattern-drop-order.rs
    [run-pass] run-pass/binding/fn-pattern-expected-type-2.rs
    [run-pass] run-pass/binding/match-beginning-vert.rs
    [run-pass] run-pass/binding/match-pattern-lit.rs
    [run-pass] run-pass/binding/pattern-in-closure.rs
    [run-pass] run-pass/bitwise.rs
    [run-pass] run-pass/blind-item-mixed-crate-use-item.rs
    [run-pass] run-pass/block-arg.rs
    [run-pass] run-pass/borrowck/borrowck-mut-uniq.rs
    [run-pass] run-pass/builtin-clone-unwind.rs
    [run-pass] run-pass/builtin-superkinds-capabilities-transitive.rs
    [run-pass] run-pass/builtin-superkinds-capabilities-xc.rs
    [run-pass] run-pass/builtin-superkinds-in-metadata.rs
    [run-pass] run-pass/catch-unwind-bang.rs
    [run-pass] run-pass/cfg/cfg_inner_static.rs
    [run-pass] run-pass/check-static-recursion-foreign.rs
    [run-pass] run-pass/cleanup-rvalue-for-scope.rs
    [run-pass] run-pass/cleanup-rvalue-scopes.rs
    [run-pass] run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs
    [run-pass] run-pass/clone-with-exterior.rs
    [run-pass] run-pass/coherence/coherence-bigint-int.rs#old
    [run-pass] run-pass/coherence/coherence-bigint-int.rs#re
    [run-pass] run-pass/coherence/coherence-bigint-vecint.rs#old
    [run-pass] run-pass/coherence/coherence-bigint-vecint.rs#re
    [run-pass] run-pass/coherence/coherence-blanket.rs#old
    [run-pass] run-pass/coherence/coherence-blanket.rs#re
    [run-pass] run-pass/coherence/coherence-covered-type-parameter.rs#old
    [run-pass] run-pass/coherence/coherence-covered-type-parameter.rs#re
    [run-pass] run-pass/coherence/coherence-iterator-vec-any-elem.rs#old
    [run-pass] run-pass/coherence/coherence-iterator-vec-any-elem.rs#re
    [run-pass] run-pass/coherence/coherence-iterator-vec.rs#old
    [run-pass] run-pass/coherence/coherence-iterator-vec.rs#re
    [run-pass] run-pass/coherence/coherence_copy_like.rs#old
    [run-pass] run-pass/coherence/coherence_copy_like.rs#re
    [run-pass] run-pass/coherence/re-rebalance-coherence.rs
    [run-pass] run-pass/command-exec.rs
    [run-pass] run-pass/command-pre-exec.rs
    [run-pass] run-pass/compiletest-skip-codegen.rs
    [run-pass] run-pass/complex.rs
    [run-pass] run-pass/const-int-conversion.rs
    [run-pass] run-pass/const-int-saturating-arith.rs
    [run-pass] run-pass/consts/const-binops.rs
    [run-pass] run-pass/consts/const-block-cross-crate-fn.rs
    [run-pass] run-pass/consts/const-cross-crate-const.rs
    [run-pass] run-pass/consts/const-cross-crate-extern.rs
    [run-pass] run-pass/consts/const-endianess.rs
    [run-pass] run-pass/consts/const-fields-and-indexing.rs
    [run-pass] run-pass/consts/const-fn-stability-calls.rs
    [run-pass] run-pass/consts/const-region-ptrs.rs
    [run-pass] run-pass/consts/const-str-ptr.rs
    [run-pass] run-pass/consts/const-struct.rs
    [run-pass] run-pass/consts/const-vecs-and-slices.rs
    [run-pass] run-pass/core-run-destroy.rs
    [run-pass] run-pass/crate-method-reexport-grrrrrrr.rs
    [run-pass] run-pass/cross-crate/anon-extern-mod-cross-crate-2.rs
    [run-pass] run-pass/cross-crate/cci_borrow.rs
    [run-pass] run-pass/cross-crate/cci_capture_clause.rs
    [run-pass] run-pass/cross-crate/cci_impl_exe.rs
    [run-pass] run-pass/cross-crate/cci_iter_exe.rs
    [run-pass] run-pass/cross-crate/cci_nested_exe.rs
    [run-pass] run-pass/cross-crate/cci_no_inline_exe.rs
    [run-pass] run-pass/cross-crate/cross-crate-const-pat.rs
    [run-pass] run-pass/cross-crate/cross-crate-newtype-struct-pat.rs
    [run-pass] run-pass/cross-crate/moves-based-on-type-cross-crate.rs
    [run-pass] run-pass/cross-crate/reexported-static-methods-cross-crate.rs
    [run-pass] run-pass/cross-crate/static-array-across-crate.rs
    [run-pass] run-pass/cross-crate/xcrate-address-insignificant.rs
    [run-pass] run-pass/cross-crate/xcrate-associated-type-defaults.rs
    [run-pass] run-pass/cross-crate/xcrate-static-addresses.rs
    [run-pass] run-pass/cross-crate/xcrate-trait-lifetime-param.rs
    [run-pass] run-pass/cross-crate/xcrate-unit-struct.rs
    [run-pass] run-pass/cross-crate/xcrate_generic_fn_nested_return.rs
    [run-pass] run-pass/ctfe/references.rs
    [run-pass] run-pass/debuginfo-lto.rs
    [run-pass] run-pass/default-method-simple.rs
    [run-pass] run-pass/deriving/deriving-eq-ord-boxed-slice.rs
    [run-pass] run-pass/drop/drop-trait-enum.rs
    [run-pass] run-pass/drop/dropck-eyepatch-extern-crate.rs
    [run-pass] run-pass/drop/dropck-eyepatch-reorder.rs
    [run-pass] run-pass/drop/dropck-eyepatch.rs
    [run-pass] run-pass/drop/dropck_legal_cycles.rs
    [run-pass] run-pass/drop/dynamic-drop.rs#lexical
    [run-pass] run-pass/drop/dynamic-drop.rs#nll
    [run-pass] run-pass/duplicated-external-mods.rs
    [run-pass] run-pass/dynamically-sized-types/dst-field-align.rs
    [run-pass] run-pass/edition-keywords-2015-2015.rs
    [run-pass] run-pass/edition-keywords-2015-2018.rs
    [run-pass] run-pass/edition-keywords-2018-2015.rs
    [run-pass] run-pass/edition-keywords-2018-2018.rs
    [run-pass] run-pass/empty_global_asm.rs
    [run-pass] run-pass/env-funky-keys.rs
    [run-pass] run-pass/env-null-vars.rs
    [run-pass] run-pass/env-vars.rs
    [run-pass] run-pass/expr-block-generic-unique1.rs
    [run-pass] run-pass/fact.rs
    [run-pass] run-pass/fds-are-cloexec.rs
    [run-pass] run-pass/for-loop-while/foreach-put-structured.rs
    [run-pass] run-pass/for-loop-while/foreach-simple-outer-slot.rs
    [run-pass] run-pass/for-loop-while/linear-for-loop.rs
    [run-pass] run-pass/for-loop-while/loop-break-cont.rs
    [run-pass] run-pass/for-loop-while/while-loop-constraints-2.rs
    [run-pass] run-pass/for-loop-while/while-with-break.rs
    [run-pass] run-pass/for-loop-while/while.rs
    [run-pass] run-pass/foreign/foreign-call-no-runtime.rs
    [run-pass] run-pass/foreign/foreign-dupe.rs
    [run-pass] run-pass/foreign/foreign-fn-with-byval.rs
    [run-pass] run-pass/functions-closures/clone-closure.rs
    [run-pass] run-pass/functions-closures/closure-reform.rs
    [run-pass] run-pass/functions-closures/closure-to-fn-coercion.rs
    [run-pass] run-pass/functions-closures/copy-closure.rs
    [run-pass] run-pass/functions-closures/fn-abi.rs
    [run-pass] run-pass/futures-api.rs
    [run-pass] run-pass/generator/borrow-in-tail-expr.rs
    [run-pass] run-pass/generator/conditional-drop.rs
    [run-pass] run-pass/generator/control-flow.rs
    [run-pass] run-pass/generator/drop-env.rs
    [run-pass] run-pass/generator/issue-44197.rs
    [run-pass] run-pass/generator/issue-52398.rs
    [run-pass] run-pass/generator/iterator-count.rs
    [run-pass] run-pass/generator/live-upvar-across-yield.rs
    [run-pass] run-pass/generator/match-bindings.rs
    [run-pass] run-pass/generator/nested_generators.rs
    [run-pass] run-pass/generator/non-static-is-unpin.rs
    [run-pass] run-pass/generator/panic-drops.rs
    [run-pass] run-pass/generator/panic-safe.rs
    [run-pass] run-pass/generator/pin-box-generator.rs
    [run-pass] run-pass/generator/resume-after-return.rs
    [run-pass] run-pass/generator/smoke.rs
    [run-pass] run-pass/generator/static-generators.rs
    [run-pass] run-pass/generator/too-live-local-in-immovable-gen.rs
    [run-pass] run-pass/generator/xcrate-reachable.rs
    [run-pass] run-pass/generator/xcrate.rs
    [run-pass] run-pass/generator/yield-in-box.rs
    [run-pass] run-pass/generator/yield-in-initializer.rs
    [run-pass] run-pass/generics/generic-default-type-params-cross-crate.rs
    [run-pass] run-pass/generics/generic-derived-type.rs
    [run-pass] run-pass/generics/generic-fn.rs
    [run-pass] run-pass/generics/generic-tag-values.rs
    [run-pass] run-pass/hashmap-memory.rs
    [run-pass] run-pass/hygiene/legacy_interaction.rs
    [run-pass] run-pass/hygiene/wrap_unhygienic_example.rs
    [run-pass] run-pass/hygiene/xcrate.rs
    [run-pass] run-pass/ifmt.rs
    [run-pass] run-pass/impl-for-never.rs
    [run-pass] run-pass/impl-privacy-xc-1.rs
    [run-pass] run-pass/impl-privacy-xc-2.rs
    [run-pass] run-pass/impl-trait/example-calendar.rs#nll
    [run-pass] run-pass/impl-trait/example-calendar.rs#normal
    [run-pass] run-pass/impl-trait/nesting.rs
    [run-pass] run-pass/impl-trait/xcrate.rs
    [run-pass] run-pass/impl-trait/xcrate_simple.rs
    [run-pass] run-pass/imports/import-crate-with-invalid-spans/main.rs
    [run-pass] run-pass/imports/import-glob-0.rs
    [run-pass] run-pass/imports/import.rs
    [run-pass] run-pass/imports/import8.rs
    [run-pass] run-pass/inherit-env.rs
    [run-pass] run-pass/init-large-type.rs
    [run-pass] run-pass/inner-module.rs
    [run-pass] run-pass/inner-static.rs
    [run-pass] run-pass/intrinsics/intrinsic-alignment.rs
    [run-pass] run-pass/intrinsics/intrinsic-atomics-cc.rs
    [run-pass] run-pass/intrinsics/intrinsic-atomics.rs
    [run-pass] run-pass/intrinsics/intrinsic-move-val-cleanups.rs
    [run-pass] run-pass/intrinsics/intrinsics-integer.rs
    [run-pass] run-pass/intrinsics/intrinsics-math.rs
    [run-pass] run-pass/invoke-external-foreign.rs
    [run-pass] run-pass/issue-18952.rs
    [run-pass] run-pass/issue-45510.rs
    [run-pass] run-pass/issues/issue-10028.rs
    [run-pass] run-pass/issues/issue-10031.rs
    [run-pass] run-pass/issues/issue-11224.rs
    [run-pass] run-pass/issues/issue-11225-1.rs
    [run-pass] run-pass/issues/issue-11225-2.rs
    [run-pass] run-pass/issues/issue-11225-3.rs
    [run-pass] run-pass/issues/issue-11508.rs
    [run-pass] run-pass/issues/issue-11529.rs
    [run-pass] run-pass/issues/issue-12133-1.rs
    [run-pass] run-pass/issues/issue-12133-2.rs
    [run-pass] run-pass/issues/issue-12133-3.rs
    [run-pass] run-pass/issues/issue-12612.rs
    [run-pass] run-pass/issues/issue-12660.rs
    [run-pass] run-pass/issues/issue-13304.rs
    [run-pass] run-pass/issues/issue-13494.rs
    [run-pass] run-pass/issues/issue-13507-2.rs
    [run-pass] run-pass/issues/issue-13620.rs
    [run-pass] run-pass/issues/issue-13872.rs
    [run-pass] run-pass/issues/issue-14344.rs
    [run-pass] run-pass/issues/issue-14382.rs
    [run-pass] run-pass/issues/issue-14421.rs
    [run-pass] run-pass/issues/issue-14422.rs
    [run-pass] run-pass/issues/issue-14875.rs
    [run-pass] run-pass/issues/issue-15155.rs
    [run-pass] run-pass/issues/issue-15562.rs
    [run-pass] run-pass/issues/issue-15571.rs
    [run-pass] run-pass/issues/issue-16492.rs
    [run-pass] run-pass/issues/issue-16560.rs
    [run-pass] run-pass/issues/issue-16597-empty.rs
    [run-pass] run-pass/issues/issue-16597.rs
    [run-pass] run-pass/issues/issue-16643.rs
    [run-pass] run-pass/issues/issue-16739.rs
    [run-pass] run-pass/issues/issue-17503.rs
    [run-pass] run-pass/issues/issue-17662.rs
    [run-pass] run-pass/issues/issue-17718.rs
    [run-pass] run-pass/issues/issue-18501.rs
    [run-pass] run-pass/issues/issue-18514.rs
    [run-pass] run-pass/issues/issue-18711.rs
    [run-pass] run-pass/issues/issue-18804/main.rs
    [run-pass] run-pass/issues/issue-19293.rs
    [run-pass] run-pass/issues/issue-19340-1.rs
    [run-pass] run-pass/issues/issue-19367.rs
    [run-pass] run-pass/issues/issue-20055-box-trait.rs
    [run-pass] run-pass/issues/issue-20055-box-unsized-array.rs
    [run-pass] run-pass/issues/issue-20389.rs
    [run-pass] run-pass/issues/issue-20427.rs
    [run-pass] run-pass/issues/issue-20823.rs
    [run-pass] run-pass/issues/issue-20953.rs
    [run-pass] run-pass/issues/issue-21058.rs
    [run-pass] run-pass/issues/issue-21291.rs
    [run-pass] run-pass/issues/issue-21922.rs
    [run-pass] run-pass/issues/issue-22258.rs
    [run-pass] run-pass/issues/issue-22992.rs
    [run-pass] run-pass/issues/issue-2316-c.rs
    [run-pass] run-pass/issues/issue-23338-ensure-param-drop-order.rs
    [run-pass] run-pass/issues/issue-23611-enum-swap-in-drop.rs
    [run-pass] run-pass/issues/issue-23781.rs
    [run-pass] run-pass/issues/issue-2380-b.rs
    [run-pass] run-pass/issues/issue-2414-c.rs
    [run-pass] run-pass/issues/issue-24313.rs
    [run-pass] run-pass/issues/issue-2472.rs
    [run-pass] run-pass/issues/issue-24945-repeat-dash-opts.rs
    [run-pass] run-pass/issues/issue-25089.rs
    [run-pass] run-pass/issues/issue-25185.rs
    [run-pass] run-pass/issues/issue-2526-a.rs
    [run-pass] run-pass/issues/issue-25467.rs
    [run-pass] run-pass/issues/issue-2631-b.rs
    [run-pass] run-pass/issues/issue-26484.rs
    [run-pass] run-pass/issues/issue-26655.rs
    [run-pass] run-pass/issues/issue-2723-b.rs
    [run-pass] run-pass/issues/issue-27639.rs
    [run-pass] run-pass/issues/issue-27859.rs
    [run-pass] run-pass/issues/issue-28676.rs
    [run-pass] run-pass/issues/issue-28950.rs
    [run-pass] run-pass/issues/issue-29485.rs
    [run-pass] run-pass/issues/issue-29488.rs
    [run-pass] run-pass/issues/issue-29663.rs
    [run-pass] run-pass/issues/issue-2989.rs
    [run-pass] run-pass/issues/issue-29948.rs
    [run-pass] run-pass/issues/issue-30018-nopanic.rs
    [run-pass] run-pass/issues/issue-30018-panic.rs
    [run-pass] run-pass/issues/issue-3012-2.rs
    [run-pass] run-pass/issues/issue-31702.rs
    [run-pass] run-pass/issues/issue-32805.rs
    [run-pass] run-pass/issues/issue-32947.rs
    [run-pass] run-pass/issues/issue-33096.rs
    [run-pass] run-pass/issues/issue-33537.rs
    [run-pass] run-pass/issues/issue-33770.rs
    [run-pass] run-pass/issues/issue-3389.rs
    [run-pass] run-pass/issues/issue-33992.rs
    [run-pass] run-pass/issues/issue-34053.rs
    [run-pass] run-pass/issues/issue-34569.rs
    [run-pass] run-pass/issues/issue-34796.rs
    [run-pass] run-pass/issues/issue-34932.rs
    [run-pass] run-pass/issues/issue-36768.rs
    [run-pass] run-pass/issues/issue-36954.rs
    [run-pass] run-pass/issues/issue-37291/main.rs
    [run-pass] run-pass/issues/issue-3743.rs
    [run-pass] run-pass/issues/issue-3794.rs
    [run-pass] run-pass/issues/issue-38074.rs
    [run-pass] run-pass/issues/issue-38190.rs
    [run-pass] run-pass/issues/issue-38226.rs
    [run-pass] run-pass/issues/issue-38715.rs
    [run-pass] run-pass/issues/issue-38763.rs
    [run-pass] run-pass/issues/issue-38987.rs
    [run-pass] run-pass/issues/issue-39720.rs
    [run-pass] run-pass/issues/issue-3979-xcrate.rs
    [run-pass] run-pass/issues/issue-39823.rs
    [run-pass] run-pass/issues/issue-39827.rs
    [run-pass] run-pass/issues/issue-40408.rs
    [run-pass] run-pass/issues/issue-40883.rs
    [run-pass] run-pass/issues/issue-41053.rs
    [run-pass] run-pass/issues/issue-41394.rs
    [run-pass] run-pass/issues/issue-41696.rs
    [run-pass] run-pass/issues/issue-42007.rs
    [run-pass] run-pass/issues/issue-4208.rs
    [run-pass] run-pass/issues/issue-42148.rs
    [run-pass] run-pass/issues/issue-42210.rs
    [run-pass] run-pass/issues/issue-4252.rs
    [run-pass] run-pass/issues/issue-43853.rs
    [run-pass] run-pass/issues/issue-4446.rs
    [run-pass] run-pass/issues/issue-4448.rs
    [run-pass] run-pass/issues/issue-4545.rs
    [run-pass] run-pass/issues/issue-45731.rs
    [run-pass] run-pass/issues/issue-46519.rs
    [run-pass] run-pass/issues/issue-46855.rs
    [run-pass] run-pass/issues/issue-47638.rs
    [run-pass] run-pass/issues/issue-48508.rs
    [run-pass] run-pass/issues/issue-48984.rs
    [run-pass] run-pass/issues/issue-49298.rs
    [run-pass] run-pass/issues/issue-49973.rs
    [run-pass] run-pass/issues/issue-5060.rs
    [run-pass] run-pass/issues/issue-50811.rs
    [run-pass] run-pass/issues/issue-50865-private-impl-trait/main.rs
    [run-pass] run-pass/issues/issue-51582.rs
    [run-pass] run-pass/issues/issue-52140/main.rs
    [run-pass] run-pass/issues/issue-52141/main.rs
    [run-pass] run-pass/issues/issue-52557.rs
    [run-pass] run-pass/issues/issue-52705/main.rs
    [run-pass] run-pass/issues/issue-5321-immediates-with-bare-self.rs
    [run-pass] run-pass/issues/issue-5518.rs
    [run-pass] run-pass/issues/issue-5521.rs
    [run-pass] run-pass/issues/issue-5550.rs
    [run-pass] run-pass/issues/issue-5666.rs
    [run-pass] run-pass/issues/issue-6919.rs
    [run-pass] run-pass/issues/issue-7178.rs
    [run-pass] run-pass/issues/issue-7563.rs
    [run-pass] run-pass/issues/issue-7899.rs
    [run-pass] run-pass/issues/issue-8044.rs
    [run-pass] run-pass/issues/issue-8259.rs
    [run-pass] run-pass/issues/issue-8401.rs
    [run-pass] run-pass/issues/issue-8460.rs
    [run-pass] run-pass/issues/issue-8827.rs
    [run-pass] run-pass/issues/issue-9123.rs
    [run-pass] run-pass/issues/issue-9188.rs
    [run-pass] run-pass/issues/issue-9396.rs
    [run-pass] run-pass/issues/issue-9446.rs
    [run-pass] run-pass/issues/issue-9906.rs
    [run-pass] run-pass/issues/issue-9968.rs
    [run-pass] run-pass/issues/issue2170exe.rs
    [run-pass] run-pass/issues/issue24687-embed-debuginfo/main.rs
    [run-pass] run-pass/issues/issue28498-ugeh-with-lifetime-param.rs
    [run-pass] run-pass/issues/issue28498-ugeh-with-passed-to-fn.rs
    [run-pass] run-pass/issues/issue28498-ugeh-with-trait-bound.rs
    [run-pass] run-pass/issues/issue_3136_b.rs
    [run-pass] run-pass/issues/issue_9155.rs
    [run-pass] run-pass/istr.rs
    [run-pass] run-pass/iterators/iter-step-overflow-debug.rs
    [run-pass] run-pass/iterators/iter-sum-overflow-debug.rs
    [run-pass] run-pass/iterators/iter-sum-overflow-overflow-checks.rs
    [run-pass] run-pass/kinds-in-metadata.rs
    [run-pass] run-pass/link-cfg-works.rs
    [run-pass] run-pass/linkage1.rs
    [run-pass] run-pass/llvm-pr32379.rs
    [run-pass] run-pass/log-poly.rs
    [run-pass] run-pass/logging-only-prints-once.rs
    [run-pass] run-pass/lto-still-runs-thread-dtors.rs
    [run-pass] run-pass/macro-quote-cond.rs
    [run-pass] run-pass/macro-quote-test.rs
    [run-pass] run-pass/macros/macro-as-fn-body.rs
    [run-pass] run-pass/macros/macro-comma-behavior.rs#core
    [run-pass] run-pass/macros/macro-comma-behavior.rs#std
    [run-pass] run-pass/macros/macro-comma-support.rs#core
    [run-pass] run-pass/macros/macro-comma-support.rs#std
    [run-pass] run-pass/macros/macro-crate-def-only.rs
    [run-pass] run-pass/macros/macro-crate-nonterminal-renamed.rs
    [run-pass] run-pass/macros/macro-crate-nonterminal.rs
    [run-pass] run-pass/macros/macro-export-inner-module.rs
    [run-pass] run-pass/macros/macro-stability.rs
    [run-pass] run-pass/macros/macro-use-all-and-none.rs
    [run-pass] run-pass/macros/macro-use-all.rs
    [run-pass] run-pass/macros/macro-use-both.rs
    [run-pass] run-pass/macros/macro-use-one.rs
    [run-pass] run-pass/macros/macro-with-braces-in-expr-position.rs
    [run-pass] run-pass/macros/macro_with_super_2.rs
    [run-pass] run-pass/macros/paths-in-macro-invocations.rs
    [run-pass] run-pass/macros/syntax-extension-source-utils.rs
    [run-pass] run-pass/macros/try-macro.rs
    [run-pass] run-pass/macros/two-macro-use.rs
    [run-pass] run-pass/macros/use-macro-self.rs
    [run-pass] run-pass/methods/method-self-arg-aux1.rs
    [run-pass] run-pass/methods/method-self-arg-aux2.rs
    [run-pass] run-pass/mir/mir_calls_to_shims.rs
    [run-pass] run-pass/mir/mir_codegen_calls.rs
    [run-pass] run-pass/mir/mir_codegen_calls_variadic.rs
    [run-pass] run-pass/mir/mir_drop_order.rs
    [run-pass] run-pass/mir/mir_fat_ptr_drop.rs
    [run-pass] run-pass/mir/mir_misc_casts.rs
    [run-pass] run-pass/mir/mir_overflow_off.rs
    [run-pass] run-pass/mir/mir_raw_fat_ptr.rs
    [run-pass] run-pass/mir/mir_refs_correct.rs
    [run-pass] run-pass/moves/moves-based-on-type-capture-clause.rs
    [run-pass] run-pass/mpsc_stress.rs
    [run-pass] run-pass/multi-panic.rs
    [run-pass] run-pass/nested_item_main.rs
    [run-pass] run-pass/new-box.rs
    [run-pass] run-pass/new-impl-syntax.rs
    [run-pass] run-pass/no-landing-pads.rs
    [run-pass] run-pass/no-stdio.rs
    [run-pass] run-pass/numbers-arithmetic/float-int-invalid-const-cast.rs
    [run-pass] run-pass/numbers-arithmetic/float-literal-inference.rs
    [run-pass] run-pass/numbers-arithmetic/float.rs
    [run-pass] run-pass/numbers-arithmetic/float_math.rs
    [run-pass] run-pass/numbers-arithmetic/i128-ffi.rs
    [run-pass] run-pass/numbers-arithmetic/i128.rs
    [run-pass] run-pass/numbers-arithmetic/int-abs-overflow.rs
    [run-pass] run-pass/numbers-arithmetic/next-power-of-two-overflow-debug.rs
    [run-pass] run-pass/numbers-arithmetic/next-power-of-two-overflow-ndebug.rs
    [run-pass] run-pass/numbers-arithmetic/num-wrapping.rs
    [run-pass] run-pass/numbers-arithmetic/saturating-float-casts.rs
    [run-pass] run-pass/numbers-arithmetic/shift.rs
    [run-pass] run-pass/numbers-arithmetic/u128-as-f32.rs
    [run-pass] run-pass/numbers-arithmetic/u128.rs
    [run-pass] run-pass/opeq.rs
    [run-pass] run-pass/out-of-stack.rs
    [run-pass] run-pass/over-constrained-vregs.rs
    [run-pass] run-pass/overloaded/overloaded-autoderef-xcrate.rs
    [run-pass] run-pass/packed/packed-struct-size-xc.rs
    [run-pass] run-pass/panic-uninitialized-zeroed.rs
    [run-pass] run-pass/print-stdout-eprint-stderr.rs
    [run-pass] run-pass/privacy/priv-impl-prim-ty.rs
    [run-pass] run-pass/privacy/privacy-reexport.rs
    [run-pass] run-pass/privacy/pub-use-xcrate.rs
    [run-pass] run-pass/privacy/pub_use_mods_xcrate_exe.rs
    [run-pass] run-pass/proc_macro.rs
    [run-pass] run-pass/process/process-envs.rs
    [run-pass] run-pass/process/process-sigpipe.rs
    [run-pass] run-pass/process/process-spawn-with-unicode-params.rs
    [run-pass] run-pass/range_inclusive.rs
    [run-pass] run-pass/raw-fat-ptr.rs
    [run-pass] run-pass/rcvr-borrowed-to-region.rs
    [run-pass] run-pass/reachable-unnameable-items.rs
    [run-pass] run-pass/reexport-should-still-link.rs
    [run-pass] run-pass/reexport-test-harness-main.rs
    [run-pass] run-pass/resource-destruct.rs
    [run-pass] run-pass/rfcs/rfc-2005-default-binding-mode/enum.rs
    [run-pass] run-pass/rfcs/rfc-2005-default-binding-mode/general.rs
    [run-pass] run-pass/rfcs/rfc-2008-non-exhaustive/enums.rs
    [run-pass] run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs
    [run-pass] run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs
    [run-pass] run-pass/rfcs/rfc-2126-extern-absolute-paths/test.rs
    [run-pass] run-pass/rfcs/rfc-2302-self-struct-ctor.rs
    [run-pass] run-pass/rfcs/rfc1857-drop-order.rs
    [run-pass] run-pass/running-with-no-runtime.rs
    [run-pass] run-pass/segfault-no-out-of-stack.rs
    [run-pass] run-pass/self/builtin-superkinds-self-type.rs
    [run-pass] run-pass/self/explicit_self_xcrate_exe.rs
    [run-pass] run-pass/self/string-self-append.rs
    [run-pass] run-pass/self/ufcs-explicit-self.rs
    [run-pass] run-pass/sepcomp/sepcomp-cci.rs
    [run-pass] run-pass/sepcomp/sepcomp-extern.rs
    [run-pass] run-pass/sepcomp/sepcomp-lib-lto.rs
    [run-pass] run-pass/sepcomp/sepcomp-lib.rs
    [run-pass] run-pass/sepcomp/sepcomp-unwind.rs
    [run-pass] run-pass/signal-alternate-stack-cleanup.rs
    [run-pass] run-pass/sigpipe-should-be-ignored.rs
    [run-pass] run-pass/simple_global_asm.rs
    [run-pass] run-pass/sleep.rs
    [run-pass] run-pass/specialization/cross-crate-defaults.rs
    [run-pass] run-pass/specialization/defaultimpl/allowed-cross-crate.rs
    [run-pass] run-pass/specialization/specialization-allowed-cross-crate.rs
    [run-pass] run-pass/specialization/specialization-cross-crate-no-gate.rs
    [run-pass] run-pass/specialization/specialization-cross-crate.rs
    [run-pass] run-pass/sse2.rs
    [run-pass] run-pass/stack-probes-lto.rs
    [run-pass] run-pass/stack-probes.rs
    [run-pass] run-pass/statics/static-fn-inline-xc.rs
    [run-pass] run-pass/statics/static-fn-trait-xc.rs
    [run-pass] run-pass/statics/static-function-pointer-xc.rs
    [run-pass] run-pass/statics/static-method-xcrate.rs
    [run-pass] run-pass/statics/static-mut-xc.rs
    [run-pass] run-pass/stdio-is-blocking.rs
    [run-pass] run-pass/structs-enums/class-cast-to-trait-cross-crate-2.rs
    [run-pass] run-pass/structs-enums/class-cast-to-trait-multiple-types.rs
    [run-pass] run-pass/structs-enums/class-impl-very-parameterized-trait.rs
    [run-pass] run-pass/structs-enums/class-implement-trait-cross-crate.rs
    [run-pass] run-pass/structs-enums/class-implement-traits.rs
    [run-pass] run-pass/structs-enums/class-method-cross-crate.rs
    [run-pass] run-pass/structs-enums/class-methods-cross-crate.rs
    [run-pass] run-pass/structs-enums/class-poly-methods-cross-crate.rs
    [run-pass] run-pass/structs-enums/classes-cross-crate.rs
    [run-pass] run-pass/structs-enums/classes-simple-cross-crate.rs
    [run-pass] run-pass/structs-enums/classes.rs
    [run-pass] run-pass/structs-enums/discrim-explicit-23030.rs
    [run-pass] run-pass/structs-enums/empty-struct-braces.rs
    [run-pass] run-pass/structs-enums/enum-discrim-width-stuff.rs
    [run-pass] run-pass/structs-enums/ivec-tag.rs
    [run-pass] run-pass/structs-enums/namespaced-enum-emulate-flat-xc.rs
    [run-pass] run-pass/structs-enums/namespaced-enum-glob-import-xcrate.rs
    [run-pass] run-pass/structs-enums/namespaced-enums-xcrate.rs
    [run-pass] run-pass/structs-enums/newtype-struct-xc-2.rs
    [run-pass] run-pass/structs-enums/newtype-struct-xc.rs
    [run-pass] run-pass/structs-enums/rec-align-u32.rs
    [run-pass] run-pass/structs-enums/rec-align-u64.rs
    [run-pass] run-pass/structs-enums/rec-auto.rs
    [run-pass] run-pass/structs-enums/small-enum-range-edge.rs
    [run-pass] run-pass/structs-enums/struct-aliases-xcrate.rs
    [run-pass] run-pass/structs-enums/struct-destructuring-cross-crate.rs
    [run-pass] run-pass/structs-enums/struct-return.rs
    [run-pass] run-pass/structs-enums/struct_variant_xc.rs
    [run-pass] run-pass/structs-enums/struct_variant_xc_match.rs
    [run-pass] run-pass/structs-enums/unit-like-struct-drop-run.rs
    [run-pass] run-pass/supported-cast.rs
    [run-pass] run-pass/svh-add-nothing.rs
    [run-pass] run-pass/tail-cps.rs
    [run-pass] run-pass/tcp-stress.rs
    [run-pass] run-pass/terminate-in-initializer.rs
    [run-pass] run-pass/test-allow-dead-extern-static-no-warning.rs
    [run-pass] run-pass/test-allow-fail-attr.rs
    [run-pass] run-pass/test-fn-signature-verification-for-explicit-return-type.rs
    [run-pass] run-pass/test-main-not-dead-attr.rs
    [run-pass] run-pass/test-main-not-dead.rs
    [run-pass] run-pass/test-runner-hides-buried-main.rs
    [run-pass] run-pass/test-runner-hides-main.rs
    [run-pass] run-pass/test-runner-hides-start.rs
    [run-pass] run-pass/test-should-fail-good-message.rs
    [run-pass] run-pass/traits/anon_trait_static_method_exe.rs
    [run-pass] run-pass/traits/trait-bounds-in-arc.rs
    [run-pass] run-pass/traits/trait-coercion-generic.rs
    [run-pass] run-pass/traits/trait-coercion.rs
    [run-pass] run-pass/traits/trait-default-method-xc-2.rs
    [run-pass] run-pass/traits/trait-default-method-xc.rs
    [run-pass] run-pass/traits/trait-impl.rs
    [run-pass] run-pass/traits/trait-inheritance-auto-xc-2.rs
    [run-pass] run-pass/traits/trait-inheritance-auto-xc.rs
    [run-pass] run-pass/traits/trait-inheritance-cross-trait-call-xc.rs
    [run-pass] run-pass/traits/trait-inheritance-overloading-xc-exe.rs
    [run-pass] run-pass/traits/trait-inheritance-self-in-supertype.rs
    [run-pass] run-pass/traits/trait-safety-ok-cc.rs
    [run-pass] run-pass/traits/trait-static-method-overwriting.rs
    [run-pass] run-pass/traits/traits-conditional-model-fn.rs
    [run-pass] run-pass/trivial-message.rs
    [run-pass] run-pass/tydesc-name.rs
    [run-pass] run-pass/typeid-intrinsic.rs
    [run-pass] run-pass/unary-minus-suffix-inference.rs
    [run-pass] run-pass/unboxed-closures/unboxed-closures-boxed.rs
    [run-pass] run-pass/unboxed-closures/unboxed-closures-cross-crate.rs
    [run-pass] run-pass/unboxed-closures/unboxed-closures-monomorphization.rs
    [run-pass] run-pass/unboxed-closures/unboxed-closures-unique-type-id.rs
    [run-pass] run-pass/uniform-paths/issue-53691.rs
    [run-pass] run-pass/union/union-basic.rs
    [run-pass] run-pass/union/union-c-interop.rs
    [run-pass] run-pass/unique/unique-send-2.rs
    [run-pass] run-pass/unwind-resource.rs
    [run-pass] run-pass/unwind-unique.rs
    [run-pass] run-pass/use_inline_dtor.rs
    [run-pass] run-pass/using-target-feature-unstable.rs
    [run-pass] run-pass/utf8.rs
    [run-pass] run-pass/utf8_idents.rs
    [run-pass] run-pass/variadic-ffi.rs
    [run-pass] run-pass/volatile-fat-ptr.rs
    [run-pass] run-pass/weird-exprs.rs
    [run-pass] run-pass/where-clauses/where-clauses-cross-crate.rs
    [run-pass] run-pass/where-clauses/where-clauses-method.rs
    [run-pass] run-pass/where-clauses/where-clauses.rs
    [run-pass] run-pass/yield.rs
    [run-pass] run-pass/yield1.rs
    [run-pass] run-pass/yield2.rs

test result: FAILED. 1401 passed; 577 failed; 805 ignored; 0 measured; 0 filtered out

Note: those 805 ignored are tests passed when I ran it previous time.

The most common runtime errors are:

  • thread 'main' panicked at 'assertion failed: `(left == right)`
      left: `22`,
     right: `0`', sysroot_src/src/libstd/sys/unix/mutex.rs:112:9
    
  • thread 'main' panicked at 'assertion failed: c.borrow().is_none()', sysroot_src/src/libstd/sys_common/thread_info.rs:37:26
    

Dependabot can't resolve your Rust dependency files

Dependabot can't resolve your Rust dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

error: failed to parse manifest at `/home/dependabot/dependabot-updater/dependabot_tmp_dir/Cargo.toml`

Caused by:
  the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /cranelift/lib/umbrella/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

.debug_line dir and file table malformed

$ git rev-parse HEAD
058c7ed46a825d09bcfa90db95a1e2f4fb43414e
$ git branch
[...]
* wip_fix_libstd
[...]
$ readelf -w target/out/alloc_example.dummy_name.rcgu.o
[...]
The Directory Table (offset 0x1b):
  1     example
  2     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/liballoc
  3     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore
  4     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore/ops
  5     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libstd/thread
  6     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libstd/sys/windows
  7     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libstd/sys/sgx/abi
  8     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore/fmt
  9     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore/num
  10    /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libstd

 The File Name Table (offset 0x349):
  Entry Dir     Time    Size    Name
  1     47      104     111     /home/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libstd/sys/unix/process
  2     47      104     111     me/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/liballoc/collections/btree
  3     0       97      108     me/bjorn/Documenten/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/liballoc/collections
  4     1       0       0       loc_example.rs
  5     2       0       0       rc.rs
  6     3       0       0       cell.rs
  7     3       0       0       mem.rs
  8     3       0       0       ptr.rs
  9     4       0       0       function.rs
  10    3       0       0       option.rs
  11    5       0       0       local.rs
  12    6       0       0       os_str.rs
  13    7       0       0       mod.rs
  14    7       0       0       reloc.rs
  15    6       0       0       pipe.rs
  16    8       0       0       mod.rs
  17    2       0       0       alloc.rs
  18    9       0       0       f64.rs
  19    3       0       0       alloc.rs
  20    9       0       0       mod.rs
  21    6       0       0       path.rs
  22    10      0       0       rt.rs
  23    11      0       0       <::std::thread::local::__thread_local_inner macros>
  24    2       0       0       boxed.rs
  25    3       0       0       result.rs
  26    3       0       0       macros.rs
  27    10      0       0       process.rs
  28    12      0       0       process_common.rs
  29    3       0       0       panicking.rs
  30    3       0       0       hint.rs
  31    6       0       0       thread.rs
  32    6       0       0       process.rs
[...]

macOS DWARF oddities

After applying the following patch, because macOS doesn't use .debug_* relocations.

diff --git a/src/debuginfo.rs b/src/debuginfo.rs
index 6da47d2..4c943c4 100644
--- a/src/debuginfo.rs
+++ b/src/debuginfo.rs
@@ -740,15 +740,7 @@ impl<'a, 'tcx> Writer for WriterRelocate<'a, 'tcx> {
     }
 
     fn write_offset(&mut self, val: usize, section: SectionId, size: u8) -> Result<()> {
-        let offset = self.len() as u32;
-        let name = self.ctx.section_name(section);
-        self.relocs.push(DebugReloc {
-            offset,
-            size,
-            name,
-            addend: val as i64,
-        });
-        self.write_word(0, size)
+        self.write_word(val as u64, size)
     }
 
     fn write_offset_at(
@@ -758,14 +750,7 @@ impl<'a, 'tcx> Writer for WriterRelocate<'a, 'tcx> {
         section: SectionId,
         size: u8,
     ) -> Result<()> {
-        let name = self.ctx.section_name(section);
-        self.relocs.push(DebugReloc {
-            offset: offset as u32,
-            size,
-            name,
-            addend: val as i64,
-        });
-        self.write_word_at(offset, 0, size)
+        self.write_word_at(offset, val as u64, size)
     }
 }

The resulting DWARF has wrong addresses, even though the original object files had relocations for the .debug_* sections:

dwarfdump --verify target/out/mini_core_hello_world.dSYM
----------------------------------------------------------------------
 File: target/out/mini_core_hello_world.dSYM/Contents/Resources/DWARF/mini_core_hello_world (x86_64)
----------------------------------------------------------------------
Verifying Compile Unit Header chain... ok
Verifying .debug_info... 
error: Range is not in parent
  TAG_subprogram {0x00000066}: [0x0000000100000ade - 0x0000000100000c6e) 
error: Range is not in parent
  TAG_subprogram {0x0000019d}: [0x0000000100000d2b - 0x0000000100001b9e) 
error: Range is not in parent
  TAG_subprogram {0x000007f8}: [0x0000000100001bbf - 0x0000000100001bcd) 
error: Range is not in parent
  TAG_subprogram {0x00000835}: [0x0000000100001b9e - 0x0000000100001bbf) 
error: Range is not in parent
  TAG_subprogram {0x0000086e}: [0x0000000100001cac - 0x0000000100001d2e) 
error: Range is not in parent
  TAG_subprogram {0x0000090c}: [0x0000000100001bcd - 0x0000000100001c52) 
error: Range is not in parent
  TAG_subprogram {0x00000a13}: [0x0000000100001eab - 0x0000000100001f30) 
error: Range is not in parent
  TAG_subprogram {0x00000a96}: [0x0000000100001d2e - 0x0000000100001eab) 
error: Range is not in parent
  TAG_subprogram {0x00000b2d}: [0x0000000100001c52 - 0x0000000100001cac) 
error: Range is not in parent
  TAG_subprogram {0x00000bae}: [0x0000000100001f58 - 0x0000000100001f65) 
error: Range is not in parent
  TAG_subprogram {0x00000beb}: [0x0000000100001f6b - 0x0000000100001f90) 
11 error(s) were found.
Verifying .apple_names... ok
Verifying .apple_types... ok
Verifying .apple_namespaces... ok
Verifying .apple_objc... ok
Verifying .debug_frame... ok
Verifying .debug_line... ok

$ dwarfdump target/out/mini_core_hello_world.dSYM
----------------------------------------------------------------------
 File: target/out/mini_core_hello_world.dSYM/Contents/Resources/DWARF/mini_core_hello_world (x86_64)
----------------------------------------------------------------------
.debug_info contents:

0x00000000: Compile Unit: length = 0x00000b7a  version = 0x0004  abbr_offset = 0x00000000  addr_size = 0x08  (next CU at 0x00000b7e)

0x0000000b: TAG_compile_unit [1] *
             AT_producer( "cranelift fn (rustc version unknown version)" )
             AT_language( DW_LANG_Rust )
             AT_name( "example/mini_core_hello_world.rs" )
             AT_comp_dir( "/Users/bjorn/Documents/rustc_codegen_cranelift" )
             AT_stmt_list( 0x00000000 )
             AT_low_pc( 0x0000000100000ad0 )
             AT_ranges( 0x00000000
                [0x0000000100000ad0 - 0x0000000100000ade)
                [0x0000000100000ad0 - 0x0000000100000ade)
                [0x0000000100000ad0 - 0x0000000100000aeb)
                [0x0000000100000ad0 - 0x0000000100000af1)
                [0x0000000100000ad0 - 0x0000000100000b2a)
                [0x0000000100000ad0 - 0x0000000100000b52)
                [0x0000000100000ad0 - 0x0000000100000b55)
                [0x0000000100000ad0 - 0x0000000100000b55)
                [0x0000000100000ad0 - 0x0000000100000b72)
                [0x0000000100000ad0 - 0x0000000100000c4d)
                [0x0000000100000ad0 - 0x0000000100000c60)
                [0x0000000100000ad0 - 0x0000000100001943)
                 End )
[...]

$ objdump -r target/out/mini_core.dummy_name.rcgu.o

target/out/mini_core.dummy_name.rcgu.o:	file format Mach-O 64-bit x86-64

RELOCATION RECORDS FOR [__text]:
000000000000034f X86_64_RELOC_GOT_LOAD __ZN9mini_core12MY_TINY_HEAP17h06b8b6ee678156b1E@GOTPCREL

RELOCATION RECORDS FOR [__debug_info]:
0000000000000032 X86_64_RELOC_UNSIGNED __ZN68_$LT$$RF$$u27$a$u20$bool$u20$as$u20$mini_core..BitOr$LT$bool$GT$$GT$5bitor17h06c4c08238ea11b3E
00000000000000a8 X86_64_RELOC_UNSIGNED __ZN39_$LT$bool$u20$as$u20$mini_core..Not$GT$3not17h0dfb0e7a03f21bafE
00000000000000f3 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Mul$GT$3mul17hbadd8ec33043e277E
0000000000000174 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Add$GT$3add17hf2b580c713c9aa22E
00000000000001e8 X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2ne17h6591d7d822cd694dE
000000000000025e X86_64_RELOC_UNSIGNED __ZN40_$LT$isize$u20$as$u20$mini_core..Neg$GT$3neg17ha9990a7b7c09dbf8E
00000000000002ba X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2eq17h85da6c7efdb2221eE
0000000000000323 X86_64_RELOC_UNSIGNED __ZN40_$LT$usize$u20$as$u20$mini_core..Sub$GT$3sub17h1819823fa4db3789E
00000000000003a5 X86_64_RELOC_UNSIGNED __ZN9mini_core5panic17h1b8c87c5633941c5E
00000000000003e2 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2eq17h77b456aa7ccf9ab8E
0000000000000451 X86_64_RELOC_UNSIGNED __ZN41_$LT$bool$u20$as$u20$mini_core..BitOr$GT$5bitor17hc51993c0e2f70499E
00000000000004ba X86_64_RELOC_UNSIGNED _rust_eh_personality
00000000000004dc X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2ne17h40203ccd00452a56E
0000000000000545 X86_64_RELOC_UNSIGNED __ZN9mini_core8allocate17h122bb7e874c2cf63E

RELOCATION RECORDS FOR [__debug_line]:
0000000000000038 X86_64_RELOC_UNSIGNED __ZN68_$LT$$RF$$u27$a$u20$bool$u20$as$u20$mini_core..BitOr$LT$bool$GT$$GT$5bitor17h06c4c08238ea11b3E
0000000000000068 X86_64_RELOC_UNSIGNED __ZN39_$LT$bool$u20$as$u20$mini_core..Not$GT$3not17h0dfb0e7a03f21bafE
0000000000000096 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Mul$GT$3mul17hbadd8ec33043e277E
00000000000000e0 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Add$GT$3add17hf2b580c713c9aa22E
000000000000012a X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2ne17h6591d7d822cd694dE
000000000000015d X86_64_RELOC_UNSIGNED __ZN40_$LT$isize$u20$as$u20$mini_core..Neg$GT$3neg17ha9990a7b7c09dbf8E
000000000000018f X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2eq17h85da6c7efdb2221eE
00000000000001c2 X86_64_RELOC_UNSIGNED __ZN40_$LT$usize$u20$as$u20$mini_core..Sub$GT$3sub17h1819823fa4db3789E
0000000000000205 X86_64_RELOC_UNSIGNED __ZN9mini_core5panic17h1b8c87c5633941c5E
0000000000000222 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2eq17h77b456aa7ccf9ab8E
0000000000000259 X86_64_RELOC_UNSIGNED __ZN41_$LT$bool$u20$as$u20$mini_core..BitOr$GT$5bitor17hc51993c0e2f70499E
0000000000000287 X86_64_RELOC_UNSIGNED _rust_eh_personality
00000000000002a4 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2ne17h40203ccd00452a56E
00000000000002db X86_64_RELOC_UNSIGNED __ZN9mini_core8allocate17h122bb7e874c2cf63E

RELOCATION RECORDS FOR [__debug_ranges]:
0000000000000000 X86_64_RELOC_UNSIGNED __ZN68_$LT$$RF$$u27$a$u20$bool$u20$as$u20$mini_core..BitOr$LT$bool$GT$$GT$5bitor17h06c4c08238ea11b3E
0000000000000008 X86_64_RELOC_UNSIGNED __ZN68_$LT$$RF$$u27$a$u20$bool$u20$as$u20$mini_core..BitOr$LT$bool$GT$$GT$5bitor17h06c4c08238ea11b3E
0000000000000010 X86_64_RELOC_UNSIGNED __ZN39_$LT$bool$u20$as$u20$mini_core..Not$GT$3not17h0dfb0e7a03f21bafE
0000000000000018 X86_64_RELOC_UNSIGNED __ZN39_$LT$bool$u20$as$u20$mini_core..Not$GT$3not17h0dfb0e7a03f21bafE
0000000000000020 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Mul$GT$3mul17hbadd8ec33043e277E
0000000000000028 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Mul$GT$3mul17hbadd8ec33043e277E
0000000000000030 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Add$GT$3add17hf2b580c713c9aa22E
0000000000000038 X86_64_RELOC_UNSIGNED __ZN37_$LT$u8$u20$as$u20$mini_core..Add$GT$3add17hf2b580c713c9aa22E
0000000000000040 X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2ne17h6591d7d822cd694dE
0000000000000048 X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2ne17h6591d7d822cd694dE
0000000000000050 X86_64_RELOC_UNSIGNED __ZN40_$LT$isize$u20$as$u20$mini_core..Neg$GT$3neg17ha9990a7b7c09dbf8E
0000000000000058 X86_64_RELOC_UNSIGNED __ZN40_$LT$isize$u20$as$u20$mini_core..Neg$GT$3neg17ha9990a7b7c09dbf8E
0000000000000060 X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2eq17h85da6c7efdb2221eE
0000000000000068 X86_64_RELOC_UNSIGNED __ZN45_$LT$char$u20$as$u20$mini_core..PartialEq$GT$2eq17h85da6c7efdb2221eE
0000000000000070 X86_64_RELOC_UNSIGNED __ZN40_$LT$usize$u20$as$u20$mini_core..Sub$GT$3sub17h1819823fa4db3789E
0000000000000078 X86_64_RELOC_UNSIGNED __ZN40_$LT$usize$u20$as$u20$mini_core..Sub$GT$3sub17h1819823fa4db3789E
0000000000000080 X86_64_RELOC_UNSIGNED __ZN9mini_core5panic17h1b8c87c5633941c5E
0000000000000088 X86_64_RELOC_UNSIGNED __ZN9mini_core5panic17h1b8c87c5633941c5E
0000000000000090 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2eq17h77b456aa7ccf9ab8E
0000000000000098 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2eq17h77b456aa7ccf9ab8E
00000000000000a0 X86_64_RELOC_UNSIGNED __ZN41_$LT$bool$u20$as$u20$mini_core..BitOr$GT$5bitor17hc51993c0e2f70499E
00000000000000a8 X86_64_RELOC_UNSIGNED __ZN41_$LT$bool$u20$as$u20$mini_core..BitOr$GT$5bitor17hc51993c0e2f70499E
00000000000000b0 X86_64_RELOC_UNSIGNED _rust_eh_personality
00000000000000b8 X86_64_RELOC_UNSIGNED _rust_eh_personality
00000000000000c0 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2ne17h40203ccd00452a56E
00000000000000c8 X86_64_RELOC_UNSIGNED __ZN43_$LT$u8$u20$as$u20$mini_core..PartialEq$GT$2ne17h40203ccd00452a56E
00000000000000d0 X86_64_RELOC_UNSIGNED __ZN9mini_core8allocate17h122bb7e874c2cf63E
00000000000000d8 X86_64_RELOC_UNSIGNED __ZN9mini_core8allocate17h122bb7e874c2cf63E

And .debug_line has all sequences start at 0x0000000100000ad0

Originally posted by @bjorn3 in #291 (comment)

DWARF support

  • Unmangled symbols names (#1470)
  • Arguments and locals
  • Statics (#1472)
  • Types
  • Line info (#291)
  • Inlining information (long term)
  • Backtrace information (#982)
  • Unwinding information (long term)

Edit: add unwinding information
Edit2: state which things are for the long term
Edit3: gimli-rs/gimli#340 has been merged
Edit4: m4b/faerie#51 has been merged and CraneStation/cranelift#426 is not necessary anymore I believe.

Generate higher quality clif ir

  • Use brnz instead of cranelift_frontend::Switch for bool switchInt. (bytecodealliance/cranelift#665 is more general)

  • Don't emit (zero sized) stack slot for zst's. (Done in e162040)

  • Use f32const instead of load.f32 gv*. (Done in 6127632)

  • Optimize Rvalue::BinaryOp(op, val, imm)

    v0 = val
    v2 = icmp_imm eq v0, imm
    

    instead of

    v0 = val
    v1 = iconst imm
    v2 = icmp eq v0, v1

Comparing enums gives SIGILL

fn main() {
    let _ = LoopState::Continue(()) == LoopState::Break(());
}

#[derive(PartialEq)]
enum LoopState {
    Continue(()),
    Break(())
}
./test.sh: line 29: 70353 Illegal instruction: 4  ./target/out/std_exampl

C abi compatability

  • Don't pass return pointer for unit return type (419cbcb)
  • Make sure every type has the correct PassMode
    • Return !
    • Option<fn(..)>
    • layout.abi = Abi::ByValPair (3f15b0a)
    • Abi::ScalarPair + non rust abis
  • Find out correct way of passing Abi::ByRef values. (ptr or stack offset)

Write a document for others wanting to implement a rustc codegen backend

It should at least include assumptions made by rustc and libstd, like:

  • fn((), u8) and fn(u8) are abi compatible (assumes by ClosureFnPointer, found in #413)
  • BinOp::Offset and the offset and arith_offset use pointer arithmetic (found in #341)
  • Don't ever stub out unimplemented stuff by using a dummy value, instead use a trap. Even something simple as making checked binops never overflow causes hard to debug breakage at many places, especially 128bit int emulation and bigint arithmetic, as those need the overflow flag as carry/borrow. (eg #381 (comment))
  • Dont implement stuff the way you think it should, without a test using it. See for example 0d16dcf for the fix of a problem that could probably have been prevented that way.
  • Alignment of stuff is important. libcore contains alignment debug asserts and some os functions will return an error on wrong alignment.
  • DST's are hard to get right. Write many tests for then!
  • Add many asserts, for example check that types are compatible when writing a value to a place.
  • SysV abi requires ByRef params to be passed at the right memory offset, not passing a pointer to the value in register.

https://github.com/dropbox/rust-brotli-decompressor is a good example of a simple project which contains a binary.

Cannot build

Hi, I cannot run the cargo build

error[E0046]: not all trait items implemented, missing: `ENABLE_PTR_TRACKING_HOOKS`
   --> src/constant.rs:281:1
    |
281 | impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ENABLE_PTR_TRACKING_HOOKS` in implementation
    |
    = note: `ENABLE_PTR_TRACKING_HOOKS` from trait: `const ENABLE_PTR_TRACKING_HOOKS: bool;`

Edit(bjorn3): Put terminal output in a code block.

Find out why the regex tests throw an allocation error with size 0xFFFF_FFFF_FFFF_FFFD

On the libtest branch:

RUST_TEST_THREADS=1 RUST_TEST_CAPTURE=0 lldb ./regex/target/debug/deps/regex-011ed8498c0d5330 -- --exclude-should-panic -Zunstable-options
(lldb) target create "./regex/target/debug/deps/regex-011ed8498c0d5330"
Current executable set to './regex/target/debug/deps/regex-011ed8498c0d5330' (x86_64).
(lldb) settings set -- target.run-args  "--exclude-should-panic" "-Zunstable-options"
(lldb) run
Process 32322 launched: './regex/target/debug/deps/regex-011ed8498c0d5330' (x86_64)

running 44 tests
test compile::tests::byte_classes ... ok
test compile::tests::full_byte_classes ... ok
test dfa::tests::prop_read_write_i32 ... ok
test dfa::tests::prop_read_write_u32 ... ok
memory allocation of 18446744073709551613 bytes failedProcess 32322 stopped
* thread #1: tid = 32322, 0x00007ffff722cfff libc.so.6`gsignal + 207, name = 'regex-011ed8498', stop reason = signal SIGABRT
    frame #0: 0x00007ffff722cfff libc.so.6`gsignal + 207
libc.so.6`gsignal:
->  0x7ffff722cfff <+207>: addq   $0x88, %rsp
    0x7ffff722d006 <+214>: movl   %r8d, %eax
    0x7ffff722d009 <+217>: popq   %rbx
    0x7ffff722d00a <+218>: retq   
(lldb) bt
* thread #1: tid = 32322, 0x00007ffff722cfff libc.so.6`gsignal + 207, name = 'regex-011ed8498', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff722cfff libc.so.6`gsignal + 207
    frame #1: 0x00007ffff722e42a libc.so.6`abort + 362
    frame #2: 0x0000555555bee92a regex-011ed8498c0d5330`std::sys::unix::abort_internal::h347f7c6a54bcbb22 + 10 at mod.rs:155
    frame #3: 0x0000555555c5ae2d regex-011ed8498c0d5330`rust_oom + 381 at alloc.rs:217
    frame #4: 0x0000555555c69f00 regex-011ed8498c0d5330`alloc::alloc::handle_alloc_error::h5808c26404527bf1 + 64 at alloc.rs:245
    frame #5: 0x0000555555c6950b regex-011ed8498c0d5330`alloc::raw_vec::RawVec$LT$T$C$A$GT$::allocate_in::haff5df609eb7a832 + 1035 at raw_vec.rs:99
    frame #6: 0x0000555555c68e97 regex-011ed8498c0d5330`alloc::raw_vec::RawVec$LT$T$GT$::with_capacity::h558055817251b981 + 39 at raw_vec.rs:139
    frame #7: 0x0000555555c679e9 regex-011ed8498c0d5330`alloc::vec::Vec$LT$T$GT$::with_capacity::h9575ef00f26886ea + 41 at vec.rs:356
    frame #8: 0x0000555555c64e5b regex-011ed8498c0d5330`alloc::slice::_$LT$impl$u20$$u5b$T$u5d$$GT$::repeat::h6ee1c58cfe569a4b + 891 at slice.rs:444
    frame #9: 0x0000555555c64ab2 regex-011ed8498c0d5330`alloc::str::_$LT$impl$u20$str$GT$::repeat::hc65f26d246e8d1a7 + 258 at str.rs:510
    frame #10: 0x000055555583fb36 regex-011ed8498c0d5330`test::TestDesc::padded_name::he46e3fe61d6de2cf + 502 at lib.rs:151
    frame #11: 0x000055555583f517 regex-011ed8498c0d5330`test::formatters::pretty::PrettyFormatter$LT$T$GT$::write_test_name::ha8c9c19d9609af13 + 407 at pretty.rs:140
    frame #12: 0x00005555558f8525 regex-011ed8498c0d5330`_$LT$test..formatters..pretty..PrettyFormatter$LT$T$GT$$u20$as$u20$test..formatters..OutputFormatter$GT$::write_test_start::h8a38528ef6ab90f8 + 149 at pretty.rs:159
    frame #13: 0x00005555558bba7a regex-011ed8498c0d5330`test::run_tests_console::callback::h39ec9cd3fc5ec7ee + 1418 at lib.rs:898
    frame #14: 0x00005555557f2071 regex-011ed8498c0d5330`test::run_tests_console::_$u7b$$u7b$closure$u7d$$u7d$::h7fa15c5363fc21fc + 225 at lib.rs:970
    frame #15: 0x00005555558ceee9 regex-011ed8498c0d5330`test::run_tests::h89ed487737f5261b + 6585 at lib.rs:1164
    frame #16: 0x00005555558faf23 regex-011ed8498c0d5330`test::run_tests_console::he0d17c3246846bca + 3891 at lib.rs:970
    frame #17: 0x000055555586c1e7 regex-011ed8498c0d5330`test::test_main::he64c3f4084c4fb20 + 1591 at lib.rs:291
    frame #18: 0x000055555586ba28 regex-011ed8498c0d5330`test::test_main_static::h18e35704a61f9a4a + 696 at lib.rs:325
    frame #19: 0x00005555555e2377 regex-011ed8498c0d5330`regex::main::hf76ba9890b6c3575 + 55 at lib.rs:1
    frame #20: 0x00005555556ec16f regex-011ed8498c0d5330`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hddee2776adbf4146 + 31 at rt.rs:64
    frame #21: 0x0000555555c4630f regex-011ed8498c0d5330`std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h2eeb809f32b3a2e3 + 79 at rt.rs:52
    frame #22: 0x0000555555c21061 regex-011ed8498c0d5330`std::panicking::try::do_call::he28f1668f2a240df + 225 at panicking.rs:296
    frame #23: 0x0000555555c5ff92 regex-011ed8498c0d5330`__rust_maybe_catch_panic + 162 at lib.rs:80
    frame #24: 0x0000555555c20d48 regex-011ed8498c0d5330`std::panicking::try::h174352fb6d676336 + 312 at panicking.rs:275
    frame #25: 0x0000555555c25930 regex-011ed8498c0d5330`std::panic::catch_unwind::h2a5a9a7c25cee50a + 64 at panic.rs:388
    frame #26: 0x0000555555c586be regex-011ed8498c0d5330`std::rt::lang_start_internal::h7455589cd378fa21 + 766 at rt.rs:52
    frame #27: 0x00005555557df6d4 regex-011ed8498c0d5330`std::rt::lang_start::h7a6c71e038f3a978 + 84 at rt.rs:64
    frame #28: 0x00005555557e539a regex-011ed8498c0d5330`main + 26
    frame #29: 0x0000555555cdecd0 regex-011ed8498c0d5330
    frame #30: 0x00007ffff721a2e1 libc.so.6`__libc_start_main + 241
    frame #31: 0x00005555555a5d1a regex-011ed8498c0d5330`_start + 42

More testing

Regex test panics with add overflow error for latest nightly

Minimized repro:

extern crate aho_corasick;

fn main() {
    let ac = aho_corasick:: AhoCorasickBuilder::new()
        .match_kind(aho_corasick::MatchKind::LeftmostFirst)
        .dfa(true)
        .build_with_size::<u32, _, _>(&[
            b"cg",
            b"gg",
            b"ta",
        ])
        .unwrap();
    ac.find(b"abc");
}
trap at Instance { def: Item(DefId(12:824 ~ aho_corasick[3b90]::prefilter[0]::{{impl}}[4]::update_skipped_bytes[0])), substs: [] } (_ZN12aho_corasick9prefilter14PrefilterState20update_skipped_bytes17hd315c6d74654538eE): [panic] Assert attempt to add with overflow at /home/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/aho-corasick-0.7.6/src/prefilter.rs:199:9: 199:32 failed.
$ rustc -V
rustc 1.38.0-nightly (d3f8a0b5d 2019-08-04)

Get libcompiler_builtins working

This is necessary for implementing floating point intrinsics. (cc #1) It is also necessary for 128 bit integer operations.

Edit: this isn't actually necessary for implementing floating point intrinsics, as libm provides the necessary symbols.

Global allocator support

Getting a linker error (branch wip_alloc_example):

target/debug/xargo(data.o): In function `__rg_realloc':
some_file.o:(.text.__rg_realloc+0x56): undefined reference to `core::alloc::Layout::from_size_align_unchecked'
some_file.o:(.text.__rg_realloc+0x84): undefined reference to `alloc_system::platform::<impl core::alloc::GlobalAlloc for alloc_system::System>::realloc'
target/debug/xargo(data.o): In function `xargo::main':
some_file.o:(.text._ZN5xargo4main17h7ba4cb1b7386fe5eE+0x7f): undefined reference to `alloc::alloc::exchange_malloc'
target/debug/xargo(data.o): In function `core::ptr::drop_in_place':
some_file.o:(.text._ZN4core3ptr13drop_in_place17hefa8a925b43607b3E+0xc): undefined reference to `alloc::alloc::box_free'
target/debug/xargo(data.o): In function `__rg_dealloc':
some_file.o:(.text.__rg_dealloc+0x3c): undefined reference to `core::alloc::Layout::from_size_align_unchecked'
some_file.o:(.text.__rg_dealloc+0x5f): undefined reference to `alloc_system::platform::<impl core::alloc::GlobalAlloc for alloc_system::System>::dealloc'
target/debug/xargo(data.o): In function `__rg_alloc':
some_file.o:(.text.__rg_alloc+0x4a): undefined reference to `core::alloc::Layout::from_size_align_unchecked'
some_file.o:(.text.__rg_alloc+0x65): undefined reference to `alloc_system::platform::<impl core::alloc::GlobalAlloc for alloc_system::System>::alloc'
target/debug/xargo(data.o): In function `__rg_alloc_zeroed':
some_file.o:(.text.__rg_alloc_zeroed+0x4a): undefined reference to `core::alloc::Layout::from_size_align_unchecked'
some_file.o:(.text.__rg_alloc_zeroed+0x65): undefined reference to `alloc_system::platform::<impl core::alloc::GlobalAlloc for alloc_system::System>::alloc_zeroed'

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /cranelift/lib/umbrella/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.