Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
babe876
Refactored std::fs::set_permissions_nofollow docs clarifying behavior…
asder8215 Jul 29, 2026
dc3bf29
Refactored documentation for std::fs::set_permissions_nofollow, refac…
asder8215 Jul 30, 2026
23e3888
Add fallback behavior on Linux to use open + fchmod if fchmodat retur…
asder8215 Aug 10, 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
c7b10b4
Refactored set_perm_nofollow and have it written so that all supporte…
asder8215 Aug 16, 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
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
9c6ebca
Add regression test for the Polonius help default
chenyukang Aug 28, 2026
d471202
fix ICE in generic_const_parameter_types with inherents
khyperia Aug 28, 2026
f31b77f
Report the configured Polonius default in -Z help
chenyukang 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
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
8d6c140
Rollup merge of #160170 - asder8215:docs_set_perms_nofollow, r=clarfo…
JonathanBrouwer Aug 28, 2026
61eaa14
Rollup merge of #161945 - joboet:format_error, r=hanna-kruppe
JonathanBrouwer Aug 28, 2026
aa7d39f
Rollup merge of #160594 - folkertdev:asm-forward-target-features, r=n…
JonathanBrouwer Aug 28, 2026
c2fec88
Rollup merge of #161577 - malezjaa:u8_split_ascii_whitespace, r=nia-e
JonathanBrouwer Aug 28, 2026
24f7e55
Rollup merge of #161858 - khyperia:ice-generic_const_parameter_types,…
JonathanBrouwer Aug 28, 2026
5391227
Rollup merge of #161377 - jnkel:fix-dylib-search-order, r=jieyouxu
JonathanBrouwer Aug 28, 2026
68b6251
Rollup merge of #161804 - zepredos:doc-option-partialord-fix, r=nia-e
JonathanBrouwer Aug 28, 2026
77969f0
Rollup merge of #161865 - heiher:inline-asm-i128, r=folkertdev
JonathanBrouwer Aug 28, 2026
741a95e
Rollup merge of #161877 - qaijuang:156009-follow-up, r=GuillaumeGomez
JonathanBrouwer Aug 28, 2026
ac53428
Rollup merge of #161880 - RalfJung:rustc_lint_defs-doctests, r=Jonath…
JonathanBrouwer Aug 28, 2026
8905295
Rollup merge of #161883 - RalfJung:doctest-internal-features, r=bjorn3
JonathanBrouwer Aug 28, 2026
f92553f
Rollup merge of #161887 - devnexen:uefi_seekfrom_fix, r=ChrisDenton
JonathanBrouwer Aug 28, 2026
f26d0d3
Rollup merge of #161897 - chenyukang:yukang/fix-contracts-ice-146834,…
JonathanBrouwer Aug 28, 2026
a65f604
Rollup merge of #161909 - chenyukang:yukang-fix-161543-polonius-help-…
JonathanBrouwer Aug 28, 2026
6bfe371
Rollup merge of #161910 - GuillaumeGomez:generated-macro, r=Urgau
JonathanBrouwer Aug 28, 2026
2c14dc0
Rollup merge of #161914 - jieyouxu:relnotes-1.98.0-bool, r=BoxyUwU
JonathanBrouwer Aug 28, 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
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
5 changes: 4 additions & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3647,11 +3647,14 @@ pub enum Polonius {

impl Default for Polonius {
fn default() -> Self {
if option_env!("CFG_DEFAULT_POLONIUS_NEXT").is_some() { Self::Next } else { Self::Off }
Self::DEFAULT
}
}

impl Polonius {
pub(crate) const DEFAULT: Self =
if option_env!("CFG_DEFAULT_POLONIUS_NEXT").is_some() { Self::Next } else { Self::Off };

/// Returns whether the legacy version of polonius is enabled
pub fn is_legacy_enabled(&self) -> bool {
matches!(self, Polonius::Legacy)
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ macro_rules! options {
$( { TARGET_MODIFIER: $tmod_variant:ident } )?
$( { MITIGATION: $mitigation_variant:ident } )?
,
$desc:literal
$desc:expr
$(, removed: $removed:ident )?
),
)*
Expand Down Expand Up @@ -2350,6 +2350,12 @@ options! {
// - src/doc/rustc/src/codegen-options/index.md
}

const POLONIUS_HELP: &str = match Polonius::DEFAULT {
Polonius::Off => "enable polonius-based borrow-checker (default: no)",
Polonius::Next => "enable polonius-based borrow-checker (default: next)",
Polonius::Legacy => panic!("Polonius::Legacy is not a valid default value"),
};

options! {
UnstableOptions, UnstableOptionsTargetModifiers, Z_OPTIONS, dbopts, "Z", "unstable",

Expand Down Expand Up @@ -2750,7 +2756,7 @@ options! {
`vt-ptr-type-discrimination - incorporate type discrimination in authenticated vtable pointers
Example: `-Zpointer-authentication=+calls,-init-fini`."),
polonius: Polonius = (Polonius::default(), parse_polonius, [TRACKED],
"enable polonius-based borrow-checker (default: no)"),
POLONIUS_HELP),
pre_link_arg: (/* redirected to pre_link_args */) = ((), parse_string_push, [UNTRACKED],
"a single extra argument to prepend the linker invocation (can be used several times)"),
pre_link_args: Vec<String> = (Vec::new(), parse_list, [UNTRACKED],
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