Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
67e8a19
[bootstrap] Don't reverse the order of dylib search path entries
jnkel Aug 19, 2026
37aaf5c
forward global target features to module-level assembly
folkertdev Aug 5, 2026
8ceed4d
Document PartialOrd behavior for Option<T> where T: PartialOrd
zepredos Aug 26, 2026
3fec803
Formatting changes for HTML tag errors
zepredos Aug 26, 2026
bb75ebf
loongarch: support passing `u128`/`i128` to inline assembly
heiher Aug 27, 2026
97fe424
Change the doc comments to link to the relevant doc section
zepredos Aug 27, 2026
a1fb7b3
add test
qaijuang Aug 27, 2026
0f08915
do not load macro metadata for local definitions in rustdoc
qaijuang Aug 27, 2026
42629e3
better deal with internal features being injected into doctests
RalfJung Aug 27, 2026
a0ec511
fix rustc_lint_defs doctest issues
RalfJung Aug 27, 2026
cdd3fc0
std: uefi: fix File::seek returning the EOF sentinel
devnexen Aug 27, 2026
65184e6
compiler: Allow safestack to be togglable via #[sanitize(safestack = …
PiJoules Aug 27, 2026
0717387
Make list alphabetical
PiJoules Aug 27, 2026
7047ae8
Add regression test for empty contract attributes with lifetime lints
chenyukang Aug 28, 2026
12f970e
Reject contract attributes without arguments
chenyukang Aug 28, 2026
d471202
fix ICE in generic_const_parameter_types with inherents
khyperia Aug 28, 2026
66bbc14
Add rustdoc-html regression test for generated macro
GuillaumeGomez Aug 28, 2026
448757d
Retroactively add relnotes for `bool::{ok_or,ok_or_else}`
jieyouxu Aug 28, 2026
55e9af5
Windows: note normalize_lexically slash behaviour
ChrisDenton Aug 28, 2026
841df3c
Change `rustc_middle/src/hooks/mod.rs` to `hooks.rs`
Zalathar Aug 28, 2026
d3b2959
Clarify None and Some comparisons in docs
zepredos Aug 28, 2026
d20d512
std: optimize IO error formatting
joboet Aug 28, 2026
aee52d7
implement [u8]::split_ascii_whitespace
malezjaa Aug 28, 2026
af94503
Rollup merge of #161945 - joboet:format_error, r=hanna-kruppe
jhpratt Aug 29, 2026
aea48c1
Rollup merge of #160594 - folkertdev:asm-forward-target-features, r=n…
jhpratt Aug 29, 2026
dc859fc
Rollup merge of #161577 - malezjaa:u8_split_ascii_whitespace, r=nia-e
jhpratt Aug 29, 2026
1a002cf
Rollup merge of #161858 - khyperia:ice-generic_const_parameter_types,…
jhpratt Aug 29, 2026
80040c6
Rollup merge of #161377 - jnkel:fix-dylib-search-order, r=jieyouxu
jhpratt Aug 29, 2026
631e6c5
Rollup merge of #161804 - zepredos:doc-option-partialord-fix, r=nia-e
jhpratt Aug 29, 2026
2178e3f
Rollup merge of #161865 - heiher:inline-asm-i128, r=folkertdev
jhpratt Aug 29, 2026
8daf5f2
Rollup merge of #161877 - qaijuang:156009-follow-up, r=GuillaumeGomez
jhpratt Aug 29, 2026
1ebcedc
Rollup merge of #161880 - RalfJung:rustc_lint_defs-doctests, r=Jonath…
jhpratt Aug 29, 2026
f2bab44
Rollup merge of #161883 - RalfJung:doctest-internal-features, r=bjorn3
jhpratt Aug 29, 2026
35fe30f
Rollup merge of #161887 - devnexen:uefi_seekfrom_fix, r=ChrisDenton
jhpratt Aug 29, 2026
36a684f
Rollup merge of #161888 - PiJoules:sanitize-safestack-togglable, r=ad…
jhpratt Aug 29, 2026
e6c5ef0
Rollup merge of #161897 - chenyukang:yukang/fix-contracts-ice-146834,…
jhpratt Aug 29, 2026
b334066
Rollup merge of #161910 - GuillaumeGomez:generated-macro, r=Urgau
jhpratt Aug 29, 2026
ada6c54
Rollup merge of #161914 - jieyouxu:relnotes-1.98.0-bool, r=BoxyUwU
jhpratt Aug 29, 2026
b21cc0d
Rollup merge of #161924 - ChrisDenton:lexically-slash, r=JohnTitor
jhpratt Aug 29, 2026
dc429cf
Rollup merge of #161927 - Zalathar:hooks, r=nnethercote
jhpratt Aug 29, 2026
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
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Stabilized APIs
- [`Atomic<T>::get_mut_slice`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.Atomic.html#method.get_mut_slice)
- [`Atomic<T>::from_mut_slice`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.Atomic.html#method.from_mut_slice)
- [`std::range::legacy`](https://doc.rust-lang.org/stable/std/range/legacy/index.html)
- [`bool::ok_or`](https://doc.rust-lang.org/stable/std/primitive.bool.html#method.ok_or)
- [`bool::ok_or_else`](https://doc.rust-lang.org/stable/std/primitive.bool.html#method.ok_or_else)


<a id="1.98.0-Compatibility-Notes"></a>
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_arena/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![cfg_attr(bootstrap, feature(never_type))]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)]
#![doc(test(no_crate_inject, attr(deny(warnings), allow(internal_features))))]
#![doc(test(no_crate_inject, attr(deny(warnings))))]
#![feature(decl_macro)]
#![feature(dropck_eyepatch)]
#![feature(rustc_attrs)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! This API is completely unstable and subject to change.

// tidy-alphabetical-start
#![doc(test(attr(deny(warnings), allow(internal_features))))]
#![doc(test(attr(deny(warnings))))]
#![feature(associated_type_defaults)]
#![feature(deref_patterns)]
#![feature(iter_order_by)]
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ impl SingleAttributeParser for SanitizeParser {
r#"kcfi = "on|off""#,
r#"memory = "on|off""#,
r#"memtag = "on|off""#,
r#"safestack = "on|off""#,
r#"shadow_call_stack = "on|off""#,
r#"thread = "on|off""#,
r#"realtime = "nonblocking|blocking|caller""#,
Expand Down Expand Up @@ -717,6 +718,7 @@ impl SingleAttributeParser for SanitizeParser {
sym::kcfi => apply(SanitizerSet::KCFI),
sym::memory => apply(SanitizerSet::MEMORY),
sym::memtag => apply(SanitizerSet::MEMTAG),
sym::safestack => apply(SanitizerSet::SAFESTACK),
sym::shadow_call_stack => apply(SanitizerSet::SHADOWCALLSTACK),
sym::thread => apply(SanitizerSet::THREAD),
sym::hwaddress | sym::kernel_hwaddress => {
Expand All @@ -743,6 +745,7 @@ impl SingleAttributeParser for SanitizeParser {
sym::kcfi,
sym::memory,
sym::memtag,
sym::safestack,
sym::shadow_call_stack,
sym::thread,
sym::hwaddress,
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_builtin_macros/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ fn expand_contract_clause_tts(
annotated: TokenStream,
clause_keyword: rustc_span::Symbol,
) -> Result<TokenStream, ErrorGuaranteed> {
if annotation.is_empty() {
let (name, example) = if clause_keyword == kw::ContractRequires {
("requires", "condition")
} else {
("ensures", "|result: &T| condition")
};
ecx.sess.dcx().span_err(
attr_span,
format!("`{name}` attribute requires an argument, e.g., `#[{name}({example})]`"),
);
// Returning `Err` would replace it with a dummy fragment and cause cascading name-resolution errors.
// Instead, we return the original token stream so that there is no later noises.
return Ok(annotated);
}

let feature_span = ecx.with_def_site_ctxt(attr_span);
expand_contract_clause(ecx, attr_span, annotated, |new_tts| {
new_tts.push(TokenTree::Token(
Expand Down
12 changes: 10 additions & 2 deletions compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use rustc_target::spec::HasTargetSpec;
use smallvec::SmallVec;
use tracing::debug;

use crate::attributes;
use crate::builder::Builder;
use crate::common::Funclet;
use crate::context::CodegenCx;
use crate::llvm::{self, ToLlvmBool, Type, Value};
use crate::type_of::LayoutLlvmExt;
use crate::{attributes, llvm_util};

impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
fn codegen_inline_asm(
Expand Down Expand Up @@ -499,7 +499,15 @@ impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
template_str.push_str("\n.att_syntax\n");
}

llvm::append_module_inline_asm(self.llmod, template_str.as_bytes());
let target_features = self.tcx.global_backend_features(()).join(",");
let target_cpu = llvm_util::target_cpu(self.tcx.sess);

llvm::append_module_inline_asm(
self.llmod,
template_str.as_bytes(),
&target_features,
target_cpu,
);
}

fn mangled_name(&self, instance: Instance<'tcx>) -> String {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,9 @@ fn embed_bitcode(
// We need custom section flags, so emit module-level inline assembly.
let section_flags = if cgcx.is_pe_coff { "n" } else { "e" };
let asm = create_section_with_flags_asm(".llvmbc", section_flags, bitcode);
llvm::append_module_inline_asm(llmod, &asm);
llvm::append_module_inline_asm(llmod, &asm, "", "");
let asm = create_section_with_flags_asm(".llvmcmd", section_flags, &[]);
llvm::append_module_inline_asm(llmod, &asm);
llvm::append_module_inline_asm(llmod, &asm, "", "");
}
}

Expand Down
18 changes: 11 additions & 7 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,13 +907,6 @@ unsafe extern "C" {
pub(crate) fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char;
pub(crate) fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);

/// Append inline assembly to a module. See `Module::appendModuleInlineAsm`.
pub(crate) fn LLVMAppendModuleInlineAsm(
M: &Module,
Asm: *const c_uchar, // See "PTR_LEN_STR".
Len: size_t,
);

/// Create the specified uniqued inline asm string. See `InlineAsm::get()`.
pub(crate) fn LLVMGetInlineAsm<'ll>(
Ty: &'ll Type,
Expand Down Expand Up @@ -2119,6 +2112,17 @@ unsafe extern "C" {
ConstraintsLen: size_t,
) -> bool;

/// Append inline assembly to a module. See `Module::appendModuleInlineAsm`.
pub(crate) fn LLVMRustAppendModuleInlineAsm(
M: &Module,
Asm: *const c_uchar, // See "PTR_LEN_STR".
AsmLen: size_t,
TargetFeatures: *const c_uchar, // See "PTR_LEN_STR".
TargetFeaturesLen: size_t,
TargetCpu: *const c_uchar, // See "PTR_LEN_STR".
TargetCpuLen: size_t,
);

/// A list of pointer-length strings is passed as two pointer-length slices,
/// one slice containing pointers and one slice containing their corresponding
/// lengths. The implementation will check that both slices have the same length.
Expand Down
19 changes: 16 additions & 3 deletions compiler/rustc_codegen_llvm/src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,24 @@ pub(crate) fn set_dso_local<'ll>(v: &'ll Value) {
}
}

/// Safe wrapper for `LLVMAppendModuleInlineAsm`, which delegates to
/// Safe wrapper for `LLVMRustAppendModuleInlineAsm`, which delegates to
/// `Module::appendModuleInlineAsm`.
pub(crate) fn append_module_inline_asm<'ll>(llmod: &'ll Module, asm: &[u8]) {
pub(crate) fn append_module_inline_asm<'ll>(
llmod: &'ll Module,
asm: &[u8],
target_features: &str,
target_cpu: &str,
) {
unsafe {
LLVMAppendModuleInlineAsm(llmod, asm.as_ptr(), asm.len());
LLVMRustAppendModuleInlineAsm(
llmod,
asm.as_ptr(),
asm.len(),
target_features.as_ptr(),
target_features.len(),
target_cpu.as_ptr(),
target_cpu.len(),
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_graphviz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
//! * [DOT language](https://www.graphviz.org/doc/info/lang.html)

// tidy-alphabetical-start
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
// tidy-alphabetical-end

use std::borrow::Cow;
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ declare_lint! {
///
/// ### Example
///
/// ```rust
/// ```rust,compile_fail
/// #![deny(dead_code_pub_in_binary)]
///
/// pub fn unused_pub_fn() {}
Expand Down Expand Up @@ -1132,9 +1132,9 @@ declare_lint! {
///
/// ### Example
///
/// ```rust
/// ```rust,compile_fail
/// #![deny(warnings)]
/// fn foo() {}
/// struct non_standard_name;
/// ```
///
/// {{produces}}
Expand Down
14 changes: 14 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,20 @@ extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
}

extern "C" void LLVMRustAppendModuleInlineAsm(
LLVMModuleRef M, const char *Asm, size_t AsmLen, const char *TargetFeatures,
size_t TargetFeaturesLen, const char *TargetCPU, size_t TargetCPULen) {
#if LLVM_VERSION_GE(23, 0)
Module::GlobalAsmProperties Props;
Props.TargetFeatures = std::string(TargetFeatures, TargetFeaturesLen);
Props.TargetCPU = std::string(TargetCPU, TargetCPULen);
unwrap(M)->appendModuleInlineAsm(
Module::GlobalAsmFragment(std::string(Asm, AsmLen), Props));
#else
unwrap(M)->appendModuleInlineAsm(StringRef(Asm, AsmLen));
#endif
}

template <typename DIT> DIT *unwrapDIPtr(LLVMMetadataRef Ref) {
return (DIT *)(Ref ? unwrap<Metadata>(Ref) : nullptr);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// We want to be able to build this crate with a stable compiler,
// so no `#![feature]` attributes should be added.
#![deny(unstable_features)]
#![doc(test(attr(deny(warnings), allow(internal_features))))]
#![doc(test(attr(deny(warnings))))]
// tidy-alphabetical-end

use std::ops::Range;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_public/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
//! For more information, see <https://github.com/rust-lang/rustc_public>.

#![allow(rustc::usage_of_ty_tykind)]
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
#![feature(sized_hierarchy)]

use std::fmt::Debug;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_public_bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// tidy-alphabetical-start
#![allow(rustc::usage_of_ty_tykind)]
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
#![feature(trait_alias)]
// tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_serialize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(internal_features)]
#![allow(rustc::internal)]
#![cfg_attr(bootstrap, feature(never_type))]
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
#![feature(core_intrinsics)]
#![feature(min_specialization)]
#![feature(nonzero_internals)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ symbols! {
s390x,
s390x_target_feature,
s390x_target_feature_vector,
safestack,
safety,
sanitize,
sanitizer_cfi_generalize_pointers,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/asm/loongarch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl LoongArchInlineAsmRegClass {
(Self::vreg, _) => {
if allow_experimental_reg {
types! {
lsx: F16, F32, F64,
lsx: I128, F16, F32, F64,
VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF32(4), VecF64(2);
}
} else {
Expand All @@ -63,7 +63,7 @@ impl LoongArchInlineAsmRegClass {
(Self::xreg, _) => {
if allow_experimental_reg {
types! {
lasx: F16, F32, F64,
lasx: I128, F16, F32, F64,
VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF32(4), VecF64(2),
VecI8(32), VecI16(16), VecI32(8), VecI64(4), VecF32(8), VecF64(4);
}
Expand Down
12 changes: 0 additions & 12 deletions compiler/rustc_traits/src/normalize_projection_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ fn normalize_canonicalized_projection<'tcx>(
0,
&mut obligations,
);
obligations.extend(const_arg_has_type_obligation(
tcx,
param_env,
normalized_term,
goal,
));
ocx.register_obligations(obligations);
// #112047: With projections and opaques, we are able to create opaques that
// are recursive (given some generic parameters of the opaque's type variables).
Expand Down Expand Up @@ -147,12 +141,6 @@ fn normalize_canonicalized_inherent_projection<'tcx>(
0,
&mut obligations,
);
obligations.extend(const_arg_has_type_obligation(
tcx,
param_env,
normalized_term,
goal,
));
ocx.register_obligations(obligations);

Ok(NormalizationResult { normalized_term })
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/internal_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ macro_rules! forward_ref_op_assign {
macro_rules! impl_fn_for_zst {
($(
$( #[$attr: meta] )*
struct $Name: ident impl$( <$( $lifetime : lifetime ),+> )? Fn =
$vis:vis struct $Name: ident impl$( <$( $lifetime : lifetime ),+> )? Fn =
|$( $arg: ident: $ArgTy: ty ),*| -> $ReturnTy: ty
$body: block;
)+) => {
$(
$( #[$attr] )*
struct $Name;
$vis struct $Name;

impl $( <$( $lifetime ),+> )? Fn<($( $ArgTy, )*)> for $Name {
#[inline]
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,8 @@ const impl<T: [const] PartialEq> PartialEq for Option<T> {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
const impl<T: [const] PartialOrd> PartialOrd for Option<T> {
/// See [the documentation](https://doc.rust-lang.org/std/option/#comparison-operators) for details.
/// [`None`] always compares less than any [`Some`]
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
match (self, other) {
Expand Down
Loading
Loading