Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
2ec4b9b
Avoid type unification errors in term search
ChayimFriedman2 Jun 29, 2026
41d005f
Fix parsing of `self::` in fn param list
ChayimFriedman2 Aug 17, 2026
95a793f
fix: accept Self as non-leading path segment in attribute paths
Aditya-PS-05 Aug 28, 2026
fd6ad17
Install cargo tools with locked dependencies
konstin Aug 20, 2026
207b861
Represent doc comments using their own node and not as COMMENT trivia
ChayimFriedman2 Aug 23, 2026
adbeb5e
rename `StoredProjection::lookup` to `StoredProjection::as_slice`
ada4a Aug 31, 2026
911ae19
rename `Place` to `StoredPlace`
ada4a Aug 31, 2026
69fba7f
rename `PlaceRef` to `Place`
ada4a Aug 31, 2026
3d79ea0
Merge pull request #23267 from ada4a/push-xoyurrkmomlv
ChayimFriedman2 Sep 1, 2026
8cc2b1b
render const value in completions label details
BenjaminBrienen Sep 1, 2026
75dd8b3
misc: add an intra-doc link
ada4a Sep 1, 2026
8ba5a18
Fix handling of `#[unsafe()]` attrs without inner meta
ChayimFriedman2 Sep 1, 2026
f737ce3
Merge pull request #23270 from ChayimFriedman2/unsafe-meta-fix
ChayimFriedman2 Sep 1, 2026
9534761
merge `hir_def::hir::Expr::Unsafe` into `Expr::Block`
ada4a Sep 1, 2026
1aa6087
minor: add space after comma in prettify macro expansion
A4-Tacks Sep 1, 2026
a53f45b
Merge pull request #23271 from ada4a/push-xporswkztpmn
ChayimFriedman2 Sep 1, 2026
30fd23d
Merge pull request #23272 from A4-Tacks/pretty-comma-space
A4-Tacks Sep 1, 2026
58efe61
Fix typos, update typos-cli
BenjaminBrienen Sep 1, 2026
bc4bb63
Merge pull request #23275 from BenjaminBrienen/typos
ChayimFriedman2 Sep 1, 2026
e21bd35
Remove FIXME, update docs
BenjaminBrienen Sep 1, 2026
53aa256
Merge pull request #23274 from BenjaminBrienen/rename-base-source
ChayimFriedman2 Sep 1, 2026
f77163c
Merge pull request #23248 from konstin/konsti/cargo-install-locked
ShoyuVanilla Sep 2, 2026
90e8beb
fix: hover `1f64` use float instead of integer
A4-Tacks Sep 2, 2026
b2e35af
Merge pull request #23279 from A4-Tacks/int-float-suf-hover
ChayimFriedman2 Sep 2, 2026
13c017d
Prepare for merging from rust-lang/rust
invalid-email-address Sep 2, 2026
3583e36
Merge ref '59dabe56f7b7' from rust-lang/rust
invalid-email-address Sep 2, 2026
3f57447
Merge pull request #23282 from rust-lang/rustc-pull
lnicola Sep 2, 2026
d7e7755
Merge pull request #23249 from Aditya-PS-05/fix-tool-attr-self-segment
ChayimFriedman2 Sep 3, 2026
1755f64
Merge pull request #23266 from BenjaminBrienen/const-label-details
ChayimFriedman2 Sep 3, 2026
8ef7995
internal: remove redundant disable 'unused_variables'
A4-Tacks Sep 3, 2026
05d1c57
Merge pull request #23283 from A4-Tacks/redundant-unused-var
ChayimFriedman2 Sep 3, 2026
1770deb
Refactor collection of diagnostics in `hir`
ChayimFriedman2 Aug 18, 2026
3a3cb14
Do not relower the signature again in inference, instead fetch it fro…
ChayimFriedman2 Aug 19, 2026
b94de22
Merge pull request #23218 from ChayimFriedman2/doc-comment-no-trivia
ChayimFriedman2 Sep 3, 2026
79d3ddb
Merge pull request #23190 from ChayimFriedman2/no-relowering
ChayimFriedman2 Sep 3, 2026
f375a45
Update contributor guide about `ChangeWithProcMacros`
BenjaminBrienen Sep 3, 2026
4503613
Add missing body diagnostics
BenjaminBrienen Sep 1, 2026
9960cbf
Merge pull request #23284 from BenjaminBrienen/update-guide-change
ChayimFriedman2 Sep 3, 2026
d8e2308
Merge pull request #23262 from BenjaminBrienen/freestanding
ChayimFriedman2 Sep 3, 2026
49fce00
misc: make a FIXME more specific
ada4a Sep 1, 2026
6f265f5
document `ExprCollector::expand_macros_to_string`
ada4a Sep 2, 2026
9133935
use `match_ast!` in `syntax::ast::expr_ext`
ada4a Sep 3, 2026
cee1e08
clean-up `render_variant_after_name`
ada4a Aug 11, 2026
2eb7af1
use correct `what` string in `size_of_sized` calls
ada4a Sep 3, 2026
ac5cf8b
Merge pull request #23285 from ada4a/push-uxovlvqktzsp
ChayimFriedman2 Sep 3, 2026
c5862f3
fix: allow inner attributes on blocks in tuple expressions
Aditya-PS-05 Aug 28, 2026
cccde2f
add placeholder for amdgpu
folkertdev Jul 26, 2026
838270f
add `TyAndLayout::complex_number`
folkertdev Aug 13, 2026
821527b
make SPARC64 `Complex` ABI GCC-compatible
folkertdev Jul 14, 2026
9e53b26
make PowerPC64 `Complex` ABI GCC-compatible
folkertdev Aug 24, 2026
fac655c
accept inner block attributes in array exprs and arg lists
Aditya-PS-05 Sep 4, 2026
0b30592
Follow symlinks when discovering prebuilt rustc proc-macro dylibs
onlycs Aug 29, 2026
7f73060
Merge pull request #23246 from Aditya-PS-05/block-inner-attrs-tuple
A4-Tacks Sep 5, 2026
a9fd5e0
docs(core): correct ARMv8-M Baseline atomic CAS support
bardiharborow Sep 5, 2026
876f11b
Do not execute `llvm-config` in the `FileCheck` step when cross-compi…
Kobzol Sep 5, 2026
25d1870
Merge pull request #23297 from onlycs/follow-symlinks-proc-macro-dylibs
ChayimFriedman2 Sep 5, 2026
f85fa63
tempfile cannot be constructed
BenjaminBrienen Sep 5, 2026
0a706c9
Merge pull request #23292 from BenjaminBrienen/fix-tempfile-new
ChayimFriedman2 Sep 5, 2026
0d7e8dc
Merge pull request #22662 from ChayimFriedman2/term-search-unify
Veykril Sep 6, 2026
e6687dc
Merge pull request #23163 from ChayimFriedman2/isolated-self
Veykril Sep 6, 2026
1069fc2
Remove `reason_span` from `EvalConfigResult::False`
JonathanBrouwer Sep 6, 2026
8aa88d1
Add a regression test before improving the diagnostics
JonathanBrouwer Sep 6, 2026
2b57478
Use `reason` for tracked item diagnostics from `cfg_select!`
JonathanBrouwer Sep 6, 2026
44965fd
Point closure trait errors at captured values
Dnreikronos Aug 23, 2026
98d37eb
Only read closure captures from in-progress typeck results
Dnreikronos Sep 6, 2026
5332fa8
Add regression test for the closure capture note cycling on overflow
Dnreikronos Sep 6, 2026
d4e6b8f
fix bare urls split text
malezjaa Sep 6, 2026
ed9f5ed
Add a hint to the `nolimit` message
JonathanBrouwer Sep 6, 2026
eb7a027
remove EnumSizeOpt
RalfJung Sep 6, 2026
cf7c0ff
std: fix set_permissions_nofollow on espidf and horizon
devnexen Sep 6, 2026
ff72114
remove outdated UnsafeCell raw_get comment
RedDaedalus Sep 6, 2026
14989dc
add regression test for packus_epi16 issue
RalfJung Sep 5, 2026
805aaa1
docs: Ask for ABI documentation in the platform support template
tgross35 Sep 7, 2026
2ece704
Prepare for merging from rust-lang/rust
invalid-email-address Sep 7, 2026
57401f1
Merge ref '32d94cc9be3f' from rust-lang/rust
invalid-email-address Sep 7, 2026
a490ea6
Allow overriding `llvm-filecheck` even if LLVM is otherwise downloade…
Kobzol Sep 5, 2026
13c9cca
Merge pull request #23303 from rust-lang/rustc-pull
lnicola Sep 7, 2026
d742397
delay unexpected successful goal during ambiguity reporting
amirHdev Sep 6, 2026
e146212
Rollup merge of #162404 - lnicola:sync-from-ra, r=lnicola
jhpratt Sep 7, 2026
d6fc337
Rollup merge of #161624 - Dnreikronos:diagnostics/closure_capture_sou…
jhpratt Sep 7, 2026
4e27adb
Rollup merge of #161697 - folkertdev:complex-sparc64-powerpc64, r=Joh…
jhpratt Sep 7, 2026
29c965e
Rollup merge of #162182 - amirHdev:skip-stale-stalled-obligations, r=…
jhpratt Sep 7, 2026
6f615a9
Rollup merge of #162328 - Kobzol:bootstrap-filecheck-relax, r=jieyouxu
jhpratt Sep 7, 2026
845de7e
Rollup merge of #162367 - JonathanBrouwer:cfg_select, r=estebank
jhpratt Sep 7, 2026
aad585b
Rollup merge of #162381 - malezjaa:fix-bare-urls-split-text, r=notriddle
jhpratt Sep 7, 2026
746c779
Rollup merge of #162388 - devnexen:espidf_set_permissions_fix, r=Dark…
jhpratt Sep 7, 2026
4e8672f
Rollup merge of #162319 - bardiharborow:docs/fix-thumbv8m-atomic-cas,…
jhpratt Sep 7, 2026
d8d5fa2
Rollup merge of #162341 - RalfJung:stdarch-regression-test, r=folkertdev
jhpratt Sep 7, 2026
d757a55
Rollup merge of #162383 - JonathanBrouwer:nolimit, r=jieyouxu
jhpratt Sep 7, 2026
f86d0cf
Rollup merge of #162384 - RalfJung:EnumSizeOpt, r=saethlin
jhpratt Sep 7, 2026
7165577
Rollup merge of #162390 - RedDaedalus:fix-raw-get-comment, r=RalfJung
jhpratt Sep 7, 2026
1ad8f9b
Rollup merge of #162397 - tgross35:platform-support-abi, r=jieyouxu
jhpratt Sep 7, 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
54 changes: 28 additions & 26 deletions compiler/rustc_abi/src/layout/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_macros::StableHash;

use crate::layout::{FieldIdx, VariantIdx};
use crate::{
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche, Numeric,
PointeeInfo, Primitive, Size, Variants,
};

Expand Down Expand Up @@ -229,12 +229,12 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
}

/// Returns `true` if this type needs to match the ABI of the C `_Complex` type. See
/// [`TyAndLayout::complex_number_primitive`] for details.
/// [`TyAndLayout::complex_number`] for details.
pub fn is_complex_number<C>(self, cx: &C) -> bool
where
Ty: TyAbiInterface<'a, C> + Copy,
{
self.complex_number_primitive(cx).is_some()
self.complex_number(cx).is_some()
}

pub fn is_scalable_vector<C>(self) -> bool
Expand Down Expand Up @@ -302,9 +302,11 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
}

/// If this type should match the ABI of the C `_Complex` type, returns the primitive that is
/// used for its parts. This only returns `Some(T)` for `core::num::Complex<T>` where `T` is
/// used for its components.
///
/// This function only returns `Some(T)` for `core::num::Complex<T>` where `T` is
/// either a float or an integer. `repr(transparent)` wrapper types are automatically handled.
pub fn complex_number_primitive<C>(&self, cx: &C) -> Option<Primitive>
pub fn complex_number<C>(&self, cx: &C) -> Option<Numeric>
where
Ty: TyAbiInterface<'a, C> + Copy,
{
Expand All @@ -313,35 +315,35 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
return None;
}

let part = complex.field(cx, 0).peel_transparent_wrappers(cx);

if let BackendRepr::Scalar(scalar) = part.backend_repr {
// Only Complex<{ float }> and Complex<{ integer }> have special layout.
let primitive = scalar.primitive();
match primitive {
// Explicitly spell out all the float types so that any new ones have to be added to
// one of the match branches.
Primitive::Int(..)
| Primitive::Float(Float::F16 | Float::F32 | Float::F64 | Float::F128) => {
Some(primitive)
}
Primitive::Pointer(..) => None,
let component = complex.field(cx, 0).peel_transparent_wrappers(cx);

let BackendRepr::Scalar(scalar) = component.backend_repr else {
return None;
};

// Only Complex<{ float }> and Complex<{ integer }> have special layout.
//
// Explicitly spell out all the float types so that any new ones have to be added to
// one of the match branches.
let primitive = scalar.primitive();
match primitive {
Primitive::Int(integer, is_signed) => Some(Numeric::Int(integer, is_signed)),
Primitive::Float(float @ (Float::F16 | Float::F32 | Float::F64 | Float::F128)) => {
Some(Numeric::Float(float))
}
} else {
None
Primitive::Pointer(..) => None,
}
}

/// Returns `Some` if this type has the ABI of the C `_Complex` type with float parts. See
/// [`TyAndLayout::complex_number_primitive`] for details.
/// Returns `Some` if this type has the ABI of the C `_Complex` type with float components.
/// See [`TyAndLayout::complex_number`] for details.
pub fn complex_float<C>(&self, cx: &C) -> Option<Float>
where
Ty: TyAbiInterface<'a, C> + Copy,
{
if let Some(Primitive::Float(float)) = self.complex_number_primitive(cx) {
Some(float)
} else {
None
match self.complex_number(cx) {
Some(Numeric::Float(float)) => Some(float),
_ => None,
}
}

Expand Down
25 changes: 25 additions & 0 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,31 @@ impl Float {
}
}

/// Numeric primitives.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "nightly", derive(StableHash))]
pub enum Numeric {
/// The `bool` is the signedness of the `Integer` type.
Int(Integer, bool),
Float(Float),
}

impl Numeric {
pub fn size(self) -> Size {
match self {
Numeric::Int(integer, _) => integer.size(),
Numeric::Float(float) => float.size(),
}
}

pub fn reg_kind(self) -> RegKind {
match self {
Numeric::Int(_, _) => RegKind::Integer,
Numeric::Float(_) => RegKind::Float,
}
}
}

/// Fundamental unit of memory access and layout.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "nightly", derive(StableHash))]
Expand Down
27 changes: 12 additions & 15 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,42 +237,39 @@ pub fn eval_config_entry(sess: &Session, cfg_entry: &CfgEntry) -> EvalConfigResu
}
EvalConfigResult::True
}
CfgEntry::Any(subs, span) => {
CfgEntry::Any(subs, _) => {
for sub in subs {
let res = eval_config_entry(sess, sub);
if res.as_bool() {
return res;
}
}
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
EvalConfigResult::False { reason: cfg_entry.clone() }
}
CfgEntry::Not(sub, span) => {
CfgEntry::Not(sub, _) => {
if eval_config_entry(sess, sub).as_bool() {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
EvalConfigResult::False { reason: cfg_entry.clone() }
} else {
EvalConfigResult::True
}
}
CfgEntry::Bool(b, span) => {
CfgEntry::Bool(b, _) => {
if *b {
EvalConfigResult::True
} else {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
EvalConfigResult::False { reason: cfg_entry.clone() }
}
}
CfgEntry::NameValue { name, value, span } => {
CfgEntry::NameValue { name, value, span: _ } => {
if sess.config.contains(&(*name, *value)) {
EvalConfigResult::True
} else {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
EvalConfigResult::False { reason: cfg_entry.clone() }
}
}
CfgEntry::Version(min_version, version_span) => {
CfgEntry::Version(min_version, _) => {
let Some(min_version) = min_version else {
return EvalConfigResult::False {
reason: cfg_entry.clone(),
reason_span: *version_span,
};
return EvalConfigResult::False { reason: cfg_entry.clone() };
};
// See https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454 for details
let min_version_ok = if sess.opts.unstable_opts.assume_incomplete_release {
Expand All @@ -283,15 +280,15 @@ pub fn eval_config_entry(sess: &Session, cfg_entry: &CfgEntry) -> EvalConfigResu
if min_version_ok {
EvalConfigResult::True
} else {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *version_span }
EvalConfigResult::False { reason: cfg_entry.clone() }
}
}
}
}

pub enum EvalConfigResult {
True,
False { reason: CfgEntry, reason_span: Span },
False { reason: CfgEntry },
}

impl EvalConfigResult {
Expand Down
16 changes: 11 additions & 5 deletions compiler/rustc_attr_parsing/src/attributes/cfg_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use rustc_span::{ErrorGuaranteed, Span, Symbol, sym};
use crate::attributes::AttributeSafety;
use crate::parser::{AllowExprMetavar, MetaItemOrLitParser};
use crate::{
AttributeParser, AttributeTemplate, ParsedDescription, ShouldEmit, diagnostics, parse_cfg_entry,
AttributeParser, AttributeTemplate, EvalConfigResult, ParsedDescription, ShouldEmit,
diagnostics, parse_cfg_entry,
};

#[derive(Clone)]
Expand Down Expand Up @@ -49,11 +50,16 @@ impl CfgSelectBranches {
/// or the wildcard if none of the reachable branches satisfied the predicate.
pub fn pop_first_match<F>(&mut self, predicate: F) -> Option<(CfgEntry, TokenStream, Span)>
where
F: Fn(&CfgEntry) -> bool,
F: Fn(&CfgEntry) -> EvalConfigResult,
{
for (index, (cfg, _, _)) in self.reachable.iter().enumerate() {
if predicate(cfg) {
return Some(self.reachable.remove(index));
for (index, (cfg, _, _)) in self.reachable.iter_mut().enumerate() {
match predicate(cfg) {
EvalConfigResult::True => {
return Some(self.reachable.remove(index));
}
EvalConfigResult::False { reason } => {
*cfg = reason;
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_builtin_macros/src/cfg_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc_ast::tokenstream::TokenStream;
use rustc_ast::{AttrKind, Expr, SyntheticAttr, ast};
use rustc_attr_ir::CfgEntry;
use rustc_attr_parsing as attr;
use rustc_attr_parsing::{CfgSelectBranches, EvalConfigResult, parse_cfg_select};
use rustc_attr_parsing::{CfgSelectBranches, parse_cfg_select};
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacResult, MacroExpanderResult};
use rustc_expand::expand::DeclaredIdents;
use rustc_span::{Ident, Span, sym};
Expand Down Expand Up @@ -129,9 +129,7 @@ pub(super) fn expand_cfg_select<'cx>(
) {
Ok(mut branches) => {
if let Some((cfg_entry, selected_tts, selected_span)) =
branches.pop_first_match(|cfg| {
matches!(attr::eval_config_entry(ecx.sess, cfg), EvalConfigResult::True)
})
branches.pop_first_match(|cfg| attr::eval_config_entry(ecx.sess, cfg))
{
let mac = CfgSelectResult {
ecx,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2366,13 +2366,13 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
let res = self.expand_cfg_true(&mut node, attr, pos);
match res {
EvalConfigResult::True => continue,
EvalConfigResult::False { reason, reason_span } => {
EvalConfigResult::False { reason } => {
for ident in node.declared_idents() {
self.cx.resolver.append_stripped_cfg_item(
self.cx.current_expansion.lint_node_id,
ident,
reason.clone(),
reason_span,
reason.span(),
)
}
}
Expand Down
Loading
Loading