Commit Graph

7 Commits

Author SHA1 Message Date
Trevor Gross
c136fb7734 Run builtins-test-intrinsics when possible
Currently we only build this, but it is possible to run the binary.
Change the CI script to do so here.
2025-05-29 18:46:06 +00:00
Trevor Gross
151b1cb047 Change compiler-builtins to edition 2024
Do the same for `builtins-test-intrinsics`. Mostly this means updating
`extern` to `unsafe extern`, and fixing a few new Clippy lints.
2025-05-29 16:12:33 +00:00
Trevor Gross
4c2659f9ce builtins-test: Remove no_mangle from eh_personality
Rustc now mangles these symbols on its own, so `no_mangle` is rejected
as an error.
2025-05-01 15:03:07 -04:00
Trevor Gross
975617e8d4 Warn on unsafe_op_in_unsafe_fn by default
Edition 2024 requires that we avoid this. There is a lot of code that
will need to be adjusted, so start the process here with a warning that
will show up in CI.
2025-04-23 15:27:05 -04:00
Trevor Gross
8d70be87e6 Run cargo fmt on all projects
Apply the same formatting rules to both `libm` and `compiler-builtins`.
2025-04-19 19:05:49 -04:00
Trevor Gross
3167cbb6d0 Temporarily disable the test call to rust_begin_unwind
Since [1] this symbol is mangled, meaning it is not easy to call
directly. A better fix will come in [2] but for now, just disable that
portion of the test.

[1]: https://github.com/rust-lang/rust/pull/127173
[2]: https://github.com/rust-lang/compiler-builtins/pull/802
2025-03-18 23:10:02 -05:00
Trevor Gross
a179959e0b Move examples/intrinsics.rs to its own crate
Currently there is an interesting situation with the way features get
enabled; `testcrate` enables `mangled-names`, but the `intrinsics.rs`
example requires this feature be disabled (otherwise the test fails with
missing symbols, as expected). This is also the reason that `testcrate`
is not a default workspace member, meaning `cargo test` doesn't actually
run `testcrate`'s tests; making it a default member would mean that
`compiler-builtins/mangled-names` gets enabled when
`examples/intrinsics.rs` gets built, due to the way features get
unified.

Simplify the situation by making moving the example to its own crate as
`builtins-test-intrinsics`. This also means `testcrate` can become a
default member so it is included in `cargo check` or `cargo test` when
run at the workspace root.

`testcrate` and `builtins-test-intrinsics` still can't be built at the
same time since there isn't a straightforward way to have Cargo build
`compiler-builtins` twice with different features. This is a side effect
of us using non-additive features, but there isn't really a better
option since enabling both mangled and unmangled names would render
`builtins-test-intrinsics` useless.
2025-03-18 05:35:19 -05:00