Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
27be5c2
docs(core): update `find()` and `rfind()` examples
smirzaei Dec 22, 2025
a6b005a
fix `Expr::can_have_side_effects` for repeat and binary expressions
andjsrk Dec 26, 2025
8ca47cd
Clarify `MoveData::init_loc_map`.
nnethercote Jan 1, 2026
bd5526c
accept test changes related to binary ops
andjsrk Jan 6, 2026
021a551
add test for repeats
andjsrk Jan 6, 2026
61ca012
rename test
andjsrk Jan 6, 2026
f805d1b
format
andjsrk Jan 6, 2026
c73b64b
update expected output as well
andjsrk Jan 6, 2026
d848437
add more information in comment
andjsrk Jan 7, 2026
ea7ada9
Update browser-ui-test version to `0.23.1`
GuillaumeGomez Jan 7, 2026
d411919
rename the `derive_{eq, clone_copy}` features to `*_internals`
cyrgani Jan 8, 2026
6ed9530
tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed)
Enselic Jan 8, 2026
8e3d604
Finish transition from `semitransparent` to `semiopaque` for `rustc_m…
Enselic Jan 1, 2026
9e00663
rust-analyzer: Also use `semiopaque` instead of `semitransparent`
Enselic Jan 1, 2026
742d276
make attrs actually use `Target::GenericParam`
Bryntet Jan 8, 2026
c502d7f
Fix trait method anchor disappearing before user can click on it
GuillaumeGomez Jan 8, 2026
bfb117a
Clean up `tests/rustdoc-gui/anchors.goml` test code
GuillaumeGomez Jan 8, 2026
16fbf6a
Add check for trait impl method anchor
GuillaumeGomez Jan 8, 2026
945e7c7
Use functions more in rustdoc GUI tests
GuillaumeGomez Jan 7, 2026
5466c6b
Move feature(multiple_supertrait_upcastable) to the actual feature ga…
zachs18 Jan 8, 2026
561b592
add test for binary ops
andjsrk Jan 9, 2026
025ac8f
The aarch64-unknown-none target requires NEON, so the docs were wrong.
jonathanpallant Jan 9, 2026
2ce7a5d
Rollup merge of #150272 - doc/improve-iter-find-docs, r=scottmcm
GuillaumeGomez Jan 9, 2026
09575ec
Rollup merge of #150385 - fix-expr-can-have-side-effects, r=jdonszelm…
GuillaumeGomez Jan 9, 2026
3daf993
Rollup merge of #150561 - semiopaque, r=BoxyUwU
GuillaumeGomez Jan 9, 2026
7702fb2
Rollup merge of #150574 - MoveData-init_loc_map, r=cjgillot
GuillaumeGomez Jan 9, 2026
10e24f1
Rollup merge of #150762 - cleanup-gui, r=lolbinarycat
GuillaumeGomez Jan 9, 2026
e99f5f6
Rollup merge of #150808 - derive-internals, r=jhpratt
GuillaumeGomez Jan 9, 2026
fe307c5
Rollup merge of #150816 - method-anchor, r=camelid
GuillaumeGomez Jan 9, 2026
19769da
Rollup merge of #150821 - remove-test, r=jackh726
GuillaumeGomez Jan 9, 2026
0548617
Rollup merge of #150829 - fix_generic_param_target, r=JonathanBrouwer
GuillaumeGomez Jan 9, 2026
ab854da
Rollup merge of #150834 - multiple_supertrait_upcastable-not-internal…
GuillaumeGomez Jan 9, 2026
8f89503
Rollup merge of #150864 - fix-aarch64-platform-docs, r=jdonszelmann
GuillaumeGomez Jan 9, 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: 1 addition & 1 deletion compiler/rustc_arena/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl DroplessArena {
/// - Types that are `!Copy` and `Drop`: these must be specified in the
/// arguments. The `TypedArena` will be used for them.
///
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro declare_arena([$($a:tt $name:ident: $ty:ty,)*]) {
#[derive(Default)]
pub struct Arena<'tcx> {
Expand Down
9 changes: 6 additions & 3 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1986,8 +1986,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let (name, kind) = self.lower_generic_param_kind(param, source);

let hir_id = self.lower_node_id(param.id);
self.lower_attrs(hir_id, &param.attrs, param.span(), Target::Param);
hir::GenericParam {
let param_attrs = &param.attrs;
let param_span = param.span();
let param = hir::GenericParam {
hir_id,
def_id: self.local_def_id(param.id),
name,
Expand All @@ -1996,7 +1997,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
kind,
colon_span: param.colon_span.map(|s| self.lower_span(s)),
source,
}
};
self.lower_attrs(hir_id, param_attrs, param_span, Target::from_generic_param(&param));
param
}

fn lower_generic_param_kind(
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::num::NonZero;

use rustc_errors::ErrorGuaranteed;
use rustc_hir::target::GenericParamKind;
use rustc_hir::{
DefaultBodyStability, MethodKind, PartialConstStability, Stability, StabilityLevel,
StableSince, Target, UnstableReason, VERSION_PLACEHOLDER,
Expand Down Expand Up @@ -43,7 +44,7 @@ const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::TyAlias),
Allow(Target::Variant),
Allow(Target::Field),
Allow(Target::Param),
Allow(Target::GenericParam { kind: GenericParamKind::Type, has_default: true }),
Allow(Target::Static),
Allow(Target::ForeignFn),
Allow(Target::ForeignStatic),
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_attr_parsing/src/attributes/transparency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<S: Stage> SingleAttributeParser<S> for TransparencyParser {
});
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::MacroDef)]);
const TEMPLATE: AttributeTemplate =
template!(NameValueStr: ["transparent", "semitransparent", "opaque"]);
template!(NameValueStr: ["transparent", "semiopaque", "opaque"]);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option<AttributeKind> {
let Some(nv) = args.name_value() else {
Expand All @@ -24,12 +24,12 @@ impl<S: Stage> SingleAttributeParser<S> for TransparencyParser {
};
match nv.value_as_str() {
Some(sym::transparent) => Some(Transparency::Transparent),
Some(sym::semiopaque | sym::semitransparent) => Some(Transparency::SemiOpaque),
Some(sym::semiopaque) => Some(Transparency::SemiOpaque),
Some(sym::opaque) => Some(Transparency::Opaque),
Some(_) => {
cx.expected_specific_argument_strings(
nv.value_span,
&[sym::transparent, sym::semitransparent, sym::opaque],
&[sym::transparent, sym::semiopaque, sym::opaque],
);
None
}
Expand Down
24 changes: 24 additions & 0 deletions compiler/rustc_attr_parsing/src/target_checking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,29 @@ pub(crate) const ALL_TARGETS: &'static [Policy] = {
Allow(Target::Crate),
Allow(Target::Delegation { mac: false }),
Allow(Target::Delegation { mac: true }),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Const,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Const,
has_default: true,
}),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Lifetime,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Lifetime,
has_default: true,
}),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Type,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_hir::target::GenericParamKind::Type,
has_default: true,
}),
]
};
14 changes: 7 additions & 7 deletions compiler/rustc_codegen_cranelift/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,43 +744,43 @@ unsafe extern "C" {
pub struct VaList<'a>(&'a mut VaListImpl);

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro stringify($($t:tt)*) {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro file() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro line() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro cfg() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro asm() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro global_asm() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro naked_asm() {
/* compiler built-in */
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/global_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub(crate) fn compile_global_asm(
#![allow(internal_features)]
#![no_core]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
macro global_asm() { /* compiler built-in */ }
global_asm!(r###"
"####,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_gcc/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,25 +748,25 @@ extern "C" {
pub struct VaList<'a>(&'a mut VaListImpl);

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro stringify($($t:tt)*) {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro file() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro line() {
/* compiler built-in */
}

#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro cfg() {
/* compiler built-in */
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ declare_features! (
(internal, link_cfg, "1.14.0", None),
/// Allows using `?Trait` trait bounds in more contexts.
(internal, more_maybe_bounds, "1.82.0", None),
/// Allows the `multiple_supertrait_upcastable` lint.
(unstable, multiple_supertrait_upcastable, "1.69.0", None),
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
(internal, negative_bounds, "1.71.0", None),
/// Set the maximum pattern complexity allowed (not limited by default).
Expand Down Expand Up @@ -569,6 +567,8 @@ declare_features! (
(unstable, more_qualified_paths, "1.54.0", Some(86935)),
/// The `movrs` target feature on x86.
(unstable, movrs_target_feature, "1.88.0", Some(137976)),
/// Allows the `multiple_supertrait_upcastable` lint.
(unstable, multiple_supertrait_upcastable, "1.69.0", Some(150833)),
/// Allows the `#[must_not_suspend]` attribute.
(unstable, must_not_suspend, "1.57.0", Some(83310)),
/// Allows `mut ref` and `mut ref mut` identifier patterns.
Expand Down
9 changes: 7 additions & 2 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2625,6 +2625,12 @@ impl Expr<'_> {
// them being used only for its side-effects.
base.can_have_side_effects()
}
ExprKind::Binary(_, lhs, rhs) => {
// This isn't exactly true for all `Binary`, but we are using this
// method exclusively for diagnostics and there's a *cultural* pressure against
// them being used only for its side-effects.
lhs.can_have_side_effects() || rhs.can_have_side_effects()
}
ExprKind::Struct(_, fields, init) => {
let init_side_effects = match init {
StructTailExpr::Base(init) => init.can_have_side_effects(),
Expand All @@ -2647,13 +2653,13 @@ impl Expr<'_> {
},
args,
) => args.iter().any(|arg| arg.can_have_side_effects()),
ExprKind::Repeat(arg, _) => arg.can_have_side_effects(),
ExprKind::If(..)
| ExprKind::Match(..)
| ExprKind::MethodCall(..)
| ExprKind::Call(..)
| ExprKind::Closure { .. }
| ExprKind::Block(..)
| ExprKind::Repeat(..)
| ExprKind::Break(..)
| ExprKind::Continue(..)
| ExprKind::Ret(..)
Expand All @@ -2664,7 +2670,6 @@ impl Expr<'_> {
| ExprKind::InlineAsm(..)
| ExprKind::AssignOp(..)
| ExprKind::ConstBlock(..)
| ExprKind::Binary(..)
| ExprKind::Yield(..)
| ExprKind::DropTemps(..)
| ExprKind::Err(_) => true,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub mod lints;
pub mod pat_util;
mod stability;
mod stable_hash_impls;
mod target;
pub mod target;
pub mod weak_lang_items;

#[cfg(test)]
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_mir_dataflow/src/move_paths/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ pub struct MoveData<'tcx> {
pub rev_lookup: MovePathLookup<'tcx>,
pub inits: IndexVec<InitIndex, Init>,
/// Each Location `l` is mapped to the Inits that are effects
/// of executing the code at `l`.
pub init_loc_map: LocationMap<SmallVec<[InitIndex; 4]>>,
/// of executing the code at `l`. Only very rarely (e.g. inline asm)
/// is there more than one Init at any `l`.
pub init_loc_map: LocationMap<SmallVec<[InitIndex; 1]>>,
pub init_path_map: IndexVec<MovePathIndex, SmallVec<[InitIndex; 4]>>,
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,6 @@ symbols! {
self_in_typedefs,
self_struct_ctor,
semiopaque,
semitransparent,
sha2,
sha3,
sha512_sm_x86,
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub const unsafe trait TrivialClone: [const] Clone {}
/// Derive macro generating an impl of the trait `Clone`.
#[rustc_builtin_macro]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow_internal_unstable(core_intrinsics, derive_clone_copy, trivial_clone)]
#[allow_internal_unstable(core_intrinsics, derive_clone_copy_internals, trivial_clone)]
pub macro Clone($item:item) {
/* compiler built-in */
}
Expand Down Expand Up @@ -350,7 +350,7 @@ impl_use_cloned! {
#[doc(hidden)]
#[allow(missing_debug_implementations)]
#[unstable(
feature = "derive_clone_copy",
feature = "derive_clone_copy_internals",
reason = "deriving hack, should not be public",
issue = "none"
)]
Expand All @@ -360,7 +360,7 @@ pub struct AssertParamIsClone<T: Clone + PointeeSized> {
#[doc(hidden)]
#[allow(missing_debug_implementations)]
#[unstable(
feature = "derive_clone_copy",
feature = "derive_clone_copy_internals",
reason = "deriving hack, should not be public",
issue = "none"
)]
Expand Down
8 changes: 6 additions & 2 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub const trait Eq: [const] PartialEq<Self> + PointeeSized {
/// Derive macro generating an impl of the trait [`Eq`].
#[rustc_builtin_macro]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow_internal_unstable(core_intrinsics, derive_eq, structural_match)]
#[allow_internal_unstable(core_intrinsics, derive_eq_internals, structural_match)]
#[allow_internal_unstable(coverage_attribute)]
pub macro Eq($item:item) {
/* compiler built-in */
Expand All @@ -363,7 +363,11 @@ pub macro Eq($item:item) {
// This struct should never appear in user code.
#[doc(hidden)]
#[allow(missing_debug_implementations)]
#[unstable(feature = "derive_eq", reason = "deriving hack, should not be public", issue = "none")]
#[unstable(
feature = "derive_eq_internals",
reason = "deriving hack, should not be public",
issue = "none"
)]
pub struct AssertParamIsEq<T: Eq + PointeeSized> {
_field: crate::marker::PhantomData<T>,
}
Expand Down
12 changes: 11 additions & 1 deletion library/core/src/iter/traits/double_ended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,18 @@ pub trait DoubleEndedIterator: Iterator {
/// ```
/// let a = [1, 2, 3];
///
/// assert_eq!(a.iter().rfind(|&&x| x == 2), Some(&2));
/// assert_eq!(a.into_iter().rfind(|&x| x == 2), Some(2));
/// assert_eq!(a.into_iter().rfind(|&x| x == 5), None);
/// ```
///
/// Iterating over references:
///
/// ```
/// let a = [1, 2, 3];
///
/// // `iter()` yields references i.e. `&i32` and `rfind()` takes a
/// // reference to each element.
/// assert_eq!(a.iter().rfind(|&&x| x == 2), Some(&2));
/// assert_eq!(a.iter().rfind(|&&x| x == 5), None);
/// ```
///
Expand Down
11 changes: 11 additions & 0 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,17 @@ pub trait Iterator {
/// assert_eq!(a.into_iter().find(|&x| x == 5), None);
/// ```
///
/// Iterating over references:
///
/// ```
/// let a = [1, 2, 3];
///
/// // `iter()` yields references i.e. `&i32` and `find()` takes a
/// // reference to each element.
/// assert_eq!(a.iter().find(|&&x| x == 2), Some(&2));
/// assert_eq!(a.iter().find(|&&x| x == 5), None);
/// ```
///
/// Stopping at the first `true`:
///
/// ```
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ macro_rules! assert_ne {
/// ```
#[unstable(feature = "assert_matches", issue = "82775")]
#[allow_internal_unstable(panic_internals)]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro assert_matches {
($left:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => {
match $left {
Expand Down Expand Up @@ -401,7 +401,7 @@ macro_rules! debug_assert_ne {
/// ```
#[unstable(feature = "assert_matches", issue = "82775")]
#[allow_internal_unstable(assert_matches)]
#[rustc_macro_transparency = "semitransparent"]
#[rustc_macro_transparency = "semiopaque"]
pub macro debug_assert_matches($($arg:tt)*) {
if $crate::cfg!(debug_assertions) {
$crate::assert_matches::assert_matches!($($arg)*);
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ pub trait Copy: Clone {
/// Derive macro generating an impl of the trait `Copy`.
#[rustc_builtin_macro]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow_internal_unstable(core_intrinsics, derive_clone_copy)]
#[allow_internal_unstable(core_intrinsics, derive_clone_copy_internals)]
pub macro Copy($item:item) {
/* compiler built-in */
}
Expand Down
Loading
Loading