Commit Graph

252900 Commits

Author SHA1 Message Date
Michael Howell 3c4e180e68 rustdoc-search: add parser for `&` syntax 2024-04-19 14:31:21 -07:00
Michael Howell 8b47f67817 rustdoc-search: add index of borrow references 2024-04-19 14:31:21 -07:00
bors f9b1614920 Auto merge of #124170 - matthiaskrgr:rollup-ldopl64, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #123571 (Correctly change type when adding adjustments on top of `NeverToAny`)
 - #123729 (run-make: refactor out command wrappers for `clang` and `llvm-readobj`)
 - #124106 (Don't repeatedly duplicate TAIT lifetimes for each subsequently nested TAIT)
 - #124149 (rustdoc-search: fix description on aliases in results)
 - #124155 (bootstrap: don't use rayon for sysinfo)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-19 19:18:56 +00:00
Matthias Krüger f1e536df59
Rollup merge of #124155 - klensy:wrong-rayon-here, r=albertlarsan68
bootstrap: don't use rayon for sysinfo

It's looks overkill to use rayon to collect cpu usage
2024-04-19 19:30:50 +02:00
Matthias Krüger f8afb6314b
Rollup merge of #124149 - notriddle:notriddle/desc-alias, r=GuillaumeGomez
rustdoc-search: fix description on aliases in results

This needs to start downloading the descriptions after aliases have been added to the result set.
2024-04-19 19:30:49 +02:00
Matthias Krüger 26d4b1bfba
Rollup merge of #124106 - compiler-errors:tait-lifetime-dedup, r=oli-obk
Don't repeatedly duplicate TAIT lifetimes for each subsequently nested TAIT

Make it so that nested TAITs inherit the lifetimes from their parent item, not their parent TAIT. This is because we don't need to re-duplicate lifetimes for nested TAITs over and over, since the only lifetimes they can capture are from the parent item anyways.

This mirrors how RPITs work. This is **not** a functional change that should be observable, since the whole point of duplicating lifetimes and marking the shadowed ones (and uncaptured ones) as bivariant is designed to *not* be observable.

r? oli-obk
2024-04-19 19:30:49 +02:00
Matthias Krüger b1eee427a0
Rollup merge of #123729 - jieyouxu:rmake-refactor-2, r=oli-obk
run-make: refactor out command wrappers for `clang` and `llvm-readobj`

This PR is rebased on top of https://github.com/rust-lang/rust/pull/123699.

This PR is a follow up to https://github.com/rust-lang/rust/pull/123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`.

r? ghost
2024-04-19 19:30:48 +02:00
Matthias Krüger 6c4657c086
Rollup merge of #123571 - WaffleLapkin:properly-adjust-never, r=compiler-errors
Correctly change type when adding adjustments on top of `NeverToAny`

I'm concerned that the check only caught the problem with `fallback = !`, because at least MIR contained `<() as PartialEq>::eq(move _5, move _7)` where `_5: ()`.

I rediscovered the issue when looking at #123482's crater run.

r? compiler-errors
Fixes #120600
2024-04-19 19:30:48 +02:00
bors ce3263e60e Auto merge of #124113 - RalfJung:interpret-scalar-ops, r=oli-obk
interpret: use ScalarInt for bin-ops; avoid PartialOrd for ScalarInt

Best reviewed commit-by-commit

r? `@oli-obk`
2024-04-19 17:00:28 +00:00
Ralf Jung d3f927db87 avoid PartialOrd on ScalarInt
we don't know their sign so we cannot, in general, order them properly
2024-04-19 17:17:31 +02:00
bors d1a0fa5ed3 Auto merge of #118441 - GuillaumeGomez:display-stability-version, r=rustdoc
Always display stability version even if it's the same as the containing item

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

Currently, if the containing item's version is the same as the item's version (like a method), we don't display it on the item.

This was something done on purpose as you can see [here](e9b7bf0114/src/librustdoc/html/render/mod.rs (L949-L955)). It was implemented in https://github.com/rust-lang/rust/pull/30686.

I think we should change this because on pages with a lot of items, if someone arrives (through the search or a link) to an item far below the page, they won't know the stability version unless they scroll to the top, which isn't great.

You can see the result [here](https://rustdoc.crud.net/imperio/display-stability-version/std/pin/struct.Pin.html#method.new).

r? `@notriddle`
2024-04-19 14:17:29 +00:00
bors 07d0d7ce3f Auto merge of #123364 - klensy:bs-mixed-types, r=albertlarsan68
bootstrap: actually allow set debuginfo-level to "line-tables-only"

I've tried to set in config.toml `rust.debuginfo-level = "line-tables-only"`, but ended with:
``` failed to parse TOML configuration 'config.toml':
data did not match any variant of untagged enum StringOrInt for key `rust.debuginfo-level`
```
Also this PR allows to set `line-directives-only` for debuginfo in config.toml too.
1. Fixes this. Alternative is remove that Deserialize and use default one:
0e682e9875/src/bootstrap/src/core/config/config.rs (L725-L728)

2. Should `line-directives-only` be added too?

3. I've tried to add test to rust/src/bootstrap/src/core/config/tests.rs:
```rust
#[test]
fn rust_debuginfo() {
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = 1").rust_debuginfo_level_rustc,
        DebuginfoLevel::Limited
    ));
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = \"line-tables-only\"").rust_debuginfo_level_rustc,
        DebuginfoLevel::LineTablesOnly
    ));
}
```

But test passes before that PR too; looks like config parse tests checks something wrong? I mean, that tests check something which isn't actual bootstrap behavior.
2024-04-19 12:11:09 +00:00
Ralf Jung 42220f0930 ScalarInt: add methods to assert being a (u)int of given size 2024-04-19 13:51:52 +02:00
Maybe Waffle e5a6d8d0cd Remove old ICE tests that no longer ICE (yay!) 2024-04-19 11:34:37 +00:00
Maybe Waffle 0bbe362901 Correctly change type when adding adjustments on top of `NeverToAny` 2024-04-19 11:05:02 +00:00
Maybe Waffle 4d749cad25 Add a test for `a == b` where `a: !, b: !`
(this currently produces malformed mir: we call `eq` with first argument not
being a reference)
2024-04-19 11:05:02 +00:00
Maybe Waffle 662d276573 Add regression test for issue 120600 2024-04-19 11:05:02 +00:00
bors 43a0686f8d Auto merge of #115253 - donno2048:patch-1, r=albertlarsan68
Implement `PROBLEMATIC_CONSTS` generalization

You forgot that `A≈4`, `B≈8`, and `E≈3` and some more constants.

The new `PROBLEMATIC_CONSTS` was generated using this code:

```py
from functools import reduce
def generate_problems(consts: list, letter_digit: dict):
    for const in consts:
        problem = reduce(lambda string, rep: string.replace(*reversed(rep)), ['%X' % const, *letter_digit.items()])
        indexes = [index for index, c in enumerate(problem) if c in letter_digit.keys()]
        for i in range(1 << len(indexes)):
            yield int(''.join(letter_digit[c] if index in indexes and (i >> indexes.index(index)) & 1 else c for index, c in enumerate(problem)), 0x10)

problems = generate_problems(
    [
        # Old PROBLEMATIC_CONSTS:
        184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037,
        3735927486, 3735932941, 4027431614, 4276992702,
        # More of my own:
        195934910, 252707358, 762133, 179681982, 173390526
    ],
    {
    'A': '4',
    'B': '8',
    'E': '3',
    }
)

# print(list(problems)) # won't use that to print formatted

from itertools import islice
while len(cur_problems := list(islice(problems, 8))):
    print('    ', end='')
    print(*cur_problems, sep=', ', end='')
    print(',')
```
2024-04-19 09:52:17 +00:00
klensy 6612ad796c bootstrap: don't use rayon for sysinfo
It's looks overkill to use rayon to collect cpu usage
2024-04-19 12:07:07 +03:00
bors c4f112af6e Auto merge of #124123 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-04-19 07:39:44 +00:00
bors 0ed85d0c8d Auto merge of #124147 - workingjubilee:rollup-7pjnzr6, r=workingjubilee
Rollup of 7 pull requests

Successful merges:

 - #123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
 - #123752 (Properly handle emojis as literal prefix in macros)
 - #123935 (Don't inline integer literals when they overflow - new attempt)
 - #123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc)
 - #124019 (Use raw-dylib for Windows synchronization functions)
 - #124110 (Fix negating `f16` and `f128` constants)
 - #124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-19 05:38:13 +00:00
Michael Howell 2e7d9e9acb rustdoc-search: fix description on aliases in results
This needs to start downloading the descriptions after aliases
have been added to the result set.
2024-04-18 22:21:29 -07:00
Jubilee c8d58faba2
Rollup merge of #124116 - RalfJung:miri-rust-backtrace, r=Nilstrieb
when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation

Fixes https://github.com/rust-lang/miri/issues/2855
2024-04-18 21:38:57 -07:00
Jubilee f36ca7a75f
Rollup merge of #124110 - beetrees:neg-f16-f128, r=compiler-errors
Fix negating `f16` and `f128` constants

Make `f16` and `f128` constants respect `neg` in `parse_float_into_scalar`.

Tracking issue: #116909

```@rustbot``` label +F-f16_and_f128
2024-04-18 21:38:57 -07:00
Jubilee 55c35dd22e
Rollup merge of #124019 - ChrisDenton:futex-raw-dylib, r=joboet
Use raw-dylib for Windows synchronization functions

Fixes #123999 by using the raw-dylib feature to specify the DLL to load the Windows futex functions from (e.g. [`WaitOnAddress`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress)). This avoids reliance on the import library causing that issue.

With apologies to ``@bjorn3,`` as it's currently necessary to revert this for cranelift.
2024-04-18 21:38:56 -07:00
Jubilee 2b94e02737
Rollup merge of #123980 - WaffleLapkin:graph-average-refactor, r=wesleywiser
Add an opt-in to store incoming edges in `VecGraph` + misc

r? ```@fmease```

needed for #123939
2024-04-18 21:38:56 -07:00
Jubilee f174c310ae
Rollup merge of #123935 - tstsrt:fix-115423, r=oli-obk
Don't inline integer literals when they overflow - new attempt

Basically #116633 but I implemented the suggested changes.
Fixes #115423. Fixes #116631.

This is my first contribution to this repo so please let me know if I'm supposed to change something :)
2024-04-18 21:38:55 -07:00
Jubilee 0a0a5a956c
Rollup merge of #123752 - estebank:emoji-prefix, r=wesleywiser
Properly handle emojis as literal prefix in macros

Do not accept the following

```rust
macro_rules! lexes {($($_:tt)*) => {}}
lexes!(🐛"foo");
```

Before, invalid emoji identifiers were gated during parsing instead of lexing in all cases, but this didn't account for macro pre-expansion of literal prefixes.

Fix #123696.
2024-04-18 21:38:55 -07:00
Jubilee 3831cbb28f
Rollup merge of #123406 - krtab:fix_remainder_iterchunk, r=scottmcm
Force exhaustion in iter::ArrayChunks::into_remainder

Closes: #123333
2024-04-18 21:38:54 -07:00
bors 13e63f7490 Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiser
Introduce perma-unstable `wasm-c-abi` flag

Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to #117918, but they could be merged independently.
MCP: https://github.com/rust-lang/compiler-team/issues/703
Tracking issue: https://github.com/rust-lang/rust/issues/122532
2024-04-19 03:35:10 +00:00
bors fa0068b541 Auto merge of #124038 - matthiaskrgr:one_or_two_more_tests, r=jieyouxu
crashes: add a couple more ice tests
2024-04-19 01:02:44 +00:00
bors e3181b091e Auto merge of #119912 - notriddle:notriddle/reexport-dedup, r=GuillaumeGomez
rustdoc-search: single result for items with multiple paths

Part of #15723

Preview: https://notriddle.com/rustdoc-html-demo-9/reexport-dup/std/index.html?search=hashmap

This change uses the same "exact" paths as trait implementors and type alias inlining to track items with multiple reachable paths. This way, if you search for `vec`, you get only the `std` exports of it, and not the one from `alloc`.

It still includes all the items in the search index so that you can search for them by all available paths. For example, try `core::option` and `std::option`, and notice that the results page doesn't show duplicates, but still shows all the items in their respective crates.
2024-04-18 21:23:15 +00:00
bors 3412f01749 Auto merge of #123949 - scottmcm:debug-no-means-no-debug-info-when-inlined, r=oli-obk,onur-ozkan
At debuginfo=0, don't inline debuginfo when inlining

See https://github.com/rust-lang/rust/pull/123949#issuecomment-2060493285 for info.
2024-04-18 19:12:28 +00:00
Maybe Waffle 523fe2b67b Add tests for predecessor-aware `VecGraph` mode 2024-04-18 17:32:42 +00:00
Matthias Krüger 1d45b7adaf crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
Scott McMurray 20cf59549f The ICE in 121127 needs debuginfo 2024-04-18 09:42:26 -07:00
scottmcm b8ac5c0f91 Update src/bootstrap/src/core/builder.rs
Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com>
2024-04-18 09:35:36 -07:00
Scott McMurray 90b4c86335 Ensure `[rust] debuginfo-level-std` doesn't change core's MIR 2024-04-18 09:35:36 -07:00
Scott McMurray 6094063c35 Update `checked_ops` so 32- and 64-bit gets the same checks 2024-04-18 09:35:36 -07:00
Scott McMurray d05545c05d At debuginfo=0, don't inline debuginfo when inlining 2024-04-18 09:35:35 -07:00
Philipp Krones 9028e00dfa
Merge commit 'ca3b393750ee8d870bf3215dcf6509cafa5c0445' into clippy-subtree-update 2024-04-18 17:48:52 +02:00
bors ca3b393750 Auto merge of #12690 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-04-18 15:42:41 +00:00
Philipp Krones fca4e16ffb
Bump nightly version -> 2024-04-18 2024-04-18 17:30:05 +02:00
Philipp Krones 846f6e7e00
Merge remote-tracking branch 'upstream/master' into rustup 2024-04-18 17:29:59 +02:00
bors 0e15f5ee8f Auto merge of #124072 - saethlin:less-sysroot-libc-misc, r=jieyouxu
Remove libc from more tests

The goal here is to trim down the number of tests that depend on libc from the sysroot to make https://github.com/rust-lang/rust/pull/123938 more plausible.

This PR is a few simple cases that I missed in https://github.com/rust-lang/rust/pull/123943.
2024-04-18 14:59:36 +00:00
Ben Kimock 8047fadbf3 Add an exception for windows-msvc 2024-04-18 09:52:00 -04:00
Ralf Jung 5e6184cdb7 interpret/binary_int_op: avoid dropping to raw ints until we determined the sign 2024-04-18 14:25:06 +02:00
bors c5de414865 Auto merge of #123144 - dpaoliello:arm64eclib, r=GuillaumeGomez,ChrisDenton,wesleywiser
Add support for Arm64EC to the Standard Library

Adds the final pieces so that the standard library can be built for arm64ec-pc-windows-msvc (initially added in #119199)

* Bumps `windows-sys` to 0.56.0, which adds support for Arm64EC.
* Correctly set the `isEC` parameter for LLVM's `writeArchive` function.
* Add `#![feature(asm_experimental_arch)]` to library crates where Arm64EC inline assembly is used, as it is currently unstable.
2024-04-18 12:22:52 +00:00
Ralf Jung 3e633981ef when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation 2024-04-18 12:05:08 +02:00
bors c25473ff62 Auto merge of #124008 - nnethercote:simpler-static_assert_size, r=Nilstrieb
Simplify `static_assert_size`s.

We want to run them on all 64-bit platforms.

r? `@ghost`
2024-04-18 09:47:45 +00:00