Commit Graph

4082 Commits

Author SHA1 Message Date
bjorn3
68b59311fa
Merge pull request #1470 from rust-lang/debuginfo_improvements
Various small debuginfo improvements
2024-03-27 15:08:07 +01:00
bjorn3
41246b2cf6 Remove fixed todos 2024-03-27 13:35:32 +00:00
bjorn3
a64387bb6b Emit DW_AT_external if applicable 2024-03-27 13:28:40 +00:00
bjorn3
98eaaeda11 Match unit names with cg_llvm 2024-03-27 12:57:24 +00:00
bjorn3
e48d7d242f Emit namespace debuginfo 2024-03-27 12:43:47 +00:00
bjorn3
c76c269aa4 Reduce debuginfo divergence between cg_llvm and cg_clif 2024-03-27 11:04:35 +00:00
bjorn3
09ec683ae7 Emit DW_AT_frame_base debuginfo attribute 2024-03-27 10:57:13 +00:00
bjorn3
cfd7325f20
Merge pull request #1469 from rust-lang/fix_some_rustc_tests
Fix a bunch of rustc tests
2024-03-26 12:19:01 +01:00
bjorn3
34d0f6a1d4 Re-enable fixed rustc test 2024-03-26 11:03:50 +00:00
bjorn3
23868af850 Correctly implement --emit 2024-03-26 10:55:46 +00:00
bjorn3
ad1886a5f0 Fix rustdoc help message when no args are passed 2024-03-26 10:27:19 +00:00
bjorn3
dc6595ddbc Implement nearbyintf32 and nearbyintf64 and remove two test ignores 2024-03-26 10:18:44 +00:00
bjorn3
60921608f7 Rustup to rustc 1.79.0-nightly (5f2c7d2bf 2024-03-25) 2024-03-26 09:56:55 +00:00
bjorn3
d183a5186f Sync from rust 5f2c7d2bfd 2024-03-26 09:50:48 +00:00
Matthias Krüger
22e4175bd6 Rollup merge of #123034 - bjorn3:test_ignores, r=compiler-errors
Add a bunch of needs-unwind annotations to tests

To filter out tests that fail with cg_clif due to missing panic=unwind support.
2024-03-25 17:05:36 +01:00
bjorn3
49777c3bfa Add needs-unwind for proc macro tests
Rustc gives a warning when compiling proc macros with panic=abort.
2024-03-25 15:02:55 +00:00
bjorn3
654ce59f70 Remove ignore for fixed rustc test 2024-03-25 14:41:19 +00:00
bjorn3
187decaf18 Fix rustc test suite 2024-03-25 14:29:11 +00:00
bjorn3
c53025b45d Add needs-unwind annotations to a couple of tests 2024-03-25 14:19:07 +00:00
bjorn3
0231d65cec Rustup to rustc 1.79.0-nightly (0824b300e 2024-03-24) 2024-03-25 14:05:11 +00:00
bjorn3
28d480b881 Sync from rust 0824b300eb 2024-03-25 13:59:27 +00:00
Michael Goulet
4609a48d6a Add async-closures/once.rs back to cranelift tests 2024-03-24 21:42:32 -04:00
Ralf Jung
a517adc66e move assert_unsafe_preconditions to its own file
These macros and functions are not intrinsics, after all.
2024-03-23 18:44:17 +01:00
bors
7f0f9f6580 Auto merge of #122852 - compiler-errors:raw-ptr, r=lcnr
Remove `TypeAndMut` from `ty::RawPtr` variant, make it take `Ty` and `Mutability`

Pretty much mechanically converting `ty::RawPtr(ty::TypeAndMut { ty, mutbl })` to `ty::RawPtr(ty, mutbl)` and its fallout.

r? lcnr

cc rust-lang/types-team#124
2024-03-22 20:34:14 +00:00
bjorn3
593228373d Remove workaround for UB in cranelift-jit that has been fixed 2024-03-22 18:58:36 +00:00
bjorn3
e2cc8ebd87 Rustup to rustc 1.79.0-nightly (0ad927c0c 2024-03-21) 2024-03-22 18:51:59 +00:00
bjorn3
087385a1e7 Sync from rust 0ad927c0c0 2024-03-22 18:44:52 +00:00
bjorn3
ae0e6e22f0 Update to Cranelift 0.106 2024-03-22 18:34:00 +00:00
bors
9057355f50 Auto merge of #122580 - saethlin:compiler-builtins-can-panic, r=pnkfelix
"Handle" calls to upstream monomorphizations in compiler_builtins

This is pretty cooked, but I think it works.

compiler-builtins has a long-standing problem that at link time, its rlib cannot contain any calls to `core`. And yet, in codegen we _love_ inserting calls to symbols in `core`, generally from various panic entrypoints.

I intend this PR to attack that problem as completely as possible. When we generate a function call, we now check if we are generating a function call from `compiler_builtins` and whether the callee is a function which was not lowered in the current crate, meaning we will have to link to it.

If those conditions are met, actually generating the call is asking for a linker error. So we don't. If the callee diverges, we lower to an abort with the same behavior as `core::intrinsics::abort`. If the callee does not diverge, we produce an error. This means that compiler-builtins can contain panics, but they'll SIGILL instead of panicking. I made non-diverging calls a compile error because I'm guessing that they'd mostly get into compiler-builtins by someone making a mistake while working on the crate, and compile errors are better than linker errors. We could turn such calls into aborts as well if that's preferred.
2024-03-22 16:55:11 +00:00
Michael Goulet
155b46aeb2 Programmatically convert some of the pat ctors 2024-03-22 11:13:29 -04:00
Michael Goulet
dfc1bd7516 Eagerly convert some ctors to use their specialized ctors 2024-03-22 11:12:01 -04:00
bjorn3
9ddba16363
Merge pull request #1467 from BeetleFunk/global-asm-ice
Avoid ICE when global_asm const operand fails to evaluate
2024-03-21 23:06:33 +01:00
BeetleFunk
eb752bc6a7 Avoid ICE when global_asm const operand fails to evaluate 2024-03-21 11:59:03 -04:00
Oli Scherer
06ef32c862 Make ptr_guaranteed_cmp a rustc_intrinsic and favor its body over backends implementing it 2024-03-19 09:17:40 +00:00
bjorn3
c49f608062 Several refactorings to constant.rs
* Move the done hash set from ConstantCx to define_all_allocs.
* Move check if alloc has already been defined to the start of the loop.
* Extract helper function for vtables.
2024-03-18 15:10:23 +00:00
bjorn3
b64079d631 Re-enable rmake.rs tests as a compiletest bug has been fixed 2024-03-18 14:08:59 +00:00
bjorn3
1aac27e6b6 Rustup to rustc 1.79.0-nightly (eb45c8444 2024-03-17) 2024-03-18 13:59:53 +00:00
Oli Scherer
eeca87b8c7 Avoid various uses of Option<Span> in favor of using DUMMY_SP in the few cases that used None 2024-03-18 09:34:08 +00:00
Ben Kimock
e46114fdc8 Handle calls to upstream monomorphizations in compiler_builtins 2024-03-16 15:22:05 -04:00
bjorn3
db15302b5d Merge branch 'sync_from_rust' 2024-03-16 17:25:11 +00:00
bjorn3
4b61629951 Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into sync_cg_clif-2024-03-16 2024-03-16 17:23:11 +00:00
bjorn3
4cf4ffc6ba Fix rustc test suite 2024-03-16 16:30:08 +00:00
bjorn3
e775fdc9e9 Don't try to get a ty for a nested allocation
Fixes rust-lang/rustc_codegen_cranelift#1464
2024-03-16 16:17:58 +00:00
bjorn3
9f162c49cb Rustup to rustc 1.78.0-nightly (c67326b06 2024-03-15) 2024-03-16 16:17:16 +00:00
bjorn3
0000db58c6 Sync from rust c67326b063 2024-03-16 13:25:40 +00:00
Matthias Krüger
47abd3a486 Rollup merge of #122287 - RalfJung:simd-static-assert, r=pnkfelix
add test ensuring simd codegen checks don't run when a static assertion failed

stdarch relies on this to ensure that SIMD indices are in bounds.

I would love to know why this works, but I can't figure out where codegen decides to not codegen a function if a required-const does not evaluate. `@oli-obk` `@bjorn3` do you have any idea?
2024-03-14 15:44:33 +01:00
Jacob Pratt
221402e863 Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
Ralf Jung
fe7be63dae add comments explaining where post-mono const eval errors abort compilation 2024-03-10 14:39:26 +01:00
Ralf Jung
01affeb53a use Instance::expect_resolve() instead of unwraping Instance::resolve() 2024-03-10 11:49:33 +01:00
bors
ef862a707b Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung
Distinguish between library and lang UB in assert_unsafe_precondition

As described in https://github.com/rust-lang/rust/pull/121583#issuecomment-1963168186, `assert_unsafe_precondition` now explicitly distinguishes between language UB (conditions we explicitly optimize on) and library UB (things we document you shouldn't do, and maybe some library internals assume you don't do).

`debug_assert_nounwind` was originally added to avoid the "only at runtime" aspect of `assert_unsafe_precondition`. Since then the difference between the macros has gotten muddied. This totally revamps the situation.

Now _all_ preconditions shall be checked with `assert_unsafe_precondition`. If you have a precondition that's only checkable at runtime, do a `const_eval_select` hack, as done in this PR.

r? RalfJung
2024-03-10 01:23:54 +00:00