-
Notifications
You must be signed in to change notification settings - Fork 1.9k
minor: Rustc pull update #21419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
minor: Rustc pull update #21419
+2
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diagnostics: do not repeat the entire message in the span label
use RwLockRef instead of RwLockId
Automatic Rustup
Automatic Rustup
Automatic Rustup
Allow building Miri with --features from miri-script
isolated_alloc: directly use mmap for allocations
Automatic Rustup
Synced rust-analyzer configs
Automatic Rustup
./miri toolchain: no need to run 'cargo metadata'
re-balance CI jobs
Remove leaky synchronisation objects.
Add tracing_chrome under "tracing" feature
move our data structures into a central location
Automatic Rustup
Automatic Rustup
Automatic Rustup
Add tracing spans to borrow tracker functions
Add std::hint::spin_loop() to tests
bootstrap: Use cargo's `build.warnings=deny` rather than -Dwarnings
This has two major advantages. First, it makes us less dependent on the rustc shim, which is nice but not super important. More importantly, it gives us much nicer caching properties.
Previously, `x build --warnings warn && x build --warnings deny` would rebuild all of bootstrap, and if there were any warnings emitted on the last build of the compiler, they would *not* fail the build, because cargo would cache the output rather than rerunning the shim.
After this change, bootstrap rebuilds instantly, and cargo knows that it should fail the build but *without* invalidating the cache.
<details><summary>An example of rebuilding bootstrap after a switch from warn->deny:</summary>
```
INFO: Downloading and building bootstrap before processing --help command.
See src/bootstrap/README.md for help with common commands.
Building bootstrap
Compiling bootstrap v0.0.0 (/Users/jyn/src/ferrocene3/src/bootstrap)
warning: unused variable: `x`
--> src/bootstrap/src/core/builder/mod.rs:1792:13
|
1792 | let x: ();
| ^
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
help: if this is intentional, prefix it with an underscore
|
1792 | let _x: ();
| +
help: you might have meant to pattern match on the similarly named constant `_`
|
1792 - let x: ();
1792 + let utils::render_tests::_: ();
|
warning: `bootstrap` (lib) generated 1 warning (run `cargo fix --lib -p bootstrap` to apply 1 suggestion)
Finished `dev` profile [unoptimized] target(s) in 5.14s
error: warnings are denied by `build.warnings` configuration
failed to run: /Users/jyn/src/ferrocene3/build/aarch64-apple-darwin/stage0/bin/cargo build --jobs=default --manifest-path /Users/jyn/src/ferrocene3/src/bootstrap/Cargo.toml -Zroot-dir=/Users/jyn/src/ferrocene3 -Zwarnings
```
</details>
building the compiler from scratch with `deny`: https://gist.github.com/jyn514/493ed26c2aa6f61bf47c21e75efa2175
<details><summary>and rebuilding the compiler after switching from deny->warn (note that it reuses the whole cache, there are no invalidations):</summary>
```
$ x c compiler
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.15s
Checking stage1 compiler artifacts{rustc-main, rustc_abi, rustc_arena, rustc_ast, rustc_ast_ir, rustc_ast_lowering, rustc_ast_passes, rustc_ast_pretty, rustc_attr_parsing, rustc_baked_icu_data, rustc_borrowck, rustc_builtin_macros, rustc_codegen_llvm, rustc_codegen_ssa, rustc_const_eval, rustc_data_structures, rustc_driver, rustc_driver_impl, rustc_error_codes, rustc_error_messages, rustc_errors, rustc_expand, rustc_feature, rustc_fluent_macro, rustc_fs_util, rustc_graphviz, rustc_hashes, rustc_hir, rustc_hir_analysis, rustc_hir_id, rustc_hir_pretty, rustc_hir_typeck, rustc_incremental, rustc_index, rustc_index_macros, rustc_infer, rustc_interface, rustc_lexer, rustc_lint, rustc_lint_defs, rustc_llvm, rustc_log, rustc_macros, rustc_metadata, rustc_middle, rustc_mir_build, rustc_mir_dataflow, rustc_mir_transform, rustc_monomorphize, rustc_next_trait_solver, rustc_parse, rustc_parse_format, rustc_passes, rustc_pattern_analysis, rustc_privacy, rustc_proc_macro, rustc_public, rustc_public_bridge, rustc_query_impl, rustc_query_system, rustc_resolve, rustc_sanitizers, rustc_serialize, rustc_session, rustc_span, rustc_symbol_mangling, rustc_target, rustc_thread_pool, rustc_trait_selection, rustc_traits, rustc_transmute, rustc_ty_utils, rustc_type_ir, rustc_type_ir_macros, rustc_windows_rc} (stage0 -> stage1, aarch64-apple-darwin)
warning: function `foo` is never used
--> compiler/rustc_hashes/src/lib.rs:16:4
|
16 | fn foo() {}
| ^^^
|
= note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
warning: `rustc_hashes` (lib) generated 1 warning
Finished `release` profile [optimized + debuginfo] target(s) in 0.53s
Build completed successfully in 0:00:08
```
</details>
thanks to `@epage` for the help finding this!
r? bootstrap
…r=Mark-Simulacrum alloc: specialize String::extend for slices of str Here's a small optimization via specialization that can potentially eliminate a fair few reallocations when building strings using specific patterns, unsure if this justifies the use of unsafe, but I had the code implemented from rust-lang/rust#148604, so I thought it was worth submitting to see.
RISC-V: Implement (Zkne or Zknd) intrinsics correctly On rust-lang/stdarch#1765, it has been pointed out that two RISC-V (64-bit only) intrinsics to perform AES key scheduling have wrong target feature. `aes64ks1i` and `aes64ks2` instructions require *either* Zkne (scalar cryptography: AES encryption) or Zknd (scalar cryptography: AES decryption) extension (or both) but corresponding Rust intrinsics (in `core::arch::riscv64`) required *both* Zkne and Zknd extensions. An excerpt from the original intrinsics: ```rust #[target_feature(enable = "zkne", enable = "zknd")] ``` To fix that, we need to: 1. Represent a condition where *either* Zkne or Zknd is available and 2. Workaround an issue: `llvm.riscv.aes64ks1i` / `llvm.riscv.aes64ks2` LLVM intrinsics require either Zkne or Zknd extension. This PR attempts to resolve them by: 1. Adding a perma-unstable RISC-V target feature: `zkne_or_zknd` (implied from both `zkne` and `zknd`) and 2. Using inline assembly to construct machine code directly (because `zkne_or_zknd` alone cannot imply neither Zkne nor Zknd, we cannot use LLVM intrinsics). The author confirmed that we can construct an AES key scheduling function with decent performance using fixed `aes64ks1i` and `aes64ks2` intrinsics (with optimization enabled).
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to 76d44ff. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
…u,jieyouxu Use --print target-libdir in run-make tests This makes the tests more robust against sysroot layout changes and slightly simplifies them.
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#146798 (RISC-V: Implement (Zkne or Zknd) intrinsics correctly) - rust-lang/rust#150337 (docs: fix typo in std::io::buffered) - rust-lang/rust#150530 (Remove `feature(string_deref_patterns)`) - rust-lang/rust#150543 (`rust-analyzer` subtree update) - rust-lang/rust#150544 (Use --print target-libdir in run-make tests) r? `@ghost` `@rustbot` modify labels: rollup
fix(bootstrap/dist)!: change dist path for `rustc-docs` to avoid clashing Closes rust-lang/rust#75833, part of rust-lang/rustup#3717: > I'd like to know if we can assign another folder name to `rustc-docs`? > [...] > [`@ThePuzzlemaker](https://github.com/ThePuzzlemaker)'s` `share/doc/rust/html/nightly-rustc` does look a bit weird to me (`nightly-rustc` has nothing to do with the current `rustc`, i.e. the Rustc Book, but they somehow appear similar just looking at the names). > > I personally would like to see something like `share/doc/rust/html/rustc-docs` or `share/doc/rust/html/rustc-api` for this component. _rust-lang/rust#75833 (comment) The TLDR is that currently the "rustc book"'s path clashes with "rustc APIs" (i.e. `rustc-docs`), so we change the path of the latter to make it distributable via rustup. I'm new to `bootstrap` so please feel free to point out any inconsistencies or any extra work I'll need to do to fully land this somewhat breaking change.
Avoid index check in char::to_lowercase and char::to_uppercase This generates a panic free code, with is helpful for smaller binary sizes.
add check for `u8`s in `lit_to_const` Fixes rust-lang/rust#131052 r? BoxyUwU
miri subtree update Subtree update of `miri` to rust-lang/miri@cb3bfe8. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
Use more principled check for generics in const ops Fixes rust-lang/rust#144547. Fixes rust-lang/rust#140891. In the future, we likely want to make the check less likely to be missed by reducing the number of external entry points to HIR type lowering. Note: If this causes pass->error regressions (not truly regressions because those cases were mistakenly accepted), they can easily be avoided for the time being by only running the check if `is_self_alias` is true or mgca is enabled. - **Fix parsing of mgca const blocks in array repeat exprs** - **Use more principled check for generics in const ops**
Run rustdoc tests in opt-dist tests Context: rust-lang/rust#150287 try-job: dist-x86_64-linux
tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs: New test Closes rust-lang/rust#60044 which has one 👍 and one ❤️ vote and just **E-needs-test**.
…anieu
Stabilize 29 RISC-V target features (`riscv_ratified_v2`)
This commit stabilizes RISC-V target features with following constraints:
* Describes a ratified extension.
* Implemented on Rust 1.88.0 or before.
Waiting for four+ version cycles seems sufficient.
* Does not disrupt current rustc's target feature (cf. rust-lang/rust#140570) + ABI (cf. rust-lang/rust#132618) handling.
It excludes `E` and all floating point-arithmetic extensions. The `Zfinx` family does not involve floating point registers but not stabilizing for now to avoid possible confusion between the `F` extension family.
* Not vector-related (floating point and integer).
While integer vector subsets should not cause any ABI issues (as they don't use ABI-dependent floating point registers), we need to discuss before stabilizing them.
* Supported by the lowest LLVM version supported by rustc (LLVM 20).
List of target features to be stabilized:
1. `b`
2. `za64rs` (no-RT)
3. `za128rs` (no-RT)
4. `zaamo`
5. `zabha`
6. `zacas`
7. `zalrsc`
8. `zama16b` (no-RT)
9. `zawrs`
10. `zca`
11. `zcb`
12. `zcmop`
13. `zic64b` (no-RT)
14. `zicbom`
15. `zicbop` (no-RT)
16. `zicboz`
17. `ziccamoa` (no-RT)
18. `ziccif` (no-RT)
19. `zicclsm` (no-RT)
20. `ziccrse` (no-RT)
21. `zicntr`
22. `zicond`
23. `zicsr`
24. `zifencei`
25. `zihintntl`
26. `zihintpause`
27. `zihpm`
28. `zimop`
29. `ztso`
Of which, 20 of them (29 minus 9 "no-RT" target features) support runtime detection through `std::arch::is_riscv_feature_detected!()`.
Corresponding PR for the Reference: rust-lang/reference#1987
…ec, r=jhpratt Add specialization for `deque1.prepend(deque2.drain(range))` (VecDeque::prepend and extend_front) Tracking issue: rust-lang/rust#146975 This specialization makes sure `deque1.prepend(deque2.drain(..))` gets similar speed to `deque1.append(&mut deque2)`. `deque1.prepend(deque2.drain(..))` is the equivalent of `deque1.append(&mut deque2)` but appending to the front (see the [second example of prepend](https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.prepend), prepend is from the same tracking issue).
This removes `associated_const_equality` as a separate feature gate and makes it part of `min_generic_const_args` (mgca). Key changes: - Remove `associated_const_equality` from unstable features, add to removed - Update all test files to use `min_generic_const_args` instead - Preserve the original "associated const equality is incomplete" error message by specially handling `sym::associated_const_equality` spans in `feature_gate.rs` - Rename FIXME(associated_const_equality) to FIXME(mgca)
Rename the gcc component to gcc-dev In preparation for https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Safe.20rustup.20distribution.20of.20rustc_codegen_gcc/with/565801325. try-job: dist-x86_64-linux
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to 6a1246b. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
…, r=BoxyUwU Merge `associated_const_equality` feature gate into MGCA Tracking Issues: rust-lang/rust#132980 rust-lang/rust#92827 Merge `associated_const_equality`(ACE) feature gate into `min_generic_const_args`(MGCA). - Replaces `features().associated_const_equality()` checks with `features().min_generic_const_args()` - Updates the parser to gate associated const equality under `min_generic_const_args` - Moves `associated_const_equality` to the removed features list - Removes the `associated_const_equality` method from the `Features` trait - Updates all affected tests and tools (rust-analyzer, clippy) Closes rust-lang/rust#150617 r? `@BoxyUwU`
`Vec::push` in consts MVP
Example:
```rust
const X: &'static [u32] = {
let mut v = Vec::with_capacity(6);
let mut x = 1;
while x < 42 {
v.push(x);
x *= 2;
}
assert!(v.len() == 6);
v.const_make_global()
};
assert_eq!([1, 2, 4, 8, 16, 32], X);
```
Oh this is fun...
* We split out the implementation of `Global` such that it calls `intrinsics::const_allocate` and `intrinsics::const_deallocate` during compile time. This is achieved using `const_eval_select`
* This allows us to `impl const Allocator for Global`
* We then constify everything necessary for `Vec::with_capacity` and `Vec::push`.
* Added `Vec::const_make_global` to leak and intern the final value via `intrinsics::const_make_global`. If we see any pointer in the final value of a `const` that did not call `const_make_global`, we error as implemented in rust-lang/rust#143595.
r? `@rust-lang/wg-const-eval`
To-do for me:
* [x] Assess the rustdoc impact of additional bounds in the method
* [x] ~~Increase test coverage~~ I think this is enough for an unstable feature.
naked functions: emit `.private_extern` on macos fixes rust-lang/rust#148307 Emit `.private_extern` on macos when the naked function uses `Linkage::Internal`. Failing to do so can cause issues with LTO. The documentation on this directive is kind of sparse, but I believe this is at least not incorrect, and does fix the issue. r? @Amanieu cc @bjorn3
This updates the rust-version file to 548e586795f6b6fe089d8329aa5edbf0f5202646.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@548e586 Filtered ref: aea42e3 Upstream diff: rust-lang/rust@e7d4414...548e586 This merge was created using https://github.com/rust-lang/josh-sync.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Latest update from rustc.