Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
88c0724
std: Update documentation for `LocalKey<Cell<T>>::update`
tgross35 Jun 11, 2026
ef5968d
Stabilize `local_key_cell_update`
tgross35 Jun 11, 2026
66b489f
Update syntax of try build delegation in bors
Kobzol Jun 20, 2026
aa78a1d
Merge pull request #2906 from Kobzol/delegate-try-update
tshepang Jun 20, 2026
35990d1
do not use title case for section names
tshepang Jun 22, 2026
36f0600
Merge pull request #2908 from rust-lang/tshepang-patch-2
tshepang Jun 22, 2026
616c9f8
do not use title case for section names (part 2)
tshepang Jun 22, 2026
52c6f5f
Merge pull request #2909 from rust-lang/tshepang-patch-3
tshepang Jun 22, 2026
35df795
std: allocate less memory in `current_exe` for OpenBSD
joboet Jun 22, 2026
db9b6a1
std: program names starting with a dot may not be path-like
joboet Jun 25, 2026
4928ea5
Prepare for merging from rust-lang/rust
invalid-email-address Jun 29, 2026
1c09ec1
Merge ref '7fb284d9037f' from rust-lang/rust
invalid-email-address Jun 29, 2026
7b24788
Merge pull request #2912 from rust-lang/rustc-pull
tshepang Jun 29, 2026
9af8904
Add well-formedness chapter
fallible-algebra Jun 1, 2026
4066557
Add Well-formedness dev guide page
BoxyUwU Jun 29, 2026
6bf1cd9
update autodiff install docs for nix
activexray Jun 23, 2026
70859bd
Merge pull request #2910 from activexray/main
ZuseZ4 Jun 29, 2026
4c65d6e
Fix typo in best-practices.md
teor2345 Jul 1, 2026
a4eba1d
make more simple
tshepang Jul 1, 2026
2ffca4e
Merge pull request #2913 from teor2345/patch-1
tshepang Jul 1, 2026
866e997
move a few tests out of tests/ui/issues
danieljofficial Jun 16, 2026
2c0fe5b
add links and bless
danieljofficial Jul 1, 2026
fdfba67
Clarify some interning details
nnethercote Jul 1, 2026
febe5a5
Remove unexpected usage of Unambig in non-infer variants
mu001999 Jun 23, 2026
34df033
Update `FIXME(static_mut_refs)` comments
obeis Jul 3, 2026
1e7c81b
Look for cdb location in the registry first
ChrisDenton Jul 3, 2026
9016189
move batch
zedddie Jul 3, 2026
0c42d92
bless batch
zedddie Jul 3, 2026
ba53d1b
Add some more AST size assertions
nnethercote Jul 3, 2026
b14e429
Use `ThinVec` in `Expr::OffsetOf`
nnethercote Jul 3, 2026
3a0a977
Use `ThinVec` in `GenericBounds`
nnethercote Jul 3, 2026
27935a6
Fix incorrect tracking issue link for read_le/read_be
kpeis695 Jul 4, 2026
4c7acb4
add rustdoc-ui regression for non-ident doc auto_cfg values
TaKO8Ki Jul 4, 2026
86960f5
handle non-ident doc auto_cfg values without panicking
TaKO8Ki Jul 4, 2026
c341ff5
sembr src/analysis/well-formed.md
tshepang Jul 4, 2026
ccec2e0
fix misplaced quotes
tshepang Jul 4, 2026
eefd538
sembr src/analysis/well-formed.md
tshepang Jul 4, 2026
6b77786
use sentence case
tshepang Jul 4, 2026
2452d9d
Update date-check markers for July 2026
krishna3554 Jul 3, 2026
5ba2f10
less words
tshepang Jul 4, 2026
42fa311
Merge pull request #2915 from krishna3554/update-date-check-markers-2…
tshepang Jul 4, 2026
bae7fba
new mdbook now gives this for free
tshepang Jul 4, 2026
769c5bd
document accepted practice
tshepang Jul 4, 2026
dd200ba
use local
tshepang Jul 4, 2026
4132d73
sembr src/building/bootstrapping/debugging-bootstrap.md
tshepang Jul 4, 2026
d8954e6
sembr src/building/bootstrapping/intro.md
tshepang Jul 4, 2026
3b40dd0
indirection
tshepang Jul 4, 2026
02b4d2b
sembr src/building/bootstrapping/how-bootstrap-does-it.md
tshepang Jul 4, 2026
3ca83eb
sembr src/building/bootstrapping/bootstrap-in-dependencies.md
tshepang Jul 4, 2026
ecb36ae
capitalise
tshepang Jul 4, 2026
41462bb
overlong
tshepang Jul 4, 2026
b593a46
missing pause
tshepang Jul 4, 2026
f070f47
Merge pull request #2916 from rust-lang/tshepang/misc
tshepang Jul 4, 2026
99b3d11
library: expand HashSet extract_if coverage
ArshLabs Jul 4, 2026
d0c3225
bootstrap: only encode RUSTFLAGS when a flag contains a space
valentynkit Jul 4, 2026
835045e
hook intrinsic-test into aarch64-gnu
xonx4l Jul 4, 2026
6ef22de
fix: emit diagnostic for AVR target without target-cpu
amirHdev Jul 4, 2026
c2cf85b
Add supplementary information for get_unchecked(mut)
yilin0518 Jul 5, 2026
6810f13
add `-Zforce-intrinsic-fallback` flag
folkertdev Jun 24, 2026
54cfcdf
Check NotInModule early since it can be a lot faster
steffahn Jul 5, 2026
ee05842
Add regression test for builtin attr macro values
Ap4sh Jul 5, 2026
43b05c8
Fix typo
bjorn3 May 8, 2026
26e35d9
Add and use cfg(target_has_threads) to enforce no_thread impl usage
Mark-Simulacrum Jul 4, 2026
fe2db9c
Split TargetTuple definition to separate file
Mark-Simulacrum Jul 5, 2026
851d8f3
tidy: Use `empty_alternate = true` for triagebot mention glob check
ShoyuVanilla Jul 6, 2026
3f92845
positive test for closures needing expectations
jdonszelmann Jul 1, 2026
a321df9
Rollup merge of #158377 - folkertdev:force-intrinsic-fallback, r=saet…
jhpratt Jul 6, 2026
75bea57
Rollup merge of #158642 - nnethercote:interning-clarification, r=Mark…
jhpratt Jul 6, 2026
48ceecf
Rollup merge of #158694 - jdonszelmann:closure-inference, r=lcnr,waff…
jhpratt Jul 6, 2026
139ddaf
Rollup merge of #158743 - ChrisDenton:find-cdb, r=Mark-Simulacrum
jhpratt Jul 6, 2026
de5f3dd
Rollup merge of #158775 - valentynkit:bootstrap-readable-rustflags, r…
jhpratt Jul 6, 2026
beeaa7a
Rollup merge of #158782 - Mark-Simulacrum:expose-no-threads, r=Urgau
jhpratt Jul 6, 2026
f604cb5
Rollup merge of #158785 - xonx4l:intrinsic-test-aarch64, r=Kobzol
jhpratt Jul 6, 2026
8c8f363
Rollup merge of #158819 - steffahn:uninhab-module-check-first, r=khyp…
jhpratt Jul 6, 2026
04b47ed
Rollup merge of #157734 - tgross35:stabilize-local_key_cell_update, r…
jhpratt Jul 6, 2026
2f8aa14
Rollup merge of #158183 - joboet:openbsd_current_exe, r=Mark-Simulacrum
jhpratt Jul 6, 2026
22b5794
Rollup merge of #158310 - mu001999-contrib:fix-158289, r=khyperia
jhpratt Jul 6, 2026
a651048
Rollup merge of #158671 - danieljofficial:move-tests-batch-17, r=Kivooeo
jhpratt Jul 6, 2026
a415aa7
Rollup merge of #158730 - obeis:raw-pointer-static-mut, r=RalfJung
jhpratt Jul 6, 2026
6504d5e
Rollup merge of #158752 - zedddie:gsoc-batch-18-meow, r=Kivooeo
jhpratt Jul 6, 2026
eadd942
Rollup merge of #158755 - nnethercote:ast-ThinVec, r=mejrs
jhpratt Jul 6, 2026
3568933
Rollup merge of #158757 - kpeis695:fix/read-le-be-tracking-issue-link…
jhpratt Jul 6, 2026
2cabed2
Rollup merge of #158765 - TaKO8Ki:fix-doc-auto-cfg-values-non-ident, …
jhpratt Jul 6, 2026
eeb4d99
Rollup merge of #158771 - ArshLabs:test/hashset-extract-if-coverage, …
jhpratt Jul 6, 2026
ccd609a
Rollup merge of #158772 - tshepang:rdg-sync, r=tshepang
jhpratt Jul 6, 2026
6fe47a6
Rollup merge of #158776 - amirHdev:fix-139223-avr-target-cpu-diagnost…
jhpratt Jul 6, 2026
953045d
Rollup merge of #158786 - Ap4sh:ap4sh/issue-145922-builtin-attr-macro…
jhpratt Jul 6, 2026
9d5b99d
Rollup merge of #158810 - yilin0518:fix_get_unchecked, r=Darksonn
jhpratt Jul 6, 2026
addcf74
Rollup merge of #158825 - bjorn3:fix_typo, r=clubby789
jhpratt Jul 6, 2026
2847dbc
Rollup merge of #158838 - ShoyuVanilla:triagebot-glob-fixup, r=jieyouxu
jhpratt Jul 6, 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
16 changes: 13 additions & 3 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl GenericBound {
}
}

pub type GenericBounds = Vec<GenericBound>;
pub type GenericBounds = ThinVec<GenericBound>;

/// Specifies the enforced ordering for generic parameters. In the future,
/// if we wanted to relax this order, we could override `PartialEq` and
Expand Down Expand Up @@ -1534,7 +1534,7 @@ impl Expr {
let (Some(lhs), Some(rhs)) = (lhs.to_bound(), rhs.to_bound()) else {
return None;
};
TyKind::TraitObject(vec![lhs, rhs], TraitObjectSyntax::None)
TyKind::TraitObject(thin_vec![lhs, rhs], TraitObjectSyntax::None)
}

ExprKind::Underscore => TyKind::Infer,
Expand Down Expand Up @@ -1868,7 +1868,7 @@ pub enum ExprKind {
///
/// Usually not written directly in user code but
/// indirectly via the macro `core::mem::offset_of!(...)`.
OffsetOf(Box<Ty>, Vec<Ident>),
OffsetOf(Box<Ty>, ThinVec<Ident>),

/// A macro invocation; pre-expansion.
MacCall(Box<MacCall>),
Expand Down Expand Up @@ -4391,27 +4391,37 @@ mod size_asserts {
// tidy-alphabetical-start
static_assert_size!(AssocItem, 80);
static_assert_size!(AssocItemKind, 16);
static_assert_size!(AttrKind, 16);
static_assert_size!(Attribute, 32);
static_assert_size!(Block, 32);
static_assert_size!(Expr, 72);
static_assert_size!(ExprKind, 40);
static_assert_size!(Fn, 192);
static_assert_size!(FnDecl, 24);
static_assert_size!(FnHeader, 76);
static_assert_size!(FnSig, 96);
static_assert_size!(ForeignItem, 80);
static_assert_size!(ForeignItemKind, 16);
static_assert_size!(GenericArg, 24);
static_assert_size!(GenericArgs, 40);
static_assert_size!(GenericBound, 88);
static_assert_size!(GenericParam, 80);
static_assert_size!(Generics, 40);
static_assert_size!(Impl, 80);
static_assert_size!(Item, 152);
static_assert_size!(ItemKind, 88);
static_assert_size!(Lifetime, 16);
static_assert_size!(LitKind, 24);
static_assert_size!(Local, 96);
static_assert_size!(MetaItem, 88);
static_assert_size!(MetaItemKind, 40);
static_assert_size!(MetaItemLit, 40);
static_assert_size!(Param, 40);
static_assert_size!(Pat, 80);
static_assert_size!(PatKind, 56);
static_assert_size!(Path, 24);
static_assert_size!(PathSegment, 24);
static_assert_size!(QSelf, 24);
static_assert_size!(Stmt, 32);
static_assert_size!(StmtKind, 16);
static_assert_size!(TraitImplHeader, 72);
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ macro_rules! common_visitor_and_walkers {
impl_visitable_list!(<$($lt)? $($mut)?>
ThinVec<AngleBracketedArg>,
ThinVec<Attribute>,
ThinVec<GenericBound>,
ThinVec<Ident>,
ThinVec<(Ident, Option<Ident>)>,
ThinVec<(NodeId, Path)>,
ThinVec<PathSegment>,
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,11 @@ impl DocParser {
// If it's a list, then only `any()` and `none()` are allowed and they must not
// contain any item.
MetaItemOrLitParser::MetaItemParser(sub_item) => {
if let Some(ident) = sub_item.ident()
&& [sym::any, sym::none].contains(&ident.name)
let Some(ident) = sub_item.ident() else {
cx.adcx().expected_identifier(sub_item.path().span());
continue;
};
if [sym::any, sym::none].contains(&ident.name)
&& let ArgParser::List(list) = sub_item.args()
&& list.mixed().count() == 0
{
Expand All @@ -371,9 +374,7 @@ impl DocParser {
} else {
cx.emit_lint(
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
DocAutoCfgHideShowUnexpectedItem {
attr_name: sub_item.ident().unwrap().name,
},
DocAutoCfgHideShowUnexpectedItem { attr_name: ident.name },
sub_item.span(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn show_substructure(cx: &ExtCtxt<'_>, span: Span, substr: &Substructure<'_>) ->
let ty_dyn_debug = cx.ty(
span,
ast::TyKind::TraitObject(
vec![cx.trait_bound(path_debug, false)],
thin_vec![cx.trait_bound(path_debug, false)],
ast::TraitObjectSyntax::Dyn,
),
);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ impl<'a> TraitDef<'a> {
ident,
generics: Generics::default(),
after_where_clause: ast::WhereClause::default(),
bounds: Vec::new(),
bounds: ThinVec::new(),
ty: Some(type_def.to_ty(cx, self.span, type_ident, generics)),
})),
tokens: None,
Expand All @@ -639,7 +639,7 @@ impl<'a> TraitDef<'a> {
// Extra restrictions on the generics parameters to the
// type being derived upon.
let span = param.ident.span.with_ctxt(ctxt);
let bounds: Vec<_> = self
let bounds: ThinVec<_> = self
.additional_bounds
.iter()
.map(|p| {
Expand Down Expand Up @@ -723,7 +723,7 @@ impl<'a> TraitDef<'a> {
{
continue;
}
let mut bounds: Vec<_> = self
let mut bounds: ThinVec<_> = self
.additional_bounds
.iter()
.map(|p| {
Expand Down
12 changes: 3 additions & 9 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use rustc_fs_util::{link_or_copy, path_to_c_string};
use rustc_middle::ty::TyCtxt;
use rustc_session::Session;
use rustc_session::config::{self, Lto, OutputType, Passes, SplitDwarfKind, SwitchWithOptPath};
use rustc_span::{BytePos, InnerSpan, Pos, RemapPathScopeComponents, SpanData, SyntaxContext, sym};
use rustc_span::{BytePos, InnerSpan, Pos, RemapPathScopeComponents, SpanData, SyntaxContext};
use rustc_target::spec::{CodeModel, FloatAbi, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
use tracing::{debug, trace};

Expand Down Expand Up @@ -209,14 +209,8 @@ pub(crate) fn target_machine_factory(

let code_model = to_llvm_code_model(sess.code_model());

let mut singlethread = sess.target.singlethread;

// On the wasm target once the `atomics` feature is enabled that means that
// we're no longer single-threaded, or otherwise we don't want LLVM to
// lower atomic operations to single-threaded operations.
if singlethread && sess.target.is_like_wasm && sess.target_features.contains(&sym::atomics) {
singlethread = false;
}
// This is used to set cfg_has_threads, so all logic must be in this method.
let singlethread = sess.target.singlethread(&sess.target_features);

let triple = SmallCStr::new(&versioned_llvm_target(sess));
let cpu = SmallCStr::new(llvm_util::target_cpu(sess));
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use rustc_target::spec::{CfgAbi, LlvmAbi, Os, RelocModel, Target, ef_avr_arch};
use tracing::debug;

use super::apple;
use crate::errors;

/// The default metadata loader. This is used by cg_llvm and cg_clif.
///
Expand Down Expand Up @@ -370,7 +371,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
if let Some(ref cpu) = sess.opts.cg.target_cpu {
ef_avr_arch(cpu)
} else {
bug!("AVR CPU not explicitly specified")
sess.dcx().emit_fatal(errors::CpuRequired)
}
}
Architecture::Csky => {
Expand Down
11 changes: 11 additions & 0 deletions compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
result_place: Option<PlaceValue<Bx::Value>>,
source_info: SourceInfo,
) -> IntrinsicResult<'tcx, Bx::Value> {
// When `-Zforce-intrinsic-fallback` is enabled, always use the fallback body if it exists,
if bx.tcx().sess.opts.unstable_opts.force_intrinsic_fallback
&& let Some(def) = bx.tcx().intrinsic(instance.def_id())
&& !def.must_be_overridden
{
return IntrinsicResult::Fallback(ty::Instance::new_raw(
instance.def_id(),
instance.args,
));
}

let span = source_info.span;

let name = bx.tcx().item_name(instance.def_id());
Expand Down
78 changes: 30 additions & 48 deletions compiler/rustc_data_structures/src/intern.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::cmp::Ordering;
use std::fmt::{self, Debug};
use std::hash::{Hash, Hasher};
use std::ops::Deref;
Expand All @@ -11,26 +10,40 @@ mod private {
pub struct PrivateZst;
}

/// A reference to a value that is interned, and is known to be unique.
/// This type is a reference with one special behaviour: the reference pointer (i.e. the address of
/// the value referred to) is used for equality and hashing, rather than the value's contents, as
/// would occur with a vanilla reference. There are two cases when this is useful.
///
/// Note that it is possible to have a `T` and a `Interned<T>` that are (or
/// refer to) equal but different values. But if you have two different
/// `Interned<T>`s, they both refer to the same value, at a single location in
/// memory. This means that equality and hashing can be done on the value's
/// address rather than the value's contents, which can improve performance.
/// - Types where uniqueness is guaranteed. This is most commonly achieved via interning -- hence
/// the name `Interned` -- though it may also be possible via other means. In this case, the use
/// of `Interned` is primarily a performance optimization, because pointer equality/hashing gives
/// the same results as value equality/hashing, but is faster. (The use of the `Interned` type
/// also provides documentation about the interned-ness.)
///
/// The `PrivateZst` field means you can pattern match with `Interned(v, _)`
/// but you can only construct a `Interned` with `new_unchecked`, and not
/// directly.
/// Note that in this case it is possible to have a `T` and a `Interned<T>` that are (or refer
/// to) equal but different values. But if you have two different `Interned<T>`s, they both refer
/// to the same value, at a single location in memory.
///
/// - Types with identity, where distinct values should always be considered unequal, even if they
/// have equal values. These are rare in Rust, but do occur sometimes. In this case, the use of
/// `Interned` gives different behaviour, because pointer equality/hashing gives different result
/// to value equality/hashing, and is also faster.
///
/// The `PrivateZst` field means you can pattern match with `Interned(v, _)` but you can only
/// construct a `Interned` with `new_unchecked`, and not directly. This means that all creation
/// points can be audited easily.
#[rustc_pass_by_value]
pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst);

impl<'a, T> Interned<'a, T> {
/// Create a new `Interned` value. The value referred to *must* be interned
/// and thus be unique, and it *must* remain unique in the future. This
/// function has `_unchecked` in the name but is not `unsafe`, because if
/// the uniqueness condition is violated condition it will cause incorrect
/// behaviour but will not affect memory safety.
/// Create a new `Interned` value. The value referred to *must* satisfy one of the following
/// two conditions.
/// - It must be unique and it must remain unique in the future.
/// - It must be of a type with "identity" such that distinct values should always be
/// considered unequal.
///
/// This function has `_unchecked` in the name but is not `unsafe`, because if neither of these
/// conditions is met it will cause incorrect behaviour but will not affect memory safety.
#[inline]
pub const fn new_unchecked(t: &'a T) -> Self {
Interned(t, private::PrivateZst)
Expand Down Expand Up @@ -64,41 +77,10 @@ impl<'a, T> PartialEq for Interned<'a, T> {

impl<'a, T> Eq for Interned<'a, T> {}

impl<'a, T: PartialOrd> PartialOrd for Interned<'a, T> {
fn partial_cmp(&self, other: &Interned<'a, T>) -> Option<Ordering> {
// Pointer equality implies equality, due to the uniqueness constraint,
// but the contents must be compared otherwise.
if ptr::eq(self.0, other.0) {
Some(Ordering::Equal)
} else {
let res = self.0.partial_cmp(other.0);
debug_assert_ne!(res, Some(Ordering::Equal));
res
}
}
}

impl<'a, T: Ord> Ord for Interned<'a, T> {
fn cmp(&self, other: &Interned<'a, T>) -> Ordering {
// Pointer equality implies equality, due to the uniqueness constraint,
// but the contents must be compared otherwise.
if ptr::eq(self.0, other.0) {
Ordering::Equal
} else {
let res = self.0.cmp(other.0);
debug_assert_ne!(res, Ordering::Equal);
res
}
}
}

impl<'a, T> Hash for Interned<'a, T>
where
T: Hash,
{
impl<'a, T> Hash for Interned<'a, T> {
#[inline]
fn hash<H: Hasher>(&self, s: &mut H) {
// Pointer hashing is sufficient, due to the uniqueness constraint.
// Pointer hashing is sufficient.
ptr::hash(self.0, s)
}
}
Expand Down
27 changes: 1 addition & 26 deletions compiler/rustc_data_structures/src/intern/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::*;

#[allow(unused)]
#[derive(Debug)]
struct S(u32);

Expand All @@ -11,22 +12,6 @@ impl PartialEq for S {

impl Eq for S {}

impl PartialOrd for S {
fn partial_cmp(&self, other: &S) -> Option<Ordering> {
// The `==` case should be handled by `Interned`.
assert_ne!(self.0, other.0);
self.0.partial_cmp(&other.0)
}
}

impl Ord for S {
fn cmp(&self, other: &S) -> Ordering {
// The `==` case should be handled by `Interned`.
assert_ne!(self.0, other.0);
self.0.cmp(&other.0)
}
}

#[test]
fn test_uniq() {
let s1 = S(1);
Expand All @@ -45,14 +30,4 @@ fn test_uniq() {
assert_eq!(v1, v1);
assert_eq!(v3a, v3b);
assert_ne!(v1, v4); // same content but different addresses: not equal

assert_eq!(v1.cmp(&v2), Ordering::Less);
assert_eq!(v3a.cmp(&v2), Ordering::Greater);
assert_eq!(v1.cmp(&v1), Ordering::Equal); // only uses Interned::eq, not S::cmp
assert_eq!(v3a.cmp(&v3b), Ordering::Equal); // only uses Interned::eq, not S::cmp

assert_eq!(v1.partial_cmp(&v2), Some(Ordering::Less));
assert_eq!(v3a.partial_cmp(&v2), Some(Ordering::Greater));
assert_eq!(v1.partial_cmp(&v1), Some(Ordering::Equal)); // only uses Interned::eq, not S::cmp
assert_eq!(v3a.partial_cmp(&v3b), Some(Ordering::Equal)); // only uses Interned::eq, not S::cmp
}
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const GATED_CFGS: &[GatedCfg] = &[
sym::cfg_target_has_reliable_f16_f128,
Features::cfg_target_has_reliable_f16_f128,
),
(sym::target_has_threads, sym::cfg_target_has_threads, Features::cfg_target_has_threads),
(sym::target_object_format, sym::cfg_target_object_format, Features::cfg_target_object_format),
];

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ declare_features! (
(unstable, anonymous_lifetime_in_impl_trait, "1.63.0", None),
/// Allows checking whether or not the backend correctly supports unstable float types.
(internal, cfg_target_has_reliable_f16_f128, "1.88.0", None),
/// Allows checking whether or not the target might have thread support.
(internal, cfg_target_has_threads, "CURRENT_RUSTC_VERSION", None),
/// Allows identifying the `compiler_builtins` crate.
(internal, compiler_builtins, "1.13.0", None),
/// Allows skipping `ConstParamTy_` trait implementation checks
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ impl<'hir, Unambig> ConstArg<'hir, Unambig> {
#[derive(Clone, Copy, Debug, StableHash)]
#[repr(u8, C)]
pub enum ConstArgKind<'hir, Unambig = ()> {
Tup(&'hir [&'hir ConstArg<'hir, Unambig>]),
Tup(&'hir [&'hir ConstArg<'hir>]),
/// **Note:** Currently this is only used for bare const params
/// (`N` where `fn foo<const N: usize>(...)`),
/// not paths to any const (`N` where `const N: usize = ...`).
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ pub fn walk_const_arg<'v, V: Visitor<'v>>(
try_visit!(visitor.visit_id(*hir_id));
match kind {
ConstArgKind::Tup(exprs) => {
walk_list!(visitor, visit_const_arg, *exprs);
walk_list!(visitor, visit_const_arg_unambig, *exprs);
V::Result::output()
}
ConstArgKind::Struct(qpath, field_exprs) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/inhabitedness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<'tcx> VariantDef {
match field.vis {
Visibility::Public => pred,
Visibility::Restricted(from) => {
pred.or(tcx, InhabitedPredicate::NotInModule(from))
InhabitedPredicate::NotInModule(from).or(tcx, pred)
}
}
}),
Expand Down
Loading
Loading