Commit Graph

147619 Commits

Author SHA1 Message Date
bors
dbce3b43b6 Auto merge of #122013 - Swatinem:unicode-gen-fastpath, r=scottmcm
Add a lower bound check to `unicode-table-generator` output

This adds a dedicated check for the lower bound
(if it is outside of ASCII range) to the output of the `unicode-table-generator` tool.

This generalized the ASCII-only fast-path, but only for the `Grapheme_Extend` property for now, as that is the only one with a lower bound outside of ASCII.
2024-04-20 20:33:25 +00:00
bors
54692c3d0b Auto merge of #124202 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-04-20 17:01:20 +00:00
Laurențiu Nicola
b0a18daa75 Merge commit '55d9a533b309119c8acd13061581b43ae8840823' into sync-from-ra 2024-04-20 19:17:08 +03:00
bors
8cf135e191 Auto merge of #121712 - mati865:provide-prebuilt-std-for-gnullvm, r=Mark-Simulacrum
Provide prebuilt std for gnullvm targets

Revival of https://github.com/rust-lang/rust/pull/114346 which waiting on MCP that was accepted recently: https://github.com/rust-lang/compiler-team/issues/710#issuecomment-1942014308
2024-04-20 14:58:25 +00:00
Ralf Jung
75d0fdd967 mir-opt tests: rename unit-test -> test-mir-pass 2024-04-20 13:19:34 +02:00
Ralf Jung
61a7d3d523 ensure the ICE-to-file logic does not affect our test 2024-04-20 11:42:10 +02:00
Ralf Jung
b562faa8c8 more consistently talk about the 'active thread', not the 'current thread' 2024-04-20 11:37:29 +02:00
Ralf Jung
465dcf1320 global allocations: don't make up a super-high VectorIdx, just use the main thread 2024-04-20 11:33:44 +02:00
Matthias Krüger
f58ef084c9
Rollup merge of #124137 - tgross35:testsuite-multi-rev-regex, r=jieyouxu
Match hyphen in multi-revision comment matchers

Currently, the matcher `//[rev-foo,rev-bar]~` does not get selected by the regex. Change the matcher to include `-`.
2024-04-20 11:10:32 +02:00
Matthias Krüger
efb264fa78
Rollup merge of #123409 - ZhuUx:master, r=oli-obk
Implement Modified Condition/Decision  Coverage

This is an implementation based on llvm backend support (>= 18) by `@evodius96` and branch coverage support by `@Zalathar.`

### Major changes:

* Add -Zcoverage-options=mcdc as switch. Now coverage options accept either `no-branch`, `branch`, or `mcdc`. `mcdc` also enables `branch` because it is essential to work.
* Add coverage mapping for MCDCBranch and MCDCDecision. Note that MCDCParameter evolves from  llvm 18 to llvm 19. The mapping in rust side mainly references to 19 and is casted to 18 types in llvm wrapper.
* Add wrapper for mcdc instrinc functions from llvm. And inject associated statements to mir.
* Add BcbMappingKind::Decision, I'm not sure is it proper but can't find a better way temporarily.
* Let coverage-dump support parsing MCDCBranch and MCDCDecision from llvm ir.
* Add simple tests to check whether mcdc works.
* Same as clang, currently rustc does not generate instrument for decision with more than 6 condtions or only 1 condition due to considerations of resource.

### Implementation Details

1. To get information about conditions and decisions, `MCDCState` in `BranchInfoBuilder` is used during hir lowering to mir. For expressions with logical op we call `Builder::visit_coverage_branch_operation` to record its sub conditions, generate condition ids for them and save their spans (to construct the span of whole decision). This process mainly references to the implementation in clang and is described in comments over `MCDCState::record_conditions`. Also true marks and false marks introduced by branch coverage are used to detect where the decision evaluation ends: the next id  of the condition == 0.
2. Once the `MCDCState::decision_stack` popped all recorded conditions, we can ensure that the decision is checked over and push it into `decision_spans`. We do not manually insert decision span to avoid complexity from then_else_break in nested if scopes.
3. When constructing CoverageSpans, add condition info to BcbMappingKind::Branch and decision info to BcbMappingKind::Decision. If the branch mapping has non-zero condition id it will be transformed to MCDCBranch mapping and insert `CondBitmapUpdate` statements to its evaluated blocks. While decision bcb mapping will insert `TestVectorBitmapUpdate` in all its end blocks.

### Usage
```bash
 echo "[build]\nprofiler=true" >> config.toml
./x build --stage 1
./x test tests/coverage/mcdc_if.rs
```
to build the compiler and run tests.

```shell
export PATH=path/to/llvm-build:$PATH
rustup toolchain link mcdc build/host/stage1
cargo +mcdc rustc --bin foo -- -Cinstrument-coverage -Zcoverage-options=mcdc
cd target/debug
LLVM_PROFILE_FILE="foo.profraw" ./foo
llvm-profdata merge -sparse foo.profraw -o foo.profdata
llvm-cov show ./foo -instr-profile=foo.profdata --show-mcdc
```
to check "foo" code.

### Problems to solve

For now decision mapping will insert statements to its all end blocks, which may be optimized by inserting a final block of the decision. To do this we must also trace the evaluated value at each end of the decision and join them separately.

This implementation is not heavily tested so there should be some unrevealed issues. We are going to check our rust products in the next.  Please let me know if you had any suggestions or comments.
2024-04-20 11:10:31 +02:00
Arpad Borsos
488598c183
Add a lower bound check to unicode-table-generator output
This adds a dedicated check for the lower bound
(if it is outside of ASCII range) to the output of the `unicode-table-generator` tool.

This generalized the ASCII-only fast-path, but only for the `Grapheme_Extend` property for now,
as that is the only one with a lower bound outside of ASCII.
2024-04-20 10:16:45 +02:00
bors
6b0ce8b1e2 Auto merge of #3495 - RalfJung:data-race-clocks, r=RalfJung
data_race: make the release/acquire API more clear
2024-04-20 08:11:15 +00:00
Ralf Jung
8cab0d5617 restrict VClock API surface 2024-04-20 10:09:31 +02:00
Jakub Beránek
d2059aef27
Move auto jobs to calculate-job-matrix.py 2024-04-20 09:54:47 +02:00
Jakub Beránek
6f0ff0b03a
Refactor calculate-job-matrix.py 2024-04-20 09:21:55 +02:00
Ralf Jung
cb1b4a6977 reuse_pool: only do acquire_clock if we reused from a different thread 2024-04-20 09:08:09 +02:00
Jakub Beránek
7a90679e28
Perform PR and try builds dynamically 2024-04-20 09:07:11 +02:00
Jakub Beránek
9fec43ddf1
Move calculate-job-matrix.py to ci/github-actions 2024-04-20 09:06:04 +02:00
Ralf Jung
7dcfb54dc6 data_race: make the release/acquire API more clear 2024-04-20 09:01:53 +02:00
Ralf Jung
7952316aff re-bless tests 2024-04-20 08:26:48 +02:00
Ralf Jung
8e1f18dce8 fix clippy warning 2024-04-20 08:26:42 +02:00
The Miri Cronjob Bot
b63bb1b374 Merge from rustc 2024-04-20 05:12:44 +00:00
The Miri Cronjob Bot
29e41fbc30 Preparing for merge from rustc 2024-04-20 05:05:23 +00:00
bors
c8d19a92aa Auto merge of #124177 - weihanglo:update-cargo, r=weihanglo
Update cargo

8 commits in 6f06fe908a5ee0f415c187f868ea627e82efe07d..80d5b607dde6ef97dfff4e23923822c01d2bb036
2024-04-16 18:47:44 +0000 to 2024-04-19 18:39:22 +0000
- fix 13773 - 'cargo build' fails when list_files() with gix is triggered (rust-lang/cargo#13777)
- fix(toml): Don't crash on parse errors that point to multi-byte character (rust-lang/cargo#13780)
- fix(toml)!: Disallow source-less dependencies (rust-lang/cargo#13775)
- fix(msrv): Put MSRV-aware resolver behind a config (rust-lang/cargo#13769)
- fix(msrv): Error, rather than panic, on rust-version 'x' (rust-lang/cargo#13771)
- fix(credential): trim newlines in tokens from stdin (rust-lang/cargo#13770)
- test(msrv): Re-organize MSRV tests (rust-lang/cargo#13767)
- feat(install): Including Locking message (rust-lang/cargo#13764)

r? ghost
2024-04-20 02:06:04 +00:00
Weihang Lo
db881f67f3
Update cargo 2024-04-19 17:04:13 -04:00
bors
e9ebc6f800 Auto merge of #3475 - RalfJung:reduce-reuse-recycle, r=RalfJung
Address reuse improvements and fixes

- when an address gets reused, establish a happens-before link in the data race model
- do not reuse stack addresses, and make the reuse rate configurable

Fixes https://github.com/rust-lang/miri/issues/3450
2024-04-19 20:50:04 +00:00
Trevor Gross
282488c808 Match hyphen in multi-revision comment matchers
Currently, the matcher `//[rev-foo,rev-bar]~` does not get selected by
the regex. Change the matcher to also match strings that contain a `-`.h
2024-04-19 16:03:44 -04: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
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
onur-ozkan
c5fdb39120 fix clippy warnings on bootstrap
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-19 20:29:16 +03: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
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
95ae2dd7ff Auto merge of #3489 - rust-lang:rustup-2024-04-19, r=RalfJung
Automatic Rustup
2024-04-19 09:00:46 +00:00
Ralf Jung
fecd7fc937 make test not leak rustc crate hash 2024-04-19 10:59:27 +02: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
Ralf Jung
b9ed4cd70a share code between win-to-unix and unix-to-win path conversion 2024-04-19 09:17:37 +02: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
The Miri Cronjob Bot
d0783e8836 Merge from rustc 2024-04-19 05:13:02 +00:00
The Miri Cronjob Bot
c1cf0a3e38 Preparing for merge from rustc 2024-04-19 05:05:48 +00: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
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
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
zhuyunxing
68f86381ee coverage. Add coverage-options=mcdc as gate for MC/DC instrument 2024-04-19 10:43:53 +08: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
Ralf Jung
9b419a1b83 when reusing an address, most of the time only reuse from the current thread 2024-04-18 23:02:21 +02:00
Ralf Jung
5067dd21b6 comment clarification and typo fix 2024-04-18 22:27:07 +02:00
Dominik Stolz
5af861cf7b Disallow ambiguous attributes on expressions 2024-04-18 20:42:19 +02: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
Philipp Krones
9028e00dfa
Merge commit 'ca3b393750ee8d870bf3215dcf6509cafa5c0445' into clippy-subtree-update 2024-04-18 17:48:52 +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
d7916fc8cd do not reuse stack addresses; make reuse rate configurable 2024-04-18 13:20:01 +02:00
Ralf Jung
48fd549cd3 when an address gets reused, establish a happens-before link in the data race model 2024-04-18 12:37:03 +02:00
bors
1ce64e717f Auto merge of #3484 - RalfJung:realloc, r=RalfJung
make realloc with a size of zero fail

Fixes https://github.com/rust-lang/miri/issues/2774
2024-04-18 10:27:42 +00:00
Ralf Jung
5ff9b2b865 move allocator shim logic into its own file 2024-04-18 12:07:09 +02:00
Ralf Jung
73e333ac44 make realloc with a size of zero fail 2024-04-18 12:06:29 +02: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
5c9924a599 Auto merge of #3486 - RalfJung:mir-validate, r=RalfJung
add test checking that we do run MIR validation

Fixes https://github.com/rust-lang/miri/issues/2840
2024-04-18 09:55:39 +00:00
Ralf Jung
5ef38aca35 add test checking that we do run MIR validation 2024-04-18 11:49:56 +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
Jakub Beránek
a920ed4136
CI: add script for installing NodeJS and update it to v20 2024-04-18 11:11:07 +02:00
Ralf Jung
62e84d5ca0 move read_byte_slice to general helpers file, next to read_c_str 2024-04-18 10:58:49 +02:00
Ralf Jung
5c352a4e75 add test for Drop terminator on non-drop type 2024-04-18 10:23:22 +02:00
Matthias Krüger
7add0bdf7e
Rollup merge of #124047 - Jules-Bertholet:match-ergonomics-cleanups, r=Nadrieril
Match ergonomics 2024: miscellaneous code cleanups

- Store `ByRef` instead of `BindingAnnotation` in `PatInfo`
- Rename `BindingAnnotation` to `BindingMode`

r? ``@Nadrieril``

cc #123076

``@rustbot`` label A-patterns
2024-04-18 08:37:48 +02:00
Matthias Krüger
56f4ac308b
Rollup merge of #124041 - GuillaumeGomez:fix-copy-path-button, r=notriddle
Fix copy path button

Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in https://github.com/rust-lang/rust/pull/123706 forgot to update the JS (it contained an image before but not anymore).

I had to make some small changes in the CSS to fix the display when the button was clicked as well.

r? ``@notriddle``
2024-04-18 08:37:48 +02:00
Nicholas Nethercote
0d97669a17 Simplify static_assert_sizes.
We want to run them on all 64-bit platforms.
2024-04-18 15:36:25 +10:00
Michael Goulet
6abf1aae24 has_typeck_results doesnt need to be a query 2024-04-17 22:18:27 -04:00
bors
9f432d7b44 Auto merge of #124044 - DianQK:update-llvm-18, r=cuviper
Update LLVM to 1deeee3

Fixes #123772.

Diff: af8f9eb61a...5399a24c66
Diff (From 18.1.2): 0af6c732ec...5399a24c66

r? `@cuviper`
2024-04-18 00:04:09 +00:00
bors
becebb3158 Auto merge of #123978 - alexcrichton:update-wasi-toolchain, r=Mark-Simulacrum
Update how WASI toolchains are used in CI and bootstrap

This commit updates how the WASI targets are configured with their toolchain. Long ago a `config.toml` option of `wasi-root` was added to enable building with the WASI files produced by wasi-libc. Additionally for CI testing and release building the Rust toolchain has been using a hard-coded commit of wasi-libc which is bundled with the release of the `wasm32-wasip1` target, for example.

Nowadays though the wasi-sdk project, the C/C++ toolchain for WASI, is the go-to solution for compiling/linking WASI code and contains the more-or-less official releases of wasi-libc. This commit migrates CI to using wasi-sdk releases and additionally updates `bootstrap` to recognize when this is configured. This means that with `$WASI_SDK_PATH` configured there's no further configuration necessary to get a working build. Notably this also works better for the new targets of WASI as well, such as `wasm32-wasip2` and `wasm32-wasip1-threads` where the wasi-sdk release now has libraries for all targets bundled within it.
2024-04-17 21:05:48 +00:00
Elisha Hollander
72edac0eb2
allow the tests to pass tidy 2024-04-17 23:33:51 +03:00
Elisha Hollander
e6b386ba2b
add tests 2024-04-17 22:57:57 +03:00
Elisha Hollander
9d27cbfaac
fix value 2024-04-17 22:56:03 +03:00
Elisha Hollander
473af625db
configure for testing 2024-04-17 22:50:05 +03:00
Ralf Jung
7c3c2716ff fmt 2024-04-17 21:20:25 +02:00
Elisha Hollander
e06f90fc51
format style.rs 2024-04-17 22:16:59 +03:00
Elisha Hollander
8d0870899c
separate regex generation 2024-04-17 21:58:52 +03:00
Ralf Jung
3d3550ffa0 Merge from rustc 2024-04-17 20:38:23 +02:00
Ralf Jung
6a108a7477 Preparing for merge from rustc 2024-04-17 20:38:15 +02:00
Elisha Hollander
da35c19311
use a function to generate the regex
mainly for testing
2024-04-17 20:40:48 +03:00
许杰友 Jieyou Xu (Joe)
255bee1777 run-make-support: add clang and llvm-readobj command wrappers 2024-04-17 16:28:49 +00:00
Matthias Krüger
6388167811
Rollup merge of #124030 - RalfJung:adjust_alloc_base_pointer, r=oli-obk
interpret: pass MemoryKind to adjust_alloc_base_pointer

Another puzzle piece for https://github.com/rust-lang/miri/pull/3475.

The 2nd commit renames base_pointer -> root_pointer; that's how Tree Borrows already calls them and I think the term is more clear than "base pointer". In particular, this distinguishes it from "base address", since a root pointer can point anywhere into an allocation, not just its base address.

https://github.com/rust-lang/rust/pull/124018 has been rolled up already so I couldn't add it there any more.

r? ```@oli-obk```
2024-04-17 18:01:38 +02:00
Guillaume Gomez
ec754cf201 Fix copy-path button 2024-04-17 16:49:11 +02:00
Jules Bertholet
2a4624ddd1
Rename BindingAnnotation to BindingMode 2024-04-17 09:34:39 -04:00
klensy
1d929cf8b7 allow to set line-directives-only too 2024-04-17 15:43:52 +03:00
Kjetil Kjeka
4734163006 Add llvm-bitcode-linker to build manifest 2024-04-17 14:35:08 +02:00
klensy
3ea7cf5383 bootstrap: actually allow set debuginfo-level to "lines-tables-only" 2024-04-17 15:30:51 +03:00
onur-ozkan
214bf5a017 enable clippy for bootstrap on CI PRs
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-17 14:04:07 +03:00
bors
9776f647e6 Auto merge of #3480 - RalfJung:alloc_error_handler, r=RalfJung
directly call handle_alloc_error

Also test more codepaths. There's like 5 different things that can happen on allocation failure! Between `-Zoom`, `#[alloc_error_handler]`, and `set_alloc_error_hook`, we have 3 layers of behavior overrides. It's all a bit messy.

https://github.com/rust-lang/rust/pull/112331 seems intended to clean this up, but has not yet reached consensus.
2024-04-17 09:41:06 +00:00
Ralf Jung
9f156d38a5 no need to use miri's native stderr here 2024-04-17 09:47:16 +02:00
Ralf Jung
d7f79cc2b2 tests/utils: add fmt::Write implementations for miri's native stdout/stderr 2024-04-17 09:47:16 +02:00
Ralf Jung
d10f61313f alloc_error_handler tests: directly call handle_alloc_error; test more codepaths 2024-04-17 09:27:55 +02:00
bors
6c6b3027ef Auto merge of #123678 - DianQK:docker-local, r=Kobzol
Improve the experience of running Docker locally

When running locally, the absence of the `GITHUB_STEP_SUMMARY` environment variable will lead to the following error:

```
::endgroup::
./src/ci/docker/run.sh: line 349: : No such file or directory
```

I've also changed the output artifacts directory to `obj/$image_name`, allowing me to easily run all images locally. We always encounter various strange issues when modifying the test cases in the `codegen` directory.

r? Kobzol cc `@saethlin`
2024-04-17 06:47:39 +00:00
Ralf Jung
ae7b07f2dc interpret: rename base_pointer -> root_pointer
also in Miri, "base tag" -> "root tag"
2024-04-17 07:35:48 +02:00
Ralf Jung
9e239bdc76 interpret: pass MemoryKind to adjust_alloc_base_pointer 2024-04-17 07:35:48 +02:00
The Miri Cronjob Bot
2cb03ef739 fmt 2024-04-17 05:09:14 +00:00
The Miri Cronjob Bot
e8739886f2 Merge from rustc 2024-04-17 05:08:05 +00:00
The Miri Cronjob Bot
af28716f19 Preparing for merge from rustc 2024-04-17 04:57:09 +00:00
bors
b7581490aa Auto merge of #124055 - matthiaskrgr:rollup-waq2e68, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #122813 (Qualifier tweaking)
 - #122883 (refactor clippy in bootstrap)
 - #123997 (Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}`)
 - #124045 (Reinstate nnethercote to the review rotation.)
 - #124051 (Fix empty-set symbol in comments)
 - #124052 (Make the comments for `ReturnDest` variants doc comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-17 04:13:31 +00:00
Matthias Krüger
8229a34102
Rollup merge of #122883 - onur-ozkan:clippy-build-step, r=albertlarsan68
refactor clippy in bootstrap

Previously, using clippy in bootstrap was not very useful as explained in #122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run `x clippy compiler -Aclippy::all -Dclippy::correctness` and `x clippy library/std -Dclippy::all` and none of them will affect each other).

Resolves #122825
2024-04-17 05:44:52 +02:00
Matthias Krüger
45940fe6d8
Rollup merge of #122813 - nnethercote:nicer-quals, r=compiler-errors
Qualifier tweaking

Adding and removing qualifiers in some cases that make things nicer. Details in individual commits.

r? `@compiler-errors`
2024-04-17 05:44:52 +02:00
bors
803e33a446 Auto merge of #124039 - weihanglo:update-cargo, r=weihanglo
Update cargo

11 commits in 48eca1b164695022295ce466b64b44e4e0228b08..6f06fe908a5ee0f415c187f868ea627e82efe07d
2024-04-12 21:16:36 +0000 to 2024-04-16 18:47:44 +0000
- fix(toml): Error on `[project]` in Edition 2024 (rust-lang/cargo#13747)
- feat(update): Include a Locking message (rust-lang/cargo#13759)
- chore(deps): update rust crate gix to 0.62.0 [security] (rust-lang/cargo#13760)
- test(schemas): Ensure tests cover the correct case (rust-lang/cargo#13761)
- feat(resolve): Tell the user the style of resovle done (rust-lang/cargo#13754)
- Make sure to also wrap the initial `-vV` invocation (rust-lang/cargo#13659)
- docs: update `checkout` GitHub action version (rust-lang/cargo#13757)
- Recategorize cargo test's `--doc` flag under "Target Selection" (rust-lang/cargo#13756)
- Reword sentence describing workspace toml for clarity (rust-lang/cargo#13753)
- docs(ref): Update unstable docs for msrv-policy (rust-lang/cargo#13751)
- refactor(config): Consistently use kebab-case (rust-lang/cargo#13748)

r? ghost
2024-04-17 02:06:45 +00:00
DianQK
374b7821a5
Update LLVM to 1deeee3 2024-04-17 06:28:22 +08:00
Elisha Hollander
dd615004ea restore line-break 2024-04-16 22:23:15 +00:00
Elisha Hollander
9cdf3ca600 default to no testing 2024-04-16 22:23:12 +00:00
Elisha Hollander
331fd31e20 use FxHashMap
* add `rustc-hash` to cargo manifest

* use `FxHashMap`
2024-04-16 22:20:13 +00:00
Elisha Hollander
cfa007f1d1 use one use for std 2024-04-16 22:20:10 +00:00
Elisha Hollander
f275a3c65b refactor 2024-04-16 22:20:07 +00:00
Elisha Hollander
ab15157960 revert using regex 2024-04-16 22:20:04 +00:00
Elisha Hollander
047a0c6fa5 use regex to check for problems 2024-04-16 22:20:01 +00:00
Elisha Hollander
7b7a26bee5 remove redundant whitespace 2024-04-16 22:19:58 +00:00
Elisha Hollander
586d9d6daf format 2024-04-16 22:19:55 +00:00
Elisha Hollander
4ff9f25467 restore original consts
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2024-04-16 22:19:52 +00:00
Elisha Hollander
48cb8649f7 use generate_problems 2024-04-16 22:19:49 +00:00
Elisha Hollander
8ced53e0cc format style.rs 2024-04-16 22:19:45 +00:00
Elisha Hollander
a1f228bcd2 add more PROBLEMATIC_CONSTS 2024-04-16 22:19:42 +00:00
Guillaume Gomez
51cfa95668
Rollup merge of #124013 - RalfJung:box-to-raw, r=oli-obk
Box::into_raw: make Miri understand that this is a box-to-raw cast

Turns out https://github.com/rust-lang/rust/pull/122647 went a bit too far in cleaning up `Box`... we still need a hack in `Box::into_raw`. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.

Fixes https://github.com/rust-lang/miri/issues/3473.
2024-04-17 00:00:24 +02:00
Guillaume Gomez
ec1618cf17
Rollup merge of #123975 - lqd:rust-lld-tests, r=jieyouxu
Port the 2 `rust-lld` run-make tests to `rmake`

In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`:
- `tests/run-make/rust-lld`
- `tests/run-make/rust-lld-custom-target`

As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library.

Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`.

r? `@jieyouxu`
2024-04-17 00:00:23 +02:00
Guillaume Gomez
4aaa8f964f
Rollup merge of #123673 - oli-obk:sig_wfcheck_ice, r=jieyouxu,estebank
Don't ICE for kind mismatches during error rendering

fixes #123457

also some test suite cleanups to make backtraces easier to read
2024-04-17 00:00:22 +02:00
Weihang Lo
cea6cb3a68
Update cargo 2024-04-16 16:53:29 -04:00
bors
8ad72b24f3 Auto merge of #3478 - RalfJung:alloc_error_handler, r=RalfJung
implement support for __rust_alloc_error_handler

Fixes https://github.com/rust-lang/miri/issues/3439
2024-04-16 20:20:34 +00:00
Ralf Jung
f325c8d4fa implement support for __rust_alloc_error_handler 2024-04-16 22:16:08 +02:00
Ralf Jung
a7db62810e no_std works on Windows now 2024-04-16 21:46:18 +02:00
Guillaume Gomez
14496d561e
Rollup merge of #122811 - nnethercote:mv-SourceMap-init, r=WaffleLapkin
Move `SourceMap` initialization

So it happens at the same time as `SessionGlobals` initialization, rather than shortly afterward.

r? `@WaffleLapkin`
2024-04-16 21:41:23 +02:00
zetanumbers
24a24ec6ba Add simple async drop glue generation
Explainer: https://zetanumbers.github.io/book/async-drop-design.html

https://github.com/rust-lang/rust/pull/121801
2024-04-16 20:45:07 +03:00
onur-ozkan
16cf0e6607 allow running clippy on most of the in-tree tools
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:24:19 +03:00
onur-ozkan
5253fe4520 update mingw-check clippy invocation
Previously this command was linting compiler and library together.
As we no longer run clippy on the entire tree unless it's explicitly
requested, we need to update this command by adding `library` path.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:23:02 +03:00
onur-ozkan
a01897345c fix sysroot bug and update step message format
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:59 +03:00
onur-ozkan
bbacfe0cb6 add simple top-level doc-comment for build_steps/clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:56 +03:00
onur-ozkan
489e5d0ad0 for clippy, skip output handling in run_cargo
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:47 +03:00
onur-ozkan
77ba3f2891 support different Kinds in Builder::msg_tool
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:44 +03:00
onur-ozkan
8a865a0fa9 create Builder::msg_clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:41 +03:00
onur-ozkan
81b7944163 create new build step clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:37 +03:00
Matthias Krüger
864ab0cc36
Rollup merge of #124018 - RalfJung:dealloc-memory-kind, r=oli-obk
interpret: pass MemoryKind to before_memory_deallocation

This will be needed for https://github.com/rust-lang/miri/pull/3475.

r? ``@oli-obk``
2024-04-16 17:54:45 +02:00
Matthias Krüger
cf7900476e
Rollup merge of #124007 - RalfJung:miri, r=RalfJung
Miri subtree update

r? ``@ghost``
2024-04-16 17:54:44 +02:00
Matthias Krüger
0aa7235423
Rollup merge of #123711 - onur-ozkan:drop-changelog-seen, r=albertlarsan68
drop `changelog-seen`

It's been 7 months since we deprecated this. It should be fine to remove it now.
2024-04-16 17:54:42 +02:00
Matthias Krüger
f54219c473
Rollup merge of #123501 - Urgau:stabilize-check-cfg, r=petrochenkov
Stabilize checking of cfgs at compile-time: `--check-cfg` option

This PR stabilize the `--check-cfg` CLI option of `rustc` (and `rustdoc`) 🎉.

In particular this PR does two things:
  1. it makes the `--check-cfg` option stable
  2. and it moves the documentation to the stable books

FCP: https://github.com/rust-lang/rust/issues/82450#issuecomment-1965328542

Resolves #82450

``@rustbot`` labels +S-blocked +F-check-cfg
r? ``@petrochenkov``
2024-04-16 17:54:41 +02:00
Matthias Krüger
49f6c95ba3
Rollup merge of #123355 - mu001999:rustdoc/search, r=GuillaumeGomez
Support type '/' to search

Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559
2024-04-16 17:54:40 +02:00
Matthias Krüger
592b1ca99a
Rollup merge of #122632 - onur-ozkan:fix-llvm-caching-bug, r=albertlarsan68
fetch submodule before checking llvm stamp

Previously, we were checking the LLVM stamp before fetching the submodule which leads to not being able to compile llvm on submodule updates.

Fixes #122612
Fixes #122787
2024-04-16 17:54:39 +02:00
Ralf Jung
18bfca50f1 interpret: pass MemoryKind to before_memory_deallocation 2024-04-16 16:37:34 +02:00
bors
1dea922ea6 Auto merge of #124015 - GuillaumeGomez:rollup-s46ksxa, r=GuillaumeGomez
Rollup of 14 pull requests

Successful merges:

 - #120781 (Correct usage note on OpenOptions::append())
 - #121694 (sess: stabilize `-Zrelro-level` as `-Crelro-level`)
 - #122521 (doc(bootstrap): add top-level doc-comment to utils/tarball.rs)
 - #123491 (Fix ICE in `eval_body_using_ecx`)
 - #123574 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 6))
 - #123687 (Update ar_archive_writer to 0.2.0)
 - #123721 (Various visionOS fixes)
 - #123797 (Better graphviz output for SCCs and NLL constraints)
 - #123990 (Make `suggest_deref_closure_return` more idiomatic/easier to understand)
 - #123995 (Make `thir_tree` and `thir_flat` into hooks)
 - #123998 (Opaque types have no namespace)
 - #124001 (Fix docs for unstable_features lint.)
 - #124006 (Move size assertions for `mir::syntax` types into the same file)
 - #124011 (rustdoc: update the module-level docs of `rustdoc::clean`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-16 13:26:03 +00:00
Guillaume Gomez
f11b21bdb7
Rollup merge of #124011 - fmease:rustdoc-updated-clean-docs, r=GuillaumeGomez
rustdoc: update the module-level docs of `rustdoc::clean`

Let's update this 11-year-old documentation.
This would've helped me greatly when first starting out.

Please point out if I should add, clarify or correct anything.
I plan on looking through the rustc dev guide later to see if anything can be expanded upon over there, too.
2024-04-16 15:19:17 +02:00
Guillaume Gomez
583c1a09ee
Rollup merge of #124001 - ehuss:fix-unstable_features-docs, r=compiler-errors
Fix docs for unstable_features lint.

This fixes the `unstable_features` lint documentation (at https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features) so that it correctly displays the output (instead of showing `{{produces}}`). The lint was undeprecated in https://github.com/rust-lang/rust/pull/118639, but this little part was missed when that happened.
2024-04-16 15:19:16 +02:00
Guillaume Gomez
4232361d89
Rollup merge of #122521 - bnleft:master, r=albertlarsan68
doc(bootstrap): add top-level doc-comment to utils/tarball.rs
2024-04-16 15:19:11 +02:00
Guillaume Gomez
26b6a234a1
Rollup merge of #121694 - davidtwco:stabilize-relro-level, r=Mark-Simulacrum
sess: stabilize `-Zrelro-level` as `-Crelro-level`

Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
2024-04-16 15:19:10 +02:00
bors
fee494b2b2 Auto merge of #3472 - RalfJung:deadlock, r=RalfJung
deadlock: show backtrace for all threads

Fixes https://github.com/rust-lang/miri/issues/3424
2024-04-16 12:40:53 +00:00
Ralf Jung
811d4de5a0 deadlock: show backtrace for all threads 2024-04-16 14:34:33 +02:00
Ralf Jung
8606efa5d2 Box::into_raw: make Miri understand that this is a box-to-raw cast 2024-04-16 14:18:06 +02:00
León Orell Valerian Liehr
a5a1775c11
rustdoc: update module-level docs of rustdoc::clean 2024-04-16 13:55:28 +02:00
Maybe Waffle
e4a854e495 Miri: adopt to new intrinsic types 2024-04-16 11:53:15 +00:00
bors
4e1f5d90bc Auto merge of #123468 - compiler-errors:precise-capturing, r=oli-obk
Implement syntax for `impl Trait` to specify its captures explicitly (`feature(precise_capturing)`)

Implements `impl use<'a, 'b, T, U> Sized` syntax that allows users to explicitly list the captured parameters for an opaque, rather than inferring it from the opaque's bounds (or capturing *all* lifetimes under 2024-edition capture rules). This allows us to exclude some implicit captures, so this syntax may be used as a migration strategy for changes due to #117587.

We represent this list of captured params as `PreciseCapturingArg` in AST and HIR, resolving them between `rustc_resolve` and `resolve_bound_vars`. Later on, we validate that the opaques only capture the parameters in this list.

We artificially limit the feature to *require* mentioning all type and const parameters, since we don't currently have support for non-lifetime bivariant generics. This can be relaxed in the future.

We also may need to limit this to require naming *all* lifetime parameters for RPITIT, since GATs have no variance. I have to investigate this. This can also be relaxed in the future.

r? `@oli-obk`

Tracking issue:

- https://github.com/rust-lang/rust/issues/123432
2024-04-16 11:22:35 +00:00
Oli Scherer
4f75d67b6f Make ui_test backtraces short by default 2024-04-16 10:59:09 +00:00
Oli Scherer
fe18afe48c Unset test env vars before setting new ones.
If you want to override an env var, don't unset it, just set it
2024-04-16 10:58:54 +00:00
Ralf Jung
3d5acebbf1 threads: keep track of why we are blocked, and sanity-check that when waking up 2024-04-16 12:09:32 +02:00
DianQK
86e939e9d5
Change the output artifact path to $root_dir/obj/$image when running locally 2024-04-16 17:56:55 +08:00
Ralf Jung
876ac7b1c3 avoid passing --sysroot twice in bootstrap 2024-04-16 08:52:36 +02:00
Ralf Jung
3d3a584e4d bless test-cargo-miri 2024-04-16 08:39:42 +02:00
Nicholas Nethercote
4b27cc8b7a Avoid lots of hir::HirId{,Map,Set} qualifiers.
Because they're a bit redundant.
2024-04-16 16:29:15 +10:00
Nicholas Nethercote
e93f754289 Always use ty:: qualifier for TyKind enum variants.
Because that's the way it should be done.
2024-04-16 16:29:13 +10:00
Nicholas Nethercote
27374a0214 Avoid unnecessary rustc_span::DUMMY_SP usage.
In some cases `DUMMY_SP` is already imported. In other cases this commit
adds the necessary import, in files where `DUMMY_SP` is used more than
once.
2024-04-16 15:55:24 +10:00
The Miri Cronjob Bot
a1f523dd2c Merge from rustc 2024-04-16 05:22:30 +00:00
The Miri Cronjob Bot
20f418252f Preparing for merge from rustc 2024-04-16 05:15:16 +00:00
Nicholas Nethercote
62c32aeeab Construct SourceMap at the same time as SessionGlobals.
Currently `SourceMap` is constructed slightly later than
`SessionGlobals`, and inserted. This commit changes things so they are
done at the same time.

Benefits:
- `SessionGlobals::source_map` changes from
  `Lock<Option<Lrc<SourceMap>>>` to `Option<Lrc<SourceMap>>`. It's still
  optional, but mutability isn't required because it's initialized at
  construction.
- `set_source_map` is removed, simplifying `run_compiler`, which is
  good because that's a critical function and it's nice to make it
  simpler.

This requires moving things around a bit, so the necessary inputs are
available when `SessionGlobals` is created, in particular the `loader`
and `hash_kind`, which are no longer computed by `build_session`. These
inputs are captured by the new `SourceMapInputs` type, which is threaded
through various places.
2024-04-16 13:02:53 +10:00
Eric Huss
24e9a0c41b Fix docs for unstable_features lint. 2024-04-15 19:22:19 -07:00
bors
63f70b3d10 Auto merge of #123991 - fmease:rollup-96xcgnm, r=fmease
Rollup of 7 pull requests

Successful merges:

 - #123016 (Remove `TypeVariableOriginKind` and `ConstVariableOriginKind`)
 - #123462 (Cleanup: Rename `ModSep` to `PathSep`)
 - #123603 (Don't even parse an intrinsic unless the feature gate is enabled)
 - #123926 (Fix pretty HIR for anon consts in diagnostics)
 - #123973 (crashes: readme: add reminder to add Fixes #abcde to prs to automatically close issues.)
 - #123984 (sanitizers: Add rustc_sanitizers to triagebot.toml)
 - #123989 (Just use `type_dependent_def_id` to figure out what the method is for an expr)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-16 00:03:54 +00:00
León Orell Valerian Liehr
1069ad3982
Rollup merge of #123926 - compiler-errors:no-ann, r=estebank
Fix pretty HIR for anon consts in diagnostics

This removes the `NoAnn` printer which skips over nested bodies altogether, which is confusing, and requires users of `{ty|qpath|pat}_to_string` to pass in `&tcx` which now impleemnts `hir_pretty::PpAnn`.

There's one case where this "regresses" by actually printing out the body of the anon const -- we could suppress that, but I don't expect people to actually get anon consts like that unless they're fuzzing, tbh.

r? estebank
2024-04-16 01:12:38 +02:00
León Orell Valerian Liehr
c5665990c5
Rollup merge of #123462 - fmease:rn-mod-sep-to-path-sep, r=nnethercote
Cleanup: Rename `ModSep` to `PathSep`

`::` is usually referred to as the *path separator* (citation needed).

The existing name `ModSep` for *module separator* is a bit misleading since it in fact separates the segments of arbitrary path segments, not only ones resolving to modules. Let me just give a shout-out to associated items (`T::Assoc`, `<Ty as Trait>::function`) and enum variants (`Option::None`).

Motivation: Reduce friction for new contributors, prevent potential confusion.

cc `@petrochenkov`
r? nnethercote or compiler
2024-04-16 01:12:37 +02:00
Daniel Paoliello
32f5ca4be7 Add support for Arm64EC to the Standard Library 2024-04-15 16:05:16 -07:00
Michael Goulet
2beb6a4782 Fix clippy 2024-04-15 18:48:12 -04:00
bors
ccfcd950b3 Auto merge of #123451 - Kobzol:arbitrary-try-build, r=pietroalbini
CI: add a script for dynamically computing CI job matrix

It would be great if was easier to run specific CI workflows locally, and also to allow us to spawn a specific CI workflow by bors, to enable running arbitrary try builds. See discussion [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20workflows.20refactoring).

This PR is a first step in that direction.
- Moves the definition of CI runners and (for now) PR jobs into a separate `jobs.yml` file.
- Adds a simple Python script that reads the file, decides which jobs should be active for the current CI workflow, and prints them as JSON to their output.
- The PR job then reads this output and generates its job matrix based on it.

By moving the job definitions from `ci.yml` into a separate file, we can handle it programmatically, which should make it easier to both do local execution of CI jobs and also to do arbitrary try builds.
2024-04-15 21:28:25 +00:00
Alex Crichton
8bb9d30a02 Update how WASI toolchains are used in CI and bootstrap
This commit updates how the WASI targets are configured with their
toolchain. Long ago a `config.toml` option of `wasi-root` was added to
enable building with the WASI files produced by wasi-libc. Additionally
for CI testing and release building the Rust toolchain has been using a
hard-coded commit of wasi-libc which is bundled with the release of the
`wasm32-wasip1` target, for example.

Nowadays though the wasi-sdk project, the C/C++ toolchain for WASI, is
the go-to solution for compiling/linking WASI code and contains the
more-or-less official releases of wasi-libc. This commit migrates CI to
using wasi-sdk releases and additionally updates `bootstrap` to
recognize when this is configured. This means that with `$WASI_SDK_PATH`
configured there's no further configuration necessary to get a working
build. Notably this also works better for the new targets of WASI as
well, such as `wasm32-wasip2` and `wasm32-wasip1-threads` where the
wasi-sdk release now has libraries for all targets bundled within it.
2024-04-15 14:27:41 -07:00
Michael Goulet
34bce07e8e Remove TypeVariableOriginKind 2024-04-15 16:51:50 -04:00
Michael Goulet
8ddd2805de Rustfmt, clippy 2024-04-15 16:45:49 -04:00
bors
78ea5db500 Auto merge of #3467 - RossSmyth:bumpSysroot, r=RalfJung
Bump rustc-build-sysroot to 0.4.6

Fixes #3313
2024-04-15 20:38:59 +00:00
bors
0abd67ff72 Auto merge of #3462 - eduardosm:chunk-128, r=RalfJung
Make `split_simd_to_128bit_chunks` take only one operand

It will allow more flexible uses in the future. This makes `split_simd_to_128bit_chunks` simpler, moving some of the complexity to its callers.
2024-04-15 20:07:14 +00:00
Eric Huss
232eb59a8f lint-docs: Add redirects for renamed lints. 2024-04-15 13:01:18 -07:00
Urgau
a20de73ccf Move --check-cfg documentation to stable books 2024-04-15 21:49:56 +02:00
Urgau
909fcfcb6a Stabilize checking of cfgs at compile-time: --check-cfg option 2024-04-15 21:49:55 +02:00
Rémy Rakic
af887d3c42 mention json target specs in run_make_support 2024-04-15 19:47:38 +00:00
Jakub Beránek
72104e245b
Add comments 2024-04-15 21:21:45 +02:00
Rémy Rakic
8acfe9a138 add link_arg helper to run_make_support
and use it in the `rust-lld` tests
2024-04-15 18:08:55 +00:00
Rémy Rakic
8fa6984e8e port rust-lld-custom-target test to rmake
also make sure that rust-lld can be disabled via linker features, even
when enabled by default by the target spec
2024-04-15 18:01:37 +00:00
Rémy Rakic
97795923fc port rust-lld test to rmake
also check that turning off the linker feature does not use lld
2024-04-15 17:33:02 +00:00
Rémy Rakic
682535e777 add regex to run_make_support
note: version more recent than 1.8 depend on memchr 2.6, which creates
conflicts as memchr 2.5.0 is pinned elsewhere in the workspace
2024-04-15 17:23:16 +00:00
Rémy Rakic
96e7d25891 add missing lld directive to compiletest 2024-04-15 17:23:06 +00:00
bors
99d0186b1d Auto merge of #123968 - jieyouxu:rollup-1pnkxor, r=jieyouxu
Rollup of 12 pull requests

Successful merges:

 - #123423 (Distribute LLVM bitcode linker as a preview component)
 - #123548 (libtest: also measure time in Miri)
 - #123666 (Fix some typos in doc)
 - #123864 (Remove a HACK by instead inferring opaque types during expected/formal type checking)
 - #123896 (Migrate some diagnostics in `rustc_resolve` to session diagnostic)
 - #123919 (builtin-derive: tag → discriminant)
 - #123922 (Remove magic constants when using `base_n`.)
 - #123931 (Don't leak unnameable types in `-> _` recover)
 - #123933 (move the LargeAssignments lint logic into its own file)
 - #123934 (`rustc_data_structures::graph` mini refactor)
 - #123941 (Fix UB in LLVM FFI when passing zero or >1 bundle)
 - #123957 (disable create_dir_all_bare test on all(miri, windows))

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-15 16:46:59 +00:00
许杰友 Jieyou Xu (Joe)
4d2a8e3692
Rollup merge of #123666 - mountcount:master, r=lqd
Fix some typos in doc
2024-04-15 16:56:14 +01:00
许杰友 Jieyou Xu (Joe)
2074631732
Rollup merge of #123548 - RalfJung:what-is-time, r=joboet
libtest: also measure time in Miri

A long time ago we disabled timekeeping of the default test harness in Miri, as otherwise it would fail to run without `-Zmiri-disable-isolation`. However, since then Miri gained a "fake clock" that lets it present some deterministic notion of time when isolation is enabled.

So we could now let libtest do timekeeping again when running in Miri. That's nice as it can help detect tests that run too long. However it can also be confusing as the results with isolation can be quite different than the real time.

``@rust-lang/miri`` what do you think?
2024-04-15 16:56:14 +01:00
Ross Smyth
ca2bd01b20 Bump rustc-build-sysroot to 0.4.6 2024-04-15 11:51:56 -04:00
Eduardo Sánchez Muñoz
54f90bc33f Make split_simd_to_128bit_chunks take only one operand
It will allow more flexible uses in the future. This makes `split_simd_to_128bit_chunks` simpler, moving some of the complexity to its callers.
2024-04-15 17:20:07 +02:00
bors
0dee2b13eb Auto merge of #3466 - RalfJung:GetFullPathNameW, r=RalfJung
add some basic support for GetFullPathNameW

This is the last missing piece to make std `path::` tests work on Windows.
2024-04-15 15:13:43 +00:00
bors
69e8e2d800 Auto merge of #3411 - RalfJung:sysroot, r=RalfJung
Handle Miri sysroot entirely outside the Miri driver

(Extracted from https://github.com/rust-lang/miri/pull/3409)

This entirely moves the responsibility of setting miri-sysroot to whatever *invokes* the Miri driver.  cargo-miri knows whether it is inside rustdoc or not and can adjust accordingly. I previously avoided doing that because there are a bunch of places that are invoking the driver (cargo-miri, the ui test suite, `./miri run`, `./x.py run miri`) and they all need to be adjusted now. But it is also somewhat less fragile as we usually have more information there -- and we can just decide that `./miri run file.rs --sysroot path` is not supported. The advantage of this is that the driver is reasonably clean and doesn't need magic environment variables like MIRI_SYSROOT, and we don't have to fight rustc_driver to use a different default sysroot. Everything is done in cargo-miri (and the other much simpler driver wrappers) where it can hopefully be debugged much better.
2024-04-15 14:42:33 +00:00
Ralf Jung
e928fc5843 add some basic support for GetFullPathNameW 2024-04-15 16:40:15 +02:00
bors
023084804e Auto merge of #123937 - RalfJung:miri-link-section, r=oli-obk
Miri on Windows: run .CRT$XLB linker section on thread-end

Hopefully fixes https://github.com/rust-lang/rust/issues/123583

First commit is originally by `@bjorn3`

r? `@oli-obk`
Cc `@ChrisDenton`
2024-04-15 14:36:12 +00:00
Kjetil Kjeka
235d45e9c9 Distribute LLVM bitcode linker as a preview component 2024-04-15 15:11:28 +02:00
bors
d493fd148d Auto merge of #115717 - jsgf:stablize-json-unused-externs, r=oli-obk
Stabilize --json unused-externs(-silent)

Implement https://github.com/rust-lang/compiler-team/issues/674 ~~(pending its approval)~~
2024-04-15 10:11:46 +00:00
mountcount
7d1ee8c0fb Fix some typos in doc
Signed-off-by: mountcount <cuimoman@outlook.com>
2024-04-15 16:39:37 +08:00