Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5ac90c6
Clarify ascii whitespace exclusion of vertical tab in the doc
krtab Apr 3, 2026
baf246f
gate tuple const params behind adt_const_params
zedddie Apr 6, 2026
a4c4944
A couple small comment cleanups, and update tests.
jackh726 Apr 11, 2026
b52a38d
Add link to Unicode White_Space property
krtab Apr 13, 2026
c681ae6
For supertrait-shadowing tests, assert str rather than println
jackh726 Apr 13, 2026
9a9f5b5
gate primitives behind `min_adt_const_params`; change suggestion to `…
zedddie Apr 11, 2026
fb9e970
explicit-tail-calls: disable two tests on LoongArch
durin42 Apr 13, 2026
7d4b12b
Add lexer test for vertical tab as Pattern_White_Space whitespace
Sandijigs Apr 14, 2026
15fd168
Tests for precise-capture through RPIT and TAIT
Zalathar Apr 14, 2026
05081b9
fix arch names in cfg pretty printer
usamoi Apr 14, 2026
97761a0
docs: move PATH search details under Platform-specific behavior, add …
Albab-Hasan Apr 14, 2026
c8c4f02
Delete unused `rustc_trait_selection` errors.
mejrs Apr 14, 2026
a34d15f
Update library/std/src/process.rs
Albab-Hasan Apr 14, 2026
0a0dc9e
remove ibraheemdev from review rotation
WaffleLapkin Apr 14, 2026
2598b50
remove PointeeParser
Bryntet Apr 14, 2026
10cff15
`BorrowedBuf`: Update outdated safety comments in `set_init` users.
briansmith Apr 14, 2026
f093767
Remove dead diagnostic structs.
nnethercote Apr 14, 2026
c636323
Rollup merge of #154882 - zedddie:gate-tuple-const-params, r=BoxyUwU
jhpratt Apr 15, 2026
de84f87
Rollup merge of #155259 - durin42:llvm-23-loongarch-tailcall, r=cheny…
jhpratt Apr 15, 2026
4886550
Rollup merge of #155293 - usamoi:rustdoc-loongarch, r=GuillaumeGomez
jhpratt Apr 15, 2026
85c11f6
Rollup merge of #155314 - briansmith:b/comments, r=joshtriplett
jhpratt Apr 15, 2026
3f19aa5
Rollup merge of #153469 - Albab-Hasan:doc/command-path-search-behavio…
jhpratt Apr 15, 2026
78a1300
Rollup merge of #154765 - krtab:doc_ascii_whitespace, r=Mark-Simulacr…
jhpratt Apr 15, 2026
5cff48a
Rollup merge of #155172 - jackh726:supertrait-shadowing-cleanup, r=lcnr
jhpratt Apr 15, 2026
07f5dca
Rollup merge of #155279 - Sandijigs:test/lexer-unicode-pattern-white-…
jhpratt Apr 15, 2026
900e3a7
Rollup merge of #155280 - Zalathar:opaque-capture-bug, r=JonathanBrouwer
jhpratt Apr 15, 2026
3002472
Rollup merge of #155301 - mejrs:dead, r=nnethercote
jhpratt Apr 15, 2026
edeacdd
Rollup merge of #155303 - WaffleLapkin:ibraheemdev, r=tgross35
jhpratt Apr 15, 2026
e20fc9c
Rollup merge of #155304 - Bryntet:remove-pointee-parser, r=JonathanBr…
jhpratt Apr 15, 2026
aeaa849
Rollup merge of #155319 - nnethercote:rm-dead-error-structs, r=Kivooeo
jhpratt Apr 15, 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
10 changes: 1 addition & 9 deletions compiler/rustc_attr_parsing/src/attributes/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use super::prelude::*;
use crate::attributes::{NoArgsAttributeParser, OnDuplicate, SingleAttributeParser};
use crate::context::{AcceptContext, Stage};
use crate::parser::ArgParser;
use crate::target_checking::AllowedTargets;
use crate::target_checking::Policy::{Allow, Warn};
use crate::target_checking::{ALL_TARGETS, AllowedTargets};

pub(crate) struct RustcSkipDuringMethodDispatchParser;
impl<S: Stage> SingleAttributeParser<S> for RustcSkipDuringMethodDispatchParser {
Expand Down Expand Up @@ -141,11 +141,3 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
AllowedTargets::AllowList(&[Allow(Target::Struct), Allow(Target::Trait)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Fundamental;
}

pub(crate) struct PointeeParser;
impl<S: Stage> NoArgsAttributeParser<S> for PointeeParser {
const PATH: &[Symbol] = &[sym::pointee];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Pointee;
}
1 change: 0 additions & 1 deletion compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ attribute_parsers!(
Single<WithoutArgs<PanicHandlerParser>>,
Single<WithoutArgs<PanicRuntimeParser>>,
Single<WithoutArgs<PinV2Parser>>,
Single<WithoutArgs<PointeeParser>>,
Single<WithoutArgs<PreludeImportParser>>,
Single<WithoutArgs<ProcMacroAttributeParser>>,
Single<WithoutArgs<ProcMacroParser>>,
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,9 +1233,6 @@ pub enum AttributeKind {
/// Represents `#[pin_v2]`
PinV2(Span),

/// Represents `#[pointee]`
Pointee(Span),

/// Represents `#[prelude_import]`
PreludeImport,

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/attrs/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ impl AttributeKind {
Path(..) => No,
PatternComplexityLimit { .. } => No,
PinV2(..) => Yes,
Pointee(..) => No,
PreludeImport => No,
ProcMacro(..) => No,
ProcMacroAttribute(..) => No,
Expand Down
8 changes: 5 additions & 3 deletions compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
) => None,
Err(ConstParamTyImplementationError::UnsizedConstParamsFeatureRequired) => {
Some(vec![
(adt_const_params_feature_string, sym::adt_const_params),
(adt_const_params_feature_string, sym::min_adt_const_params),
(
" references to implement the `ConstParamTy` trait".into(),
sym::unsized_const_params,
Expand All @@ -931,11 +931,13 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er

ty_is_local(ty).then_some(vec![(
adt_const_params_feature_string,
sym::adt_const_params,
sym::min_adt_const_params,
)])
}
// Implements `ConstParamTy`, suggest adding the feature to enable.
Ok(..) => Some(vec![(adt_const_params_feature_string, sym::adt_const_params)]),
Ok(..) => {
Some(vec![(adt_const_params_feature_string, sym::min_adt_const_params)])
}
};
if let Some(features) = may_suggest_feature {
tcx.disabled_nightly_features(&mut diag, features);
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2377,8 +2377,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
continue;
}

// This pick is not a supertrait of the `child_pick`.
// Check if it's a subtrait of the `child_pick`, instead.
// This candidate is not a supertrait of the `child_trait`.
// Check if it's a subtrait of the `child_trait`, instead.
// If it is, then it must have been a subtrait of every
// other pick we've eliminated at this point. It will
// take over at this point.
Expand All @@ -2392,7 +2392,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
continue;
}

// `child_pick` is not a supertrait of this pick.
// Neither `child_trait` or the current candidate are
// supertraits of each other.
// Don't bail here, since we may be comparing two supertraits
// of a common subtrait. These two supertraits won't be related
// at all, but we will pick them up next round when we find their
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,6 @@ pub struct ConflictingAllocErrorHandler {
)]
pub struct GlobalAllocRequired;

#[derive(Diagnostic)]
#[diag(
"the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}`"
)]
pub struct NoTransitiveNeedsDep<'a> {
pub crate_name: Symbol,
pub needs_crate_name: &'a str,
pub deps_crate_name: Symbol,
}

#[derive(Diagnostic)]
#[diag("failed to write {$filename}: {$err}")]
pub struct FailedWriteError {
Expand Down
15 changes: 0 additions & 15 deletions compiler/rustc_middle/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ pub(crate) struct OpaqueHiddenTypeMismatch<'tcx> {
pub sub: TypeMismatchReason,
}

#[derive(Diagnostic)]
#[diag("we don't support unions yet: '{$ty_name}'")]
pub struct UnsupportedUnion {
pub ty_name: String,
}

// FIXME(autodiff): I should get used somewhere
#[derive(Diagnostic)]
#[diag("reading from a `Duplicated` const {$ty} is unsafe")]
pub struct AutodiffUnsafeInnerConstRef<'tcx> {
#[primary_span]
pub span: Span,
pub ty: Ty<'tcx>,
}

#[derive(Subdiagnostic)]
pub enum TypeMismatchReason {
#[label("this expression supplies two conflicting concrete types for the same opaque type")]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| AttributeKind::Path(..)
| AttributeKind::PatternComplexityLimit { .. }
| AttributeKind::PinV2(..)
| AttributeKind::Pointee(..)
| AttributeKind::PreludeImport
| AttributeKind::ProfilerRuntime
| AttributeKind::RecursionLimit { .. }
Expand Down
63 changes: 0 additions & 63 deletions compiler/rustc_trait_selection/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ pub struct UnableToConstructConstantValue<'a> {
pub unevaluated: ty::UnevaluatedConst<'a>,
}

#[derive(Diagnostic)]
#[diag("this attribute must have a value", code = E0232)]
#[note("e.g. `#[rustc_on_unimplemented(message=\"foo\")]`")]
pub struct NoValueInOnUnimplemented {
#[primary_span]
#[label("expected value here")]
pub span: Span,
}

pub struct NegativePositiveConflict<'tcx> {
pub impl_span: Span,
pub trait_desc: ty::TraitRef<'tcx>,
Expand Down Expand Up @@ -1201,60 +1192,6 @@ pub struct TraitImplDiff {
pub found: String,
}

pub struct DynTraitConstraintSuggestion {
pub span: Span,
pub ident: Ident,
}

impl Subdiagnostic for DynTraitConstraintSuggestion {
fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
let mut multi_span: MultiSpan = vec![self.span].into();
multi_span.push_span_label(
self.span,
msg!("this has an implicit `'static` lifetime requirement"),
);
multi_span.push_span_label(
self.ident.span,
msg!("calling this method introduces the `impl`'s `'static` requirement"),
);
let msg = msg!("the used `impl` has a `'static` requirement");
diag.span_note(multi_span, msg);
let msg = msg!("consider relaxing the implicit `'static` requirement");
diag.span_suggestion_verbose(
self.span.shrink_to_hi(),
msg,
" + '_",
Applicability::MaybeIncorrect,
);
}
}

pub struct ReqIntroducedLocations {
pub span: MultiSpan,
pub spans: Vec<Span>,
pub fn_decl_span: Span,
pub cause_span: Span,
pub add_label: bool,
}

impl Subdiagnostic for ReqIntroducedLocations {
fn add_to_diag<G: EmissionGuarantee>(mut self, diag: &mut Diag<'_, G>) {
for sp in self.spans {
self.span.push_span_label(sp, msg!("`'static` requirement introduced here"));
}

if self.add_label {
self.span.push_span_label(
self.fn_decl_span,
msg!("requirement introduced by this return type"),
);
}
self.span.push_span_label(self.cause_span, msg!("because of this returned expression"));
let msg = msg!("\"`'static` lifetime requirement introduced by the return type");
diag.span_note(self.span, msg);
}
}

#[derive(Diagnostic)]
#[diag("{$has_param_name ->
[true] `{$param_name}`
Expand Down
3 changes: 3 additions & 0 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,9 @@ impl char {
/// U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED,
/// U+000C FORM FEED, or U+000D CARRIAGE RETURN.
///
/// **Warning:** Because the list above excludes U+000B VERTICAL TAB,
/// `c.is_ascii_whitespace()` is **not** equivalent to `c.is_ascii() && c.is_whitespace()`.
///
/// Rust uses the WhatWG Infra Standard's [definition of ASCII
/// whitespace][infra-aw]. There are several other definitions in
/// wide use. For instance, [the POSIX locale][pct] includes
Expand Down
6 changes: 5 additions & 1 deletion library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,13 @@ pub macro ConstParamTy($item:item) {
/* compiler built-in */
}

// For `adt_const_params` to be recognized as a feature
#[unstable(feature = "adt_const_params", issue = "95174")]
const _: () = ();

// FIXME(adt_const_params): handle `ty::FnDef`/`ty::Closure`
marker_impls! {
#[unstable(feature = "adt_const_params", issue = "95174")]
#[unstable(feature = "min_adt_const_params", issue = "154042")]
ConstParamTy_ for
usize, u8, u16, u32, u64, u128,
isize, i8, i16, i32, i64, i128,
Expand Down
3 changes: 3 additions & 0 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ impl u8 {
/// U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED,
/// U+000C FORM FEED, or U+000D CARRIAGE RETURN.
///
/// **Warning:** Because the list above excludes U+000B VERTICAL TAB,
/// `b.is_ascii_whitespace()` is **not** equivalent to `char::from(b).is_whitespace()`.
///
/// Rust uses the WhatWG Infra Standard's [definition of ASCII
/// whitespace][infra-aw]. There are several other definitions in
/// wide use. For instance, [the POSIX locale][pct] includes
Expand Down
18 changes: 15 additions & 3 deletions library/core/src/slice/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ impl [u8] {
/// Returns a byte slice with leading ASCII whitespace bytes removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the `\0x0B` byte even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim_start`].
///
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand Down Expand Up @@ -251,7 +255,11 @@ impl [u8] {
/// Returns a byte slice with trailing ASCII whitespace bytes removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the `\0x0B` byte even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim_end`].
///
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand Down Expand Up @@ -281,7 +289,11 @@ impl [u8] {
/// removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the `\0x0B` byte even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim`].
///
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand Down
18 changes: 15 additions & 3 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,9 @@ impl str {
///
/// This uses the same definition as [`char::is_ascii_whitespace`].
/// To split by Unicode `Whitespace` instead, use [`split_whitespace`].
/// Note that because of this difference in definition, even if `s.is_ascii()`
/// is `true`, `s.split_ascii_whitespace()` behavior will differ from `s.split_whitespace()`
/// if `s` contains U+000B VERTICAL TAB.
///
/// [`split_whitespace`]: str::split_whitespace
///
Expand Down Expand Up @@ -2896,9 +2899,12 @@ impl str {
/// Returns a string slice with leading ASCII whitespace removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the U+000B code point even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim_start`].
///
/// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand All @@ -2921,9 +2927,12 @@ impl str {
/// Returns a string slice with trailing ASCII whitespace removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the U+000B code point even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim_end`].
///
/// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand All @@ -2947,9 +2956,12 @@ impl str {
/// removed.
///
/// 'Whitespace' refers to the definition used by
/// [`u8::is_ascii_whitespace`].
/// [`u8::is_ascii_whitespace`]. Importantly, this definition excludes
/// the U+000B code point even though it has the Unicode [`White_Space`] property
/// and is removed by [`str::trim`].
///
/// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
/// [`White_Space`]: https://www.unicode.org/reports/tr44/#White_Space
///
/// # Examples
///
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ macro_rules! tuple_impls {

maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "adt_const_params", issue = "95174")]
#[unstable_feature_bound(unsized_const_params)]
#[unstable(feature = "min_adt_const_params", issue = "154042")]
impl<$($T: ConstParamTy_),+> ConstParamTy_ for ($($T,)+)
{}
}
Expand Down
17 changes: 11 additions & 6 deletions library/std/src/io/buffered/bufreader/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub struct Buffer {
// Each call to `fill_buf` sets `filled` to indicate how many bytes at the start of `buf` are
// initialized with bytes from a read.
filled: usize,
// This is the max number of bytes returned across all `fill_buf` calls. We track this so that we
// can accurately tell `read_buf` how many bytes of buf are initialized, to bypass as much of its
// defensive initialization as possible. Note that while this often the same as `filled`, it
// doesn't need to be. Calls to `fill_buf` are not required to actually fill the buffer, and
// omitting this is a huge perf regression for `Read` impls that do not.
// Whether `buf` has been fully initialized. We track this so that we can accurately tell
// `read_buf` how many bytes of buf are initialized, to bypass as much of its defensive
// initialization as possible. Note that while this often the same as `filled`, it doesn't need
// to be. Calls to `fill_buf` are not required to actually fill the buffer, and omitting this
// is a huge perf regression for `Read` impls that do not.
initialized: bool,
}

Expand Down Expand Up @@ -112,6 +112,9 @@ impl Buffer {
let mut buf = BorrowedBuf::from(&mut self.buf[self.filled..]);

if self.initialized {
// SAFETY: `self.initialized` is only set after `self.buf` was
// fully initialized, and once `self.buf` is fully initialized
// no part will become uninitialized.
unsafe { buf.set_init() };
}

Expand All @@ -138,9 +141,11 @@ impl Buffer {
debug_assert!(self.pos == self.filled);

let mut buf = BorrowedBuf::from(&mut *self.buf);
// SAFETY: `self.filled` bytes will always have been initialized.

if self.initialized {
// SAFETY: `self.initialized` is only set after `self.buf` was
// fully initialized, and once `self.buf` is fully initialized
// no part will become uninitialized.
unsafe { buf.set_init() };
}

Expand Down
Loading
Loading