Skip to content

Commit 9fb94b3

Browse files
committed
Auto merge of rust-lang#138310 - matthiaskrgr:rollup-zvbpuei, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#137931 (Add remark for missing `llvm-tools` component re. `rustc_private` linker failures related to not finding LLVM libraries) - rust-lang#138138 (Pass `InferCtxt` to `InlineAsmCtxt` to properly taint on error) - rust-lang#138223 (Fix post-merge workflow) - rust-lang#138268 (Handle empty test suites in GitHub job summary report) - rust-lang#138278 (Delegation: fix ICE with invalid `MethodCall` generation) - rust-lang#138281 (Fix O(tests) stack usage in edition 2024 mergeable doctests) - rust-lang#138305 (Subtree update of `rust-analyzer`) - rust-lang#138306 (Revert "Use workspace lints for crates in `compiler/` rust-lang#138084") r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2b285cd + 44ec67f commit 9fb94b3

File tree

347 files changed

+4967
-2279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+4967
-2279
lines changed

.github/workflows/post-merge.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ jobs:
1616
pull-requests: write
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
# Make sure that we have enough commits to find the parent merge commit.
21+
# Since all merges should be through merge commits, fetching two commits
22+
# should be enough to get the parent bors merge commit.
23+
fetch-depth: 2
1924
- name: Perform analysis and send PR
25+
env:
26+
GH_TOKEN: ${{ github.token }}
2027
run: |
2128
# Get closest bors merge commit
2229
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
30+
echo "Parent: ${PARENT_COMMIT}"
2331
2432
# Find PR for the current commit
2533
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
26-
27-
echo "Parent: ${PARENT_COMMIT}"
2834
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
2935
3036
cd src/ci/citool

Cargo.toml

-14
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,6 @@ exclude = [
6363
"src/tools/x",
6464
]
6565

66-
# These lints are applied to many crates in the workspace. In practice, this is
67-
# all crates under `compiler/`.
68-
#
69-
# NOTE: rustc-specific lints (e.g. `rustc::internal`) aren't supported by
70-
# Cargo. (Support for them is possibly blocked by #44690 (attributes for
71-
# tools).) Those lints are instead specified for `compiler/` crates in
72-
# `src/bootstrap/src/core/builder/cargo.rs`.
73-
[workspace.lints.rust]
74-
# FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all of the
75-
# individual lints are satisfied.
76-
keyword_idents_2024 = "warn"
77-
unreachable_pub = "warn"
78-
unsafe_op_in_unsafe_fn = "warn"
79-
8066
[profile.release.package.rustc-rayon-core]
8167
# The rustc fork of Rayon has deadlock detection code which intermittently
8268
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)

compiler/rustc/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,3 @@ llvm = ['rustc_driver_impl/llvm']
3232
max_level_info = ['rustc_driver_impl/max_level_info']
3333
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
3434
# tidy-alphabetical-end
35-
36-
[lints]
37-
workspace = true

compiler/rustc_abi/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ nightly = [
3131
]
3232
randomize = ["dep:rand", "dep:rand_xoshiro", "nightly"]
3333
# tidy-alphabetical-end
34-
35-
[lints]
36-
workspace = true

compiler/rustc_abi/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
66
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
77
#![cfg_attr(feature = "nightly", feature(step_trait))]
8+
#![warn(unreachable_pub)]
89
// tidy-alphabetical-end
910

1011
/*! ABI handling for rustc

compiler/rustc_arena/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ edition = "2024"
77
# tidy-alphabetical-start
88
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
99
# tidy-alphabetical-end
10-
11-
[lints]
12-
workspace = true

compiler/rustc_arena/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#![feature(maybe_uninit_slice)]
2424
#![feature(rustc_attrs)]
2525
#![feature(rustdoc_internals)]
26+
#![warn(unreachable_pub)]
2627
// tidy-alphabetical-end
2728

2829
use std::alloc::Layout;

compiler/rustc_ast/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
1818
thin-vec = "0.2.12"
1919
tracing = "0.1"
2020
# tidy-alphabetical-end
21-
22-
[lints]
23-
workspace = true

compiler/rustc_ast/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(never_type)]
2020
#![feature(rustdoc_internals)]
2121
#![feature(stmt_expr_attributes)]
22+
#![warn(unreachable_pub)]
2223
// tidy-alphabetical-end
2324

2425
pub mod util {

compiler/rustc_ast_ir/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ nightly = [
1919
"dep:rustc_macros",
2020
"dep:rustc_span",
2121
]
22-
23-
[lints]
24-
workspace = true

compiler/rustc_ast_ir/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![cfg_attr(feature = "nightly", allow(internal_features))]
1010
#![cfg_attr(feature = "nightly", feature(never_type))]
1111
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
12+
#![warn(unreachable_pub)]
1213
// tidy-alphabetical-end
1314

1415
#[cfg(feature = "nightly")]

compiler/rustc_ast_lowering/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,3 @@ smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2828
thin-vec = "0.2.12"
2929
tracing = "0.1"
3030
# tidy-alphabetical-end
31-
32-
[lints]
33-
workspace = true

compiler/rustc_ast_lowering/src/delegation.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,27 @@ pub(crate) struct DelegationResults<'hir> {
6060
}
6161

6262
impl<'hir> LoweringContext<'_, 'hir> {
63-
pub(crate) fn delegation_has_self(&self, item_id: NodeId, path_id: NodeId, span: Span) -> bool {
63+
/// Defines whether the delegatee is an associated function whose first parameter is `self`.
64+
pub(crate) fn delegatee_is_method(&self, item_id: NodeId, path_id: NodeId, span: Span) -> bool {
6465
let sig_id = self.get_delegation_sig_id(item_id, path_id, span);
6566
let Ok(sig_id) = sig_id else {
6667
return false;
6768
};
68-
self.has_self(sig_id, span)
69+
self.is_method(sig_id, span)
6970
}
7071

71-
fn has_self(&self, def_id: DefId, span: Span) -> bool {
72-
if let Some(local_sig_id) = def_id.as_local() {
73-
// The value may be missing due to recursive delegation.
74-
// Error will be emitted later during HIR ty lowering.
75-
self.resolver.delegation_fn_sigs.get(&local_sig_id).is_some_and(|sig| sig.has_self)
76-
} else {
77-
match self.tcx.def_kind(def_id) {
78-
DefKind::Fn => false,
79-
DefKind::AssocFn => self.tcx.associated_item(def_id).fn_has_self_parameter,
80-
_ => span_bug!(span, "unexpected DefKind for delegation item"),
81-
}
72+
fn is_method(&self, def_id: DefId, span: Span) -> bool {
73+
match self.tcx.def_kind(def_id) {
74+
DefKind::Fn => false,
75+
DefKind::AssocFn => match def_id.as_local() {
76+
Some(local_def_id) => self
77+
.resolver
78+
.delegation_fn_sigs
79+
.get(&local_def_id)
80+
.is_some_and(|sig| sig.has_self),
81+
None => self.tcx.associated_item(def_id).fn_has_self_parameter,
82+
},
83+
_ => span_bug!(span, "unexpected DefKind for delegation item"),
8284
}
8385
}
8486

@@ -324,7 +326,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
324326

325327
let call = if self
326328
.get_resolution_id(delegation.id, span)
327-
.and_then(|def_id| Ok(self.has_self(def_id, span)))
329+
.and_then(|def_id| Ok(self.is_method(def_id, span)))
328330
.unwrap_or_default()
329331
&& delegation.qself.is_none()
330332
&& !has_generic_args

compiler/rustc_ast_lowering/src/item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
871871
hir::AssocItemKind::Fn { has_self: sig.decl.has_self() }
872872
}
873873
AssocItemKind::Delegation(box delegation) => hir::AssocItemKind::Fn {
874-
has_self: self.delegation_has_self(i.id, delegation.id, i.span),
874+
has_self: self.delegatee_is_method(i.id, delegation.id, i.span),
875875
},
876876
AssocItemKind::MacCall(..) | AssocItemKind::DelegationMac(..) => {
877877
panic!("macros should have been expanded by now")
@@ -1000,7 +1000,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10001000
hir::AssocItemKind::Fn { has_self: sig.decl.has_self() }
10011001
}
10021002
AssocItemKind::Delegation(box delegation) => hir::AssocItemKind::Fn {
1003-
has_self: self.delegation_has_self(i.id, delegation.id, i.span),
1003+
has_self: self.delegatee_is_method(i.id, delegation.id, i.span),
10041004
},
10051005
AssocItemKind::MacCall(..) | AssocItemKind::DelegationMac(..) => {
10061006
panic!("macros should have been expanded by now")

compiler/rustc_ast_lowering/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#![feature(if_let_guard)]
3939
#![feature(let_chains)]
4040
#![feature(rustdoc_internals)]
41+
#![warn(unreachable_pub)]
4142
// tidy-alphabetical-end
4243

4344
use std::sync::Arc;

compiler/rustc_ast_passes/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,3 @@ rustc_session = { path = "../rustc_session" }
2020
rustc_span = { path = "../rustc_span" }
2121
thin-vec = "0.2.12"
2222
# tidy-alphabetical-end
23-
24-
[lints]
25-
workspace = true

compiler/rustc_ast_passes/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![feature(iter_is_partitioned)]
1111
#![feature(let_chains)]
1212
#![feature(rustdoc_internals)]
13+
#![warn(unreachable_pub)]
1314
// tidy-alphabetical-end
1415

1516
pub mod ast_validation;

compiler/rustc_ast_pretty/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ rustc_lexer = { path = "../rustc_lexer" }
1212
rustc_span = { path = "../rustc_span" }
1313
thin-vec = "0.2.12"
1414
# tidy-alphabetical-end
15-
16-
[lints]
17-
workspace = true

compiler/rustc_ast_pretty/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![doc(rust_logo)]
44
#![feature(box_patterns)]
55
#![feature(rustdoc_internals)]
6+
#![warn(unreachable_pub)]
67
// tidy-alphabetical-end
78

89
mod helpers;

compiler/rustc_attr_data_structures/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ rustc_serialize = {path = "../rustc_serialize"}
1414
rustc_span = {path = "../rustc_span"}
1515
thin-vec = "0.2.12"
1616
# tidy-alphabetical-end
17-
18-
[lints]
19-
workspace = true

compiler/rustc_attr_data_structures/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![doc(rust_logo)]
44
#![feature(let_chains)]
55
#![feature(rustdoc_internals)]
6+
#![warn(unreachable_pub)]
67
// tidy-alphabetical-end
78

89
mod attributes;

compiler/rustc_attr_parsing/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,3 @@ rustc_session = { path = "../rustc_session" }
2222
rustc_span = { path = "../rustc_span" }
2323
thin-vec = "0.2.12"
2424
# tidy-alphabetical-end
25-
26-
[lints]
27-
workspace = true

compiler/rustc_attr_parsing/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#![doc(rust_logo)]
8181
#![feature(let_chains)]
8282
#![feature(rustdoc_internals)]
83+
#![warn(unreachable_pub)]
8384
// tidy-alphabetical-end
8485

8586
#[macro_use]

compiler/rustc_baked_icu_data/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ icu_locid_transform = "1.3.2"
1111
icu_provider = { version = "1.2", features = ["sync"] }
1212
zerovec = "0.10.0"
1313
# tidy-alphabetical-end
14-
15-
[lints]
16-
workspace = true

compiler/rustc_baked_icu_data/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// tidy-alphabetical-start
2424
#![allow(elided_lifetimes_in_paths)]
2525
#![allow(internal_features)]
26-
#![allow(unreachable_pub)] // because this crate is mostly generated code
2726
#![doc(rust_logo)]
2827
#![feature(rustdoc_internals)]
28+
// #![warn(unreachable_pub)] // don't use because this crate is mostly generated code
2929
// tidy-alphabetical-end
3030

3131
mod data {

compiler/rustc_borrowck/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ rustc_traits = { path = "../rustc_traits" }
2727
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2828
tracing = "0.1"
2929
# tidy-alphabetical-end
30-
31-
[lints]
32-
workspace = true

compiler/rustc_borrowck/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#![feature(rustdoc_internals)]
1414
#![feature(stmt_expr_attributes)]
1515
#![feature(try_blocks)]
16+
#![warn(unreachable_pub)]
1617
// tidy-alphabetical-end
1718

1819
use std::borrow::Cow;

compiler/rustc_builtin_macros/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "rustc_builtin_macros"
33
version = "0.0.0"
44
edition = "2024"
55

6+
7+
[lints.rust]
8+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(llvm_enzyme)'] }
9+
610
[lib]
711
doctest = false
812

@@ -30,6 +34,3 @@ smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
3034
thin-vec = "0.2.12"
3135
tracing = "0.1"
3236
# tidy-alphabetical-end
33-
34-
[lints]
35-
workspace = true

compiler/rustc_builtin_macros/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(rustdoc_internals)]
1919
#![feature(string_from_utf8_lossy_owned)]
2020
#![feature(try_blocks)]
21+
#![warn(unreachable_pub)]
2122
// tidy-alphabetical-end
2223

2324
extern crate proc_macro;

compiler/rustc_codegen_llvm/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,3 @@ serde_json = "1"
4343
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
4444
tracing = "0.1"
4545
# tidy-alphabetical-end
46-
47-
[lints]
48-
workspace = true

compiler/rustc_codegen_llvm/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(rustdoc_internals)]
2020
#![feature(slice_as_array)]
2121
#![feature(try_blocks)]
22+
#![warn(unreachable_pub)]
2223
// tidy-alphabetical-end
2324

2425
use std::any::Any;

compiler/rustc_codegen_ssa/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,3 @@ features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive",
6363
[target.'cfg(windows)'.dependencies.windows]
6464
version = "0.59.0"
6565
features = ["Win32_Globalization"]
66-
67-
[lints]
68-
workspace = true

compiler/rustc_codegen_ssa/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![feature(rustdoc_internals)]
1515
#![feature(trait_alias)]
1616
#![feature(try_blocks)]
17+
#![warn(unreachable_pub)]
1718
// tidy-alphabetical-end
1819

1920
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).

compiler/rustc_const_eval/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
2626
rustc_type_ir = { path = "../rustc_type_ir" }
2727
tracing = "0.1"
2828
# tidy-alphabetical-end
29-
30-
[lints]
31-
workspace = true

compiler/rustc_const_eval/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![feature(unqualified_local_imports)]
1717
#![feature(yeet_expr)]
1818
#![warn(unqualified_local_imports)]
19+
#![warn(unreachable_pub)]
1920
// tidy-alphabetical-end
2021

2122
pub mod check_consts;

compiler/rustc_data_structures/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,3 @@ memmap2 = "0.2.1"
5454

5555
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
5656
portable-atomic = "1.5.1"
57-
58-
[lints]
59-
workspace = true

compiler/rustc_data_structures/src/graph/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::cmp::max;
33
use super::*;
44
use crate::fx::FxHashMap;
55

6-
pub(super) struct TestGraph {
6+
pub struct TestGraph {
77
num_nodes: usize,
88
start_node: usize,
99
successors: FxHashMap<usize, Vec<usize>>,
1010
predecessors: FxHashMap<usize, Vec<usize>>,
1111
}
1212

1313
impl TestGraph {
14-
pub(super) fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
14+
pub fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
1515
let mut graph = TestGraph {
1616
num_nodes: start_node + 1,
1717
start_node,

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub struct Error<O, E> {
313313

314314
mod helper {
315315
use super::*;
316-
pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
316+
pub type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
317317
impl<O: ForestObligation> ObligationForest<O> {
318318
pub fn new() -> ObligationForest<O> {
319319
ObligationForest {

0 commit comments

Comments
 (0)