Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jul 16, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

a1phyr and others added 29 commits July 9, 2025 18:11
This method was not really useful: at no point one would only need to read the initialized part of the cursor without mutating it.
I assume that this method was there for completeness, but there is hardly any useful use of it: the buffer it gave was not always connected to the start of the cursor and its use required `unsafe` anyway to mark the bytes as initialized.
This enable removing the `start` field, so `BorrowedCursor` fits in a single register. Because `written` is almost always used in difference with another call, this changes nothing else in practice.
Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion.
Co-Authored-By: Ralf Jung <post@ralfj.de> Co-Authored-By: Oli Scherer <github333195615777966@oli-obk.de>
Co-Authored-By: Ralf Jung <post@ralfj.de>
There are many places that join path segments with `::` to produce a string. A lot of these use `join("::")`. Many in rustdoc use `join_with_double_colon`, and a few use `.joined("..")`. One in Clippy uses `itertools::join`. A couple of them look for `kw::PathRoot` in the first segment, which can be important. This commit introduces `rustc_ast::join_path_{syms,ident}` to do the joining for everyone. `rustc_ast` is as good a location for these as any, being the earliest-running of the several crates with a `Path` type. Two functions are needed because `Ident` printing is more complex than simple `Symbol` printing. The commit also removes `join_with_double_colon`, and `estimate_item_path_byte_length` with it. There are still a handful of places that join strings with "::" that are unchanged. They are not that important: some of them are in tests, and some of them first split a path around "::" and then rejoin with "::". This fixes one test case where `{{root}}` shows up in an error message.
This one is a bit marginal, because the segments are a mix of symbols and strings.
…r, r=RalfJung,fee1-dead add `const_make_global`; err for `const_allocate` ptrs if didn't call Implements as discussed on Zulip: [#t-compiler/const-eval > const heap](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const.20heap/with/527125421) r? `@rust-lang/wg-const-eval` Fixes rust-lang#129233
Added error for invalid char cast fixes rust-lang#143597 not really sure if I did it right, but according to cast-char test -- it is right, also this code gave me false positive result ``` for _ in 0..(256 as u8) {} ``` so this is why I added this check `if lit_val <= 0xFF` Also I believe that error message could be improved, but I'm not sure how exactly cc `@hkBst` r? compiler
Opaque type collection: Guard against endlessly recursing free alias types See test description for technical details. Fixes rust-lang#131994. r? oli-obk (sry, your queue is large, so no rush & feel free to reassign)
…k-Simulacrum Fixed a core crate compilation failure when enabling the `optimize_for_size` feature on some targets This fixes rust-lang#143804.
…enton Trim `BorrowedCursor` API This PR removes some method from the unstable `BorrowedCursor` type. A rational for each change can be found in the message of each commit. I don't think that an ACP is required for this, please tell me if it is not the case. Cc rust-lang#78485 rust-lang#117693
…trochenkov Linting public reexport of private dependencies Part of public/private dependencies rust-lang#44663 Partially addresses rust-lang#71043 I'm adding a warning for reexports of private dependencies into `rustc_resolve`. I get that this should not be a warning, but should instead be a lint to be controlled by the feature gate, but I did not figure out how exactly to do that at that point. I tried doing the same thing as is done in `rustc_privacy`, but the linting system is not ready yet as far as I understand the error I got, so I made a warning for now instead. Some guidance on how to emit lints with `dcx` would be appreciated. This also sets the `std_detect` crate as a public dependency of `std` because some macros are reexported from there. I did not check closer, but the other option may be to allow the specific reexports instead.
…y, r=fmease parse `const trait Trait` r? oli-obk or anyone from project-const-traits cc ``@rust-lang/project-const-traits``
…szelmann Port `#[coverage]` to the new attribute system r? `@jdonszelmann`
…taxes-rewording, r=traviscross,jieyouxu Reword mismatched-lifetime-syntaxes text based on feedback Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion. r? `@jieyouxu`
Improve path segment joining Currently paths are joined with `::` in many places, in a variety of ways. This PR unifies things. r? `@petrochenkov`
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Jul 16, 2025
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Jul 16, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2025
@samueltardieu
Copy link
Member

Yeah, bors seems slow to register what PR have been merged through #144028 already!

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/const-trait-bounds-trait-objects/const-trait-bounds-trait-objects.stderr` diff of stderr: 26 | 27 = note: trait objects cannot have `[const]` trait bounds 28 - error: `const` can only be applied to `#[const_trait]` traits + error: `const` can only be applied to `const` traits 30 --> $DIR/const-trait-bounds-trait-objects.rs:15:25 31 | --- 37 LL | #[const_trait] trait NonConst {} 38 | ++++++++++++++ 39 - error: `[const]` can only be applied to `#[const_trait]` traits + error: `[const]` can only be applied to `const` traits 41 --> $DIR/const-trait-bounds-trait-objects.rs:18:23 42 | 43 LL | const fn take(_: &dyn [const] NonConst) {} 44 | ^^^^^^^ can't be applied to `NonConst` 45 | - help: mark `NonConst` as `#[const_trait]` to allow it to have `const` implementations + help: mark `NonConst` as `const` to allow it to have `const` implementations --- To only update this specific test, also pass `--test-args traits/const-traits/const-trait-bounds-trait-objects.rs` error: 1 errors occurred comparing output. status: exit status: 1 command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/const-trait-bounds-trait-objects" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" stdout: none --- stderr ------------------------------- error: const trait bounds are not allowed in trait object types ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:9:17 | LL | let _: &dyn const Trait; //~ ERROR const trait bounds are not allowed in trait object types | ^^^^^^^^^^^ error: `[const]` is not allowed here ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:10:17 | LL | let _: &dyn [const] Trait; //~ ERROR `[const]` is not allowed here | ^^^^^^^ | = note: trait objects cannot have `[const]` trait bounds error: const trait bounds are not allowed in trait object types ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:15:25 | LL | const fn handle(_: &dyn const NonConst) {} | ^^^^^^^^^^^^^^ error: `[const]` is not allowed here ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:18:23 | LL | const fn take(_: &dyn [const] NonConst) {} | ^^^^^^^ | = note: trait objects cannot have `[const]` trait bounds error: `const` can only be applied to `const` traits ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:15:25 | LL | const fn handle(_: &dyn const NonConst) {} | ^^^^^ can't be applied to `NonConst` | help: mark `NonConst` as `const` to allow it to have `const` implementations | LL | #[const_trait] trait NonConst {} | ++++++++++++++ error: `[const]` can only be applied to `const` traits ##[error] --> /checkout/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.rs:18:23 | LL | const fn take(_: &dyn [const] NonConst) {} | ^^^^^^^ can't be applied to `NonConst` | help: mark `NonConst` as `const` to allow it to have `const` implementations | LL | #[const_trait] trait NonConst {} | ++++++++++++++ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide rollup A PR which is a rollup T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.