Commit Graph

252437 Commits

Author SHA1 Message Date
Daniel Paoliello
ed46e3ca65 Update backtrace submodule 2024-04-12 16:28:19 -07:00
Hamza Jadid
fa21dd4a97
chore: replace x with y for hexa-decimal fmt 2024-04-13 02:16:20 +03:00
Weihang Lo
62e98555fb
Update cargo 2024-04-12 18:32:40 -04:00
bors
9782770a81 Auto merge of #121430 - madsmtm:mac-catalyst-iOSSupport, r=wesleywiser
Add `/System/iOSSupport` to the library search path on Mac Catalyst

On macOS, `/System/iOSSupport` contains iOS frameworks like UIKit, which is the whole idea of Mac Catalyst.

To link to these, we need to explicitly tell the linker about the support library stubs provided in the macOS SDK under the same path.

Concretely, when building a binary for Mac Catalyst, Xcode passes the following flags to the linker:
```
-iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/iOSSupport/System/Library/Frameworks
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/iOSSupport/usr/lib
```

This is not something that can be disabled (it's enabled as soon as you enable `SUPPORTS_MACCATALYST`), so I think it's pretty safe to say that we don't need an option to turn these off.

I've chosen to slightly deviate from what Xcode does and use `-F` instead of `-iframework`, since we don't need to change the header search path, and this way the flags nicely match on all the linkers. From what I could tell by reading Clang sources, there shouldn't be a difference when just running the linker.

CC `@BlackHoleFox,` `@shepmaster` (I accidentally let rustbot choose the reviewer).
2024-04-12 22:27:33 +00:00
Ben Kimock
f7d54fa6cb Avoid more NonNull-raw-NonNull roundtrips in Vec 2024-04-12 18:14:29 -04:00
Josh Stone
a7201db04b
Merge cuviper in the mailmap 2024-04-12 14:55:36 -07:00
Trevor Gross
ca0939db04 Fix Pietro's entry in the mailmap
Mailmap only allows one remapping per line, so @pietroalbini wasn't
getting grouped correctly. Fix this.
2024-04-12 17:36:00 -04:00
Esteban Küber
4c7213c888 review comments
Added comments and reworded messages
2024-04-12 20:57:07 +00:00
bors
79424056b0 Auto merge of #123869 - matthiaskrgr:rollup-9kif9c9, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123654 (typeck: fix `?` suggestion span)
 - #123807 (Remove `sys_common::thread`)
 - #123834 (Don't do coroutine-closure-specific upvar analysis if tainted by errors)
 - #123847 (Suppress `let else` suggestion for uninitialized refutable `let`s)
 - #123857 (std::net: TcpListener shrinks the backlog argument to 32 for Haiku.)
 - #123858 (zkvm: fix path to cmath in zkvm module)
 - #123867 (Add `unsafe` to two functions with safety invariants)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-12 20:23:30 +00:00
Eduardo Sánchez Muñoz
474a0473b4 De-duplicate SSE2 sll/srl/sra code 2024-04-12 22:07:51 +02:00
Matthias Krüger
3026204e84
Rollup merge of #123867 - eduardosm:unsafe-fns, r=ChrisDenton
Add `unsafe` to two functions with safety invariants
2024-04-12 21:47:00 +02:00
Matthias Krüger
b5c3db162e
Rollup merge of #123858 - marijanp:fix-zkvm-cmath-path, r=joboet
zkvm: fix path to cmath in zkvm module

I don't know why the original author decided to use relative paths.

I think it would be better to use `use crate::sys::cmath;`

The according issue can be found here https://github.com/risc0/risc0/issues/1647
2024-04-12 21:47:00 +02:00
Matthias Krüger
fa4c219d91
Rollup merge of #123857 - devnexen:tcp_listener_update_backlog, r=ChrisDenton
std::net: TcpListener shrinks the backlog argument to 32 for Haiku.
2024-04-12 21:46:59 +02:00
Matthias Krüger
e4c8672571
Rollup merge of #123847 - eggyal:issue-123844, r=fmease
Suppress `let else` suggestion for uninitialized refutable `let`s

Fixes #123844

r? `@CAD97`
2024-04-12 21:46:59 +02:00
Matthias Krüger
1524fe04ad
Rollup merge of #123834 - compiler-errors:async-closure-with-tainted-body, r=oli-obk
Don't do coroutine-closure-specific upvar analysis if tainted by errors

See the comment

Fixes #123821
Fixes #123818
2024-04-12 21:46:58 +02:00
Matthias Krüger
595a284872
Rollup merge of #123807 - joboet:sys_common_thread, r=jhpratt
Remove `sys_common::thread`

Part of #117276.

The stack size calculation isn't system-specific at all and can just live together with the rest of the spawn logic.
2024-04-12 21:46:58 +02:00
Matthias Krüger
ca28e9554f
Rollup merge of #123654 - jieyouxu:question-mark-span, r=Nadrieril
typeck: fix `?` suggestion span

Noticed in <https://github.com/rust-lang/rust/pull/112043#issuecomment-2043565292>, if the

```
use the `?` operator to extract the `Result<(), std::fmt::Error>` value, propagating a `Result::Err` value to the caller
```

suggestion is applied to a macro that comes from a non-local crate (e.g. the stdlib), the suggestion span can become non-local, which will cause newer rustfix versions to fail.

This PR tries to remedy the problem by recursively probing ancestors of the expression span, trying to identify the most ancestor span that is (1) still local, and (2) still shares the same syntax context as the expression.

This is the same strategy used in https://github.com/rust-lang/rust/pull/112043.

The test unfortunately cannot `//@ run-rustfix` because there are two conflicting MaybeIncorrect suggestions that when collectively applied, cause the fixed source file to become non-compilable.

Also avoid running `//@ run-rustfix` for `tests/ui/typeck/issue-112007-leaked-writeln-macro-internals.rs` because that also contains conflicting suggestions.

cc `@ehuss` who noticed this. This question mark span fix + not running rustfix on the tests containing conflicting MaybeIncorrect suggestions should hopefully unblock rustfix from updating.
2024-04-12 21:46:57 +02:00
Eduardo Sánchez Muñoz
fb9e1f73b3 Stabilize (const_)slice_ptr_len and (const_)slice_ptr_is_empty_nonnull 2024-04-12 21:23:20 +02:00
Eduardo Sánchez Muñoz
a6ed319e1b Add unsafe to two functions with safety invariants 2024-04-12 21:13:44 +02:00
bors
22a2425c10 Auto merge of #121426 - madsmtm:remove-cc-syslibroot, r=pnkfelix
Remove redundant `-Wl,-syslibroot`

Since `-isysroot` is set, [Clang already passes this when invoking the linker](https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/clang/lib/Driver/ToolChains/Darwin.cpp#L439-L442).

See https://github.com/rust-lang/rust/pull/56833 for when the `-isysroot` was originally added, but didn't remove the unnecessary linker flag.

CC `@BlackHoleFox`
r? shepmaster
2024-04-12 18:16:47 +00:00
Alan Egerton
ddcfb94b84
Suppress erroneous suggestion
The suggestion to use `let else` with an uninitialized refutable `let`
statement was erroneous: `let else` cannot be used with deferred
initialization.
2024-04-12 17:45:15 +01:00
Marijan Petričević
861e213f87
zkvm: remove cmath
- Remove cmath from zkvm module since cmath was moved to sys and is
shared by all platforms (see #120109)
2024-04-12 11:30:12 -05:00
Oli Scherer
24653a5664 Remove a HACK by instead inferring opaque types during expected/formal type checking 2024-04-12 16:17:31 +00:00
Oli Scherer
0c6077984f Avoid an intermediate Option and just create the resulting enum directly 2024-04-12 16:16:40 +00:00
bors
322e92bdae Auto merge of #123856 - matthiaskrgr:rollup-4v8rkfj, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #123204 (rustdoc: point at span in `include_str!`-ed md file)
 - #123223 (Fix invalid silencing of parsing error)
 - #123249 (do not add prolog for variadic naked functions)
 - #123825 (Call the panic hook for non-unwind panics in proc-macros)
 - #123833 (Update stdarch submodule)
 - #123841 (Improve diagnostic by suggesting to remove visibility qualifier)
 - #123849 (Update E0384.md)
 - #123852 (fix typo in library/std/src/lib.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-12 16:14:41 +00:00
Michael Goulet
49e73c3e01 Don't do coroutine-closure-specific upvar analysis if tainted by errors 2024-04-12 12:14:29 -04:00
David Carlier
1ce559b690
std::net: TcpListener shrinks the backlog argument to 32 for Haiku. 2024-04-12 16:55:10 +01:00
Matthias Krüger
4393eab9ea
Rollup merge of #123852 - kamaboko123:fix_typo_in_std_lib_rs, r=lqd
fix typo in library/std/src/lib.rs

I found typo in literal.
I got an error by this typo when build std.

```
salacia@Vega:~/fat12rs$ cargo build -Zbuild-std
   Compiling compiler_builtins v0.1.108
   Compiling core v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.153
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
   Compiling rustc-std-workspace-core v1.99.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling unwind v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling gimli v0.28.1
   Compiling object v0.32.2
   Compiling addr2line v0.21.0
   Compiling miniz_oxide v0.7.2
   Compiling std_detect v0.1.5 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling hashbrown v0.14.3
   Compiling panic_abort v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_unwind)
error: expected `,`, found `.`
   --> /home/salacia/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/lib.rs:224:78
    |
224 |             `#![no_std]` or overriding this warning by enabling this feature".
    |                                                                              ^ expected `,`

error: could not compile `std` (lib) due to 1 previous error
:224:78
    |
224 |             `#![no_std]` or overriding this warning by enabling this feature".
    |                                                                              ^ expected `,`

error: could not compile `std` (lib) due to 1 previous error
```
2024-04-12 17:41:36 +02:00
Matthias Krüger
38283bc295
Rollup merge of #123849 - JimmyOhn:first_contribution, r=pnkfelix
Update E0384.md

Add an example for the shadowing usage.
2024-04-12 17:41:35 +02:00
Matthias Krüger
15a8b490ea
Rollup merge of #123841 - Kohei316:remove_qualifier_sugg, r=wesleywiser
Improve diagnostic by suggesting to remove visibility qualifier

Resolves #123529
This PR improve diagnostic by suggesting to remove visibility qualifier.
2024-04-12 17:41:35 +02:00
Matthias Krüger
be3ea1dfb0
Rollup merge of #123833 - dpaoliello:stdarch, r=Amanieu
Update stdarch submodule

`asm_experimental_arch` is required in `core` as we're now using unstable inline assembly when building Arm64EC.

Brings in the fix for <https://github.com/rust-lang/stdarch/issues/1555> (cc `@tslnc04).`

r? `@Amanieu`
2024-04-12 17:41:34 +02:00
Matthias Krüger
8c8692014b
Rollup merge of #123825 - saethlin:report-nounwind-panics, r=petrochenkov
Call the panic hook for non-unwind panics in proc-macros

As I suggested in https://github.com/rust-lang/rust/issues/123286#issuecomment-2030344815.

If a proc macro causes a non-unwinding panic, `proc_macro` isn't able to catch the unwind and report the panic as a compile error by passing control back to the compiler. Our only chance to produce any diagnostic is the panic hook, so we should call it.

This scenario has already existed, but has become a lot more interesting now that we're adding more UB-detecting panics to the standard library, and such panics do not unwind.
2024-04-12 17:41:34 +02:00
Matthias Krüger
4a0e9e0deb
Rollup merge of #123249 - goolmoos:naked_variadics, r=pnkfelix
do not add prolog for variadic naked functions

fixes #99858
2024-04-12 17:41:33 +02:00
Matthias Krüger
68359e2284
Rollup merge of #123223 - estebank:issue-123079, r=pnkfelix
Fix invalid silencing of parsing error

Given

```rust
macro_rules! a {
    ( ) => {
        impl<'b> c for d {
            e::<f'g>
        }
    };
}
```

ensure an error is emitted.

Fix #123079.
2024-04-12 17:41:33 +02:00
Matthias Krüger
ffea7e2a9b
Rollup merge of #123204 - notriddle:notriddle/include-str-span, r=pnkfelix
rustdoc: point at span in `include_str!`-ed md file

Fixes #118549
2024-04-12 17:41:32 +02:00
klensy
aff5f47dce remove dead code 2024-04-12 17:54:35 +03:00
Vadim Petrochenkov
ed62b57c86 linker: Remove laziness and caching from native search directory walks
It shouldn't be necessary for performance now.
2024-04-12 17:28:00 +03:00
Jimmy Ohn
0b5653f098 Update compiler/rustc_error_codes/src/error_codes/E0384.md
Add an example for the shadowing usage.
2024-04-12 22:43:38 +09:00
bors
bd71213cf0 Auto merge of #123846 - matthiaskrgr:rollup-85y28av, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #123796 (Remove unused cargo-platform dependency from tidy)
 - #123830 (Remove `From` impls for unstable types that break inference)
 - #123842 (fix typo in pin.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-12 13:13:50 +00:00
Jiahao XU
4a6b1562b5
Update document for std::io::Error::downcast 2024-04-12 23:03:36 +10:00
kamaboko123
47c3ffa5d4 fix typo in library/std/src/lib.rs 2024-04-12 22:02:08 +09:00
Guy Shefy
9139d7252d do not add prolog for variadic naked functions
fixes #99858
2024-04-12 15:29:39 +03:00
Matthias Krüger
e256d5f2ee
Rollup merge of #123842 - ShockYoungCHN:master, r=scottmcm
fix typo in pin.rs

correct "implemts" to "implements".
2024-04-12 13:35:31 +02:00
Matthias Krüger
bcf24d6467
Rollup merge of #123830 - tgross35:f16-f128-from-inference-fix, r=Nilstrieb
Remove `From` impls for unstable types that break inference

Adding additional `From` implementations that fit `f32::from(<unaffixed float>)` broke inference. Remove these for now.

I added a test to make sure this doesn't quietly change in the future, even though the behavior is not technically guaranteed https://github.com/rust-lang/rust/issues/123824#issuecomment-2050628184

Fixes: <https://github.com/rust-lang/rust/issues/123824>
2024-04-12 13:35:30 +02:00
Matthias Krüger
b467eddf64
Rollup merge of #123796 - bjorn3:remove_cargo_platform, r=clubby789
Remove unused cargo-platform dependency from tidy

Noticed in https://github.com/rust-lang/rust/pull/123788#issuecomment-2049806519
2024-04-12 13:35:30 +02:00
bors
7bdae134cb Auto merge of #123783 - tgross35:f16-f128-debug-impl, r=Amanieu
Add a `Debug` impl and some basic functions to `f16` and `f128`

`compiler_builtins` uses some convenience functions like `is_nan` and `is_sign_positive`. Add these, as well as a temporary implementation for `Debug` that prints the bit representation.
2024-04-12 11:11:50 +00:00
joboet
0f52cd0e71
core: get rid of USIZE_MARKER 2024-04-12 12:00:14 +02:00
Rémy Rakic
dee834b8a6 test duplicate features, that the last +/-lld on the CLI wins 2024-04-12 09:46:38 +00:00
Rémy Rakic
317d0bdd63 document -Zlinker-features in the unstable book 2024-04-12 09:46:38 +00:00
Rémy Rakic
5359d9c02a test self-contained linking via -Zlinker-features=+lld 2024-04-12 09:46:38 +00:00