Commit Graph

264955 Commits

Author SHA1 Message Date
Matthias Krüger 3ea3397943
Rollup merge of #129843 - tgross35:triagebot-vacation, r=tgross35
Mark myself as on vacation for triagebot

I'll be on vacation for a couple weeks coming up pretty soon.

r? ``@ghost``
2024-09-02 04:19:31 +02:00
Matthias Krüger efad457ad5
Rollup merge of #129842 - no1wudi:master, r=saethlin
Fix LLVM ABI NAME for riscv64imac-unknown-nuttx-elf

This patch fix https://github.com/rust-lang/rust/issues/129825

For the riscv64imac target, the LLVM ABI NAME should be "lp64", which is the default ABI if not specified for the riscv64imac target.
2024-09-02 04:19:30 +02:00
Matthias Krüger 5c3370d684
Rollup merge of #129837 - aDotInTheVoid:test-better-json, r=jieyouxu
Actually parse stdout json, instead of using hacky contains logic.

Fixes up the test added in #128963, to actually parse the stdout to JSON, instead of just checking that it contains `{"`.

CC ``@GuillaumeGomez``

r? ``@jieyouxu``
2024-09-02 04:19:30 +02:00
Matthias Krüger 820540aaa0
Rollup merge of #129804 - ranger-ross:fixed-documentation-typos, r=Noratrieb
Fixed some typos in the standard library documentation/comments

I spent some time to fix a few typos in `library/std` and `library/core`
2024-09-02 04:19:29 +02:00
Matthias Krüger 8c2898989f
Rollup merge of #129793 - lolbinarycat:doc-missing-newlines, r=workingjubilee
add extra linebreaks so rustdoc can identify the first sentence

there should probably be a lint against this in rustdoc, it causes too many lines to be shown in the short documentation overviews

expecially noticable for the slice primative type: https://doc.rust-lang.org/std/index.html
2024-09-02 04:19:29 +02:00
Matthias Krüger dce26656ea
Rollup merge of #129738 - nnethercote:rustc_mir_transform-cleanups, r=cjgillot
`rustc_mir_transform` cleanups

A bunch of small improvements I made while looking closely at this code.

r? `@saethlin`
2024-09-02 04:19:28 +02:00
Matthias Krüger e0039171ff
Rollup merge of #129678 - compiler-errors:type-ir-inherent, r=fmease
Deny imports of `rustc_type_ir::inherent` outside of type ir + new trait solver

We shouldn't encourage using `rustc_type_ir::inherent` outside of the new solver[^1], though this can happen by accident due to rust-analyzer, for example. See https://github.com/rust-lang/rust/pull/127537#discussion_r1733813842 for an example in practice.

r? fmease

[^1]: Unless we go the fully radical approach of always using these inherent methods everywhere in favor of inherent methods, which would be a major overhaul of the compiler, IMO. I don't really want to consider that possibility right now, tho.
2024-09-02 04:19:28 +02:00
Matthias Krüger c90991db17
Rollup merge of #127474 - tesuji:foldable-inline-derefs, r=t-rustdoc
doc: Make block of inline Deref methods foldable

After:
![image](https://github.com/rust-lang/rust/assets/15225902/3e8ab320-dbf7-436f-9be0-d0ef82664663)
Before:
![image](https://github.com/rust-lang/rust/assets/15225902/f6f7635d-d4c3-437e-a2d9-147726287b05)

Fix  #127470.

Current status:
- [x] Bug when hovering over title "Methods from ...": The anchor sign $ overlaps with `[-]`: https://github.com/rust-lang/rust/pull/127474#issuecomment-2222930038
    => Fixed by https://github.com/rust-lang/rust/pull/127474#issuecomment-2228886292
2024-09-02 04:19:27 +02:00
binarycat 0064bd1b99 add extra linebreaks so rustdoc can identify the first sentence
there should probably be a lint against this in rustdoc, it causes
too many lines to be shown in the short documentation overviews

expecially noticable for the slice primative type:
https://doc.rust-lang.org/std/index.html
2024-09-01 14:22:50 -07:00
bors 94885bc699 Auto merge of #129854 - Kobzol:revert-127537, r=lqd
Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU"

This reverts https://github.com/rust-lang/rust/pull/127537 (commit acb4e8b625), reversing changes made to 100fde5246.

Opening to see if this can help resolve the recent perf. results [instability](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Weird.20perf.20results).
2024-09-01 19:46:46 +00:00
Michael Goulet 91854453f2 Deny imports of rustc_type_ir::inherent outside of type ir + new trait solver 2024-09-01 12:16:18 -04:00
bors a48861a627 Auto merge of #127313 - cjgillot:single-expect, r=jieyouxu
Rewrite lint_expectations in a single pass.

This PR aims at reducing the perf regression from https://github.com/rust-lang/rust/pull/120924#issuecomment-2202486203 with drive-by simplifications.

Basically, instead of using the lint level builder, which is slow, this PR splits `lint_expectations` logic in 2:
- listing the `LintExpectations` is done in `shallow_lint_levels_on`, on a per-owner basis;
- building the unstable->stable expectation id map is done by iterating on attributes.

r? ghost for perf
2024-09-01 15:50:48 +00:00
Jakub Beránek 47e6b5deed Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU"
This reverts commit acb4e8b625, reversing
changes made to 100fde5246.
2024-09-01 16:35:53 +02:00
bors 1a1cc050d8 Auto merge of #127897 - nyurik:add-qnx-70-target, r=saethlin
add `aarch64_unknown_nto_qnx700` target - QNX 7.0 support for aarch64le

This backports the QNX 7.1 aarch64 implementation to 7.0.

* [x] required `-lregex` disabled, see https://github.com/rust-lang/libc/pull/3775 (released in libc 0.2.156)
* [x] uses `libgcc.a` instead of `libgcc_s.so` (7.0 used ancient GCC 5.4 which didn't have gcc_s)
* [x] a fix in `backtrace` crate to support stack traces https://github.com/rust-lang/backtrace-rs/pull/648

This PR bumps libc dependency to 0.2.158

CC: to the folks who did the [initial implementation](https://doc.rust-lang.org/rustc/platform-support/nto-qnx.html): `@flba-eb,` `@gh-tr,` `@jonathanpallant,` `@japaric`

# Compile target

```bash
# Configure qcc build environment
source _path_/_to_/qnx7.0/qnxsdp-env.sh

# Tell rust to use qcc when building QNX 7.0 targets
export build_env='
    CC_aarch64-unknown-nto-qnx700=qcc
    CFLAGS_aarch64-unknown-nto-qnx700=-Vgcc_ntoaarch64le_cxx
    CXX_aarch64-unknown-nto-qnx700=qcc
    AR_aarch64_unknown_nto_qnx700=ntoaarch64-ar'

# Build rust compiler, libs, and the remote test server
env $build_env ./x.py build \
  --target x86_64-unknown-linux-gnu,aarch64-unknown-nto-qnx700 \
  rustc library/core library/alloc library/std src/tools/remote-test-server

rustup toolchain link stage1 build/host/stage1
```

# Compile "hello world"

```bash
source _path_/_to_/qnx7.0/qnxsdp-env.sh

cargo new hello_world
cd hello_world
cargo +stage1 build --release --target aarch64-unknown-nto-qnx700
```

# Configure a remote for testing

Do this from a new shell - we will need to run more commands in the previous one.  I ran into these two issues, and found some workarounds.

* Temporary dir might not work properly
* Default `remote-test-server` has issues binding to an address

```
# ./remote-test-server
starting test server
thread 'main' panicked at src/tools/remote-test-server/src/main.rs:175:29:
called `Result::unwrap()` on an `Err` value: Os { code: 249, kind: AddrNotAvailable, message: "Can't assign requested address" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Specifying `--bind` param actually fixes that, and so does setting `TMPDIR` properly.

```bash
# Copy remote-test-server to remote device. You may need to use sftp instead.
# ATTENTION: Note that the path is different from the one in the remote testing documentation for some reason
scp ./build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server  qnxdevice:/path/

# Run ssh with port forwarding - so that rust tester can connect to the local port instead
ssh -L 12345:127.0.0.1:12345 qnxdevice

# on the device, run
rm -rf tmp && mkdir -p tmp && TMPDIR=$PWD/tmp ./remote-test-server --bind 0.0.0.0:12345
```

# Run test suit

Assume all previous environment variables are still set, or re-init them

```bash
export TEST_DEVICE_ADDR="localhost:12345"

# tidy needs to be skipped due to using un-published libc dependency
export exclude_tests='
    --exclude src/bootstrap
    --exclude src/tools/error_index_generator
    --exclude src/tools/linkchecker
    --exclude src/tools/tidy
    --exclude tests/ui-fulldeps
    --exclude rustc
    --exclude rustdoc
    --exclude tests/run-make-fulldeps'

env $build_env ./x.py test  $exclude_tests --stage 1 --target aarch64-unknown-nto-qnx700
```

try-job: dist-x86_64-msvc
2024-09-01 08:00:25 +00:00
bors 78d5c04d9c Auto merge of #129841 - matthiaskrgr:rollup-pkavdtl, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #128495 (core: use `compare_bytes` for more slice element types)
 - #128641 (refactor: standardize duplicate processes in parser)
 - #129207 (Lint that warns when an elided lifetime ends up being a named lifetime)
 - #129493 (Create opaque definitions in resolver.)
 - #129619 (Update stacker to 0.1.17)
 - #129672 (Make option-like-enum.rs UB-free and portable)
 - #129780 (add crashtests for several old unfixed ICEs)
 - #129832 (Remove stray dot in `std::char::from_u32_unchecked` documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-01 04:21:26 +00:00
Trevor Gross a0073104ad Mark myself as on vacation for triagebot 2024-08-31 21:24:47 -05:00
Huang Qi de7a14e977 Fix LLVM ABI NAME for riscv64imac-unknown-nuttx-elf
This patch fix https://github.com/rust-lang/rust/issues/129825

For the riscv64imac target, the LLVM ABI NAME should be "lp64",
which is the default ABI if not specified for the riscv64imac target.
2024-09-01 09:59:09 +08:00
Matthias Krüger 2261ffa19f
Rollup merge of #129832 - eduardosm:stray-dot, r=jhpratt
Remove stray dot in `std::char::from_u32_unchecked` documentation
2024-09-01 03:58:06 +02:00
Matthias Krüger f040e689c0
Rollup merge of #129780 - cyrgani:master, r=compiler-errors
add crashtests for several old unfixed ICEs

Adds several new crashtests for some older ICEs that did not yet have any.
Tests were added for #128097, #119095, #117460 and #126443.
2024-09-01 03:58:05 +02:00
Matthias Krüger d24336b8c9
Rollup merge of #129672 - saethlin:enum-debuginfo-tests, r=Mark-Simulacrum
Make option-like-enum.rs UB-free and portable

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

(or, at least the parts of it that aren't https://github.com/rust-lang/rust/issues/128973)
2024-09-01 03:58:05 +02:00
Matthias Krüger 62b8fdb7da
Rollup merge of #129619 - sunshowers:update-stacker, r=Mark-Simulacrum
Update stacker to 0.1.17

The main new feature is support for detecting the current stack size on illumos. (See [my blog post] for the context which led to this.)

[my blog post]: https://sunshowers.io/posts/rustc-segfault-illumos/

try-job: x86_64-mingw
2024-09-01 03:58:04 +02:00
Matthias Krüger 07d5c250be
Rollup merge of #129493 - cjgillot:early-opaque-def, r=petrochenkov
Create opaque definitions in resolver.

Implementing https://github.com/rust-lang/rust/issues/129023#issuecomment-2306079532

That was easier than I expected.

r? `@petrochenkov`
2024-09-01 03:58:04 +02:00
Matthias Krüger 1063c0dd37
Rollup merge of #129207 - GrigorenkoPV:elided-is-named, r=cjgillot
Lint that warns when an elided lifetime ends up being a named lifetime

As suggested in https://github.com/rust-lang/rust/issues/48686#issuecomment-1817334575

Fixes #48686
2024-09-01 03:58:03 +02:00
Matthias Krüger da65b9064f
Rollup merge of #128641 - Konippi:standardize-duplicate-processes-in-parser, r=scottmcm
refactor: standardize duplicate processes in parser

## Summary
This PR refactors the `read_number` function to standardize duplicate code, improve readability, and enhance efficiency.

## Changes
- Merged the logic for both `max_digits` cases into a single `read_atomically` closure
- Simplified control flow and reduced code duplication
2024-09-01 03:58:03 +02:00
Matthias Krüger a073004484
Rollup merge of #128495 - joboet:more_memcmp, r=scottmcm
core: use `compare_bytes` for more slice element types

`bool`, `NonZero<u8>`, `Option<NonZero<u8>>` and `ascii::Char` can be compared the same way as `u8`.
2024-09-01 03:58:02 +02:00
bors 43eaa5c624 Auto merge of #129790 - BoxyUwU:bump-version, r=BoxyUwU
Bump to 1.83

https://forge.rust-lang.org/release/process.html#bump-the-stable-version-number-t-6-days-friday-the-week-before
2024-09-01 01:53:11 +00:00
Alona Enraght-Moony f78979e687 Actually parse stdout json, instead of using hacky contains logic. 2024-08-31 22:08:38 +00:00
bors a7399ba69d Auto merge of #129831 - matthiaskrgr:rollup-befq6zx, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #128523 (Add release notes for 1.81.0)
 - #129605 (Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen)
 - #129650 (Clean up `library/profiler_builtins/build.rs`)
 - #129651 (skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set)
 - #129684 (Enable Miri to pass pointers through FFI)
 - #129762 (Update the `wasm-component-ld` binary dependency)
 - #129782 (couple more crash tests)
 - #129816 (tidy: say which feature gate has a stability issue mismatch)
 - #129818 (make the const-unstable-in-stable error more clear)
 - #129824 (Fix code examples buttons not appearing on click on mobile)
 - #129826 (library: Fix typo in `core::mem`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-31 20:59:27 +00:00
Camille GILLOT f68f66538a Create opaque definitions in resolver. 2024-08-31 20:14:43 +00:00
Eduardo Sánchez Muñoz d4e708f1bc Remove stray dot in `std::char::from_u32_unchecked` documentation 2024-08-31 21:54:29 +02:00
Matthias Krüger 4151fd407e
Rollup merge of #129826 - Alcaro:patch-1, r=workingjubilee
library: Fix typo in `core::mem`

This typo looks unnecessary
2024-08-31 20:36:28 +02:00
Matthias Krüger 828f7c895a
Rollup merge of #129824 - GuillaumeGomez:code-example-buttons-mobile, r=notriddle
Fix code examples buttons not appearing on click on mobile

When browsing docs on mobile today, I realized that the buttons didn't appear when I tapped on the code example.

One issue: I have no idea how to add a regression test for this case...

r? ``@notriddle``
2024-08-31 20:36:27 +02:00
Matthias Krüger b8b2a65035
Rollup merge of #129818 - RalfJung:const-stability, r=compiler-errors
make the const-unstable-in-stable error more clear

The default should be to add `rustc_const_unstable`, not `rustc_allow_const_fn_unstable`.

Also I discovered our check for missing const stability attributes on stable functions -- but strangely that check only kicks in for "reachable" functions. `check_missing_stability` checks for reachability since all reachable functions must have a stability attribute, but I would say if a function has `#[stable]` it should also have const-stability attributes regardless of reachability.
2024-08-31 20:36:27 +02:00
Matthias Krüger 08b813b30e
Rollup merge of #129816 - RalfJung:tidy-feature-issue-mismatch, r=compiler-errors
tidy: say which feature gate has a stability issue mismatch

This gives some valuable context to what the error is actually about :)
2024-08-31 20:36:26 +02:00
Matthias Krüger 1e0cc8bec3
Rollup merge of #129782 - matthiaskrgr:c, r=jieyouxu
couple more crash tests

r? ```@jieyouxu```
2024-08-31 20:36:26 +02:00
Matthias Krüger 0afda15f05
Rollup merge of #129762 - alexcrichton:update-wasm-component-ld, r=jieyouxu
Update the `wasm-component-ld` binary dependency

This keeps it up-to-date by moving from 0.5.6 to 0.5.7. While here I've additionally updated some other wasm-related dependencies in the workspace to keep them up-to-date and try to avoid duplicate versions as well.
2024-08-31 20:36:25 +02:00
Matthias Krüger a5fb8b90bf
Rollup merge of #129684 - Strophox:miri-pass-pointer-to-ffi, r=RalfJung
Enable Miri to pass pointers through FFI

Following https://github.com/rust-lang/rust/pull/126787, the purpose of this PR is to now enable Miri to execute native calls that make use of pointers.

> <details>
>
> <summary> Simple example </summary>
>
> ```rust
> extern "C" {
>     fn ptr_printer(ptr: *mut i32);
> }
>
> fn main() {
>     let ptr = &mut 42 as *mut i32;
>     unsafe {
>         ptr_printer(ptr);
>     }
> }
> ```
> ```c
> void ptr_printer(int *ptr) {
>   printf("printing pointer dereference from C: %d\n", *ptr);
> }
> ```
> should now show `printing pointer dereference from C: 42`.
>
> </details>

Note that this PR does not yet implement any logic involved in updating Miri's "analysis" state (byte initialization, provenance) upon such a native call.

r? ``@RalfJung``
2024-08-31 20:36:25 +02:00
Matthias Krüger e3795af77f
Rollup merge of #129651 - onur-ozkan:stage0-target-sanity-check, r=Kobzol
skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set

When adding a new target to `rustc` and extending `STAGE0_MISSING_TARGETS`, there is a chance that in the merge CI bootstrap target sanity check might fail [here](26d27b7c87/src/bootstrap/src/core/sanity.rs (L243-L256)) because the stage 0 compiler will assume to already support the new target since `opt-dist` uses the previously compiled compiler as the stage 0 compiler.

This PR skips this check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set, and makes `opt-dist` to set `BOOTSTRAP_SKIP_TARGET_SANITY` so bootstrap doesn't run this logic for opt-dist tests.

Fixes https://github.com/rust-lang/rust/pull/127021#issuecomment-2308782315.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/.60STAGE0_MISSING_TARGETS.60.20seems.20to.20check.20stage1

Blocker for https://github.com/rust-lang/rust/pull/127021
2024-08-31 20:36:24 +02:00
Matthias Krüger 6a96e7a255
Rollup merge of #129650 - Zalathar:profiler-builtins, r=Mark-Simulacrum
Clean up `library/profiler_builtins/build.rs`

This PR makes a series of improvements to the long-neglected build script for `profiler_builtins`.

Most notably:
- The logic that silently skips missing source files has been removed, since it is currently unnecessary and makes build errors more confusing.
- The script now emits `cargo::rerun-if-changed` directives for the `compiler-rt` source and include directories.

Compiler behaviour and user programs should be unaffected by these changes.
2024-08-31 20:36:24 +02:00
Matthias Krüger d354d4ddd7
Rollup merge of #129605 - jieyouxu:needs-llvm-components, r=Mark-Simulacrum
Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen

Without suitable `needs-llvm-components` directives, some run-make tests exercising target-specific codegen can fail if the LLVM used is built without the necessary components. Currently, the list is:

```
tests\run-make\print-target-list
tests\run-make\print-to-output
tests\run-make\print-cfg
tests\run-make\target-without-atomic-cas
```

This PR also skips tidy checks for revisions and `needs-llvm-components` for run-make tests since revisions are not supported.

Fixes #129390.
Fixes #127895.

cc ``@petrochenkov`` who noticed this, thanks! Would be great if you could confirm that this fixes the test errors for you locally.
2024-08-31 20:36:23 +02:00
Matthias Krüger 71240e4805
Rollup merge of #128523 - cuviper:relnotes-1.81.0, r=Mark-Simulacrum
Add release notes for 1.81.0

cc ``@rust-lang/release``
r? ``@Mark-Simulacrum``
2024-08-31 20:36:23 +02:00
Alcaro 7d728e54d9
Update mod.rs
This typo looks unnecessary
2024-08-31 19:09:41 +02:00
bors d571ae851d Auto merge of #129817 - matthiaskrgr:rollup-ll2ld5m, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - #129659 (const fn stability checking: also check declared language features)
 - #129711 (Expand NLL MIR dumps)
 - #129730 (f32 docs: define 'arithmetic' operations)
 - #129733 (Subtree update of `rust-analyzer`)
 - #129749 (llvm-wrapper: adapt for LLVM API changes)
 - #129757 (Add a test for trait solver overflow in MIR inliner cycle detection)
 - #129760 (Make the "detect-old-time" UI test more representative)
 - #129767 (Remove `#[macro_use] extern crate tracing`, round 4)
 - #129774 (Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt)
 - #129785 (Miri subtree update)
 - #129791 (mark joboet as on vacation)
 - #129812 (interpret, codegen: tweak some comments and checks regarding Box with custom allocator)

Failed merges:

 - #129777 (Add `unreachable_pub`, round 4)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-31 16:43:26 +00:00
Guillaume Gomez 670a78b3a7 Fix code examples buttons not appearing on click on mobile 2024-08-31 17:26:54 +02:00
Camille GILLOT ff1fc68c11 Simplify lint source computation. 2024-08-31 14:02:27 +00:00
Camille GILLOT 5f1f45b095 Remove attr_id from stable lint ids. 2024-08-31 14:01:07 +00:00
Camille GILLOT 111b0a97b4 Rewrite lint_expectations in a single pass. 2024-08-31 14:00:54 +00:00
Camille GILLOT 4928b22fa8 Use AttrId key for unstable<->stable expectation map. 2024-08-31 13:58:01 +00:00
Ralf Jung 3cec2d6935 don't take reachability into account when warning about missing-const-stability 2024-08-31 15:11:48 +02:00
Ralf Jung e3b1966137 make the const-unstable-in-stable error more clear 2024-08-31 15:11:48 +02:00