Skip to content

Commit 412be32

Browse files
committed
Auto merge of #166141 - JonathanBrouwer:rollup-ZQcXVqU, r=JonathanBrouwer
Rollup of 15 pull requests Successful merges: - #166037 (reflection: enable tool attributes to be reflectable) - #165465 (Use `emit_ptr_va_arg` for `va_arg` on M68k) - #166042 (Fix out of scope method suggestion) - #166090 (bootstrap: rebuild LLD when LLVM changes) - #159795 (Introduce `-Z pack-coroutine-layout` flag) - #163556 (arm: only f32 and f64 are valid HFA bases) - #164665 (Add Reference annotations for inline assembly) - #165725 (change target modifier errors to use the diagnostic APIs instead of structs) - #165912 (simplify `fluent_value_from_str_list_sep_by_and`) - #165982 (compiler: Stop special-casing `report_in_external_macro` in `declare_tool_lint!`) - #166006 (Detect method shadowed by another when accessing a field or calling method that isn't found in method chain) - #166083 (Record seeds in the appropriate order) - #166104 (abi/bad-custom.rs: make test run on all editions) - #166124 (platform-support: add amaanq as powerpc64-unknown-linux-gnuelfv2 maintainer) - #166127 (Add tests from failed attempt at implementing `hir::Param` move) Failed merges: - #165094 (reflection: doc attributes from adts, fields, and variants)
2 parents 6c587fd + abceb21 commit 412be32

196 files changed

Lines changed: 4106 additions & 2049 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,19 +1811,6 @@ dependencies = [
18111811
"zerovec",
18121812
]
18131813

1814-
[[package]]
1815-
name = "icu_list"
1816-
version = "2.3.0"
1817-
source = "registry+https://github.com/rust-lang/crates.io-index"
1818-
checksum = "5a5c625125085fac4bf9ad111888a90c6ab9dc7bcaec392ca79cab417f46e3fb"
1819-
dependencies = [
1820-
"icu_provider",
1821-
"regex-automata",
1822-
"serde",
1823-
"writeable",
1824-
"zerovec",
1825-
]
1826-
18271814
[[package]]
18281815
name = "icu_locale_core"
18291816
version = "2.3.0"
@@ -1832,32 +1819,11 @@ checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
18321819
dependencies = [
18331820
"displaydoc",
18341821
"litemap",
1835-
"serde",
18361822
"tinystr",
18371823
"writeable",
18381824
"zerovec",
18391825
]
18401826

1841-
[[package]]
1842-
name = "icu_locale_fallback"
1843-
version = "2.3.0"
1844-
source = "registry+https://github.com/rust-lang/crates.io-index"
1845-
checksum = "251af8e57c9400e3eb58242fe5b8b1152b2a64fdf4cf632f923c38ccee6f2fa9"
1846-
dependencies = [
1847-
"icu_locale_core",
1848-
"icu_locale_fallback_data",
1849-
"icu_provider",
1850-
"potential_utf",
1851-
"tinystr",
1852-
"zerovec",
1853-
]
1854-
1855-
[[package]]
1856-
name = "icu_locale_fallback_data"
1857-
version = "2.3.0"
1858-
source = "registry+https://github.com/rust-lang/crates.io-index"
1859-
checksum = "decf2a22ec8fa68f1a0c1129a3f8583f8f8bc24e8b9ccbe98ead99f62a4dc3a8"
1860-
18611827
[[package]]
18621828
name = "icu_normalizer"
18631829
version = "2.2.0"
@@ -1906,8 +1872,6 @@ checksum = "92a7ed671a6aad807a8651a2e1782a6598fda9ce5185dd8158549e95a91c6428"
19061872
dependencies = [
19071873
"displaydoc",
19081874
"icu_locale_core",
1909-
"serde",
1910-
"stable_deref_trait",
19111875
"writeable",
19121876
"yoke",
19131877
"zerofrom",
@@ -3106,8 +3070,6 @@ version = "0.1.4"
31063070
source = "registry+https://github.com/rust-lang/crates.io-index"
31073071
checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
31083072
dependencies = [
3109-
"serde_core",
3110-
"writeable",
31113073
"zerovec",
31123074
]
31133075

@@ -3713,6 +3675,7 @@ dependencies = [
37133675
"rustc_ast_pretty",
37143676
"rustc_data_structures",
37153677
"rustc_error_messages",
3678+
"rustc_lint_defs",
37163679
"rustc_macros",
37173680
"rustc_serialize",
37183681
"rustc_span",
@@ -3745,16 +3708,6 @@ dependencies = [
37453708
"thin-vec",
37463709
]
37473710

3748-
[[package]]
3749-
name = "rustc_baked_icu_data"
3750-
version = "0.0.0"
3751-
dependencies = [
3752-
"icu_list",
3753-
"icu_locale_fallback",
3754-
"icu_provider",
3755-
"zerovec",
3756-
]
3757-
37583711
[[package]]
37593712
name = "rustc_borrowck"
37603713
version = "0.0.0"
@@ -4028,10 +3981,6 @@ name = "rustc_error_messages"
40283981
version = "0.0.0"
40293982
dependencies = [
40303983
"fluent-bundle",
4031-
"icu_list",
4032-
"icu_locale_core",
4033-
"intl-memoizer",
4034-
"rustc_baked_icu_data",
40353984
"rustc_data_structures",
40363985
"rustc_macros",
40373986
"rustc_serialize",
@@ -7008,7 +6957,6 @@ dependencies = [
70086957
"displaydoc",
70096958
"yoke",
70106959
"zerofrom",
7011-
"zerovec",
70126960
]
70136961

70146962
[[package]]

‎compiler/rustc_abi/src/layout.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::num::NonZero;
44
use std::ops::Deref;
55
use std::range::{RangeFrom, RangeToInclusive};
66

7+
pub use coroutine::PackCoroutineLayout;
78
use rustc_hashes::Hash64;
89
use rustc_index::Idx;
910
use rustc_index::bit_set::BitMatrix;

‎compiler/rustc_abi/src/layout/coroutine.rs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ use crate::{
3030
StructKind, TagEncoding, VariantLayout, Variants, WrappingRange,
3131
};
3232

33+
/// This option controls how coroutine saved locals are packed
34+
/// into the coroutine state data
35+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
36+
#[cfg_attr(
37+
feature = "nightly",
38+
derive(
39+
rustc_macros::Encodable_NoContext,
40+
rustc_macros::Decodable_NoContext,
41+
rustc_macros::StableHash,
42+
)
43+
)]
44+
pub enum PackCoroutineLayout {
45+
/// The classic layout where captures are always promoted to coroutine state prefix
46+
#[default]
47+
Classic,
48+
/// Captures are first saved into the `UNRESUMED` state and promoted
49+
/// when they are used across more than one suspension
50+
CapturesOnly,
51+
}
52+
3353
/// Overlap eligibility and variant assignment for each CoroutineSavedLocal.
3454
#[derive(Clone, Debug, PartialEq)]
3555
enum SavedLocalEligibility<VariantIdx, FieldIdx> {

‎compiler/rustc_abi/src/lib.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ pub use canon_abi::{ArmCall, CanonAbi, InterruptKind, X86Call};
7272
#[cfg(feature = "nightly")]
7373
pub use extern_abi::CVariadicStatus;
7474
pub use extern_abi::{ExternAbi, all_names};
75-
pub use layout::{FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorError, VariantIdx};
75+
pub use layout::{
76+
FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorError, PackCoroutineLayout,
77+
VariantIdx,
78+
};
7679
#[cfg(feature = "nightly")]
7780
pub use layout::{Layout, TyAbiInterface, TyAndLayout};
7881
pub use wrapping_range::WrappingRange;

‎compiler/rustc_attr_ir/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ rustc_ast = { path = "../rustc_ast" }
1010
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1111
rustc_data_structures = { path = "../rustc_data_structures" }
1212
rustc_error_messages = { path = "../rustc_error_messages" }
13+
rustc_lint_defs = { path = "../rustc_lint_defs" }
1314
rustc_macros = { path = "../rustc_macros" }
1415
rustc_serialize = { path = "../rustc_serialize" }
1516
rustc_span = { path = "../rustc_span" }

‎compiler/rustc_attr_ir/src/attr.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustc_ast::token::DocFragmentKind;
55
use rustc_ast::{AttrStyle, DelimArgs, MetaItemLit, ast, join_path_idents};
66
use rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher};
77
use rustc_error_messages::{DiagArgValue, IntoDiagArg};
8+
use rustc_lint_defs::ToolOptions;
89
use rustc_macros::{Decodable, Encodable, StableHash};
910
use rustc_span::{AttrId, DUMMY_SP, Ident, Span, Symbol};
1011

@@ -112,7 +113,7 @@ pub enum Attribute {
112113
///
113114
/// Tool attributes, with the exception of diagnostic attributes, are not converted into a
114115
/// parsed form.
115-
Tool(Box<AttrItem>),
116+
Tool { item: Box<AttrItem>, opts: ToolOptions },
116117

117118
/// A derive helper attribute.
118119
///
@@ -125,7 +126,7 @@ pub enum Attribute {
125126
impl Attribute {
126127
pub fn value_lit(&self) -> Option<&MetaItemLit> {
127128
match &self {
128-
Attribute::Tool(n) | Attribute::DeriveHelper(n) => match n.as_ref() {
129+
Attribute::Tool { item: n, .. } | Attribute::DeriveHelper(n) => match n.as_ref() {
129130
AttrItem { args: AttrArgs::Eq { eq_span: _, expr }, .. } => Some(expr),
130131
_ => None,
131132
},
@@ -135,7 +136,7 @@ impl Attribute {
135136

136137
pub fn is_prefix_attr_for_suggestions(&self) -> bool {
137138
match self {
138-
Attribute::Tool(attr) | Attribute::DeriveHelper(attr) => {
139+
Attribute::Tool { item: attr, .. } | Attribute::DeriveHelper(attr) => {
139140
attr.span.desugaring_kind().is_none()
140141
}
141142
// Other parsed attributes that can appear on expressions originate from source and

‎compiler/rustc_attr_ir/src/data_structures.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_ast::token::DocFragmentKind;
1212
use rustc_ast::{AttrStyle, Path, ast};
1313
use rustc_data_structures::fx::FxIndexMap;
1414
use rustc_error_messages::{DiagArgValue, IntoDiagArg};
15+
use rustc_lint_defs::ToolOptions;
1516
use rustc_macros::{
1617
Decodable, Decodable_NoContext, Encodable, Encodable_NoContext, PrintAttribute, StableHash,
1718
};
@@ -1167,8 +1168,8 @@ pub enum AttributeKind {
11671168

11681169
/// Represents `#[register_attribute_tool]`, `#[register_lint_tool]` and `#[register_tool]`
11691170
RegisterTool {
1170-
attr_tools: ThinVec<Ident>,
1171-
lint_tools: ThinVec<Ident>,
1171+
attr_tools: ThinVec<(Ident, ToolOptions)>,
1172+
lint_tools: ThinVec<(Ident, ToolOptions)>,
11721173
},
11731174

11741175
/// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations).

‎compiler/rustc_attr_ir/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ macro_rules! find_attr {
132132
$crate::Attribute::Parsed($pattern) $(if $guard)? => {
133133
break 'done Some($e);
134134
}
135-
$crate::Attribute::Tool(..) | $crate::Attribute::DeriveHelper(..) => {}
135+
$crate::Attribute::Tool {..} | $crate::Attribute::DeriveHelper(..) => {}
136136
// In lint emitting, there's a specific exception for this warning.
137137
// It's not usually emitted from inside macros from other crates
138138
// (see https://github.com/rust-lang/rust/issues/110613)

‎compiler/rustc_attr_ir/src/pretty_printing.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use rustc_ast::token::{CommentKind, DocFragmentKind};
1111
use rustc_ast::{AttrId, AttrStyle, IntTy, UintTy};
1212
use rustc_ast_pretty::pp::Printer;
1313
use rustc_data_structures::fx::FxIndexMap;
14+
use rustc_lint_defs::{Reflectiveness, ToolOptions};
1415
use rustc_span::def_id::DefId;
1516
use rustc_span::hygiene::Transparency;
1617
use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol};
@@ -226,4 +227,6 @@ print_debug!(
226227
NativeLibKind,
227228
CollapseMacroDebuginfo,
228229
LintName,
230+
ToolOptions,
231+
Reflectiveness,
229232
);

‎compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl AttributeParser for NakedParser {
294294
if other_attr
295295
.segments()
296296
.next()
297-
.is_some_and(|i| tools.iter().any(|tool| tool.name == i.name))
297+
.is_some_and(|i| tools.iter().any(|(tool, _)| tool.name == i.name))
298298
{
299299
// effectively skips the error message being emitted below
300300
// if it's a tool attribute

0 commit comments

Comments
 (0)