Skip to content

Rollup of 11 pull requests #145334

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 23 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4c4b8b2
remove gate
Kivooeo Aug 3, 2025
9a1d380
Add `u8`-as-ASCII methods to `core::ascii::Char`
ChaiTRex Jul 4, 2025
d811581
Add `std::ascii::Char` `MIN` and `MAX` constants
ChaiTRex Jul 5, 2025
7af87d1
editorconfig: don't trim trailing whitespace in tests
lolbinarycat Jul 29, 2025
c1a31d8
Deprecate RUST_TEST_* env variables
epage Aug 11, 2025
bd44d85
Link to payload_as_str() from payload().
m-ou-se Aug 12, 2025
427be23
Address dangling doc
giltho Aug 12, 2025
0d72323
chore(ci): upgrade checkout to v5
rejected-l Aug 12, 2025
7ce620d
Constify SystemTime methods
clarfonthey Jul 26, 2025
614364c
Allow cross-compiling the Cranelift dist component
Kobzol Aug 12, 2025
2c0409c
Remove unused must_use
compiler-errors Aug 11, 2025
d6945f6
Add cast_init and cast_uninit methods for pointers
clarfonthey Jul 18, 2025
fb9cd24
Rollup merge of #143467 - ChaiTRex:ascii_char_is_ascii, r=tgross35
Kobzol Aug 13, 2025
bd2db28
Rollup merge of #144519 - clarfonthey:const-system-time, r=jhpratt
Kobzol Aug 13, 2025
900e568
Rollup merge of #144642 - lolbinarycat:editorconfig-no-run-make, r=lcnr
Kobzol Aug 13, 2025
ff44871
Rollup merge of #144870 - Kivooeo:file_prefix-stabilize, r=tgross35
Kobzol Aug 13, 2025
4b1deef
Rollup merge of #145269 - epage:test-env, r=jhpratt
Kobzol Aug 13, 2025
c2bc926
Rollup merge of #145274 - compiler-errors:unused-must-use, r=fmease
Kobzol Aug 13, 2025
6e14364
Rollup merge of #145289 - rejected-l:master, r=Kobzol
Kobzol Aug 13, 2025
a0ed088
Rollup merge of #145303 - m-ou-se:payload-as-str-doc, r=jhpratt
Kobzol Aug 13, 2025
b60d5b3
Rollup merge of #145308 - giltho:dangling-doc, r=scottmcm
Kobzol Aug 13, 2025
c4e82ab
Rollup merge of #145320 - Kobzol:fix-cranelift-codegen-dist, r=shepma…
Kobzol Aug 13, 2025
8cb78fe
Rollup merge of #145325 - clarfonthey:cast-init, r=scottmcm
Kobzol Aug 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# some tests need trailing whitespace in output snapshots
[!tests/]
trim_trailing_whitespace = true
# for actual source code files of test, we still don't want trailing whitespace
[tests/**.{rs,js}]
trim_trailing_whitespace = true
# these specific source files need to have trailing whitespace.
[tests/ui/{frontmatter/frontmatter-whitespace-3.rs,parser/shebang/shebang-space.rs}]
trim_trailing_whitespace = false

[!src/llvm-project]
indent_style = space
indent_size = 4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run_type: ${{ steps.jobs.outputs.run_type }}
steps:
- name: Checkout the source code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Test citool
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
# on PR/try builds.
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
run: git config --global core.autocrlf false

- name: checkout the source code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 2

Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
steps:
- name: checkout the source code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 2
# Calculate the exit status of the whole CI workflow.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: checkout the source code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: recursive
- name: install the bootstrap toolchain
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
pull-requests: write
steps:
- name: checkout the source code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: download Cargo.lock from update job
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# Needed to write to the ghcr.io registry
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Make sure that we have enough commits to find the parent merge commit.
# Since all merges should be through merge commits, fetching two commits
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
attr_name,
macro_name: pprust::path_to_string(&call.path),
invoc_span: call.path.span,
attr_span: attr.span,
},
);
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ lint_unused_allocation_mut = unnecessary allocation, use `&mut` instead
lint_unused_builtin_attribute = unused attribute `{$attr_name}`
.note = the built-in attribute `{$attr_name}` will be ignored, since it's applied to the macro invocation `{$macro_name}`
.suggestion = remove the attribute
lint_unused_closure =
unused {$pre}{$count ->
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_lint/src/early/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,14 @@ pub fn decorate_builtin_lint(
}
.decorate_lint(diag);
}
BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);
BuiltinLintDiag::UnusedBuiltinAttribute {
attr_name,
macro_name,
invoc_span,
attr_span,
} => {
lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name, attr_span }
.decorate_lint(diag);
}
BuiltinLintDiag::TrailingMacro(is_trailing, name) => {
lints::TrailingMacro { is_trailing, name }.decorate_lint(diag);
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_lint/src/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2938,9 +2938,10 @@ pub(crate) struct RawPrefix {
pub(crate) struct UnusedBuiltinAttribute {
#[note]
pub invoc_span: Span,

pub attr_name: Symbol,
pub macro_name: String,
#[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
pub attr_span: Span,
}

#[derive(LintDiagnostic)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_lint_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ pub enum BuiltinLintDiag {
attr_name: Symbol,
macro_name: String,
invoc_span: Span,
attr_span: Span,
},
PatternsInFnsWithoutBody {
span: Span,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ passes_must_not_suspend =
passes_must_use_no_effect =
`#[must_use]` has no effect when applied to {$article} {$target}
.suggestion = remove the attribute
passes_no_link =
attribute should be applied to an `extern crate` item
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
UNUSED_ATTRIBUTES,
hir_id,
attr_span,
errors::MustUseNoEffect { article, target },
errors::MustUseNoEffect { article, target, attr_span },
);
}

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ pub(crate) struct FfiConstInvalidTarget {
pub(crate) struct MustUseNoEffect {
pub article: &'static str,
pub target: rustc_hir::Target,
#[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
pub attr_span: Span,
}

#[derive(Diagnostic)]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
#![feature(async_iterator)]
#![feature(bstr)]
#![feature(bstr_internals)]
#![feature(cast_maybe_uninit)]
#![feature(char_internals)]
#![feature(char_max_len)]
#![feature(clone_to_uninit)]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3176,7 +3176,7 @@ impl<T, A: Allocator> Vec<T, A> {
// - but the allocation extends out to `self.buf.capacity()` elements, possibly
// uninitialized
let spare_ptr = unsafe { ptr.add(self.len) };
let spare_ptr = spare_ptr.cast::<MaybeUninit<T>>();
let spare_ptr = spare_ptr.cast_uninit();
let spare_len = self.buf.capacity() - self.len;

// SAFETY:
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ impl Layout {

/// Creates a `NonNull` that is dangling, but well-aligned for this Layout.
///
/// Note that the pointer value may potentially represent a valid pointer,
/// which means this must not be used as a "not yet initialized"
/// sentinel value. Types that lazily allocate must track initialization by
/// some other means.
/// Note that the address of the returned pointer may potentially
/// be that of a valid pointer, which means this must not be used
/// as a "not yet initialized" sentinel value.
/// Types that lazily allocate must track initialization by some other means.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[must_use]
#[inline]
Expand Down
Loading
Loading