Commit Graph

232991 Commits

Author SHA1 Message Date
Weihang Lo
099613dab8
Update cargo 2023-08-26 09:51:44 +01:00
bors
42857db66d Auto merge of #115232 - wesleywiser:revert_114643, r=tmiasko
Revert "Use the same DISubprogram for each instance of the same inline function within the caller"

This reverts commit 687bffa493.

Reverting to resolve ICEs reported on nightly.

cc `@dpaoliello`

Fixes #115156
2023-08-26 07:47:26 +00:00
Ralf Jung
0fde82fb97 codegen_llvm/llvm_type: avoid matching on the Rust type 2023-08-26 08:34:56 +02:00
bors
766c0c0b83 Auto merge of #115236 - scottmcm:less-vector, r=compiler-errors
Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen

Fixes #115212

It's unclear what makes this not work sometimes, since it often *does* work, so for now just disable the unusual cases.  A future PR can consider doing something smarter, but this is an easy and safe tweak that we can do to resolve the regressions for now.
2023-08-26 06:02:13 +00:00
Jubilee Young
0f33bb0a75 Fixup sparc-unknown-none-elf table spacing 2023-08-25 21:40:18 -07:00
Zalathar
8d91e71e9a Various trivial formatting fixes in run-coverage tests
These changes were made by manually running `rustfmt` on all of the test files,
and then manually undoing all cases where the original formatting appeared to
have been deliberate.

  `rustfmt +nightly --config-path=/dev/null --edition=2021 tests/run-coverage*/**/*.rs`
2023-08-26 14:35:34 +10:00
Zalathar
4da38c31d2 Tidy up some awkwardly-placed comments in tests
Prior to #114875, these tests were very sensitive to lines being added/removed,
so the migration to `run-coverage` in #112300 tried hard to avoid disturbing
the existing line numbers. That resulted in some awkward reshuffling when
certain comments/directives needed to be added or moved.

Now that we don't have to worry about preserving line numbers, we can rearrange
those comments into a more conventional layout.
2023-08-26 14:35:34 +10:00
Zalathar
72b721f48e Resolve all warnings in run-coverage tests
When one of these tests fails, any compiler warnings will be printed to the
console, which makes it harder to track down the actual reason for failure.

(The outstanding warnings were found by temporarily adding `-Dwarnings` to the
compiler arguments for `RunCoverage` in `src/tools/compiletest/src/runtest.rs`.)
2023-08-26 14:35:34 +10:00
Scott McMurray
84e305dd93 Stop emitting non-power-of-two vectors in basic LLVM codegen 2023-08-25 20:06:57 -07:00
Esteban Küber
bac0e556f0 On let binding type point to type parameter that introduced unmet bound
On the following example, point at `String` instead of the whole type:

```
error[E0277]: the trait bound `String: Copy` is not satisfied
  --> $DIR/own-bound-span.rs:14:24
   |
LL |     let _: <S as D>::P<String>;
   |                        ^^^^^^ the trait `Copy` is not implemented for `String`
   |
note: required by a bound in `D::P`
  --> $DIR/own-bound-span.rs:4:15
   |
LL |     type P<T: Copy>;
   |               ^^^^ required by this bound in `D::P`
```
2023-08-26 02:23:25 +00:00
bors
9334ec9354 Auto merge of #115228 - saethlin:is-interrupted, r=thomcc
Add a new helper to avoid calling io::Error::kind

On `cfg(unix)`, `Error::kind` emits an enormous jump table that LLVM seems unable to optimize out. I don't really understand why, but see for yourself: https://godbolt.org/z/17hY496KG

This change lets us check for `ErrorKind::Interrupted` without going through a big match. I've checked the codegen locally, and it has the desired effect on the codegen for `BufReader::read_exact`.
2023-08-26 02:19:08 +00:00
Ben Kimock
1abaf40ec8 Add a new helper to avoid calling io::Error::kind 2023-08-25 21:26:06 -04:00
Esteban Küber
120c24dab5 Point at appropriate type parameter in more trait bound errors 2023-08-26 01:07:05 +00:00
bors
c5035271ac Auto merge of #115211 - spastorino:add-missing-smir-generics-of, r=compiler-errors
Add missing high-level stable_mir::generics_of fn

We forgot to add this function in https://github.com/rust-lang/rust/pull/115092, as we have done on https://github.com/rust-lang/rust/pull/115084 and other high level APIs.

At some point I think we should re-organize the structure of the code but this is what we have for now.

r? `@compiler-errors`
Would have assigned `@oli-obk` but he is still on vacations
2023-08-26 00:32:16 +00:00
Ciarán Curley
6ec570aca5
Make rustc_on_unimplemented std-agnostic for alloc::rc 2023-08-26 00:52:51 +01:00
Wesley Wiser
d0b2c4f727 Revert "Use the same DISubprogram for each instance of the same inlined function within the caller"
This reverts commit 687bffa493.

Reverting to resolve ICEs reported on nightly.
2023-08-25 19:49:10 -04:00
Ben Kimock
b678d40826 Remove some wasm/emscripten ignores 2023-08-25 19:48:20 -04:00
bors
ac89e1615d Auto merge of #115221 - compiler-errors:walk-path, r=estebank
Walk through full path in `point_at_path_if_possible`

We already had sufficient information to point at the `[u8]` in `Option::<[u8]>::None` (the `fallback_param_to_point_at` parameter), we just were neither using it nor walking through hir paths sufficiently to encounter it.

This should alleviate the need to add additional logic to extract params in a somewhat arbitrary manner of looking at the grandparent def path: https://github.com/rust-lang/rust/pull/115219#discussion_r1305946358

r? `@estebank`
2023-08-25 22:22:08 +00:00
Santiago Pastorino
e2efb6ab29
Check that universe can name other universe instead of equality 2023-08-25 18:14:00 -03:00
bors
734a0d0aa0 Auto merge of #115202 - ouz-a:more_smir, r=spastorino
Add stable for Constant in smir

Previously https://github.com/rust-lang/rust/pull/114587 we covered much of the groundwork needed to cover Const in smir, so there is no reason keep `Constant` as String.

r? `@spastorino`
2023-08-25 20:35:39 +00:00
Santiago Pastorino
78da436cbb
Remove lub_empty from lexical region resolve 2023-08-25 17:16:08 -03:00
Michael Goulet
13e8b13e15 Handle Self in paths too 2023-08-25 19:05:38 +00:00
Michael Goulet
055452864e Walk through full path in point_at_path_if_possible 2023-08-25 19:05:38 +00:00
bors
84382dd10a Auto merge of #115133 - coderwithcat:master, r=cuviper
use the correct link
2023-08-25 18:49:51 +00:00
bors
296c7a683c Auto merge of #115184 - saethlin:local-allocated-spans, r=RalfJung
Record allocation spans inside force_allocation

This expands https://github.com/rust-lang/miri/pull/2940 to cover locals

r? `@RalfJung`
2023-08-25 17:03:33 +00:00
Ben Kimock
8ecdefb3db
Add a doc comment for the new hook
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-08-25 11:58:31 -04:00
Ben Kimock
ec21d584ee Record allocation spans inside force_allocation 2023-08-25 11:16:52 -04:00
bors
a8b905cd78 Auto merge of #115158 - Enselic:break-rust-args, r=compiler-errors
Include compiler flags when you `break rust;`

Closes #70661

r? `@RalfJung` who requested this feature :)
2023-08-25 15:16:17 +00:00
Michael van Straten
edefa8b105 Added option to set ProcThreadAttributes for Windows processes
This implements the ability to add arbitrary attributes to a command on Windows targets using a new `raw_attribute` method on the [`CommandExt`](https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html) trait. Setting these attributes provides extended configuration options for Windows processes.

Co-authored-by: Tyler Ruckinger <t.ruckinger@gmail.com>
2023-08-25 16:30:34 +02:00
bors
25ed43ddf3 Auto merge of #115138 - cjgillot:dse-move-packed, r=compiler-errors
Do not convert copies of packed projections to moves.

This code path was introduced in https://github.com/rust-lang/rust/pull/113758

After seeing https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Packed.20fields.20and.20in-place.20function.20argument.2Freturn.20passing, this may be UB, so should be disallowed.

This should not appear in normally-built MIR, which introduces temporary copies for packed projections.
2023-08-25 13:27:21 +00:00
Santiago Pastorino
3dd1c6bc98
Add missing high-level stable_mir::generics_of fn 2023-08-25 09:42:57 -03:00
bors
738df13e8a Auto merge of #115093 - Zalathar:smir-coverage, r=cjgillot,oli-obk
Treat `StatementKind::Coverage` as completely opaque for SMIR purposes

Coverage statements in MIR are heavily tied to internal details of the coverage implementation that are likely to change, and are unlikely to be useful to third-party tools for the foreseeable future.
2023-08-25 11:43:05 +00:00
David Wood
0848ebd056
tests: add test for #67992
Signed-off-by: David Wood <david@davidtw.co>
2023-08-25 10:31:22 +01:00
bors
b60f7b51a2 Auto merge of #115045 - RalfJung:unwind-terminate-reason, r=davidtwco
when terminating during unwinding, show the reason why

With this, the output on double-panic becomes something like that:
```
thread 'main' panicked at src/tools/miri/tests/fail/panic/double_panic.rs:15:5:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at src/tools/miri/tests/fail/panic/double_panic.rs:10:9:
second
stack backtrace:
   0:           0xbe273a - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut [closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/miri.rs:99:5
   1:           0xbe22e6 - std::backtrace_rs::backtrace::miri::trace::<&mut [closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/miri.rs:62:14
   2:           0xbe1086 - std::backtrace_rs::backtrace::trace_unsynchronized::<[closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   3:           0xba3afd - std::sys_common::backtrace::_print_fmt
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:67:5
   4:           0xba2471 - <std::sys_common::backtrace::_print::DisplayBacktrace as std::fmt::Display>::fmt
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:44:22
   5:           0xbcf754 - core::fmt::rt::Argument::<'_>::fmt
                               at /home/r/src/rust/rustc.3/library/core/src/fmt/rt.rs:138:9
   6:           0x9b8f81 - std::fmt::write
                               at /home/r/src/rust/rustc.3/library/core/src/fmt/mod.rs:1094:17
   7:           0x21391d - <std::sys::unix::stdio::Stderr as std::io::Write>::write_fmt
                               at /home/r/src/rust/rustc.3/library/std/src/io/mod.rs:1714:15
   8:           0xba37b1 - std::sys_common::backtrace::_print
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:47:5
   9:           0xba365b - std::sys_common::backtrace::print
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:34:9
  10:           0x143c67 - std::panic_hook_with_disk_dump::{closure#1}
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:278:22
  11:           0x144187 - std::panic_hook_with_disk_dump
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:312:9
  12:           0x143659 - std::panicking::default_hook
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:239:5
  13:           0x1482a7 - std::panicking::rust_panic_with_hook
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:729:13
  14:           0x1475d5 - std::rt::begin_panic::<&str>::{closure#0}
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:650:9
  15:           0xba496a - std::sys_common::backtrace::__rust_end_short_backtrace::<[closure@std::rt::begin_panic<&str>::{closure#0}], !>
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:170:18
  16:           0x147599 - std::rt::begin_panic::<&str>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:649:12
  17:            0x31916 - <Foo as std::ops::Drop>::drop
                               at src/tools/miri/tests/fail/panic/double_panic.rs:10:9
  18:           0x1a2b5e - std::ptr::drop_in_place::<Foo> - shim(Some(Foo))
                               at /home/r/src/rust/rustc.3/library/core/src/ptr/mod.rs:497:1
  19:            0x202bf - main
                               at src/tools/miri/tests/fail/panic/double_panic.rs:16:1
  20:            0xcc6a8 - <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
                               at /home/r/src/rust/rustc.3/library/core/src/ops/function.rs:250:5
  21:           0xba47d9 - std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:154:18
  22:           0x141a6a - std::rt::lang_start::<()>::{closure#0}
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:166:18
  23:            0xcca18 - std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once
                               at /home/r/src/rust/rustc.3/library/core/src/ops/function.rs:284:13
  24:           0x146469 - std::panicking::try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:524:40
  25:           0x145e09 - std::panicking::try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:488:19
  26:            0x7b0ac - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                               at /home/r/src/rust/rustc.3/library/std/src/panic.rs:142:14
  27:           0x14189b - std::rt::lang_start_internal::{closure#2}
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:148:48
  28:           0x146481 - std::panicking::try::do_call::<[closure@std::rt::lang_start_internal::{closure#2}], isize>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:524:40
  29:           0x145e2c - std::panicking::try::<isize, [closure@std::rt::lang_start_internal::{closure#2}]>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:488:19
  30:            0x7b0d5 - std::panic::catch_unwind::<[closure@std::rt::lang_start_internal::{closure#2}], isize>
                               at /home/r/src/rust/rustc.3/library/std/src/panic.rs:142:14
  31:           0x1418b0 - std::rt::lang_start_internal
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:148:20
  32:           0x141a97 - std::rt::lang_start::<()>
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:165:17
thread 'main' panicked at /home/r/src/rust/rustc.3/library/core/src/panicking.rs:126:5:
panic in a destructor during cleanup
stack backtrace:
   0:           0xe9f6d7 - std::backtrace_rs::backtrace::miri::trace_unsynchronized::<&mut [closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/miri.rs:99:5
   1:           0xe9f27d - std::backtrace_rs::backtrace::miri::trace::<&mut [closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/miri.rs:62:14
   2:           0xe9e016 - std::backtrace_rs::backtrace::trace_unsynchronized::<[closure@std::sys_common::backtrace::_print_fmt::{closure#1}]>
                               at /home/r/src/rust/rustc.3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   3:           0xba3afd - std::sys_common::backtrace::_print_fmt
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:67:5
   4:           0xba2471 - <std::sys_common::backtrace::_print::DisplayBacktrace as std::fmt::Display>::fmt
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:44:22
   5:           0xbcf754 - core::fmt::rt::Argument::<'_>::fmt
                               at /home/r/src/rust/rustc.3/library/core/src/fmt/rt.rs:138:9
   6:           0x9b8f81 - std::fmt::write
                               at /home/r/src/rust/rustc.3/library/core/src/fmt/mod.rs:1094:17
   7:           0x4d0895 - <std::sys::unix::stdio::Stderr as std::io::Write>::write_fmt
                               at /home/r/src/rust/rustc.3/library/std/src/io/mod.rs:1714:15
   8:           0xba37b1 - std::sys_common::backtrace::_print
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:47:5
   9:           0xba365b - std::sys_common::backtrace::print
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:34:9
  10:           0x400bd4 - std::panic_hook_with_disk_dump::{closure#1}
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:278:22
  11:           0x144187 - std::panic_hook_with_disk_dump
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:312:9
  12:           0x143659 - std::panicking::default_hook
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:239:5
  13:           0x1482a7 - std::panicking::rust_panic_with_hook
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:729:13
  14:           0x40403b - std::panicking::begin_panic_handler::{closure#0}
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:619:13
  15:           0xe618b3 - std::sys_common::backtrace::__rust_end_short_backtrace::<[closure@std::panicking::begin_panic_handler::{closure#0}], !>
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:170:18
  16:           0x403fc8 - std::panicking::begin_panic_handler
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:617:5
  17:           0xee23e9 - core::panicking::panic_nounwind_fmt
                               at /home/r/src/rust/rustc.3/library/core/src/panicking.rs:96:14
  18:           0xee29e6 - core::panicking::panic_nounwind
                               at /home/r/src/rust/rustc.3/library/core/src/panicking.rs:126:5
  19:           0xee365e - core::panicking::panic_in_cleanup
                               at /home/r/src/rust/rustc.3/library/core/src/panicking.rs:206:5
  20:            0x2028a - main
                               at src/tools/miri/tests/fail/panic/double_panic.rs:13:1
  21:           0x3895ee - <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
                               at /home/r/src/rust/rustc.3/library/core/src/ops/function.rs:250:5
  22:           0xe61725 - std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
                               at /home/r/src/rust/rustc.3/library/std/src/sys_common/backtrace.rs:154:18
  23:           0x3fe9aa - std::rt::lang_start::<()>::{closure#0}
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:166:18
  24:           0x389962 - std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once
                               at /home/r/src/rust/rustc.3/library/core/src/ops/function.rs:284:13
  25:           0x4033b9 - std::panicking::try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:524:40
  26:           0x402d58 - std::panicking::try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:488:19
  27:           0x337ff7 - std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
                               at /home/r/src/rust/rustc.3/library/std/src/panic.rs:142:14
  28:           0x3fe7e7 - std::rt::lang_start_internal::{closure#2}
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:148:48
  29:           0x4033d6 - std::panicking::try::do_call::<[closure@std::rt::lang_start_internal::{closure#2}], isize>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:524:40
  30:           0x402d7f - std::panicking::try::<isize, [closure@std::rt::lang_start_internal::{closure#2}]>
                               at /home/r/src/rust/rustc.3/library/std/src/panicking.rs:488:19
  31:           0x338028 - std::panic::catch_unwind::<[closure@std::rt::lang_start_internal::{closure#2}], isize>
                               at /home/r/src/rust/rustc.3/library/std/src/panic.rs:142:14
  32:           0x1418b0 - std::rt::lang_start_internal
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:148:20
  33:           0x3fe9dc - std::rt::lang_start::<()>
                               at /home/r/src/rust/rustc.3/library/std/src/rt.rs:165:17
thread caused non-unwinding panic. aborting.
```
If we also land https://github.com/rust-lang/rust/pull/115020, the 2nd backtrace disappears, hopefully making the "panic in a destructor during cleanup" easier to see.

Fixes https://github.com/rust-lang/rust/issues/114954.
2023-08-25 08:47:18 +00:00
cui fliter
9c3f44f922 use the correct link
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-08-25 15:45:41 +08:00
bors
4535d33e33 Auto merge of #115204 - matthiaskrgr:rollup-avsp3t3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #114754 (Name what ln_gamma does)
 - #115081 (Allow overwriting ExpnId for concurrent decoding)
 - #115151 (Fix CFI: f32 and f64 are encoded incorrectly for cross-language CFI)
 - #115169 (remove some unnecessary ignore-debug clauses)
 - #115190 (Add comment to the push_trailing function)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-25 07:02:01 +00:00
Matthias Krüger
021e882c34
Rollup merge of #115190 - allaboutevemirolive:push_trailing, r=petrochenkov
Add comment to the push_trailing function

## Add comment to the `push_trailing` function for clarity.

I improve the explanation by describing:

- how the code handles unicode and emoji characters using `char_indices`,
- how the code handles the absence of high indexes, and
- what the code's overall aim is.
2023-08-25 09:00:14 +02:00
Matthias Krüger
d4b6cff42f
Rollup merge of #115169 - RalfJung:do-not-ignore-debug, r=cjgillot
remove some unnecessary ignore-debug clauses

ignore-debug is only needed when the debug assertions *in the standard library* somehow affect the test. This can happen with inlining but otherwise should be rare. ignore-debug is problematic since PR CI is only run with debug assertions.

r? `@cjgillot` since it looks like you added most of these
2023-08-25 09:00:14 +02:00
Matthias Krüger
adc0c914d4
Rollup merge of #115151 - rcvalle:rust-cfi-fix-115150, r=compiler-errors
Fix CFI: f32 and f64 are encoded incorrectly for cross-language CFI

Fix #115150 by encoding f32 and f64 correctly for cross-language CFI. I missed changing the encoding for f32 and f64 when I introduced the integer normalization option in #105452 as integer normalization does not include floating point. `f32` and `f64` should be always encoded as `f` and `d` since they are both FFI safe when their representation are the same (i.e., IEEE 754) for both the Rust compiler and Clang.
2023-08-25 09:00:13 +02:00
Matthias Krüger
49cdf06b4a
Rollup merge of #115081 - Zoxc:expn-id-decode, r=cjgillot
Allow overwriting ExpnId for concurrent decoding

These assertions only hold for the single threaded compiler. They were triggered in https://github.com/rust-lang/rust/pull/115003.
2023-08-25 09:00:12 +02:00
Matthias Krüger
b88849d77c
Rollup merge of #114754 - workingjubilee:gamma-ray-logger, r=thomcc
Name what ln_gamma does

The previous description omitted some important details.
2023-08-25 09:00:12 +02:00
ouz-a
cab9fc99c9 Add stable for Constant in smir 2023-08-25 09:25:57 +03:00
Ralf Jung
df5a248cb1 keep trying which flags we need for this test until it passes bors 2023-08-25 08:20:19 +02:00
Ramon de C Valle
5d6e2d7050 Fix CFI: f32 and f64 are encoded incorrectly for c
Fix #115150 by encoding f32 and f64 correctly for cross-language CFI. I
missed changing the encoding for f32 and f64 when I introduced the
integer normalization option in #105452 as integer normalization does
not include floating point. `f32` and `f64` should be always encoded as
`f` and `d` since they are both FFI safe when their representation are
the same (i.e., IEEE 754) for both the Rust compiler and Clang.
2023-08-24 21:02:06 -07:00
bors
c9228aeaba Auto merge of #115193 - weihanglo:rollup-6s3mz06, r=weihanglo
Rollup of 9 pull requests

Successful merges:

 - #114987 (elaborate a bit on the (lack of) safety in 'Mmap::map')
 - #115084 (Add smir `predicates_of`)
 - #115117 (Detect and report nix shell)
 - #115124 (kmc-solid: Import `std::sync::PoisonError` in `std::sys::solid::os`)
 - #115152 (refactor(lint): translate `RenamedOrRemovedLint`)
 - #115154 (Move some ui tests to subdirectories)
 - #115167 (Fix ub-int-array test for big-endian platforms)
 - #115172 (Add more tests for if_let_guard)
 - #115177 (Add symbols for Clippy usage)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-25 03:30:23 +00:00
Tobias Bucher
5e76e20d71 Remove special cases that are no longer needed due to #112606 2023-08-25 03:54:28 +02:00
bors
c75b6bdb37 Auto merge of #114397 - sebastiantoh:issue-85222, r=Nadrieril
Add note when matching on tuples/ADTs containing non-exhaustive types

Fixes https://github.com/rust-lang/rust/issues/85222

r? `@Nadrieril`
2023-08-25 01:44:07 +00:00
John Kåre Alsaker
3040d92dc4 Fix waiting on a query that panicked 2023-08-25 03:34:36 +02:00
bors
4354192429 Auto merge of #114201 - Centri3:explicit-repr-rust, r=WaffleLapkin
Allow explicit `#[repr(Rust)]`

This is identical to no `repr()` at all. For `Rust, packed` and `Rust, align(x)`, it should be the same as no `Rust` at all (as, afaik, `#[repr(align(16))]` uses the Rust ABI.)

The main use case for this is being able to explicitly say "I want to use the Rust ABI" in very very rare circumstances where the first obvious choice would be the C ABI yet is undesirable, which is already possible with functions as `extern "Rust"`. This would be useful for silencing https://github.com/rust-lang/rust-clippy/pull/11253. It's also more consistent with `extern`.

The lack of this also tripped me up a bit when I was new to Rust, as I expected this to be possible.
2023-08-25 00:02:54 +00:00
Weihang Lo
eee76d9555
Rollup merge of #115177 - c410-f3r:symbols, r=compiler-errors
Add symbols for Clippy usage

The `arithmetic_side_effects` lint is always "interning" these non-existing symbols related to math operations causing a bit of a slowdown.
2023-08-24 22:54:00 +01:00