Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 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
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
735cc3d
Add regression test for CString::clone_into unwind safety
Vastargazing Jul 5, 2026
6810f13
add `-Zforce-intrinsic-fallback` flag
folkertdev Jun 24, 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
76925bc
Rollup merge of #158377 - folkertdev:force-intrinsic-fallback, r=saet…
jhpratt Jul 6, 2026
2d8afe7
Rollup merge of #158642 - nnethercote:interning-clarification, r=Mark…
jhpratt Jul 6, 2026
44d5751
Rollup merge of #158743 - ChrisDenton:find-cdb, r=Mark-Simulacrum
jhpratt Jul 6, 2026
aa0b10d
Rollup merge of #158775 - valentynkit:bootstrap-readable-rustflags, r…
jhpratt Jul 6, 2026
4d8e598
Rollup merge of #158782 - Mark-Simulacrum:expose-no-threads, r=Urgau
jhpratt Jul 6, 2026
cdf0009
Rollup merge of #158785 - xonx4l:intrinsic-test-aarch64, r=Kobzol
jhpratt Jul 6, 2026
1011258
Rollup merge of #157734 - tgross35:stabilize-local_key_cell_update, r…
jhpratt Jul 6, 2026
86ab51b
Rollup merge of #158183 - joboet:openbsd_current_exe, r=Mark-Simulacrum
jhpratt Jul 6, 2026
832c6e0
Rollup merge of #158671 - danieljofficial:move-tests-batch-17, r=Kivooeo
jhpratt Jul 6, 2026
7ca2101
Rollup merge of #158730 - obeis:raw-pointer-static-mut, r=RalfJung
jhpratt Jul 6, 2026
e4b5bcd
Rollup merge of #158752 - zedddie:gsoc-batch-18-meow, r=Kivooeo
jhpratt Jul 6, 2026
9ab04cf
Rollup merge of #158755 - nnethercote:ast-ThinVec, r=mejrs
jhpratt Jul 6, 2026
ae2fff6
Rollup merge of #158757 - kpeis695:fix/read-le-be-tracking-issue-link…
jhpratt Jul 6, 2026
b66e218
Rollup merge of #158765 - TaKO8Ki:fix-doc-auto-cfg-values-non-ident, …
jhpratt Jul 6, 2026
48e9e9f
Rollup merge of #158771 - ArshLabs:test/hashset-extract-if-coverage, …
jhpratt Jul 6, 2026
7ad9af1
Rollup merge of #158772 - tshepang:rdg-sync, r=tshepang
jhpratt Jul 6, 2026
f0b7d2d
Rollup merge of #158776 - amirHdev:fix-139223-avr-target-cpu-diagnost…
jhpratt Jul 6, 2026
0d23742
Rollup merge of #158786 - Ap4sh:ap4sh/issue-145922-builtin-attr-macro…
jhpratt Jul 6, 2026
0970148
Rollup merge of #158807 - Vastargazing:tests/cstr-clone-into-alloc-er…
jhpratt Jul 6, 2026
f423b10
Rollup merge of #158825 - bjorn3:fix_typo, r=clubby789
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
11 changes: 9 additions & 2 deletions compiler/rustc_monomorphize/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,11 +995,18 @@ fn visit_instance_use<'tcx>(
output.push(create_fn_mono_item(tcx, panic_instance, source));
}
} else if !intrinsic.must_be_overridden
&& !tcx.sess.replaced_intrinsics.contains(&intrinsic.name)
&& (tcx.sess.opts.unstable_opts.force_intrinsic_fallback
|| !tcx.sess.replaced_intrinsics.contains(&intrinsic.name))
{
// Codegen the fallback body of intrinsics with fallback bodies.
// We have to skip this otherwise as there's no body to codegen.
// We also skip intrinsics the backend handles, to reduce monomorphizations.
//
// We also skip `replaced_intrinsics` which are always replaced by the backend and hence
// monomorphizing the fallback body would be pointless.
//
// However, when -Zforce-intrinsic-fallback is set (e.g. to test the fallback
// implementations) we ignore the optimization hint and do monomorphize
// the fallback body.
let instance = ty::Instance::new_raw(instance.def_id(), instance.args);
if tcx.should_codegen_locally(instance) {
output.push(create_fn_mono_item(tcx, instance, source));
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ impl<'a> Parser<'a> {
/// Parse the field access used in offset_of, matched by `$(e:expr)+`.
/// Currently returns a list of idents. However, it should be possible in
/// future to also do array indices, which might be arbitrary expressions.
pub(crate) fn parse_floating_field_access(&mut self) -> PResult<'a, Vec<Ident>> {
let mut fields = Vec::new();
pub(crate) fn parse_floating_field_access(&mut self) -> PResult<'a, ThinVec<Ident>> {
let mut fields = ThinVec::new();
let mut trailing_dot = None;

loop {
Expand Down
Loading
Loading