Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 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
bb75ebf
loongarch: support passing `u128`/`i128` to inline assembly
heiher 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
be9b958
Rollup merge of #161858 - khyperia:ice-generic_const_parameter_types,…
JonathanBrouwer Aug 28, 2026
7012704
Rollup merge of #161377 - jnkel:fix-dylib-search-order, r=jieyouxu
JonathanBrouwer Aug 28, 2026
eefd220
Rollup merge of #161865 - heiher:inline-asm-i128, r=folkertdev
JonathanBrouwer Aug 28, 2026
8829e2c
Rollup merge of #161877 - qaijuang:156009-follow-up, r=GuillaumeGomez
JonathanBrouwer Aug 28, 2026
cdc9b48
Rollup merge of #161880 - RalfJung:rustc_lint_defs-doctests, r=Jonath…
JonathanBrouwer Aug 28, 2026
5360da2
Rollup merge of #161883 - RalfJung:doctest-internal-features, r=bjorn3
JonathanBrouwer Aug 28, 2026
47d1f24
Rollup merge of #161887 - devnexen:uefi_seekfrom_fix, r=ChrisDenton
JonathanBrouwer Aug 28, 2026
9cf6641
Rollup merge of #161897 - chenyukang:yukang/fix-contracts-ice-146834,…
JonathanBrouwer Aug 28, 2026
575608b
Rollup merge of #161909 - chenyukang:yukang-fix-161543-polonius-help-…
JonathanBrouwer Aug 28, 2026
46f3eab
Rollup merge of #161910 - GuillaumeGomez:generated-macro, r=Urgau
JonathanBrouwer Aug 28, 2026
0f19ec0
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
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
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
7 changes: 1 addition & 6 deletions library/std/src/sys/fs/uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,7 @@ impl File {
let off = match pos {
SeekFrom::Start(p) => p,
SeekFrom::End(p) => {
// Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
if p == 0 {
0xFFFFFFFFFFFFFFFF
} else {
self.file_attr()?.size().checked_add_signed(p).ok_or(NEG_OFF_ERR)?
}
self.file_attr()?.size().checked_add_signed(p).ok_or(NEG_OFF_ERR)?
}
SeekFrom::Current(p) => self.tell()?.checked_add_signed(p).ok_or(NEG_OFF_ERR)?,
};
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/src/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ fn main() {
if let Some(crate_name) = parse_value_from_args(&args, "--crate-name") {
// Add rust logo and set html root for all rustc crates.
if crate_name.starts_with("rustc_") {
cmd.arg("-Ainternal_features")
// We use `-Zcrate-attr=allow` instead of `-A` to force rustdoc to forward this flag to
// the actual doctests. Otherwise those tests all receive the
// `feature(rustdoc_internals)` without receiving the `-A` which leads to errors.
cmd.arg("-Zcrate-attr=allow(internal_features)")
.arg("-Zcrate-attr=doc(rust_logo)")
.arg("-Zcrate-attr=doc(html_root_url = \"https://doc.rust-lang.org/nightly/nightly-rustc/\")");

Expand Down
7 changes: 2 additions & 5 deletions src/bootstrap/src/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ pub fn libdir(target: TargetSelection) -> &'static str {
/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path.
/// If the dylib_path_var is already set for this cmd, the old value will be overwritten!
pub fn add_dylib_path(path: Vec<PathBuf>, cmd: &mut BootstrapCommand) {
let mut list = dylib_path();
for path in path {
list.insert(0, path);
}
cmd.env(dylib_path_var(), t!(env::join_paths(list)));
let paths = path.into_iter().chain(dylib_path());
cmd.env(dylib_path_var(), t!(env::join_paths(paths)));
}

pub struct TimeIt(bool, Instant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ This tracks support for additional registers in architectures where inline assem

| Architecture | Register class | Target feature | Allowed types |
| ------------ | -------------- | -------------- | ------------- |
| LoongArch | `vreg` | `lsx` | `f32`, `f64`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
| LoongArch | `xreg` | `lasx` | `f32`, `f64`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2`, <br> `i8x32`, `i16x16`, `i32x8`, `i64x4`, `f32x8`, `f64x4` |
| LoongArch | `vreg` | `lsx` | `i128`, `f32`, `f64`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
| LoongArch | `xreg` | `lasx` | `i128`, `f32`, `f64`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2`, <br> `i8x32`, `i16x16`, `i32x8`, `i64x4`, `f32x8`, `f64x4` |

## Register aliases

Expand Down
20 changes: 12 additions & 8 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,21 @@ pub(crate) fn get_item_path(tcx: TyCtxt<'_>, def_id: DefId, kind: ItemType) -> V
if let ItemType::Macro = kind {
// Check to see if it is a macro 2.0 or built-in macro
// More information in <https://rust-lang.github.io/rfcs/1584-macros.html>.
if matches!(
CStore::from_tcx(tcx).load_macro_untracked(tcx, def_id),
LoadedMacro::MacroDef { def, .. } if !def.macro_rules
) {
once(crate_name).chain(relative).collect()
let is_macro_2_0_or_builtin = if let Some(local_def_id) = def_id.as_local() {
let (_, macro_def, _) = tcx.hir_expect_item(local_def_id).expect_macro();
!macro_def.macro_rules
} else {
vec![crate_name, *relative.last().expect("relative was empty")]
matches!(
CStore::from_tcx(tcx).load_macro_untracked(tcx, def_id),
LoadedMacro::MacroDef { def, .. } if !def.macro_rules
)
};
if !is_macro_2_0_or_builtin {
return vec![crate_name, *relative.last().expect("relative was empty")];
}
} else {
once(crate_name).chain(relative).collect()
}

once(crate_name).chain(relative).collect()
}

/// Record an external fully qualified name in the external_paths cache.
Expand Down
1 change: 1 addition & 0 deletions tests/run-make/rustc-help/polonius-help.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Z polonius=val -- enable polonius-based borrow-checker (default: next)
6 changes: 6 additions & 0 deletions tests/run-make/rustc-help/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ fn main() {
// Check that all help options can be invoked at once
let codegen_help = bare_rustc().arg("-Chelp").run().stdout_utf8();
let unstable_help = bare_rustc().arg("-Zhelp").run().stdout_utf8();
let polonius_help =
format!("{}\n", unstable_help.lines().find(|line| line.contains("polonius=val")).unwrap());
diff()
.expected_file("polonius-help.stdout")
.actual_text("rustc -Zhelp (polonius)", &polonius_help)
.run();
let lints_help = bare_rustc().arg("-Whelp").run().stdout_utf8();
let expected_all = format!("{help}{codegen_help}{unstable_help}{lints_help}");
let all_help = bare_rustc().args(["--help", "-Chelp", "-Zhelp", "-Whelp"]).run().stdout_utf8();
Expand Down
17 changes: 17 additions & 0 deletions tests/rustdoc-html/auxiliary/generated_macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ no-prefer-dynamic

#![crate_type = "proc-macro"]

use std::str::FromStr;

extern crate proc_macro;

#[proc_macro_derive(MyDeriveMacro)]
pub fn derive_my_derive_macro(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
proc_macro::TokenStream::from_str("
#[macro_export]
macro_rules! my_generated_macro {
($my_macro_parameter: expr) => {};
}
").unwrap()
}
16 changes: 16 additions & 0 deletions tests/rustdoc-html/generated_macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This test ensures that the macro generated by the proc macro has the correct
// "item-decl" code block.
// Regression test for <https://github.com/rust-lang/rust/issues/79289>.

//@ aux-build:generated_macro.rs

#![crate_name = "foo"]

extern crate generated_macro;

//@ has 'foo/macro.my_generated_macro.html'
//@ matches - '//*[@class="rust item-decl"]/code' \
// 'macro_rules! my_generated_macro \{\s+\(\$my_macro_parameter:expr\) => \{ ... \};\s+\}'

#[derive(generated_macro::MyDeriveMacro)]
struct MyStruct {}
13 changes: 13 additions & 0 deletions tests/rustdoc-ui/lints/redundant-explicit-links-ice.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Regression test for <https://github.com/rust-lang/rust/issues/161837>.

//@ run-rustfix

#![deny(rustdoc::redundant_explicit_links)]

//! [queue]
//~^ ERROR redundant explicit link target

#[macro_export]
macro_rules! queue {
() => {};
}
13 changes: 13 additions & 0 deletions tests/rustdoc-ui/lints/redundant-explicit-links-ice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Regression test for <https://github.com/rust-lang/rust/issues/161837>.

//@ run-rustfix

#![deny(rustdoc::redundant_explicit_links)]

//! [queue](macro.queue.html)
//~^ ERROR redundant explicit link target

#[macro_export]
macro_rules! queue {
() => {};
}
23 changes: 23 additions & 0 deletions tests/rustdoc-ui/lints/redundant-explicit-links-ice.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
error: redundant explicit link target
--> $DIR/redundant-explicit-links-ice.rs:7:13
|
LL | //! [queue](macro.queue.html)
| ----- ^^^^^^^^^^^^^^^^ explicit target is redundant
| |
| because label contains path that resolves to same destination
|
= note: when a link's destination is not specified,
the label is used to resolve intra-doc links
note: the lint level is defined here
--> $DIR/redundant-explicit-links-ice.rs:5:9
|
LL | #![deny(rustdoc::redundant_explicit_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove explicit link target
|
LL - //! [queue](macro.queue.html)
LL + //! [queue]
|

error: aborting due to 1 previous error

Loading
Loading