Skip to content
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

Rollup of 9 pull requests #129898

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9d694b5
support custom clippy
onur-ozkan Aug 26, 2024
9dcc656
document `build.cargo-clippy` option
onur-ozkan Aug 26, 2024
1a991e5
add change entry for custom clippy support
onur-ozkan Aug 26, 2024
893413d
Add a run-make test for checking that certain `rustc_` crates build o…
Kobzol Aug 24, 2024
7957140
inhibit proc-macro2 nightly detection
lqd Aug 24, 2024
d9794a9
run test in tmp dir and emit artifacts there
lqd Aug 24, 2024
2190c28
remove use of RUSTC_BOOTSTRAP and cargo nightly features
lqd Aug 25, 2024
0577035
separate the crates to test from the test setup
lqd Aug 25, 2024
f1df0c5
remove unneeded type ascription
lqd Aug 25, 2024
175238b
Make decoding non-optional LazyArray panic if not set
compiler-errors Aug 30, 2024
d30b5f0
update `object` dependency to deduplicate `wasmparser`
lqd Sep 1, 2024
5780c1c
chore: Fix typos in 'compiler' (batch 3)
Sajjon Sep 2, 2024
ac69544
chore: Fix typos in 'compiler' (batch 1)
Sajjon Sep 2, 2024
00de006
chore: Fix typos in 'compiler' (batch 2)
Sajjon Sep 2, 2024
a178559
address review comments
lqd Sep 2, 2024
cf08447
Do not request sanitizers for naked functions
nikic Sep 2, 2024
7494224
clarify language around non-null ptrs in slice::raw
oskgo Sep 2, 2024
2dcad58
Rollup merge of #129152 - onur-ozkan:custom-clippy, r=Kobzol
matthiaskrgr Sep 2, 2024
9485928
Rollup merge of #129529 - lqd:stable-new-solver, r=Kobzol
matthiaskrgr Sep 2, 2024
aec8ada
Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr
matthiaskrgr Sep 2, 2024
c67c646
Rollup merge of #129860 - lqd:remove-duplicate-deps, r=alexcrichton
matthiaskrgr Sep 2, 2024
9bacd78
Rollup merge of #129875 - Sajjon:sajjon_fix_typos_batch_1, r=compiler…
matthiaskrgr Sep 2, 2024
364135a
Rollup merge of #129877 - Sajjon:sajjon_fix_typos_batch_2, r=fee1-dead
matthiaskrgr Sep 2, 2024
6165b06
Rollup merge of #129878 - Sajjon:sajjon_fix_typos_batch_3, r=jieyouxu
matthiaskrgr Sep 2, 2024
19a6bf3
Rollup merge of #129891 - nikic:naked-no-san, r=jackh726
matthiaskrgr Sep 2, 2024
718b124
Rollup merge of #129892 - oskgo:clarify-slice-from-raw, r=RalfJung
matthiaskrgr Sep 2, 2024
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
37 changes: 14 additions & 23 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
dependencies = [
"object 0.36.3",
"object 0.36.4",
]

[[package]]
Expand Down Expand Up @@ -2453,17 +2453,17 @@ dependencies = [

[[package]]
name = "object"
version = "0.36.3"
version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
dependencies = [
"crc32fast",
"flate2",
"hashbrown",
"indexmap",
"memchr",
"ruzstd 0.7.0",
"wasmparser 0.215.0",
"wasmparser",
]

[[package]]
Expand Down Expand Up @@ -3129,11 +3129,11 @@ dependencies = [
"build_helper",
"gimli 0.31.0",
"libc",
"object 0.36.3",
"object 0.36.4",
"regex",
"serde_json",
"similar",
"wasmparser 0.216.0",
"wasmparser",
]

[[package]]
Expand Down Expand Up @@ -3408,7 +3408,7 @@ dependencies = [
"itertools",
"libc",
"measureme",
"object 0.36.3",
"object 0.36.4",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -3447,7 +3447,7 @@ dependencies = [
"itertools",
"jobserver",
"libc",
"object 0.36.3",
"object 0.36.4",
"pathdiff",
"regex",
"rustc_arena",
Expand Down Expand Up @@ -4431,7 +4431,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags 2.6.0",
"object 0.36.3",
"object 0.36.4",
"rustc_abi",
"rustc_data_structures",
"rustc_feature",
Expand Down Expand Up @@ -5849,7 +5849,7 @@ dependencies = [
"lexopt",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.216.0",
"wasmparser",
"wat",
"wit-component",
"wit-parser",
Expand All @@ -5869,7 +5869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88"
dependencies = [
"leb128",
"wasmparser 0.216.0",
"wasmparser",
]

[[package]]
Expand All @@ -5885,16 +5885,7 @@ dependencies = [
"serde_json",
"spdx",
"wasm-encoder",
"wasmparser 0.216.0",
]

[[package]]
name = "wasmparser"
version = "0.215.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e"
dependencies = [
"bitflags 2.6.0",
"wasmparser",
]

[[package]]
Expand Down Expand Up @@ -6228,7 +6219,7 @@ dependencies = [
"serde_json",
"wasm-encoder",
"wasm-metadata",
"wasmparser 0.216.0",
"wasmparser",
"wit-parser",
]

Expand All @@ -6247,7 +6238,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.216.0",
"wasmparser",
]

[[package]]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn has_self(&self, def_id: DefId, span: Span) -> bool {
if let Some(local_sig_id) = def_id.as_local() {
// The value may be missing due to recursive delegation.
// Error will be emmited later during HIR ty lowering.
// Error will be emitted later during HIR ty lowering.
self.resolver.delegation_fn_sigs.get(&local_sig_id).map_or(false, |sig| sig.has_self)
} else {
match self.tcx.def_kind(def_id) {
Expand Down Expand Up @@ -139,7 +139,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn param_count(&self, sig_id: DefId) -> (usize, bool /*c_variadic*/) {
if let Some(local_sig_id) = sig_id.as_local() {
// Map may be filled incorrectly due to recursive delegation.
// Error will be emmited later during HIR ty lowering.
// Error will be emitted later during HIR ty lowering.
match self.resolver.delegation_fn_sigs.get(&local_sig_id) {
Some(sig) => (sig.param_count, sig.c_variadic),
None => (0, false),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
for field in &variant.fields {
// In practice unless there are more than one field with the same type, we'll be
// suggesting a single field at a type, because we don't aggregate multiple borrow
// checker errors involving the functional record update sytnax into a single one.
// checker errors involving the functional record update syntax into a single one.
let field_ty = field.ty(self.infcx.tcx, args);
let ident = field.ident(self.infcx.tcx);
if field_ty == ty && fields.iter().all(|field| field.ident.name != ident.name) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/liveness/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl<'a, 'me, 'typeck, 'flow, 'tcx> LivenessResults<'a, 'me, 'typeck, 'flow, 'tc
// This collect is more necessary than immediately apparent
// because these facts go into `add_drop_live_facts_for()`,
// which also writes to `all_facts`, and so this is genuinely
// a simulatneous overlapping mutable borrow.
// a simultaneous overlapping mutable borrow.
// FIXME for future hackers: investigate whether this is
// actually necessary; these facts come from Polonius
// and probably maybe plausibly does not need to go back in.
Expand Down
46 changes: 25 additions & 21 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,26 +411,31 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
// the string "false". Now it is disabled by absence of the attribute.
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "branch-target-enforcement", "false"));
}
} else if llvm_util::get_version() >= (19, 0, 0) {
// For non-naked functions, set branch protection attributes on aarch64.
if let Some(BranchProtection { bti, pac_ret }) =
cx.sess().opts.unstable_opts.branch_protection
{
assert!(cx.sess().target.arch == "aarch64");
if bti {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
}
if let Some(PacRet { leaf, key }) = pac_ret {
to_add.push(llvm::CreateAttrStringValue(
cx.llcx,
"sign-return-address",
if leaf { "all" } else { "non-leaf" },
));
to_add.push(llvm::CreateAttrStringValue(
cx.llcx,
"sign-return-address-key",
if key == PAuthKey::A { "a_key" } else { "b_key" },
));
} else {
// Do not set sanitizer attributes for naked functions.
to_add.extend(sanitize_attrs(cx, codegen_fn_attrs.no_sanitize));

if llvm_util::get_version() >= (19, 0, 0) {
// For non-naked functions, set branch protection attributes on aarch64.
if let Some(BranchProtection { bti, pac_ret }) =
cx.sess().opts.unstable_opts.branch_protection
{
assert!(cx.sess().target.arch == "aarch64");
if bti {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
}
if let Some(PacRet { leaf, key }) = pac_ret {
to_add.push(llvm::CreateAttrStringValue(
cx.llcx,
"sign-return-address",
if leaf { "all" } else { "non-leaf" },
));
to_add.push(llvm::CreateAttrStringValue(
cx.llcx,
"sign-return-address-key",
if key == PAuthKey::A { "a_key" } else { "b_key" },
));
}
}
}
}
Expand Down Expand Up @@ -485,7 +490,6 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
if let Some(backchain) = backchain_attr(cx) {
to_add.push(backchain);
}
to_add.extend(sanitize_attrs(cx, codegen_fn_attrs.no_sanitize));
to_add.extend(patchable_function_entry_attrs(cx, codegen_fn_attrs.patchable_function_entry));

// Always annotate functions with the target-cpu they are compiled for.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn prepare_usage_sets<'tcx>(tcx: TyCtxt<'tcx>) -> UsageSets<'tcx> {
(instance.def_id(), body)
});

// Functions whose coverage statments were found inlined into other functions.
// Functions whose coverage statements were found inlined into other functions.
let mut used_via_inlining = FxHashSet::default();
// Functions that were instrumented, but had all of their coverage statements
// removed by later MIR transforms (e.g. UnreachablePropagation).
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
match ty.kind() {
ty::Int(ity) => {
// FIXME: directly extract the bits from a valtree instead of evaluating an
// alreay evaluated `Const` in order to get the bits.
// already evaluated `Const` in order to get the bits.
let bits = ct.eval_bits(tcx, ty::ParamEnv::reveal_all());
let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128;
write!(output, "{val}")
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/interpret/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use super::{
};
use crate::fluent_generated as fluent;

/// An argment passed to a function.
/// An argument passed to a function.
#[derive(Clone, Debug)]
pub enum FnArg<'tcx, Prov: Provenance = CtfeProvenance> {
/// Pass a copy of the given operand.
Expand Down Expand Up @@ -123,7 +123,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
self.tcx.has_attr(def.did(), sym::rustc_nonnull_optimization_guaranteed)
};
let inner = self.unfold_transparent(inner, /* may_unfold */ |def| {
// Stop at NPO tpyes so that we don't miss that attribute in the check below!
// Stop at NPO types so that we don't miss that attribute in the check below!
def.is_struct() && !is_npo(def)
});
Ok(match inner.ty.kind() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// be computed as the type references non-existing names.
// See <https://github.com/rust-lang/rust/issues/124348>.
} else {
// Looks like the const is not captued by `required_consts`, that's bad.
// Looks like the const is not captured by `required_consts`, that's bad.
span_bug!(span, "interpret const eval failure of {val:?} which is not in required_consts");
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {

let (size, align) = if nested {
// Nested anonymous statics are untyped, so let's get their
// size and alignment from the allocaiton itself. This always
// size and alignment from the allocation itself. This always
// succeeds, as the query is fed at DefId creation time, so no
// evaluation actually occurs.
let alloc = self.tcx.eval_static_initializer(def_id).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub(super) enum Place<Prov: Provenance = CtfeProvenance> {
/// `Local` places always refer to the current stack frame, so they are unstable under
/// function calls/returns and switching betweens stacks of different threads!
/// We carry around the address of the `locals` buffer of the correct stack frame as a sanity
/// chec to be able to catch some cases of using a dangling `Place`.
/// check to be able to catch some cases of using a dangling `Place`.
///
/// This variant shall not be used for unsized types -- those must always live in memory.
Local { local: mir::Local, offset: Option<Size>, locals_addr: usize },
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/stack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Manages the low-level pushing and popping of stack frames and the (de)allocation of local variables.
//! For hadling of argument passing and return values, see the `call` module.
//! For handling of argument passing and return values, see the `call` module.
use std::cell::Cell;
use std::{fmt, mem};

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/base_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl fmt::Display for BaseNString {
}

// This trait just lets us reserve the exact right amount of space when doing fixed-length
// case-insensitve encoding. Add any impls you need.
// case-insensitive encoding. Add any impls you need.
pub trait ToBaseN: Into<u128> {
fn encoded_len(base: usize) -> usize;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/graph/scc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ where
// will know when we hit the state where previous_node == node.
loop {
// Back at the beginning, we can return. Note that we return the root state.
// This is becuse for components being explored, we would otherwise get a
// This is because for components being explored, we would otherwise get a
// `node_state[n] = InCycleWith{ parent: n }` and that's wrong.
if previous_node == node {
return root_state;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_data_structures/src/hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
//! or 16 bytes of the hash.
//!
//! The types in this module represent 64-bit or 128-bit hashes produced by a `StableHasher`.
//! `Hash64` and `Hash128` expose some utilty functions to encourage users to not extract the inner
//! `Hash64` and `Hash128` expose some utility functions to encourage users to not extract the inner
//! hash value as an integer type and accidentally apply varint encoding to it.
//!
//! In contrast with `Fingerprint`, users of these types cannot and should not attempt to construct
//! and decompose these types into constitutent pieces. The point of these types is only to
//! and decompose these types into constituent pieces. The point of these types is only to
//! connect the fact that they can only be produced by a `StableHasher` to their
//! `Encode`/`Decode` impls.

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_data_structures/src/sync/worker_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl RegistryId {
/// index within the registry. This panics if the current thread is not associated with this
/// registry.
///
/// Note that there's a race possible where the identifer in `THREAD_DATA` could be reused
/// Note that there's a race possible where the identifier in `THREAD_DATA` could be reused
/// so this can succeed from a different registry.
#[cfg(parallel_compiler)]
fn verify(self) -> usize {
Expand Down Expand Up @@ -50,7 +50,7 @@ struct ThreadData {
}

thread_local! {
/// A thread local which contains the identifer of `REGISTRY` but allows for faster access.
/// A thread local which contains the identifier of `REGISTRY` but allows for faster access.
/// It also holds the index of the current thread.
static THREAD_DATA: ThreadData = const { ThreadData {
registry_id: Cell::new(RegistryId(ptr::null())),
Expand All @@ -66,7 +66,7 @@ impl Registry {

/// Gets the registry associated with the current thread. Panics if there's no such registry.
pub fn current() -> Self {
REGISTRY.with(|registry| registry.get().cloned().expect("No assocated registry"))
REGISTRY.with(|registry| registry.get().cloned().expect("No associated registry"))
}

/// Registers the current thread with the registry so worker locals can be used on it.
Expand All @@ -92,7 +92,7 @@ impl Registry {
}
}

/// Gets the identifer of this registry.
/// Gets the identifier of this registry.
fn id(&self) -> RegistryId {
RegistryId(&*self.0)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0582.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
```
The latter scenario encounters this error because `Foo::Assoc<'a>` could be
implemented by a type that does not use the `'a` parameter, so there is no
guarentee that `X::Assoc<'a>` actually uses `'a`.
guarantee that `X::Assoc<'a>` actually uses `'a`.

To fix this we can pass a dummy parameter:
```
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ pub struct Subdiag {
/// - The `EmissionGuarantee`, which determines the type returned from `emit`.
///
/// Each constructed `Diag` must be consumed by a function such as `emit`,
/// `cancel`, `delay_as_bug`, or `into_diag`. A panic occurrs if a `Diag`
/// `cancel`, `delay_as_bug`, or `into_diag`. A panic occurs if a `Diag`
/// is dropped without being consumed by one of these functions.
///
/// If there is some state in a downstream crate you would like to access in
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,7 @@ impl HumanEmitter {
// For example, for the following:
// |
// 2 - .await
// 2 + (note the left over whitepsace)
// 2 + (note the left over whitespace)
// |
// We really want
// |
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ impl<'a> DiagCtxtHandle<'a> {
);
}
// We delay a bug here so that `-Ztreat-err-as-bug -Zeagerly-emit-delayed-bugs`
// can be used to create a backtrace at the stashing site insted of whenever the
// can be used to create a backtrace at the stashing site instead of whenever the
// diagnostic context is dropped and thus delayed bugs are emitted.
Error => Some(self.span_delayed_bug(span, format!("stashing {key:?}"))),
DelayedBug => {
Expand Down
Loading
Loading