Auto merge of #148492 - pmur:murp/ppc-relax-r29-inlineasm, r=Amanieu
Relax r29 inline asm restriction on PowerPC64 targets
LLVM uses r29 to hold a base pointer for some PowerPC target configurations. It is usable on all 64 bit targets as a callee save register.
r? `@Amanieu`
diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs
index 1435681..b078fc9 100644
--- a/compiler/rustc_abi/src/layout.rs
+++ b/compiler/rustc_abi/src/layout.rs
@@ -812,7 +812,7 @@ fn layout_of_enum<
let (max, min) = largest_niche
// We might have no inhabited variants, so pretend there's at least one.
.unwrap_or((0, 0));
- let (min_ity, signed) = discr_range_of_repr(min, max); //Integer::repr_discr(tcx, ty, &repr, min, max);
+ let (min_ity, signed) = discr_range_of_repr(min, max); //Integer::discr_range_of_repr(tcx, ty, &repr, min, max);
let mut align = dl.aggregate_align;
let mut max_repr_align = repr.align;
diff --git a/compiler/rustc_abi/src/layout/ty.rs b/compiler/rustc_abi/src/layout/ty.rs
index 8d3c10f..ca2753ea 100644
--- a/compiler/rustc_abi/src/layout/ty.rs
+++ b/compiler/rustc_abi/src/layout/ty.rs
@@ -172,6 +172,8 @@ fn ty_and_layout_pointee_info_at(
fn is_tuple(this: TyAndLayout<'a, Self>) -> bool;
fn is_unit(this: TyAndLayout<'a, Self>) -> bool;
fn is_transparent(this: TyAndLayout<'a, Self>) -> bool;
+ /// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
+ fn is_pass_indirectly_in_non_rustic_abis_flag_set(this: TyAndLayout<'a, Self>) -> bool;
}
impl<'a, Ty> TyAndLayout<'a, Ty> {
@@ -269,6 +271,30 @@ pub fn is_transparent<C>(self) -> bool
Ty::is_transparent(self)
}
+ /// If this method returns `true`, then this type should always have a `PassMode` of
+ /// `Indirect { on_stack: false, .. }` when being used as the argument type of a function with a
+ /// non-Rustic ABI (this is true for structs annotated with the
+ /// `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute).
+ ///
+ /// This is used to replicate some of the behaviour of C array-to-pointer decay; however unlike
+ /// C any changes the caller makes to the passed value will not be reflected in the callee, so
+ /// the attribute is only useful for types where observing the value in the caller after the
+ /// function call isn't allowed (a.k.a. `va_list`).
+ ///
+ /// This function handles transparent types automatically.
+ pub fn pass_indirectly_in_non_rustic_abis<C>(mut self, cx: &C) -> bool
+ where
+ Ty: TyAbiInterface<'a, C> + Copy,
+ {
+ while self.is_transparent()
+ && let Some((_, field)) = self.non_1zst_field(cx)
+ {
+ self = field;
+ }
+
+ Ty::is_pass_indirectly_in_non_rustic_abis_flag_set(self)
+ }
+
/// Finds the one field that is not a 1-ZST.
/// Returns `None` if there are multiple non-1-ZST fields or only 1-ZST-fields.
pub fn non_1zst_field<C>(&self, cx: &C) -> Option<(FieldIdx, Self)>
diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs
index de44c87..1dc4441 100644
--- a/compiler/rustc_abi/src/lib.rs
+++ b/compiler/rustc_abi/src/lib.rs
@@ -88,14 +88,17 @@ impl ReprFlags: u8 {
const IS_C = 1 << 0;
const IS_SIMD = 1 << 1;
const IS_TRANSPARENT = 1 << 2;
- // Internal only for now. If true, don't reorder fields.
- // On its own it does not prevent ABI optimizations.
+ /// Internal only for now. If true, don't reorder fields.
+ /// On its own it does not prevent ABI optimizations.
const IS_LINEAR = 1 << 3;
- // If true, the type's crate has opted into layout randomization.
- // Other flags can still inhibit reordering and thus randomization.
- // The seed stored in `ReprOptions.field_shuffle_seed`.
+ /// If true, the type's crate has opted into layout randomization.
+ /// Other flags can still inhibit reordering and thus randomization.
+ /// The seed stored in `ReprOptions.field_shuffle_seed`.
const RANDOMIZE_LAYOUT = 1 << 4;
- // Any of these flags being set prevent field reordering optimisation.
+ /// If true, the type is always passed indirectly by non-Rustic ABIs.
+ /// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
+ const PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS = 1 << 5;
+ /// Any of these flags being set prevent field reordering optimisation.
const FIELD_ORDER_UNOPTIMIZABLE = ReprFlags::IS_C.bits()
| ReprFlags::IS_SIMD.bits()
| ReprFlags::IS_LINEAR.bits();
@@ -183,6 +186,11 @@ pub fn linear(&self) -> bool {
/// Returns the discriminant type, given these `repr` options.
/// This must only be called on enums!
+ ///
+ /// This is the "typeck type" of the discriminant, which is effectively the maximum size:
+ /// discriminant values will be wrapped to fit (with a lint). Layout can later decide to use a
+ /// smaller type for the tag that stores the discriminant at runtime and that will work just
+ /// fine, it just induces casts when getting/setting the discriminant.
pub fn discr_type(&self) -> IntegerType {
self.int.unwrap_or(IntegerType::Pointer(true))
}
diff --git a/compiler/rustc_attr_parsing/src/attributes/cfg.rs b/compiler/rustc_attr_parsing/src/attributes/cfg.rs
index dab9e76..47b46cd 100644
--- a/compiler/rustc_attr_parsing/src/attributes/cfg.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/cfg.rs
@@ -12,13 +12,14 @@
use rustc_session::lint::BuiltinLintDiag;
use rustc_session::lint::builtin::UNEXPECTED_CFGS;
use rustc_session::parse::{ParseSess, feature_err};
-use rustc_span::{Span, Symbol, sym};
+use rustc_span::{ErrorGuaranteed, Span, Symbol, sym};
use thin_vec::ThinVec;
use crate::context::{AcceptContext, ShouldEmit, Stage};
use crate::parser::{ArgParser, MetaItemListParser, MetaItemOrLitParser, NameValueParser};
use crate::session_diagnostics::{
AttributeParseError, AttributeParseErrorReason, CfgAttrBadDelim, MetaBadDelimSugg,
+ ParsedDescription,
};
use crate::{
AttributeParser, CfgMatchesLintEmitter, fluent_generated, parse_version, session_diagnostics,
@@ -47,20 +48,19 @@ pub fn parse_cfg<'c, S: Stage>(
cx.expected_single_argument(list.span);
return None;
};
- parse_cfg_entry(cx, single)
+ parse_cfg_entry(cx, single).ok()
}
-pub(crate) fn parse_cfg_entry<S: Stage>(
+pub fn parse_cfg_entry<S: Stage>(
cx: &mut AcceptContext<'_, '_, S>,
item: &MetaItemOrLitParser<'_>,
-) -> Option<CfgEntry> {
- Some(match item {
+) -> Result<CfgEntry, ErrorGuaranteed> {
+ Ok(match item {
MetaItemOrLitParser::MetaItemParser(meta) => match meta.args() {
ArgParser::List(list) => match meta.path().word_sym() {
Some(sym::not) => {
let Some(single) = list.single() else {
- cx.expected_single_argument(list.span);
- return None;
+ return Err(cx.expected_single_argument(list.span));
};
CfgEntry::Not(Box::new(parse_cfg_entry(cx, single)?), list.span)
}
@@ -75,29 +75,24 @@ pub(crate) fn parse_cfg_entry<S: Stage>(
Some(sym::target) => parse_cfg_entry_target(cx, list, meta.span())?,
Some(sym::version) => parse_cfg_entry_version(cx, list, meta.span())?,
_ => {
- cx.emit_err(session_diagnostics::InvalidPredicate {
+ return Err(cx.emit_err(session_diagnostics::InvalidPredicate {
span: meta.span(),
predicate: meta.path().to_string(),
- });
- return None;
+ }));
}
},
a @ (ArgParser::NoArgs | ArgParser::NameValue(_)) => {
let Some(name) = meta.path().word_sym() else {
- cx.expected_identifier(meta.path().span());
- return None;
+ return Err(cx.expected_identifier(meta.path().span()));
};
parse_name_value(name, meta.path().span(), a.name_value(), meta.span(), cx)?
}
},
MetaItemOrLitParser::Lit(lit) => match lit.kind {
LitKind::Bool(b) => CfgEntry::Bool(b, lit.span),
- _ => {
- cx.expected_identifier(lit.span);
- return None;
- }
+ _ => return Err(cx.expected_identifier(lit.span)),
},
- MetaItemOrLitParser::Err(_, _) => return None,
+ MetaItemOrLitParser::Err(_, err) => return Err(*err),
})
}
@@ -105,19 +100,22 @@ fn parse_cfg_entry_version<S: Stage>(
cx: &mut AcceptContext<'_, '_, S>,
list: &MetaItemListParser<'_>,
meta_span: Span,
-) -> Option<CfgEntry> {
+) -> Result<CfgEntry, ErrorGuaranteed> {
try_gate_cfg(sym::version, meta_span, cx.sess(), cx.features_option());
let Some(version) = list.single() else {
- cx.emit_err(session_diagnostics::ExpectedSingleVersionLiteral { span: list.span });
- return None;
+ return Err(
+ cx.emit_err(session_diagnostics::ExpectedSingleVersionLiteral { span: list.span })
+ );
};
let Some(version_lit) = version.lit() else {
- cx.emit_err(session_diagnostics::ExpectedVersionLiteral { span: version.span() });
- return None;
+ return Err(
+ cx.emit_err(session_diagnostics::ExpectedVersionLiteral { span: version.span() })
+ );
};
let Some(version_str) = version_lit.value_str() else {
- cx.emit_err(session_diagnostics::ExpectedVersionLiteral { span: version_lit.span });
- return None;
+ return Err(
+ cx.emit_err(session_diagnostics::ExpectedVersionLiteral { span: version_lit.span })
+ );
};
let min_version = parse_version(version_str).or_else(|| {
@@ -127,14 +125,14 @@ fn parse_cfg_entry_version<S: Stage>(
None
});
- Some(CfgEntry::Version(min_version, list.span))
+ Ok(CfgEntry::Version(min_version, list.span))
}
fn parse_cfg_entry_target<S: Stage>(
cx: &mut AcceptContext<'_, '_, S>,
list: &MetaItemListParser<'_>,
meta_span: Span,
-) -> Option<CfgEntry> {
+) -> Result<CfgEntry, ErrorGuaranteed> {
if let Some(features) = cx.features_option()
&& !features.cfg_target_compact()
{
@@ -161,17 +159,16 @@ fn parse_cfg_entry_target<S: Stage>(
// Then, parse it as a name-value item
let Some(name) = sub_item.path().word_sym() else {
- cx.expected_identifier(sub_item.path().span());
- return None;
+ return Err(cx.expected_identifier(sub_item.path().span()));
};
let name = Symbol::intern(&format!("target_{name}"));
- if let Some(cfg) =
+ if let Ok(cfg) =
parse_name_value(name, sub_item.path().span(), Some(nv), sub_item.span(), cx)
{
result.push(cfg);
}
}
- Some(CfgEntry::All(result, list.span))
+ Ok(CfgEntry::All(result, list.span))
}
fn parse_name_value<S: Stage>(
@@ -180,21 +177,22 @@ fn parse_name_value<S: Stage>(
value: Option<&NameValueParser>,
span: Span,
cx: &mut AcceptContext<'_, '_, S>,
-) -> Option<CfgEntry> {
+) -> Result<CfgEntry, ErrorGuaranteed> {
try_gate_cfg(name, span, cx.sess(), cx.features_option());
let value = match value {
None => None,
Some(value) => {
let Some(value_str) = value.value_as_str() else {
- cx.expected_string_literal(value.value_span, Some(value.value_as_lit()));
- return None;
+ return Err(
+ cx.expected_string_literal(value.value_span, Some(value.value_as_lit()))
+ );
};
Some((value_str, value.value_span))
}
};
- Some(CfgEntry::NameValue { name, name_span, value, span })
+ Ok(CfgEntry::NameValue { name, name_span, value, span })
}
pub fn eval_config_entry(
@@ -355,7 +353,8 @@ pub fn parse_cfg_attr(
span,
attr_span: cfg_attr.span,
template: CFG_ATTR_TEMPLATE,
- attribute: AttrPath::from_ast(&cfg_attr.get_normal_item().path),
+ path: AttrPath::from_ast(&cfg_attr.get_normal_item().path),
+ description: ParsedDescription::Attribute,
reason,
suggestions: CFG_ATTR_TEMPLATE.suggestions(Some(cfg_attr.style), sym::cfg_attr),
});
@@ -398,6 +397,7 @@ fn parse_cfg_attr_internal<'a>(
.into_boxed_slice(),
span: attribute.span,
},
+ ParsedDescription::Attribute,
pred_span,
CRATE_NODE_ID,
features,
@@ -406,7 +406,8 @@ fn parse_cfg_attr_internal<'a>(
parse_cfg_entry,
&CFG_ATTR_TEMPLATE,
)
- .ok_or_else(|| {
+ .map_err(|_err: ErrorGuaranteed| {
+ // We have an `ErrorGuaranteed` so this delayed bug cannot fail, but we need a `Diag` for the `PResult` so we make one anyways
let mut diag = sess.dcx().struct_err(
"cfg_entry parsing failing with `ShouldEmit::ErrorsAndLints` should emit a error.",
);
diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
index f09b022..1270f87 100644
--- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
@@ -676,3 +676,12 @@ fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<At
Some(AttributeKind::Sanitize { on_set, off_set, span: cx.attr_span })
}
}
+
+pub(crate) struct RustcPassIndirectlyInNonRusticAbisParser;
+
+impl<S: Stage> NoArgsAttributeParser<S> for RustcPassIndirectlyInNonRusticAbisParser {
+ const PATH: &[Symbol] = &[sym::rustc_pass_indirectly_in_non_rustic_abis];
+ const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
+ const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Struct)]);
+ const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPassIndirectlyInNonRusticAbis;
+}
diff --git a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
index 797d04b..5a4a4e7 100644
--- a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
@@ -4,7 +4,7 @@
use rustc_session::Session;
use rustc_session::parse::feature_err;
use rustc_span::kw;
-use rustc_target::spec::BinaryFormat;
+use rustc_target::spec::{Arch, BinaryFormat};
use super::prelude::*;
use super::util::parse_single_integer;
@@ -396,7 +396,7 @@ fn parse_link_cfg<S: Stage>(
)
.emit();
}
- *cfg = parse_cfg_entry(cx, link_cfg);
+ *cfg = parse_cfg_entry(cx, link_cfg).ok();
true
}
@@ -438,7 +438,7 @@ fn parse_link_import_name_type<S: Stage>(
cx.expected_name_value(item.span(), Some(sym::import_name_type));
return true;
};
- if cx.sess().target.arch != "x86" {
+ if cx.sess().target.arch != Arch::X86 {
cx.emit_err(ImportNameTypeX86 { span: item.span() });
return true;
}
diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs
index 15904fd..a3473c6 100644
--- a/compiler/rustc_attr_parsing/src/context.rs
+++ b/compiler/rustc_attr_parsing/src/context.rs
@@ -20,8 +20,9 @@
use crate::attributes::body::CoroutineParser;
use crate::attributes::codegen_attrs::{
ColdParser, CoverageParser, ExportNameParser, ForceTargetFeatureParser, NakedParser,
- NoMangleParser, ObjcClassParser, ObjcSelectorParser, OptimizeParser, SanitizeParser,
- TargetFeatureParser, TrackCallerParser, UsedParser,
+ NoMangleParser, ObjcClassParser, ObjcSelectorParser, OptimizeParser,
+ RustcPassIndirectlyInNonRusticAbisParser, SanitizeParser, TargetFeatureParser,
+ TrackCallerParser, UsedParser,
};
use crate::attributes::confusables::ConfusablesParser;
use crate::attributes::crate_level::{
@@ -71,7 +72,9 @@
use crate::attributes::transparency::TransparencyParser;
use crate::attributes::{AttributeParser as _, Combine, Single, WithoutArgs};
use crate::parser::{ArgParser, PathParser};
-use crate::session_diagnostics::{AttributeParseError, AttributeParseErrorReason, UnknownMetaItem};
+use crate::session_diagnostics::{
+ AttributeParseError, AttributeParseErrorReason, ParsedDescription, UnknownMetaItem,
+};
use crate::target_checking::AllowedTargets;
type GroupType<S> = LazyLock<GroupTypeInner<S>>;
@@ -241,6 +244,7 @@ mod late {
Single<WithoutArgs<PubTransparentParser>>,
Single<WithoutArgs<RustcCoherenceIsCoreParser>>,
Single<WithoutArgs<RustcMainParser>>,
+ Single<WithoutArgs<RustcPassIndirectlyInNonRusticAbisParser>>,
Single<WithoutArgs<SpecializationTraitParser>>,
Single<WithoutArgs<StdInternalSymbolParser>>,
Single<WithoutArgs<TrackCallerParser>>,
@@ -353,6 +357,10 @@ pub struct AcceptContext<'f, 'sess, S: Stage> {
/// Whether it is an inner or outer attribute
pub(crate) attr_style: AttrStyle,
+ /// A description of the thing we are parsing using this attribute parser
+ /// We are not only using these parsers for attributes, but also for macros such as the `cfg!()` macro.
+ pub(crate) parsed_description: ParsedDescription,
+
/// The expected structure of the attribute.
///
/// Used in reporting errors to give a hint to users what the attribute *should* look like.
@@ -431,7 +439,8 @@ pub(crate) fn expected_string_literal(
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedStringLiteral {
byte_string: actual_literal.and_then(|i| {
i.kind.is_bytestr().then(|| self.sess().source_map().start_point(i.span))
@@ -446,7 +455,8 @@ pub(crate) fn expected_integer_literal(&self, span: Span) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedIntegerLiteral,
suggestions: self.suggestions(),
})
@@ -457,7 +467,8 @@ pub(crate) fn expected_list(&self, span: Span) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedList,
suggestions: self.suggestions(),
})
@@ -468,7 +479,8 @@ pub(crate) fn expected_no_args(&self, args_span: Span) -> ErrorGuaranteed {
span: args_span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedNoArgs,
suggestions: self.suggestions(),
})
@@ -480,7 +492,8 @@ pub(crate) fn expected_identifier(&self, span: Span) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedIdentifier,
suggestions: self.suggestions(),
})
@@ -493,7 +506,8 @@ pub(crate) fn expected_name_value(&self, span: Span, name: Option<Symbol>) -> Er
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedNameValue(name),
suggestions: self.suggestions(),
})
@@ -505,7 +519,8 @@ pub(crate) fn duplicate_key(&self, span: Span, key: Symbol) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::DuplicateKey(key),
suggestions: self.suggestions(),
})
@@ -518,7 +533,8 @@ pub(crate) fn unexpected_literal(&self, span: Span) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::UnexpectedLiteral,
suggestions: self.suggestions(),
})
@@ -529,7 +545,8 @@ pub(crate) fn expected_single_argument(&self, span: Span) -> ErrorGuaranteed {
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedSingleArgument,
suggestions: self.suggestions(),
})
@@ -540,7 +557,8 @@ pub(crate) fn expected_at_least_one_argument(&self, span: Span) -> ErrorGuarante
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedAtLeastOneArgument,
suggestions: self.suggestions(),
})
@@ -556,7 +574,8 @@ pub(crate) fn expected_specific_argument(
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedSpecificArgument {
possibilities,
strings: false,
@@ -577,7 +596,8 @@ pub(crate) fn expected_specific_argument_and_list(
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedSpecificArgument {
possibilities,
strings: false,
@@ -597,7 +617,8 @@ pub(crate) fn expected_specific_argument_strings(
span,
attr_span: self.attr_span,
template: self.template.clone(),
- attribute: self.attr_path.clone(),
+ path: self.attr_path.clone(),
+ description: self.parsed_description,
reason: AttributeParseErrorReason::ExpectedSpecificArgument {
possibilities,
strings: true,
diff --git a/compiler/rustc_attr_parsing/src/interface.rs b/compiler/rustc_attr_parsing/src/interface.rs
index 953b0eb..b7a6a1e 100644
--- a/compiler/rustc_attr_parsing/src/interface.rs
+++ b/compiler/rustc_attr_parsing/src/interface.rs
@@ -12,6 +12,7 @@
use crate::context::{AcceptContext, FinalizeContext, SharedContext, Stage};
use crate::parser::{ArgParser, MetaItemParser, PathParser};
+use crate::session_diagnostics::ParsedDescription;
use crate::{Early, Late, OmitDoc, ShouldEmit};
/// Context created once, for example as part of the ast lowering
@@ -145,6 +146,7 @@ pub fn parse_single<T>(
normal_attr.item.span(),
attr.style,
path.get_attribute_path(),
+ ParsedDescription::Attribute,
target_span,
target_node_id,
features,
@@ -163,14 +165,15 @@ pub fn parse_single_args<T, I>(
inner_span: Span,
attr_style: AttrStyle,
attr_path: AttrPath,
+ parsed_description: ParsedDescription,
target_span: Span,
target_node_id: NodeId,
features: Option<&'sess Features>,
emit_errors: ShouldEmit,
args: &I,
- parse_fn: fn(cx: &mut AcceptContext<'_, '_, Early>, item: &I) -> Option<T>,
+ parse_fn: fn(cx: &mut AcceptContext<'_, '_, Early>, item: &I) -> T,
template: &AttributeTemplate,
- ) -> Option<T> {
+ ) -> T {
let mut parser = Self {
features,
tools: Vec::new(),
@@ -190,6 +193,7 @@ pub fn parse_single_args<T, I>(
attr_span,
inner_span,
attr_style,
+ parsed_description,
template,
attr_path,
};
@@ -310,6 +314,7 @@ pub fn parse_attribute_list(
attr_span: lower_span(attr.span),
inner_span: lower_span(attr.get_normal_item().span()),
attr_style: attr.style,
+ parsed_description: ParsedDescription::Attribute,
template: &accept.template,
attr_path: path.get_attribute_path(),
};
diff --git a/compiler/rustc_attr_parsing/src/lib.rs b/compiler/rustc_attr_parsing/src/lib.rs
index bcd0d67..2e0c5be 100644
--- a/compiler/rustc_attr_parsing/src/lib.rs
+++ b/compiler/rustc_attr_parsing/src/lib.rs
@@ -106,12 +106,13 @@
pub mod validate_attr;
pub use attributes::cfg::{
- CFG_TEMPLATE, EvalConfigResult, eval_config_entry, parse_cfg, parse_cfg_attr,
+ CFG_TEMPLATE, EvalConfigResult, eval_config_entry, parse_cfg, parse_cfg_attr, parse_cfg_entry,
};
pub use attributes::cfg_old::*;
pub use attributes::util::{is_builtin_attr, is_doc_alias_attrs_contain_symbol, parse_version};
pub use context::{Early, Late, OmitDoc, ShouldEmit};
pub use interface::AttributeParser;
pub use lints::emit_attribute_lint;
+pub use session_diagnostics::ParsedDescription;
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs
index 82bd292..8d78350 100644
--- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs
+++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs
@@ -610,20 +610,35 @@ pub(crate) enum AttributeParseErrorReason<'a> {
ExpectedIdentifier,
}
+/// A description of a thing that can be parsed using an attribute parser.
+#[derive(Copy, Clone)]
+pub enum ParsedDescription {
+ /// Used when parsing attributes.
+ Attribute,
+ /// Used when parsing some macros, such as the `cfg!()` macro.
+ Macro,
+}
+
pub(crate) struct AttributeParseError<'a> {
pub(crate) span: Span,
pub(crate) attr_span: Span,
pub(crate) template: AttributeTemplate,
- pub(crate) attribute: AttrPath,
+ pub(crate) path: AttrPath,
+ pub(crate) description: ParsedDescription,
pub(crate) reason: AttributeParseErrorReason<'a>,
pub(crate) suggestions: Vec<String>,
}
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> {
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
- let name = self.attribute.to_string();
+ let name = self.path.to_string();
- let mut diag = Diag::new(dcx, level, format!("malformed `{name}` attribute input"));
+ let description = match self.description {
+ ParsedDescription::Attribute => "attribute",
+ ParsedDescription::Macro => "macro",
+ };
+
+ let mut diag = Diag::new(dcx, level, format!("malformed `{name}` {description} input"));
diag.span(self.attr_span);
diag.code(E0539);
match self.reason {
@@ -724,12 +739,12 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
diag.span_label(
self.span,
format!(
- "this attribute is only valid with {quote}{x}{quote} as an argument"
+ "this {description} is only valid with {quote}{x}{quote} as an argument"
),
);
}
[first, second] => {
- diag.span_label(self.span, format!("this attribute is only valid with either {quote}{first}{quote} or {quote}{second}{quote} as an argument"));
+ diag.span_label(self.span, format!("this {description} is only valid with either {quote}{first}{quote} or {quote}{second}{quote} as an argument"));
}
[first @ .., second_to_last, last] => {
let mut res = String::new();
@@ -740,7 +755,7 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
"{quote}{second_to_last}{quote} or {quote}{last}{quote}"
));
- diag.span_label(self.span, format!("this attribute is only valid with one of the following arguments: {res}"));
+ diag.span_label(self.span, format!("this {description} is only valid with one of the following arguments: {res}"));
}
}
}
@@ -756,9 +771,9 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
diag.span_suggestions(
self.attr_span,
if self.suggestions.len() == 1 {
- "must be of the form"
+ "must be of the form".to_string()
} else {
- "try changing it to one of the following valid forms of the attribute"
+ format!("try changing it to one of the following valid forms of the {description}")
},
self.suggestions,
Applicability::HasPlaceholders,
diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
index e23c7ee..2f011db 100644
--- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
@@ -150,8 +150,8 @@ pub(crate) fn report_mutability_error(
}
}
}
- PlaceRef { local: _, projection: [proj_base @ .., ProjectionElem::Deref] } => {
- if the_place_err.local == ty::CAPTURE_STRUCT_LOCAL
+ PlaceRef { local, projection: [proj_base @ .., ProjectionElem::Deref] } => {
+ if local == ty::CAPTURE_STRUCT_LOCAL
&& proj_base.is_empty()
&& !self.upvars.is_empty()
{
@@ -165,10 +165,8 @@ pub(crate) fn report_mutability_error(
", as `Fn` closures cannot mutate their captured variables".to_string()
}
} else {
- let source = self.borrowed_content_source(PlaceRef {
- local: the_place_err.local,
- projection: proj_base,
- });
+ let source =
+ self.borrowed_content_source(PlaceRef { local, projection: proj_base });
let pointer_type = source.describe_for_immutable_place(self.infcx.tcx);
opt_source = Some(source);
if let Some(desc) = self.describe_place(access_place.as_ref()) {
@@ -335,10 +333,18 @@ pub(crate) fn report_mutability_error(
LocalInfo::User(BindingForm::Var(mir::VarBindingForm {
binding_mode: BindingMode(ByRef::No, Mutability::Not),
opt_ty_info: Some(sp),
+ pat_span,
..
})) => {
if suggest {
err.span_note(sp, "the binding is already a mutable borrow");
+ err.span_suggestion_verbose(
+ pat_span.shrink_to_lo(),
+ "consider making the binding mutable if you need to reborrow \
+ multiple times",
+ "mut ".to_string(),
+ Applicability::MaybeIncorrect,
+ );
}
}
_ => {
@@ -356,9 +362,9 @@ pub(crate) fn report_mutability_error(
// give a best effort structured suggestion.
err.span_suggestion_verbose(
source_info.span.with_hi(source_info.span.lo() + BytePos(5)),
- "try removing `&mut` here",
+ "if there is only one mutable reborrow, remove the `&mut`",
"",
- Applicability::MachineApplicable,
+ Applicability::MaybeIncorrect,
);
} else {
// This can occur with things like `(&mut self).foo()`.
@@ -532,6 +538,7 @@ pub(crate) fn report_mutability_error(
PlaceRef { local, projection: [ProjectionElem::Deref] }
if local == ty::CAPTURE_STRUCT_LOCAL && !self.upvars.is_empty() =>
{
+ self.point_at_binding_outside_closure(&mut err, local, access_place);
self.expected_fn_found_fn_mut_call(&mut err, span, act);
}
@@ -950,6 +957,50 @@ fn visit_expr(&mut self, e: &'tcx hir::Expr<'tcx>) -> Self::Result {
}
}
+ /// When modifying a binding from inside of an `Fn` closure, point at the binding definition.
+ fn point_at_binding_outside_closure(
+ &self,
+ err: &mut Diag<'_>,
+ local: Local,
+ access_place: Place<'tcx>,
+ ) {
+ let place = access_place.as_ref();
+ for (index, elem) in place.projection.into_iter().enumerate() {
+ if let ProjectionElem::Deref = elem {
+ if index == 0 {
+ if self.body.local_decls[local].is_ref_for_guard() {
+ continue;
+ }
+ if let LocalInfo::StaticRef { .. } = *self.body.local_decls[local].local_info()
+ {
+ continue;
+ }
+ }
+ if let Some(field) = self.is_upvar_field_projection(PlaceRef {
+ local,
+ projection: place.projection.split_at(index + 1).0,
+ }) {
+ let var_index = field.index();
+ let upvar = self.upvars[var_index];
+ if let Some(hir_id) = upvar.info.capture_kind_expr_id {
+ let node = self.infcx.tcx.hir_node(hir_id);
+ if let hir::Node::Expr(expr) = node
+ && let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = expr.kind
+ && let hir::def::Res::Local(hir_id) = path.res
+ && let hir::Node::Pat(pat) = self.infcx.tcx.hir_node(hir_id)
+ {
+ let name = upvar.to_string(self.infcx.tcx);
+ err.span_label(
+ pat.span,
+ format!("`{name}` declared here, outside the closure"),
+ );
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
/// Targeted error when encountering an `FnMut` closure where an `Fn` closure was expected.
fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str) {
err.span_label(sp, format!("cannot {act}"));
@@ -962,6 +1013,7 @@ fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str)
let def_id = tcx.hir_enclosing_body_owner(fn_call_id);
let mut look_at_return = true;
+ err.span_label(closure_span, "in this closure");
// If the HIR node is a function or method call, get the DefId
// of the callee function or method, the span, and args of the call expr
let get_call_details = || {
@@ -1032,7 +1084,6 @@ fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str)
if let Some(span) = arg {
err.span_label(span, "change this to accept `FnMut` instead of `Fn`");
err.span_label(call_span, "expects `Fn` instead of `FnMut`");
- err.span_label(closure_span, "in this closure");
look_at_return = false;
}
}
@@ -1059,7 +1110,6 @@ fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str)
sig.decl.output.span(),
"change this to return `FnMut` instead of `Fn`",
);
- err.span_label(closure_span, "in this closure");
}
_ => {}
}
diff --git a/compiler/rustc_builtin_macros/src/cfg.rs b/compiler/rustc_builtin_macros/src/cfg.rs
index 85b8ef7..3873996 100644
--- a/compiler/rustc_builtin_macros/src/cfg.rs
+++ b/compiler/rustc_builtin_macros/src/cfg.rs
@@ -2,13 +2,18 @@
//! a literal `true` or `false` based on whether the given cfg matches the
//! current compilation environment.
-use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
-use rustc_errors::PResult;
+use rustc_ast::{AttrStyle, CRATE_NODE_ID, token};
+use rustc_attr_parsing as attr;
+use rustc_attr_parsing::parser::MetaItemOrLitParser;
+use rustc_attr_parsing::{
+ AttributeParser, CFG_TEMPLATE, ParsedDescription, ShouldEmit, parse_cfg_entry,
+};
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult};
+use rustc_hir::AttrPath;
+use rustc_hir::attrs::CfgEntry;
use rustc_parse::exp;
-use rustc_span::Span;
-use {rustc_ast as ast, rustc_attr_parsing as attr};
+use rustc_span::{ErrorGuaranteed, Ident, Span};
use crate::errors;
@@ -21,38 +26,49 @@ pub(crate) fn expand_cfg(
ExpandResult::Ready(match parse_cfg(cx, sp, tts) {
Ok(cfg) => {
- let matches_cfg = attr::cfg_matches(
+ let matches_cfg = attr::eval_config_entry(
+ cx.sess,
&cfg,
- &cx.sess,
cx.current_expansion.lint_node_id,
Some(cx.ecfg.features),
- );
+ ShouldEmit::ErrorsAndLints,
+ )
+ .as_bool();
+
MacEager::expr(cx.expr_bool(sp, matches_cfg))
}
- Err(err) => {
- let guar = err.emit();
- DummyResult::any(sp, guar)
- }
+ Err(guar) => DummyResult::any(sp, guar),
})
}
-fn parse_cfg<'a>(
- cx: &ExtCtxt<'a>,
- span: Span,
- tts: TokenStream,
-) -> PResult<'a, ast::MetaItemInner> {
- let mut p = cx.new_parser_from_tts(tts);
-
- if p.token == token::Eof {
- return Err(cx.dcx().create_err(errors::RequiresCfgPattern { span }));
+fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry, ErrorGuaranteed> {
+ let mut parser = cx.new_parser_from_tts(tts);
+ if parser.token == token::Eof {
+ return Err(cx.dcx().emit_err(errors::RequiresCfgPattern { span }));
}
- let cfg = p.parse_meta_item_inner()?;
+ let meta = MetaItemOrLitParser::parse_single(&mut parser, ShouldEmit::ErrorsAndLints)
+ .map_err(|diag| diag.emit())?;
+ let cfg = AttributeParser::parse_single_args(
+ cx.sess,
+ span,
+ span,
+ AttrStyle::Inner,
+ AttrPath { segments: vec![Ident::from_str("cfg")].into_boxed_slice(), span },
+ ParsedDescription::Macro,
+ span,
+ CRATE_NODE_ID,
+ Some(cx.ecfg.features),
+ ShouldEmit::ErrorsAndLints,
+ &meta,
+ parse_cfg_entry,
+ &CFG_TEMPLATE,
+ )?;
- let _ = p.eat(exp!(Comma));
+ let _ = parser.eat(exp!(Comma));
- if !p.eat(exp!(Eof)) {
- return Err(cx.dcx().create_err(errors::OneCfgPattern { span }));
+ if !parser.eat(exp!(Eof)) {
+ return Err(cx.dcx().emit_err(errors::OneCfgPattern { span }));
}
Ok(cfg)
diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
index 9a9a1f4..d7f1779 100644
--- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
@@ -20,6 +20,7 @@
use rustc_session::Session;
use rustc_span::source_map::Spanned;
use rustc_target::callconv::{FnAbi, PassMode};
+use rustc_target::spec::Arch;
use smallvec::SmallVec;
use self::pass_mode::*;
@@ -155,7 +156,7 @@ pub(crate) fn lib_call(
let ret = self.lib_call_unadjusted(name, params, returns, &args)[0];
Cow::Owned(vec![codegen_bitcast(self, types::I128, ret)])
- } else if ret_single_i128 && self.tcx.sess.target.arch == "s390x" {
+ } else if ret_single_i128 && self.tcx.sess.target.arch == Arch::S390x {
// Return i128 using a return area pointer on s390x.
let mut params = params;
let mut args = args.to_vec();
@@ -641,7 +642,7 @@ fn adjust_call_for_c_variadic<'tcx>(
.flat_map(|arg_abi| arg_abi.get_abi_param(fx.tcx).into_iter()),
);
- if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == "aarch64" {
+ if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == Arch::AArch64 {
// Add any padding arguments needed for Apple AArch64.
// There's no need to pad the argument list unless variadic arguments are actually being
// passed.
@@ -787,25 +788,25 @@ pub(crate) fn codegen_drop<'tcx>(
pub(crate) fn lib_call_arg_param(tcx: TyCtxt<'_>, ty: Type, is_signed: bool) -> AbiParam {
let param = AbiParam::new(ty);
if ty.is_int() && u64::from(ty.bits()) < tcx.data_layout.pointer_size().bits() {
- match (&*tcx.sess.target.arch, &*tcx.sess.target.vendor) {
- ("x86_64", _) | ("aarch64", "apple") => match (ty, is_signed) {
+ match (&tcx.sess.target.arch, tcx.sess.target.vendor.as_ref()) {
+ (Arch::X86_64, _) | (Arch::AArch64, "apple") => match (ty, is_signed) {
(types::I8 | types::I16, true) => param.sext(),
(types::I8 | types::I16, false) => param.uext(),
_ => param,
},
- ("aarch64", _) => param,
- ("riscv64", _) => match (ty, is_signed) {
+ (Arch::AArch64, _) => param,
+ (Arch::RiscV64, _) => match (ty, is_signed) {
(types::I32, _) | (_, true) => param.sext(),
_ => param.uext(),
},
- ("s390x", _) => {
+ (Arch::S390x, _) => {
if is_signed {
param.sext()
} else {
param.uext()
}
}
- _ => unimplemented!("{:?}", tcx.sess.target.arch),
+ (arch, _) => unimplemented!("{arch:?}"),
}
} else {
param
diff --git a/compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs b/compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs
index 1e202be..c0f6d9d 100644
--- a/compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs
+++ b/compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs
@@ -1,8 +1,10 @@
+use rustc_target::spec::Arch;
+
use crate::prelude::*;
pub(crate) fn f16_to_f32(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
let (value, arg_ty) =
- if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == "x86_64" {
+ if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64 {
(
fx.bcx.ins().bitcast(types::I16, MemFlags::new(), value),
lib_call_arg_param(fx.tcx, types::I16, false),
@@ -19,7 +21,8 @@ fn f16_to_f64(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
}
pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
- let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == "x86_64" {
+ let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
+ {
types::I16
} else {
types::F16
@@ -34,7 +37,8 @@ pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value
}
fn f64_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
- let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == "x86_64" {
+ let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
+ {
types::I16
} else {
types::F16
diff --git a/compiler/rustc_codegen_cranelift/src/common.rs b/compiler/rustc_codegen_cranelift/src/common.rs
index 81b1814..de3d2f3 100644
--- a/compiler/rustc_codegen_cranelift/src/common.rs
+++ b/compiler/rustc_codegen_cranelift/src/common.rs
@@ -8,7 +8,7 @@
};
use rustc_span::source_map::Spanned;
use rustc_target::callconv::FnAbi;
-use rustc_target::spec::{HasTargetSpec, Target};
+use rustc_target::spec::{Arch, HasTargetSpec, Target};
use crate::constant::ConstantCx;
use crate::debuginfo::FunctionDebugContext;
@@ -373,7 +373,7 @@ pub(crate) fn create_stack_slot(&mut self, size: u32, align: u32) -> Pointer {
"size must be a multiple of alignment (size={size}, align={align})"
);
- let abi_align = if self.tcx.sess.target.arch == "s390x" { 8 } else { 16 };
+ let abi_align = if self.tcx.sess.target.arch == Arch::S390x { 8 } else { 16 };
if align <= abi_align {
let stack_slot = self.bcx.create_sized_stack_slot(StackSlotData {
kind: StackSlotKind::ExplicitSlot,
diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs
index 6281089..ca41381 100644
--- a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs
+++ b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs
@@ -2,6 +2,7 @@
use cranelift_codegen::ir::immediates::Offset32;
use rustc_abi::Endian;
+use rustc_middle::ty::SimdAlign;
use super::*;
use crate::prelude::*;
@@ -960,6 +961,15 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
let lane_clif_ty = fx.clif_type(val_lane_ty).unwrap();
let ptr_val = ptr.load_scalar(fx);
+ let alignment = generic_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment();
+
+ let memflags = match alignment {
+ SimdAlign::Unaligned => MemFlags::new().with_notrap(),
+ _ => MemFlags::trusted(),
+ };
+
for lane_idx in 0..val_lane_count {
let val_lane = val.value_lane(fx, lane_idx).load_scalar(fx);
let mask_lane = mask.value_lane(fx, lane_idx).load_scalar(fx);
@@ -972,7 +982,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
fx.bcx.switch_to_block(if_enabled);
let offset = lane_idx as i32 * lane_clif_ty.bytes() as i32;
- fx.bcx.ins().store(MemFlags::trusted(), val_lane, ptr_val, Offset32::new(offset));
+ fx.bcx.ins().store(memflags, val_lane, ptr_val, Offset32::new(offset));
fx.bcx.ins().jump(next, &[]);
fx.bcx.seal_block(next);
@@ -996,6 +1006,15 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
let lane_clif_ty = fx.clif_type(val_lane_ty).unwrap();
let ret_lane_layout = fx.layout_of(ret_lane_ty);
+ let alignment = generic_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment();
+
+ let memflags = match alignment {
+ SimdAlign::Unaligned => MemFlags::new().with_notrap(),
+ _ => MemFlags::trusted(),
+ };
+
for lane_idx in 0..ptr_lane_count {
let val_lane = val.value_lane(fx, lane_idx).load_scalar(fx);
let ptr_lane = ptr.value_lane(fx, lane_idx).load_scalar(fx);
@@ -1011,7 +1030,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
fx.bcx.seal_block(if_disabled);
fx.bcx.switch_to_block(if_enabled);
- let res = fx.bcx.ins().load(lane_clif_ty, MemFlags::trusted(), ptr_lane, 0);
+ let res = fx.bcx.ins().load(lane_clif_ty, memflags, ptr_lane, 0);
fx.bcx.ins().jump(next, &[res.into()]);
fx.bcx.switch_to_block(if_disabled);
diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs
index 5d48d0c..5c23cd0 100644
--- a/compiler/rustc_codegen_cranelift/src/lib.rs
+++ b/compiler/rustc_codegen_cranelift/src/lib.rs
@@ -50,6 +50,7 @@
use rustc_session::Session;
use rustc_session::config::OutputFilenames;
use rustc_span::{Symbol, sym};
+use rustc_target::spec::Arch;
pub use crate::config::*;
use crate::prelude::*;
@@ -186,20 +187,20 @@ fn init(&self, sess: &Session) {
fn target_config(&self, sess: &Session) -> TargetConfig {
// FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
- let target_features = if sess.target.arch == "x86_64" && sess.target.os != "none" {
- // x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
- vec![sym::fxsr, sym::sse, sym::sse2, Symbol::intern("x87")]
- } else if sess.target.arch == "aarch64" {
- match &*sess.target.os {
+ let target_features = match sess.target.arch {
+ Arch::X86_64 if sess.target.os != "none" => {
+ // x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
+ vec![sym::fxsr, sym::sse, sym::sse2, Symbol::intern("x87")]
+ }
+ Arch::AArch64 => match &*sess.target.os {
"none" => vec![],
// On macOS the aes, sha2 and sha3 features are enabled by default and ring
// fails to compile on macOS when they are not present.
"macos" => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
// AArch64 mandates Neon support
_ => vec![sym::neon],
- }
- } else {
- vec![]
+ },
+ _ => vec![],
};
// FIXME do `unstable_target_features` properly
let unstable_target_features = target_features.clone();
@@ -208,14 +209,14 @@ fn target_config(&self, sess: &Session) -> TargetConfig {
// Windows, whereas LLVM 21+ and Cranelift pass it indirectly. This means that `f128` won't
// work when linking against a LLVM-built sysroot.
let has_reliable_f128 = !sess.target.is_like_windows;
- let has_reliable_f16 = match &*sess.target.arch {
+ let has_reliable_f16 = match sess.target.arch {
// FIXME(f16_f128): LLVM 20 does not support `f16` on s390x, meaning the required
// builtins are not available in `compiler-builtins`.
- "s390x" => false,
+ Arch::S390x => false,
// FIXME(f16_f128): `rustc_codegen_llvm` currently disables support on Windows GNU
// targets due to GCC using a different ABI than LLVM. Therefore `f16` won't be
// available when using a LLVM-built sysroot.
- "x86_64"
+ Arch::X86_64
if sess.target.os == "windows"
&& sess.target.env == "gnu"
&& sess.target.abi != "llvm" =>
diff --git a/compiler/rustc_codegen_gcc/src/abi.rs b/compiler/rustc_codegen_gcc/src/abi.rs
index 0b359f1..bcc28e4 100644
--- a/compiler/rustc_codegen_gcc/src/abi.rs
+++ b/compiler/rustc_codegen_gcc/src/abi.rs
@@ -12,6 +12,8 @@
#[cfg(feature = "master")]
use rustc_session::config;
use rustc_target::callconv::{ArgAttributes, CastTarget, FnAbi, PassMode};
+#[cfg(feature = "master")]
+use rustc_target::spec::Arch;
use crate::builder::Builder;
use crate::context::CodegenCx;
@@ -238,7 +240,7 @@ fn gcc_cconv(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Option<FnAttribute<'gcc>> {
}
#[cfg(feature = "master")]
-pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &str) -> Option<FnAttribute<'gcc>> {
+pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &Arch) -> Option<FnAttribute<'gcc>> {
let attribute = match conv {
CanonAbi::C | CanonAbi::Rust => return None,
CanonAbi::RustCold => FnAttribute::Cold,
@@ -251,15 +253,11 @@ pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &str) -> Option<FnAttrib
ArmCall::CCmseNonSecureEntry => FnAttribute::ArmCmseNonsecureEntry,
ArmCall::Aapcs => FnAttribute::ArmPcs("aapcs"),
},
- CanonAbi::GpuKernel => {
- if arch == "amdgpu" {
- FnAttribute::GcnAmdGpuHsaKernel
- } else if arch == "nvptx64" {
- FnAttribute::NvptxKernel
- } else {
- panic!("Architecture {} does not support GpuKernel calling convention", arch);
- }
- }
+ CanonAbi::GpuKernel => match arch {
+ &Arch::AmdGpu => FnAttribute::GcnAmdGpuHsaKernel,
+ &Arch::Nvptx64 => FnAttribute::NvptxKernel,
+ arch => panic!("Arch {arch} does not support GpuKernel calling convention"),
+ },
// TODO(antoyo): check if those AVR attributes are mapped correctly.
CanonAbi::Interrupt(interrupt_kind) => match interrupt_kind {
InterruptKind::Avr => FnAttribute::AvrSignal,
diff --git a/compiler/rustc_codegen_gcc/src/attributes.rs b/compiler/rustc_codegen_gcc/src/attributes.rs
index 04b43bb..5df1dc4 100644
--- a/compiler/rustc_codegen_gcc/src/attributes.rs
+++ b/compiler/rustc_codegen_gcc/src/attributes.rs
@@ -9,6 +9,8 @@
#[cfg(feature = "master")]
use rustc_middle::mir::TerminatorKind;
use rustc_middle::ty;
+#[cfg(feature = "master")]
+use rustc_target::spec::Arch;
use crate::context::CodegenCx;
use crate::gcc_util::to_gcc_features;
@@ -70,7 +72,7 @@ fn inline_attr<'gcc, 'tcx>(
InlineAttr::Hint => Some(FnAttribute::Inline),
InlineAttr::Force { .. } => Some(FnAttribute::AlwaysInline),
InlineAttr::Never => {
- if cx.sess().target.arch != "amdgpu" {
+ if cx.sess().target.arch != Arch::AmdGpu {
Some(FnAttribute::NoInline)
} else {
None
@@ -153,8 +155,8 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
.join(",");
if !target_features.is_empty() {
#[cfg(feature = "master")]
- match cx.sess().target.arch.as_ref() {
- "x86" | "x86_64" | "powerpc" => {
+ match cx.sess().target.arch {
+ Arch::X86 | Arch::X86_64 | Arch::PowerPC => {
func.add_attribute(FnAttribute::Target(&target_features))
}
// The target attribute is not supported on other targets in GCC.
diff --git a/compiler/rustc_codegen_gcc/src/base.rs b/compiler/rustc_codegen_gcc/src/base.rs
index e8672f4..0a0f0ed 100644
--- a/compiler/rustc_codegen_gcc/src/base.rs
+++ b/compiler/rustc_codegen_gcc/src/base.rs
@@ -15,9 +15,9 @@
use rustc_middle::ty::TyCtxt;
use rustc_session::config::DebugInfo;
use rustc_span::Symbol;
-use rustc_target::spec::RelocModel;
#[cfg(feature = "master")]
use rustc_target::spec::SymbolVisibility;
+use rustc_target::spec::{Arch, RelocModel};
use crate::builder::Builder;
use crate::context::CodegenCx;
@@ -116,7 +116,7 @@ fn module_codegen(
.map(|string| &string[1..])
.collect();
- if !disabled_features.contains("avx") && tcx.sess.target.arch == "x86_64" {
+ if !disabled_features.contains("avx") && tcx.sess.target.arch == Arch::X86_64 {
// NOTE: we always enable AVX because the equivalent of llvm.x86.sse2.cmp.pd in GCC for
// SSE2 is multiple builtins, so we use the AVX __builtin_ia32_cmppd instead.
// FIXME(antoyo): use the proper builtins for llvm.x86.sse2.cmp.pd and similar.
diff --git a/compiler/rustc_codegen_gcc/src/gcc_util.rs b/compiler/rustc_codegen_gcc/src/gcc_util.rs
index 702704d..e33b6c9 100644
--- a/compiler/rustc_codegen_gcc/src/gcc_util.rs
+++ b/compiler/rustc_codegen_gcc/src/gcc_util.rs
@@ -3,6 +3,7 @@
use rustc_codegen_ssa::target_features;
use rustc_data_structures::smallvec::{SmallVec, smallvec};
use rustc_session::Session;
+use rustc_target::spec::Arch;
fn gcc_features_by_flags(sess: &Session, features: &mut Vec<String>) {
target_features::retpoline_features_by_flags(sess, features);
@@ -65,44 +66,47 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
// To find a list of GCC's names, check https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
pub fn to_gcc_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]> {
- let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch };
// cSpell:disable
- match (arch, s) {
+ match (&sess.target.arch, s) {
// FIXME: seems like x87 does not exist?
- ("x86", "x87") => smallvec![],
- ("x86", "sse4.2") => smallvec!["sse4.2", "crc32"],
- ("x86", "pclmulqdq") => smallvec!["pclmul"],
- ("x86", "rdrand") => smallvec!["rdrnd"],
- ("x86", "bmi1") => smallvec!["bmi"],
- ("x86", "cmpxchg16b") => smallvec!["cx16"],
- ("x86", "avx512vaes") => smallvec!["vaes"],
- ("x86", "avx512gfni") => smallvec!["gfni"],
- ("x86", "avx512vpclmulqdq") => smallvec!["vpclmulqdq"],
+ (&Arch::X86 | &Arch::X86_64, "x87") => smallvec![],
+ (&Arch::X86 | &Arch::X86_64, "sse4.2") => smallvec!["sse4.2", "crc32"],
+ (&Arch::X86 | &Arch::X86_64, "pclmulqdq") => smallvec!["pclmul"],
+ (&Arch::X86 | &Arch::X86_64, "rdrand") => smallvec!["rdrnd"],
+ (&Arch::X86 | &Arch::X86_64, "bmi1") => smallvec!["bmi"],
+ (&Arch::X86 | &Arch::X86_64, "cmpxchg16b") => smallvec!["cx16"],
+ (&Arch::X86 | &Arch::X86_64, "avx512vaes") => smallvec!["vaes"],
+ (&Arch::X86 | &Arch::X86_64, "avx512gfni") => smallvec!["gfni"],
+ (&Arch::X86 | &Arch::X86_64, "avx512vpclmulqdq") => smallvec!["vpclmulqdq"],
// NOTE: seems like GCC requires 'avx512bw' for 'avx512vbmi2'.
- ("x86", "avx512vbmi2") => smallvec!["avx512vbmi2", "avx512bw"],
+ (&Arch::X86 | &Arch::X86_64, "avx512vbmi2") => {
+ smallvec!["avx512vbmi2", "avx512bw"]
+ }
// NOTE: seems like GCC requires 'avx512bw' for 'avx512bitalg'.
- ("x86", "avx512bitalg") => smallvec!["avx512bitalg", "avx512bw"],
- ("aarch64", "rcpc2") => smallvec!["rcpc-immo"],
- ("aarch64", "dpb") => smallvec!["ccpp"],
- ("aarch64", "dpb2") => smallvec!["ccdp"],
- ("aarch64", "frintts") => smallvec!["fptoint"],
- ("aarch64", "fcma") => smallvec!["complxnum"],
- ("aarch64", "pmuv3") => smallvec!["perfmon"],
- ("aarch64", "paca") => smallvec!["pauth"],
- ("aarch64", "pacg") => smallvec!["pauth"],
+ (&Arch::X86 | &Arch::X86_64, "avx512bitalg") => {
+ smallvec!["avx512bitalg", "avx512bw"]
+ }
+ (&Arch::AArch64, "rcpc2") => smallvec!["rcpc-immo"],
+ (&Arch::AArch64, "dpb") => smallvec!["ccpp"],
+ (&Arch::AArch64, "dpb2") => smallvec!["ccdp"],
+ (&Arch::AArch64, "frintts") => smallvec!["fptoint"],
+ (&Arch::AArch64, "fcma") => smallvec!["complxnum"],
+ (&Arch::AArch64, "pmuv3") => smallvec!["perfmon"],
+ (&Arch::AArch64, "paca") => smallvec!["pauth"],
+ (&Arch::AArch64, "pacg") => smallvec!["pauth"],
// Rust ties fp and neon together. In GCC neon implicitly enables fp,
// but we manually enable neon when a feature only implicitly enables fp
- ("aarch64", "f32mm") => smallvec!["f32mm", "neon"],
- ("aarch64", "f64mm") => smallvec!["f64mm", "neon"],
- ("aarch64", "fhm") => smallvec!["fp16fml", "neon"],
- ("aarch64", "fp16") => smallvec!["fullfp16", "neon"],
- ("aarch64", "jsconv") => smallvec!["jsconv", "neon"],
- ("aarch64", "sve") => smallvec!["sve", "neon"],
- ("aarch64", "sve2") => smallvec!["sve2", "neon"],
- ("aarch64", "sve2-aes") => smallvec!["sve2-aes", "neon"],
- ("aarch64", "sve2-sm4") => smallvec!["sve2-sm4", "neon"],
- ("aarch64", "sve2-sha3") => smallvec!["sve2-sha3", "neon"],
- ("aarch64", "sve2-bitperm") => smallvec!["sve2-bitperm", "neon"],
+ (&Arch::AArch64, "f32mm") => smallvec!["f32mm", "neon"],
+ (&Arch::AArch64, "f64mm") => smallvec!["f64mm", "neon"],
+ (&Arch::AArch64, "fhm") => smallvec!["fp16fml", "neon"],
+ (&Arch::AArch64, "fp16") => smallvec!["fullfp16", "neon"],
+ (&Arch::AArch64, "jsconv") => smallvec!["jsconv", "neon"],
+ (&Arch::AArch64, "sve") => smallvec!["sve", "neon"],
+ (&Arch::AArch64, "sve2") => smallvec!["sve2", "neon"],
+ (&Arch::AArch64, "sve2-aes") => smallvec!["sve2-aes", "neon"],
+ (&Arch::AArch64, "sve2-sm4") => smallvec!["sve2-sm4", "neon"],
+ (&Arch::AArch64, "sve2-sha3") => smallvec!["sve2-sha3", "neon"],
+ (&Arch::AArch64, "sve2-bitperm") => smallvec!["sve2-bitperm", "neon"],
(_, s) => smallvec![s],
}
// cSpell:enable
diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs
index 71500de..9f5b03c 100644
--- a/compiler/rustc_codegen_gcc/src/lib.rs
+++ b/compiler/rustc_codegen_gcc/src/lib.rs
@@ -103,7 +103,7 @@
use rustc_session::Session;
use rustc_session::config::{OptLevel, OutputFilenames};
use rustc_span::Symbol;
-use rustc_target::spec::RelocModel;
+use rustc_target::spec::{Arch, RelocModel};
use tempfile::TempDir;
use crate::back::lto::ModuleBuffer;
@@ -249,7 +249,7 @@ fn target_config(&self, sess: &Session) -> TargetConfig {
fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
let context = Context::default();
- if tcx.sess.target.arch == "x86" || tcx.sess.target.arch == "x86_64" {
+ if matches!(tcx.sess.target.arch, Arch::X86 | Arch::X86_64) {
context.add_command_line_option("-masm=intel");
}
#[cfg(feature = "master")]
diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs
index e03c286..e6b76f7 100644
--- a/compiler/rustc_codegen_llvm/src/abi.rs
+++ b/compiler/rustc_codegen_llvm/src/abi.rs
@@ -16,7 +16,7 @@
use rustc_target::callconv::{
ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, PassMode,
};
-use rustc_target::spec::SanitizerSet;
+use rustc_target::spec::{Arch, SanitizerSet};
use smallvec::SmallVec;
use crate::attributes::{self, llfn_attrs_from_instance};
@@ -528,6 +528,28 @@ fn apply_attrs_llfn(
let ii = apply(b);
if let BackendRepr::ScalarPair(scalar_a, scalar_b) = arg.layout.backend_repr {
apply_range_attr(llvm::AttributePlace::Argument(i), scalar_a);
+ let primitive_b = scalar_b.primitive();
+ let scalar_b = if let rustc_abi::Primitive::Int(int, false) = primitive_b
+ && let ty::Ref(_, pointee_ty, _) = *arg.layout.ty.kind()
+ && let ty::Slice(element_ty) = *pointee_ty.kind()
+ && let elem_size = cx.layout_of(element_ty).size
+ && elem_size != rustc_abi::Size::ZERO
+ {
+ // Ideally the layout calculations would have set the range,
+ // but that's complicated due to cycles, so in the mean time
+ // we calculate and apply it here.
+ debug_assert!(scalar_b.is_always_valid(cx));
+ let isize_max = int.signed_max() as u64;
+ rustc_abi::Scalar::Initialized {
+ value: primitive_b,
+ valid_range: rustc_abi::WrappingRange {
+ start: 0,
+ end: u128::from(isize_max / elem_size.bytes()),
+ },
+ }
+ } else {
+ scalar_b
+ };
apply_range_attr(llvm::AttributePlace::Argument(ii), scalar_b);
}
}
@@ -676,16 +698,11 @@ pub(crate) fn to_llvm_calling_convention(sess: &Session, abi: CanonAbi) -> llvm:
// possible to declare an `extern "custom"` block, so the backend still needs a calling
// convention for declaring foreign functions.
CanonAbi::Custom => llvm::CCallConv,
- CanonAbi::GpuKernel => {
- let arch = sess.target.arch.as_ref();
- if arch == "amdgpu" {
- llvm::AmdgpuKernel
- } else if arch == "nvptx64" {
- llvm::PtxKernel
- } else {
- panic!("Architecture {arch} does not support GpuKernel calling convention");
- }
- }
+ CanonAbi::GpuKernel => match &sess.target.arch {
+ Arch::AmdGpu => llvm::AmdgpuKernel,
+ Arch::Nvptx64 => llvm::PtxKernel,
+ arch => panic!("Architecture {arch} does not support GpuKernel calling convention"),
+ },
CanonAbi::Interrupt(interrupt_kind) => match interrupt_kind {
InterruptKind::Avr => llvm::AvrInterrupt,
InterruptKind::AvrNonBlocking => llvm::AvrNonBlockingInterrupt,
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 209b8ef..ff9607e 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -7,7 +7,7 @@
use rustc_middle::ty::{self, TyCtxt};
use rustc_session::config::{BranchProtection, FunctionReturn, OptLevel, PAuthKey, PacRet};
use rustc_symbol_mangling::mangle_internal_symbol;
-use rustc_target::spec::{FramePointer, SanitizerSet, StackProbeType, StackProtector};
+use rustc_target::spec::{Arch, FramePointer, SanitizerSet, StackProbeType, StackProtector};
use smallvec::SmallVec;
use crate::context::SimpleCx;
@@ -54,7 +54,7 @@ pub(crate) fn inline_attr<'ll, 'tcx>(
Some(AttributeKind::AlwaysInline.create_attr(cx.llcx))
}
InlineAttr::Never => {
- if tcx.sess.target.arch != "amdgpu" {
+ if tcx.sess.target.arch != Arch::AmdGpu {
Some(AttributeKind::NoInline.create_attr(cx.llcx))
} else {
None
@@ -229,7 +229,7 @@ fn instrument_function_attr<'ll>(
}
fn nojumptables_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll Attribute> {
- if !sess.opts.unstable_opts.no_jump_tables {
+ if sess.opts.cg.jump_tables {
return None;
}
@@ -287,7 +287,7 @@ fn stackprotector_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll A
}
fn backchain_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll Attribute> {
- if sess.target.arch != "s390x" {
+ if sess.target.arch != Arch::S390x {
return None;
}
@@ -423,7 +423,7 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
if let Some(BranchProtection { bti, pac_ret, gcs }) =
sess.opts.unstable_opts.branch_protection
{
- assert!(sess.target.arch == "aarch64");
+ assert!(sess.target.arch == Arch::AArch64);
if bti {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
}
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index cfbb954..c1874a1 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -25,7 +25,9 @@
self, Lto, OutputType, Passes, RemapPathScopeComponents, SplitDwarfKind, SwitchWithOptPath,
};
use rustc_span::{BytePos, InnerSpan, Pos, SpanData, SyntaxContext, sym};
-use rustc_target::spec::{CodeModel, FloatAbi, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
+use rustc_target::spec::{
+ Arch, CodeModel, FloatAbi, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel,
+};
use tracing::{debug, trace};
use crate::back::lto::ThinBuffer;
@@ -206,7 +208,7 @@ pub(crate) fn target_machine_factory(
let reloc_model = to_llvm_relocation_model(sess.relocation_model());
let (opt_level, _) = to_llvm_opt_settings(optlvl);
- let float_abi = if sess.target.arch == "arm" && sess.opts.cg.soft_float {
+ let float_abi = if sess.target.arch == Arch::Arm && sess.opts.cg.soft_float {
llvm::FloatAbi::Soft
} else {
// `validate_commandline_args_with_session_available` has already warned about this being
@@ -451,7 +453,7 @@ fn report_inline_asm(
llvm::DiagnosticLevel::Warning => Level::Warning,
llvm::DiagnosticLevel::Note | llvm::DiagnosticLevel::Remark => Level::Note,
};
- let msg = msg.strip_prefix("error: ").unwrap_or(&msg).to_string();
+ let msg = msg.trim_prefix("error: ").to_string();
cgcx.diag_emitter.inline_asm_error(span, msg, level, source);
}
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 49d38e0..d441cd1 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -26,7 +26,7 @@
use rustc_session::config::OptLevel;
use rustc_span::Span;
use rustc_target::callconv::{FnAbi, PassMode};
-use rustc_target::spec::{HasTargetSpec, SanitizerSet, Target};
+use rustc_target::spec::{Arch, HasTargetSpec, SanitizerSet, Target};
use smallvec::SmallVec;
use tracing::{debug, instrument};
@@ -839,11 +839,10 @@ fn store_with_flags(
// operation. But it's not clear how to do that with LLVM.)
// For more context, see <https://github.com/rust-lang/rust/issues/114582> and
// <https://github.com/llvm/llvm-project/issues/64521>.
- const WELL_BEHAVED_NONTEMPORAL_ARCHS: &[&str] =
- &["aarch64", "arm", "riscv32", "riscv64"];
-
- let use_nontemporal =
- WELL_BEHAVED_NONTEMPORAL_ARCHS.contains(&&*self.cx.tcx.sess.target.arch);
+ let use_nontemporal = matches!(
+ self.cx.tcx.sess.target.arch,
+ Arch::AArch64 | Arch::Arm | Arch::RiscV32 | Arch::RiscV64
+ );
if use_nontemporal {
// According to LLVM [1] building a nontemporal store must
// *always* point to a metadata value of the integer 1.
diff --git a/compiler/rustc_codegen_llvm/src/callee.rs b/compiler/rustc_codegen_llvm/src/callee.rs
index b86b32b..f0d4c54 100644
--- a/compiler/rustc_codegen_llvm/src/callee.rs
+++ b/compiler/rustc_codegen_llvm/src/callee.rs
@@ -7,6 +7,7 @@
use rustc_codegen_ssa::common;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv};
use rustc_middle::ty::{self, Instance, TypeVisitableExt};
+use rustc_target::spec::Arch;
use tracing::debug;
use crate::context::CodegenCx;
@@ -35,7 +36,7 @@ pub(crate) fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'t
llfn
} else {
let instance_def_id = instance.def_id();
- let llfn = if tcx.sess.target.arch == "x86"
+ let llfn = if tcx.sess.target.arch == Arch::X86
&& let Some(dllimport) = crate::common::get_dllimport(tcx, instance_def_id, sym)
{
// When calling functions in generated import libraries, MSVC needs
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs
index 9844c94..08c5317 100644
--- a/compiler/rustc_codegen_llvm/src/consts.rs
+++ b/compiler/rustc_codegen_llvm/src/consts.rs
@@ -17,6 +17,7 @@
use rustc_middle::ty::{self, Instance};
use rustc_middle::{bug, span_bug};
use rustc_span::Symbol;
+use rustc_target::spec::Arch;
use tracing::{debug, instrument, trace};
use crate::common::CodegenCx;
@@ -203,7 +204,7 @@ fn check_and_apply_linkage<'ll, 'tcx>(
llvm::set_linkage(g2, llvm::Linkage::InternalLinkage);
llvm::set_initializer(g2, g1);
g2
- } else if cx.tcx.sess.target.arch == "x86"
+ } else if cx.tcx.sess.target.arch == Arch::X86
&& common::is_mingw_gnu_toolchain(&cx.tcx.sess.target)
&& let Some(dllimport) = crate::common::get_dllimport(cx.tcx, def_id, sym)
{
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 808aace..c01f163 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -28,7 +28,9 @@
use rustc_span::source_map::Spanned;
use rustc_span::{DUMMY_SP, Span, Symbol};
use rustc_symbol_mangling::mangle_internal_symbol;
-use rustc_target::spec::{HasTargetSpec, RelocModel, SmallDataThresholdSupport, Target, TlsModel};
+use rustc_target::spec::{
+ Arch, HasTargetSpec, RelocModel, SmallDataThresholdSupport, Target, TlsModel,
+};
use smallvec::SmallVec;
use crate::abi::to_llvm_calling_convention;
@@ -181,22 +183,22 @@ pub(crate) unsafe fn create_module<'ll>(
let llvm_version = llvm_util::get_version();
if llvm_version < (21, 0, 0) {
- if sess.target.arch == "nvptx64" {
+ if sess.target.arch == Arch::Nvptx64 {
// LLVM 21 updated the default layout on nvptx: https://github.com/llvm/llvm-project/pull/124961
target_data_layout = target_data_layout.replace("e-p6:32:32-i64", "e-i64");
}
- if sess.target.arch == "amdgpu" {
+ if sess.target.arch == Arch::AmdGpu {
// LLVM 21 adds the address width for address space 8.
// See https://github.com/llvm/llvm-project/pull/139419
target_data_layout = target_data_layout.replace("p8:128:128:128:48", "p8:128:128")
}
}
if llvm_version < (22, 0, 0) {
- if sess.target.arch == "avr" {
+ if sess.target.arch == Arch::Avr {
// LLVM 22.0 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/153010
target_data_layout = target_data_layout.replace("n8:16", "n8")
}
- if sess.target.arch == "nvptx64" {
+ if sess.target.arch == Arch::Nvptx64 {
// LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198
target_data_layout = target_data_layout.replace("-i256:256", "");
}
@@ -371,7 +373,7 @@ pub(crate) unsafe fn create_module<'ll>(
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.opts.unstable_opts.branch_protection
{
- if sess.target.arch == "aarch64" {
+ if sess.target.arch == Arch::AArch64 {
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
@@ -502,7 +504,7 @@ pub(crate) unsafe fn create_module<'ll>(
// FIXME: https://github.com/llvm/llvm-project/issues/50591
// If llvm_abiname is empty, emit nothing.
let llvm_abiname = &sess.target.options.llvm_abiname;
- if matches!(sess.target.arch.as_ref(), "riscv32" | "riscv64") && !llvm_abiname.is_empty() {
+ if matches!(sess.target.arch, Arch::RiscV32 | Arch::RiscV64) && !llvm_abiname.is_empty() {
llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
@@ -667,7 +669,7 @@ pub(crate) fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'
/// This corresponds to the `-fobjc-abi-version=` flag in Clang / GCC.
pub(crate) fn objc_abi_version(&self) -> u32 {
assert!(self.tcx.sess.target.is_like_darwin);
- if self.tcx.sess.target.arch == "x86" && self.tcx.sess.target.os == "macos" {
+ if self.tcx.sess.target.arch == Arch::X86 && self.tcx.sess.target.os == "macos" {
// 32-bit x86 macOS uses ABI version 1 (a.k.a. the "fragile ABI").
1
} else {
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index 14b3f36..0626cb3 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -13,7 +13,7 @@
use rustc_hir::{self as hir};
use rustc_middle::mir::BinOp;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
-use rustc_middle::ty::{self, GenericArgsRef, Instance, Ty, TyCtxt, TypingEnv};
+use rustc_middle::ty::{self, GenericArgsRef, Instance, SimdAlign, Ty, TyCtxt, TypingEnv};
use rustc_middle::{bug, span_bug};
use rustc_span::{Span, Symbol, sym};
use rustc_symbol_mangling::{mangle_internal_symbol, symbol_name_for_instance_in_crate};
@@ -1840,8 +1840,21 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
return Ok(call);
}
+ fn llvm_alignment<'ll, 'tcx>(
+ bx: &mut Builder<'_, 'll, 'tcx>,
+ alignment: SimdAlign,
+ vector_ty: Ty<'tcx>,
+ element_ty: Ty<'tcx>,
+ ) -> u64 {
+ match alignment {
+ SimdAlign::Unaligned => 1,
+ SimdAlign::Element => bx.align_of(element_ty).bytes(),
+ SimdAlign::Vector => bx.align_of(vector_ty).bytes(),
+ }
+ }
+
if name == sym::simd_masked_load {
- // simd_masked_load(mask: <N x i{M}>, pointer: *_ T, values: <N x T>) -> <N x T>
+ // simd_masked_load<_, _, _, const ALIGN: SimdAlign>(mask: <N x i{M}>, pointer: *_ T, values: <N x T>) -> <N x T>
// * N: number of elements in the input vectors
// * T: type of the element to load
// * M: any integer width is supported, will be truncated to i1
@@ -1849,6 +1862,10 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
// those lanes whose `mask` bit is enabled.
// The memory addresses corresponding to the “off” lanes are not accessed.
+ let alignment = fn_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment();
+
// The element type of the "mask" argument must be a signed integer type of any width
let mask_ty = in_ty;
let (mask_len, mask_elem) = (in_len, in_elem);
@@ -1905,7 +1922,7 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len);
// Alignment of T, must be a constant integer value:
- let alignment = bx.align_of(values_elem).bytes();
+ let alignment = llvm_alignment(bx, alignment, values_ty, values_elem);
let llvm_pointer = bx.type_ptr();
@@ -1932,7 +1949,7 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
}
if name == sym::simd_masked_store {
- // simd_masked_store(mask: <N x i{M}>, pointer: *mut T, values: <N x T>) -> ()
+ // simd_masked_store<_, _, _, const ALIGN: SimdAlign>(mask: <N x i{M}>, pointer: *mut T, values: <N x T>) -> ()
// * N: number of elements in the input vectors
// * T: type of the element to load
// * M: any integer width is supported, will be truncated to i1
@@ -1940,6 +1957,10 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
// those lanes whose `mask` bit is enabled.
// The memory addresses corresponding to the “off” lanes are not accessed.
+ let alignment = fn_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment();
+
// The element type of the "mask" argument must be a signed integer type of any width
let mask_ty = in_ty;
let (mask_len, mask_elem) = (in_len, in_elem);
@@ -1990,7 +2011,7 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len);
// Alignment of T, must be a constant integer value:
- let alignment = bx.align_of(values_elem).bytes();
+ let alignment = llvm_alignment(bx, alignment, values_ty, values_elem);
let llvm_pointer = bx.type_ptr();
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index 982d5cd..c8ad8f0 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -17,6 +17,7 @@
#![feature(macro_derive)]
#![feature(rustdoc_internals)]
#![feature(slice_as_array)]
+#![feature(trim_prefix_suffix)]
#![feature(try_blocks)]
// tidy-alphabetical-end
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 0fcad03..32ea398 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -15,7 +15,7 @@
use rustc_middle::bug;
use rustc_session::Session;
use rustc_session::config::{PrintKind, PrintRequest};
-use rustc_target::spec::{MergeFunctions, PanicStrategy, SmallDataThresholdSupport};
+use rustc_target::spec::{Arch, MergeFunctions, PanicStrategy, SmallDataThresholdSupport};
use smallvec::{SmallVec, smallvec};
use crate::back::write::create_informational_target_machine;
@@ -217,70 +217,85 @@ fn into_iter(self) -> Self::IntoIter {
/// Rust can also be build with an external precompiled version of LLVM which might lead to failures
/// if the oldest tested / supported LLVM version doesn't yet support the relevant intrinsics.
pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFeature<'a>> {
- let raw_arch = &*sess.target.arch;
- let arch = match raw_arch {
- "x86_64" => "x86",
- "arm64ec" => "aarch64",
- "sparc64" => "sparc",
- "powerpc64" => "powerpc",
- _ => raw_arch,
- };
let (major, _, _) = get_version();
- match (arch, s) {
- ("aarch64", "rcpc2") => Some(LLVMFeature::new("rcpc-immo")),
- ("aarch64", "dpb") => Some(LLVMFeature::new("ccpp")),
- ("aarch64", "dpb2") => Some(LLVMFeature::new("ccdp")),
- ("aarch64", "frintts") => Some(LLVMFeature::new("fptoint")),
- ("aarch64", "fcma") => Some(LLVMFeature::new("complxnum")),
- ("aarch64", "pmuv3") => Some(LLVMFeature::new("perfmon")),
- ("aarch64", "paca") => Some(LLVMFeature::new("pauth")),
- ("aarch64", "pacg") => Some(LLVMFeature::new("pauth")),
- ("aarch64", "flagm2") => Some(LLVMFeature::new("altnzcv")),
- // Rust ties fp and neon together.
- ("aarch64", "neon") => Some(LLVMFeature::with_dependencies(
- "neon",
- smallvec![TargetFeatureFoldStrength::Both("fp-armv8")],
- )),
- // In LLVM neon implicitly enables fp, but we manually enable
- // neon when a feature only implicitly enables fp
- ("aarch64", "fhm") => Some(LLVMFeature::new("fp16fml")),
- ("aarch64", "fp16") => Some(LLVMFeature::new("fullfp16")),
+ match sess.target.arch {
+ Arch::AArch64 | Arch::Arm64EC => {
+ match s {
+ "rcpc2" => Some(LLVMFeature::new("rcpc-immo")),
+ "dpb" => Some(LLVMFeature::new("ccpp")),
+ "dpb2" => Some(LLVMFeature::new("ccdp")),
+ "frintts" => Some(LLVMFeature::new("fptoint")),
+ "fcma" => Some(LLVMFeature::new("complxnum")),
+ "pmuv3" => Some(LLVMFeature::new("perfmon")),
+ "paca" => Some(LLVMFeature::new("pauth")),
+ "pacg" => Some(LLVMFeature::new("pauth")),
+ "flagm2" => Some(LLVMFeature::new("altnzcv")),
+ // Rust ties fp and neon together.
+ "neon" => Some(LLVMFeature::with_dependencies(
+ "neon",
+ smallvec![TargetFeatureFoldStrength::Both("fp-armv8")],
+ )),
+ // In LLVM neon implicitly enables fp, but we manually enable
+ // neon when a feature only implicitly enables fp
+ "fhm" => Some(LLVMFeature::new("fp16fml")),
+ "fp16" => Some(LLVMFeature::new("fullfp16")),
+ // Filter out features that are not supported by the current LLVM version
+ "fpmr" => None, // only existed in 18
+ s => Some(LLVMFeature::new(s)),
+ }
+ }
+ Arch::Arm => match s {
+ "fp16" => Some(LLVMFeature::new("fullfp16")),
+ s => Some(LLVMFeature::new(s)),
+ },
+
// Filter out features that are not supported by the current LLVM version
- ("aarch64", "fpmr") => None, // only existed in 18
- ("arm", "fp16") => Some(LLVMFeature::new("fullfp16")),
- // Filter out features that are not supported by the current LLVM version
- ("loongarch32" | "loongarch64", "32s") if major < 21 => None,
- ("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
- ("sparc", "leoncasa") => Some(LLVMFeature::new("hasleoncasa")),
- ("x86", "sse4.2") => Some(LLVMFeature::with_dependencies(
- "sse4.2",
- smallvec![TargetFeatureFoldStrength::EnableOnly("crc32")],
- )),
- ("x86", "pclmulqdq") => Some(LLVMFeature::new("pclmul")),
- ("x86", "rdrand") => Some(LLVMFeature::new("rdrnd")),
- ("x86", "bmi1") => Some(LLVMFeature::new("bmi")),
- ("x86", "cmpxchg16b") => Some(LLVMFeature::new("cx16")),
- ("x86", "lahfsahf") => Some(LLVMFeature::new("sahf")),
- // Enable the evex512 target feature if an avx512 target feature is enabled.
- ("x86", s) if s.starts_with("avx512") => Some(LLVMFeature::with_dependencies(
- s,
- smallvec![TargetFeatureFoldStrength::EnableOnly("evex512")],
- )),
- ("x86", "avx10.1") => Some(LLVMFeature::new("avx10.1-512")),
- ("x86", "avx10.2") => Some(LLVMFeature::new("avx10.2-512")),
- ("x86", "apxf") => Some(LLVMFeature::with_dependencies(
- "egpr",
- smallvec![
- TargetFeatureFoldStrength::Both("push2pop2"),
- TargetFeatureFoldStrength::Both("ppx"),
- TargetFeatureFoldStrength::Both("ndd"),
- TargetFeatureFoldStrength::Both("ccmp"),
- TargetFeatureFoldStrength::Both("cf"),
- TargetFeatureFoldStrength::Both("nf"),
- TargetFeatureFoldStrength::Both("zu"),
- ],
- )),
- (_, s) => Some(LLVMFeature::new(s)),
+ Arch::LoongArch32 | Arch::LoongArch64 => match s {
+ "32s" if major < 21 => None,
+ s => Some(LLVMFeature::new(s)),
+ },
+ Arch::PowerPC | Arch::PowerPC64 => match s {
+ "power8-crypto" => Some(LLVMFeature::new("crypto")),
+ s => Some(LLVMFeature::new(s)),
+ },
+ Arch::Sparc | Arch::Sparc64 => match s {
+ "leoncasa" => Some(LLVMFeature::new("hasleoncasa")),
+ s => Some(LLVMFeature::new(s)),
+ },
+ Arch::X86 | Arch::X86_64 => {
+ match s {
+ "sse4.2" => Some(LLVMFeature::with_dependencies(
+ "sse4.2",
+ smallvec![TargetFeatureFoldStrength::EnableOnly("crc32")],
+ )),
+ "pclmulqdq" => Some(LLVMFeature::new("pclmul")),
+ "rdrand" => Some(LLVMFeature::new("rdrnd")),
+ "bmi1" => Some(LLVMFeature::new("bmi")),
+ "cmpxchg16b" => Some(LLVMFeature::new("cx16")),
+ "lahfsahf" => Some(LLVMFeature::new("sahf")),
+ // Enable the evex512 target feature if an avx512 target feature is enabled.
+ s if s.starts_with("avx512") => Some(LLVMFeature::with_dependencies(
+ s,
+ smallvec![TargetFeatureFoldStrength::EnableOnly("evex512")],
+ )),
+ "avx10.1" => Some(LLVMFeature::new("avx10.1-512")),
+ "avx10.2" => Some(LLVMFeature::new("avx10.2-512")),
+ "apxf" => Some(LLVMFeature::with_dependencies(
+ "egpr",
+ smallvec![
+ TargetFeatureFoldStrength::Both("push2pop2"),
+ TargetFeatureFoldStrength::Both("ppx"),
+ TargetFeatureFoldStrength::Both("ndd"),
+ TargetFeatureFoldStrength::Both("ccmp"),
+ TargetFeatureFoldStrength::Both("cf"),
+ TargetFeatureFoldStrength::Both("nf"),
+ TargetFeatureFoldStrength::Both("zu"),
+ ],
+ )),
+ s => Some(LLVMFeature::new(s)),
+ }
+ }
+ _ => Some(LLVMFeature::new(s)),
}
}
@@ -327,7 +342,7 @@ pub(crate) fn target_config(sess: &Session) -> TargetConfig {
/// Determine whether or not experimental float types are reliable based on known bugs.
fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
- let target_arch = sess.target.arch.as_ref();
+ let target_arch = &sess.target.arch;
let target_os = sess.target.options.os.as_ref();
let target_env = sess.target.options.env.as_ref();
let target_abi = sess.target.options.abi.as_ref();
@@ -338,23 +353,23 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
cfg.has_reliable_f16 = match (target_arch, target_os) {
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in llvm20)
- ("aarch64", _)
+ (Arch::AArch64, _)
if !cfg.target_features.iter().any(|f| f.as_str() == "neon") && lt_20_1_1 =>
{
false
}
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
- ("arm64ec", _) => false,
+ (Arch::Arm64EC, _) => false,
// Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
- ("s390x", _) if lt_21_0_0 => false,
+ (Arch::S390x, _) if lt_21_0_0 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
- ("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
+ (Arch::X86_64, "windows") if target_env == "gnu" && target_abi != "llvm" => false,
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
- ("csky", _) => false,
- ("hexagon", _) if lt_21_0_0 => false, // (fixed in llvm21)
- ("powerpc" | "powerpc64", _) => false,
- ("sparc" | "sparc64", _) => false,
- ("wasm32" | "wasm64", _) => false,
+ (Arch::CSky, _) => false,
+ (Arch::Hexagon, _) if lt_21_0_0 => false, // (fixed in llvm21)
+ (Arch::PowerPC | Arch::PowerPC64, _) => false,
+ (Arch::Sparc | Arch::Sparc64, _) => false,
+ (Arch::Wasm32 | Arch::Wasm64, _) => false,
// `f16` support only requires that symbols converting to and from `f32` are available. We
// provide these in `compiler-builtins`, so `f16` should be available on all platforms that
// do not have other ABI issues or LLVM crashes.
@@ -363,24 +378,24 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
cfg.has_reliable_f128 = match (target_arch, target_os) {
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
- ("arm64ec", _) => false,
+ (Arch::Arm64EC, _) => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in llvm20)
- ("mips64" | "mips64r6", _) if lt_20_1_1 => false,
+ (Arch::Mips64 | Arch::Mips64r6, _) if lt_20_1_1 => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>. This issue is closed
// but basic math still does not work.
- ("nvptx64", _) => false,
+ (Arch::Nvptx64, _) => false,
// Unsupported https://github.com/llvm/llvm-project/issues/121122
- ("amdgpu", _) => false,
+ (Arch::AmdGpu, _) => false,
// ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
// list at <https://github.com/rust-lang/rust/issues/116909>)
- ("powerpc" | "powerpc64", _) => false,
+ (Arch::PowerPC | Arch::PowerPC64, _) => false,
// ABI unsupported <https://github.com/llvm/llvm-project/issues/41838>
- ("sparc", _) => false,
+ (Arch::Sparc, _) => false,
// Stack alignment bug <https://github.com/llvm/llvm-project/issues/77401>. NB: tests may
// not fail if our compiler-builtins is linked. (fixed in llvm21)
- ("x86", _) if lt_21_0_0 => false,
+ (Arch::X86, _) if lt_21_0_0 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
- ("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
+ (Arch::X86_64, "windows") if target_env == "gnu" && target_abi != "llvm" => false,
// There are no known problems on other platforms, so the only requirement is that symbols
// are available. `compiler-builtins` provides all symbols required for core `f128`
// support, so this should work for everything else.
@@ -402,7 +417,7 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
//
// musl does not implement the symbols required for f128 math at all.
_ if target_env == "musl" => false,
- ("x86_64", _) => false,
+ (Arch::X86_64, _) => false,
(_, "linux") if target_pointer_width == 64 => true,
_ => false,
} && cfg.has_reliable_f128;
@@ -605,8 +620,8 @@ fn llvm_features_by_flags(sess: &Session, features: &mut Vec<String>) {
// -Zfixed-x18
if sess.opts.unstable_opts.fixed_x18 {
- if sess.target.arch != "aarch64" {
- sess.dcx().emit_fatal(errors::FixedX18InvalidArch { arch: &sess.target.arch });
+ if sess.target.arch != Arch::AArch64 {
+ sess.dcx().emit_fatal(errors::FixedX18InvalidArch { arch: sess.target.arch.desc() });
} else {
features.push("+reserve-x18".into());
}
diff --git a/compiler/rustc_codegen_llvm/src/mono_item.rs b/compiler/rustc_codegen_llvm/src/mono_item.rs
index 52eefe2..4184ced 100644
--- a/compiler/rustc_codegen_llvm/src/mono_item.rs
+++ b/compiler/rustc_codegen_llvm/src/mono_item.rs
@@ -7,7 +7,7 @@
use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv, LayoutOf};
use rustc_middle::ty::{self, Instance, TypeVisitableExt};
use rustc_session::config::CrateType;
-use rustc_target::spec::RelocModel;
+use rustc_target::spec::{Arch, RelocModel};
use tracing::debug;
use crate::context::CodegenCx;
@@ -116,7 +116,7 @@ fn should_assume_dso_local(&self, llval: &llvm::Value, is_declaration: bool) ->
}
// PowerPC64 prefers TOC indirection to avoid copy relocations.
- if matches!(&*self.tcx.sess.target.arch, "powerpc64" | "powerpc64le") {
+ if matches!(self.tcx.sess.target.arch, Arch::PowerPC64 | Arch::PowerPC64LE) {
return false;
}
diff --git a/compiler/rustc_codegen_llvm/src/va_arg.rs b/compiler/rustc_codegen_llvm/src/va_arg.rs
index 2d9abb4..115d96d 100644
--- a/compiler/rustc_codegen_llvm/src/va_arg.rs
+++ b/compiler/rustc_codegen_llvm/src/va_arg.rs
@@ -7,6 +7,7 @@
};
use rustc_middle::ty::Ty;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
+use rustc_target::spec::Arch;
use crate::builder::Builder;
use crate::llvm::{Type, Value};
@@ -886,8 +887,8 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
// is lacking in some instances, so we should only use it as a fallback.
let target = &bx.cx.tcx.sess.target;
- match &*target.arch {
- "x86" => emit_ptr_va_arg(
+ match target.arch {
+ Arch::X86 => emit_ptr_va_arg(
bx,
addr,
target_ty,
@@ -896,7 +897,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
if target.is_like_windows { AllowHigherAlign::No } else { AllowHigherAlign::Yes },
ForceRightAdjust::No,
),
- "aarch64" | "arm64ec" if target.is_like_windows || target.is_like_darwin => {
+ Arch::AArch64 | Arch::Arm64EC if target.is_like_windows || target.is_like_darwin => {
emit_ptr_va_arg(
bx,
addr,
@@ -907,8 +908,8 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
ForceRightAdjust::No,
)
}
- "aarch64" => emit_aapcs_va_arg(bx, addr, target_ty),
- "arm" => {
+ Arch::AArch64 => emit_aapcs_va_arg(bx, addr, target_ty),
+ Arch::Arm => {
// Types wider than 16 bytes are not currently supported. Clang has special logic for
// such types, but `VaArgSafe` is not implemented for any type that is this large.
assert!(bx.cx.size_of(target_ty).bytes() <= 16);
@@ -923,22 +924,28 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
ForceRightAdjust::No,
)
}
- "s390x" => emit_s390x_va_arg(bx, addr, target_ty),
- "powerpc" => emit_powerpc_va_arg(bx, addr, target_ty),
- "powerpc64" | "powerpc64le" => emit_ptr_va_arg(
+ Arch::S390x => emit_s390x_va_arg(bx, addr, target_ty),
+ Arch::PowerPC => emit_powerpc_va_arg(bx, addr, target_ty),
+ Arch::PowerPC64 => emit_ptr_va_arg(
bx,
addr,
target_ty,
PassMode::Direct,
SlotSize::Bytes8,
AllowHigherAlign::Yes,
- match &*target.arch {
- "powerpc64" => ForceRightAdjust::Yes,
- _ => ForceRightAdjust::No,
- },
+ ForceRightAdjust::Yes,
+ ),
+ Arch::PowerPC64LE => emit_ptr_va_arg(
+ bx,
+ addr,
+ target_ty,
+ PassMode::Direct,
+ SlotSize::Bytes8,
+ AllowHigherAlign::Yes,
+ ForceRightAdjust::No,
),
// Windows x86_64
- "x86_64" if target.is_like_windows => {
+ Arch::X86_64 if target.is_like_windows => {
let target_ty_size = bx.cx.size_of(target_ty).bytes();
emit_ptr_va_arg(
bx,
@@ -955,8 +962,8 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
)
}
// This includes `target.is_like_darwin`, which on x86_64 targets is like sysv64.
- "x86_64" => emit_x86_64_sysv64_va_arg(bx, addr, target_ty),
- "xtensa" => emit_xtensa_va_arg(bx, addr, target_ty),
+ Arch::X86_64 => emit_x86_64_sysv64_va_arg(bx, addr, target_ty),
+ Arch::Xtensa => emit_xtensa_va_arg(bx, addr, target_ty),
// For all other architecture/OS combinations fall back to using
// the LLVM va_arg instruction.
// https://llvm.org/docs/LangRef.html#va-arg-instruction
diff --git a/compiler/rustc_codegen_ssa/src/back/apple.rs b/compiler/rustc_codegen_ssa/src/back/apple.rs
index b1d646d..3b29dde 100644
--- a/compiler/rustc_codegen_ssa/src/back/apple.rs
+++ b/compiler/rustc_codegen_ssa/src/back/apple.rs
@@ -5,8 +5,8 @@
use itertools::Itertools;
use rustc_middle::middle::exported_symbols::SymbolExportKind;
use rustc_session::Session;
-use rustc_target::spec::Target;
pub(super) use rustc_target::spec::apple::OSVersion;
+use rustc_target::spec::{Arch, Target};
use tracing::debug;
use crate::errors::{XcrunError, XcrunSdkPathWarning};
@@ -95,7 +95,7 @@ pub(super) fn add_data_and_relocation(
pointer_width => unimplemented!("unsupported Apple pointer width {pointer_width:?}"),
};
- if target.arch == "x86_64" {
+ if target.arch == Arch::X86_64 {
// Force alignment for the entire section to be 16 on x86_64.
file.section_mut(section).append_data(&[], 16);
} else {
@@ -111,7 +111,7 @@ pub(super) fn add_data_and_relocation(
r_pcrel: false,
r_length: 3,
}
- } else if target.arch == "arm" {
+ } else if target.arch == Arch::Arm {
// FIXME(madsmtm): Remove once `object` supports 32-bit ARM relocations:
// https://github.com/gimli-rs/object/pull/757
object::write::RelocationFlags::MachO {
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs
index cfd8cea..93f6cb3 100644
--- a/compiler/rustc_codegen_ssa/src/back/archive.rs
+++ b/compiler/rustc_codegen_ssa/src/back/archive.rs
@@ -17,6 +17,7 @@
use rustc_metadata::EncodedMetadata;
use rustc_session::Session;
use rustc_span::Symbol;
+use rustc_target::spec::Arch;
use tracing::trace;
use super::metadata::{create_compressed_metadata_file, search_for_section};
@@ -42,7 +43,7 @@ pub struct ImportLibraryItem {
impl ImportLibraryItem {
fn into_coff_short_export(self, sess: &Session) -> COFFShortExport {
- let import_name = (sess.target.arch == "arm64ec").then(|| self.name.clone());
+ let import_name = (sess.target.arch == Arch::Arm64EC).then(|| self.name.clone());
COFFShortExport {
name: self.name,
ext_name: None,
@@ -117,12 +118,12 @@ fn create_dll_import_lib(
let exports =
items.into_iter().map(|item| item.into_coff_short_export(sess)).collect::<Vec<_>>();
- let machine = match &*sess.target.arch {
- "x86_64" => MachineTypes::AMD64,
- "x86" => MachineTypes::I386,
- "aarch64" => MachineTypes::ARM64,
- "arm64ec" => MachineTypes::ARM64EC,
- "arm" => MachineTypes::ARMNT,
+ let machine = match &sess.target.arch {
+ Arch::X86_64 => MachineTypes::AMD64,
+ Arch::X86 => MachineTypes::I386,
+ Arch::AArch64 => MachineTypes::ARM64,
+ Arch::Arm64EC => MachineTypes::ARM64EC,
+ Arch::Arm => MachineTypes::ARMNT,
cpu => panic!("unsupported cpu type {cpu}"),
};
@@ -223,12 +224,12 @@ fn create_mingw_dll_import_lib(
};
// dlltool target architecture args from:
// https://github.com/llvm/llvm-project-release-prs/blob/llvmorg-15.0.6/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp#L69
- let (dlltool_target_arch, dlltool_target_bitness) = match sess.target.arch.as_ref() {
- "x86_64" => ("i386:x86-64", "--64"),
- "x86" => ("i386", "--32"),
- "aarch64" => ("arm64", "--64"),
- "arm" => ("arm", "--32"),
- _ => panic!("unsupported arch {}", sess.target.arch),
+ let (dlltool_target_arch, dlltool_target_bitness) = match &sess.target.arch {
+ Arch::X86_64 => ("i386:x86-64", "--64"),
+ Arch::X86 => ("i386", "--32"),
+ Arch::AArch64 => ("arm64", "--64"),
+ Arch::Arm => ("arm", "--32"),
+ arch => panic!("unsupported arch {arch}"),
};
let mut dlltool_cmd = std::process::Command::new(&dlltool);
dlltool_cmd
@@ -281,10 +282,10 @@ fn find_binutils_dlltool(sess: &Session) -> OsString {
"dlltool.exe"
} else {
// On other platforms, use the architecture-specific name.
- match sess.target.arch.as_ref() {
- "x86_64" => "x86_64-w64-mingw32-dlltool",
- "x86" => "i686-w64-mingw32-dlltool",
- "aarch64" => "aarch64-w64-mingw32-dlltool",
+ match sess.target.arch {
+ Arch::X86_64 => "x86_64-w64-mingw32-dlltool",
+ Arch::X86 => "i686-w64-mingw32-dlltool",
+ Arch::AArch64 => "aarch64-w64-mingw32-dlltool",
// For non-standard architectures (e.g., aarch32) fallback to "dlltool".
_ => "dlltool",
@@ -378,9 +379,9 @@ pub fn try_extract_macho_fat_archive(
archive_path: &Path,
) -> io::Result<Option<PathBuf>> {
let archive_map = unsafe { Mmap::map(File::open(&archive_path)?)? };
- let target_arch = match sess.target.arch.as_ref() {
- "aarch64" => object::Architecture::Aarch64,
- "x86_64" => object::Architecture::X86_64,
+ let target_arch = match sess.target.arch {
+ Arch::AArch64 => object::Architecture::Aarch64,
+ Arch::X86_64 => object::Architecture::X86_64,
_ => return Ok(None),
};
@@ -531,7 +532,7 @@ fn build_inner(self, output: &Path) -> io::Result<bool> {
&entries,
archive_kind,
false,
- /* is_ec = */ Some(self.sess.target.arch == "arm64ec"),
+ /* is_ec = */ Some(self.sess.target.arch == Arch::Arm64EC),
)?;
archive_tmpfile.flush()?;
drop(archive_tmpfile);
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index ea538d3..1124b0a 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -883,7 +883,8 @@ fn link_natively(
if is_msvc_link_exe && (code < 1000 || code > 9999) {
let is_vs_installed = find_msvc_tools::find_vs_version().is_ok();
let has_linker =
- find_msvc_tools::find_tool(&sess.target.arch, "link.exe").is_some();
+ find_msvc_tools::find_tool(sess.target.arch.desc(), "link.exe")
+ .is_some();
sess.dcx().emit_note(errors::LinkExeUnexpectedError);
diff --git a/compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs b/compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs
index 7321bc1..45c2171 100644
--- a/compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs
@@ -11,6 +11,7 @@
use rustc_session::Session;
use rustc_session::cstore::DllImport;
use rustc_span::Symbol;
+use rustc_target::spec::Arch;
use crate::back::archive::ImportLibraryItem;
use crate::back::link::ArchiveBuilderBuilder;
@@ -77,7 +78,7 @@ pub(super) fn create_raw_dylib_dll_import_libs<'a>(
let items: Vec<ImportLibraryItem> = raw_dylib_imports
.iter()
.map(|import: &DllImport| {
- if sess.target.arch == "x86" {
+ if sess.target.arch == Arch::X86 {
ImportLibraryItem {
name: common::i686_decorated_name(
import,
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index ac12314..eb2740d 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -17,7 +17,7 @@
use rustc_middle::ty::TyCtxt;
use rustc_session::Session;
use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};
-use rustc_target::spec::{Cc, LinkOutputKind, LinkerFlavor, Lld};
+use rustc_target::spec::{Arch, Cc, LinkOutputKind, LinkerFlavor, Lld};
use tracing::{debug, warn};
use super::command::Command;
@@ -53,7 +53,7 @@ pub(crate) fn get_linker<'a>(
target_cpu: &'a str,
codegen_backend: &'static str,
) -> Box<dyn Linker + 'a> {
- let msvc_tool = find_msvc_tools::find_tool(&sess.target.arch, "link.exe");
+ let msvc_tool = find_msvc_tools::find_tool(sess.target.arch.desc(), "link.exe");
// If our linker looks like a batch script on Windows then to execute this
// we'll need to spawn `cmd` explicitly. This is primarily done to handle
@@ -87,11 +87,11 @@ pub(crate) fn get_linker<'a>(
if let Some(ref tool) = msvc_tool {
let original_path = tool.path();
if let Some(root_lib_path) = original_path.ancestors().nth(4) {
- let arch = match t.arch.as_ref() {
- "x86_64" => Some("x64"),
- "x86" => Some("x86"),
- "aarch64" => Some("arm64"),
- "arm" => Some("arm"),
+ let arch = match t.arch {
+ Arch::X86_64 => Some("x64"),
+ Arch::X86 => Some("x86"),
+ Arch::AArch64 => Some("arm64"),
+ Arch::Arm => Some("arm"),
_ => None,
};
if let Some(ref a) = arch {
@@ -589,7 +589,7 @@ fn set_output_kind(
//
// Currently this makes sense only when using avr-gcc as a linker, since
// it brings a couple of hand-written important intrinsics from libgcc.
- if self.sess.target.arch == "avr" && !self.uses_lld {
+ if self.sess.target.arch == Arch::Avr && !self.uses_lld {
self.verbatim_arg(format!("-mmcu={}", self.target_cpu));
}
}
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
index d9ba501..6fa8725 100644
--- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
+++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
@@ -17,7 +17,7 @@
use rustc_middle::util::Providers;
use rustc_session::config::{CrateType, OomStrategy};
use rustc_symbol_mangling::mangle_internal_symbol;
-use rustc_target::spec::TlsModel;
+use rustc_target::spec::{Arch, TlsModel};
use tracing::debug;
use crate::back::symbol_export;
@@ -659,11 +659,11 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
return undecorated;
}
- let prefix = match &target.arch[..] {
- "x86" => Some('_'),
- "x86_64" => None,
+ let prefix = match target.arch {
+ Arch::X86 => Some('_'),
+ Arch::X86_64 => None,
// Only functions are decorated for arm64ec.
- "arm64ec" if export_kind == SymbolExportKind::Text => Some('#'),
+ Arch::Arm64EC if export_kind == SymbolExportKind::Text => Some('#'),
// Only x86/64 and arm64ec use symbol decorations.
_ => return undecorated,
};
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index f58be0a..ed2815b 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -33,6 +33,7 @@
use rustc_session::config::{self, CrateType, EntryFnType};
use rustc_span::{DUMMY_SP, Symbol, sym};
use rustc_symbol_mangling::mangle_internal_symbol;
+use rustc_target::spec::Arch;
use rustc_trait_selection::infer::{BoundRegionConversionTime, TyCtxtInferExt};
use rustc_trait_selection::traits::{ObligationCause, ObligationCtxt};
use tracing::{debug, info};
@@ -982,9 +983,9 @@ pub fn new(tcx: TyCtxt<'_>, target_cpu: String) -> CrateInfo {
// by the compiler, but that's ok because all this stuff is unstable anyway.
let target = &tcx.sess.target;
if !are_upstream_rust_objects_already_included(tcx.sess) {
- let add_prefix = match (target.is_like_windows, target.arch.as_ref()) {
- (true, "x86") => |name: String, _: SymbolExportKind| format!("_{name}"),
- (true, "arm64ec") => {
+ let add_prefix = match (target.is_like_windows, &target.arch) {
+ (true, Arch::X86) => |name: String, _: SymbolExportKind| format!("_{name}"),
+ (true, Arch::Arm64EC) => {
// Only functions are decorated for arm64ec.
|name: String, export_kind: SymbolExportKind| match export_kind {
SymbolExportKind::Text => format!("#{name}"),
diff --git a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
index cc3316c..aeb7401 100644
--- a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
@@ -4,6 +4,7 @@
use rustc_middle::{bug, span_bug};
use rustc_session::config::OptLevel;
use rustc_span::sym;
+use rustc_target::spec::Arch;
use super::FunctionCx;
use super::operand::OperandRef;
@@ -79,7 +80,7 @@ pub fn codegen_intrinsic_call(
// reinterpretation of values as (chunkable) byte arrays, and the loop in the
// block optimization in `ptr::swap_nonoverlapping` is hard to rewrite back
// into the (unoptimized) direct swapping implementation, so we disable it.
- || bx.sess().target.arch == "spirv"
+ || bx.sess().target.arch == Arch::SpirV
{
let align = pointee_layout.align.abi;
let x_place = args[0].val.deref(align);
diff --git a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
index e7239eb..4a47799 100644
--- a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
@@ -7,7 +7,7 @@
use rustc_middle::{bug, ty};
use rustc_span::sym;
use rustc_target::callconv::{ArgAbi, FnAbi, PassMode};
-use rustc_target::spec::BinaryFormat;
+use rustc_target::spec::{Arch, BinaryFormat};
use crate::common;
use crate::mir::AsmCodegenMethods;
@@ -125,7 +125,7 @@ fn prefix_and_suffix<'tcx>(
let asm_binary_format = &tcx.sess.target.binary_format;
- let is_arm = tcx.sess.target.arch == "arm";
+ let is_arm = tcx.sess.target.arch == Arch::Arm;
let is_thumb = tcx.sess.unstable_target_features.contains(&sym::thumb_mode);
let attrs = tcx.codegen_instance_attrs(instance.def);
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs
index 5458499..9b86fa9 100644
--- a/compiler/rustc_codegen_ssa/src/target_features.rs
+++ b/compiler/rustc_codegen_ssa/src/target_features.rs
@@ -10,6 +10,7 @@
use rustc_session::lint::builtin::AARCH64_SOFTFLOAT_NEON;
use rustc_session::parse::feature_err;
use rustc_span::{Span, Symbol, sym};
+use rustc_target::spec::Arch;
use rustc_target::target_features::{RUSTC_SPECIFIC_FEATURES, Stability};
use smallvec::SmallVec;
@@ -73,7 +74,7 @@ pub(crate) fn from_target_feature_attr(
if abi_feature_constraints.incompatible.contains(&name.as_str()) {
// For "neon" specifically, we emit an FCW instead of a hard error.
// See <https://github.com/rust-lang/rust/issues/134375>.
- if tcx.sess.target.arch == "aarch64" && name.as_str() == "neon" {
+ if tcx.sess.target.arch == Arch::AArch64 && name.as_str() == "neon" {
tcx.emit_node_span_lint(
AARCH64_SOFTFLOAT_NEON,
tcx.local_def_id_to_hir_id(did),
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index f0f06d4..58d7f8e 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -25,6 +25,35 @@
};
use crate::fluent_generated as fluent;
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+enum MulAddType {
+ /// Used with `fma` and `simd_fma`, always uses fused-multiply-add
+ Fused,
+ /// Used with `fmuladd` and `simd_relaxed_fma`, nondeterministically determines whether to use
+ /// fma or simple multiply-add
+ Nondeterministic,
+}
+
+#[derive(Copy, Clone)]
+pub(crate) enum MinMax {
+ /// The IEEE `Minimum` operation - see `f32::minimum` etc
+ /// In particular, `-0.0` is considered smaller than `+0.0` and
+ /// if either input is NaN, the result is NaN.
+ Minimum,
+ /// The IEEE `MinNum` operation - see `f32::min` etc
+ /// In particular, if the inputs are `-0.0` and `+0.0`, the result is non-deterministic,
+ /// and is one argument is NaN, the other one is returned.
+ MinNum,
+ /// The IEEE `Maximum` operation - see `f32::maximum` etc
+ /// In particular, `-0.0` is considered smaller than `+0.0` and
+ /// if either input is NaN, the result is NaN.
+ Maximum,
+ /// The IEEE `MaxNum` operation - see `f32::max` etc
+ /// In particular, if the inputs are `-0.0` and `+0.0`, the result is non-deterministic,
+ /// and is one argument is NaN, the other one is returned.
+ MaxNum,
+}
+
/// Directly returns an `Allocation` containing an absolute path representation of the given type.
pub(crate) fn alloc_type_name<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> (AllocId, u64) {
let path = crate::util::type_name(tcx, ty);
@@ -504,25 +533,33 @@ pub fn eval_intrinsic(
self.write_scalar(Scalar::from_target_usize(align.bytes(), self), dest)?;
}
- sym::minnumf16 => self.float_min_intrinsic::<Half>(args, dest)?,
- sym::minnumf32 => self.float_min_intrinsic::<Single>(args, dest)?,
- sym::minnumf64 => self.float_min_intrinsic::<Double>(args, dest)?,
- sym::minnumf128 => self.float_min_intrinsic::<Quad>(args, dest)?,
+ sym::minnumf16 => self.float_minmax_intrinsic::<Half>(args, MinMax::MinNum, dest)?,
+ sym::minnumf32 => self.float_minmax_intrinsic::<Single>(args, MinMax::MinNum, dest)?,
+ sym::minnumf64 => self.float_minmax_intrinsic::<Double>(args, MinMax::MinNum, dest)?,
+ sym::minnumf128 => self.float_minmax_intrinsic::<Quad>(args, MinMax::MinNum, dest)?,
- sym::minimumf16 => self.float_minimum_intrinsic::<Half>(args, dest)?,
- sym::minimumf32 => self.float_minimum_intrinsic::<Single>(args, dest)?,
- sym::minimumf64 => self.float_minimum_intrinsic::<Double>(args, dest)?,
- sym::minimumf128 => self.float_minimum_intrinsic::<Quad>(args, dest)?,
+ sym::minimumf16 => self.float_minmax_intrinsic::<Half>(args, MinMax::Minimum, dest)?,
+ sym::minimumf32 => {
+ self.float_minmax_intrinsic::<Single>(args, MinMax::Minimum, dest)?
+ }
+ sym::minimumf64 => {
+ self.float_minmax_intrinsic::<Double>(args, MinMax::Minimum, dest)?
+ }
+ sym::minimumf128 => self.float_minmax_intrinsic::<Quad>(args, MinMax::Minimum, dest)?,
- sym::maxnumf16 => self.float_max_intrinsic::<Half>(args, dest)?,
- sym::maxnumf32 => self.float_max_intrinsic::<Single>(args, dest)?,
- sym::maxnumf64 => self.float_max_intrinsic::<Double>(args, dest)?,
- sym::maxnumf128 => self.float_max_intrinsic::<Quad>(args, dest)?,
+ sym::maxnumf16 => self.float_minmax_intrinsic::<Half>(args, MinMax::MaxNum, dest)?,
+ sym::maxnumf32 => self.float_minmax_intrinsic::<Single>(args, MinMax::MaxNum, dest)?,
+ sym::maxnumf64 => self.float_minmax_intrinsic::<Double>(args, MinMax::MaxNum, dest)?,
+ sym::maxnumf128 => self.float_minmax_intrinsic::<Quad>(args, MinMax::MaxNum, dest)?,
- sym::maximumf16 => self.float_maximum_intrinsic::<Half>(args, dest)?,
- sym::maximumf32 => self.float_maximum_intrinsic::<Single>(args, dest)?,
- sym::maximumf64 => self.float_maximum_intrinsic::<Double>(args, dest)?,
- sym::maximumf128 => self.float_maximum_intrinsic::<Quad>(args, dest)?,
+ sym::maximumf16 => self.float_minmax_intrinsic::<Half>(args, MinMax::Maximum, dest)?,
+ sym::maximumf32 => {
+ self.float_minmax_intrinsic::<Single>(args, MinMax::Maximum, dest)?
+ }
+ sym::maximumf64 => {
+ self.float_minmax_intrinsic::<Double>(args, MinMax::Maximum, dest)?
+ }
+ sym::maximumf128 => self.float_minmax_intrinsic::<Quad>(args, MinMax::Maximum, dest)?,
sym::copysignf16 => self.float_copysign_intrinsic::<Half>(args, dest)?,
sym::copysignf32 => self.float_copysign_intrinsic::<Single>(args, dest)?,
@@ -630,14 +667,22 @@ pub fn eval_intrinsic(
dest,
rustc_apfloat::Round::NearestTiesToEven,
)?,
- sym::fmaf16 => self.fma_intrinsic::<Half>(args, dest)?,
- sym::fmaf32 => self.fma_intrinsic::<Single>(args, dest)?,
- sym::fmaf64 => self.fma_intrinsic::<Double>(args, dest)?,
- sym::fmaf128 => self.fma_intrinsic::<Quad>(args, dest)?,
- sym::fmuladdf16 => self.float_muladd_intrinsic::<Half>(args, dest)?,
- sym::fmuladdf32 => self.float_muladd_intrinsic::<Single>(args, dest)?,
- sym::fmuladdf64 => self.float_muladd_intrinsic::<Double>(args, dest)?,
- sym::fmuladdf128 => self.float_muladd_intrinsic::<Quad>(args, dest)?,
+ sym::fmaf16 => self.float_muladd_intrinsic::<Half>(args, dest, MulAddType::Fused)?,
+ sym::fmaf32 => self.float_muladd_intrinsic::<Single>(args, dest, MulAddType::Fused)?,
+ sym::fmaf64 => self.float_muladd_intrinsic::<Double>(args, dest, MulAddType::Fused)?,
+ sym::fmaf128 => self.float_muladd_intrinsic::<Quad>(args, dest, MulAddType::Fused)?,
+ sym::fmuladdf16 => {
+ self.float_muladd_intrinsic::<Half>(args, dest, MulAddType::Nondeterministic)?
+ }
+ sym::fmuladdf32 => {
+ self.float_muladd_intrinsic::<Single>(args, dest, MulAddType::Nondeterministic)?
+ }
+ sym::fmuladdf64 => {
+ self.float_muladd_intrinsic::<Double>(args, dest, MulAddType::Nondeterministic)?
+ }
+ sym::fmuladdf128 => {
+ self.float_muladd_intrinsic::<Quad>(args, dest, MulAddType::Nondeterministic)?
+ }
// Unsupported intrinsic: skip the return_to_block below.
_ => return interp_ok(false),
@@ -919,76 +964,45 @@ pub(crate) fn raw_eq_intrinsic(
interp_ok(Scalar::from_bool(lhs_bytes == rhs_bytes))
}
- fn float_min_intrinsic<F>(
- &mut self,
- args: &[OpTy<'tcx, M::Provenance>],
- dest: &PlaceTy<'tcx, M::Provenance>,
- ) -> InterpResult<'tcx, ()>
+ fn float_minmax<F>(
+ &self,
+ a: Scalar<M::Provenance>,
+ b: Scalar<M::Provenance>,
+ op: MinMax,
+ ) -> InterpResult<'tcx, Scalar<M::Provenance>>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let res = if a == b {
+ let a: F = a.to_float()?;
+ let b: F = b.to_float()?;
+ let res = if matches!(op, MinMax::MinNum | MinMax::MaxNum) && a == b {
// They are definitely not NaN (those are never equal), but they could be `+0` and `-0`.
// Let the machine decide which one to return.
M::equal_float_min_max(self, a, b)
} else {
- self.adjust_nan(a.min(b), &[a, b])
+ let result = match op {
+ MinMax::Minimum => a.minimum(b),
+ MinMax::MinNum => a.min(b),
+ MinMax::Maximum => a.maximum(b),
+ MinMax::MaxNum => a.max(b),
+ };
+ self.adjust_nan(result, &[a, b])
};
- self.write_scalar(res, dest)?;
- interp_ok(())
+
+ interp_ok(res.into())
}
- fn float_max_intrinsic<F>(
+ fn float_minmax_intrinsic<F>(
&mut self,
args: &[OpTy<'tcx, M::Provenance>],
+ op: MinMax,
dest: &PlaceTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx, ()>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let res = if a == b {
- // They are definitely not NaN (those are never equal), but they could be `+0` and `-0`.
- // Let the machine decide which one to return.
- M::equal_float_min_max(self, a, b)
- } else {
- self.adjust_nan(a.max(b), &[a, b])
- };
- self.write_scalar(res, dest)?;
- interp_ok(())
- }
-
- fn float_minimum_intrinsic<F>(
- &mut self,
- args: &[OpTy<'tcx, M::Provenance>],
- dest: &PlaceTy<'tcx, M::Provenance>,
- ) -> InterpResult<'tcx, ()>
- where
- F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
- {
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let res = a.minimum(b);
- let res = self.adjust_nan(res, &[a, b]);
- self.write_scalar(res, dest)?;
- interp_ok(())
- }
-
- fn float_maximum_intrinsic<F>(
- &mut self,
- args: &[OpTy<'tcx, M::Provenance>],
- dest: &PlaceTy<'tcx, M::Provenance>,
- ) -> InterpResult<'tcx, ()>
- where
- F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
- {
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let res = a.maximum(b);
- let res = self.adjust_nan(res, &[a, b]);
+ let res =
+ self.float_minmax::<F>(self.read_scalar(&args[0])?, self.read_scalar(&args[1])?, op)?;
self.write_scalar(res, dest)?;
interp_ok(())
}
@@ -1022,6 +1036,20 @@ fn float_abs_intrinsic<F>(
interp_ok(())
}
+ fn float_round<F>(
+ &mut self,
+ x: Scalar<M::Provenance>,
+ mode: rustc_apfloat::Round,
+ ) -> InterpResult<'tcx, Scalar<M::Provenance>>
+ where
+ F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
+ {
+ let x: F = x.to_float()?;
+ let res = x.round_to_integral(mode).value;
+ let res = self.adjust_nan(res, &[x]);
+ interp_ok(res.into())
+ }
+
fn float_round_intrinsic<F>(
&mut self,
args: &[OpTy<'tcx, M::Provenance>],
@@ -1031,47 +1059,46 @@ fn float_round_intrinsic<F>(
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
- let x: F = self.read_scalar(&args[0])?.to_float()?;
- let res = x.round_to_integral(mode).value;
- let res = self.adjust_nan(res, &[x]);
+ let res = self.float_round::<F>(self.read_scalar(&args[0])?, mode)?;
self.write_scalar(res, dest)?;
interp_ok(())
}
- fn fma_intrinsic<F>(
- &mut self,
- args: &[OpTy<'tcx, M::Provenance>],
- dest: &PlaceTy<'tcx, M::Provenance>,
- ) -> InterpResult<'tcx, ()>
+ fn float_muladd<F>(
+ &self,
+ a: Scalar<M::Provenance>,
+ b: Scalar<M::Provenance>,
+ c: Scalar<M::Provenance>,
+ typ: MulAddType,
+ ) -> InterpResult<'tcx, Scalar<M::Provenance>>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let c: F = self.read_scalar(&args[2])?.to_float()?;
+ let a: F = a.to_float()?;
+ let b: F = b.to_float()?;
+ let c: F = c.to_float()?;
- let res = a.mul_add(b, c).value;
+ let fuse = typ == MulAddType::Fused || M::float_fuse_mul_add(self);
+
+ let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
let res = self.adjust_nan(res, &[a, b, c]);
- self.write_scalar(res, dest)?;
- interp_ok(())
+ interp_ok(res.into())
}
fn float_muladd_intrinsic<F>(
&mut self,
args: &[OpTy<'tcx, M::Provenance>],
dest: &PlaceTy<'tcx, M::Provenance>,
+ typ: MulAddType,
) -> InterpResult<'tcx, ()>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
- let a: F = self.read_scalar(&args[0])?.to_float()?;
- let b: F = self.read_scalar(&args[1])?.to_float()?;
- let c: F = self.read_scalar(&args[2])?.to_float()?;
+ let a = self.read_scalar(&args[0])?;
+ let b = self.read_scalar(&args[1])?;
+ let c = self.read_scalar(&args[2])?;
- let fuse = M::float_fuse_mul_add(self);
-
- let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
- let res = self.adjust_nan(res, &[a, b, c]);
+ let res = self.float_muladd::<F>(a, b, c, typ)?;
self.write_scalar(res, dest)?;
interp_ok(())
}
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs b/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs
index 0dba66a..751674f 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs
@@ -1,24 +1,19 @@
use either::Either;
-use rustc_abi::Endian;
+use rustc_abi::{BackendRepr, Endian};
+use rustc_apfloat::ieee::{Double, Half, Quad, Single};
use rustc_apfloat::{Float, Round};
-use rustc_middle::mir::interpret::{InterpErrorKind, UndefinedBehaviorInfo};
-use rustc_middle::ty::FloatTy;
+use rustc_middle::mir::interpret::{InterpErrorKind, Pointer, UndefinedBehaviorInfo};
+use rustc_middle::ty::{FloatTy, SimdAlign};
use rustc_middle::{bug, err_ub_format, mir, span_bug, throw_unsup_format, ty};
use rustc_span::{Symbol, sym};
use tracing::trace;
use super::{
- ImmTy, InterpCx, InterpResult, Machine, OpTy, PlaceTy, Provenance, Scalar, Size, interp_ok,
- throw_ub_format,
+ ImmTy, InterpCx, InterpResult, Machine, MinMax, MulAddType, OpTy, PlaceTy, Provenance, Scalar,
+ Size, TyAndLayout, assert_matches, interp_ok, throw_ub_format,
};
use crate::interpret::Writeable;
-#[derive(Copy, Clone)]
-pub(crate) enum MinMax {
- Min,
- Max,
-}
-
impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
/// Returns `true` if emulation happened.
/// Here we implement the intrinsics that are common to all CTFE instances; individual machines can add their own
@@ -125,10 +120,10 @@ enum Op {
let op = op.to_scalar();
// "Bitwise" operation, no NaN adjustments
match float_ty {
- FloatTy::F16 => unimplemented!("f16_f128"),
+ FloatTy::F16 => Scalar::from_f16(op.to_f16()?.abs()),
FloatTy::F32 => Scalar::from_f32(op.to_f32()?.abs()),
FloatTy::F64 => Scalar::from_f64(op.to_f64()?.abs()),
- FloatTy::F128 => unimplemented!("f16_f128"),
+ FloatTy::F128 => Scalar::from_f128(op.to_f128()?.abs()),
}
}
Op::Round(rounding) => {
@@ -139,21 +134,12 @@ enum Op {
intrinsic_name
)
};
+ let op = op.to_scalar();
match float_ty {
- FloatTy::F16 => unimplemented!("f16_f128"),
- FloatTy::F32 => {
- let f = op.to_scalar().to_f32()?;
- let res = f.round_to_integral(rounding).value;
- let res = self.adjust_nan(res, &[f]);
- Scalar::from_f32(res)
- }
- FloatTy::F64 => {
- let f = op.to_scalar().to_f64()?;
- let res = f.round_to_integral(rounding).value;
- let res = self.adjust_nan(res, &[f]);
- Scalar::from_f64(res)
- }
- FloatTy::F128 => unimplemented!("f16_f128"),
+ FloatTy::F16 => self.float_round::<Half>(op, rounding)?,
+ FloatTy::F32 => self.float_round::<Single>(op, rounding)?,
+ FloatTy::F64 => self.float_round::<Double>(op, rounding)?,
+ FloatTy::F128 => self.float_round::<Quad>(op, rounding)?,
}
}
Op::Numeric(name) => {
@@ -216,8 +202,8 @@ enum Op {
sym::simd_le => Op::MirOp(BinOp::Le),
sym::simd_gt => Op::MirOp(BinOp::Gt),
sym::simd_ge => Op::MirOp(BinOp::Ge),
- sym::simd_fmax => Op::FMinMax(MinMax::Max),
- sym::simd_fmin => Op::FMinMax(MinMax::Min),
+ sym::simd_fmax => Op::FMinMax(MinMax::MaxNum),
+ sym::simd_fmin => Op::FMinMax(MinMax::MinNum),
sym::simd_saturating_add => Op::SaturatingOp(BinOp::Add),
sym::simd_saturating_sub => Op::SaturatingOp(BinOp::Sub),
sym::simd_arith_offset => Op::WrappingOffset,
@@ -309,8 +295,8 @@ enum Op {
sym::simd_reduce_xor => Op::MirOp(BinOp::BitXor),
sym::simd_reduce_any => Op::MirOpBool(BinOp::BitOr),
sym::simd_reduce_all => Op::MirOpBool(BinOp::BitAnd),
- sym::simd_reduce_max => Op::MinMax(MinMax::Max),
- sym::simd_reduce_min => Op::MinMax(MinMax::Min),
+ sym::simd_reduce_max => Op::MinMax(MinMax::MaxNum),
+ sym::simd_reduce_min => Op::MinMax(MinMax::MinNum),
_ => unreachable!(),
};
@@ -332,10 +318,10 @@ enum Op {
if matches!(res.layout.ty.kind(), ty::Float(_)) {
ImmTy::from_scalar(self.fminmax_op(mmop, &res, &op)?, res.layout)
} else {
- // Just boring integers, so NaNs to worry about
+ // Just boring integers, no NaNs to worry about.
let mirop = match mmop {
- MinMax::Min => BinOp::Le,
- MinMax::Max => BinOp::Ge,
+ MinMax::MinNum | MinMax::Minimum => BinOp::Le,
+ MinMax::MaxNum | MinMax::Maximum => BinOp::Ge,
};
if self.binary_op(mirop, &res, &op)?.to_scalar().to_bool()? {
res
@@ -658,6 +644,8 @@ enum Op {
}
}
sym::simd_masked_load => {
+ let dest_layout = dest.layout;
+
let (mask, mask_len) = self.project_to_simd(&args[0])?;
let ptr = self.read_pointer(&args[1])?;
let (default, default_len) = self.project_to_simd(&args[2])?;
@@ -666,6 +654,14 @@ enum Op {
assert_eq!(dest_len, mask_len);
assert_eq!(dest_len, default_len);
+ self.check_simd_ptr_alignment(
+ ptr,
+ dest_layout,
+ generic_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment(),
+ )?;
+
for i in 0..dest_len {
let mask = self.read_immediate(&self.project_index(&mask, i)?)?;
let default = self.read_immediate(&self.project_index(&default, i)?)?;
@@ -674,7 +670,8 @@ enum Op {
let val = if simd_element_to_bool(mask)? {
// Size * u64 is implemented as always checked
let ptr = ptr.wrapping_offset(dest.layout.size * i, self);
- let place = self.ptr_to_mplace(ptr, dest.layout);
+ // we have already checked the alignment requirements
+ let place = self.ptr_to_mplace_unaligned(ptr, dest.layout);
self.read_immediate(&place)?
} else {
default
@@ -689,6 +686,14 @@ enum Op {
assert_eq!(mask_len, vals_len);
+ self.check_simd_ptr_alignment(
+ ptr,
+ args[2].layout,
+ generic_args[3].expect_const().to_value().valtree.unwrap_branch()[0]
+ .unwrap_leaf()
+ .to_simd_alignment(),
+ )?;
+
for i in 0..vals_len {
let mask = self.read_immediate(&self.project_index(&mask, i)?)?;
let val = self.read_immediate(&self.project_index(&vals, i)?)?;
@@ -696,11 +701,49 @@ enum Op {
if simd_element_to_bool(mask)? {
// Size * u64 is implemented as always checked
let ptr = ptr.wrapping_offset(val.layout.size * i, self);
- let place = self.ptr_to_mplace(ptr, val.layout);
+ // we have already checked the alignment requirements
+ let place = self.ptr_to_mplace_unaligned(ptr, val.layout);
self.write_immediate(*val, &place)?
};
}
}
+ sym::simd_fma | sym::simd_relaxed_fma => {
+ // `simd_fma` should always deterministically use `mul_add`, whereas `relaxed_fma`
+ // is non-deterministic, and can use either `mul_add` or `a * b + c`
+ let typ = match intrinsic_name {
+ sym::simd_fma => MulAddType::Fused,
+ sym::simd_relaxed_fma => MulAddType::Nondeterministic,
+ _ => unreachable!(),
+ };
+
+ let (a, a_len) = self.project_to_simd(&args[0])?;
+ let (b, b_len) = self.project_to_simd(&args[1])?;
+ let (c, c_len) = self.project_to_simd(&args[2])?;
+ let (dest, dest_len) = self.project_to_simd(&dest)?;
+
+ assert_eq!(dest_len, a_len);
+ assert_eq!(dest_len, b_len);
+ assert_eq!(dest_len, c_len);
+
+ for i in 0..dest_len {
+ let a = self.read_scalar(&self.project_index(&a, i)?)?;
+ let b = self.read_scalar(&self.project_index(&b, i)?)?;
+ let c = self.read_scalar(&self.project_index(&c, i)?)?;
+ let dest = self.project_index(&dest, i)?;
+
+ let ty::Float(float_ty) = dest.layout.ty.kind() else {
+ span_bug!(self.cur_span(), "{} operand is not a float", intrinsic_name)
+ };
+
+ let val = match float_ty {
+ FloatTy::F16 => self.float_muladd::<Half>(a, b, c, typ)?,
+ FloatTy::F32 => self.float_muladd::<Single>(a, b, c, typ)?,
+ FloatTy::F64 => self.float_muladd::<Double>(a, b, c, typ)?,
+ FloatTy::F128 => self.float_muladd::<Quad>(a, b, c, typ)?,
+ };
+ self.write_scalar(val, &dest)?;
+ }
+ }
// Unsupported intrinsic: skip the return_to_block below.
_ => return interp_ok(false),
@@ -711,12 +754,12 @@ enum Op {
interp_ok(true)
}
- fn fminmax_op<Prov: Provenance>(
+ fn fminmax_op(
&self,
op: MinMax,
- left: &ImmTy<'tcx, Prov>,
- right: &ImmTy<'tcx, Prov>,
- ) -> InterpResult<'tcx, Scalar<Prov>> {
+ left: &ImmTy<'tcx, M::Provenance>,
+ right: &ImmTy<'tcx, M::Provenance>,
+ ) -> InterpResult<'tcx, Scalar<M::Provenance>> {
assert_eq!(left.layout.ty, right.layout.ty);
let ty::Float(float_ty) = left.layout.ty.kind() else {
bug!("fmax operand is not a float")
@@ -724,30 +767,36 @@ fn fminmax_op<Prov: Provenance>(
let left = left.to_scalar();
let right = right.to_scalar();
interp_ok(match float_ty {
- FloatTy::F16 => unimplemented!("f16_f128"),
- FloatTy::F32 => {
- let left = left.to_f32()?;
- let right = right.to_f32()?;
- let res = match op {
- MinMax::Min => left.min(right),
- MinMax::Max => left.max(right),
- };
- let res = self.adjust_nan(res, &[left, right]);
- Scalar::from_f32(res)
- }
- FloatTy::F64 => {
- let left = left.to_f64()?;
- let right = right.to_f64()?;
- let res = match op {
- MinMax::Min => left.min(right),
- MinMax::Max => left.max(right),
- };
- let res = self.adjust_nan(res, &[left, right]);
- Scalar::from_f64(res)
- }
- FloatTy::F128 => unimplemented!("f16_f128"),
+ FloatTy::F16 => self.float_minmax::<Half>(left, right, op)?,
+ FloatTy::F32 => self.float_minmax::<Single>(left, right, op)?,
+ FloatTy::F64 => self.float_minmax::<Double>(left, right, op)?,
+ FloatTy::F128 => self.float_minmax::<Quad>(left, right, op)?,
})
}
+
+ fn check_simd_ptr_alignment(
+ &self,
+ ptr: Pointer<Option<M::Provenance>>,
+ vector_layout: TyAndLayout<'tcx>,
+ alignment: SimdAlign,
+ ) -> InterpResult<'tcx> {
+ assert_matches!(vector_layout.backend_repr, BackendRepr::SimdVector { .. });
+
+ let align = match alignment {
+ ty::SimdAlign::Unaligned => {
+ // The pointer is supposed to be unaligned, so no check is required.
+ return interp_ok(());
+ }
+ ty::SimdAlign::Element => {
+ // Take the alignment of the only field, which is an array and therefore has the same
+ // alignment as the element type.
+ vector_layout.field(self, 0).align.abi
+ }
+ ty::SimdAlign::Vector => vector_layout.align.abi,
+ };
+
+ self.check_ptr_align(ptr, align)
+ }
}
fn simd_bitmask_index(idx: u32, vec_len: u32, endianness: Endian) -> u32 {
diff --git a/compiler/rustc_const_eval/src/interpret/machine.rs b/compiler/rustc_const_eval/src/interpret/machine.rs
index 1725635..236c35e 100644
--- a/compiler/rustc_const_eval/src/interpret/machine.rs
+++ b/compiler/rustc_const_eval/src/interpret/machine.rs
@@ -290,7 +290,7 @@ fn equal_float_min_max<F: Float>(_ecx: &InterpCx<'tcx, Self>, a: F, _b: F) -> F
}
/// Determines whether the `fmuladd` intrinsics fuse the multiply-add or use separate operations.
- fn float_fuse_mul_add(_ecx: &mut InterpCx<'tcx, Self>) -> bool;
+ fn float_fuse_mul_add(_ecx: &InterpCx<'tcx, Self>) -> bool;
/// Called before a basic block terminator is executed.
#[inline]
@@ -676,7 +676,7 @@ fn call_extra_fn(
}
#[inline(always)]
- fn float_fuse_mul_add(_ecx: &mut InterpCx<$tcx, Self>) -> bool {
+ fn float_fuse_mul_add(_ecx: &InterpCx<$tcx, Self>) -> bool {
true
}
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 462ca98..8353aac 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -13,6 +13,7 @@
#![feature(panic_backtrace_config)]
#![feature(panic_update_hook)]
#![feature(rustdoc_internals)]
+#![feature(trim_prefix_suffix)]
#![feature(try_blocks)]
// tidy-alphabetical-end
@@ -466,7 +467,7 @@ pub enum Compilation {
fn handle_explain(early_dcx: &EarlyDiagCtxt, registry: Registry, code: &str, color: ColorConfig) {
// Allow "E0123" or "0123" form.
let upper_cased_code = code.to_ascii_uppercase();
- if let Ok(code) = upper_cased_code.strip_prefix('E').unwrap_or(&upper_cased_code).parse::<u32>()
+ if let Ok(code) = upper_cased_code.trim_prefix('E').parse::<u32>()
&& code <= ErrCode::MAX_AS_U32
&& let Ok(description) = registry.try_find_description(ErrCode::from_u32(code))
{
@@ -1267,7 +1268,7 @@ fn eq_ignore_separators(s1: &str, s2: &str) -> bool {
if let Some(name) = matches.opt_str("o")
&& let Some(suspect) = args.iter().find(|arg| arg.starts_with("-o") && *arg != "-o")
{
- let filename = suspect.strip_prefix("-").unwrap_or(suspect);
+ let filename = suspect.trim_prefix("-");
let optgroups = config::rustc_optgroups();
let fake_args = ["optimize", "o0", "o1", "o2", "o3", "ofast", "og", "os", "oz"];
diff --git a/compiler/rustc_error_codes/src/error_codes/E0536.md b/compiler/rustc_error_codes/src/error_codes/E0536.md
index f00d177..c1f43fa 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0536.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0536.md
@@ -1,18 +1,22 @@
The `not` cfg-predicate was malformed.
-Erroneous code example:
+Erroneous code example (using `cargo doc`):
-```compile_fail,E0536
+```ignore, E0536 (only triggers on cargo doc)
+#![feature(doc_cfg)]
+#[doc(cfg(not()))]
pub fn main() {
- if cfg!(not()) { }
+
}
```
The `not` predicate expects one cfg-pattern. Example:
```
+#![feature(doc_cfg)]
+#[doc(cfg(not(target_os = "linux")))] // ok!
pub fn main() {
- if cfg!(not(target_os = "linux")) { } // ok!
+
}
```
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 25b6d99..d98d6e5 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2155,6 +2155,7 @@ fn emit_suggestion_default(
let line_start = sm.lookup_char_pos(parts[0].original_span.lo()).line;
let mut lines = complete.lines();
+ let lines_len = lines.clone().count();
if lines.clone().next().is_none() {
// Account for a suggestion to completely remove a line(s) with whitespace (#94192).
let line_end = sm.lookup_char_pos(parts[0].original_span.hi()).line;
@@ -2195,6 +2196,7 @@ fn emit_suggestion_default(
if highlight_parts.len() == 1
&& line.trim().starts_with("#[")
&& line.trim().ends_with(']')
+ && lines_len == 1
{
is_item_attribute = true;
}
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index 2c47280..5dcb5df 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -657,6 +657,12 @@ pub struct BuiltinAttribute {
template!(Word, "https://doc.rust-lang.org/reference/attributes/codegen.html#the-naked-attribute"),
WarnFollowing, EncodeCrossCrate::No
),
+ // See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details.
+ rustc_attr!(
+ rustc_pass_indirectly_in_non_rustic_abis, Normal, template!(Word), ErrorFollowing,
+ EncodeCrossCrate::No,
+ "types marked with `#[rustc_pass_indirectly_in_non_rustic_abis]` are always passed indirectly by non-Rustic abis."
+ ),
// Limits:
ungated!(
diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs
index 1bb8767..a5f7deb 100644
--- a/compiler/rustc_hir/src/attrs/data_structures.rs
+++ b/compiler/rustc_hir/src/attrs/data_structures.rs
@@ -679,6 +679,9 @@ pub enum AttributeKind {
/// Represents `#[rustc_object_lifetime_default]`.
RustcObjectLifetimeDefault,
+ /// Represents `#[rustc_pass_indirectly_in_non_rustic_abis]`
+ RustcPassIndirectlyInNonRusticAbis(Span),
+
/// Represents `#[rustc_simd_monomorphize_lane_limit = "N"]`.
RustcSimdMonomorphizeLaneLimit(Limit),
diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
index 11c54b0..d59fccb 100644
--- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
+++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
@@ -91,6 +91,7 @@ pub fn encode_cross_crate(&self) -> EncodeCrossCrate {
RustcLayoutScalarValidRangeStart(..) => Yes,
RustcMain => No,
RustcObjectLifetimeDefault => No,
+ RustcPassIndirectlyInNonRusticAbis(..) => No,
RustcSimdMonomorphizeLaneLimit(..) => Yes, // Affects layout computation, which needs to work cross-crate
Sanitize { .. } => No,
ShouldPanic { .. } => No,
diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs
index eb630fc..0d0a1f6 100644
--- a/compiler/rustc_hir/src/lib.rs
+++ b/compiler/rustc_hir/src/lib.rs
@@ -3,9 +3,9 @@
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
// tidy-alphabetical-start
+#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
-#![feature(debug_closure_helpers)]
#![feature(exhaustive_patterns)]
#![feature(never_type)]
#![feature(variant_count)]
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index cc65989..1e12adb 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -782,7 +782,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
tcx.ensure_ok().generics_of(def_id);
tcx.ensure_ok().type_of(def_id);
tcx.ensure_ok().predicates_of(def_id);
- crate::collect::lower_enum_variant_types(tcx, def_id.to_def_id());
+ crate::collect::lower_enum_variant_types(tcx, def_id);
check_enum(tcx, def_id);
check_variances_for_type_defn(tcx, def_id);
}
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
index 936b02c..74bf683 100644
--- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
+++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
@@ -1097,14 +1097,14 @@ fn check_region_bounds_on_impl_item<'tcx>(
.expect("expected impl item to have generics or else we can't compare them")
.span;
- let mut generics_span = None;
+ let mut generics_span = tcx.def_span(trait_m.def_id);
let mut bounds_span = vec![];
let mut where_span = None;
if let Some(trait_node) = tcx.hir_get_if_local(trait_m.def_id)
&& let Some(trait_generics) = trait_node.generics()
{
- generics_span = Some(trait_generics.span);
+ generics_span = trait_generics.span;
// FIXME: we could potentially look at the impl's bounds to not point at bounds that
// *are* present in the impl.
for p in trait_generics.predicates {
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
index a665991..a8e8830 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
@@ -695,8 +695,8 @@ pub(crate) fn check_intrinsic_type(
(1, 0, vec![param(0), param(0), param(0)], param(0))
}
sym::simd_gather => (3, 0, vec![param(0), param(1), param(2)], param(0)),
- sym::simd_masked_load => (3, 0, vec![param(0), param(1), param(2)], param(2)),
- sym::simd_masked_store => (3, 0, vec![param(0), param(1), param(2)], tcx.types.unit),
+ sym::simd_masked_load => (3, 1, vec![param(0), param(1), param(2)], param(2)),
+ sym::simd_masked_store => (3, 1, vec![param(0), param(1), param(2)], tcx.types.unit),
sym::simd_scatter => (3, 0, vec![param(0), param(1), param(2)], tcx.types.unit),
sym::simd_insert | sym::simd_insert_dyn => {
(2, 0, vec![param(0), tcx.types.u32, param(1)], param(0))
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs
index 1386070..6e62e50 100644
--- a/compiler/rustc_hir_analysis/src/collect.rs
+++ b/compiler/rustc_hir_analysis/src/collect.rs
@@ -19,7 +19,7 @@
use std::iter;
use std::ops::Bound;
-use rustc_abi::ExternAbi;
+use rustc_abi::{ExternAbi, Size};
use rustc_ast::Recovered;
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_data_structures::unord::UnordMap;
@@ -605,32 +605,70 @@ pub(super) fn lower_variant_ctor(tcx: TyCtxt<'_>, def_id: LocalDefId) {
tcx.ensure_ok().predicates_of(def_id);
}
-pub(super) fn lower_enum_variant_types(tcx: TyCtxt<'_>, def_id: DefId) {
+pub(super) fn lower_enum_variant_types(tcx: TyCtxt<'_>, def_id: LocalDefId) {
let def = tcx.adt_def(def_id);
let repr_type = def.repr().discr_type();
let initial = repr_type.initial_discriminant(tcx);
let mut prev_discr = None::<Discr<'_>>;
+ // Some of the logic below relies on `i128` being able to hold all c_int and c_uint values.
+ assert!(tcx.sess.target.c_int_width < 128);
+ let mut min_discr = i128::MAX;
+ let mut max_discr = i128::MIN;
// fill the discriminant values and field types
for variant in def.variants() {
let wrapped_discr = prev_discr.map_or(initial, |d| d.wrap_incr(tcx));
- prev_discr = Some(
- if let ty::VariantDiscr::Explicit(const_def_id) = variant.discr {
- def.eval_explicit_discr(tcx, const_def_id).ok()
- } else if let Some(discr) = repr_type.disr_incr(tcx, prev_discr) {
- Some(discr)
- } else {
+ let cur_discr = if let ty::VariantDiscr::Explicit(const_def_id) = variant.discr {
+ def.eval_explicit_discr(tcx, const_def_id).ok()
+ } else if let Some(discr) = repr_type.disr_incr(tcx, prev_discr) {
+ Some(discr)
+ } else {
+ let span = tcx.def_span(variant.def_id);
+ tcx.dcx().emit_err(errors::EnumDiscriminantOverflowed {
+ span,
+ discr: prev_discr.unwrap().to_string(),
+ item_name: tcx.item_ident(variant.def_id),
+ wrapped_discr: wrapped_discr.to_string(),
+ });
+ None
+ }
+ .unwrap_or(wrapped_discr);
+
+ if def.repr().c() {
+ let c_int = Size::from_bits(tcx.sess.target.c_int_width);
+ let c_uint_max = i128::try_from(c_int.unsigned_int_max()).unwrap();
+ // c_int is a signed type, so get a proper signed version of the discriminant
+ let discr_size = cur_discr.ty.int_size_and_signed(tcx).0;
+ let discr_val = discr_size.sign_extend(cur_discr.val);
+ min_discr = min_discr.min(discr_val);
+ max_discr = max_discr.max(discr_val);
+
+ // The discriminant range must either fit into c_int or c_uint.
+ if !(min_discr >= c_int.signed_int_min() && max_discr <= c_int.signed_int_max())
+ && !(min_discr >= 0 && max_discr <= c_uint_max)
+ {
let span = tcx.def_span(variant.def_id);
- tcx.dcx().emit_err(errors::EnumDiscriminantOverflowed {
+ let msg = if discr_val < c_int.signed_int_min() || discr_val > c_uint_max {
+ "`repr(C)` enum discriminant does not fit into C `int` nor into C `unsigned int`"
+ } else if discr_val < 0 {
+ "`repr(C)` enum discriminant does not fit into C `unsigned int`, and a previous discriminant does not fit into C `int`"
+ } else {
+ "`repr(C)` enum discriminant does not fit into C `int`, and a previous discriminant does not fit into C `unsigned int`"
+ };
+ tcx.node_span_lint(
+ rustc_session::lint::builtin::REPR_C_ENUMS_LARGER_THAN_INT,
+ tcx.local_def_id_to_hir_id(def_id),
span,
- discr: prev_discr.unwrap().to_string(),
- item_name: tcx.item_ident(variant.def_id),
- wrapped_discr: wrapped_discr.to_string(),
- });
- None
+ |d| {
+ d.primary_message(msg)
+ .note("`repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C")
+ .help("use `repr($int_ty)` instead to explicitly set the size of this enum");
+ }
+ );
}
- .unwrap_or(wrapped_discr),
- );
+ }
+
+ prev_discr = Some(cur_discr);
for f in &variant.fields {
tcx.ensure_ok().generics_of(f.did);
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index d1eb328..dbad98f 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -191,7 +191,7 @@ pub(crate) struct LifetimesOrBoundsMismatchOnTrait {
#[label]
pub span: Span,
#[label(hir_analysis_generics_label)]
- pub generics_span: Option<Span>,
+ pub generics_span: Span,
#[label(hir_analysis_where_label)]
pub where_span: Option<Span>,
#[label(hir_analysis_bounds_label)]
diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs
index 6659aff..56c0f4e 100644
--- a/compiler/rustc_hir_analysis/src/lib.rs
+++ b/compiler/rustc_hir_analysis/src/lib.rs
@@ -59,10 +59,10 @@
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
+#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(assert_matches)]
-#![feature(debug_closure_helpers)]
#![feature(gen_blocks)]
#![feature(if_let_guard)]
#![feature(iter_intersperse)]
diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs
index 41fcfbd..6200029 100644
--- a/compiler/rustc_hir_typeck/src/errors.rs
+++ b/compiler/rustc_hir_typeck/src/errors.rs
@@ -3,7 +3,7 @@
use std::borrow::Cow;
use rustc_abi::ExternAbi;
-use rustc_ast::Label;
+use rustc_ast::{AssignOpKind, Label};
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, DiagArgValue, DiagCtxtHandle, DiagSymbolList, Diagnostic,
@@ -14,9 +14,10 @@
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
use rustc_middle::ty::{self, Ty};
use rustc_span::edition::{Edition, LATEST_STABLE_EDITION};
+use rustc_span::source_map::Spanned;
use rustc_span::{Ident, Span, Symbol};
-use crate::fluent_generated as fluent;
+use crate::{FnCtxt, fluent_generated as fluent};
#[derive(Diagnostic)]
#[diag(hir_typeck_base_expression_double_dot, code = E0797)]
@@ -1144,6 +1145,42 @@ fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
}
}
+pub(crate) fn maybe_emit_plus_equals_diagnostic<'a>(
+ fnctxt: &FnCtxt<'a, '_>,
+ assign_op: Spanned<AssignOpKind>,
+ lhs_expr: &hir::Expr<'_>,
+) -> Result<(), Diag<'a>> {
+ if assign_op.node == hir::AssignOpKind::AddAssign
+ && let hir::ExprKind::Binary(bin_op, left, right) = &lhs_expr.kind
+ && bin_op.node == hir::BinOpKind::And
+ && crate::op::contains_let_in_chain(left)
+ && let hir::ExprKind::Path(hir::QPath::Resolved(_, path)) = &right.kind
+ && matches!(path.res, hir::def::Res::Local(_))
+ {
+ let mut err = fnctxt.dcx().struct_span_err(
+ assign_op.span,
+ "binary assignment operation `+=` cannot be used in a let chain",
+ );
+
+ err.span_label(
+ lhs_expr.span,
+ "you are add-assigning the right-hand side expression to the result of this let-chain",
+ );
+
+ err.span_label(assign_op.span, "cannot use `+=` in a let chain");
+
+ err.span_suggestion(
+ assign_op.span,
+ "you might have meant to compare with `==` instead of assigning with `+=`",
+ "==",
+ Applicability::MaybeIncorrect,
+ );
+
+ return Err(err);
+ }
+ Ok(())
+}
+
#[derive(Diagnostic)]
#[diag(hir_typeck_naked_functions_must_naked_asm, code = E0787)]
pub(crate) struct NakedFunctionsMustNakedAsm {
diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs
index e720958..78b16ff 100644
--- a/compiler/rustc_hir_typeck/src/expr.rs
+++ b/compiler/rustc_hir_typeck/src/expr.rs
@@ -48,6 +48,7 @@
NoFieldOnVariant, ReturnLikeStatementKind, ReturnStmtOutsideOfFnBody, StructExprNonExhaustive,
TypeMismatchFruTypo, YieldExprOutsideOfCoroutine,
};
+use crate::op::contains_let_in_chain;
use crate::{
BreakableCtxt, CoroutineTypes, Diverges, FnCtxt, GatherLocalsVisitor, Needs,
TupleArgumentsFlag, cast, fatally_break_rust, report_unexpected_variant_res, type_error_struct,
@@ -1277,6 +1278,12 @@ pub(crate) fn check_lhs_assignable(
return;
}
+ // Skip suggestion if LHS contains a let-chain at this would likely be spurious
+ // cc: https://github.com/rust-lang/rust/issues/147664
+ if contains_let_in_chain(lhs) {
+ return;
+ }
+
let mut err = self.dcx().struct_span_err(op_span, "invalid left-hand side of assignment");
err.code(code);
err.span_label(lhs.span, "cannot assign to this expression");
diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs
index 99a9566..b4264e9 100644
--- a/compiler/rustc_hir_typeck/src/lib.rs
+++ b/compiler/rustc_hir_typeck/src/lib.rs
@@ -7,6 +7,7 @@
#![feature(iter_intersperse)]
#![feature(iter_order_by)]
#![feature(never_type)]
+#![feature(trim_prefix_suffix)]
// tidy-alphabetical-end
mod _match;
diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs
index 8e9c6eb..7d6982c 100644
--- a/compiler/rustc_hir_typeck/src/method/suggest.rs
+++ b/compiler/rustc_hir_typeck/src/method/suggest.rs
@@ -2551,7 +2551,7 @@ fn report_failed_method_call_on_numerical_infer_var(
// If this is a floating point literal that ends with '.',
// get rid of it to stop this from becoming a member access.
- let snippet = snippet.strip_suffix('.').unwrap_or(&snippet);
+ let snippet = snippet.trim_suffix('.');
err.span_suggestion(
lit.span,
format!(
diff --git a/compiler/rustc_hir_typeck/src/op.rs b/compiler/rustc_hir_typeck/src/op.rs
index d18aed0..a175b35 100644
--- a/compiler/rustc_hir_typeck/src/op.rs
+++ b/compiler/rustc_hir_typeck/src/op.rs
@@ -20,8 +20,8 @@
use super::FnCtxt;
use super::method::MethodCallee;
-use crate::Expectation;
use crate::method::TreatNotYetDefinedOpaques;
+use crate::{Expectation, errors};
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// Checks a `a <op>= b`
@@ -308,23 +308,32 @@ fn check_overloaded_binop(
let mut path = None;
let lhs_ty_str = self.tcx.short_string(lhs_ty, &mut path);
let rhs_ty_str = self.tcx.short_string(rhs_ty, &mut path);
+
let (mut err, output_def_id) = match op {
+ // Try and detect when `+=` was incorrectly
+ // used instead of `==` in a let-chain
Op::AssignOp(assign_op) => {
- let s = assign_op.node.as_str();
- let mut err = struct_span_code_err!(
- self.dcx(),
- expr.span,
- E0368,
- "binary assignment operation `{}` cannot be applied to type `{}`",
- s,
- lhs_ty_str,
- );
- err.span_label(
- lhs_expr.span,
- format!("cannot use `{}` on type `{}`", s, lhs_ty_str),
- );
- self.note_unmet_impls_on_type(&mut err, &errors, false);
- (err, None)
+ if let Err(e) =
+ errors::maybe_emit_plus_equals_diagnostic(&self, assign_op, lhs_expr)
+ {
+ (e, None)
+ } else {
+ let s = assign_op.node.as_str();
+ let mut err = struct_span_code_err!(
+ self.dcx(),
+ expr.span,
+ E0368,
+ "binary assignment operation `{}` cannot be applied to type `{}`",
+ s,
+ lhs_ty_str,
+ );
+ err.span_label(
+ lhs_expr.span,
+ format!("cannot use `{}` on type `{}`", s, lhs_ty_str),
+ );
+ self.note_unmet_impls_on_type(&mut err, &errors, false);
+ (err, None)
+ }
}
Op::BinOp(bin_op) => {
let message = match bin_op.node {
@@ -1084,6 +1093,17 @@ fn lang_item_for_unop(tcx: TyCtxt<'_>, op: hir::UnOp) -> (Symbol, Option<hir::de
}
}
+/// Check if `expr` contains a `let` or `&&`, indicating presence of a let-chain
+pub(crate) fn contains_let_in_chain(expr: &hir::Expr<'_>) -> bool {
+ match &expr.kind {
+ hir::ExprKind::Let(..) => true,
+ hir::ExprKind::Binary(Spanned { node: hir::BinOpKind::And, .. }, left, right) => {
+ contains_let_in_chain(left) || contains_let_in_chain(right)
+ }
+ _ => false,
+ }
+}
+
// Binary operator categories. These categories summarize the behavior
// with respect to the builtin operations supported.
#[derive(Clone, Copy)]
diff --git a/compiler/rustc_index/Cargo.toml b/compiler/rustc_index/Cargo.toml
index e46a1a7..edcd781 100644
--- a/compiler/rustc_index/Cargo.toml
+++ b/compiler/rustc_index/Cargo.toml
@@ -8,7 +8,7 @@
rustc_index_macros = { path = "../rustc_index_macros" }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }
-smallvec = "1.8.1"
+smallvec = { version = "1.8.1", optional = true }
# tidy-alphabetical-end
[features]
@@ -17,6 +17,7 @@
nightly = [
"dep:rustc_macros",
"dep:rustc_serialize",
+ "dep:smallvec",
"rustc_index_macros/nightly",
]
rustc_randomized_layouts = []
diff --git a/compiler/rustc_infer/src/infer/snapshot/fudge.rs b/compiler/rustc_infer/src/infer/snapshot/fudge.rs
index e210479..3730d21 100644
--- a/compiler/rustc_infer/src/infer/snapshot/fudge.rs
+++ b/compiler/rustc_infer/src/infer/snapshot/fudge.rs
@@ -1,3 +1,4 @@
+use std::fmt::Debug;
use std::ops::Range;
use rustc_data_structures::{snapshot_vec as sv, unify as ut};
@@ -84,11 +85,12 @@ impl<'tcx> InferCtxt<'tcx> {
/// the actual types (`?T`, `Option<?T>`) -- and remember that
/// after the snapshot is popped, the variable `?T` is no longer
/// unified.
- #[instrument(skip(self, f), level = "debug")]
+ #[instrument(skip(self, f), level = "debug", ret)]
pub fn fudge_inference_if_ok<T, E, F>(&self, f: F) -> Result<T, E>
where
F: FnOnce() -> Result<T, E>,
T: TypeFoldable<TyCtxt<'tcx>>,
+ E: Debug,
{
let variable_lengths = self.variable_lengths();
let (snapshot_vars, value) = self.probe(|_| {
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index be33db2..6c08b37 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -620,6 +620,7 @@ macro_rules! tracked {
tracked!(force_frame_pointers, FramePointer::Always);
tracked!(force_unwind_tables, Some(true));
tracked!(instrument_coverage, InstrumentCoverage::Yes);
+ tracked!(jump_tables, false);
tracked!(link_dead_code, Some(true));
tracked!(linker_plugin_lto, LinkerPluginLto::LinkerPluginAuto);
tracked!(llvm_args, vec![String::from("1"), String::from("2")]);
@@ -831,7 +832,6 @@ macro_rules! tracked {
tracked!(mutable_noalias, false);
tracked!(next_solver, NextSolverConfig { coherence: true, globally: true });
tracked!(no_generate_arange_section, true);
- tracked!(no_jump_tables, true);
tracked!(no_link, true);
tracked!(no_profiler_runtime, true);
tracked!(no_trait_vptr, true);
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs
index 8ce74ff..4895e61 100644
--- a/compiler/rustc_lint/src/types.rs
+++ b/compiler/rustc_lint/src/types.rs
@@ -10,7 +10,7 @@
use tracing::debug;
use {rustc_ast as ast, rustc_hir as hir};
-mod improper_ctypes; // these filed do the implementation for ImproperCTypesDefinitions,ImproperCTypesDeclarations
+mod improper_ctypes; // these files do the implementation for ImproperCTypesDefinitions,ImproperCTypesDeclarations
pub(crate) use improper_ctypes::ImproperCTypesLint;
use crate::lints::{
@@ -25,7 +25,6 @@
use crate::{LateContext, LateLintPass, LintContext};
mod literal;
-
use literal::{int_ty_range, lint_literal, uint_ty_range};
declare_lint! {
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 8c474ed..86aa634 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -86,6 +86,7 @@
REFINING_IMPL_TRAIT_INTERNAL,
REFINING_IMPL_TRAIT_REACHABLE,
RENAMED_AND_REMOVED_LINTS,
+ REPR_C_ENUMS_LARGER_THAN_INT,
REPR_TRANSPARENT_NON_ZST_FIELDS,
RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES,
RUST_2021_INCOMPATIBLE_OR_PATTERNS,
@@ -5213,3 +5214,52 @@
Warn,
r#"detects when a function annotated with `#[inline(always)]` and `#[target_feature(enable = "..")]` is inlined into a caller without the required target feature"#,
}
+
+declare_lint! {
+ /// The `repr_c_enums_larger_than_int` lint detects `repr(C)` enums with discriminant
+ /// values that do not fit into a C `int` or `unsigned int`.
+ ///
+ /// ### Example
+ ///
+ /// ```rust,ignore (only errors on 64bit)
+ /// #[repr(C)]
+ /// enum E {
+ /// V = 9223372036854775807, // i64::MAX
+ /// }
+ /// ```
+ ///
+ /// This will produce:
+ ///
+ /// ```text
+ /// error: `repr(C)` enum discriminant does not fit into C `int` nor into C `unsigned int`
+ /// --> $DIR/repr-c-big-discriminant1.rs:16:5
+ /// |
+ /// LL | A = 9223372036854775807, // i64::MAX
+ /// | ^
+ /// |
+ /// = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ /// = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+ /// ```
+ ///
+ /// ### Explanation
+ ///
+ /// In C, enums with discriminants that do not all fit into an `int` or all fit into an
+ /// `unsigned int` are a portability hazard: such enums are only permitted since C23, and not
+ /// supported e.g. by MSVC.
+ ///
+ /// Furthermore, Rust interprets the discriminant values of `repr(C)` enums as expressions of
+ /// type `isize`. This makes it impossible to implement the C23 behavior of enums where the enum
+ /// discriminants have no predefined type and instead the enum uses a type large enough to hold
+ /// all discriminants.
+ ///
+ /// Therefore, `repr(C)` enums in Rust require that either all discriminants to fit into a C
+ /// `int` or they all fit into an `unsigned int`.
+ pub REPR_C_ENUMS_LARGER_THAN_INT,
+ Warn,
+ "repr(C) enums with discriminant values that do not fit into a C int",
+ @future_incompatible = FutureIncompatibleInfo {
+ reason: FutureIncompatibilityReason::FutureReleaseError,
+ reference: "issue #124403 <https://github.com/rust-lang/rust/issues/124403>",
+ report_in_deps: false,
+ };
+}
diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs
index 1557206..8f51cbe 100644
--- a/compiler/rustc_metadata/src/native_libs.rs
+++ b/compiler/rustc_metadata/src/native_libs.rs
@@ -15,7 +15,7 @@
use rustc_session::search_paths::PathKind;
use rustc_span::Symbol;
use rustc_span::def_id::{DefId, LOCAL_CRATE};
-use rustc_target::spec::{BinaryFormat, LinkSelfContainedComponents};
+use rustc_target::spec::{Arch, BinaryFormat, LinkSelfContainedComponents};
use crate::errors;
@@ -393,7 +393,7 @@ fn build_dll_import(
// This logic is similar to `AbiMap::canonize_abi` (in rustc_target/src/spec/abi_map.rs) but
// we need more detail than those adjustments, and we can't support all ABIs that are
// generally supported.
- let calling_convention = if self.tcx.sess.target.arch == "x86" {
+ let calling_convention = if self.tcx.sess.target.arch == Arch::X86 {
match abi {
ExternAbi::C { .. } | ExternAbi::Cdecl { .. } => DllCallingConvention::C,
ExternAbi::Stdcall { .. } => {
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index b895feb..808d9fb 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1560,7 +1560,6 @@ fn def_path_hash_to_def_index(self, hash: DefPathHash) -> Option<DefIndex> {
}
fn expn_hash_to_expn_id(self, sess: &Session, index_guess: u32, hash: ExpnHash) -> ExpnId {
- debug_assert_eq!(ExpnId::from_hash(hash), None);
let index_guess = ExpnIndex::from_u32(index_guess);
let old_hash = self.root.expn_hashes.get(self, index_guess).map(|lazy| lazy.decode(self));
diff --git a/compiler/rustc_middle/src/ty/consts/int.rs b/compiler/rustc_middle/src/ty/consts/int.rs
index 6ee76b94..eaf67ae 100644
--- a/compiler/rustc_middle/src/ty/consts/int.rs
+++ b/compiler/rustc_middle/src/ty/consts/int.rs
@@ -39,6 +39,15 @@ pub enum AtomicOrdering {
SeqCst = 4,
}
+/// An enum to represent the compiler-side view of `intrinsics::simd::SimdAlign`.
+#[derive(Debug, Copy, Clone)]
+pub enum SimdAlign {
+ // These values must match `intrinsics::simd::SimdAlign`!
+ Unaligned = 0,
+ Element = 1,
+ Vector = 2,
+}
+
impl std::fmt::Debug for ConstInt {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let Self { int, signed, is_ptr_sized_integral } = *self;
@@ -350,6 +359,21 @@ pub fn to_atomic_ordering(self) -> AtomicOrdering {
}
}
+ #[inline]
+ pub fn to_simd_alignment(self) -> SimdAlign {
+ use SimdAlign::*;
+ let val = self.to_u32();
+ if val == Unaligned as u32 {
+ Unaligned
+ } else if val == Element as u32 {
+ Element
+ } else if val == Vector as u32 {
+ Vector
+ } else {
+ panic!("not a valid simd alignment")
+ }
+ }
+
/// Converts the `ScalarInt` to `bool`.
/// Panics if the `size` of the `ScalarInt` is not equal to 1 byte.
/// Errors if it is not a valid `bool`.
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 60effa1..a00eaef 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -2388,7 +2388,7 @@ pub fn return_type_impl_or_dyn_traits_with_type_alias(
/// Determines whether identifiers in the assembly have strict naming rules.
/// Currently, only NVPTX* targets need it.
pub fn has_strict_asm_symbol_naming(self) -> bool {
- self.sess.target.arch.contains("nvptx")
+ self.sess.target.llvm_target.starts_with("nvptx")
}
/// Returns `&'static core::panic::Location<'static>`.
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
index eefb913..621d5c3 100644
--- a/compiler/rustc_middle/src/ty/layout.rs
+++ b/compiler/rustc_middle/src/ty/layout.rs
@@ -3,7 +3,7 @@
use rustc_abi::{
AddressSpace, Align, ExternAbi, FieldIdx, FieldsShape, HasDataLayout, LayoutData, PointeeInfo,
- PointerKind, Primitive, ReprOptions, Scalar, Size, TagEncoding, TargetDataLayout,
+ PointerKind, Primitive, ReprFlags, ReprOptions, Scalar, Size, TagEncoding, TargetDataLayout,
TyAbiInterface, VariantIdx, Variants,
};
use rustc_error_messages::DiagMessage;
@@ -72,7 +72,10 @@ fn from_uint_ty<C: HasDataLayout>(cx: &C, ity: ty::UintTy) -> abi::Integer {
/// signed discriminant range and `#[repr]` attribute.
/// N.B.: `u128` values above `i128::MAX` will be treated as signed, but
/// that shouldn't affect anything, other than maybe debuginfo.
- fn repr_discr<'tcx>(
+ ///
+ /// This is the basis for computing the type of the *tag* of an enum (which can be smaller than
+ /// the type of the *discriminant*, which is determined by [`ReprOptions::discr_type`]).
+ fn discr_range_of_repr<'tcx>(
tcx: TyCtxt<'tcx>,
ty: Ty<'tcx>,
repr: &ReprOptions,
@@ -108,7 +111,8 @@ fn repr_discr<'tcx>(
abi::Integer::I8
};
- // Pick the smallest fit.
+ // Pick the smallest fit. Prefer unsigned; that matches clang in cases where this makes a
+ // difference (https://godbolt.org/z/h4xEasW1d) so it is crucial for repr(C).
if unsigned_fit <= signed_fit {
(cmp::max(unsigned_fit, at_least), false)
} else {
@@ -1173,6 +1177,11 @@ fn is_unit(this: TyAndLayout<'tcx>) -> bool {
fn is_transparent(this: TyAndLayout<'tcx>) -> bool {
matches!(this.ty.kind(), ty::Adt(def, _) if def.repr().transparent())
}
+
+ /// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
+ fn is_pass_indirectly_in_non_rustic_abis_flag_set(this: TyAndLayout<'tcx>) -> bool {
+ matches!(this.ty.kind(), ty::Adt(def, _) if def.repr().flags.contains(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS))
+ }
}
/// Calculates whether a function's ABI can unwind or not.
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 2b9079d..d253deb 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -74,7 +74,7 @@
};
pub use self::consts::{
AnonConstKind, AtomicOrdering, Const, ConstInt, ConstKind, ConstToValTreeResult, Expr,
- ExprKind, ScalarInt, UnevaluatedConst, ValTree, ValTreeKind, Value,
+ ExprKind, ScalarInt, SimdAlign, UnevaluatedConst, ValTree, ValTreeKind, Value,
};
pub use self::context::{
CtxtInterners, CurrentGcx, Feed, FreeRegionInfo, GlobalCtxt, Lift, TyCtxt, TyCtxtFeed, tls,
@@ -1573,6 +1573,14 @@ pub fn repr_options_of_def(self, did: LocalDefId) -> ReprOptions {
flags.insert(ReprFlags::IS_LINEAR);
}
+ // See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details.
+ if find_attr!(
+ self.get_all_attrs(did),
+ AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)
+ ) {
+ flags.insert(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS);
+ }
+
ReprOptions { int: size, align: max_align, pack: min_pack, flags, field_shuffle_seed }
}
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index 6534749..55a279f 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -407,6 +407,10 @@ fn parse_ty_common(
// Qualified path
let (qself, path) = self.parse_qpath(PathStyle::Type)?;
TyKind::Path(Some(qself), path)
+ } else if (self.token.is_keyword(kw::Const) || self.token.is_keyword(kw::Mut))
+ && self.look_ahead(1, |t| *t == token::Star)
+ {
+ self.parse_ty_c_style_pointer()?
} else if self.check_path() {
self.parse_path_start_ty(lo, allow_plus, ty_generics)?
} else if self.can_begin_bound() {
@@ -588,6 +592,41 @@ fn parse_remaining_bounds(
Ok(TyKind::TraitObject(bounds, TraitObjectSyntax::None))
}
+ /// Parses a raw pointer with a C-style typo
+ fn parse_ty_c_style_pointer(&mut self) -> PResult<'a, TyKind> {
+ let kw_span = self.token.span;
+ let mutbl = self.parse_const_or_mut();
+
+ if let Some(mutbl) = mutbl
+ && self.eat(exp!(Star))
+ {
+ let star_span = self.prev_token.span;
+
+ let mutability = match mutbl {
+ Mutability::Not => "const",
+ Mutability::Mut => "mut",
+ };
+
+ let ty = self.parse_ty_no_question_mark_recover()?;
+
+ self.dcx()
+ .struct_span_err(
+ kw_span,
+ format!("raw pointer types must be written as `*{mutability} T`"),
+ )
+ .with_multipart_suggestion(
+ format!("put the `*` before `{mutability}`"),
+ vec![(star_span, String::new()), (kw_span.shrink_to_lo(), "*".to_string())],
+ Applicability::MachineApplicable,
+ )
+ .emit();
+
+ return Ok(TyKind::Ptr(MutTy { ty, mutbl }));
+ }
+ // This is unreachable because we always get into if above and return from it
+ unreachable!("this could never happen")
+ }
+
/// Parses a raw pointer type: `*[const | mut] $type`.
fn parse_ty_ptr(&mut self) -> PResult<'a, TyKind> {
let mutbl = self.parse_const_or_mut().unwrap_or_else(|| {
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index c214104..5944a1e 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -284,6 +284,7 @@ fn check_attributes(
| AttributeKind::RustcCoherenceIsCore(..)
| AttributeKind::DebuggerVisualizer(..)
| AttributeKind::RustcMain
+ | AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)
| AttributeKind::PinV2(..),
) => { /* do nothing */ }
Attribute::Unparsed(attr_item) => {
@@ -1770,6 +1771,17 @@ fn check_repr(
target: target.to_string(),
});
}
+ // Error on `#[repr(transparent)]` in combination with
+ // `#[rustc_pass_indirectly_in_non_rustic_abis]`
+ if is_transparent
+ && let Some(&pass_indirectly_span) =
+ find_attr!(attrs, AttributeKind::RustcPassIndirectlyInNonRusticAbis(span) => span)
+ {
+ self.dcx().emit_err(errors::TransparentIncompatible {
+ hint_spans: vec![span, pass_indirectly_span],
+ target: target.to_string(),
+ });
+ }
if is_explicit_rust && (int_reprs > 0 || is_c || is_simd) {
let hint_spans = hint_spans.clone().collect();
self.dcx().emit_err(errors::ReprConflicting { hint_spans });
diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl
index d462ff5..1569c17 100644
--- a/compiler/rustc_resolve/messages.ftl
+++ b/compiler/rustc_resolve/messages.ftl
@@ -11,9 +11,9 @@
resolve_ancestor_only =
visibilities can only be restricted to ancestor modules
-resolve_anonymous_lifetime_non_gat_report_error =
- in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+resolve_anonymous_lifetime_non_gat_report_error = missing lifetime in associated type
.label = this lifetime must come from the implemented type
+ .note = in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
resolve_arguments_macro_use_not_allowed = arguments to `macro_use` are not allowed here
@@ -175,6 +175,7 @@
} from outer item
.refer_to_type_directly = refer to the type directly here instead
.suggestion = try introducing a local generic parameter here
+ .note = nested items are independent from their parent item for everything except for privacy and name resolution
resolve_generic_params_from_outer_item_const = a `const` is a separate item from the item that contains it
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 3020ecb..2f4a18f 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -558,6 +558,7 @@ pub(crate) fn into_struct_error(
has_generic_params,
def_kind,
inner_item,
+ current_self_ty,
} => {
use errs::GenericParamsFromOuterItemLabel as Label;
let static_or_const = match def_kind {
@@ -595,7 +596,8 @@ pub(crate) fn into_struct_error(
sm,
self.def_span(def_id),
)));
- err.refer_to_type_directly = Some(span);
+ err.refer_to_type_directly =
+ current_self_ty.map(|snippet| errs::UseTypeDirectly { span, snippet });
return self.dcx().create_err(err);
}
Res::Def(DefKind::TyParam, def_id) => {
diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs
index 5c5938a..eace729 100644
--- a/compiler/rustc_resolve/src/errors.rs
+++ b/compiler/rustc_resolve/src/errors.rs
@@ -11,14 +11,15 @@
#[derive(Diagnostic)]
#[diag(resolve_generic_params_from_outer_item, code = E0401)]
+#[note]
pub(crate) struct GenericParamsFromOuterItem {
#[primary_span]
#[label]
pub(crate) span: Span,
#[subdiagnostic]
pub(crate) label: Option<GenericParamsFromOuterItemLabel>,
- #[label(resolve_refer_to_type_directly)]
- pub(crate) refer_to_type_directly: Option<Span>,
+ #[subdiagnostic]
+ pub(crate) refer_to_type_directly: Option<UseTypeDirectly>,
#[subdiagnostic]
pub(crate) sugg: Option<GenericParamsFromOuterItemSugg>,
#[subdiagnostic]
@@ -68,6 +69,18 @@ pub(crate) struct GenericParamsFromOuterItemSugg {
pub(crate) span: Span,
pub(crate) snippet: String,
}
+#[derive(Subdiagnostic)]
+#[suggestion(
+ resolve_refer_to_type_directly,
+ code = "{snippet}",
+ applicability = "maybe-incorrect",
+ style = "verbose"
+)]
+pub(crate) struct UseTypeDirectly {
+ #[primary_span]
+ pub(crate) span: Span,
+ pub(crate) snippet: String,
+}
#[derive(Diagnostic)]
#[diag(resolve_name_is_already_used_as_generic_parameter, code = E0403)]
@@ -945,6 +958,8 @@ pub(crate) struct AnonymousLifetimeNonGatReportError {
#[primary_span]
#[label]
pub(crate) lifetime: Span,
+ #[note]
+ pub(crate) decl: MultiSpan,
}
#[derive(Subdiagnostic)]
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs
index 278c0fe..f3f0a74 100644
--- a/compiler/rustc_resolve/src/ident.rs
+++ b/compiler/rustc_resolve/src/ident.rs
@@ -326,7 +326,7 @@ pub(crate) fn resolve_ident_in_lexical_scope(
i,
rib_ident,
*res,
- finalize.map(|finalize| finalize.path_span),
+ finalize.map(|_| general_span),
*original_rib_ident_def,
ribs,
diag_metadata,
@@ -1415,6 +1415,11 @@ fn validate_res_from_ribs(
has_generic_params,
def_kind,
inner_item: item,
+ current_self_ty: diag_metadata
+ .and_then(|m| m.current_self_type.as_ref())
+ .and_then(|ty| {
+ self.tcx.sess.source_map().span_to_snippet(ty.span).ok()
+ }),
},
);
}
@@ -1503,6 +1508,11 @@ fn validate_res_from_ribs(
has_generic_params,
def_kind,
inner_item: item,
+ current_self_ty: diag_metadata
+ .and_then(|m| m.current_self_type.as_ref())
+ .and_then(|ty| {
+ self.tcx.sess.source_map().span_to_snippet(ty.span).ok()
+ }),
},
);
}
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 0b41a79..f462ba0 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -10,6 +10,7 @@
use std::borrow::Cow;
use std::collections::hash_map::Entry;
use std::mem::{replace, swap, take};
+use std::ops::ControlFlow;
use rustc_ast::visit::{
AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor, try_visit, visit_opt, walk_list,
@@ -19,21 +20,21 @@
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_errors::codes::*;
use rustc_errors::{
- Applicability, Diag, DiagArgValue, ErrorGuaranteed, IntoDiagArg, StashKey, Suggestions,
- pluralize,
+ Applicability, Diag, DiagArgValue, ErrorGuaranteed, IntoDiagArg, MultiSpan, StashKey,
+ Suggestions, pluralize,
};
use rustc_hir::def::Namespace::{self, *};
use rustc_hir::def::{self, CtorKind, DefKind, LifetimeRes, NonMacroAttrKind, PartialRes, PerNS};
use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LOCAL_CRATE, LocalDefId};
use rustc_hir::{MissingLifetimeKind, PrimTy, TraitCandidate};
use rustc_middle::middle::resolve_bound_vars::Set1;
-use rustc_middle::ty::{DelegationFnSig, Visibility};
+use rustc_middle::ty::{AssocTag, DelegationFnSig, Visibility};
use rustc_middle::{bug, span_bug};
use rustc_session::config::{CrateType, ResolveDocLinks};
use rustc_session::lint;
use rustc_session::parse::feature_err;
use rustc_span::source_map::{Spanned, respan};
-use rustc_span::{BytePos, Ident, Span, Symbol, SyntaxContext, kw, sym};
+use rustc_span::{BytePos, DUMMY_SP, Ident, Span, Symbol, SyntaxContext, kw, sym};
use smallvec::{SmallVec, smallvec};
use thin_vec::ThinVec;
use tracing::{debug, instrument, trace};
@@ -373,11 +374,14 @@ enum LifetimeBinderKind {
FnPtrType,
PolyTrait,
WhereBound,
+ // Item covers foreign items, ADTs, type aliases, trait associated items and
+ // trait alias associated items.
Item,
ConstItem,
Function,
Closure,
ImplBlock,
+ // Covers only `impl` associated types.
ImplAssocType,
}
@@ -675,7 +679,7 @@ pub(crate) struct DiagMetadata<'ast> {
current_trait_assoc_items: Option<&'ast [Box<AssocItem>]>,
/// The current self type if inside an impl (used for better errors).
- current_self_type: Option<Ty>,
+ pub(crate) current_self_type: Option<Ty>,
/// The current self item if inside an ADT (used for better errors).
current_self_item: Option<NodeId>,
@@ -724,6 +728,9 @@ pub(crate) struct DiagMetadata<'ast> {
/// The current impl items (used to suggest).
current_impl_items: Option<&'ast [Box<AssocItem>]>,
+ /// The current impl items (used to suggest).
+ current_impl_item: Option<&'ast AssocItem>,
+
/// When processing impl trait
currently_processing_impl_trait: Option<(TraitRef, Ty)>,
@@ -1880,9 +1887,31 @@ fn resolve_anonymous_lifetime(
ty: ty.span,
});
} else {
+ let decl = if !trait_id.is_local()
+ && let Some(assoc) = self.diag_metadata.current_impl_item
+ && let AssocItemKind::Type(_) = assoc.kind
+ && let assocs = self.r.tcx.associated_items(trait_id)
+ && let Some(ident) = assoc.kind.ident()
+ && let Some(assoc) = assocs.find_by_ident_and_kind(
+ self.r.tcx,
+ ident,
+ AssocTag::Type,
+ trait_id,
+ ) {
+ let mut decl: MultiSpan =
+ self.r.tcx.def_span(assoc.def_id).into();
+ decl.push_span_label(
+ self.r.tcx.def_span(trait_id),
+ String::new(),
+ );
+ decl
+ } else {
+ DUMMY_SP.into()
+ };
let mut err = self.r.dcx().create_err(
errors::AnonymousLifetimeNonGatReportError {
lifetime: lifetime.ident.span,
+ decl,
},
);
self.point_at_impl_lifetimes(&mut err, i, lifetime.ident.span);
@@ -1924,17 +1953,13 @@ fn resolve_anonymous_lifetime(
}
fn point_at_impl_lifetimes(&mut self, err: &mut Diag<'_>, i: usize, lifetime: Span) {
- let Some((rib, span)) = self.lifetime_ribs[..i]
- .iter()
- .rev()
- .skip(1)
- .filter_map(|rib| match rib.kind {
+ let Some((rib, span)) =
+ self.lifetime_ribs[..i].iter().rev().find_map(|rib| match rib.kind {
LifetimeRibKind::Generics { span, kind: LifetimeBinderKind::ImplBlock, .. } => {
Some((rib, span))
}
_ => None,
})
- .next()
else {
return;
};
@@ -1956,11 +1981,63 @@ fn point_at_impl_lifetimes(&mut self, err: &mut Diag<'_>, i: usize, lifetime: Sp
);
}
} else {
- err.span_label(
- span,
- "you could add a lifetime on the impl block, if the trait or the self type can \
- have one",
- );
+ struct AnonRefFinder;
+ impl<'ast> Visitor<'ast> for AnonRefFinder {
+ type Result = ControlFlow<Span>;
+
+ fn visit_ty(&mut self, ty: &'ast ast::Ty) -> Self::Result {
+ if let ast::TyKind::Ref(None, mut_ty) = &ty.kind {
+ return ControlFlow::Break(mut_ty.ty.span.shrink_to_lo());
+ }
+ visit::walk_ty(self, ty)
+ }
+
+ fn visit_lifetime(
+ &mut self,
+ lt: &'ast ast::Lifetime,
+ _cx: visit::LifetimeCtxt,
+ ) -> Self::Result {
+ if lt.ident.name == kw::UnderscoreLifetime {
+ return ControlFlow::Break(lt.ident.span);
+ }
+ visit::walk_lifetime(self, lt)
+ }
+ }
+
+ if let Some(ty) = &self.diag_metadata.current_self_type
+ && let ControlFlow::Break(sp) = AnonRefFinder.visit_ty(ty)
+ {
+ err.multipart_suggestion_verbose(
+ "add a lifetime to the impl block and use it in the self type and associated \
+ type",
+ vec![
+ (span, "<'a>".to_string()),
+ (sp, "'a ".to_string()),
+ (lifetime.shrink_to_hi(), "'a ".to_string()),
+ ],
+ Applicability::MaybeIncorrect,
+ );
+ } else if let Some(item) = &self.diag_metadata.current_item
+ && let ItemKind::Impl(impl_) = &item.kind
+ && let Some(of_trait) = &impl_.of_trait
+ && let ControlFlow::Break(sp) = AnonRefFinder.visit_trait_ref(&of_trait.trait_ref)
+ {
+ err.multipart_suggestion_verbose(
+ "add a lifetime to the impl block and use it in the trait and associated type",
+ vec![
+ (span, "<'a>".to_string()),
+ (sp, "'a".to_string()),
+ (lifetime.shrink_to_hi(), "'a ".to_string()),
+ ],
+ Applicability::MaybeIncorrect,
+ );
+ } else {
+ err.span_label(
+ span,
+ "you could add a lifetime on the impl block, if the trait or the self type \
+ could have one",
+ );
+ }
}
}
@@ -3304,6 +3381,8 @@ fn resolve_impl_item(
) {
use crate::ResolutionError::*;
self.resolve_doc_links(&item.attrs, MaybeExported::ImplItem(trait_id.ok_or(&item.vis)));
+ let prev = self.diag_metadata.current_impl_item.take();
+ self.diag_metadata.current_impl_item = Some(&item);
match &item.kind {
AssocItemKind::Const(box ast::ConstItem {
ident,
@@ -3452,6 +3531,7 @@ fn resolve_impl_item(
panic!("unexpanded macro in resolve!")
}
}
+ self.diag_metadata.current_impl_item = prev;
}
fn check_trait_item<F>(
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index 57f81eb..1d00a6b 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -2608,7 +2608,7 @@ fn let_binding_suggestion(&self, err: &mut Diag<'_>, ident_span: Span) -> bool {
let (span, text) = match path.segments.first() {
Some(seg) if let Some(name) = seg.ident.as_str().strip_prefix("let") => {
// a special case for #117894
- let name = name.strip_prefix('_').unwrap_or(name);
+ let name = name.trim_prefix('_');
(ident_span, format!("let {name}"))
}
_ => (ident_span.shrink_to_lo(), "let ".to_string()),
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 6b671df..9f68b93 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -22,6 +22,7 @@
#![feature(ptr_as_ref_unchecked)]
#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
+#![feature(trim_prefix_suffix)]
#![recursion_limit = "256"]
// tidy-alphabetical-end
@@ -246,6 +247,7 @@ enum ResolutionError<'ra> {
has_generic_params: HasGenericParams,
def_kind: DefKind,
inner_item: Option<(Span, ast::ItemKind)>,
+ current_self_ty: Option<String>,
},
/// Error E0403: the name is already used for a type or const parameter in this generic
/// parameter list.
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs
index 970d163..872770d 100644
--- a/compiler/rustc_resolve/src/rustdoc.rs
+++ b/compiler/rustc_resolve/src/rustdoc.rs
@@ -400,10 +400,10 @@ fn preprocess_link(link: &str) -> Box<str> {
let link = link.split('#').next().unwrap();
let link = link.trim();
let link = link.rsplit('@').next().unwrap();
- let link = link.strip_suffix("()").unwrap_or(link);
- let link = link.strip_suffix("{}").unwrap_or(link);
- let link = link.strip_suffix("[]").unwrap_or(link);
- let link = if link != "!" { link.strip_suffix('!').unwrap_or(link) } else { link };
+ let link = link.trim_suffix("()");
+ let link = link.trim_suffix("{}");
+ let link = link.trim_suffix("[]");
+ let link = if link != "!" { link.trim_suffix('!') } else { link };
let link = link.trim();
strip_generics_from_path(link).unwrap_or_else(|_| link.into())
}
diff --git a/compiler/rustc_session/src/config/cfg.rs b/compiler/rustc_session/src/config/cfg.rs
index a72f620..4654527 100644
--- a/compiler/rustc_session/src/config/cfg.rs
+++ b/compiler/rustc_session/src/config/cfg.rs
@@ -240,7 +240,7 @@ macro_rules! ins_sym {
}
ins_str!(sym::target_abi, &sess.target.abi);
- ins_str!(sym::target_arch, &sess.target.arch);
+ ins_sym!(sym::target_arch, sess.target.arch.desc_symbol());
ins_str!(sym::target_endian, sess.target.endian.as_str());
ins_str!(sym::target_env, &sess.target.env);
@@ -448,7 +448,7 @@ macro_rules! ins {
for target in Target::builtins().chain(iter::once(current_target.clone())) {
values_target_abi.insert(Symbol::intern(&target.options.abi));
- values_target_arch.insert(Symbol::intern(&target.arch));
+ values_target_arch.insert(target.arch.desc_symbol());
values_target_endian.insert(Symbol::intern(target.options.endian.as_str()));
values_target_env.insert(Symbol::intern(&target.options.env));
values_target_family.extend(
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index b89aec7..c9d73ad 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -2093,6 +2093,8 @@ pub(crate) fn parse_align(slot: &mut Option<Align>, v: Option<&str>) -> bool {
"instrument the generated code to support LLVM source-based code coverage reports \
(note, the compiler build config must include `profiler = true`); \
implies `-C symbol-mangling-version=v0`"),
+ jump_tables: bool = (true, parse_bool, [TRACKED],
+ "allow jump table and lookup table generation from switch case lowering (default: yes)"),
link_arg: (/* redirected to link_args */) = ((), parse_string_push, [UNTRACKED],
"a single extra argument to append to the linker invocation (can be used several times)"),
link_args: Vec<String> = (Vec::new(), parse_list, [UNTRACKED],
@@ -2475,8 +2477,6 @@ pub(crate) fn parse_align(slot: &mut Option<Align>, v: Option<&str>) -> bool {
"omit DWARF address ranges that give faster lookups"),
no_implied_bounds_compat: bool = (false, parse_bool, [TRACKED],
"disable the compatibility version of the `implied_bounds_ty` query"),
- no_jump_tables: bool = (false, parse_no_value, [TRACKED],
- "disable the jump tables and lookup tables that can be generated from a switch case lowering"),
no_leak_check: bool = (false, parse_no_value, [UNTRACKED],
"disable the 'leak check' for subtyping; unsound, but useful for tests"),
no_link: bool = (false, parse_no_value, [TRACKED],
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index 522faf1..16f9774 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -32,7 +32,7 @@
use rustc_span::{FileNameDisplayPreference, RealFileName, Span, Symbol};
use rustc_target::asm::InlineAsmArch;
use rustc_target::spec::{
- CodeModel, DebuginfoKind, PanicStrategy, RelocModel, RelroLevel, SanitizerSet,
+ Arch, CodeModel, DebuginfoKind, PanicStrategy, RelocModel, RelroLevel, SanitizerSet,
SmallDataThresholdSupport, SplitDebuginfo, StackProtector, SymbolVisibility, Target,
TargetTuple, TlsModel, apple,
};
@@ -1112,7 +1112,7 @@ pub fn build_session(
_ => CtfeBacktrace::Disabled,
});
- let asm_arch = if target.allow_asm { InlineAsmArch::from_str(&target.arch).ok() } else { None };
+ let asm_arch = if target.allow_asm { InlineAsmArch::from_arch(&target.arch) } else { None };
let target_filesearch =
filesearch::FileSearch::new(&sopts.search_paths, &target_tlib_path, &target);
let host_filesearch = filesearch::FileSearch::new(&sopts.search_paths, &host_tlib_path, &host);
@@ -1202,7 +1202,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
let mut unsupported_sanitizers = sess.opts.unstable_opts.sanitizer - supported_sanitizers;
// Niche: if `fixed-x18`, or effectively switching on `reserved-x18` flag, is enabled
// we should allow Shadow Call Stack sanitizer.
- if sess.opts.unstable_opts.fixed_x18 && sess.target.arch == "aarch64" {
+ if sess.opts.unstable_opts.fixed_x18 && sess.target.arch == Arch::AArch64 {
unsupported_sanitizers -= SanitizerSet::SHADOWCALLSTACK;
}
match unsupported_sanitizers.into_iter().count() {
@@ -1313,7 +1313,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
}
}
- if sess.opts.unstable_opts.branch_protection.is_some() && sess.target.arch != "aarch64" {
+ if sess.opts.unstable_opts.branch_protection.is_some() && sess.target.arch != Arch::AArch64 {
sess.dcx().emit_err(errors::BranchProtectionRequiresAArch64);
}
@@ -1357,13 +1357,13 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
}
if sess.opts.unstable_opts.function_return != FunctionReturn::default() {
- if sess.target.arch != "x86" && sess.target.arch != "x86_64" {
+ if !matches!(sess.target.arch, Arch::X86 | Arch::X86_64) {
sess.dcx().emit_err(errors::FunctionReturnRequiresX86OrX8664);
}
}
if sess.opts.unstable_opts.indirect_branch_cs_prefix {
- if sess.target.arch != "x86" && sess.target.arch != "x86_64" {
+ if !matches!(sess.target.arch, Arch::X86 | Arch::X86_64) {
sess.dcx().emit_err(errors::IndirectBranchCsPrefixRequiresX86OrX8664);
}
}
@@ -1372,12 +1372,12 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
if regparm > 3 {
sess.dcx().emit_err(errors::UnsupportedRegparm { regparm });
}
- if sess.target.arch != "x86" {
+ if sess.target.arch != Arch::X86 {
sess.dcx().emit_err(errors::UnsupportedRegparmArch);
}
}
if sess.opts.unstable_opts.reg_struct_return {
- if sess.target.arch != "x86" {
+ if sess.target.arch != Arch::X86 {
sess.dcx().emit_err(errors::UnsupportedRegStructReturnArch);
}
}
@@ -1399,7 +1399,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
}
if sess.opts.cg.soft_float {
- if sess.target.arch == "arm" {
+ if sess.target.arch == Arch::Arm {
sess.dcx().emit_warn(errors::SoftFloatDeprecated);
} else {
// All `use_softfp` does is the equivalent of `-mfloat-abi` in GCC/clang, which only exists on ARM targets.
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 02bae6f..38718ba 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -400,6 +400,7 @@
_t,
_task_context,
a32,
+ aarch64,
aarch64_target_feature,
aarch64_unstable_target_feature,
aarch64_ver_target_feature,
@@ -449,6 +450,7 @@
altivec,
alu32,
always,
+ amdgpu,
analysis,
and,
and_then,
@@ -466,6 +468,7 @@
args,
arith_offset,
arm,
+ arm64ec,
arm_target_feature,
array,
as_dash_needed: "as-needed",
@@ -555,6 +558,7 @@
autodiff_reverse,
automatically_derived,
available_externally,
+ avr,
avx,
avx10_target_feature,
avx512_target_feature,
@@ -587,6 +591,7 @@
box_patterns,
box_syntax,
boxed_slice,
+ bpf,
bpf_target_feature,
braced_empty_structs,
branch,
@@ -791,6 +796,7 @@
crate_type,
crate_visibility_modifier,
crt_dash_static: "crt-static",
+ csky,
csky_target_feature,
cstr_type,
cstring_as_c_str,
@@ -1157,6 +1163,7 @@
hashset_drain_ty,
hashset_iter,
hashset_iter_ty,
+ hexagon,
hexagon_target_feature,
hidden,
hide,
@@ -1343,11 +1350,14 @@
logf32,
logf64,
logf128,
+ loongarch32,
+ loongarch64,
loongarch_target_feature,
loop_break_value,
loop_match,
lr,
lt,
+ m68k,
m68k_target_feature,
macro_at_most_once_rep,
macro_attr,
@@ -1423,6 +1433,10 @@
minnumf32,
minnumf64,
minnumf128,
+ mips,
+ mips32r6,
+ mips64,
+ mips64r6,
mips_target_feature,
mir_assume,
mir_basic_block,
@@ -1471,6 +1485,7 @@
move_ref_pattern,
move_size_limit,
movrs_target_feature,
+ msp430,
mul,
mul_assign,
mul_with_overflow,
@@ -1558,6 +1573,7 @@
notable_trait,
note,
null,
+ nvptx64,
nvptx_target_feature,
object_safe_for_dispatch,
of,
@@ -1683,6 +1699,9 @@
post_cleanup: "post-cleanup",
post_dash_lto: "post-lto",
postfix_match,
+ powerpc,
+ powerpc64,
+ powerpc64le,
powerpc_target_feature,
powf16,
powf32,
@@ -1830,6 +1849,8 @@
resume,
return_position_impl_trait_in_trait,
return_type_notation,
+ riscv32,
+ riscv64,
riscv_target_feature,
rlib,
ropi,
@@ -1944,6 +1965,7 @@
rustc_partition_codegened,
rustc_partition_reused,
rustc_pass_by_value,
+ rustc_pass_indirectly_in_non_rustic_abis,
rustc_peek,
rustc_peek_liveness,
rustc_peek_maybe_init,
@@ -1976,6 +1998,7 @@
rvalue_static_promotion,
rwpi,
s,
+ s390x,
s390x_target_feature,
safety,
sanitize,
@@ -2104,9 +2127,12 @@
slice_patterns,
slicing_syntax,
soft,
+ sparc,
+ sparc64,
sparc_target_feature,
specialization,
speed,
+ spirv,
spotlight,
sqrtf16,
sqrtf32,
@@ -2421,6 +2447,8 @@
vtable_size,
warn,
wasip2,
+ wasm32,
+ wasm64,
wasm_abi,
wasm_import_module,
wasm_target_feature,
@@ -2447,12 +2475,15 @@
write_str,
write_via_move,
writeln_macro,
+ x86,
+ x86_64,
x86_amx_intrinsics,
x87_reg,
x87_target_feature,
xer,
xmm_reg,
xop_target_feature,
+ xtensa,
yeet_desugar_details,
yeet_expr,
yes,
diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs
index d97ee95..b5716b5 100644
--- a/compiler/rustc_symbol_mangling/src/lib.rs
+++ b/compiler/rustc_symbol_mangling/src/lib.rs
@@ -228,7 +228,7 @@ fn compute_symbol_name<'tcx>(
// However, we don't have the wasm import module map there yet.
tcx.is_foreign_item(def_id)
&& tcx.sess.target.is_like_wasm
- && tcx.wasm_import_module_map(LOCAL_CRATE).contains_key(&def_id.into())
+ && tcx.wasm_import_module_map(def_id.krate).contains_key(&def_id.into())
};
if !wasm_import_module_exception_force_mangling {
diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs
index 5d9e39d..cd7d912 100644
--- a/compiler/rustc_target/src/asm/mod.rs
+++ b/compiler/rustc_target/src/asm/mod.rs
@@ -1,12 +1,11 @@
use std::fmt;
-use std::str::FromStr;
use rustc_abi::Size;
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::Symbol;
-use crate::spec::{RelocModel, Target};
+use crate::spec::{Arch, RelocModel, Target};
pub struct ModifierInfo {
pub modifier: char,
@@ -245,38 +244,36 @@ pub enum InlineAsmArch {
CSKY,
}
-impl FromStr for InlineAsmArch {
- type Err = ();
-
- fn from_str(s: &str) -> Result<InlineAsmArch, ()> {
- match s {
- "x86" => Ok(Self::X86),
- "x86_64" => Ok(Self::X86_64),
- "arm" => Ok(Self::Arm),
- "aarch64" => Ok(Self::AArch64),
- "arm64ec" => Ok(Self::Arm64EC),
- "riscv32" => Ok(Self::RiscV32),
- "riscv64" => Ok(Self::RiscV64),
- "nvptx64" => Ok(Self::Nvptx64),
- "powerpc" => Ok(Self::PowerPC),
- "powerpc64" => Ok(Self::PowerPC64),
- "hexagon" => Ok(Self::Hexagon),
- "loongarch32" => Ok(Self::LoongArch32),
- "loongarch64" => Ok(Self::LoongArch64),
- "mips" | "mips32r6" => Ok(Self::Mips),
- "mips64" | "mips64r6" => Ok(Self::Mips64),
- "s390x" => Ok(Self::S390x),
- "sparc" => Ok(Self::Sparc),
- "sparc64" => Ok(Self::Sparc64),
- "spirv" => Ok(Self::SpirV),
- "wasm32" => Ok(Self::Wasm32),
- "wasm64" => Ok(Self::Wasm64),
- "bpf" => Ok(Self::Bpf),
- "avr" => Ok(Self::Avr),
- "msp430" => Ok(Self::Msp430),
- "m68k" => Ok(Self::M68k),
- "csky" => Ok(Self::CSKY),
- _ => Err(()),
+impl InlineAsmArch {
+ pub fn from_arch(arch: &Arch) -> Option<Self> {
+ match arch {
+ Arch::X86 => Some(Self::X86),
+ Arch::X86_64 => Some(Self::X86_64),
+ Arch::Arm => Some(Self::Arm),
+ Arch::Arm64EC => Some(Self::Arm64EC),
+ Arch::AArch64 => Some(Self::AArch64),
+ Arch::RiscV32 => Some(Self::RiscV32),
+ Arch::RiscV64 => Some(Self::RiscV64),
+ Arch::Nvptx64 => Some(Self::Nvptx64),
+ Arch::Hexagon => Some(Self::Hexagon),
+ Arch::LoongArch32 => Some(Self::LoongArch32),
+ Arch::LoongArch64 => Some(Self::LoongArch64),
+ Arch::Mips | Arch::Mips32r6 => Some(Self::Mips),
+ Arch::Mips64 | Arch::Mips64r6 => Some(Self::Mips64),
+ Arch::PowerPC => Some(Self::PowerPC),
+ Arch::PowerPC64 | Arch::PowerPC64LE => Some(Self::PowerPC64),
+ Arch::S390x => Some(Self::S390x),
+ Arch::Sparc => Some(Self::Sparc),
+ Arch::Sparc64 => Some(Self::Sparc64),
+ Arch::SpirV => Some(Self::SpirV),
+ Arch::Wasm32 => Some(Self::Wasm32),
+ Arch::Wasm64 => Some(Self::Wasm64),
+ Arch::Bpf => Some(Self::Bpf),
+ Arch::Avr => Some(Self::Avr),
+ Arch::Msp430 => Some(Self::Msp430),
+ Arch::M68k => Some(Self::M68k),
+ Arch::CSky => Some(Self::CSKY),
+ Arch::AmdGpu | Arch::Xtensa | Arch::Unknown(_) => None,
}
}
}
diff --git a/compiler/rustc_target/src/callconv/aarch64.rs b/compiler/rustc_target/src/callconv/aarch64.rs
index 5c23e703..b86d0ba 100644
--- a/compiler/rustc_target/src/callconv/aarch64.rs
+++ b/compiler/rustc_target/src/callconv/aarch64.rs
@@ -114,6 +114,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, kind: AbiKind)
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if !arg.layout.is_aggregate() {
if kind == AbiKind::DarwinPCS {
// On Darwin, when passing an i8/i16, it must be sign-extended to 32 bits,
diff --git a/compiler/rustc_target/src/callconv/amdgpu.rs b/compiler/rustc_target/src/callconv/amdgpu.rs
index 3ec6d0b..98ab3ce8 100644
--- a/compiler/rustc_target/src/callconv/amdgpu.rs
+++ b/compiler/rustc_target/src/callconv/amdgpu.rs
@@ -10,11 +10,15 @@ fn classify_ret<'a, Ty, C>(_cx: &C, ret: &mut ArgAbi<'a, Ty>)
ret.extend_integer_width_to(32);
}
-fn classify_arg<'a, Ty, C>(_cx: &C, arg: &mut ArgAbi<'a, Ty>)
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
arg.extend_integer_width_to(32);
}
diff --git a/compiler/rustc_target/src/callconv/arm.rs b/compiler/rustc_target/src/callconv/arm.rs
index abc9a40..4c1ff27 100644
--- a/compiler/rustc_target/src/callconv/arm.rs
+++ b/compiler/rustc_target/src/callconv/arm.rs
@@ -65,6 +65,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, vfp: bool)
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if !arg.layout.is_aggregate() {
arg.extend_integer_width_to(32);
return;
diff --git a/compiler/rustc_target/src/callconv/avr.rs b/compiler/rustc_target/src/callconv/avr.rs
index 0d690ef..0646d3c 100644
--- a/compiler/rustc_target/src/callconv/avr.rs
+++ b/compiler/rustc_target/src/callconv/avr.rs
@@ -30,6 +30,8 @@
//! compatible with AVR-GCC - Rust and AVR-GCC only differ in the small amount
//! of compiler frontend specific calling convention logic implemented here.
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret_ty<Ty>(ret: &mut ArgAbi<'_, Ty>) {
@@ -38,13 +40,23 @@ fn classify_ret_ty<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg_ty<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() {
arg.make_indirect();
}
}
-pub(crate) fn compute_abi_info<Ty>(fty: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fty.ret.is_ignore() {
classify_ret_ty(&mut fty.ret);
}
@@ -54,6 +66,6 @@ pub(crate) fn compute_abi_info<Ty>(fty: &mut FnAbi<'_, Ty>) {
continue;
}
- classify_arg_ty(arg);
+ classify_arg_ty(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/bpf.rs b/compiler/rustc_target/src/callconv/bpf.rs
index ec5c1c2c..3624f40 100644
--- a/compiler/rustc_target/src/callconv/bpf.rs
+++ b/compiler/rustc_target/src/callconv/bpf.rs
@@ -1,4 +1,6 @@
// see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/BPF/BPFCallingConv.td
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
@@ -9,7 +11,14 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() || arg.layout.size.bits() > 64 {
arg.make_indirect();
} else {
@@ -17,7 +26,10 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -26,7 +38,7 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/csky.rs b/compiler/rustc_target/src/callconv/csky.rs
index cf289e6..95741f137 100644
--- a/compiler/rustc_target/src/callconv/csky.rs
+++ b/compiler/rustc_target/src/callconv/csky.rs
@@ -4,6 +4,8 @@
// Reference: Clang CSKY lowering code
// https://github.com/llvm/llvm-project/blob/4a074f32a6914f2a8d7215d78758c24942dddc3d/clang/lib/CodeGen/Targets/CSKY.cpp#L76-L162
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
@@ -27,11 +29,18 @@ fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !arg.layout.is_sized() {
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
// For argument type, the first 4*XLen parts of aggregate will be passed
// in registers, and the rest will be passed in stack.
// So we can coerce to integers directly and let backend handle it correctly.
@@ -47,7 +56,10 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -56,6 +68,6 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/hexagon.rs b/compiler/rustc_target/src/callconv/hexagon.rs
index d4f6dd0..e08e6da 100644
--- a/compiler/rustc_target/src/callconv/hexagon.rs
+++ b/compiler/rustc_target/src/callconv/hexagon.rs
@@ -1,3 +1,5 @@
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
@@ -8,7 +10,14 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() && arg.layout.size.bits() > 64 {
arg.make_indirect();
} else {
@@ -16,7 +25,10 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -25,6 +37,6 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/loongarch.rs b/compiler/rustc_target/src/callconv/loongarch.rs
index bc3c960..bbea841 100644
--- a/compiler/rustc_target/src/callconv/loongarch.rs
+++ b/compiler/rustc_target/src/callconv/loongarch.rs
@@ -287,6 +287,11 @@ fn classify_arg<'a, Ty, C>(
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ *avail_gprs = (*avail_gprs).saturating_sub(1);
+ return;
+ }
if !is_vararg {
match should_use_fp_conv(cx, &arg.layout, xlen, flen) {
Some(FloatConv::Float(f)) if *avail_fprs >= 1 => {
diff --git a/compiler/rustc_target/src/callconv/m68k.rs b/compiler/rustc_target/src/callconv/m68k.rs
index 0b637e1..f4668b4 100644
--- a/compiler/rustc_target/src/callconv/m68k.rs
+++ b/compiler/rustc_target/src/callconv/m68k.rs
@@ -1,3 +1,5 @@
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
@@ -8,11 +10,18 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !arg.layout.is_sized() {
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() {
arg.pass_by_stack_offset(None);
} else {
@@ -20,7 +29,10 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -29,6 +41,6 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/mips.rs b/compiler/rustc_target/src/callconv/mips.rs
index 8ffd7bd..d2572cc 100644
--- a/compiler/rustc_target/src/callconv/mips.rs
+++ b/compiler/rustc_target/src/callconv/mips.rs
@@ -1,4 +1,4 @@
-use rustc_abi::{HasDataLayout, Size};
+use rustc_abi::{HasDataLayout, Size, TyAbiInterface};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
@@ -14,18 +14,26 @@ fn classify_ret<Ty, C>(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size)
}
}
-fn classify_arg<Ty, C>(cx: &C, arg: &mut ArgAbi<'_, Ty>, offset: &mut Size)
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, offset: &mut Size)
where
+ Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
if !arg.layout.is_sized() {
+ // FIXME: Update offset?
// Not touching this...
return;
}
let dl = cx.data_layout();
- let size = arg.layout.size;
let align = arg.layout.align.abi.max(dl.i32_align).min(dl.i64_align);
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ *offset = offset.align_to(align) + dl.pointer_size().align_to(align);
+ return;
+ }
+
+ let size = arg.layout.size;
if arg.layout.is_aggregate() {
let pad_i32 = !offset.is_aligned(align);
arg.cast_to_and_pad_i32(Uniform::new(Reg::i32(), size), pad_i32);
@@ -36,8 +44,9 @@ fn classify_arg<Ty, C>(cx: &C, arg: &mut ArgAbi<'_, Ty>, offset: &mut Size)
*offset = offset.align_to(align) + size.align_to(align);
}
-pub(crate) fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>)
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where
+ Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
let mut offset = Size::ZERO;
diff --git a/compiler/rustc_target/src/callconv/mips64.rs b/compiler/rustc_target/src/callconv/mips64.rs
index 8386a15..313ad6d 100644
--- a/compiler/rustc_target/src/callconv/mips64.rs
+++ b/compiler/rustc_target/src/callconv/mips64.rs
@@ -82,6 +82,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
extend_integer_width_mips(arg, 64);
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
let dl = cx.data_layout();
let size = arg.layout.size;
diff --git a/compiler/rustc_target/src/callconv/mod.rs b/compiler/rustc_target/src/callconv/mod.rs
index a33c246..43e1ca3 100644
--- a/compiler/rustc_target/src/callconv/mod.rs
+++ b/compiler/rustc_target/src/callconv/mod.rs
@@ -7,7 +7,7 @@
use rustc_macros::HashStable_Generic;
pub use crate::spec::AbiMap;
-use crate::spec::{HasTargetSpec, HasX86AbiOpt};
+use crate::spec::{Arch, HasTargetSpec, HasX86AbiOpt};
mod aarch64;
mod amdgpu;
@@ -633,8 +633,8 @@ pub fn adjust_for_foreign_abi<C>(&mut self, cx: &C, abi: ExternAbi)
}
let spec = cx.target_spec();
- match &spec.arch[..] {
- "x86" => {
+ match &spec.arch {
+ Arch::X86 => {
let (flavor, regparm) = match abi {
ExternAbi::Fastcall { .. } | ExternAbi::Vectorcall { .. } => {
(x86::Flavor::FastcallOrVectorcall, None)
@@ -652,7 +652,7 @@ pub fn adjust_for_foreign_abi<C>(&mut self, cx: &C, abi: ExternAbi)
x86::compute_abi_info(cx, self, opts);
}
}
- "x86_64" => match abi {
+ Arch::X86_64 => match abi {
ExternAbi::SysV64 { .. } => x86_64::compute_abi_info(cx, self),
ExternAbi::Win64 { .. } | ExternAbi::Vectorcall { .. } => {
x86_win64::compute_abi_info(cx, self)
@@ -665,7 +665,7 @@ pub fn adjust_for_foreign_abi<C>(&mut self, cx: &C, abi: ExternAbi)
}
}
},
- "aarch64" | "arm64ec" => {
+ Arch::AArch64 | Arch::Arm64EC => {
let kind = if cx.target_spec().is_like_darwin {
aarch64::AbiKind::DarwinPCS
} else if cx.target_spec().is_like_windows {
@@ -675,33 +675,35 @@ pub fn adjust_for_foreign_abi<C>(&mut self, cx: &C, abi: ExternAbi)
};
aarch64::compute_abi_info(cx, self, kind)
}
- "amdgpu" => amdgpu::compute_abi_info(cx, self),
- "arm" => arm::compute_abi_info(cx, self),
- "avr" => avr::compute_abi_info(self),
- "loongarch32" | "loongarch64" => loongarch::compute_abi_info(cx, self),
- "m68k" => m68k::compute_abi_info(self),
- "csky" => csky::compute_abi_info(self),
- "mips" | "mips32r6" => mips::compute_abi_info(cx, self),
- "mips64" | "mips64r6" => mips64::compute_abi_info(cx, self),
- "powerpc" => powerpc::compute_abi_info(cx, self),
- "powerpc64" => powerpc64::compute_abi_info(cx, self),
- "s390x" => s390x::compute_abi_info(cx, self),
- "msp430" => msp430::compute_abi_info(self),
- "sparc" => sparc::compute_abi_info(cx, self),
- "sparc64" => sparc64::compute_abi_info(cx, self),
- "nvptx64" => {
+ Arch::AmdGpu => amdgpu::compute_abi_info(cx, self),
+ Arch::Arm => arm::compute_abi_info(cx, self),
+ Arch::Avr => avr::compute_abi_info(cx, self),
+ Arch::LoongArch32 | Arch::LoongArch64 => loongarch::compute_abi_info(cx, self),
+ Arch::M68k => m68k::compute_abi_info(cx, self),
+ Arch::CSky => csky::compute_abi_info(cx, self),
+ Arch::Mips | Arch::Mips32r6 => mips::compute_abi_info(cx, self),
+ Arch::Mips64 | Arch::Mips64r6 => mips64::compute_abi_info(cx, self),
+ Arch::PowerPC => powerpc::compute_abi_info(cx, self),
+ Arch::PowerPC64 => powerpc64::compute_abi_info(cx, self),
+ Arch::S390x => s390x::compute_abi_info(cx, self),
+ Arch::Msp430 => msp430::compute_abi_info(cx, self),
+ Arch::Sparc => sparc::compute_abi_info(cx, self),
+ Arch::Sparc64 => sparc64::compute_abi_info(cx, self),
+ Arch::Nvptx64 => {
if abi == ExternAbi::PtxKernel || abi == ExternAbi::GpuKernel {
nvptx64::compute_ptx_kernel_abi_info(cx, self)
} else {
- nvptx64::compute_abi_info(self)
+ nvptx64::compute_abi_info(cx, self)
}
}
- "hexagon" => hexagon::compute_abi_info(self),
- "xtensa" => xtensa::compute_abi_info(cx, self),
- "riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
- "wasm32" | "wasm64" => wasm::compute_abi_info(cx, self),
- "bpf" => bpf::compute_abi_info(self),
- arch => panic!("no lowering implemented for {arch}"),
+ Arch::Hexagon => hexagon::compute_abi_info(cx, self),
+ Arch::Xtensa => xtensa::compute_abi_info(cx, self),
+ Arch::RiscV32 | Arch::RiscV64 => riscv::compute_abi_info(cx, self),
+ Arch::Wasm32 | Arch::Wasm64 => wasm::compute_abi_info(cx, self),
+ Arch::Bpf => bpf::compute_abi_info(cx, self),
+ arch @ (Arch::PowerPC64LE | Arch::SpirV | Arch::Unknown(_)) => {
+ panic!("no lowering implemented for {arch}")
+ }
}
}
@@ -711,12 +713,12 @@ pub fn adjust_for_rust_abi<C>(&mut self, cx: &C)
C: HasDataLayout + HasTargetSpec,
{
let spec = cx.target_spec();
- match &*spec.arch {
- "x86" => x86::compute_rust_abi_info(cx, self),
- "riscv32" | "riscv64" => riscv::compute_rust_abi_info(cx, self),
- "loongarch32" | "loongarch64" => loongarch::compute_rust_abi_info(cx, self),
- "aarch64" => aarch64::compute_rust_abi_info(cx, self),
- "bpf" => bpf::compute_rust_abi_info(self),
+ match &spec.arch {
+ Arch::X86 => x86::compute_rust_abi_info(cx, self),
+ Arch::RiscV32 | Arch::RiscV64 => riscv::compute_rust_abi_info(cx, self),
+ Arch::LoongArch32 | Arch::LoongArch64 => loongarch::compute_rust_abi_info(cx, self),
+ Arch::AArch64 => aarch64::compute_rust_abi_info(cx, self),
+ Arch::Bpf => bpf::compute_rust_abi_info(self),
_ => {}
};
diff --git a/compiler/rustc_target/src/callconv/msp430.rs b/compiler/rustc_target/src/callconv/msp430.rs
index 3b53d18..7d23363 100644
--- a/compiler/rustc_target/src/callconv/msp430.rs
+++ b/compiler/rustc_target/src/callconv/msp430.rs
@@ -1,6 +1,8 @@
// Reference: MSP430 Embedded Application Binary Interface
// https://www.ti.com/lit/an/slaa534a/slaa534a.pdf
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
// 3.5 Structures or Unions Passed and Returned by Reference
@@ -17,7 +19,14 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() && arg.layout.size.bits() > 32 {
arg.make_indirect();
} else {
@@ -25,7 +34,10 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -34,6 +46,6 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/nvptx64.rs b/compiler/rustc_target/src/callconv/nvptx64.rs
index dc32dd8..a19b89c 100644
--- a/compiler/rustc_target/src/callconv/nvptx64.rs
+++ b/compiler/rustc_target/src/callconv/nvptx64.rs
@@ -11,7 +11,14 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if arg.layout.is_aggregate() && arg.layout.is_sized() {
classify_aggregate(arg)
} else if arg.layout.size.bits() < 32 && arg.layout.is_sized() {
@@ -81,7 +88,10 @@ fn classify_arg_kernel<'a, Ty, C>(_cx: &C, arg: &mut ArgAbi<'a, Ty>)
}
}
-pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
@@ -90,7 +100,7 @@ pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if arg.is_ignore() {
continue;
}
- classify_arg(arg);
+ classify_arg(cx, arg);
}
}
diff --git a/compiler/rustc_target/src/callconv/powerpc.rs b/compiler/rustc_target/src/callconv/powerpc.rs
index 2f61296..6706667 100644
--- a/compiler/rustc_target/src/callconv/powerpc.rs
+++ b/compiler/rustc_target/src/callconv/powerpc.rs
@@ -1,3 +1,5 @@
+use rustc_abi::TyAbiInterface;
+
use crate::callconv::{ArgAbi, FnAbi};
use crate::spec::HasTargetSpec;
@@ -9,7 +11,10 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
}
-fn classify_arg<Ty>(cx: &impl HasTargetSpec, arg: &mut ArgAbi<'_, Ty>) {
+fn classify_arg<'a, Ty, C: HasTargetSpec>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if arg.is_ignore() {
// powerpc-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs.
if cx.target_spec().os == "linux"
@@ -20,14 +25,17 @@ fn classify_arg<Ty>(cx: &impl HasTargetSpec, arg: &mut ArgAbi<'_, Ty>) {
}
return;
}
- if arg.layout.is_aggregate() {
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) || arg.layout.is_aggregate() {
arg.make_indirect();
} else {
arg.extend_integer_width_to(32);
}
}
-pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C: HasTargetSpec>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret);
}
diff --git a/compiler/rustc_target/src/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs
index be1d138..380b280 100644
--- a/compiler/rustc_target/src/callconv/powerpc64.rs
+++ b/compiler/rustc_target/src/callconv/powerpc64.rs
@@ -52,6 +52,10 @@ fn classify<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, abi: ABI, is_ret: bool)
// Not touching this...
return;
}
+ if !is_ret && arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if !arg.layout.is_aggregate() {
arg.extend_integer_width_to(64);
return;
diff --git a/compiler/rustc_target/src/callconv/riscv.rs b/compiler/rustc_target/src/callconv/riscv.rs
index 16de3fe..c4310bf 100644
--- a/compiler/rustc_target/src/callconv/riscv.rs
+++ b/compiler/rustc_target/src/callconv/riscv.rs
@@ -290,9 +290,15 @@ fn classify_arg<'a, Ty, C>(
Ty: TyAbiInterface<'a, C> + Copy,
{
if !arg.layout.is_sized() {
+ // FIXME: Update avail_gprs?
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ *avail_gprs = (*avail_gprs).saturating_sub(1);
+ return;
+ }
if !is_vararg {
match should_use_fp_conv(cx, &arg.layout, xlen, flen) {
Some(FloatConv::Float(f)) if *avail_fprs >= 1 => {
diff --git a/compiler/rustc_target/src/callconv/s390x.rs b/compiler/rustc_target/src/callconv/s390x.rs
index d2ae404..c2f2b47 100644
--- a/compiler/rustc_target/src/callconv/s390x.rs
+++ b/compiler/rustc_target/src/callconv/s390x.rs
@@ -37,6 +37,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
}
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
let size = arg.layout.size;
if size.bits() <= 128 {
diff --git a/compiler/rustc_target/src/callconv/sparc.rs b/compiler/rustc_target/src/callconv/sparc.rs
index 8ffd7bd..d424214 100644
--- a/compiler/rustc_target/src/callconv/sparc.rs
+++ b/compiler/rustc_target/src/callconv/sparc.rs
@@ -1,4 +1,4 @@
-use rustc_abi::{HasDataLayout, Size};
+use rustc_abi::{HasDataLayout, Size, TyAbiInterface};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
@@ -14,15 +14,22 @@ fn classify_ret<Ty, C>(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size)
}
}
-fn classify_arg<Ty, C>(cx: &C, arg: &mut ArgAbi<'_, Ty>, offset: &mut Size)
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, offset: &mut Size)
where
+ Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
if !arg.layout.is_sized() {
+ // FIXME: Update offset?
// Not touching this...
return;
}
let dl = cx.data_layout();
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ *offset += dl.pointer_size();
+ return;
+ }
let size = arg.layout.size;
let align = arg.layout.align.abi.max(dl.i32_align).min(dl.i64_align);
@@ -36,8 +43,9 @@ fn classify_arg<Ty, C>(cx: &C, arg: &mut ArgAbi<'_, Ty>, offset: &mut Size)
*offset = offset.align_to(align) + size.align_to(align);
}
-pub(crate) fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>)
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where
+ Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
let mut offset = Size::ZERO;
diff --git a/compiler/rustc_target/src/callconv/sparc64.rs b/compiler/rustc_target/src/callconv/sparc64.rs
index 62c8ed1..911eaaf 100644
--- a/compiler/rustc_target/src/callconv/sparc64.rs
+++ b/compiler/rustc_target/src/callconv/sparc64.rs
@@ -140,6 +140,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, in_registers_max: S
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
if !arg.layout.is_aggregate() {
arg.extend_integer_width_to(64);
return;
diff --git a/compiler/rustc_target/src/callconv/wasm.rs b/compiler/rustc_target/src/callconv/wasm.rs
index a308f37..5be8cd5 100644
--- a/compiler/rustc_target/src/callconv/wasm.rs
+++ b/compiler/rustc_target/src/callconv/wasm.rs
@@ -52,6 +52,10 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
// Not touching this...
return;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ return;
+ }
arg.extend_integer_width_to(32);
if arg.layout.is_aggregate() && !unwrap_trivial_aggregate(cx, arg) {
arg.make_indirect();
diff --git a/compiler/rustc_target/src/callconv/x86.rs b/compiler/rustc_target/src/callconv/x86.rs
index 918b71c..93dc60d 100644
--- a/compiler/rustc_target/src/callconv/x86.rs
+++ b/compiler/rustc_target/src/callconv/x86.rs
@@ -64,6 +64,11 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, op
continue;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ continue;
+ }
+
let t = cx.target_spec();
let align_4 = Align::from_bytes(4).unwrap();
let align_16 = Align::from_bytes(16).unwrap();
diff --git a/compiler/rustc_target/src/callconv/x86_64.rs b/compiler/rustc_target/src/callconv/x86_64.rs
index d8db7ed..04eecbf 100644
--- a/compiler/rustc_target/src/callconv/x86_64.rs
+++ b/compiler/rustc_target/src/callconv/x86_64.rs
@@ -183,9 +183,15 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
let mut x86_64_arg_or_ret = |arg: &mut ArgAbi<'a, Ty>, is_arg: bool| {
if !arg.layout.is_sized() {
+ // FIXME: Update int_regs?
// Not touching this...
return;
}
+ if is_arg && arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ int_regs = int_regs.saturating_sub(1);
+ arg.make_indirect();
+ return;
+ }
let mut cls_or_mem = classify_arg(cx, arg);
if is_arg {
diff --git a/compiler/rustc_target/src/callconv/x86_win32.rs b/compiler/rustc_target/src/callconv/x86_win32.rs
index 554a736..824e7cc 100644
--- a/compiler/rustc_target/src/callconv/x86_win32.rs
+++ b/compiler/rustc_target/src/callconv/x86_win32.rs
@@ -46,6 +46,11 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(
continue;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ continue;
+ }
+
// FIXME: MSVC 2015+ will pass the first 3 vector arguments in [XYZ]MM0-2
// See https://reviews.llvm.org/D72114 for Clang behavior
diff --git a/compiler/rustc_target/src/callconv/x86_win64.rs b/compiler/rustc_target/src/callconv/x86_win64.rs
index 8f8597e..85ee59e 100644
--- a/compiler/rustc_target/src/callconv/x86_win64.rs
+++ b/compiler/rustc_target/src/callconv/x86_win64.rs
@@ -1,11 +1,14 @@
-use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind, Size};
+use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind, Size, TyAbiInterface};
use crate::callconv::{ArgAbi, FnAbi, Reg};
use crate::spec::{HasTargetSpec, RustcAbi};
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
-pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
+pub(crate) fn compute_abi_info<'a, Ty, C: HasTargetSpec>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+where
+ Ty: TyAbiInterface<'a, C> + Copy,
+{
let fixup = |a: &mut ArgAbi<'_, Ty>, is_ret: bool| {
match a.layout.backend_repr {
BackendRepr::Memory { sized: false } => {}
@@ -59,6 +62,10 @@ pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'
arg.make_indirect_from_ignore();
continue;
}
+ if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ arg.make_indirect();
+ continue;
+ }
fixup(arg, false);
}
// FIXME: We should likely also do something about ZST return types, similar to above.
diff --git a/compiler/rustc_target/src/callconv/xtensa.rs b/compiler/rustc_target/src/callconv/xtensa.rs
index 561ee98..4dc9fad 100644
--- a/compiler/rustc_target/src/callconv/xtensa.rs
+++ b/compiler/rustc_target/src/callconv/xtensa.rs
@@ -15,7 +15,7 @@
const MAX_ARG_IN_REGS_SIZE: u64 = NUM_ARG_GPRS * 32;
const MAX_RET_IN_REGS_SIZE: u64 = NUM_RET_GPRS * 32;
-fn classify_ret_ty<'a, Ty, C>(arg: &mut ArgAbi<'_, Ty>)
+fn classify_ret_ty<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
where
Ty: TyAbiInterface<'a, C> + Copy,
{
@@ -26,7 +26,7 @@ fn classify_ret_ty<'a, Ty, C>(arg: &mut ArgAbi<'_, Ty>)
// The rules for return and argument types are the same,
// so defer to `classify_arg_ty`.
let mut arg_gprs_left = NUM_RET_GPRS;
- classify_arg_ty(arg, &mut arg_gprs_left, MAX_RET_IN_REGS_SIZE);
+ classify_arg_ty(cx, arg, &mut arg_gprs_left, true);
// Ret args cannot be passed via stack, we lower to indirect and let the backend handle the invisible reference
match arg.mode {
super::PassMode::Indirect { attrs: _, meta_attrs: _, ref mut on_stack } => {
@@ -36,12 +36,24 @@ fn classify_ret_ty<'a, Ty, C>(arg: &mut ArgAbi<'_, Ty>)
}
}
-fn classify_arg_ty<'a, Ty, C>(arg: &mut ArgAbi<'_, Ty>, arg_gprs_left: &mut u64, max_size: u64)
-where
+fn classify_arg_ty<'a, Ty, C>(
+ cx: &C,
+ arg: &mut ArgAbi<'a, Ty>,
+ arg_gprs_left: &mut u64,
+ is_ret: bool,
+) where
Ty: TyAbiInterface<'a, C> + Copy,
{
assert!(*arg_gprs_left <= NUM_ARG_GPRS, "Arg GPR tracking underflow");
+ let max_size = if is_ret { MAX_RET_IN_REGS_SIZE } else { MAX_ARG_IN_REGS_SIZE };
+
+ if !is_ret && arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ *arg_gprs_left = arg_gprs_left.saturating_sub(1);
+ arg.make_indirect();
+ return;
+ }
+
// Ignore empty structs/unions.
if arg.layout.is_zst() {
return;
@@ -95,13 +107,13 @@ fn classify_arg_ty<'a, Ty, C>(arg: &mut ArgAbi<'_, Ty>, arg_gprs_left: &mut u64,
}
}
-pub(crate) fn compute_abi_info<'a, Ty, C>(_cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
+pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec,
{
if !fn_abi.ret.is_ignore() {
- classify_ret_ty(&mut fn_abi.ret);
+ classify_ret_ty(cx, &mut fn_abi.ret);
}
let mut arg_gprs_left = NUM_ARG_GPRS;
@@ -110,7 +122,7 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(_cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
if arg.is_ignore() {
continue;
}
- classify_arg_ty(arg, &mut arg_gprs_left, MAX_ARG_IN_REGS_SIZE);
+ classify_arg_ty(cx, arg, &mut arg_gprs_left, false);
}
}
diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs
index 8c6a77c..b38ce20 100644
--- a/compiler/rustc_target/src/lib.rs
+++ b/compiler/rustc_target/src/lib.rs
@@ -9,9 +9,9 @@
// tidy-alphabetical-start
#![allow(internal_features)]
+#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
-#![feature(debug_closure_helpers)]
#![feature(iter_intersperse)]
#![feature(rustdoc_internals)]
// tidy-alphabetical-end
@@ -118,6 +118,67 @@ pub fn desc(&self) -> &'static str {
}
}
+ crate::target_spec_enum!(@common_impls $Name);
+ };
+
+ (
+ $( #[$attr:meta] )*
+ pub enum $Name:ident {
+ $(
+ $( #[$variant_attr:meta] )*
+ $Variant:ident = $string:literal,
+ )*
+ }
+ $( #[$other_variant_attr:meta] )*
+ other_variant = $OtherVariant:ident;
+ ) => {
+ $( #[$attr] )*
+ #[derive(Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
+ pub enum $Name {
+ $(
+ $( #[$variant_attr:meta] )*
+ $Variant,
+ )*
+ $( #[$other_variant_attr] )*
+ $OtherVariant(crate::spec::StaticCow<str>),
+ }
+
+ impl schemars::JsonSchema for $Name {
+ fn schema_name() -> std::borrow::Cow<'static, str> {
+ std::borrow::Cow::Borrowed(stringify!($Name))
+ }
+
+ fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
+ schemars::json_schema!({
+ "type": "string"
+ })
+ }
+ }
+
+ impl FromStr for $Name {
+ type Err = core::convert::Infallible;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ Ok(match s {
+ $( $string => Self::$Variant, )*
+ _ => Self::$OtherVariant(s.to_owned().into()),
+ })
+ }
+ }
+
+ impl $Name {
+ pub fn desc(&self) -> &str {
+ match self {
+ $( Self::$Variant => $string, )*
+ Self::$OtherVariant(name) => name.as_ref(),
+ }
+ }
+ }
+
+ crate::target_spec_enum!(@common_impls $Name);
+ };
+
+ (@common_impls $Name:ident) => {
impl crate::json::ToJson for $Name {
fn to_json(&self) -> crate::json::Json {
self.desc().to_json()
diff --git a/compiler/rustc_target/src/spec/abi_map.rs b/compiler/rustc_target/src/spec/abi_map.rs
index 23e7453..8126227 100644
--- a/compiler/rustc_target/src/spec/abi_map.rs
+++ b/compiler/rustc_target/src/spec/abi_map.rs
@@ -1,6 +1,6 @@
use rustc_abi::{ArmCall, CanonAbi, ExternAbi, InterruptKind, X86Call};
-use crate::spec::Target;
+use crate::spec::{Arch, Target};
/// Mapping for ExternAbi to CanonAbi according to a Target
///
@@ -8,7 +8,7 @@
/// encapsulating arch-specific ABI lowering details to make them more testable.
#[derive(Clone, Debug)]
pub struct AbiMap {
- arch: Arch,
+ arch: ArchKind,
os: OsKind,
}
@@ -47,18 +47,21 @@ impl AbiMap {
/// create an AbiMap according to arbitrary fields on the [Target]
pub fn from_target(target: &Target) -> Self {
// the purpose of this little exercise is to force listing what affects these mappings
- let arch = match &*target.arch {
- "aarch64" => Arch::Aarch64,
- "amdgpu" => Arch::Amdgpu,
- "arm" if target.llvm_target.starts_with("thumbv8m") => Arch::Arm(ArmVer::ThumbV8M),
- "arm" => Arch::Arm(ArmVer::Other),
- "avr" => Arch::Avr,
- "msp430" => Arch::Msp430,
- "nvptx64" => Arch::Nvptx,
- "riscv32" | "riscv64" => Arch::Riscv,
- "x86" => Arch::X86,
- "x86_64" => Arch::X86_64,
- _ => Arch::Other,
+ let arch = match target.arch {
+ Arch::AArch64 => ArchKind::Aarch64,
+ Arch::AmdGpu => ArchKind::Amdgpu,
+ Arch::Arm => ArchKind::Arm(if target.llvm_target.starts_with("thumbv8m") {
+ ArmVer::ThumbV8M
+ } else {
+ ArmVer::Other
+ }),
+ Arch::Avr => ArchKind::Avr,
+ Arch::Msp430 => ArchKind::Msp430,
+ Arch::Nvptx64 => ArchKind::Nvptx,
+ Arch::RiscV32 | Arch::RiscV64 => ArchKind::Riscv,
+ Arch::X86 => ArchKind::X86,
+ Arch::X86_64 => ArchKind::X86_64,
+ _ => ArchKind::Other,
};
let os = if target.is_like_windows {
@@ -87,10 +90,12 @@ pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMap
(ExternAbi::Custom, _) => CanonAbi::Custom,
- (ExternAbi::System { .. }, Arch::X86) if os == OsKind::Windows && !has_c_varargs => {
+ (ExternAbi::System { .. }, ArchKind::X86)
+ if os == OsKind::Windows && !has_c_varargs =>
+ {
CanonAbi::X86(X86Call::Stdcall)
}
- (ExternAbi::System { .. }, Arch::Arm(..)) if self.os == OsKind::VEXos => {
+ (ExternAbi::System { .. }, ArchKind::Arm(..)) if self.os == OsKind::VEXos => {
// Calls to VEXos APIs do not use VFP registers.
CanonAbi::Arm(ArmCall::Aapcs)
}
@@ -101,19 +106,19 @@ pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMap
// always and forever
(ExternAbi::RustInvalid, _) => return AbiMapping::Invalid,
- (ExternAbi::EfiApi, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
- (ExternAbi::EfiApi, Arch::X86_64) => CanonAbi::X86(X86Call::Win64),
- (ExternAbi::EfiApi, Arch::Aarch64 | Arch::Riscv | Arch::X86) => CanonAbi::C,
+ (ExternAbi::EfiApi, ArchKind::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
+ (ExternAbi::EfiApi, ArchKind::X86_64) => CanonAbi::X86(X86Call::Win64),
+ (ExternAbi::EfiApi, ArchKind::Aarch64 | ArchKind::Riscv | ArchKind::X86) => CanonAbi::C,
(ExternAbi::EfiApi, _) => return AbiMapping::Invalid,
/* arm */
- (ExternAbi::Aapcs { .. }, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
+ (ExternAbi::Aapcs { .. }, ArchKind::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
(ExternAbi::Aapcs { .. }, _) => return AbiMapping::Invalid,
- (ExternAbi::CmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
+ (ExternAbi::CmseNonSecureCall, ArchKind::Arm(ArmVer::ThumbV8M)) => {
CanonAbi::Arm(ArmCall::CCmseNonSecureCall)
}
- (ExternAbi::CmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
+ (ExternAbi::CmseNonSecureEntry, ArchKind::Arm(ArmVer::ThumbV8M)) => {
CanonAbi::Arm(ArmCall::CCmseNonSecureEntry)
}
(ExternAbi::CmseNonSecureCall | ExternAbi::CmseNonSecureEntry, ..) => {
@@ -121,53 +126,53 @@ pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMap
}
/* gpu */
- (ExternAbi::PtxKernel, Arch::Nvptx) => CanonAbi::GpuKernel,
- (ExternAbi::GpuKernel, Arch::Amdgpu | Arch::Nvptx) => CanonAbi::GpuKernel,
+ (ExternAbi::PtxKernel, ArchKind::Nvptx) => CanonAbi::GpuKernel,
+ (ExternAbi::GpuKernel, ArchKind::Amdgpu | ArchKind::Nvptx) => CanonAbi::GpuKernel,
(ExternAbi::PtxKernel | ExternAbi::GpuKernel, _) => return AbiMapping::Invalid,
/* x86 */
- (ExternAbi::Cdecl { .. }, Arch::X86) => CanonAbi::C,
+ (ExternAbi::Cdecl { .. }, ArchKind::X86) => CanonAbi::C,
(ExternAbi::Cdecl { .. }, _) => return AbiMapping::Deprecated(CanonAbi::C),
- (ExternAbi::Fastcall { .. }, Arch::X86) => CanonAbi::X86(X86Call::Fastcall),
+ (ExternAbi::Fastcall { .. }, ArchKind::X86) => CanonAbi::X86(X86Call::Fastcall),
(ExternAbi::Fastcall { .. }, _) if os == OsKind::Windows => {
return AbiMapping::Deprecated(CanonAbi::C);
}
(ExternAbi::Fastcall { .. }, _) => return AbiMapping::Invalid,
- (ExternAbi::Stdcall { .. }, Arch::X86) => CanonAbi::X86(X86Call::Stdcall),
+ (ExternAbi::Stdcall { .. }, ArchKind::X86) => CanonAbi::X86(X86Call::Stdcall),
(ExternAbi::Stdcall { .. }, _) if os == OsKind::Windows => {
return AbiMapping::Deprecated(CanonAbi::C);
}
(ExternAbi::Stdcall { .. }, _) => return AbiMapping::Invalid,
- (ExternAbi::Thiscall { .. }, Arch::X86) => CanonAbi::X86(X86Call::Thiscall),
+ (ExternAbi::Thiscall { .. }, ArchKind::X86) => CanonAbi::X86(X86Call::Thiscall),
(ExternAbi::Thiscall { .. }, _) => return AbiMapping::Invalid,
- (ExternAbi::Vectorcall { .. }, Arch::X86 | Arch::X86_64) => {
+ (ExternAbi::Vectorcall { .. }, ArchKind::X86 | ArchKind::X86_64) => {
CanonAbi::X86(X86Call::Vectorcall)
}
(ExternAbi::Vectorcall { .. }, _) => return AbiMapping::Invalid,
- (ExternAbi::SysV64 { .. }, Arch::X86_64) => CanonAbi::X86(X86Call::SysV64),
- (ExternAbi::Win64 { .. }, Arch::X86_64) => CanonAbi::X86(X86Call::Win64),
+ (ExternAbi::SysV64 { .. }, ArchKind::X86_64) => CanonAbi::X86(X86Call::SysV64),
+ (ExternAbi::Win64 { .. }, ArchKind::X86_64) => CanonAbi::X86(X86Call::Win64),
(ExternAbi::SysV64 { .. } | ExternAbi::Win64 { .. }, _) => return AbiMapping::Invalid,
/* interrupts */
- (ExternAbi::AvrInterrupt, Arch::Avr) => CanonAbi::Interrupt(InterruptKind::Avr),
- (ExternAbi::AvrNonBlockingInterrupt, Arch::Avr) => {
+ (ExternAbi::AvrInterrupt, ArchKind::Avr) => CanonAbi::Interrupt(InterruptKind::Avr),
+ (ExternAbi::AvrNonBlockingInterrupt, ArchKind::Avr) => {
CanonAbi::Interrupt(InterruptKind::AvrNonBlocking)
}
- (ExternAbi::Msp430Interrupt, Arch::Msp430) => {
+ (ExternAbi::Msp430Interrupt, ArchKind::Msp430) => {
CanonAbi::Interrupt(InterruptKind::Msp430)
}
- (ExternAbi::RiscvInterruptM, Arch::Riscv) => {
+ (ExternAbi::RiscvInterruptM, ArchKind::Riscv) => {
CanonAbi::Interrupt(InterruptKind::RiscvMachine)
}
- (ExternAbi::RiscvInterruptS, Arch::Riscv) => {
+ (ExternAbi::RiscvInterruptS, ArchKind::Riscv) => {
CanonAbi::Interrupt(InterruptKind::RiscvSupervisor)
}
- (ExternAbi::X86Interrupt, Arch::X86 | Arch::X86_64) => {
+ (ExternAbi::X86Interrupt, ArchKind::X86 | ArchKind::X86_64) => {
CanonAbi::Interrupt(InterruptKind::X86)
}
(
@@ -186,7 +191,7 @@ pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMap
}
#[derive(Debug, PartialEq, Copy, Clone)]
-enum Arch {
+enum ArchKind {
Aarch64,
Amdgpu,
Arm(ArmVer),
diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs
index c32e333..047bc9b 100644
--- a/compiler/rustc_target/src/spec/base/apple/mod.rs
+++ b/compiler/rustc_target/src/spec/base/apple/mod.rs
@@ -11,7 +11,6 @@
#[cfg(test)]
mod tests;
-use Arch::*;
#[allow(non_camel_case_types)]
#[derive(Copy, Clone, PartialEq)]
pub(crate) enum Arch {
@@ -29,54 +28,60 @@ pub(crate) enum Arch {
impl Arch {
fn target_name(self) -> &'static str {
match self {
- Armv7k => "armv7k",
- Armv7s => "armv7s",
- Arm64 => "arm64",
- Arm64e => "arm64e",
- Arm64_32 => "arm64_32",
- I386 => "i386",
- I686 => "i686",
- X86_64 => "x86_64",
- X86_64h => "x86_64h",
+ Self::Armv7k => "armv7k",
+ Self::Armv7s => "armv7s",
+ Self::Arm64 => "arm64",
+ Self::Arm64e => "arm64e",
+ Self::Arm64_32 => "arm64_32",
+ Self::I386 => "i386",
+ Self::I686 => "i686",
+ Self::X86_64 => "x86_64",
+ Self::X86_64h => "x86_64h",
}
}
- pub(crate) fn target_arch(self) -> Cow<'static, str> {
- Cow::Borrowed(match self {
- Armv7k | Armv7s => "arm",
- Arm64 | Arm64e | Arm64_32 => "aarch64",
- I386 | I686 => "x86",
- X86_64 | X86_64h => "x86_64",
- })
+ pub(crate) fn target_arch(self) -> crate::spec::Arch {
+ match self {
+ Self::Armv7k | Self::Armv7s => crate::spec::Arch::Arm,
+ Self::Arm64 | Self::Arm64e | Self::Arm64_32 => crate::spec::Arch::AArch64,
+ Self::I386 | Self::I686 => crate::spec::Arch::X86,
+ Self::X86_64 | Self::X86_64h => crate::spec::Arch::X86_64,
+ }
}
fn target_cpu(self, env: TargetEnv) -> &'static str {
match self {
- Armv7k => "cortex-a8",
- Armv7s => "swift", // iOS 10 is only supported on iPhone 5 or higher.
- Arm64 => match env {
+ Self::Armv7k => "cortex-a8",
+ Self::Armv7s => "swift", // iOS 10 is only supported on iPhone 5 or higher.
+ Self::Arm64 => match env {
TargetEnv::Normal => "apple-a7",
TargetEnv::Simulator => "apple-a12",
TargetEnv::MacCatalyst => "apple-a12",
},
- Arm64e => "apple-a12",
- Arm64_32 => "apple-s4",
+ Self::Arm64e => "apple-a12",
+ Self::Arm64_32 => "apple-s4",
// Only macOS 10.12+ is supported, which means
// all x86_64/x86 CPUs must be running at least penryn
// https://github.com/llvm/llvm-project/blob/01f924d0e37a5deae51df0d77e10a15b63aa0c0f/clang/lib/Driver/ToolChains/Arch/X86.cpp#L79-L82
- I386 | I686 => "penryn",
- X86_64 => "penryn",
+ Self::I386 | Self::I686 => "penryn",
+ Self::X86_64 => "penryn",
// Note: `core-avx2` is slightly more advanced than `x86_64h`, see
// comments (and disabled features) in `x86_64h_apple_darwin` for
// details. It is a higher baseline then `penryn` however.
- X86_64h => "core-avx2",
+ Self::X86_64h => "core-avx2",
}
}
fn stack_probes(self) -> StackProbeType {
match self {
- Armv7k | Armv7s => StackProbeType::None,
- Arm64 | Arm64e | Arm64_32 | I386 | I686 | X86_64 | X86_64h => StackProbeType::Inline,
+ Self::Armv7k | Self::Armv7s => StackProbeType::None,
+ Self::Arm64
+ | Self::Arm64e
+ | Self::Arm64_32
+ | Self::I386
+ | Self::I686
+ | Self::X86_64
+ | Self::X86_64h => StackProbeType::Inline,
}
}
}
@@ -104,7 +109,7 @@ pub(crate) fn base(
os: &'static str,
arch: Arch,
env: TargetEnv,
-) -> (TargetOptions, StaticCow<str>, StaticCow<str>) {
+) -> (TargetOptions, StaticCow<str>, crate::spec::Arch) {
let mut opts = TargetOptions {
llvm_floatabi: Some(FloatAbi::Hard),
os: os.into(),
@@ -132,10 +137,10 @@ pub(crate) fn base(
default_dwarf_version: 4,
frame_pointer: match arch {
// clang ignores `-fomit-frame-pointer` for Armv7, it only accepts `-momit-leaf-frame-pointer`
- Armv7k | Armv7s => FramePointer::Always,
+ Arch::Armv7k | Arch::Armv7s => FramePointer::Always,
// clang supports omitting frame pointers for the rest, but... don't?
- Arm64 | Arm64e | Arm64_32 => FramePointer::NonLeaf,
- I386 | I686 | X86_64 | X86_64h => FramePointer::Always,
+ Arch::Arm64 | Arch::Arm64e | Arch::Arm64_32 => FramePointer::NonLeaf,
+ Arch::I386 | Arch::I686 | Arch::X86_64 | Arch::X86_64h => FramePointer::Always,
},
has_rpath: true,
dll_suffix: ".dylib".into(),
@@ -306,18 +311,22 @@ pub fn os_minimum_deployment_target(os: &str) -> Self {
/// This matches what LLVM does, see in part:
/// <https://github.com/llvm/llvm-project/blob/llvmorg-21.1.3/llvm/lib/TargetParser/Triple.cpp#L2140-L2175>
pub fn minimum_deployment_target(target: &Target) -> Self {
- let (major, minor, patch) = match (&*target.os, &*target.arch, &*target.env) {
- ("macos", "aarch64", _) => (11, 0, 0),
- ("ios", "aarch64", "macabi") => (14, 0, 0),
- ("ios", "aarch64", "sim") => (14, 0, 0),
+ let (major, minor, patch) = match (&*target.os, &target.arch, &*target.env) {
+ ("macos", crate::spec::Arch::AArch64, _) => (11, 0, 0),
+ ("ios", crate::spec::Arch::AArch64, "macabi") => (14, 0, 0),
+ ("ios", crate::spec::Arch::AArch64, "sim") => (14, 0, 0),
("ios", _, _) if target.llvm_target.starts_with("arm64e") => (14, 0, 0),
// Mac Catalyst defaults to 13.1 in Clang.
("ios", _, "macabi") => (13, 1, 0),
- ("tvos", "aarch64", "sim") => (14, 0, 0),
- ("watchos", "aarch64", "sim") => (7, 0, 0),
+ ("tvos", crate::spec::Arch::AArch64, "sim") => (14, 0, 0),
+ ("watchos", crate::spec::Arch::AArch64, "sim") => (7, 0, 0),
// True Aarch64 on watchOS (instead of their Aarch64 Ilp32 called `arm64_32`) has been
// available since Xcode 14, but it's only actually used more recently in watchOS 26.
- ("watchos", "aarch64", "") if !target.llvm_target.starts_with("arm64_32") => (26, 0, 0),
+ ("watchos", crate::spec::Arch::AArch64, "")
+ if !target.llvm_target.starts_with("arm64_32") =>
+ {
+ (26, 0, 0)
+ }
(os, _, _) => return Self::os_minimum_deployment_target(os),
};
Self { major, minor, patch }
diff --git a/compiler/rustc_target/src/spec/base/nto_qnx.rs b/compiler/rustc_target/src/spec/base/nto_qnx.rs
index 6498742..119c5ec 100644
--- a/compiler/rustc_target/src/spec/base/nto_qnx.rs
+++ b/compiler/rustc_target/src/spec/base/nto_qnx.rs
@@ -41,7 +41,7 @@ pub(crate) fn aarch64() -> Target {
// n32:64 = 32 and 64 are native integer widths; Elements of this set are considered to support most general arithmetic operations efficiently.
// S128 = 128 bits are the natural alignment of the stack in bits.
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: crate::spec::Arch::AArch64,
options: TargetOptions {
features: "+v8a".into(),
max_atomic_width: Some(128),
@@ -57,7 +57,7 @@ pub(crate) fn x86_64() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: crate::spec::Arch::X86_64,
options: TargetOptions {
cpu: "x86-64".into(),
plt_by_default: false,
diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
index f236be9..c25628c 100644
--- a/compiler/rustc_target/src/spec/json.rs
+++ b/compiler/rustc_target/src/spec/json.rs
@@ -5,7 +5,7 @@
use super::crt_objects::CrtObjects;
use super::{
- BinaryFormat, CodeModel, DebuginfoKind, FloatAbi, FramePointer, LinkArgsCli,
+ Arch, BinaryFormat, CodeModel, DebuginfoKind, FloatAbi, FramePointer, LinkArgsCli,
LinkSelfContainedComponents, LinkSelfContainedDefault, LinkerFlavorCli, LldFlavor,
MergeFunctions, PanicStrategy, RelocModel, RelroLevel, RustcAbi, SanitizerSet,
SmallDataThresholdSupport, SplitDebuginfo, StackProbeType, StaticCow, SymbolVisibility, Target,
@@ -486,7 +486,7 @@ struct TargetSpecJson {
llvm_target: StaticCow<str>,
target_pointer_width: u16,
data_layout: StaticCow<str>,
- arch: StaticCow<str>,
+ arch: Arch,
metadata: Option<TargetSpecJsonMetadata>,
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index b49e7fc..74048d3 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1847,6 +1847,89 @@ enum TargetKind {
Builtin,
}
+crate::target_spec_enum! {
+ pub enum Arch {
+ AArch64 = "aarch64",
+ AmdGpu = "amdgpu",
+ Arm = "arm",
+ Arm64EC = "arm64ec",
+ Avr = "avr",
+ Bpf = "bpf",
+ CSky = "csky",
+ Hexagon = "hexagon",
+ LoongArch32 = "loongarch32",
+ LoongArch64 = "loongarch64",
+ M68k = "m68k",
+ Mips = "mips",
+ Mips32r6 = "mips32r6",
+ Mips64 = "mips64",
+ Mips64r6 = "mips64r6",
+ Msp430 = "msp430",
+ Nvptx64 = "nvptx64",
+ PowerPC = "powerpc",
+ PowerPC64 = "powerpc64",
+ PowerPC64LE = "powerpc64le",
+ RiscV32 = "riscv32",
+ RiscV64 = "riscv64",
+ S390x = "s390x",
+ Sparc = "sparc",
+ Sparc64 = "sparc64",
+ SpirV = "spirv",
+ Wasm32 = "wasm32",
+ Wasm64 = "wasm64",
+ X86 = "x86",
+ X86_64 = "x86_64",
+ Xtensa = "xtensa",
+ }
+ /// The vast majority of the time, the compiler deals with a fixed set of
+ /// target architectures, so it is convenient for them to be represented in
+ /// an enum. However, it is possible to have arbitrary values for the "arch"
+ /// field in a target JSON file (which can be parsed when `--target` is
+ /// specified). This might occur, for example, for an out-of-tree codegen
+ /// backend that supports an architecture that rustc currently doesn't know
+ /// about. This variant exists as an escape hatch for such cases.
+ other_variant = Unknown;
+}
+
+impl Arch {
+ pub fn desc_symbol(&self) -> Symbol {
+ match self {
+ Self::AArch64 => sym::aarch64,
+ Self::AmdGpu => sym::amdgpu,
+ Self::Arm => sym::arm,
+ Self::Arm64EC => sym::arm64ec,
+ Self::Avr => sym::avr,
+ Self::Bpf => sym::bpf,
+ Self::CSky => sym::csky,
+ Self::Hexagon => sym::hexagon,
+ Self::LoongArch32 => sym::loongarch32,
+ Self::LoongArch64 => sym::loongarch64,
+ Self::M68k => sym::m68k,
+ Self::Mips => sym::mips,
+ Self::Mips32r6 => sym::mips32r6,
+ Self::Mips64 => sym::mips64,
+ Self::Mips64r6 => sym::mips64r6,
+ Self::Msp430 => sym::msp430,
+ Self::Nvptx64 => sym::nvptx64,
+ Self::PowerPC => sym::powerpc,
+ Self::PowerPC64 => sym::powerpc64,
+ Self::PowerPC64LE => sym::powerpc64le,
+ Self::RiscV32 => sym::riscv32,
+ Self::RiscV64 => sym::riscv64,
+ Self::S390x => sym::s390x,
+ Self::Sparc => sym::sparc,
+ Self::Sparc64 => sym::sparc64,
+ Self::SpirV => sym::spirv,
+ Self::Wasm32 => sym::wasm32,
+ Self::Wasm64 => sym::wasm64,
+ Self::X86 => sym::x86,
+ Self::X86_64 => sym::x86_64,
+ Self::Xtensa => sym::xtensa,
+ Self::Unknown(name) => rustc_span::Symbol::intern(name),
+ }
+ }
+}
+
/// Everything `rustc` knows about how to compile for a specific target.
///
/// Every field here must be specified, and has no default value.
@@ -1866,7 +1949,7 @@ pub struct Target {
pub pointer_width: u16,
/// Architecture to use for ABI considerations. Valid options include: "x86",
/// "x86_64", "arm", "aarch64", "mips", "powerpc", "powerpc64", and others.
- pub arch: StaticCow<str>,
+ pub arch: Arch,
/// [Data layout](https://llvm.org/docs/LangRef.html#data-layout) to pass to LLVM.
pub data_layout: StaticCow<str>,
/// Optional settings with defaults.
@@ -2672,7 +2755,7 @@ macro_rules! check_matches {
);
check_eq!(
self.is_like_wasm,
- self.arch == "wasm32" || self.arch == "wasm64",
+ matches!(self.arch, Arch::Wasm32 | Arch::Wasm64),
"`is_like_wasm` must be set if and only if `arch` is `wasm32` or `wasm64`"
);
if self.is_like_msvc {
@@ -2704,12 +2787,12 @@ macro_rules! check_matches {
"`linker_flavor` must be `em-cc` if and only if `os` is `emscripten`"
);
check_eq!(
- self.arch == "bpf",
+ self.arch == Arch::Bpf,
matches!(self.linker_flavor, LinkerFlavor::Bpf),
"`linker_flavor` must be `bpf` if and only if `arch` is `bpf`"
);
check_eq!(
- self.arch == "nvptx64",
+ self.arch == Arch::Nvptx64,
matches!(self.linker_flavor, LinkerFlavor::Ptx),
"`linker_flavor` must be `ptc` if and only if `arch` is `nvptx64`"
);
@@ -2723,7 +2806,7 @@ macro_rules! check_matches {
] {
for (&flavor, flavor_args) in args {
check!(
- !flavor_args.is_empty() || self.arch == "avr",
+ !flavor_args.is_empty() || self.arch == Arch::Avr,
"linker flavor args must not be empty"
);
// Check that flavors mentioned in link args are compatible with the default flavor.
@@ -2846,10 +2929,7 @@ macro_rules! check_matches {
// hexagon: when targeting QuRT, that OS can load dynamic libraries.
// wasm{32,64}: dynamic linking is inherent in the definition of the VM.
if self.os == "none"
- && (self.arch != "bpf"
- && self.arch != "hexagon"
- && self.arch != "wasm32"
- && self.arch != "wasm64")
+ && !matches!(self.arch, Arch::Bpf | Arch::Hexagon | Arch::Wasm32 | Arch::Wasm64)
{
check!(
!self.dynamic_linking,
@@ -2912,8 +2992,8 @@ macro_rules! check_matches {
// Check that RISC-V targets always specify which ABI they use,
// and that ARM targets specify their float ABI.
- match &*self.arch {
- "riscv32" => {
+ match self.arch {
+ Arch::RiscV32 => {
check_matches!(
&*self.llvm_abiname,
"ilp32" | "ilp32f" | "ilp32d" | "ilp32e",
@@ -2921,7 +3001,7 @@ macro_rules! check_matches {
self.llvm_abiname,
);
}
- "riscv64" => {
+ Arch::RiscV64 => {
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
check_matches!(
&*self.llvm_abiname,
@@ -2930,7 +3010,7 @@ macro_rules! check_matches {
self.llvm_abiname,
);
}
- "arm" => {
+ Arch::Arm => {
check!(
self.llvm_floatabi.is_some(),
"ARM targets must set `llvm-floatabi` to `hard` or `soft`",
@@ -2943,13 +3023,13 @@ macro_rules! check_matches {
if let Some(rust_abi) = self.rustc_abi {
match rust_abi {
RustcAbi::X86Sse2 => check_matches!(
- &*self.arch,
- "x86",
+ self.arch,
+ Arch::X86,
"`x86-sse2` ABI is only valid for x86-32 targets"
),
RustcAbi::X86Softfloat => check_matches!(
- &*self.arch,
- "x86" | "x86_64",
+ self.arch,
+ Arch::X86 | Arch::X86_64,
"`x86-softfloat` ABI is only valid for x86 targets"
),
}
@@ -3116,15 +3196,15 @@ pub fn small_data_threshold_support(&self) -> SmallDataThresholdSupport {
// Avoid having to duplicate the small data support in every
// target file by supporting a default value for each
// architecture.
- SmallDataThresholdSupport::DefaultForArch => match self.arch.as_ref() {
- "mips" | "mips64" | "mips32r6" => {
+ SmallDataThresholdSupport::DefaultForArch => match self.arch {
+ Arch::Mips | Arch::Mips64 | Arch::Mips32r6 => {
SmallDataThresholdSupport::LlvmArg("mips-ssection-threshold".into())
}
- "hexagon" => {
+ Arch::Hexagon => {
SmallDataThresholdSupport::LlvmArg("hexagon-small-data-threshold".into())
}
- "m68k" => SmallDataThresholdSupport::LlvmArg("m68k-ssection-threshold".into()),
- "riscv32" | "riscv64" => {
+ Arch::M68k => SmallDataThresholdSupport::LlvmArg("m68k-ssection-threshold".into()),
+ Arch::RiscV32 | Arch::RiscV64 => {
SmallDataThresholdSupport::LlvmModuleFlag("SmallDataLimit".into())
}
_ => SmallDataThresholdSupport::None,
@@ -3138,9 +3218,9 @@ pub fn object_architecture(
unstable_target_features: &FxIndexSet<Symbol>,
) -> Option<(object::Architecture, Option<object::SubArchitecture>)> {
use object::Architecture;
- Some(match self.arch.as_ref() {
- "arm" => (Architecture::Arm, None),
- "aarch64" => (
+ Some(match self.arch {
+ Arch::Arm => (Architecture::Arm, None),
+ Arch::AArch64 => (
if self.pointer_width == 32 {
Architecture::Aarch64_Ilp32
} else {
@@ -3148,11 +3228,11 @@ pub fn object_architecture(
},
None,
),
- "x86" => (Architecture::I386, None),
- "s390x" => (Architecture::S390x, None),
- "m68k" => (Architecture::M68k, None),
- "mips" | "mips32r6" => (Architecture::Mips, None),
- "mips64" | "mips64r6" => (
+ Arch::X86 => (Architecture::I386, None),
+ Arch::S390x => (Architecture::S390x, None),
+ Arch::M68k => (Architecture::M68k, None),
+ Arch::Mips | Arch::Mips32r6 => (Architecture::Mips, None),
+ Arch::Mips64 | Arch::Mips64r6 => (
// While there are currently no builtin targets
// using the N32 ABI, it is possible to specify
// it using a custom target specification. N32
@@ -3165,7 +3245,7 @@ pub fn object_architecture(
},
None,
),
- "x86_64" => (
+ Arch::X86_64 => (
if self.pointer_width == 32 {
Architecture::X86_64_X32
} else {
@@ -3173,11 +3253,11 @@ pub fn object_architecture(
},
None,
),
- "powerpc" => (Architecture::PowerPc, None),
- "powerpc64" => (Architecture::PowerPc64, None),
- "riscv32" => (Architecture::Riscv32, None),
- "riscv64" => (Architecture::Riscv64, None),
- "sparc" => {
+ Arch::PowerPC => (Architecture::PowerPc, None),
+ Arch::PowerPC64 => (Architecture::PowerPc64, None),
+ Arch::RiscV32 => (Architecture::Riscv32, None),
+ Arch::RiscV64 => (Architecture::Riscv64, None),
+ Arch::Sparc => {
if unstable_target_features.contains(&sym::v8plus) {
// Target uses V8+, aka EM_SPARC32PLUS, aka 64-bit V9 but in 32-bit mode
(Architecture::Sparc32Plus, None)
@@ -3186,18 +3266,23 @@ pub fn object_architecture(
(Architecture::Sparc, None)
}
}
- "sparc64" => (Architecture::Sparc64, None),
- "avr" => (Architecture::Avr, None),
- "msp430" => (Architecture::Msp430, None),
- "hexagon" => (Architecture::Hexagon, None),
- "xtensa" => (Architecture::Xtensa, None),
- "bpf" => (Architecture::Bpf, None),
- "loongarch32" => (Architecture::LoongArch32, None),
- "loongarch64" => (Architecture::LoongArch64, None),
- "csky" => (Architecture::Csky, None),
- "arm64ec" => (Architecture::Aarch64, Some(object::SubArchitecture::Arm64EC)),
- // Unsupported architecture.
- _ => return None,
+ Arch::Sparc64 => (Architecture::Sparc64, None),
+ Arch::Avr => (Architecture::Avr, None),
+ Arch::Msp430 => (Architecture::Msp430, None),
+ Arch::Hexagon => (Architecture::Hexagon, None),
+ Arch::Xtensa => (Architecture::Xtensa, None),
+ Arch::Bpf => (Architecture::Bpf, None),
+ Arch::LoongArch32 => (Architecture::LoongArch32, None),
+ Arch::LoongArch64 => (Architecture::LoongArch64, None),
+ Arch::CSky => (Architecture::Csky, None),
+ Arch::Arm64EC => (Architecture::Aarch64, Some(object::SubArchitecture::Arm64EC)),
+ Arch::AmdGpu
+ | Arch::Nvptx64
+ | Arch::PowerPC64LE
+ | Arch::SpirV
+ | Arch::Wasm32
+ | Arch::Wasm64
+ | Arch::Unknown(_) => return None,
})
}
@@ -3213,7 +3298,7 @@ pub fn max_reliable_alignment(&self) -> Align {
// FIXME(#112480) MSVC on x86-32 is unsound and fails to properly align many types with
// more-than-4-byte-alignment on the stack. This makes alignments larger than 4 generally
// unreliable on 32bit Windows.
- if self.is_like_windows && self.arch == "x86" {
+ if self.is_like_windows && self.arch == Arch::X86 {
Align::from_bytes(4).unwrap()
} else {
Align::MAX
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_hermit.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_hermit.rs
index cad57ab..78ae0f5 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_hermit.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_hermit.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
options: TargetOptions {
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu.rs
index 4b75a6e..659bcdc 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu.rs
@@ -1,6 +1,8 @@
use rustc_abi::Endian;
-use crate::spec::{FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{
+ Arch, FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +15,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a,+outline-atomics".into(),
// the AAPCS64 expects use of non-leaf frame pointers per
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu_ilp32.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu_ilp32.rs
index 2a16d1d..63a13b8 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu_ilp32.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu_ilp32.rs
@@ -1,6 +1,8 @@
use rustc_abi::Endian;
-use crate::spec::{FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{
+ Arch, FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
@@ -16,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
abi: "ilp32".into(),
features: "+v8a,+outline-atomics".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_musl.rs
index be5ac4a..d3bf641 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_musl.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -26,7 +26,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
// the AAPCS64 expects use of non-leaf frame pointers per
// https://github.com/ARM-software/abi-aa/blob/4492d1570eb70c8fd146623e0db65b2d241f12e7/aapcs64/aapcs64.rst#the-frame-pointer
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs
index 9774240..1d77669 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
mcount: "__mcount".into(),
max_atomic_width: Some(128),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_none_softfloat.rs
index 7f918e8..8ba909a 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_none_softfloat.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_be_unknown_none_softfloat.rs
@@ -8,7 +8,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
TargetMetadata, TargetOptions,
};
@@ -37,7 +37,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_kmc_solid_asp3.rs b/compiler/rustc_target/src/spec/targets/aarch64_kmc_solid_asp3.rs
index f58aa1a..d6b0e09 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_kmc_solid_asp3.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_kmc_solid_asp3.rs
@@ -1,4 +1,4 @@
-use crate::spec::{RelocModel, StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, RelocModel, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let base = base::solid::opts("asp3");
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
linker: Some("aarch64-kmc-elf-gcc".into()),
features: "+v8a,+neon,+fp-armv8".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_linux_android.rs b/compiler/rustc_target/src/spec/targets/aarch64_linux_android.rs
index d8651f3..2bee1cf 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_linux_android.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_linux_android.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
// See https://developer.android.com/ndk/guides/abis.html#arm64-v8a
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
max_atomic_width: Some(128),
// As documented in https://developer.android.com/ndk/guides/cpu-features.html
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_nintendo_switch_freestanding.rs b/compiler/rustc_target/src/spec/targets/aarch64_nintendo_switch_freestanding.rs
index 61e4cad..eb8144d 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_nintendo_switch_freestanding.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_nintendo_switch_freestanding.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, StackProbeType, Target, TargetMetadata,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, StackProbeType, Target, TargetMetadata,
TargetOptions,
};
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a,+neon,+crypto,+crc".into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_gnullvm.rs b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_gnullvm.rs
index eee668c..9b7db11 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_gnullvm.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_gnullvm.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FramePointer, Target, TargetMetadata, base};
+use crate::spec::{Arch, FramePointer, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnullvm::opts();
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs
index cd55576..3453f1d 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FramePointer, Target, TargetMetadata, base};
+use crate::spec::{Arch, FramePointer, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_freebsd.rs
index 7306a75..69a65e6 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_freebsd.rs
@@ -1,4 +1,6 @@
-use crate::spec::{SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{
+ Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a".into(),
max_atomic_width: Some(128),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs
index 8366b6d..b5907c6 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -33,7 +33,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_helenos.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_helenos.rs
index 31b4a21..3e168b6 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_helenos.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_helenos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, base};
+use crate::spec::{Arch, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::helenos::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_hermit.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_hermit.rs
index 580a36c..2cf5c25 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_hermit.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_hermit.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
options: TargetOptions {
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_illumos.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_illumos.rs
index 1ed4fdb..e744dc7 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_illumos.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_illumos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::illumos::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs
index 4220d74..c4b1f2c 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a,+outline-atomics".into(),
// the AAPCS64 expects use of non-leaf frame pointers per
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu_ilp32.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu_ilp32.rs
index a22c128..5020d89 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu_ilp32.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu_ilp32.rs
@@ -1,4 +1,6 @@
-use crate::spec::{FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{
+ Arch, FramePointer, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
abi: "ilp32".into(),
features: "+v8a,+outline-atomics".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
index 158b38e..6ba5112 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -27,7 +27,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
// the AAPCS64 expects use of non-leaf frame pointers per
// https://github.com/ARM-software/abi-aa/blob/4492d1570eb70c8fd146623e0db65b2d241f12e7/aapcs64/aapcs64.rst#the-frame-pointer
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_ohos.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_ohos.rs
index 51cdebf..5f1ab60 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_ohos.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_ohos.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
// the AAPCS64 expects use of non-leaf frame pointers per
// https://github.com/ARM-software/abi-aa/blob/4492d1570eb70c8fd146623e0db65b2d241f12e7/aapcs64/aapcs64.rst#the-frame-pointer
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_managarm_mlibc.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_managarm_mlibc.rs
index 1fa9d71..ede0f78 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_managarm_mlibc.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_managarm_mlibc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, base};
+use crate::spec::{Arch, StackProbeType, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::managarm_mlibc::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs
index 46173045..d024030 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a".into(),
mcount: "__mcount".into(),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs
index 6c14f5d..ffb1363 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs
@@ -7,7 +7,7 @@
// For example, `-C target-cpu=cortex-a53`.
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
TargetMetadata, TargetOptions,
};
@@ -39,7 +39,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
index 35a4dd7..387fef3 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
@@ -7,7 +7,7 @@
// For example, `-C target-cpu=cortex-a53`.
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
TargetMetadata, TargetOptions,
};
@@ -35,7 +35,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs
index 243d84a1..8bcc3e0 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs
@@ -7,7 +7,7 @@
// For example, `-C target-cpu=cortex-a53`.
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target,
TargetMetadata, TargetOptions, cvs,
};
@@ -41,7 +41,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_openbsd.rs
index c23006a..e5e40cb 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_openbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a".into(),
max_atomic_width: Some(128),
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_redox.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_redox.rs
index 39fe715..81aac17 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_redox.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_redox.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::redox::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs
index 799ff1a..009f027 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::teeos::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_trusty.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_trusty.rs
index 05783fd..3d0560e 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_trusty.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_trusty.rs
@@ -1,7 +1,8 @@
// Trusty OS target for AArch64.
use crate::spec::{
- LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetMetadata, TargetOptions,
+ Arch, LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetMetadata,
+ TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -15,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+neon,+fp-armv8,+reserve-x18".into(),
executables: true,
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
index 327b523..e2c1888 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
@@ -1,7 +1,7 @@
// This defines the aarch64 target for UEFI systems as described in the UEFI specification. See the
// uefi-base module for generic UEFI options.
-use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::uefi_msvc::opts();
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_uwp_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/aarch64_uwp_windows_msvc.rs
index a40c8c3..0b39b90 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_uwp_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_uwp_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_msvc::opts();
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs
index b682676..679d894 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
- arch: "aarch64".into(),
+ arch: Arch::AArch64,
options: TargetOptions {
features: "+v8a,+reserve-x18".into(),
max_atomic_width: Some(128),
diff --git a/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs b/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs
index 0d6c619..07772c7 100644
--- a/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs
+++ b/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs
@@ -1,8 +1,10 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, Target, TargetMetadata, TargetOptions};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, Target, TargetMetadata, TargetOptions,
+};
pub(crate) fn target() -> Target {
Target {
- arch: "amdgpu".into(),
+ arch: Arch::AmdGpu,
data_layout: "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(),
llvm_target: "amdgcn-amd-amdhsa".into(),
metadata: TargetMetadata {
diff --git a/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs
index 7292412..aa31f53 100644
--- a/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs
@@ -1,4 +1,6 @@
-use crate::spec::{FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base};
+use crate::spec::{
+ Arch, FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -28,7 +30,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
- arch: "arm64ec".into(),
+ arch: Arch::Arm64EC,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs b/compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs
index d744688..dad8f5e 100644
--- a/compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs
+++ b/compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabi.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabi.rs
index 3b6c971..5513625 100644
--- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabi.rs
+++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs
index 0c711d5..087d4cf 100644
--- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs
index d05f4c7..e5224e4 100644
--- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs
+++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs
index 9ce752e..0e95845 100644
--- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs b/compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs
index afb17fd..a9794f8 100644
--- a/compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armebv7r_none_eabi.rs b/compiler/rustc_target/src/spec/targets/armebv7r_none_eabi.rs
index 0ae7cd7..bf9519b 100644
--- a/compiler/rustc_target/src/spec/targets/armebv7r_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armebv7r_none_eabi.rs
@@ -3,7 +3,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armebv7r_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armebv7r_none_eabihf.rs
index 71ffd8b..75a4ab4 100644
--- a/compiler/rustc_target/src/spec/targets/armebv7r_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armebv7r_none_eabihf.rs
@@ -3,7 +3,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv4t_none_eabi.rs b/compiler/rustc_target/src/spec/targets/armv4t_none_eabi.rs
index 9571821..2bb35bd 100644
--- a/compiler/rustc_target/src/spec/targets/armv4t_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv4t_none_eabi.rs
@@ -10,7 +10,7 @@
//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions, cvs,
};
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "arm".into(),
+ arch: Arch::Arm,
/* Data layout args are '-' separated:
* little endian
* stack is 64-bit aligned (EABI)
diff --git a/compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs b/compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs
index beaec71..1e13e02 100644
--- a/compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv5te_none_eabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_none_eabi.rs
index 75ab941..28f2533 100644
--- a/compiler/rustc_target/src/spec/targets/armv5te_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv5te_none_eabi.rs
@@ -1,6 +1,6 @@
//! Targets the ARMv5TE, with code as `a32` code by default.
-use crate::spec::{FloatAbi, FramePointer, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, FramePointer, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "arm".into(),
+ arch: Arch::Arm,
/* Data layout args are '-' separated:
* little endian
* stack is 64-bit aligned (EABI)
diff --git a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_gnueabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_gnueabi.rs
index 7b93672..763d68f 100644
--- a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_gnueabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_gnueabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs
index 0240450..a08d1a1 100644
--- a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs
index 860629b..1719ab7 100644
--- a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs
index 1625a6b..2da1521 100644
--- a/compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs
index af9a435..fbd55a3 100644
--- a/compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs b/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs
index 4c32a5e..a79c642 100644
--- a/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs
+++ b/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
};
/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
os: "horizon".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs b/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs
index 706fb12..ce6c3c8 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, SanitizerSet, Target, TargetMetadata, TargetOptions,
+ base,
};
// This target if is for the baseline of the Android v7a ABI
@@ -23,7 +24,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_rtems_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_rtems_eabihf.rs
index c17db36..0958f61 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_rtems_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_rtems_eabihf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions, cvs,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
os: "rtems".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
index 4902dc3..6c02ec2 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
};
/// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib).
@@ -26,7 +26,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
os: "vita".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs
index 56f2e09..63aee18 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabi.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabi.rs
index 603afe2..6288095 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on ARMv7 without thumb-mode, NEON or
// hardfloat.
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs
index a3b35d6..57374b8 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on ARMv7 without NEON or
// thumb-mode. See the thumbv7neon variant for enabling both.
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs
index dd8a97b..20545ab 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for musl Linux on ARMv7 without thumb-mode, NEON or
// hardfloat.
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs
index c3b7ac5..7028f43 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for musl Linux on ARMv7 without thumb-mode or NEON.
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
// target.
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_ohos.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_ohos.rs
index f31dedb..f094618 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_ohos.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_ohos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for OpenHarmony on ARMv7 Linux with thumb-mode, but no NEON or
// hardfloat.
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabi.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabi.rs
index a9e9f46..c2cc252 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for uclibc Linux on ARMv7 without NEON,
// thumb-mode or hardfloat.
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs
index a95f12d..0649ba3 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for uclibc Linux on ARMv7 without NEON or
// thumb-mode. See the thumbv7neon variant for enabling both.
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs
index d155dc5..d6cb517 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_trusty.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_trusty.rs
index 2b0b0e1..765d198 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_unknown_trusty.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_trusty.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FloatAbi, LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetMetadata,
+ Arch, FloatAbi, LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetMetadata,
TargetOptions,
};
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs
index 05be389b..ef26115 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabi.rs b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabi.rs
index 26c2513..3ceeef4 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabi.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, RelocModel, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, RelocModel, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let base = base::solid::opts("asp3");
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs
index 7032444..65af0bd 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, RelocModel, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, RelocModel, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let base = base::solid::opts("asp3");
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_none_eabi.rs b/compiler/rustc_target/src/spec/targets/armv7a_none_eabi.rs
index fb1d7d6..3d4328a 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_none_eabi.rs
@@ -15,7 +15,7 @@
// linking. rationale: matches `thumb` targets
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -44,7 +44,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs
index 217a79d..e3c5dce 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs
@@ -6,7 +6,7 @@
// `thumb` & `aarch64` targets.
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -36,7 +36,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabi.rs
index 052285b..9330254 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabi.rs
@@ -5,7 +5,7 @@
// configuration without hardware floating point support.
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions, cvs,
};
@@ -36,7 +36,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabihf.rs
index 85543e9..8645175 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_nuttx_eabihf.rs
@@ -5,7 +5,7 @@
// configuration with hardware floating point support.
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions, cvs,
};
@@ -36,7 +36,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs b/compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs
index 06dd262..6da1a35 100644
--- a/compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -38,7 +38,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/armv7r_none_eabi.rs b/compiler/rustc_target/src/spec/targets/armv7r_none_eabi.rs
index 334be48..bd07e72 100644
--- a/compiler/rustc_target/src/spec/targets/armv7r_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7r_none_eabi.rs
@@ -1,7 +1,7 @@
// Targets the Little-endian Cortex-R4/R5 processor (ARMv7-R)
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7r_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7r_none_eabihf.rs
index 2bb3e70..2f89f80 100644
--- a/compiler/rustc_target/src/spec/targets/armv7r_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7r_none_eabihf.rs
@@ -1,7 +1,7 @@
// Targets the Little-endian Cortex-R4F/R5F processor (ARMv7-R)
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs
index d6e3a03..58bd9fa 100644
--- a/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs
@@ -1,7 +1,7 @@
// Targets the Little-endian Cortex-R52 processor (ARMv8-R)
use crate::spec::{
- Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
diff --git a/compiler/rustc_target/src/spec/targets/avr_none.rs b/compiler/rustc_target/src/spec/targets/avr_none.rs
index 65a171e..eaf4e95 100644
--- a/compiler/rustc_target/src/spec/targets/avr_none.rs
+++ b/compiler/rustc_target/src/spec/targets/avr_none.rs
@@ -1,8 +1,8 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {
Target {
- arch: "avr".into(),
+ arch: Arch::Avr,
metadata: crate::spec::TargetMetadata {
description: None,
tier: Some(3),
diff --git a/compiler/rustc_target/src/spec/targets/bpfeb_unknown_none.rs b/compiler/rustc_target/src/spec/targets/bpfeb_unknown_none.rs
index 3d39cd2..d4a40b2 100644
--- a/compiler/rustc_target/src/spec/targets/bpfeb_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/bpfeb_unknown_none.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
pointer_width: 64,
- arch: "bpf".into(),
+ arch: Arch::Bpf,
options: base::bpf::opts(Endian::Big),
}
}
diff --git a/compiler/rustc_target/src/spec/targets/bpfel_unknown_none.rs b/compiler/rustc_target/src/spec/targets/bpfel_unknown_none.rs
index 51f45b0..f9c5f09 100644
--- a/compiler/rustc_target/src/spec/targets/bpfel_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/bpfel_unknown_none.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
pointer_width: 64,
- arch: "bpf".into(),
+ arch: Arch::Bpf,
options: base::bpf::opts(Endian::Little),
}
}
diff --git a/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs b/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs
index 6142c15..1f7f789 100644
--- a/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs
+++ b/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on Csky
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-S32-p:32:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:32-v128:32:32-a:0:32-Fi32-n32".into(),
- arch: "csky".into(),
+ arch: Arch::CSky,
options: TargetOptions {
abi: "abiv2".into(),
features: "+2e3,+3e7,+7e10,+cache,+dsp1e2,+dspe60,+e1,+e2,+edsp,+elrw,+hard-tp,+high-registers,+hwdiv,+mp,+mp1e2,+nvic,+trust".into(),
diff --git a/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2hf.rs b/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2hf.rs
index c233ec3..68fdb69 100644
--- a/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2hf.rs
+++ b/compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2hf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on Csky
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-S32-p:32:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:32-v128:32:32-a:0:32-Fi32-n32".into(),
- arch: "csky".into(),
+ arch: Arch::CSky,
options: TargetOptions {
abi: "abiv2hf".into(),
cpu: "ck860fv".into(),
diff --git a/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
index 74a7eab..17b371f 100644
--- a/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
":2048:2048"
)
.into(),
- arch: "hexagon".into(),
+ arch: Arch::Hexagon,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs
index e5a927d..6379cd3 100644
--- a/compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{PanicStrategy, Target, TargetMetadata, TargetOptions};
+use crate::spec::{Arch, PanicStrategy, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
Target {
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
":2048:2048"
)
.into(),
- arch: "hexagon".into(),
+ arch: Arch::Hexagon,
options: TargetOptions {
cpu: "hexagonv60".into(),
diff --git a/compiler/rustc_target/src/spec/targets/i586_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/i586_unknown_netbsd.rs
index 39a71cf..92889d6 100644
--- a/compiler/rustc_target/src/spec/targets/i586_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/i586_unknown_netbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::netbsd::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: TargetOptions { mcount: "__mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i586_unknown_redox.rs b/compiler/rustc_target/src/spec/targets/i586_unknown_redox.rs
index 08281ed..9356666 100644
--- a/compiler/rustc_target/src/spec/targets/i586_unknown_redox.rs
+++ b/compiler/rustc_target/src/spec/targets/i586_unknown_redox.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::redox::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
data_layout:
"e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_linux_android.rs b/compiler/rustc_target/src/spec/targets/i686_linux_android.rs
index f2d7ec6..b4716f8 100644
--- a/compiler/rustc_target/src/spec/targets/i686_linux_android.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_linux_android.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
// See https://developer.android.com/ndk/guides/abis.html#x86
@@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs b/compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs
index 6a98a76..af7f3b6 100644
--- a/compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs
@@ -1,5 +1,5 @@
use crate::spec::base::nto_qnx;
-use crate::spec::{RustcAbi, StackProbeType, Target, TargetOptions, base};
+use crate::spec::{Arch, RustcAbi, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut meta = nto_qnx::meta();
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: TargetOptions {
rustc_abi: Some(RustcAbi::X86Sse2),
cpu: "pentium4".into(),
diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs
index a0d403b..8ec1607 100644
--- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base, crt_objects,
+ Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base, crt_objects,
};
pub(crate) fn target() -> Target {
@@ -34,7 +34,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs
index 2e2ea8f..7893fc7 100644
--- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnullvm::opts();
@@ -27,7 +29,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs
index 6a95afa..8f2746c 100644
--- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -32,7 +32,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs
index 1dfea64..6ff5f6d 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::freebsd::opts();
@@ -20,7 +22,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_haiku.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_haiku.rs
index ab32917..a5d4be4 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_haiku.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_haiku.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::haiku::opts();
@@ -20,7 +22,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_helenos.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_helenos.rs
index 1cd32d6..c653f43 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_helenos.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_helenos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, Target, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, RustcAbi, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::helenos::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs
index b01f93f..cf65bdd 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::hurd_gnu::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
index c70c026..932f603 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
+ base,
};
pub(crate) fn target() -> Target {
@@ -34,7 +35,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
index b6b85f5..5c85a3e 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata,
+ base,
};
pub(crate) fn target() -> Target {
@@ -40,7 +41,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_netbsd.rs
index cbd61ca..8cecc2b 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_netbsd.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, TargetOptions,
+ base,
};
pub(crate) fn target() -> Target {
@@ -22,7 +23,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: TargetOptions { mcount: "__mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs
index 48f7be7..572dedb 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::openbsd::opts();
@@ -20,7 +22,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs
index 1a7923c..37b2020 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs
@@ -5,7 +5,7 @@
// The cdecl ABI is used. It differs from the stdcall or fastcall ABI.
// "i686-unknown-windows" is used to get the minimal subset of windows-specific features.
-use crate::spec::{LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, add_link_args, base};
+use crate::spec::{Arch, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, add_link_args, base};
pub(crate) fn target() -> Target {
let mut base = base::uefi_msvc::opts();
@@ -96,7 +96,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs
index d95f779..bf2608f 100644
--- a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_gnu::opts();
@@ -27,7 +29,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_msvc.rs
index fa7a103..e6d2916 100644
--- a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{RustcAbi, Target, TargetMetadata, base};
+use crate::spec::{Arch, RustcAbi, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_msvc::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs
index f364c2c..c026f91 100644
--- a/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnu::opts();
@@ -29,7 +31,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
index 91ab311..68131bf 100644
--- a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -39,7 +39,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs
index 63ede7b..9ce61da 100644
--- a/compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::vxworks::opts();
@@ -20,7 +22,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i128:128-f64:32:64-f80:32-n8:16:32-S128"
.into(),
- arch: "x86".into(),
+ arch: Arch::X86,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none.rs b/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none.rs
index fb4963b..d9a4708 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
- arch: "loongarch32".into(),
+ arch: Arch::LoongArch32,
options: TargetOptions {
cpu: "generic".into(),
features: "+f,+d".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none_softfloat.rs
index 0e65f83..4ac9241 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none_softfloat.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch32_unknown_none_softfloat.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
- arch: "loongarch32".into(),
+ arch: Arch::LoongArch32,
options: TargetOptions {
cpu: "generic".into(),
features: "-f,-d".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
index 9e743a35..255756b 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "loongarch64".into(),
+ arch: Arch::LoongArch64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs
index d9010b1..74b0efd 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "loongarch64".into(),
+ arch: Arch::LoongArch64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs
index c1c859e..222cf5c 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "loongarch64".into(),
+ arch: Arch::LoongArch64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
index b6a0895..d8b5095 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "loongarch64".into(),
+ arch: Arch::LoongArch64,
options: TargetOptions {
cpu: "generic".into(),
features: "+f,+d,-lsx".into(),
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
index 2498390..e33d8c9 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
TargetOptions,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "loongarch64".into(),
+ arch: Arch::LoongArch64,
options: TargetOptions {
cpu: "generic".into(),
features: "-f,-d".into(),
diff --git a/compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs
index 9bd02e8..75bb02c 100644
--- a/compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{LinkSelfContainedDefault, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, LinkSelfContainedDefault, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),
- arch: "m68k".into(),
+ arch: Arch::M68k,
options: TargetOptions {
endian: Endian::Big,
mcount: "_mcount".into(),
diff --git a/compiler/rustc_target/src/spec/targets/m68k_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/m68k_unknown_none_elf.rs
index 6b66052..5686934 100644
--- a/compiler/rustc_target/src/spec/targets/m68k_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/m68k_unknown_none_elf.rs
@@ -1,6 +1,8 @@
use rustc_abi::Endian;
-use crate::spec::{CodeModel, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions};
+use crate::spec::{
+ Arch, CodeModel, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+};
pub(crate) fn target() -> Target {
let options = TargetOptions {
@@ -28,7 +30,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),
- arch: "m68k".into(),
+ arch: Arch::M68k,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs b/compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs
index eb1148d..0cd9342 100644
--- a/compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs
@@ -2,7 +2,7 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64".into(),
+ arch: Arch::Mips64,
options: TargetOptions {
vendor: "openwrt".into(),
abi: "abi64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs
index a26350f..4d06466 100644
--- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64".into(),
+ arch: Arch::Mips64,
options: TargetOptions {
abi: "abi64".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
index e54628a..a37508c 100644
--- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64".into(),
+ arch: Arch::Mips64,
options: TargetOptions {
abi: "abi64".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
index 19bcead..9ece84e 100644
--- a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64".into(),
+ arch: Arch::Mips64,
options: TargetOptions {
abi: "abi64".into(),
// NOTE(mips64r2) matches C toolchain
diff --git a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs
index a256733..759a04d 100644
--- a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64".into(),
+ arch: Arch::Mips64,
options: TargetOptions {
abi: "abi64".into(),
mcount: "_mcount".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mips_mti_none_elf.rs b/compiler/rustc_target/src/spec/targets/mips_mti_none_elf.rs
index def1212..5403992 100644
--- a/compiler/rustc_target/src/spec/targets/mips_mti_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/mips_mti_none_elf.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
std: None, // ?
},
pointer_width: 32,
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
vendor: "mti".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs
index 29a451b..ea6e237 100644
--- a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
endian: Endian::Big,
cpu: "mips32r2".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs
index 2d258d7..ab68c24 100644
--- a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs
index c14bfbf..c699f7e 100644
--- a/compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs
+++ b/compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
endian: Endian::Big,
cpu: "mips32r2".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_mti_none_elf.rs b/compiler/rustc_target/src/spec/targets/mipsel_mti_none_elf.rs
index cc9c19e..06c4d14 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_mti_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_mti_none_elf.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
std: None, // ?
},
pointer_width: 32,
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
vendor: "mti".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs b/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs
index 37ebb3d..200735f 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+};
// The PSP has custom linker requirements.
const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld");
@@ -19,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
os: "psp".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_sony_psx.rs b/compiler/rustc_target/src/spec/targets/mipsel_sony_psx.rs
index 8475a43..b6d30be 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_sony_psx.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_sony_psx.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ cvs,
};
pub(crate) fn target() -> Target {
@@ -13,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
// The Playstation 1 is mostly bare-metal, but the BIOS does provide some a slight bit
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs
index 6c7ea5c..79a22e5 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
cpu: "mips32r2".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs
index f4fb6be..8c64b17 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions { mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs
index f005679..295b178 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
cpu: "mips32r2".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs
index 502d738..69b232d 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::netbsd::opts();
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
features: "+soft-float".into(),
mcount: "__mcount".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsel_unknown_none.rs b/compiler/rustc_target/src/spec/targets/mipsel_unknown_none.rs
index 6a201c5..7012651 100644
--- a/compiler/rustc_target/src/spec/targets/mipsel_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsel_unknown_none.rs
@@ -3,7 +3,7 @@
//! Can be used for MIPS M4K core (e.g. on PIC32MX devices)
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips".into(),
+ arch: Arch::Mips,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs
index 0716f2e..b455114 100644
--- a/compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips32r6".into(),
+ arch: Arch::Mips32r6,
options: TargetOptions {
endian: Endian::Big,
cpu: "mips32r6".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs
index 81f2424..3684502 100644
--- a/compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
- arch: "mips32r6".into(),
+ arch: Arch::Mips32r6,
options: TargetOptions {
cpu: "mips32r6".into(),
diff --git a/compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs b/compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs
index cdd5f6b..3a95f78 100644
--- a/compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64r6".into(),
+ arch: Arch::Mips64r6,
options: TargetOptions {
abi: "abi64".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs b/compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs
index 88879a2..8e5bf3d 100644
--- a/compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
- arch: "mips64r6".into(),
+ arch: Arch::Mips64r6,
options: TargetOptions {
abi: "abi64".into(),
// NOTE(mips64r6) matches C toolchain
diff --git a/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs b/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
index caf77bb..d8cee79 100644
--- a/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 16,
data_layout: "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16".into(),
- arch: "msp430".into(),
+ arch: Arch::Msp430,
options: TargetOptions {
c_int_width: 16,
diff --git a/compiler/rustc_target/src/spec/targets/nvptx64_nvidia_cuda.rs b/compiler/rustc_target/src/spec/targets/nvptx64_nvidia_cuda.rs
index cada0dd..ac2d31a 100644
--- a/compiler/rustc_target/src/spec/targets/nvptx64_nvidia_cuda.rs
+++ b/compiler/rustc_target/src/spec/targets/nvptx64_nvidia_cuda.rs
@@ -1,11 +1,11 @@
use crate::spec::{
- LinkSelfContainedDefault, LinkerFlavor, MergeFunctions, PanicStrategy, Target, TargetMetadata,
- TargetOptions,
+ Arch, LinkSelfContainedDefault, LinkerFlavor, MergeFunctions, PanicStrategy, Target,
+ TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
Target {
- arch: "nvptx64".into(),
+ arch: Arch::Nvptx64,
data_layout: "e-p6:32:32-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64".into(),
llvm_target: "nvptx64-nvidia-cuda".into(),
metadata: TargetMetadata {
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs b/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs
index a140518..b4f3946 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::aix::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:a-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs
index b01ca98..de94d20 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs
index bc7e445..18a3f05 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
index 8fb991d..64d4f58 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_openbsd.rs
index 9dc44aa..1034a16 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_openbsd.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs
index 10072f8..fb40316 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs
index a7f4e0e..7ae74dc 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
index af5704b..4d1e3df 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
index 0f8b78f..3813e29 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
- arch: "powerpc64".into(),
+ arch: Arch::PowerPC64,
options: TargetOptions { mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs
index 5e1161e..54f490e 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions {
endian: Endian::Big,
features: "+secure-plt".into(),
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_helenos.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_helenos.rs
index 2b713e8..9e06faa 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_helenos.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_helenos.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::helenos::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs
index 6cde4bd..aa2b694 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions {
endian: Endian::Big,
features: "+secure-plt".into(),
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs
index 3c1d18e..8bbed94 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions {
abi: "spe".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
index f5c7cb0..7e494e0 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
index 8ddb454..0b6535e 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions {
abi: "spe".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_netbsd.rs
index 47a61a1a..62e50bb 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_netbsd.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions { endian: Endian::Big, mcount: "__mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs
index bc5a50a..59fccb5 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::openbsd::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs
index ca78be2..6c58775 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions { endian: Endian::Big, features: "+secure-plt".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs b/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs
index e634562..85de246 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
- arch: "powerpc".into(),
+ arch: Arch::PowerPC,
options: TargetOptions {
abi: "spe".into(),
endian: Endian::Big,
diff --git a/compiler/rustc_target/src/spec/targets/riscv32_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/riscv32_wrs_vxworks.rs
index efc17d8..3ec8891 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32_wrs_vxworks.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
cpu: "generic-rv32".into(),
llvm_abiname: "ilp32d".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs
index 00e8532..1f8b2ca 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
abi: abi.into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs
index f814201..1ae868e 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
abi: abi.into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs
index 33df429..e0958e0 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
abi: abi.into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs
index 5b7feef..29b0f35 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv32".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
index a13bb17..2811605 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv32".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32i_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32i_unknown_none_elf.rs
index f9a3b21..bd6375f 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32i_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32i_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs
index 162f21c4..c037203 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: None, // ?
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
os: "zkvm".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32im_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32im_unknown_none_elf.rs
index 47b408a..5aef58b 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32im_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32im_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32ima_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32ima_unknown_none_elf.rs
index a173fb0..c455f65 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32ima_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32ima_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs b/compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs
index 48db9f4..6b3e5a4 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_none_elf.rs
index 1608f05..deca348 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_nuttx_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_nuttx_elf.rs
index 4ee02c6..70eb7cb 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_nuttx_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_nuttx_elf.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ cvs,
};
pub(crate) fn target() -> Target {
@@ -13,7 +14,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_xous_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_xous_elf.rs
index 0893bd5..e50de1c 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_xous_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imac_unknown_xous_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: None, // ?
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
os: "xous".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imafc_esp_espidf.rs b/compiler/rustc_target/src/spec/targets/riscv32imafc_esp_espidf.rs
index 0929af7..196a3de 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imafc_esp_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imafc_esp_espidf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_none_elf.rs
index 44a84d9..21f6835 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_nuttx_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_nuttx_elf.rs
index 8908c0c..f7b8bd4 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_nuttx_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_nuttx_elf.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ cvs,
};
pub(crate) fn target() -> Target {
@@ -13,7 +14,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imc_esp_espidf.rs b/compiler/rustc_target/src/spec/targets/riscv32imc_esp_espidf.rs
index 82a4d58..66c6466 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imc_esp_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imc_esp_espidf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_none_elf.rs
index 755ffc6..0b8e447 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_nuttx_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_nuttx_elf.rs
index 8da0b0e..a10ddb2 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_nuttx_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32imc_unknown_nuttx_elf.rs
@@ -1,5 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ cvs,
};
pub(crate) fn target() -> Target {
@@ -13,7 +14,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 32,
- arch: "riscv32".into(),
+ arch: Arch::RiscV32,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs b/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs
index b9176c9..404f414 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs
@@ -1,7 +1,7 @@
use std::borrow::Cow;
use crate::spec::{
- CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
+ Arch, CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/riscv64_wrs_vxworks.rs
index 8d8c219..c6fffc25 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64_wrs_vxworks.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
cpu: "generic-rv64".into(),
llvm_abiname: "lp64d".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64a23_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/riscv64a23_unknown_linux_gnu.rs
index 60f2e7d..39db793 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64a23_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64a23_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs
index e628095..dbcfbc3 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs
index c4466e1..c3a45254 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, CodeModel, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::fuchsia::opts();
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_hermit.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_hermit.rs
index 5c15bdd..68f6904 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_hermit.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_hermit.rs
@@ -1,4 +1,6 @@
-use crate::spec::{CodeModel, RelocModel, Target, TargetMetadata, TargetOptions, TlsModel, base};
+use crate::spec::{
+ Arch, CodeModel, RelocModel, Target, TargetMetadata, TargetOptions, TlsModel, base,
+};
pub(crate) fn target() -> Target {
Target {
@@ -10,7 +12,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
options: TargetOptions {
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs
index af2f42f..333a63a 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs
index 83fd4e2..f5d647d 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_managarm_mlibc.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_managarm_mlibc.rs
index abf2831..a9ecf27 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_managarm_mlibc.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_managarm_mlibc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, Target, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, Target, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_netbsd.rs
index 1f359d1..bc929a0 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_netbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_none_elf.rs
index 5a5aad9..b06727e 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
TargetMetadata, TargetOptions,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
llvm_target: "riscv64".into(),
pointer_width: 64,
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_nuttx_elf.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_nuttx_elf.rs
index e8abc92..93dd6dc 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_nuttx_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_nuttx_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
TargetMetadata, TargetOptions, cvs,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
llvm_target: "riscv64".into(),
pointer_width: 64,
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_openbsd.rs
index 85d7dfe..fb7b077 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_openbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_redox.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_redox.rs
index 01276a8..b6e8864 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_redox.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_redox.rs
@@ -1,4 +1,4 @@
-use crate::spec::{CodeModel, Target, TargetMetadata, base};
+use crate::spec::{Arch, CodeModel, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::redox::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_none_elf.rs
index 5c5d4aa..60ee41b 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_none_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
TargetMetadata, TargetOptions,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 64,
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
diff --git a/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs b/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs
index 0928250..25e3e72 100644
--- a/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
TargetMetadata, TargetOptions, cvs,
};
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
llvm_target: "riscv64".into(),
pointer_width: 64,
- arch: "riscv64".into(),
+ arch: Arch::RiscV64,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
index cdcf7d6..a64e867 100644
--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::{Align, Endian};
-use crate::spec::{SanitizerSet, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
- arch: "s390x".into(),
+ arch: Arch::S390x,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
index 509105a..69c25d7 100644
--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
@@ -1,6 +1,6 @@
use rustc_abi::{Align, Endian};
-use crate::spec::{SanitizerSet, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts();
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
- arch: "s390x".into(),
+ arch: Arch::S390x,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparc64_unknown_helenos.rs b/compiler/rustc_target/src/spec/targets/sparc64_unknown_helenos.rs
index 8c3def5..c5d5657 100644
--- a/compiler/rustc_target/src/spec/targets/sparc64_unknown_helenos.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc64_unknown_helenos.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::helenos::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
- arch: "sparc64".into(),
+ arch: Arch::Sparc64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/sparc64_unknown_linux_gnu.rs
index a52dadb..b6c06af 100644
--- a/compiler/rustc_target/src/spec/targets/sparc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc64_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
- arch: "sparc64".into(),
+ arch: Arch::Sparc64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs
index 21eedc5..8f95528 100644
--- a/compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::netbsd::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
- arch: "sparc64".into(),
+ arch: Arch::Sparc64,
options: TargetOptions { endian: Endian::Big, mcount: "__mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparc64_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/sparc64_unknown_openbsd.rs
index b573bdf..6adabec 100644
--- a/compiler/rustc_target/src/spec/targets/sparc64_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc64_unknown_openbsd.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::openbsd::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
- arch: "sparc64".into(),
+ arch: Arch::Sparc64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs
index ffef696..f110acf 100644
--- a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64".into(),
- arch: "sparc".into(),
+ arch: Arch::Sparc,
options: TargetOptions {
features: "+v8plus".into(),
cpu: "v9".into(),
diff --git a/compiler/rustc_target/src/spec/targets/sparc_unknown_none_elf.rs b/compiler/rustc_target/src/spec/targets/sparc_unknown_none_elf.rs
index c2f6499..de60633 100644
--- a/compiler/rustc_target/src/spec/targets/sparc_unknown_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/sparc_unknown_none_elf.rs
@@ -1,7 +1,7 @@
use rustc_abi::Endian;
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -29,7 +29,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "sparc".into(),
+ arch: Arch::Sparc,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/sparcv9_sun_solaris.rs b/compiler/rustc_target/src/spec/targets/sparcv9_sun_solaris.rs
index 1c53e15..79035c7 100644
--- a/compiler/rustc_target/src/spec/targets/sparcv9_sun_solaris.rs
+++ b/compiler/rustc_target/src/spec/targets/sparcv9_sun_solaris.rs
@@ -1,6 +1,6 @@
use rustc_abi::Endian;
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::solaris::opts();
@@ -25,7 +25,7 @@ pub(crate) fn target() -> Target {
// used widely in the source base. If we ever needed ABI
// differentiation from the sparc64, we could, but that would probably
// just be confusing.
- arch: "sparc64".into(),
+ arch: Arch::Sparc64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv4t_none_eabi.rs
index 7221bd8..7a183bf 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv4t_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv4t_none_eabi.rs
@@ -10,8 +10,8 @@
//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
use crate::spec::{
- FloatAbi, FramePointer, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, base,
- cvs,
+ Arch, FloatAbi, FramePointer, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ base, cvs,
};
pub(crate) fn target() -> Target {
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "arm".into(),
+ arch: Arch::Arm,
/* Data layout args are '-' separated:
* little endian
* stack is 64-bit aligned (EABI)
diff --git a/compiler/rustc_target/src/spec/targets/thumbv5te_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv5te_none_eabi.rs
index 155e252..b20be27 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv5te_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv5te_none_eabi.rs
@@ -1,6 +1,6 @@
//! Targets the ARMv5TE, with code as `t32` code by default.
-use crate::spec::{FloatAbi, FramePointer, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, FramePointer, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
std: Some(false),
},
pointer_width: 32,
- arch: "arm".into(),
+ arch: Arch::Arm,
/* Data layout args are '-' separated:
* little endian
* stack is 64-bit aligned (EABI)
diff --git a/compiler/rustc_target/src/spec/targets/thumbv6m_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv6m_none_eabi.rs
index 3b4b94d..684e465 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv6m_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv6m_none_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M0, Cortex-M0+ and Cortex-M1 processors (ARMv6-M architecture)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv6m_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv6m_nuttx_eabi.rs
index 3c6133d..c0dd931 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv6m_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv6m_nuttx_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M0, Cortex-M0+ and Cortex-M1 processors (ARMv6-M architecture)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabi.rs
index 5660f97..335c4c1 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabi.rs
@@ -4,7 +4,7 @@
// and will use software floating point operations. This matches the NuttX EABI
// configuration without hardware floating point support.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabihf.rs
index d79970b..0a0dbaf 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7a_nuttx_eabihf.rs
@@ -7,7 +7,7 @@
// This target uses the "hard" floating convention (ABI) where floating point values
// are passed to/from subroutines via FPU registers (S0, S1, D0, D1, etc.).
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs
index 33da885..808fae3 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- FloatAbi, LinkerFlavor, Lld, PanicStrategy, Target, TargetMetadata, TargetOptions, base,
+ Arch, FloatAbi, LinkerFlavor, Lld, PanicStrategy, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3,+neon".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7a_uwp_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/thumbv7a_uwp_windows_msvc.rs
index b4cc960..d9ad392 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7a_uwp_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7a_uwp_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, PanicStrategy, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, PanicStrategy, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3,+neon".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabi.rs
index c747d72..c67e955 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabi.rs
@@ -9,7 +9,7 @@
// To opt-in to hardware accelerated floating point operations, you can use, for example,
// `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs
index 309d320..9a05209 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs
@@ -8,7 +8,7 @@
//
// To opt into double precision hardware support, use the `-C target-feature=+fp64` flag.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabi.rs
index 57ef4e7..7888587 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabi.rs
@@ -9,7 +9,7 @@
// To opt-in to hardware accelerated floating point operations, you can use, for example,
// `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabihf.rs
index 0518872..51e57f7 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabihf.rs
@@ -8,7 +8,7 @@
//
// To opt into double precision hardware support, use the `-C target-feature=+fp64` flag.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs
index f261009..fea5f15 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M3 processor (ARMv7-M)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs
index 611795e..50ab8c5 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M3 processor (ARMv7-M)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7neon_linux_androideabi.rs b/compiler/rustc_target/src/spec/targets/thumbv7neon_linux_androideabi.rs
index d3a2516..cc6f26d 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7neon_linux_androideabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7neon_linux_androideabi.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{
+ Arch, Cc, FloatAbi, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base,
+};
// This target if is for the Android v7a ABI in thumb mode with
// NEON unconditionally enabled and, therefore, with 32 FPU registers
@@ -21,7 +23,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
llvm_floatabi: Some(FloatAbi::Soft),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_gnueabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_gnueabihf.rs
index cce49f2..9abbec8 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_gnueabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_gnueabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on ARMv7 with thumb mode enabled
// (for consistency with Android and Debian-based distributions)
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
llvm_floatabi: Some(FloatAbi::Hard),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
index d58339b..e823917 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
@@ -1,4 +1,4 @@
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
// This target is for musl Linux on ARMv7 with thumb mode enabled
// (for consistency with Android and Debian-based distributions)
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
// Most of these settings are copied from the thumbv7neon_unknown_linux_gnueabihf
// target.
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_base_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_base_none_eabi.rs
index b35f7ba..aca7441 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_base_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_base_none_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M23 processor (Baseline ARMv8-M)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_base_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_base_nuttx_eabi.rs
index 4e5f689..26bf14d 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_base_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_base_nuttx_eabi.rs
@@ -1,6 +1,6 @@
// Targets the Cortex-M23 processor (Baseline ARMv8-M)
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabi.rs
index 3814390..e1cc16a 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabi.rs
@@ -1,7 +1,7 @@
// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
// without the Floating Point extension.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabi".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabihf.rs
index 55b7561..cd3d332 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabihf.rs
@@ -1,7 +1,7 @@
// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
// with the Floating Point extension.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
abi: "eabihf".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabi.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabi.rs
index 56aca0a..1fae7a9 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabi.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabi.rs
@@ -1,7 +1,7 @@
// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
// without the Floating Point extension.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabihf.rs
index 47525e7..b8de91e 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabihf.rs
@@ -1,7 +1,7 @@
// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
// with the Floating Point extension.
-use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
+use crate::spec::{Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs};
pub(crate) fn target() -> Target {
Target {
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
- arch: "arm".into(),
+ arch: Arch::Arm,
options: TargetOptions {
families: cvs!["unix"],
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
index 4624c0f..aa4a1be 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
@@ -1,6 +1,6 @@
use crate::spec::{
- LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, base,
- cvs,
+ Arch, LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
+ base, cvs,
};
pub(crate) fn target() -> Target {
@@ -35,7 +35,7 @@ pub(crate) fn target() -> Target {
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-S128-ni:1:10:20"
.into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs b/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs
index b579273..3050f17 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs
@@ -10,7 +10,7 @@
//! This target is more or less managed by the Rust and WebAssembly Working
//! Group nowadays at <https://github.com/rustwasm>.
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut options = base::wasm::options();
@@ -44,7 +44,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wali_linux_musl.rs b/compiler/rustc_target/src/spec/targets/wasm32_wali_linux_musl.rs
index 06e5cfa..9e4121d 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_wali_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wali_linux_musl.rs
@@ -1,7 +1,7 @@
//! The `wasm32-wali-linux-musl` target is a wasm32 target compliant with the
//! [WebAssembly Linux Interface](https://github.com/arjunr2/WALI).
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut options = base::linux_wasm::opts();
@@ -30,7 +30,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
index 26add45..a7c196c 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
@@ -11,7 +11,7 @@
//! introduced.
use crate::spec::{
- Cc, LinkSelfContainedDefault, LinkerFlavor, Target, TargetMetadata, base, crt_objects,
+ Arch, Cc, LinkSelfContainedDefault, LinkerFlavor, Target, TargetMetadata, base, crt_objects,
};
pub(crate) fn target() -> Target {
@@ -58,7 +58,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs
index c735c72..d4953cc 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs
@@ -8,7 +8,7 @@
//! Historically this target was known as `wasm32-wasi-preview1-threads`.
use crate::spec::{
- Cc, LinkSelfContainedDefault, LinkerFlavor, Target, TargetMetadata, base, crt_objects,
+ Arch, Cc, LinkSelfContainedDefault, LinkerFlavor, Target, TargetMetadata, base, crt_objects,
};
pub(crate) fn target() -> Target {
@@ -72,7 +72,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs
index 7ad675d..717d490 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs
@@ -17,7 +17,7 @@
//! <https://github.com/WebAssembly/component-model>.
use crate::spec::{
- LinkSelfContainedDefault, RelocModel, Target, TargetMetadata, base, crt_objects,
+ Arch, LinkSelfContainedDefault, RelocModel, Target, TargetMetadata, base, crt_objects,
};
pub(crate) fn target() -> Target {
@@ -69,7 +69,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs b/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs
index e554e2a..41267f0 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs
@@ -12,7 +12,7 @@
//! nightly Rust feature `-Zbuild-std`. This target is for people who want to
//! use stable Rust, and target a stable set pf WebAssembly features.
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut options = base::wasm::options();
@@ -51,7 +51,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm32".into(),
+ arch: Arch::Wasm32,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs b/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs
index e8ac93a..850e855 100644
--- a/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs
@@ -7,7 +7,7 @@
//! the standard library is available, most of it returns an error immediately
//! (e.g. trying to create a TCP stream or something like that).
-use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut options = base::wasm::options();
@@ -47,7 +47,7 @@ pub(crate) fn target() -> Target {
},
pointer_width: 64,
data_layout: "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
- arch: "wasm64".into(),
+ arch: Arch::Wasm64,
options,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs b/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs
index bbaee6c..6232de4 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
let pre_link_args = TargetOptions::link_args(
@@ -83,7 +83,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_linux_android.rs b/compiler/rustc_target/src/spec/targets/x86_64_linux_android.rs
index 3a0acaa..93d77b9 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_linux_android.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_linux_android.rs
@@ -1,6 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions,
- base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata,
+ TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -25,7 +25,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_lynx_lynxos178.rs b/compiler/rustc_target/src/spec/targets/x86_64_lynx_lynxos178.rs
index 654ae7c..933e716 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_lynx_lynxos178.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_lynx_lynxos178.rs
@@ -1,4 +1,4 @@
-use crate::spec::{SanitizerSet, StackProbeType, Target, base};
+use crate::spec::{Arch, SanitizerSet, StackProbeType, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::lynxos178::opts();
@@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_cygwin.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_cygwin.rs
index eac4caf..1d7ecc2 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_pc_cygwin.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_cygwin.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::cygwin::opts();
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
metadata: crate::spec::TargetMetadata {
description: Some("64-bit x86 Cygwin".into()),
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_solaris.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_solaris.rs
index 662bbc4..7b8d5de 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_pc_solaris.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_solaris.rs
@@ -1,4 +1,6 @@
-use crate::spec::{Cc, LinkerFlavor, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{
+ Arch, Cc, LinkerFlavor, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+};
pub(crate) fn target() -> Target {
let mut base = base::solaris::opts();
@@ -21,7 +23,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs
index 16bdd3e..ba0882b 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnu::opts();
@@ -25,7 +25,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs
index 1a03390..28c9e62 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnullvm::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs
index d88aaba..1eecec8 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unikraft_linux_musl.rs b/compiler/rustc_target/src/spec/targets/x86_64_unikraft_linux_musl.rs
index f5bc3ab..c5421f3 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unikraft_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unikraft_linux_musl.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
+ Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
options: TargetOptions {
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_dragonfly.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_dragonfly.rs
index 715c0db..99f10ca 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_dragonfly.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_dragonfly.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::dragonfly::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_freebsd.rs
index 4a07453..3043fd2 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_freebsd.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_freebsd.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_fuchsia.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_fuchsia.rs
index d7253da..0d92097 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_fuchsia.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_fuchsia.rs
@@ -1,4 +1,4 @@
-use crate::spec::{SanitizerSet, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::fuchsia::opts();
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_haiku.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_haiku.rs
index ecb9fc8..8565937 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_haiku.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_haiku.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::haiku::opts();
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_helenos.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_helenos.rs
index 82c9807..42e46fa 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_helenos.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_helenos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::helenos::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_hermit.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_hermit.rs
index 7abde77..ee191ac 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_hermit.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_hermit.rs
@@ -1,4 +1,4 @@
-use crate::spec::{StackProbeType, Target, TargetMetadata, TargetOptions, base};
+use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
options: TargetOptions {
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_hurd_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_hurd_gnu.rs
index 57ce67a..cf28233 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_hurd_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_hurd_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::hurd_gnu::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_illumos.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_illumos.rs
index 17f90db..9510ed5 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_illumos.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_illumos.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::illumos::opts();
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_l4re_uclibc.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_l4re_uclibc.rs
index 4107249..5ab6b09 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_l4re_uclibc.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_l4re_uclibc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{PanicStrategy, Target, TargetMetadata, base};
+use crate::spec::{Arch, PanicStrategy, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::l4re::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
index 59bb7f5..adb7a43 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -31,7 +31,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnux32.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnux32.rs
index c5d556e..0b3e25b 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnux32.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnux32.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32:64-S128"
.into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs
index 3cb2a96..ee88353 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -30,7 +30,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs
index 896e8a7..ecf232f 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, PanicStrategy, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_ohos.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_ohos.rs
index de9027b..c6c55c1 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_ohos.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_ohos.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
@@ -27,7 +27,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_managarm_mlibc.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_managarm_mlibc.rs
index 359e38c..98997c9 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_managarm_mlibc.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_managarm_mlibc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::managarm_mlibc::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_motor.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_motor.rs
index 0fd4335..3be05b7 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_motor.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_motor.rs
@@ -1,5 +1,5 @@
use crate::spec::{
- CodeModel, LinkSelfContainedDefault, LldFlavor, RelocModel, RelroLevel, Target, base,
+ Arch, CodeModel, LinkSelfContainedDefault, LldFlavor, RelocModel, RelroLevel, Target, base,
};
pub(crate) fn target() -> Target {
@@ -32,7 +32,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs
index 0403c22..2561fe4 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs
@@ -1,6 +1,6 @@
use crate::spec::{
- Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions,
- base,
+ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata,
+ TargetOptions, base,
};
pub(crate) fn target() -> Target {
@@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: TargetOptions { mcount: "__mcount".into(), ..base },
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
index 1a63435..520a59d 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
@@ -5,7 +5,7 @@
// features.
use crate::spec::{
- Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelroLevel, RustcAbi, SanitizerSet,
+ Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelroLevel, RustcAbi, SanitizerSet,
StackProbeType, Target, TargetMetadata, TargetOptions,
};
@@ -39,7 +39,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: opts,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_openbsd.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_openbsd.rs
index 2eb09b8..c911de4 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_openbsd.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_openbsd.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::openbsd::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_redox.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_redox.rs
index 65b8e25..562beab 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_redox.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_redox.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::redox::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_trusty.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_trusty.rs
index dbcb5fd..88c66ff 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_trusty.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_trusty.rs
@@ -1,8 +1,8 @@
// Trusty OS target for X86_64.
use crate::spec::{
- LinkSelfContainedDefault, PanicStrategy, RelroLevel, StackProbeType, Target, TargetMetadata,
- TargetOptions,
+ Arch, LinkSelfContainedDefault, PanicStrategy, RelroLevel, StackProbeType, Target,
+ TargetMetadata, TargetOptions,
};
pub(crate) fn target() -> Target {
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: TargetOptions {
executables: true,
max_atomic_width: Some(64),
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
index 0cf6a87..8a494d0 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
@@ -7,7 +7,7 @@
use rustc_abi::{CanonAbi, X86Call};
-use crate::spec::{RustcAbi, Target, TargetMetadata, base};
+use crate::spec::{Arch, RustcAbi, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::uefi_msvc::opts();
@@ -40,7 +40,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs
index bf6179c..96d1bd2 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_gnu::opts();
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs
index 50b0578..3be6abd 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Target, TargetMetadata, base};
+use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_msvc::opts();
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs
index df1fe8e..22a1a12 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_gnu::opts();
@@ -25,7 +25,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs
index 876ac01..99b5915 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs
@@ -1,4 +1,4 @@
-use crate::spec::{SanitizerSet, Target, TargetMetadata, base};
+use crate::spec::{Arch, SanitizerSet, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs b/compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs
index 9ab62b3..0bc3749 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs
@@ -1,4 +1,4 @@
-use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
+use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::vxworks::opts();
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
- arch: "x86_64".into(),
+ arch: Arch::X86_64,
options: base,
}
}
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
index 8a67738..d909271 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
@@ -1,14 +1,14 @@
use rustc_abi::Endian;
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
options: TargetOptions {
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32_none_elf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32_none_elf.rs
index d8638e8..82c6e0c 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32_none_elf.rs
@@ -1,12 +1,12 @@
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata {
description: Some("Xtensa ESP32".into()),
tier: Some(3),
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
index f38d771..b1ed0ff 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
@@ -1,14 +1,14 @@
use rustc_abi::Endian;
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
options: TargetOptions {
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_none_elf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_none_elf.rs
index 7bf5834..755f4db 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_none_elf.rs
@@ -1,12 +1,12 @@
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata {
description: Some("Xtensa ESP32-S2".into()),
tier: Some(3),
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
index 4ec6e31..8e1fee4 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
@@ -1,14 +1,14 @@
use rustc_abi::Endian;
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions, cvs};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, cvs};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
options: TargetOptions {
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_none_elf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_none_elf.rs
index d506888..07530d8 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_none_elf.rs
@@ -1,12 +1,12 @@
use crate::spec::base::xtensa;
-use crate::spec::{Target, TargetMetadata, TargetOptions};
+use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
Target {
llvm_target: "xtensa-none-elf".into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
- arch: "xtensa".into(),
+ arch: Arch::Xtensa,
metadata: TargetMetadata {
description: Some("Xtensa ESP32-S3".into()),
tier: Some(3),
diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs
index 288ee63..fd95bd0 100644
--- a/compiler/rustc_target/src/target_features.rs
+++ b/compiler/rustc_target/src/target_features.rs
@@ -5,7 +5,7 @@
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::{Symbol, sym};
-use crate::spec::{FloatAbi, RustcAbi, Target};
+use crate::spec::{Arch, FloatAbi, RustcAbi, Target};
/// Features that control behaviour of rustc, rather than the codegen.
/// These exist globally and are not in the target-specific lists below.
@@ -955,50 +955,64 @@ pub struct FeatureConstraints {
impl Target {
pub fn rust_target_features(&self) -> &'static [(&'static str, Stability, ImpliedFeatures)] {
- match &*self.arch {
- "arm" => ARM_FEATURES,
- "aarch64" | "arm64ec" => AARCH64_FEATURES,
- "x86" | "x86_64" => X86_FEATURES,
- "hexagon" => HEXAGON_FEATURES,
- "mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_FEATURES,
- "nvptx64" => NVPTX_FEATURES,
- "powerpc" | "powerpc64" => POWERPC_FEATURES,
- "riscv32" | "riscv64" => RISCV_FEATURES,
- "wasm32" | "wasm64" => WASM_FEATURES,
- "bpf" => BPF_FEATURES,
- "csky" => CSKY_FEATURES,
- "loongarch32" | "loongarch64" => LOONGARCH_FEATURES,
- "s390x" => IBMZ_FEATURES,
- "sparc" | "sparc64" => SPARC_FEATURES,
- "m68k" => M68K_FEATURES,
- _ => &[],
+ match &self.arch {
+ Arch::Arm => ARM_FEATURES,
+ Arch::AArch64 | Arch::Arm64EC => AARCH64_FEATURES,
+ Arch::X86 | Arch::X86_64 => X86_FEATURES,
+ Arch::Hexagon => HEXAGON_FEATURES,
+ Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => MIPS_FEATURES,
+ Arch::Nvptx64 => NVPTX_FEATURES,
+ Arch::PowerPC | Arch::PowerPC64 => POWERPC_FEATURES,
+ Arch::RiscV32 | Arch::RiscV64 => RISCV_FEATURES,
+ Arch::Wasm32 | Arch::Wasm64 => WASM_FEATURES,
+ Arch::Bpf => BPF_FEATURES,
+ Arch::CSky => CSKY_FEATURES,
+ Arch::LoongArch32 | Arch::LoongArch64 => LOONGARCH_FEATURES,
+ Arch::S390x => IBMZ_FEATURES,
+ Arch::Sparc | Arch::Sparc64 => SPARC_FEATURES,
+ Arch::M68k => M68K_FEATURES,
+ Arch::AmdGpu
+ | Arch::Avr
+ | Arch::Msp430
+ | Arch::PowerPC64LE
+ | Arch::SpirV
+ | Arch::Xtensa
+ | Arch::Unknown(_) => &[],
}
}
pub fn features_for_correct_vector_abi(&self) -> &'static [(u64, &'static str)] {
- match &*self.arch {
- "x86" | "x86_64" => X86_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "aarch64" | "arm64ec" => AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "arm" => ARM_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "powerpc" | "powerpc64" => POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "loongarch32" | "loongarch64" => LOONGARCH_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "riscv32" | "riscv64" => RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "wasm32" | "wasm64" => WASM_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "s390x" => S390X_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "sparc" | "sparc64" => SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "hexagon" => HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_FEATURES_FOR_CORRECT_VECTOR_ABI,
- "nvptx64" | "bpf" | "m68k" => &[], // no vector ABI
- "csky" => CSKY_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ match &self.arch {
+ Arch::X86 | Arch::X86_64 => X86_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::AArch64 | Arch::Arm64EC => AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::Arm => ARM_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::PowerPC | Arch::PowerPC64 => POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::LoongArch32 | Arch::LoongArch64 => LOONGARCH_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::RiscV32 | Arch::RiscV64 => RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::Wasm32 | Arch::Wasm64 => WASM_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::S390x => S390X_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::Sparc | Arch::Sparc64 => SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::Hexagon => HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI,
+ Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => {
+ MIPS_FEATURES_FOR_CORRECT_VECTOR_ABI
+ }
+ Arch::Nvptx64 | Arch::Bpf | Arch::M68k => &[], // no vector ABI
+ Arch::CSky => CSKY_FEATURES_FOR_CORRECT_VECTOR_ABI,
// FIXME: for some tier3 targets, we are overly cautious and always give warnings
// when passing args in vector registers.
- _ => &[],
+ Arch::AmdGpu
+ | Arch::Avr
+ | Arch::Msp430
+ | Arch::PowerPC64LE
+ | Arch::SpirV
+ | Arch::Xtensa
+ | Arch::Unknown(_) => &[],
}
}
pub fn tied_target_features(&self) -> &'static [&'static [&'static str]] {
- match &*self.arch {
- "aarch64" | "arm64ec" => AARCH64_TIED_FEATURES,
+ match &self.arch {
+ Arch::AArch64 | Arch::Arm64EC => AARCH64_TIED_FEATURES,
_ => &[],
}
}
@@ -1038,8 +1052,8 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
// defined by target features. When that is the case, those target features must be
// "forbidden" in the list above to ensure that there is a consistent answer to the
// questions "which ABI is used".
- match &*self.arch {
- "x86" => {
+ match &self.arch {
+ Arch::X86 => {
// We use our own ABI indicator here; LLVM does not have anything native.
// Every case should require or forbid `soft-float`!
match self.rustc_abi {
@@ -1064,7 +1078,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
}
}
}
- "x86_64" => {
+ Arch::X86_64 => {
// We use our own ABI indicator here; LLVM does not have anything native.
// Every case should require or forbid `soft-float`!
match self.rustc_abi {
@@ -1085,7 +1099,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
Some(r) => panic!("invalid Rust ABI for x86_64: {r:?}"),
}
}
- "arm" => {
+ Arch::Arm => {
// On ARM, ABI handling is reasonably sane; we use `llvm_floatabi` to indicate
// to LLVM which ABI we are going for.
match self.llvm_floatabi.unwrap() {
@@ -1102,7 +1116,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
}
}
}
- "aarch64" | "arm64ec" => {
+ Arch::AArch64 | Arch::Arm64EC => {
// Aarch64 has no sane ABI specifier, and LLVM doesn't even have a way to force
// the use of soft-float, so all we can do here is some crude hacks.
match &*self.abi {
@@ -1121,7 +1135,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
}
}
}
- "riscv32" | "riscv64" => {
+ Arch::RiscV32 | Arch::RiscV64 => {
// RISC-V handles ABI in a very sane way, being fully explicit via `llvm_abiname`
// about what the intended ABI is.
match &*self.llvm_abiname {
@@ -1155,7 +1169,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
_ => unreachable!(),
}
}
- "loongarch32" | "loongarch64" => {
+ Arch::LoongArch32 | Arch::LoongArch64 => {
// LoongArch handles ABI in a very sane way, being fully explicit via `llvm_abiname`
// about what the intended ABI is.
match &*self.llvm_abiname {
@@ -1177,7 +1191,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
_ => unreachable!(),
}
}
- "s390x" => {
+ Arch::S390x => {
// We don't currently support a softfloat target on this architecture.
// As usual, we have to reject swapping the `soft-float` target feature.
// The "vector" target feature does not affect the ABI for floats
diff --git a/compiler/rustc_target/src/tests.rs b/compiler/rustc_target/src/tests.rs
index a2692ea..bb17dd1 100644
--- a/compiler/rustc_target/src/tests.rs
+++ b/compiler/rustc_target/src/tests.rs
@@ -1,3 +1,4 @@
+use crate::json::ToJson;
use crate::spec::Target;
#[test]
@@ -15,3 +16,27 @@ fn report_unused_fields() {
eprintln!("{result:#?}");
assert!(result.is_err());
}
+
+#[test]
+fn custom_arch_propagates_from_json() {
+ let json = r#"
+ {
+ "llvm-target": "x86_64-unknown-none-gnu",
+ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
+ "arch": "customarch",
+ "target-endian": "little",
+ "target-pointer-width": 64,
+ "os": "customos",
+ "linker-flavor": "ld.lld",
+ "linker": "rust-lld",
+ "executables": true
+ }
+ "#;
+ rustc_span::create_session_if_not_set_then(rustc_span::edition::DEFAULT_EDITION, |_| {
+ let (target, warnings) = Target::from_json(json).expect("json target parses");
+ assert!(warnings.warning_messages().is_empty());
+ assert_eq!(target.arch.desc(), "customarch");
+ let serialized = target.to_json();
+ assert_eq!(serialized["arch"], "customarch");
+ });
+}
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs
index 0f09e54..f98f161 100644
--- a/compiler/rustc_ty_utils/src/abi.rs
+++ b/compiler/rustc_ty_utils/src/abi.rs
@@ -1,3 +1,4 @@
+use std::assert_matches::assert_matches;
use std::iter;
use rustc_abi::Primitive::Pointer;
@@ -388,6 +389,12 @@ fn fn_arg_sanity_check<'tcx>(
if let PassMode::Indirect { on_stack, .. } = arg.mode {
assert!(!on_stack, "rust abi shouldn't use on_stack");
}
+ } else if arg.layout.pass_indirectly_in_non_rustic_abis(cx) {
+ assert_matches!(
+ arg.mode,
+ PassMode::Indirect { on_stack: false, .. },
+ "the {spec_abi} ABI does not implement `#[rustc_pass_indirectly_in_non_rustic_abis]`"
+ );
}
match &arg.mode {
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index b3c0953..3a935b9 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -639,8 +639,8 @@ fn layout_of_uncached<'tcx>(
// UnsafeCell and UnsafePinned both disable niche optimizations
let is_special_no_niche = def.is_unsafe_cell() || def.is_unsafe_pinned();
- let get_discriminant_type =
- |min, max| abi::Integer::repr_discr(tcx, ty, &def.repr(), min, max);
+ let discr_range_of_repr =
+ |min, max| abi::Integer::discr_range_of_repr(tcx, ty, &def.repr(), min, max);
let discriminants_iter = || {
def.is_enum()
@@ -663,7 +663,7 @@ fn layout_of_uncached<'tcx>(
def.is_enum(),
is_special_no_niche,
tcx.layout_scalar_valid_range(def.did()),
- get_discriminant_type,
+ discr_range_of_repr,
discriminants_iter(),
!maybe_unsized,
)
@@ -688,7 +688,7 @@ fn layout_of_uncached<'tcx>(
def.is_enum(),
is_special_no_niche,
tcx.layout_scalar_valid_range(def.did()),
- get_discriminant_type,
+ discr_range_of_repr,
discriminants_iter(),
!maybe_unsized,
) else {
diff --git a/compiler/rustc_ty_utils/src/layout/invariant.rs b/compiler/rustc_ty_utils/src/layout/invariant.rs
index b768269..d1484ae 100644
--- a/compiler/rustc_ty_utils/src/layout/invariant.rs
+++ b/compiler/rustc_ty_utils/src/layout/invariant.rs
@@ -14,6 +14,8 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou
if layout.size.bytes() >= tcx.data_layout.obj_size_bound() {
bug!("size is too large, in the following layout:\n{layout:#?}");
}
+ // FIXME(#124403): Once `repr_c_enums_larger_than_int` is a hard error, we could assert
+ // here that a repr(c) enum discriminant is never larger than a c_int.
if !cfg!(debug_assertions) {
// Stop here, the rest is kind of expensive.
diff --git a/compiler/rustc_type_ir_macros/Cargo.toml b/compiler/rustc_type_ir_macros/Cargo.toml
index 15a5557..14bffa4 100644
--- a/compiler/rustc_type_ir_macros/Cargo.toml
+++ b/compiler/rustc_type_ir_macros/Cargo.toml
@@ -10,6 +10,6 @@
# tidy-alphabetical-start
proc-macro2 = "1"
quote = "1"
-syn = { version = "2.0.9", features = ["full"] }
+syn = { version = "2.0.9", features = ["full", "visit-mut"] }
synstructure = "0.13.0"
# tidy-alphabetical-end
diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs
index 82eaf7d..4d6fe22 100644
--- a/library/alloc/src/fmt.rs
+++ b/library/alloc/src/fmt.rs
@@ -602,7 +602,7 @@
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::fmt::{Formatter, Result, Write};
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
pub use core::fmt::{FromFn, from_fn};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::fmt::{LowerExp, UpperExp};
diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs
index 46ccf33..3c9587d 100644
--- a/library/core/src/ffi/va_list.rs
+++ b/library/core/src/ffi/va_list.rs
@@ -299,3 +299,15 @@ fn drop(&mut self) {
// This works for now, since `va_end` is a no-op on all current LLVM targets.
}
}
+
+// Checks (via an assert in `compiler/rustc_ty_utils/src/abi.rs`) that the C ABI for the current
+// target correctly implements `rustc_pass_indirectly_in_non_rustic_abis`.
+const _: () = {
+ #[repr(C)]
+ #[rustc_pass_indirectly_in_non_rustic_abis]
+ struct Type(usize);
+
+ const extern "C" fn c(_: Type) {}
+
+ c(Type(0))
+};
diff --git a/library/core/src/fmt/builders.rs b/library/core/src/fmt/builders.rs
index 665b05b..4ea6c6b 100644
--- a/library/core/src/fmt/builders.rs
+++ b/library/core/src/fmt/builders.rs
@@ -1210,13 +1210,12 @@ fn is_pretty(&self) -> bool {
}
}
-/// Creates a type whose [`fmt::Debug`] and [`fmt::Display`] impls are provided with the function
-/// `f`.
+/// Creates a type whose [`fmt::Debug`] and [`fmt::Display`] impls are
+/// forwarded to the provided closure.
///
/// # Examples
///
/// ```
-/// #![feature(debug_closure_helpers)]
/// use std::fmt;
///
/// let value = 'a';
@@ -1227,21 +1226,19 @@ fn is_pretty(&self) -> bool {
/// assert_eq!(format!("{}", wrapped), "'a'");
/// assert_eq!(format!("{:?}", wrapped), "'a'");
/// ```
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
FromFn(f)
}
-/// Implements [`fmt::Debug`] and [`fmt::Display`] using a function.
+/// Implements [`fmt::Debug`] and [`fmt::Display`] via the provided closure.
///
/// Created with [`from_fn`].
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
-pub struct FromFn<F>(F)
-where
- F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result;
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
+pub struct FromFn<F>(F);
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
impl<F> fmt::Debug for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result,
@@ -1251,7 +1248,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
impl<F> fmt::Display for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result,
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index 0f255e5..502ca4a 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -39,7 +39,7 @@ pub enum Alignment {
#[stable(feature = "debug_builders", since = "1.2.0")]
pub use self::builders::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
-#[unstable(feature = "debug_closure_helpers", issue = "117729")]
+#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
pub use self::builders::{FromFn, from_fn};
/// The type returned by formatter methods.
diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs
index 1948808..c56e04b 100644
--- a/library/core/src/intrinsics/simd.rs
+++ b/library/core/src/intrinsics/simd.rs
@@ -2,6 +2,8 @@
//!
//! In this module, a "vector" is any `repr(simd)` type.
+use crate::marker::ConstParamTy;
+
/// Inserts an element into a vector, returning the updated vector.
///
/// `T` must be a vector with element type `U`, and `idx` must be `const`.
@@ -377,6 +379,19 @@ pub unsafe fn simd_extract_dyn<T, U>(x: T, idx: u32) -> U {
#[rustc_nounwind]
pub unsafe fn simd_scatter<T, U, V>(val: T, ptr: U, mask: V);
+/// A type for alignment options for SIMD masked load/store intrinsics.
+#[derive(Debug, ConstParamTy, PartialEq, Eq)]
+pub enum SimdAlign {
+ // These values must match the compiler's `SimdAlign` defined in
+ // `rustc_middle/src/ty/consts/int.rs`!
+ /// No alignment requirements on the pointer
+ Unaligned = 0,
+ /// The pointer must be aligned to the element type of the SIMD vector
+ Element = 1,
+ /// The pointer must be aligned to the SIMD vector type
+ Vector = 2,
+}
+
/// Reads a vector of pointers.
///
/// `T` must be a vector.
@@ -392,13 +407,12 @@ pub unsafe fn simd_extract_dyn<T, U>(x: T, idx: u32) -> U {
/// `val`.
///
/// # Safety
-/// Unmasked values in `T` must be readable as if by `<ptr>::read` (e.g. aligned to the element
-/// type).
+/// `ptr` must be aligned according to the `ALIGN` parameter, see [`SimdAlign`] for details.
///
/// `mask` must only contain `0` or `!0` values.
#[rustc_intrinsic]
#[rustc_nounwind]
-pub unsafe fn simd_masked_load<V, U, T>(mask: V, ptr: U, val: T) -> T;
+pub unsafe fn simd_masked_load<V, U, T, const ALIGN: SimdAlign>(mask: V, ptr: U, val: T) -> T;
/// Writes to a vector of pointers.
///
@@ -414,13 +428,12 @@ pub unsafe fn simd_extract_dyn<T, U>(x: T, idx: u32) -> U {
/// Otherwise if the corresponding value in `mask` is `0`, do nothing.
///
/// # Safety
-/// Unmasked values in `T` must be writeable as if by `<ptr>::write` (e.g. aligned to the element
-/// type).
+/// `ptr` must be aligned according to the `ALIGN` parameter, see [`SimdAlign`] for details.
///
/// `mask` must only contain `0` or `!0` values.
#[rustc_intrinsic]
#[rustc_nounwind]
-pub unsafe fn simd_masked_store<V, U, T>(mask: V, ptr: U, val: T);
+pub unsafe fn simd_masked_store<V, U, T, const ALIGN: SimdAlign>(mask: V, ptr: U, val: T);
/// Adds two simd vectors elementwise, with saturation.
///
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs
index 97eb9ec..c22a9da 100644
--- a/library/core/src/task/wake.rs
+++ b/library/core/src/task/wake.rs
@@ -584,6 +584,28 @@ pub fn data(&self) -> *const () {
pub fn vtable(&self) -> &'static RawWakerVTable {
self.waker.vtable
}
+
+ /// Constructs a `Waker` from a function pointer.
+ #[inline]
+ #[must_use]
+ #[unstable(feature = "waker_from_fn_ptr", issue = "148457")]
+ pub const fn from_fn_ptr(f: fn()) -> Self {
+ // SAFETY: Unsafe is used for transmutes, pointer came from `fn()` so it
+ // is sound to transmute it back to `fn()`.
+ static VTABLE: RawWakerVTable = unsafe {
+ RawWakerVTable::new(
+ |this| RawWaker::new(this, &VTABLE),
+ |this| transmute::<*const (), fn()>(this)(),
+ |this| transmute::<*const (), fn()>(this)(),
+ |_| {},
+ )
+ };
+ let raw = RawWaker::new(f as *const (), &VTABLE);
+
+ // SAFETY: `clone` is just a copy, `drop` is a no-op while `wake` and
+ // `wake_by_ref` just call the function pointer.
+ unsafe { Self::from_raw(raw) }
+ }
}
#[stable(feature = "futures_api", since = "1.36.0")]
@@ -879,6 +901,28 @@ pub fn data(&self) -> *const () {
pub fn vtable(&self) -> &'static RawWakerVTable {
self.waker.vtable
}
+
+ /// Constructs a `LocalWaker` from a function pointer.
+ #[inline]
+ #[must_use]
+ #[unstable(feature = "waker_from_fn_ptr", issue = "148457")]
+ pub const fn from_fn_ptr(f: fn()) -> Self {
+ // SAFETY: Unsafe is used for transmutes, pointer came from `fn()` so it
+ // is sound to transmute it back to `fn()`.
+ static VTABLE: RawWakerVTable = unsafe {
+ RawWakerVTable::new(
+ |this| RawWaker::new(this, &VTABLE),
+ |this| transmute::<*const (), fn()>(this)(),
+ |this| transmute::<*const (), fn()>(this)(),
+ |_| {},
+ )
+ };
+ let raw = RawWaker::new(f as *const (), &VTABLE);
+
+ // SAFETY: `clone` is just a copy, `drop` is a no-op while `wake` and
+ // `wake_by_ref` just call the function pointer.
+ unsafe { Self::from_raw(raw) }
+ }
}
#[unstable(feature = "local_waker", issue = "118959")]
impl Clone for LocalWaker {
diff --git a/library/core/src/unicode/mod.rs b/library/core/src/unicode/mod.rs
index 1ee97d6..c71fa75 100644
--- a/library/core/src/unicode/mod.rs
+++ b/library/core/src/unicode/mod.rs
@@ -18,9 +18,8 @@
pub(crate) mod printable;
-mod rt;
#[allow(unreachable_pub)]
-pub mod unicode_data;
+mod unicode_data;
/// The version of [Unicode](https://www.unicode.org/) that the Unicode parts of
/// `char` and `str` methods are based on.
diff --git a/library/core/src/unicode/unicode_data.rs b/library/core/src/unicode/unicode_data.rs
index 81d0484..3c38b44 100644
--- a/library/core/src/unicode/unicode_data.rs
+++ b/library/core/src/unicode/unicode_data.rs
@@ -11,64 +11,167 @@
// to_upper : 13656 bytes
// Total : 31911 bytes
-use super::rt::*;
+#[inline(always)]
+const fn bitset_search<
+ const N: usize,
+ const CHUNK_SIZE: usize,
+ const N1: usize,
+ const CANONICAL: usize,
+ const CANONICALIZED: usize,
+>(
+ needle: u32,
+ chunk_idx_map: &[u8; N],
+ bitset_chunk_idx: &[[u8; CHUNK_SIZE]; N1],
+ bitset_canonical: &[u64; CANONICAL],
+ bitset_canonicalized: &[(u8, u8); CANONICALIZED],
+) -> bool {
+ let bucket_idx = (needle / 64) as usize;
+ let chunk_map_idx = bucket_idx / CHUNK_SIZE;
+ let chunk_piece = bucket_idx % CHUNK_SIZE;
+ // FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
+ let chunk_idx = if chunk_map_idx < chunk_idx_map.len() {
+ chunk_idx_map[chunk_map_idx]
+ } else {
+ return false;
+ };
+ let idx = bitset_chunk_idx[chunk_idx as usize][chunk_piece] as usize;
+ // FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
+ let word = if idx < bitset_canonical.len() {
+ bitset_canonical[idx]
+ } else {
+ let (real_idx, mapping) = bitset_canonicalized[idx - bitset_canonical.len()];
+ let mut word = bitset_canonical[real_idx as usize];
+ let should_invert = mapping & (1 << 6) != 0;
+ if should_invert {
+ word = !word;
+ }
+ // Lower 6 bits
+ let quantity = mapping & ((1 << 6) - 1);
+ if mapping & (1 << 7) != 0 {
+ // shift
+ word >>= quantity as u64;
+ } else {
+ word = word.rotate_left(quantity as u32);
+ }
+ word
+ };
+ (word & (1 << (needle % 64) as u64)) != 0
+}
+
+#[repr(transparent)]
+struct ShortOffsetRunHeader(u32);
+
+impl ShortOffsetRunHeader {
+ const fn new(start_index: usize, prefix_sum: u32) -> Self {
+ assert!(start_index < (1 << 11));
+ assert!(prefix_sum < (1 << 21));
+
+ Self((start_index as u32) << 21 | prefix_sum)
+ }
+
+ #[inline]
+ const fn start_index(&self) -> usize {
+ (self.0 >> 21) as usize
+ }
+
+ #[inline]
+ const fn prefix_sum(&self) -> u32 {
+ self.0 & ((1 << 21) - 1)
+ }
+}
+
+/// # Safety
+///
+/// - The last element of `short_offset_runs` must be greater than `std::char::MAX`.
+/// - The start indices of all elements in `short_offset_runs` must be less than `OFFSETS`.
+#[inline(always)]
+unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
+ needle: char,
+ short_offset_runs: &[ShortOffsetRunHeader; SOR],
+ offsets: &[u8; OFFSETS],
+) -> bool {
+ let needle = needle as u32;
+
+ let last_idx =
+ match short_offset_runs.binary_search_by_key(&(needle << 11), |header| header.0 << 11) {
+ Ok(idx) => idx + 1,
+ Err(idx) => idx,
+ };
+ // SAFETY: `last_idx` *cannot* be past the end of the array, as the last
+ // element is greater than `std::char::MAX` (the largest possible needle)
+ // as guaranteed by the caller.
+ //
+ // So, we cannot have found it (i.e. `Ok(idx) => idx + 1 != length`) and the
+ // correct location cannot be past it, so `Err(idx) => idx != length` either.
+ //
+ // This means that we can avoid bounds checking for the accesses below, too.
+ //
+ // We need to use `intrinsics::assume` since the `panic_nounwind` contained
+ // in `hint::assert_unchecked` may not be optimized out.
+ unsafe { crate::intrinsics::assume(last_idx < SOR) };
+
+ let mut offset_idx = short_offset_runs[last_idx].start_index();
+ let length = if let Some(next) = short_offset_runs.get(last_idx + 1) {
+ (*next).start_index() - offset_idx
+ } else {
+ offsets.len() - offset_idx
+ };
+
+ let prev =
+ last_idx.checked_sub(1).map(|prev| short_offset_runs[prev].prefix_sum()).unwrap_or(0);
+
+ let total = needle - prev;
+ let mut prefix_sum = 0;
+ for _ in 0..(length - 1) {
+ // SAFETY: It is guaranteed that `length <= OFFSETS - offset_idx`,
+ // so it follows that `length - 1 + offset_idx < OFFSETS`, therefore
+ // `offset_idx < OFFSETS` is always true in this loop.
+ //
+ // We need to use `intrinsics::assume` since the `panic_nounwind` contained
+ // in `hint::assert_unchecked` may not be optimized out.
+ unsafe { crate::intrinsics::assume(offset_idx < OFFSETS) };
+ let offset = offsets[offset_idx];
+ prefix_sum += offset as u32;
+ if prefix_sum > total {
+ break;
+ }
+ offset_idx += 1;
+ }
+ offset_idx % 2 == 1
+}
pub const UNICODE_VERSION: (u8, u8, u8) = (17, 0, 0);
+#[rustfmt::skip]
pub mod alphabetic {
use super::ShortOffsetRunHeader;
static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 51] = [
- ShortOffsetRunHeader::new(0, 706),
- ShortOffsetRunHeader::new(12, 4681),
- ShortOffsetRunHeader::new(414, 5741),
- ShortOffsetRunHeader::new(452, 7958),
- ShortOffsetRunHeader::new(552, 9398),
- ShortOffsetRunHeader::new(623, 11264),
- ShortOffsetRunHeader::new(625, 12293),
- ShortOffsetRunHeader::new(663, 13312),
- ShortOffsetRunHeader::new(687, 19904),
- ShortOffsetRunHeader::new(688, 42125),
- ShortOffsetRunHeader::new(690, 42509),
- ShortOffsetRunHeader::new(694, 55204),
- ShortOffsetRunHeader::new(778, 63744),
- ShortOffsetRunHeader::new(783, 64110),
- ShortOffsetRunHeader::new(784, 64830),
- ShortOffsetRunHeader::new(806, 66176),
- ShortOffsetRunHeader::new(847, 67383),
- ShortOffsetRunHeader::new(894, 73440),
- ShortOffsetRunHeader::new(1217, 74650),
- ShortOffsetRunHeader::new(1228, 77712),
- ShortOffsetRunHeader::new(1233, 78896),
- ShortOffsetRunHeader::new(1236, 82939),
- ShortOffsetRunHeader::new(1240, 83527),
- ShortOffsetRunHeader::new(1242, 90368),
- ShortOffsetRunHeader::new(1243, 92160),
- ShortOffsetRunHeader::new(1245, 92729),
- ShortOffsetRunHeader::new(1246, 93504),
- ShortOffsetRunHeader::new(1261, 101590),
- ShortOffsetRunHeader::new(1282, 110576),
- ShortOffsetRunHeader::new(1287, 110883),
- ShortOffsetRunHeader::new(1294, 111356),
- ShortOffsetRunHeader::new(1304, 113664),
- ShortOffsetRunHeader::new(1305, 119808),
- ShortOffsetRunHeader::new(1315, 120486),
- ShortOffsetRunHeader::new(1352, 122624),
- ShortOffsetRunHeader::new(1375, 123536),
- ShortOffsetRunHeader::new(1399, 124112),
- ShortOffsetRunHeader::new(1403, 126464),
- ShortOffsetRunHeader::new(1431, 127280),
- ShortOffsetRunHeader::new(1497, 131072),
- ShortOffsetRunHeader::new(1503, 173792),
- ShortOffsetRunHeader::new(1504, 178206),
- ShortOffsetRunHeader::new(1506, 183982),
- ShortOffsetRunHeader::new(1508, 191457),
- ShortOffsetRunHeader::new(1510, 192094),
- ShortOffsetRunHeader::new(1512, 194560),
- ShortOffsetRunHeader::new(1513, 195102),
- ShortOffsetRunHeader::new(1514, 196608),
- ShortOffsetRunHeader::new(1515, 201547),
- ShortOffsetRunHeader::new(1516, 210042),
+ ShortOffsetRunHeader::new(0, 706), ShortOffsetRunHeader::new(12, 4681),
+ ShortOffsetRunHeader::new(414, 5741), ShortOffsetRunHeader::new(452, 7958),
+ ShortOffsetRunHeader::new(552, 9398), ShortOffsetRunHeader::new(623, 11264),
+ ShortOffsetRunHeader::new(625, 12293), ShortOffsetRunHeader::new(663, 13312),
+ ShortOffsetRunHeader::new(687, 19904), ShortOffsetRunHeader::new(688, 42125),
+ ShortOffsetRunHeader::new(690, 42509), ShortOffsetRunHeader::new(694, 55204),
+ ShortOffsetRunHeader::new(778, 63744), ShortOffsetRunHeader::new(783, 64110),
+ ShortOffsetRunHeader::new(784, 64830), ShortOffsetRunHeader::new(806, 66176),
+ ShortOffsetRunHeader::new(847, 67383), ShortOffsetRunHeader::new(894, 73440),
+ ShortOffsetRunHeader::new(1217, 74650), ShortOffsetRunHeader::new(1228, 77712),
+ ShortOffsetRunHeader::new(1233, 78896), ShortOffsetRunHeader::new(1236, 82939),
+ ShortOffsetRunHeader::new(1240, 83527), ShortOffsetRunHeader::new(1242, 90368),
+ ShortOffsetRunHeader::new(1243, 92160), ShortOffsetRunHeader::new(1245, 92729),
+ ShortOffsetRunHeader::new(1246, 93504), ShortOffsetRunHeader::new(1261, 101590),
+ ShortOffsetRunHeader::new(1282, 110576), ShortOffsetRunHeader::new(1287, 110883),
+ ShortOffsetRunHeader::new(1294, 111356), ShortOffsetRunHeader::new(1304, 113664),
+ ShortOffsetRunHeader::new(1305, 119808), ShortOffsetRunHeader::new(1315, 120486),
+ ShortOffsetRunHeader::new(1352, 122624), ShortOffsetRunHeader::new(1375, 123536),
+ ShortOffsetRunHeader::new(1399, 124112), ShortOffsetRunHeader::new(1403, 126464),
+ ShortOffsetRunHeader::new(1431, 127280), ShortOffsetRunHeader::new(1497, 131072),
+ ShortOffsetRunHeader::new(1503, 173792), ShortOffsetRunHeader::new(1504, 178206),
+ ShortOffsetRunHeader::new(1506, 183982), ShortOffsetRunHeader::new(1508, 191457),
+ ShortOffsetRunHeader::new(1510, 192094), ShortOffsetRunHeader::new(1512, 194560),
+ ShortOffsetRunHeader::new(1513, 195102), ShortOffsetRunHeader::new(1514, 196608),
+ ShortOffsetRunHeader::new(1515, 201547), ShortOffsetRunHeader::new(1516, 210042),
ShortOffsetRunHeader::new(1518, 1324154),
];
static OFFSETS: [u8; 1519] = [
@@ -77,60 +180,58 @@ pub mod alphabetic {
1, 2, 1, 2, 1, 1, 8, 27, 4, 4, 29, 11, 5, 56, 1, 7, 14, 102, 1, 8, 4, 8, 4, 3, 10, 3, 2, 1,
16, 48, 13, 101, 24, 33, 9, 2, 4, 1, 5, 24, 2, 19, 19, 25, 7, 11, 5, 24, 1, 7, 7, 1, 8, 42,
10, 12, 3, 7, 6, 76, 1, 16, 1, 3, 4, 15, 13, 19, 1, 8, 2, 2, 2, 22, 1, 7, 1, 1, 3, 4, 3, 8,
- 2, 2, 2, 2, 1, 1, 8, 1, 4, 2, 1, 5, 12, 2, 10, 1, 4, 3, 1, 6, 4, 2, 2, 22, 1, 7, 1, 2, 1,
- 2, 1, 2, 4, 5, 4, 2, 2, 2, 4, 1, 7, 4, 1, 1, 17, 6, 11, 3, 1, 9, 1, 3, 1, 22, 1, 7, 1, 2,
- 1, 5, 3, 9, 1, 3, 1, 2, 3, 1, 15, 4, 21, 4, 4, 3, 1, 8, 2, 2, 2, 22, 1, 7, 1, 2, 1, 5, 3,
- 8, 2, 2, 2, 2, 9, 2, 4, 2, 1, 5, 13, 1, 16, 2, 1, 6, 3, 3, 1, 4, 3, 2, 1, 1, 1, 2, 3, 2, 3,
- 3, 3, 12, 4, 5, 3, 3, 1, 3, 3, 1, 6, 1, 40, 13, 1, 3, 1, 23, 1, 16, 3, 8, 1, 3, 1, 3, 8, 2,
- 1, 3, 1, 2, 2, 4, 28, 4, 1, 8, 1, 3, 1, 23, 1, 10, 1, 5, 3, 8, 1, 3, 1, 3, 8, 2, 5, 3, 1,
- 4, 13, 3, 12, 13, 1, 3, 1, 41, 2, 8, 1, 3, 1, 3, 1, 1, 5, 4, 7, 5, 22, 6, 1, 3, 1, 18, 3,
- 24, 1, 9, 1, 1, 2, 7, 8, 6, 1, 1, 1, 8, 18, 2, 13, 58, 5, 7, 6, 1, 51, 2, 1, 1, 1, 5, 1,
- 24, 1, 1, 1, 19, 1, 3, 2, 5, 1, 1, 6, 1, 14, 4, 32, 1, 63, 8, 1, 36, 4, 19, 4, 16, 1, 36,
- 67, 55, 1, 1, 2, 5, 16, 64, 10, 4, 2, 38, 1, 1, 5, 1, 2, 43, 1, 0, 1, 4, 2, 7, 1, 1, 1, 4,
- 2, 41, 1, 4, 2, 33, 1, 4, 2, 7, 1, 1, 1, 4, 2, 15, 1, 57, 1, 4, 2, 67, 37, 16, 16, 86, 2,
- 6, 3, 0, 2, 17, 1, 26, 5, 75, 3, 11, 7, 20, 11, 21, 12, 20, 12, 13, 1, 3, 1, 2, 12, 52, 2,
- 19, 14, 1, 4, 1, 67, 89, 7, 43, 5, 70, 10, 31, 1, 12, 4, 9, 23, 30, 2, 5, 11, 44, 4, 26,
- 54, 28, 4, 63, 2, 20, 50, 1, 23, 2, 11, 3, 49, 52, 1, 15, 1, 8, 51, 42, 2, 4, 10, 44, 1,
- 11, 14, 55, 22, 3, 10, 36, 2, 11, 5, 43, 2, 3, 41, 4, 1, 6, 1, 2, 3, 1, 5, 192, 19, 34, 11,
- 0, 2, 6, 2, 38, 2, 6, 2, 8, 1, 1, 1, 1, 1, 1, 1, 31, 2, 53, 1, 7, 1, 1, 3, 3, 1, 7, 3, 4,
- 2, 6, 4, 13, 5, 3, 1, 7, 116, 1, 13, 1, 16, 13, 101, 1, 4, 1, 2, 10, 1, 1, 3, 5, 6, 1, 1,
- 1, 1, 1, 1, 4, 1, 11, 2, 4, 5, 5, 4, 1, 17, 41, 0, 52, 0, 229, 6, 4, 3, 2, 12, 38, 1, 1, 5,
- 1, 2, 56, 7, 1, 16, 23, 9, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 32, 47, 1, 0, 3,
- 25, 9, 7, 5, 2, 5, 4, 86, 6, 3, 1, 90, 1, 4, 5, 43, 1, 94, 17, 32, 48, 16, 0, 0, 64, 0, 67,
- 46, 2, 0, 3, 16, 10, 2, 20, 47, 5, 8, 3, 113, 39, 9, 2, 103, 2, 82, 20, 21, 1, 33, 24, 52,
- 12, 68, 1, 1, 44, 6, 3, 1, 1, 3, 10, 33, 5, 35, 13, 29, 3, 51, 1, 12, 15, 1, 16, 16, 10, 5,
- 1, 55, 9, 14, 18, 23, 3, 69, 1, 1, 1, 1, 24, 3, 2, 16, 2, 4, 11, 6, 2, 6, 2, 6, 9, 7, 1, 7,
- 1, 43, 1, 14, 6, 123, 21, 0, 12, 23, 4, 49, 0, 0, 2, 106, 38, 7, 12, 5, 5, 12, 1, 13, 1, 5,
- 1, 1, 1, 2, 1, 2, 1, 108, 33, 0, 18, 64, 2, 54, 40, 12, 116, 5, 1, 135, 36, 26, 6, 26, 11,
- 89, 3, 6, 2, 6, 2, 6, 2, 3, 35, 12, 1, 26, 1, 19, 1, 2, 1, 15, 2, 14, 34, 123, 69, 53, 0,
- 29, 3, 49, 47, 32, 13, 30, 5, 43, 5, 30, 2, 36, 4, 8, 1, 5, 42, 158, 18, 36, 4, 36, 4, 40,
- 8, 52, 12, 11, 1, 15, 1, 7, 1, 2, 1, 11, 1, 15, 1, 7, 1, 2, 3, 52, 12, 0, 9, 22, 10, 8, 24,
- 6, 1, 42, 1, 9, 69, 6, 2, 1, 1, 44, 1, 2, 3, 1, 2, 23, 10, 23, 9, 31, 65, 19, 1, 2, 10, 22,
- 10, 26, 6, 26, 38, 56, 6, 2, 64, 4, 1, 2, 5, 8, 1, 3, 1, 29, 42, 29, 3, 29, 35, 8, 1, 28,
- 27, 54, 10, 22, 10, 19, 13, 18, 110, 73, 55, 51, 13, 51, 13, 40, 34, 28, 3, 1, 5, 23, 250,
- 42, 1, 2, 3, 2, 16, 6, 50, 3, 3, 29, 10, 1, 8, 22, 42, 18, 46, 21, 27, 23, 9, 70, 43, 5,
- 10, 57, 9, 1, 13, 25, 23, 51, 17, 4, 8, 35, 3, 1, 9, 64, 1, 4, 9, 2, 10, 1, 1, 1, 35, 18,
- 1, 34, 2, 1, 6, 4, 62, 7, 1, 1, 1, 4, 1, 15, 1, 10, 7, 57, 23, 4, 1, 8, 2, 2, 2, 22, 1, 7,
- 1, 2, 1, 5, 3, 8, 2, 2, 2, 2, 3, 1, 6, 1, 5, 7, 28, 10, 1, 1, 2, 1, 1, 38, 1, 10, 1, 1, 2,
- 1, 1, 4, 1, 2, 3, 1, 1, 1, 44, 66, 1, 3, 1, 4, 20, 3, 30, 66, 2, 2, 1, 1, 184, 54, 2, 7,
- 25, 6, 34, 63, 1, 1, 3, 1, 59, 54, 2, 1, 71, 27, 2, 14, 21, 7, 185, 57, 103, 64, 31, 8, 2,
- 1, 2, 8, 1, 2, 1, 30, 1, 2, 2, 2, 2, 4, 93, 8, 2, 46, 2, 6, 1, 1, 1, 2, 27, 51, 2, 10, 17,
- 72, 5, 1, 18, 73, 103, 8, 88, 33, 31, 9, 1, 45, 1, 7, 1, 1, 49, 30, 2, 22, 1, 14, 73, 7, 1,
- 2, 1, 44, 3, 1, 1, 2, 1, 3, 1, 1, 2, 2, 24, 6, 1, 2, 1, 37, 1, 2, 1, 4, 1, 1, 23, 44, 0,
- 23, 9, 17, 1, 41, 3, 3, 111, 1, 79, 0, 102, 111, 17, 196, 0, 97, 15, 0, 17, 6, 25, 0, 5, 0,
- 0, 47, 0, 0, 7, 31, 17, 79, 17, 30, 18, 48, 16, 4, 31, 21, 5, 19, 0, 45, 211, 64, 32, 25,
- 2, 25, 44, 75, 4, 57, 7, 17, 64, 2, 1, 1, 12, 7, 9, 0, 41, 32, 97, 115, 0, 4, 1, 7, 1, 2,
- 1, 0, 15, 1, 29, 3, 2, 1, 14, 4, 8, 0, 0, 107, 5, 13, 3, 9, 7, 10, 4, 1, 0, 85, 1, 71, 1,
- 2, 2, 1, 2, 2, 2, 4, 1, 12, 1, 1, 1, 7, 1, 65, 1, 4, 2, 8, 1, 7, 1, 28, 1, 4, 1, 5, 1, 1,
- 3, 7, 1, 0, 2, 25, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 8, 0,
- 31, 6, 6, 213, 7, 1, 17, 2, 7, 1, 2, 1, 5, 5, 62, 33, 1, 112, 45, 10, 7, 16, 1, 0, 30, 18,
- 44, 0, 28, 228, 30, 2, 1, 207, 31, 1, 22, 8, 2, 224, 7, 1, 4, 1, 2, 1, 15, 1, 197, 59, 68,
- 3, 1, 3, 1, 0, 4, 1, 27, 1, 2, 1, 1, 2, 1, 1, 10, 1, 4, 1, 1, 1, 1, 6, 1, 4, 1, 1, 1, 1, 1,
- 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 7, 1, 4, 1, 4, 1, 1,
- 1, 10, 1, 17, 5, 3, 1, 5, 1, 17, 0, 26, 6, 26, 6, 26, 0, 0, 32, 0, 2, 0, 2, 0, 15, 0, 0, 0,
- 0, 0, 5, 0, 0,
+ 2, 2, 2, 2, 1, 1, 8, 1, 4, 2, 1, 5, 12, 2, 10, 1, 4, 3, 1, 6, 4, 2, 2, 22, 1, 7, 1, 2, 1, 2,
+ 1, 2, 4, 5, 4, 2, 2, 2, 4, 1, 7, 4, 1, 1, 17, 6, 11, 3, 1, 9, 1, 3, 1, 22, 1, 7, 1, 2, 1, 5,
+ 3, 9, 1, 3, 1, 2, 3, 1, 15, 4, 21, 4, 4, 3, 1, 8, 2, 2, 2, 22, 1, 7, 1, 2, 1, 5, 3, 8, 2, 2,
+ 2, 2, 9, 2, 4, 2, 1, 5, 13, 1, 16, 2, 1, 6, 3, 3, 1, 4, 3, 2, 1, 1, 1, 2, 3, 2, 3, 3, 3, 12,
+ 4, 5, 3, 3, 1, 3, 3, 1, 6, 1, 40, 13, 1, 3, 1, 23, 1, 16, 3, 8, 1, 3, 1, 3, 8, 2, 1, 3, 1,
+ 2, 2, 4, 28, 4, 1, 8, 1, 3, 1, 23, 1, 10, 1, 5, 3, 8, 1, 3, 1, 3, 8, 2, 5, 3, 1, 4, 13, 3,
+ 12, 13, 1, 3, 1, 41, 2, 8, 1, 3, 1, 3, 1, 1, 5, 4, 7, 5, 22, 6, 1, 3, 1, 18, 3, 24, 1, 9, 1,
+ 1, 2, 7, 8, 6, 1, 1, 1, 8, 18, 2, 13, 58, 5, 7, 6, 1, 51, 2, 1, 1, 1, 5, 1, 24, 1, 1, 1, 19,
+ 1, 3, 2, 5, 1, 1, 6, 1, 14, 4, 32, 1, 63, 8, 1, 36, 4, 19, 4, 16, 1, 36, 67, 55, 1, 1, 2, 5,
+ 16, 64, 10, 4, 2, 38, 1, 1, 5, 1, 2, 43, 1, 0, 1, 4, 2, 7, 1, 1, 1, 4, 2, 41, 1, 4, 2, 33,
+ 1, 4, 2, 7, 1, 1, 1, 4, 2, 15, 1, 57, 1, 4, 2, 67, 37, 16, 16, 86, 2, 6, 3, 0, 2, 17, 1, 26,
+ 5, 75, 3, 11, 7, 20, 11, 21, 12, 20, 12, 13, 1, 3, 1, 2, 12, 52, 2, 19, 14, 1, 4, 1, 67, 89,
+ 7, 43, 5, 70, 10, 31, 1, 12, 4, 9, 23, 30, 2, 5, 11, 44, 4, 26, 54, 28, 4, 63, 2, 20, 50, 1,
+ 23, 2, 11, 3, 49, 52, 1, 15, 1, 8, 51, 42, 2, 4, 10, 44, 1, 11, 14, 55, 22, 3, 10, 36, 2,
+ 11, 5, 43, 2, 3, 41, 4, 1, 6, 1, 2, 3, 1, 5, 192, 19, 34, 11, 0, 2, 6, 2, 38, 2, 6, 2, 8, 1,
+ 1, 1, 1, 1, 1, 1, 31, 2, 53, 1, 7, 1, 1, 3, 3, 1, 7, 3, 4, 2, 6, 4, 13, 5, 3, 1, 7, 116, 1,
+ 13, 1, 16, 13, 101, 1, 4, 1, 2, 10, 1, 1, 3, 5, 6, 1, 1, 1, 1, 1, 1, 4, 1, 11, 2, 4, 5, 5,
+ 4, 1, 17, 41, 0, 52, 0, 229, 6, 4, 3, 2, 12, 38, 1, 1, 5, 1, 2, 56, 7, 1, 16, 23, 9, 7, 1,
+ 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 32, 47, 1, 0, 3, 25, 9, 7, 5, 2, 5, 4, 86, 6, 3,
+ 1, 90, 1, 4, 5, 43, 1, 94, 17, 32, 48, 16, 0, 0, 64, 0, 67, 46, 2, 0, 3, 16, 10, 2, 20, 47,
+ 5, 8, 3, 113, 39, 9, 2, 103, 2, 82, 20, 21, 1, 33, 24, 52, 12, 68, 1, 1, 44, 6, 3, 1, 1, 3,
+ 10, 33, 5, 35, 13, 29, 3, 51, 1, 12, 15, 1, 16, 16, 10, 5, 1, 55, 9, 14, 18, 23, 3, 69, 1,
+ 1, 1, 1, 24, 3, 2, 16, 2, 4, 11, 6, 2, 6, 2, 6, 9, 7, 1, 7, 1, 43, 1, 14, 6, 123, 21, 0, 12,
+ 23, 4, 49, 0, 0, 2, 106, 38, 7, 12, 5, 5, 12, 1, 13, 1, 5, 1, 1, 1, 2, 1, 2, 1, 108, 33, 0,
+ 18, 64, 2, 54, 40, 12, 116, 5, 1, 135, 36, 26, 6, 26, 11, 89, 3, 6, 2, 6, 2, 6, 2, 3, 35,
+ 12, 1, 26, 1, 19, 1, 2, 1, 15, 2, 14, 34, 123, 69, 53, 0, 29, 3, 49, 47, 32, 13, 30, 5, 43,
+ 5, 30, 2, 36, 4, 8, 1, 5, 42, 158, 18, 36, 4, 36, 4, 40, 8, 52, 12, 11, 1, 15, 1, 7, 1, 2,
+ 1, 11, 1, 15, 1, 7, 1, 2, 3, 52, 12, 0, 9, 22, 10, 8, 24, 6, 1, 42, 1, 9, 69, 6, 2, 1, 1,
+ 44, 1, 2, 3, 1, 2, 23, 10, 23, 9, 31, 65, 19, 1, 2, 10, 22, 10, 26, 6, 26, 38, 56, 6, 2, 64,
+ 4, 1, 2, 5, 8, 1, 3, 1, 29, 42, 29, 3, 29, 35, 8, 1, 28, 27, 54, 10, 22, 10, 19, 13, 18,
+ 110, 73, 55, 51, 13, 51, 13, 40, 34, 28, 3, 1, 5, 23, 250, 42, 1, 2, 3, 2, 16, 6, 50, 3, 3,
+ 29, 10, 1, 8, 22, 42, 18, 46, 21, 27, 23, 9, 70, 43, 5, 10, 57, 9, 1, 13, 25, 23, 51, 17, 4,
+ 8, 35, 3, 1, 9, 64, 1, 4, 9, 2, 10, 1, 1, 1, 35, 18, 1, 34, 2, 1, 6, 4, 62, 7, 1, 1, 1, 4,
+ 1, 15, 1, 10, 7, 57, 23, 4, 1, 8, 2, 2, 2, 22, 1, 7, 1, 2, 1, 5, 3, 8, 2, 2, 2, 2, 3, 1, 6,
+ 1, 5, 7, 28, 10, 1, 1, 2, 1, 1, 38, 1, 10, 1, 1, 2, 1, 1, 4, 1, 2, 3, 1, 1, 1, 44, 66, 1, 3,
+ 1, 4, 20, 3, 30, 66, 2, 2, 1, 1, 184, 54, 2, 7, 25, 6, 34, 63, 1, 1, 3, 1, 59, 54, 2, 1, 71,
+ 27, 2, 14, 21, 7, 185, 57, 103, 64, 31, 8, 2, 1, 2, 8, 1, 2, 1, 30, 1, 2, 2, 2, 2, 4, 93, 8,
+ 2, 46, 2, 6, 1, 1, 1, 2, 27, 51, 2, 10, 17, 72, 5, 1, 18, 73, 103, 8, 88, 33, 31, 9, 1, 45,
+ 1, 7, 1, 1, 49, 30, 2, 22, 1, 14, 73, 7, 1, 2, 1, 44, 3, 1, 1, 2, 1, 3, 1, 1, 2, 2, 24, 6,
+ 1, 2, 1, 37, 1, 2, 1, 4, 1, 1, 23, 44, 0, 23, 9, 17, 1, 41, 3, 3, 111, 1, 79, 0, 102, 111,
+ 17, 196, 0, 97, 15, 0, 17, 6, 25, 0, 5, 0, 0, 47, 0, 0, 7, 31, 17, 79, 17, 30, 18, 48, 16,
+ 4, 31, 21, 5, 19, 0, 45, 211, 64, 32, 25, 2, 25, 44, 75, 4, 57, 7, 17, 64, 2, 1, 1, 12, 7,
+ 9, 0, 41, 32, 97, 115, 0, 4, 1, 7, 1, 2, 1, 0, 15, 1, 29, 3, 2, 1, 14, 4, 8, 0, 0, 107, 5,
+ 13, 3, 9, 7, 10, 4, 1, 0, 85, 1, 71, 1, 2, 2, 1, 2, 2, 2, 4, 1, 12, 1, 1, 1, 7, 1, 65, 1, 4,
+ 2, 8, 1, 7, 1, 28, 1, 4, 1, 5, 1, 1, 3, 7, 1, 0, 2, 25, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25,
+ 1, 31, 1, 25, 1, 31, 1, 25, 1, 8, 0, 31, 6, 6, 213, 7, 1, 17, 2, 7, 1, 2, 1, 5, 5, 62, 33,
+ 1, 112, 45, 10, 7, 16, 1, 0, 30, 18, 44, 0, 28, 228, 30, 2, 1, 207, 31, 1, 22, 8, 2, 224, 7,
+ 1, 4, 1, 2, 1, 15, 1, 197, 59, 68, 3, 1, 3, 1, 0, 4, 1, 27, 1, 2, 1, 1, 2, 1, 1, 10, 1, 4,
+ 1, 1, 1, 1, 6, 1, 4, 1, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 1, 2, 4, 1, 7, 1, 4, 1, 4, 1, 1, 1, 10, 1, 17, 5, 3, 1, 5, 1, 17, 0, 26, 6, 26, 6, 26, 0, 0,
+ 32, 0, 2, 0, 2, 0, 15, 0, 0, 0, 0, 0, 5, 0, 0,
];
-
#[inline]
pub fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
@@ -153,84 +254,66 @@ fn lookup_slow(c: char) -> bool {
}
}
+#[rustfmt::skip]
pub mod case_ignorable {
use super::ShortOffsetRunHeader;
static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 36] = [
- ShortOffsetRunHeader::new(0, 688),
- ShortOffsetRunHeader::new(11, 4957),
- ShortOffsetRunHeader::new(263, 5906),
- ShortOffsetRunHeader::new(265, 8125),
- ShortOffsetRunHeader::new(377, 11388),
- ShortOffsetRunHeader::new(411, 12293),
- ShortOffsetRunHeader::new(423, 40981),
- ShortOffsetRunHeader::new(435, 42232),
- ShortOffsetRunHeader::new(437, 42508),
- ShortOffsetRunHeader::new(439, 64286),
- ShortOffsetRunHeader::new(535, 65024),
- ShortOffsetRunHeader::new(539, 66045),
- ShortOffsetRunHeader::new(569, 67456),
- ShortOffsetRunHeader::new(575, 68097),
- ShortOffsetRunHeader::new(581, 68900),
- ShortOffsetRunHeader::new(593, 69291),
- ShortOffsetRunHeader::new(601, 71727),
- ShortOffsetRunHeader::new(727, 71995),
- ShortOffsetRunHeader::new(731, 73459),
- ShortOffsetRunHeader::new(797, 78896),
- ShortOffsetRunHeader::new(809, 90398),
- ShortOffsetRunHeader::new(813, 92912),
- ShortOffsetRunHeader::new(817, 93504),
- ShortOffsetRunHeader::new(823, 94031),
- ShortOffsetRunHeader::new(827, 110576),
- ShortOffsetRunHeader::new(837, 113821),
- ShortOffsetRunHeader::new(843, 118528),
- ShortOffsetRunHeader::new(847, 119143),
- ShortOffsetRunHeader::new(851, 121344),
- ShortOffsetRunHeader::new(861, 122880),
- ShortOffsetRunHeader::new(873, 123566),
- ShortOffsetRunHeader::new(889, 124139),
- ShortOffsetRunHeader::new(893, 125136),
- ShortOffsetRunHeader::new(907, 127995),
- ShortOffsetRunHeader::new(911, 917505),
- ShortOffsetRunHeader::new(913, 2032112),
+ ShortOffsetRunHeader::new(0, 688), ShortOffsetRunHeader::new(11, 4957),
+ ShortOffsetRunHeader::new(263, 5906), ShortOffsetRunHeader::new(265, 8125),
+ ShortOffsetRunHeader::new(377, 11388), ShortOffsetRunHeader::new(411, 12293),
+ ShortOffsetRunHeader::new(423, 40981), ShortOffsetRunHeader::new(435, 42232),
+ ShortOffsetRunHeader::new(437, 42508), ShortOffsetRunHeader::new(439, 64286),
+ ShortOffsetRunHeader::new(535, 65024), ShortOffsetRunHeader::new(539, 66045),
+ ShortOffsetRunHeader::new(569, 67456), ShortOffsetRunHeader::new(575, 68097),
+ ShortOffsetRunHeader::new(581, 68900), ShortOffsetRunHeader::new(593, 69291),
+ ShortOffsetRunHeader::new(601, 71727), ShortOffsetRunHeader::new(727, 71995),
+ ShortOffsetRunHeader::new(731, 73459), ShortOffsetRunHeader::new(797, 78896),
+ ShortOffsetRunHeader::new(809, 90398), ShortOffsetRunHeader::new(813, 92912),
+ ShortOffsetRunHeader::new(817, 93504), ShortOffsetRunHeader::new(823, 94031),
+ ShortOffsetRunHeader::new(827, 110576), ShortOffsetRunHeader::new(837, 113821),
+ ShortOffsetRunHeader::new(843, 118528), ShortOffsetRunHeader::new(847, 119143),
+ ShortOffsetRunHeader::new(851, 121344), ShortOffsetRunHeader::new(861, 122880),
+ ShortOffsetRunHeader::new(873, 123566), ShortOffsetRunHeader::new(889, 124139),
+ ShortOffsetRunHeader::new(893, 125136), ShortOffsetRunHeader::new(907, 127995),
+ ShortOffsetRunHeader::new(911, 917505), ShortOffsetRunHeader::new(913, 2032112),
];
static OFFSETS: [u8; 919] = [
168, 1, 4, 1, 1, 1, 4, 1, 2, 2, 0, 192, 4, 2, 4, 1, 9, 2, 1, 1, 251, 7, 207, 1, 5, 1, 49,
- 45, 1, 1, 1, 2, 1, 2, 1, 1, 44, 1, 11, 6, 10, 11, 1, 1, 35, 1, 10, 21, 16, 1, 101, 8, 1,
- 10, 1, 4, 33, 1, 1, 1, 30, 27, 91, 11, 58, 11, 4, 1, 2, 1, 24, 24, 43, 3, 44, 1, 7, 2, 5,
- 9, 41, 58, 55, 1, 1, 1, 4, 8, 4, 1, 3, 7, 10, 2, 13, 1, 15, 1, 58, 1, 4, 4, 8, 1, 20, 2,
- 26, 1, 2, 2, 57, 1, 4, 2, 4, 2, 2, 3, 3, 1, 30, 2, 3, 1, 11, 2, 57, 1, 4, 5, 1, 2, 4, 1,
- 20, 2, 22, 6, 1, 1, 58, 1, 2, 1, 1, 4, 8, 1, 7, 2, 11, 2, 30, 1, 61, 1, 12, 1, 50, 1, 3, 1,
- 55, 1, 1, 3, 5, 3, 1, 4, 7, 2, 11, 2, 29, 1, 58, 1, 2, 1, 6, 1, 5, 2, 20, 2, 28, 2, 57, 2,
- 4, 4, 8, 1, 20, 2, 29, 1, 72, 1, 7, 3, 1, 1, 90, 1, 2, 7, 11, 9, 98, 1, 2, 9, 9, 1, 1, 7,
- 73, 2, 27, 1, 1, 1, 1, 1, 55, 14, 1, 5, 1, 2, 5, 11, 1, 36, 9, 1, 102, 4, 1, 6, 1, 2, 2, 2,
- 25, 2, 4, 3, 16, 4, 13, 1, 2, 2, 6, 1, 15, 1, 94, 1, 0, 3, 0, 3, 29, 2, 30, 2, 30, 2, 64,
- 2, 1, 7, 8, 1, 2, 11, 3, 1, 5, 1, 45, 5, 51, 1, 65, 2, 34, 1, 118, 3, 4, 2, 9, 1, 6, 3,
- 219, 2, 2, 1, 58, 1, 1, 7, 1, 1, 1, 1, 2, 8, 6, 10, 2, 1, 39, 1, 8, 46, 2, 12, 20, 4, 48,
- 1, 1, 5, 1, 1, 5, 1, 40, 9, 12, 2, 32, 4, 2, 2, 1, 3, 56, 1, 1, 2, 3, 1, 1, 3, 58, 8, 2, 2,
- 64, 6, 82, 3, 1, 13, 1, 7, 4, 1, 6, 1, 3, 2, 50, 63, 13, 1, 34, 101, 0, 1, 1, 3, 11, 3, 13,
- 3, 13, 3, 13, 2, 12, 5, 8, 2, 10, 1, 2, 1, 2, 5, 49, 5, 1, 10, 1, 1, 13, 1, 16, 13, 51, 33,
- 0, 2, 113, 3, 125, 1, 15, 1, 96, 32, 47, 1, 0, 1, 36, 4, 3, 5, 5, 1, 93, 6, 93, 3, 0, 1, 0,
- 6, 0, 1, 98, 4, 1, 10, 1, 1, 28, 4, 80, 2, 14, 34, 78, 1, 23, 3, 102, 4, 3, 2, 8, 1, 3, 1,
- 4, 1, 25, 2, 5, 1, 151, 2, 26, 18, 13, 1, 38, 8, 25, 11, 46, 3, 48, 1, 2, 4, 2, 2, 17, 1,
- 21, 2, 66, 6, 2, 2, 2, 2, 12, 1, 8, 1, 35, 1, 11, 1, 51, 1, 1, 3, 2, 2, 5, 2, 1, 1, 27, 1,
- 14, 2, 5, 2, 1, 1, 100, 5, 9, 3, 121, 1, 2, 1, 4, 1, 0, 1, 147, 17, 0, 16, 3, 1, 12, 16,
- 34, 1, 2, 1, 169, 1, 7, 1, 6, 1, 11, 1, 35, 1, 1, 1, 47, 1, 45, 2, 67, 1, 21, 3, 0, 1, 226,
- 1, 149, 5, 0, 6, 1, 42, 1, 9, 0, 3, 1, 2, 5, 4, 40, 3, 4, 1, 165, 2, 0, 4, 38, 1, 26, 5, 1,
- 1, 0, 2, 24, 1, 52, 6, 70, 11, 49, 4, 123, 1, 54, 15, 41, 1, 2, 2, 10, 3, 49, 4, 2, 2, 2,
- 1, 4, 1, 10, 1, 50, 3, 36, 5, 1, 8, 62, 1, 12, 2, 52, 9, 10, 4, 2, 1, 95, 3, 2, 1, 1, 2, 6,
- 1, 2, 1, 157, 1, 3, 8, 21, 2, 57, 2, 3, 1, 37, 7, 3, 5, 70, 6, 13, 1, 1, 1, 1, 1, 14, 2,
- 85, 8, 2, 3, 1, 1, 23, 1, 84, 6, 1, 1, 4, 2, 1, 2, 238, 4, 6, 2, 1, 2, 27, 2, 85, 8, 2, 1,
- 1, 2, 106, 1, 1, 1, 2, 6, 1, 1, 101, 1, 1, 1, 2, 4, 1, 5, 0, 9, 1, 2, 0, 2, 1, 1, 4, 1,
- 144, 4, 2, 2, 4, 1, 32, 10, 40, 6, 2, 4, 8, 1, 9, 6, 2, 3, 46, 13, 1, 2, 198, 1, 1, 3, 1,
- 1, 201, 7, 1, 6, 1, 1, 82, 22, 2, 7, 1, 2, 1, 2, 122, 6, 3, 1, 1, 2, 1, 7, 1, 1, 72, 2, 3,
- 1, 1, 1, 65, 1, 0, 2, 11, 2, 52, 5, 5, 1, 1, 1, 23, 1, 0, 17, 6, 15, 0, 12, 3, 3, 0, 5, 59,
- 7, 9, 4, 0, 3, 40, 2, 0, 1, 63, 17, 64, 2, 1, 2, 13, 2, 0, 4, 1, 7, 1, 2, 0, 2, 1, 4, 0,
- 46, 2, 23, 0, 3, 9, 16, 2, 7, 30, 4, 148, 3, 0, 55, 4, 50, 8, 1, 14, 1, 22, 5, 1, 15, 0, 7,
- 1, 17, 2, 7, 1, 2, 1, 5, 5, 62, 33, 1, 160, 14, 0, 1, 61, 4, 0, 5, 254, 2, 243, 1, 2, 1, 7,
- 2, 5, 1, 9, 1, 0, 7, 109, 8, 0, 5, 0, 1, 30, 96, 128, 240, 0,
+ 45, 1, 1, 1, 2, 1, 2, 1, 1, 44, 1, 11, 6, 10, 11, 1, 1, 35, 1, 10, 21, 16, 1, 101, 8, 1, 10,
+ 1, 4, 33, 1, 1, 1, 30, 27, 91, 11, 58, 11, 4, 1, 2, 1, 24, 24, 43, 3, 44, 1, 7, 2, 5, 9, 41,
+ 58, 55, 1, 1, 1, 4, 8, 4, 1, 3, 7, 10, 2, 13, 1, 15, 1, 58, 1, 4, 4, 8, 1, 20, 2, 26, 1, 2,
+ 2, 57, 1, 4, 2, 4, 2, 2, 3, 3, 1, 30, 2, 3, 1, 11, 2, 57, 1, 4, 5, 1, 2, 4, 1, 20, 2, 22, 6,
+ 1, 1, 58, 1, 2, 1, 1, 4, 8, 1, 7, 2, 11, 2, 30, 1, 61, 1, 12, 1, 50, 1, 3, 1, 55, 1, 1, 3,
+ 5, 3, 1, 4, 7, 2, 11, 2, 29, 1, 58, 1, 2, 1, 6, 1, 5, 2, 20, 2, 28, 2, 57, 2, 4, 4, 8, 1,
+ 20, 2, 29, 1, 72, 1, 7, 3, 1, 1, 90, 1, 2, 7, 11, 9, 98, 1, 2, 9, 9, 1, 1, 7, 73, 2, 27, 1,
+ 1, 1, 1, 1, 55, 14, 1, 5, 1, 2, 5, 11, 1, 36, 9, 1, 102, 4, 1, 6, 1, 2, 2, 2, 25, 2, 4, 3,
+ 16, 4, 13, 1, 2, 2, 6, 1, 15, 1, 94, 1, 0, 3, 0, 3, 29, 2, 30, 2, 30, 2, 64, 2, 1, 7, 8, 1,
+ 2, 11, 3, 1, 5, 1, 45, 5, 51, 1, 65, 2, 34, 1, 118, 3, 4, 2, 9, 1, 6, 3, 219, 2, 2, 1, 58,
+ 1, 1, 7, 1, 1, 1, 1, 2, 8, 6, 10, 2, 1, 39, 1, 8, 46, 2, 12, 20, 4, 48, 1, 1, 5, 1, 1, 5, 1,
+ 40, 9, 12, 2, 32, 4, 2, 2, 1, 3, 56, 1, 1, 2, 3, 1, 1, 3, 58, 8, 2, 2, 64, 6, 82, 3, 1, 13,
+ 1, 7, 4, 1, 6, 1, 3, 2, 50, 63, 13, 1, 34, 101, 0, 1, 1, 3, 11, 3, 13, 3, 13, 3, 13, 2, 12,
+ 5, 8, 2, 10, 1, 2, 1, 2, 5, 49, 5, 1, 10, 1, 1, 13, 1, 16, 13, 51, 33, 0, 2, 113, 3, 125, 1,
+ 15, 1, 96, 32, 47, 1, 0, 1, 36, 4, 3, 5, 5, 1, 93, 6, 93, 3, 0, 1, 0, 6, 0, 1, 98, 4, 1, 10,
+ 1, 1, 28, 4, 80, 2, 14, 34, 78, 1, 23, 3, 102, 4, 3, 2, 8, 1, 3, 1, 4, 1, 25, 2, 5, 1, 151,
+ 2, 26, 18, 13, 1, 38, 8, 25, 11, 46, 3, 48, 1, 2, 4, 2, 2, 17, 1, 21, 2, 66, 6, 2, 2, 2, 2,
+ 12, 1, 8, 1, 35, 1, 11, 1, 51, 1, 1, 3, 2, 2, 5, 2, 1, 1, 27, 1, 14, 2, 5, 2, 1, 1, 100, 5,
+ 9, 3, 121, 1, 2, 1, 4, 1, 0, 1, 147, 17, 0, 16, 3, 1, 12, 16, 34, 1, 2, 1, 169, 1, 7, 1, 6,
+ 1, 11, 1, 35, 1, 1, 1, 47, 1, 45, 2, 67, 1, 21, 3, 0, 1, 226, 1, 149, 5, 0, 6, 1, 42, 1, 9,
+ 0, 3, 1, 2, 5, 4, 40, 3, 4, 1, 165, 2, 0, 4, 38, 1, 26, 5, 1, 1, 0, 2, 24, 1, 52, 6, 70, 11,
+ 49, 4, 123, 1, 54, 15, 41, 1, 2, 2, 10, 3, 49, 4, 2, 2, 2, 1, 4, 1, 10, 1, 50, 3, 36, 5, 1,
+ 8, 62, 1, 12, 2, 52, 9, 10, 4, 2, 1, 95, 3, 2, 1, 1, 2, 6, 1, 2, 1, 157, 1, 3, 8, 21, 2, 57,
+ 2, 3, 1, 37, 7, 3, 5, 70, 6, 13, 1, 1, 1, 1, 1, 14, 2, 85, 8, 2, 3, 1, 1, 23, 1, 84, 6, 1,
+ 1, 4, 2, 1, 2, 238, 4, 6, 2, 1, 2, 27, 2, 85, 8, 2, 1, 1, 2, 106, 1, 1, 1, 2, 6, 1, 1, 101,
+ 1, 1, 1, 2, 4, 1, 5, 0, 9, 1, 2, 0, 2, 1, 1, 4, 1, 144, 4, 2, 2, 4, 1, 32, 10, 40, 6, 2, 4,
+ 8, 1, 9, 6, 2, 3, 46, 13, 1, 2, 198, 1, 1, 3, 1, 1, 201, 7, 1, 6, 1, 1, 82, 22, 2, 7, 1, 2,
+ 1, 2, 122, 6, 3, 1, 1, 2, 1, 7, 1, 1, 72, 2, 3, 1, 1, 1, 65, 1, 0, 2, 11, 2, 52, 5, 5, 1, 1,
+ 1, 23, 1, 0, 17, 6, 15, 0, 12, 3, 3, 0, 5, 59, 7, 9, 4, 0, 3, 40, 2, 0, 1, 63, 17, 64, 2, 1,
+ 2, 13, 2, 0, 4, 1, 7, 1, 2, 0, 2, 1, 4, 0, 46, 2, 23, 0, 3, 9, 16, 2, 7, 30, 4, 148, 3, 0,
+ 55, 4, 50, 8, 1, 14, 1, 22, 5, 1, 15, 0, 7, 1, 17, 2, 7, 1, 2, 1, 5, 5, 62, 33, 1, 160, 14,
+ 0, 1, 61, 4, 0, 5, 254, 2, 243, 1, 2, 1, 7, 2, 5, 1, 9, 1, 0, 7, 109, 8, 0, 5, 0, 1, 30, 96,
+ 128, 240, 0,
];
-
#[inline]
pub fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
@@ -253,48 +336,37 @@ fn lookup_slow(c: char) -> bool {
}
}
+#[rustfmt::skip]
pub mod cased {
use super::ShortOffsetRunHeader;
static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 22] = [
- ShortOffsetRunHeader::new(0, 4256),
- ShortOffsetRunHeader::new(51, 5024),
- ShortOffsetRunHeader::new(61, 7296),
- ShortOffsetRunHeader::new(65, 7958),
- ShortOffsetRunHeader::new(74, 9398),
- ShortOffsetRunHeader::new(149, 11264),
- ShortOffsetRunHeader::new(151, 42560),
- ShortOffsetRunHeader::new(163, 43824),
- ShortOffsetRunHeader::new(177, 64256),
- ShortOffsetRunHeader::new(183, 65313),
- ShortOffsetRunHeader::new(187, 66560),
- ShortOffsetRunHeader::new(191, 67456),
- ShortOffsetRunHeader::new(213, 68736),
- ShortOffsetRunHeader::new(221, 71840),
- ShortOffsetRunHeader::new(229, 93760),
- ShortOffsetRunHeader::new(231, 119808),
- ShortOffsetRunHeader::new(237, 120486),
- ShortOffsetRunHeader::new(274, 122624),
- ShortOffsetRunHeader::new(297, 122928),
- ShortOffsetRunHeader::new(303, 125184),
- ShortOffsetRunHeader::new(305, 127280),
- ShortOffsetRunHeader::new(307, 1241482),
+ ShortOffsetRunHeader::new(0, 4256), ShortOffsetRunHeader::new(51, 5024),
+ ShortOffsetRunHeader::new(61, 7296), ShortOffsetRunHeader::new(65, 7958),
+ ShortOffsetRunHeader::new(74, 9398), ShortOffsetRunHeader::new(149, 11264),
+ ShortOffsetRunHeader::new(151, 42560), ShortOffsetRunHeader::new(163, 43824),
+ ShortOffsetRunHeader::new(177, 64256), ShortOffsetRunHeader::new(183, 65313),
+ ShortOffsetRunHeader::new(187, 66560), ShortOffsetRunHeader::new(191, 67456),
+ ShortOffsetRunHeader::new(213, 68736), ShortOffsetRunHeader::new(221, 71840),
+ ShortOffsetRunHeader::new(229, 93760), ShortOffsetRunHeader::new(231, 119808),
+ ShortOffsetRunHeader::new(237, 120486), ShortOffsetRunHeader::new(274, 122624),
+ ShortOffsetRunHeader::new(297, 122928), ShortOffsetRunHeader::new(303, 125184),
+ ShortOffsetRunHeader::new(305, 127280), ShortOffsetRunHeader::new(307, 1241482),
];
static OFFSETS: [u8; 313] = [
170, 1, 10, 1, 4, 1, 5, 23, 1, 31, 1, 195, 1, 4, 4, 208, 2, 35, 7, 2, 30, 5, 96, 1, 42, 4,
- 2, 2, 2, 4, 1, 1, 6, 1, 1, 3, 1, 1, 1, 20, 1, 83, 1, 139, 8, 166, 1, 38, 9, 41, 0, 38, 1,
- 1, 5, 1, 2, 43, 1, 4, 0, 86, 2, 6, 0, 11, 5, 43, 2, 3, 64, 192, 64, 0, 2, 6, 2, 38, 2, 6,
- 2, 8, 1, 1, 1, 1, 1, 1, 1, 31, 2, 53, 1, 7, 1, 1, 3, 3, 1, 7, 3, 4, 2, 6, 4, 13, 5, 3, 1,
- 7, 116, 1, 13, 1, 16, 13, 101, 1, 4, 1, 2, 10, 1, 1, 3, 5, 6, 1, 1, 1, 1, 1, 1, 4, 1, 6, 4,
- 1, 2, 4, 5, 5, 4, 1, 17, 32, 3, 2, 0, 52, 0, 229, 6, 4, 3, 2, 12, 38, 1, 1, 5, 1, 0, 46,
- 18, 30, 132, 102, 3, 4, 1, 77, 20, 6, 1, 3, 0, 43, 1, 14, 6, 80, 0, 7, 12, 5, 0, 26, 6, 26,
- 0, 80, 96, 36, 4, 36, 116, 11, 1, 15, 1, 7, 1, 2, 1, 11, 1, 15, 1, 7, 1, 2, 0, 1, 2, 3, 1,
- 42, 1, 9, 0, 51, 13, 51, 93, 22, 10, 22, 0, 64, 0, 64, 32, 25, 2, 25, 0, 85, 1, 71, 1, 2,
- 2, 1, 2, 2, 2, 4, 1, 12, 1, 1, 1, 7, 1, 65, 1, 4, 2, 8, 1, 7, 1, 28, 1, 4, 1, 5, 1, 1, 3,
- 7, 1, 0, 2, 25, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 8, 0, 10,
- 1, 20, 6, 6, 0, 62, 0, 68, 0, 26, 6, 26, 6, 26, 0,
+ 2, 2, 2, 4, 1, 1, 6, 1, 1, 3, 1, 1, 1, 20, 1, 83, 1, 139, 8, 166, 1, 38, 9, 41, 0, 38, 1, 1,
+ 5, 1, 2, 43, 1, 4, 0, 86, 2, 6, 0, 11, 5, 43, 2, 3, 64, 192, 64, 0, 2, 6, 2, 38, 2, 6, 2, 8,
+ 1, 1, 1, 1, 1, 1, 1, 31, 2, 53, 1, 7, 1, 1, 3, 3, 1, 7, 3, 4, 2, 6, 4, 13, 5, 3, 1, 7, 116,
+ 1, 13, 1, 16, 13, 101, 1, 4, 1, 2, 10, 1, 1, 3, 5, 6, 1, 1, 1, 1, 1, 1, 4, 1, 6, 4, 1, 2, 4,
+ 5, 5, 4, 1, 17, 32, 3, 2, 0, 52, 0, 229, 6, 4, 3, 2, 12, 38, 1, 1, 5, 1, 0, 46, 18, 30, 132,
+ 102, 3, 4, 1, 77, 20, 6, 1, 3, 0, 43, 1, 14, 6, 80, 0, 7, 12, 5, 0, 26, 6, 26, 0, 80, 96,
+ 36, 4, 36, 116, 11, 1, 15, 1, 7, 1, 2, 1, 11, 1, 15, 1, 7, 1, 2, 0, 1, 2, 3, 1, 42, 1, 9, 0,
+ 51, 13, 51, 93, 22, 10, 22, 0, 64, 0, 64, 32, 25, 2, 25, 0, 85, 1, 71, 1, 2, 2, 1, 2, 2, 2,
+ 4, 1, 12, 1, 1, 1, 7, 1, 65, 1, 4, 2, 8, 1, 7, 1, 28, 1, 4, 1, 5, 1, 1, 3, 7, 1, 0, 2, 25,
+ 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 8, 0, 10, 1, 20, 6, 6, 0,
+ 62, 0, 68, 0, 26, 6, 26, 6, 26, 0,
];
-
#[inline]
pub fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
@@ -317,75 +389,59 @@ fn lookup_slow(c: char) -> bool {
}
}
+#[rustfmt::skip]
pub mod grapheme_extend {
use super::ShortOffsetRunHeader;
static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 33] = [
- ShortOffsetRunHeader::new(0, 768),
- ShortOffsetRunHeader::new(1, 1155),
- ShortOffsetRunHeader::new(3, 1425),
- ShortOffsetRunHeader::new(5, 4957),
- ShortOffsetRunHeader::new(249, 5906),
- ShortOffsetRunHeader::new(251, 8204),
- ShortOffsetRunHeader::new(347, 11503),
- ShortOffsetRunHeader::new(351, 12330),
- ShortOffsetRunHeader::new(357, 42607),
- ShortOffsetRunHeader::new(361, 43010),
- ShortOffsetRunHeader::new(369, 64286),
- ShortOffsetRunHeader::new(435, 65024),
- ShortOffsetRunHeader::new(437, 65438),
- ShortOffsetRunHeader::new(441, 66045),
- ShortOffsetRunHeader::new(443, 68097),
- ShortOffsetRunHeader::new(449, 68900),
- ShortOffsetRunHeader::new(461, 69291),
- ShortOffsetRunHeader::new(465, 71727),
- ShortOffsetRunHeader::new(601, 73459),
- ShortOffsetRunHeader::new(669, 78912),
- ShortOffsetRunHeader::new(679, 90398),
- ShortOffsetRunHeader::new(683, 92912),
- ShortOffsetRunHeader::new(687, 94031),
- ShortOffsetRunHeader::new(691, 113821),
- ShortOffsetRunHeader::new(699, 118528),
- ShortOffsetRunHeader::new(701, 119141),
- ShortOffsetRunHeader::new(705, 121344),
- ShortOffsetRunHeader::new(717, 122880),
- ShortOffsetRunHeader::new(729, 123566),
- ShortOffsetRunHeader::new(743, 124140),
- ShortOffsetRunHeader::new(747, 125136),
- ShortOffsetRunHeader::new(759, 917536),
+ ShortOffsetRunHeader::new(0, 768), ShortOffsetRunHeader::new(1, 1155),
+ ShortOffsetRunHeader::new(3, 1425), ShortOffsetRunHeader::new(5, 4957),
+ ShortOffsetRunHeader::new(249, 5906), ShortOffsetRunHeader::new(251, 8204),
+ ShortOffsetRunHeader::new(347, 11503), ShortOffsetRunHeader::new(351, 12330),
+ ShortOffsetRunHeader::new(357, 42607), ShortOffsetRunHeader::new(361, 43010),
+ ShortOffsetRunHeader::new(369, 64286), ShortOffsetRunHeader::new(435, 65024),
+ ShortOffsetRunHeader::new(437, 65438), ShortOffsetRunHeader::new(441, 66045),
+ ShortOffsetRunHeader::new(443, 68097), ShortOffsetRunHeader::new(449, 68900),
+ ShortOffsetRunHeader::new(461, 69291), ShortOffsetRunHeader::new(465, 71727),
+ ShortOffsetRunHeader::new(601, 73459), ShortOffsetRunHeader::new(669, 78912),
+ ShortOffsetRunHeader::new(679, 90398), ShortOffsetRunHeader::new(683, 92912),
+ ShortOffsetRunHeader::new(687, 94031), ShortOffsetRunHeader::new(691, 113821),
+ ShortOffsetRunHeader::new(699, 118528), ShortOffsetRunHeader::new(701, 119141),
+ ShortOffsetRunHeader::new(705, 121344), ShortOffsetRunHeader::new(717, 122880),
+ ShortOffsetRunHeader::new(729, 123566), ShortOffsetRunHeader::new(743, 124140),
+ ShortOffsetRunHeader::new(747, 125136), ShortOffsetRunHeader::new(759, 917536),
ShortOffsetRunHeader::new(763, 2032112),
];
static OFFSETS: [u8; 767] = [
0, 112, 0, 7, 0, 45, 1, 1, 1, 2, 1, 2, 1, 1, 72, 11, 48, 21, 16, 1, 101, 7, 2, 6, 2, 2, 1,
- 4, 35, 1, 30, 27, 91, 11, 58, 9, 9, 1, 24, 4, 1, 9, 1, 3, 1, 5, 43, 3, 59, 9, 42, 24, 1,
- 32, 55, 1, 1, 1, 4, 8, 4, 1, 3, 7, 10, 2, 29, 1, 58, 1, 1, 1, 2, 4, 8, 1, 9, 1, 10, 2, 26,
- 1, 2, 2, 57, 1, 4, 2, 4, 2, 2, 3, 3, 1, 30, 2, 3, 1, 11, 2, 57, 1, 4, 5, 1, 2, 4, 1, 20, 2,
- 22, 6, 1, 1, 58, 1, 1, 2, 1, 4, 8, 1, 7, 3, 10, 2, 30, 1, 59, 1, 1, 1, 12, 1, 9, 1, 40, 1,
- 3, 1, 55, 1, 1, 3, 5, 3, 1, 4, 7, 2, 11, 2, 29, 1, 58, 1, 2, 2, 1, 1, 3, 3, 1, 4, 7, 2, 11,
- 2, 28, 2, 57, 2, 1, 1, 2, 4, 8, 1, 9, 1, 10, 2, 29, 1, 72, 1, 4, 1, 2, 3, 1, 1, 8, 1, 81,
- 1, 2, 7, 12, 8, 98, 1, 2, 9, 11, 7, 73, 2, 27, 1, 1, 1, 1, 1, 55, 14, 1, 5, 1, 2, 5, 11, 1,
- 36, 9, 1, 102, 4, 1, 6, 1, 2, 2, 2, 25, 2, 4, 3, 16, 4, 13, 1, 2, 2, 6, 1, 15, 1, 0, 3, 0,
- 4, 28, 3, 29, 2, 30, 2, 64, 2, 1, 7, 8, 1, 2, 11, 9, 1, 45, 3, 1, 1, 117, 2, 34, 1, 118, 3,
- 4, 2, 9, 1, 6, 3, 219, 2, 2, 1, 58, 1, 1, 7, 1, 1, 1, 1, 2, 8, 6, 10, 2, 1, 48, 46, 2, 12,
- 20, 4, 48, 10, 4, 3, 38, 9, 12, 2, 32, 4, 2, 6, 56, 1, 1, 2, 3, 1, 1, 5, 56, 8, 2, 2, 152,
- 3, 1, 13, 1, 7, 4, 1, 6, 1, 3, 2, 198, 64, 0, 1, 195, 33, 0, 3, 141, 1, 96, 32, 0, 6, 105,
- 2, 0, 4, 1, 10, 32, 2, 80, 2, 0, 1, 3, 1, 4, 1, 25, 2, 5, 1, 151, 2, 26, 18, 13, 1, 38, 8,
- 25, 11, 1, 1, 44, 3, 48, 1, 2, 4, 2, 2, 2, 1, 36, 1, 67, 6, 2, 2, 2, 2, 12, 1, 8, 1, 47, 1,
- 51, 1, 1, 3, 2, 2, 5, 2, 1, 1, 42, 2, 8, 1, 238, 1, 2, 1, 4, 1, 0, 1, 0, 16, 16, 16, 0, 2,
- 0, 1, 226, 1, 149, 5, 0, 3, 1, 2, 5, 4, 40, 3, 4, 1, 165, 2, 0, 4, 65, 5, 0, 2, 77, 6, 70,
- 11, 49, 4, 123, 1, 54, 15, 41, 1, 2, 2, 10, 3, 49, 4, 2, 2, 7, 1, 61, 3, 36, 5, 1, 8, 62,
- 1, 12, 2, 52, 9, 1, 1, 8, 4, 2, 1, 95, 3, 2, 4, 6, 1, 2, 1, 157, 1, 3, 8, 21, 2, 57, 2, 1,
- 1, 1, 1, 12, 1, 9, 1, 14, 7, 3, 5, 67, 1, 2, 6, 1, 1, 2, 1, 1, 3, 4, 3, 1, 1, 14, 2, 85, 8,
- 2, 3, 1, 1, 23, 1, 81, 1, 2, 6, 1, 1, 2, 1, 1, 2, 1, 2, 235, 1, 2, 4, 6, 2, 1, 2, 27, 2,
- 85, 8, 2, 1, 1, 2, 106, 1, 1, 1, 2, 8, 101, 1, 1, 1, 2, 4, 1, 5, 0, 9, 1, 2, 245, 1, 10, 4,
- 4, 1, 144, 4, 2, 2, 4, 1, 32, 10, 40, 6, 2, 4, 8, 1, 9, 6, 2, 3, 46, 13, 1, 2, 198, 1, 1,
- 3, 1, 1, 201, 7, 1, 6, 1, 1, 82, 22, 2, 7, 1, 2, 1, 2, 122, 6, 3, 1, 1, 2, 1, 7, 1, 1, 72,
- 2, 3, 1, 1, 1, 0, 2, 11, 2, 52, 5, 5, 3, 23, 1, 0, 1, 6, 15, 0, 12, 3, 3, 0, 5, 59, 7, 0,
- 1, 63, 4, 81, 1, 11, 2, 0, 2, 0, 46, 2, 23, 0, 5, 3, 6, 8, 8, 2, 7, 30, 4, 148, 3, 0, 55,
- 4, 50, 8, 1, 14, 1, 22, 5, 1, 15, 0, 7, 1, 17, 2, 7, 1, 2, 1, 5, 100, 1, 160, 7, 0, 1, 61,
- 4, 0, 4, 254, 2, 243, 1, 2, 1, 7, 2, 5, 1, 0, 7, 109, 7, 0, 96, 128, 240, 0,
+ 4, 35, 1, 30, 27, 91, 11, 58, 9, 9, 1, 24, 4, 1, 9, 1, 3, 1, 5, 43, 3, 59, 9, 42, 24, 1, 32,
+ 55, 1, 1, 1, 4, 8, 4, 1, 3, 7, 10, 2, 29, 1, 58, 1, 1, 1, 2, 4, 8, 1, 9, 1, 10, 2, 26, 1, 2,
+ 2, 57, 1, 4, 2, 4, 2, 2, 3, 3, 1, 30, 2, 3, 1, 11, 2, 57, 1, 4, 5, 1, 2, 4, 1, 20, 2, 22, 6,
+ 1, 1, 58, 1, 1, 2, 1, 4, 8, 1, 7, 3, 10, 2, 30, 1, 59, 1, 1, 1, 12, 1, 9, 1, 40, 1, 3, 1,
+ 55, 1, 1, 3, 5, 3, 1, 4, 7, 2, 11, 2, 29, 1, 58, 1, 2, 2, 1, 1, 3, 3, 1, 4, 7, 2, 11, 2, 28,
+ 2, 57, 2, 1, 1, 2, 4, 8, 1, 9, 1, 10, 2, 29, 1, 72, 1, 4, 1, 2, 3, 1, 1, 8, 1, 81, 1, 2, 7,
+ 12, 8, 98, 1, 2, 9, 11, 7, 73, 2, 27, 1, 1, 1, 1, 1, 55, 14, 1, 5, 1, 2, 5, 11, 1, 36, 9, 1,
+ 102, 4, 1, 6, 1, 2, 2, 2, 25, 2, 4, 3, 16, 4, 13, 1, 2, 2, 6, 1, 15, 1, 0, 3, 0, 4, 28, 3,
+ 29, 2, 30, 2, 64, 2, 1, 7, 8, 1, 2, 11, 9, 1, 45, 3, 1, 1, 117, 2, 34, 1, 118, 3, 4, 2, 9,
+ 1, 6, 3, 219, 2, 2, 1, 58, 1, 1, 7, 1, 1, 1, 1, 2, 8, 6, 10, 2, 1, 48, 46, 2, 12, 20, 4, 48,
+ 10, 4, 3, 38, 9, 12, 2, 32, 4, 2, 6, 56, 1, 1, 2, 3, 1, 1, 5, 56, 8, 2, 2, 152, 3, 1, 13, 1,
+ 7, 4, 1, 6, 1, 3, 2, 198, 64, 0, 1, 195, 33, 0, 3, 141, 1, 96, 32, 0, 6, 105, 2, 0, 4, 1,
+ 10, 32, 2, 80, 2, 0, 1, 3, 1, 4, 1, 25, 2, 5, 1, 151, 2, 26, 18, 13, 1, 38, 8, 25, 11, 1, 1,
+ 44, 3, 48, 1, 2, 4, 2, 2, 2, 1, 36, 1, 67, 6, 2, 2, 2, 2, 12, 1, 8, 1, 47, 1, 51, 1, 1, 3,
+ 2, 2, 5, 2, 1, 1, 42, 2, 8, 1, 238, 1, 2, 1, 4, 1, 0, 1, 0, 16, 16, 16, 0, 2, 0, 1, 226, 1,
+ 149, 5, 0, 3, 1, 2, 5, 4, 40, 3, 4, 1, 165, 2, 0, 4, 65, 5, 0, 2, 77, 6, 70, 11, 49, 4, 123,
+ 1, 54, 15, 41, 1, 2, 2, 10, 3, 49, 4, 2, 2, 7, 1, 61, 3, 36, 5, 1, 8, 62, 1, 12, 2, 52, 9,
+ 1, 1, 8, 4, 2, 1, 95, 3, 2, 4, 6, 1, 2, 1, 157, 1, 3, 8, 21, 2, 57, 2, 1, 1, 1, 1, 12, 1, 9,
+ 1, 14, 7, 3, 5, 67, 1, 2, 6, 1, 1, 2, 1, 1, 3, 4, 3, 1, 1, 14, 2, 85, 8, 2, 3, 1, 1, 23, 1,
+ 81, 1, 2, 6, 1, 1, 2, 1, 1, 2, 1, 2, 235, 1, 2, 4, 6, 2, 1, 2, 27, 2, 85, 8, 2, 1, 1, 2,
+ 106, 1, 1, 1, 2, 8, 101, 1, 1, 1, 2, 4, 1, 5, 0, 9, 1, 2, 245, 1, 10, 4, 4, 1, 144, 4, 2, 2,
+ 4, 1, 32, 10, 40, 6, 2, 4, 8, 1, 9, 6, 2, 3, 46, 13, 1, 2, 198, 1, 1, 3, 1, 1, 201, 7, 1, 6,
+ 1, 1, 82, 22, 2, 7, 1, 2, 1, 2, 122, 6, 3, 1, 1, 2, 1, 7, 1, 1, 72, 2, 3, 1, 1, 1, 0, 2, 11,
+ 2, 52, 5, 5, 3, 23, 1, 0, 1, 6, 15, 0, 12, 3, 3, 0, 5, 59, 7, 0, 1, 63, 4, 81, 1, 11, 2, 0,
+ 2, 0, 46, 2, 23, 0, 5, 3, 6, 8, 8, 2, 7, 30, 4, 148, 3, 0, 55, 4, 50, 8, 1, 14, 1, 22, 5, 1,
+ 15, 0, 7, 1, 17, 2, 7, 1, 2, 1, 5, 100, 1, 160, 7, 0, 1, 61, 4, 0, 4, 254, 2, 243, 1, 2, 1,
+ 7, 2, 5, 1, 0, 7, 109, 7, 0, 96, 128, 240, 0,
];
-
#[inline]
pub fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
@@ -408,13 +464,14 @@ fn lookup_slow(c: char) -> bool {
}
}
+#[rustfmt::skip]
pub mod lowercase {
static BITSET_CHUNKS_MAP: [u8; 123] = [
12, 17, 0, 0, 9, 0, 0, 13, 14, 10, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 4, 1, 0, 15, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
- 0, 3, 18, 0, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 4, 1, 0, 15, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
+ 3, 18, 0, 7,
];
static BITSET_INDEX_CHUNKS: [[u8; 16]; 20] = [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
@@ -498,107 +555,66 @@ pub mod lowercase {
0b1110101111000000000000000000000000001111111111111111111111111100,
];
static BITSET_MAPPING: [(u8, u8); 22] = [
- (0, 64),
- (1, 184),
- (1, 182),
- (1, 179),
- (1, 172),
- (1, 168),
- (1, 161),
- (1, 146),
- (1, 144),
- (1, 140),
- (1, 136),
- (1, 132),
- (2, 146),
- (2, 144),
- (2, 83),
- (3, 93),
- (3, 147),
- (3, 133),
- (4, 12),
- (4, 6),
- (5, 187),
- (6, 78),
+ (0, 64), (1, 184), (1, 182), (1, 179), (1, 172), (1, 168), (1, 161), (1, 146), (1, 144),
+ (1, 140), (1, 136), (1, 132), (2, 146), (2, 144), (2, 83), (3, 93), (3, 147), (3, 133),
+ (4, 12), (4, 6), (5, 187), (6, 78),
];
pub const fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
- (c as u32) >= 0xaa
- && super::bitset_search(
- c as u32,
- &BITSET_CHUNKS_MAP,
- &BITSET_INDEX_CHUNKS,
- &BITSET_CANONICAL,
- &BITSET_MAPPING,
- )
+ (c as u32) >= 0xaa &&
+ super::bitset_search(
+ c as u32,
+ &BITSET_CHUNKS_MAP,
+ &BITSET_INDEX_CHUNKS,
+ &BITSET_CANONICAL,
+ &BITSET_MAPPING,
+ )
}
}
+#[rustfmt::skip]
pub mod n {
use super::ShortOffsetRunHeader;
static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 43] = [
- ShortOffsetRunHeader::new(0, 1632),
- ShortOffsetRunHeader::new(7, 2406),
- ShortOffsetRunHeader::new(13, 4160),
- ShortOffsetRunHeader::new(47, 4969),
- ShortOffsetRunHeader::new(51, 5870),
- ShortOffsetRunHeader::new(53, 6470),
- ShortOffsetRunHeader::new(61, 8304),
- ShortOffsetRunHeader::new(77, 9312),
- ShortOffsetRunHeader::new(87, 10102),
- ShortOffsetRunHeader::new(91, 11517),
- ShortOffsetRunHeader::new(93, 12295),
- ShortOffsetRunHeader::new(95, 12690),
- ShortOffsetRunHeader::new(101, 42528),
- ShortOffsetRunHeader::new(113, 43056),
- ShortOffsetRunHeader::new(117, 44016),
- ShortOffsetRunHeader::new(129, 65296),
- ShortOffsetRunHeader::new(131, 65799),
- ShortOffsetRunHeader::new(133, 66273),
- ShortOffsetRunHeader::new(139, 67672),
- ShortOffsetRunHeader::new(151, 68858),
- ShortOffsetRunHeader::new(181, 69216),
- ShortOffsetRunHeader::new(187, 70736),
- ShortOffsetRunHeader::new(207, 71248),
- ShortOffsetRunHeader::new(211, 71904),
- ShortOffsetRunHeader::new(219, 72688),
- ShortOffsetRunHeader::new(223, 73552),
- ShortOffsetRunHeader::new(233, 74752),
- ShortOffsetRunHeader::new(237, 90416),
- ShortOffsetRunHeader::new(239, 92768),
- ShortOffsetRunHeader::new(241, 93552),
- ShortOffsetRunHeader::new(249, 93824),
- ShortOffsetRunHeader::new(251, 94196),
- ShortOffsetRunHeader::new(253, 118000),
- ShortOffsetRunHeader::new(255, 119488),
- ShortOffsetRunHeader::new(257, 120782),
- ShortOffsetRunHeader::new(263, 123200),
- ShortOffsetRunHeader::new(265, 123632),
- ShortOffsetRunHeader::new(267, 124144),
- ShortOffsetRunHeader::new(269, 125127),
- ShortOffsetRunHeader::new(273, 126065),
- ShortOffsetRunHeader::new(277, 127232),
- ShortOffsetRunHeader::new(287, 130032),
+ ShortOffsetRunHeader::new(0, 1632), ShortOffsetRunHeader::new(7, 2406),
+ ShortOffsetRunHeader::new(13, 4160), ShortOffsetRunHeader::new(47, 4969),
+ ShortOffsetRunHeader::new(51, 5870), ShortOffsetRunHeader::new(53, 6470),
+ ShortOffsetRunHeader::new(61, 8304), ShortOffsetRunHeader::new(77, 9312),
+ ShortOffsetRunHeader::new(87, 10102), ShortOffsetRunHeader::new(91, 11517),
+ ShortOffsetRunHeader::new(93, 12295), ShortOffsetRunHeader::new(95, 12690),
+ ShortOffsetRunHeader::new(101, 42528), ShortOffsetRunHeader::new(113, 43056),
+ ShortOffsetRunHeader::new(117, 44016), ShortOffsetRunHeader::new(129, 65296),
+ ShortOffsetRunHeader::new(131, 65799), ShortOffsetRunHeader::new(133, 66273),
+ ShortOffsetRunHeader::new(139, 67672), ShortOffsetRunHeader::new(151, 68858),
+ ShortOffsetRunHeader::new(181, 69216), ShortOffsetRunHeader::new(187, 70736),
+ ShortOffsetRunHeader::new(207, 71248), ShortOffsetRunHeader::new(211, 71904),
+ ShortOffsetRunHeader::new(219, 72688), ShortOffsetRunHeader::new(223, 73552),
+ ShortOffsetRunHeader::new(233, 74752), ShortOffsetRunHeader::new(237, 90416),
+ ShortOffsetRunHeader::new(239, 92768), ShortOffsetRunHeader::new(241, 93552),
+ ShortOffsetRunHeader::new(249, 93824), ShortOffsetRunHeader::new(251, 94196),
+ ShortOffsetRunHeader::new(253, 118000), ShortOffsetRunHeader::new(255, 119488),
+ ShortOffsetRunHeader::new(257, 120782), ShortOffsetRunHeader::new(263, 123200),
+ ShortOffsetRunHeader::new(265, 123632), ShortOffsetRunHeader::new(267, 124144),
+ ShortOffsetRunHeader::new(269, 125127), ShortOffsetRunHeader::new(273, 126065),
+ ShortOffsetRunHeader::new(277, 127232), ShortOffsetRunHeader::new(287, 130032),
ShortOffsetRunHeader::new(289, 1244154),
];
static OFFSETS: [u8; 291] = [
178, 2, 5, 1, 2, 3, 0, 10, 134, 10, 198, 10, 0, 10, 118, 10, 4, 6, 108, 10, 118, 10, 118,
10, 2, 6, 110, 13, 115, 10, 8, 7, 103, 10, 104, 7, 7, 19, 109, 10, 96, 10, 118, 10, 70, 20,
- 0, 10, 70, 10, 0, 20, 0, 3, 239, 10, 6, 10, 22, 10, 0, 10, 128, 11, 165, 10, 6, 10, 182,
- 10, 86, 10, 134, 10, 6, 10, 0, 1, 3, 6, 6, 10, 198, 51, 2, 5, 0, 60, 78, 22, 0, 30, 0, 1,
- 0, 1, 25, 9, 14, 3, 0, 4, 138, 10, 30, 8, 1, 15, 32, 10, 39, 15, 0, 10, 188, 10, 0, 6, 154,
- 10, 38, 10, 198, 10, 22, 10, 86, 10, 0, 10, 0, 10, 0, 45, 12, 57, 17, 2, 0, 27, 36, 4, 29,
- 1, 8, 1, 134, 5, 202, 10, 0, 8, 25, 7, 39, 9, 75, 5, 22, 6, 160, 2, 2, 16, 2, 46, 64, 9,
- 52, 2, 30, 3, 75, 5, 104, 8, 24, 8, 41, 7, 0, 6, 48, 10, 6, 10, 0, 31, 158, 10, 42, 4, 112,
- 7, 134, 30, 128, 10, 60, 10, 144, 10, 7, 20, 251, 10, 0, 10, 118, 10, 0, 10, 102, 10, 6,
- 20, 76, 12, 0, 19, 93, 10, 0, 10, 86, 29, 227, 10, 70, 10, 54, 10, 0, 10, 102, 21, 0, 111,
- 0, 10, 0, 10, 86, 10, 134, 10, 1, 7, 0, 10, 0, 23, 0, 3, 0, 10, 0, 20, 12, 20, 108, 25, 0,
- 50, 0, 10, 0, 10, 0, 10, 247, 10, 0, 9, 128, 10, 0, 59, 1, 3, 1, 4, 76, 45, 1, 15, 0, 13,
- 0, 10, 0,
+ 0, 10, 70, 10, 0, 20, 0, 3, 239, 10, 6, 10, 22, 10, 0, 10, 128, 11, 165, 10, 6, 10, 182, 10,
+ 86, 10, 134, 10, 6, 10, 0, 1, 3, 6, 6, 10, 198, 51, 2, 5, 0, 60, 78, 22, 0, 30, 0, 1, 0, 1,
+ 25, 9, 14, 3, 0, 4, 138, 10, 30, 8, 1, 15, 32, 10, 39, 15, 0, 10, 188, 10, 0, 6, 154, 10,
+ 38, 10, 198, 10, 22, 10, 86, 10, 0, 10, 0, 10, 0, 45, 12, 57, 17, 2, 0, 27, 36, 4, 29, 1, 8,
+ 1, 134, 5, 202, 10, 0, 8, 25, 7, 39, 9, 75, 5, 22, 6, 160, 2, 2, 16, 2, 46, 64, 9, 52, 2,
+ 30, 3, 75, 5, 104, 8, 24, 8, 41, 7, 0, 6, 48, 10, 6, 10, 0, 31, 158, 10, 42, 4, 112, 7, 134,
+ 30, 128, 10, 60, 10, 144, 10, 7, 20, 251, 10, 0, 10, 118, 10, 0, 10, 102, 10, 6, 20, 76, 12,
+ 0, 19, 93, 10, 0, 10, 86, 29, 227, 10, 70, 10, 54, 10, 0, 10, 102, 21, 0, 111, 0, 10, 0, 10,
+ 86, 10, 134, 10, 1, 7, 0, 10, 0, 23, 0, 3, 0, 10, 0, 20, 12, 20, 108, 25, 0, 50, 0, 10, 0,
+ 10, 0, 10, 247, 10, 0, 9, 128, 10, 0, 59, 1, 3, 1, 4, 76, 45, 1, 15, 0, 13, 0, 10, 0,
];
-
#[inline]
pub fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
@@ -621,13 +637,14 @@ fn lookup_slow(c: char) -> bool {
}
}
+#[rustfmt::skip]
pub mod uppercase {
static BITSET_CHUNKS_MAP: [u8; 125] = [
3, 14, 6, 6, 0, 6, 6, 2, 5, 12, 6, 15, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 7, 6, 13, 6, 11, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 16, 6,
- 6, 6, 6, 10, 6, 4,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 7, 6, 13, 6, 11, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 16, 6, 6,
+ 6, 6, 10, 6, 4,
];
static BITSET_INDEX_CHUNKS: [[u8; 16]; 17] = [
[44, 44, 5, 35, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 5, 0],
@@ -695,1001 +712,877 @@ pub mod uppercase {
0b1111111100000000111111110000000000111111000000001111111100000000,
];
static BITSET_MAPPING: [(u8, u8); 25] = [
- (0, 182),
- (0, 74),
- (0, 166),
- (0, 162),
- (0, 159),
- (0, 150),
- (0, 148),
- (0, 142),
- (0, 134),
- (0, 131),
- (0, 64),
- (1, 66),
- (1, 70),
- (1, 83),
- (1, 12),
- (1, 8),
- (2, 146),
- (2, 140),
- (2, 134),
- (2, 130),
- (3, 164),
- (3, 146),
- (3, 20),
- (4, 178),
- (4, 171),
+ (0, 182), (0, 74), (0, 166), (0, 162), (0, 159), (0, 150), (0, 148), (0, 142), (0, 134),
+ (0, 131), (0, 64), (1, 66), (1, 70), (1, 83), (1, 12), (1, 8), (2, 146), (2, 140), (2, 134),
+ (2, 130), (3, 164), (3, 146), (3, 20), (4, 178), (4, 171),
];
pub const fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
- (c as u32) >= 0xc0
- && super::bitset_search(
- c as u32,
- &BITSET_CHUNKS_MAP,
- &BITSET_INDEX_CHUNKS,
- &BITSET_CANONICAL,
- &BITSET_MAPPING,
- )
+ (c as u32) >= 0xc0 &&
+ super::bitset_search(
+ c as u32,
+ &BITSET_CHUNKS_MAP,
+ &BITSET_INDEX_CHUNKS,
+ &BITSET_CANONICAL,
+ &BITSET_MAPPING,
+ )
}
}
+#[rustfmt::skip]
pub mod white_space {
static WHITESPACE_MAP: [u8; 256] = [
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
-
#[inline]
pub const fn lookup(c: char) -> bool {
debug_assert!(!c.is_ascii());
match c as u32 >> 8 {
- 0x00 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0,
- 0x16 => c as u32 == 0x1680,
- 0x20 => WHITESPACE_MAP[c as usize & 0xff] & 2 != 0,
- 0x30 => c as u32 == 0x3000,
+ 0 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0,
+ 22 => c as u32 == 0x1680,
+ 32 => WHITESPACE_MAP[c as usize & 0xff] & 2 != 0,
+ 48 => c as u32 == 0x3000,
_ => false,
}
}
}
+#[rustfmt::skip]
pub mod conversions {
- #[rustfmt::skip]
- static LOWERCASE_TABLE: &[(char, u32); 1462] = &[
- ('\u{c0}', 0xe0), ('\u{c1}', 0xe1), ('\u{c2}', 0xe2), ('\u{c3}', 0xe3), ('\u{c4}', 0xe4),
- ('\u{c5}', 0xe5), ('\u{c6}', 0xe6), ('\u{c7}', 0xe7), ('\u{c8}', 0xe8), ('\u{c9}', 0xe9),
- ('\u{ca}', 0xea), ('\u{cb}', 0xeb), ('\u{cc}', 0xec), ('\u{cd}', 0xed), ('\u{ce}', 0xee),
- ('\u{cf}', 0xef), ('\u{d0}', 0xf0), ('\u{d1}', 0xf1), ('\u{d2}', 0xf2), ('\u{d3}', 0xf3),
- ('\u{d4}', 0xf4), ('\u{d5}', 0xf5), ('\u{d6}', 0xf6), ('\u{d8}', 0xf8), ('\u{d9}', 0xf9),
- ('\u{da}', 0xfa), ('\u{db}', 0xfb), ('\u{dc}', 0xfc), ('\u{dd}', 0xfd), ('\u{de}', 0xfe),
- ('\u{100}', 0x101), ('\u{102}', 0x103), ('\u{104}', 0x105), ('\u{106}', 0x107),
- ('\u{108}', 0x109), ('\u{10a}', 0x10b), ('\u{10c}', 0x10d), ('\u{10e}', 0x10f),
- ('\u{110}', 0x111), ('\u{112}', 0x113), ('\u{114}', 0x115), ('\u{116}', 0x117),
- ('\u{118}', 0x119), ('\u{11a}', 0x11b), ('\u{11c}', 0x11d), ('\u{11e}', 0x11f),
- ('\u{120}', 0x121), ('\u{122}', 0x123), ('\u{124}', 0x125), ('\u{126}', 0x127),
- ('\u{128}', 0x129), ('\u{12a}', 0x12b), ('\u{12c}', 0x12d), ('\u{12e}', 0x12f),
- ('\u{130}', 0x400000), ('\u{132}', 0x133), ('\u{134}', 0x135), ('\u{136}', 0x137),
- ('\u{139}', 0x13a), ('\u{13b}', 0x13c), ('\u{13d}', 0x13e), ('\u{13f}', 0x140),
- ('\u{141}', 0x142), ('\u{143}', 0x144), ('\u{145}', 0x146), ('\u{147}', 0x148),
- ('\u{14a}', 0x14b), ('\u{14c}', 0x14d), ('\u{14e}', 0x14f), ('\u{150}', 0x151),
- ('\u{152}', 0x153), ('\u{154}', 0x155), ('\u{156}', 0x157), ('\u{158}', 0x159),
- ('\u{15a}', 0x15b), ('\u{15c}', 0x15d), ('\u{15e}', 0x15f), ('\u{160}', 0x161),
- ('\u{162}', 0x163), ('\u{164}', 0x165), ('\u{166}', 0x167), ('\u{168}', 0x169),
- ('\u{16a}', 0x16b), ('\u{16c}', 0x16d), ('\u{16e}', 0x16f), ('\u{170}', 0x171),
- ('\u{172}', 0x173), ('\u{174}', 0x175), ('\u{176}', 0x177), ('\u{178}', 0xff),
- ('\u{179}', 0x17a), ('\u{17b}', 0x17c), ('\u{17d}', 0x17e), ('\u{181}', 0x253),
- ('\u{182}', 0x183), ('\u{184}', 0x185), ('\u{186}', 0x254), ('\u{187}', 0x188),
- ('\u{189}', 0x256), ('\u{18a}', 0x257), ('\u{18b}', 0x18c), ('\u{18e}', 0x1dd),
- ('\u{18f}', 0x259), ('\u{190}', 0x25b), ('\u{191}', 0x192), ('\u{193}', 0x260),
- ('\u{194}', 0x263), ('\u{196}', 0x269), ('\u{197}', 0x268), ('\u{198}', 0x199),
- ('\u{19c}', 0x26f), ('\u{19d}', 0x272), ('\u{19f}', 0x275), ('\u{1a0}', 0x1a1),
- ('\u{1a2}', 0x1a3), ('\u{1a4}', 0x1a5), ('\u{1a6}', 0x280), ('\u{1a7}', 0x1a8),
- ('\u{1a9}', 0x283), ('\u{1ac}', 0x1ad), ('\u{1ae}', 0x288), ('\u{1af}', 0x1b0),
- ('\u{1b1}', 0x28a), ('\u{1b2}', 0x28b), ('\u{1b3}', 0x1b4), ('\u{1b5}', 0x1b6),
- ('\u{1b7}', 0x292), ('\u{1b8}', 0x1b9), ('\u{1bc}', 0x1bd), ('\u{1c4}', 0x1c6),
- ('\u{1c5}', 0x1c6), ('\u{1c7}', 0x1c9), ('\u{1c8}', 0x1c9), ('\u{1ca}', 0x1cc),
- ('\u{1cb}', 0x1cc), ('\u{1cd}', 0x1ce), ('\u{1cf}', 0x1d0), ('\u{1d1}', 0x1d2),
- ('\u{1d3}', 0x1d4), ('\u{1d5}', 0x1d6), ('\u{1d7}', 0x1d8), ('\u{1d9}', 0x1da),
- ('\u{1db}', 0x1dc), ('\u{1de}', 0x1df), ('\u{1e0}', 0x1e1), ('\u{1e2}', 0x1e3),
- ('\u{1e4}', 0x1e5), ('\u{1e6}', 0x1e7), ('\u{1e8}', 0x1e9), ('\u{1ea}', 0x1eb),
- ('\u{1ec}', 0x1ed), ('\u{1ee}', 0x1ef), ('\u{1f1}', 0x1f3), ('\u{1f2}', 0x1f3),
- ('\u{1f4}', 0x1f5), ('\u{1f6}', 0x195), ('\u{1f7}', 0x1bf), ('\u{1f8}', 0x1f9),
- ('\u{1fa}', 0x1fb), ('\u{1fc}', 0x1fd), ('\u{1fe}', 0x1ff), ('\u{200}', 0x201),
- ('\u{202}', 0x203), ('\u{204}', 0x205), ('\u{206}', 0x207), ('\u{208}', 0x209),
- ('\u{20a}', 0x20b), ('\u{20c}', 0x20d), ('\u{20e}', 0x20f), ('\u{210}', 0x211),
- ('\u{212}', 0x213), ('\u{214}', 0x215), ('\u{216}', 0x217), ('\u{218}', 0x219),
- ('\u{21a}', 0x21b), ('\u{21c}', 0x21d), ('\u{21e}', 0x21f), ('\u{220}', 0x19e),
- ('\u{222}', 0x223), ('\u{224}', 0x225), ('\u{226}', 0x227), ('\u{228}', 0x229),
- ('\u{22a}', 0x22b), ('\u{22c}', 0x22d), ('\u{22e}', 0x22f), ('\u{230}', 0x231),
- ('\u{232}', 0x233), ('\u{23a}', 0x2c65), ('\u{23b}', 0x23c), ('\u{23d}', 0x19a),
- ('\u{23e}', 0x2c66), ('\u{241}', 0x242), ('\u{243}', 0x180), ('\u{244}', 0x289),
- ('\u{245}', 0x28c), ('\u{246}', 0x247), ('\u{248}', 0x249), ('\u{24a}', 0x24b),
- ('\u{24c}', 0x24d), ('\u{24e}', 0x24f), ('\u{370}', 0x371), ('\u{372}', 0x373),
- ('\u{376}', 0x377), ('\u{37f}', 0x3f3), ('\u{386}', 0x3ac), ('\u{388}', 0x3ad),
- ('\u{389}', 0x3ae), ('\u{38a}', 0x3af), ('\u{38c}', 0x3cc), ('\u{38e}', 0x3cd),
- ('\u{38f}', 0x3ce), ('\u{391}', 0x3b1), ('\u{392}', 0x3b2), ('\u{393}', 0x3b3),
- ('\u{394}', 0x3b4), ('\u{395}', 0x3b5), ('\u{396}', 0x3b6), ('\u{397}', 0x3b7),
- ('\u{398}', 0x3b8), ('\u{399}', 0x3b9), ('\u{39a}', 0x3ba), ('\u{39b}', 0x3bb),
- ('\u{39c}', 0x3bc), ('\u{39d}', 0x3bd), ('\u{39e}', 0x3be), ('\u{39f}', 0x3bf),
- ('\u{3a0}', 0x3c0), ('\u{3a1}', 0x3c1), ('\u{3a3}', 0x3c3), ('\u{3a4}', 0x3c4),
- ('\u{3a5}', 0x3c5), ('\u{3a6}', 0x3c6), ('\u{3a7}', 0x3c7), ('\u{3a8}', 0x3c8),
- ('\u{3a9}', 0x3c9), ('\u{3aa}', 0x3ca), ('\u{3ab}', 0x3cb), ('\u{3cf}', 0x3d7),
- ('\u{3d8}', 0x3d9), ('\u{3da}', 0x3db), ('\u{3dc}', 0x3dd), ('\u{3de}', 0x3df),
- ('\u{3e0}', 0x3e1), ('\u{3e2}', 0x3e3), ('\u{3e4}', 0x3e5), ('\u{3e6}', 0x3e7),
- ('\u{3e8}', 0x3e9), ('\u{3ea}', 0x3eb), ('\u{3ec}', 0x3ed), ('\u{3ee}', 0x3ef),
- ('\u{3f4}', 0x3b8), ('\u{3f7}', 0x3f8), ('\u{3f9}', 0x3f2), ('\u{3fa}', 0x3fb),
- ('\u{3fd}', 0x37b), ('\u{3fe}', 0x37c), ('\u{3ff}', 0x37d), ('\u{400}', 0x450),
- ('\u{401}', 0x451), ('\u{402}', 0x452), ('\u{403}', 0x453), ('\u{404}', 0x454),
- ('\u{405}', 0x455), ('\u{406}', 0x456), ('\u{407}', 0x457), ('\u{408}', 0x458),
- ('\u{409}', 0x459), ('\u{40a}', 0x45a), ('\u{40b}', 0x45b), ('\u{40c}', 0x45c),
- ('\u{40d}', 0x45d), ('\u{40e}', 0x45e), ('\u{40f}', 0x45f), ('\u{410}', 0x430),
- ('\u{411}', 0x431), ('\u{412}', 0x432), ('\u{413}', 0x433), ('\u{414}', 0x434),
- ('\u{415}', 0x435), ('\u{416}', 0x436), ('\u{417}', 0x437), ('\u{418}', 0x438),
- ('\u{419}', 0x439), ('\u{41a}', 0x43a), ('\u{41b}', 0x43b), ('\u{41c}', 0x43c),
- ('\u{41d}', 0x43d), ('\u{41e}', 0x43e), ('\u{41f}', 0x43f), ('\u{420}', 0x440),
- ('\u{421}', 0x441), ('\u{422}', 0x442), ('\u{423}', 0x443), ('\u{424}', 0x444),
- ('\u{425}', 0x445), ('\u{426}', 0x446), ('\u{427}', 0x447), ('\u{428}', 0x448),
- ('\u{429}', 0x449), ('\u{42a}', 0x44a), ('\u{42b}', 0x44b), ('\u{42c}', 0x44c),
- ('\u{42d}', 0x44d), ('\u{42e}', 0x44e), ('\u{42f}', 0x44f), ('\u{460}', 0x461),
- ('\u{462}', 0x463), ('\u{464}', 0x465), ('\u{466}', 0x467), ('\u{468}', 0x469),
- ('\u{46a}', 0x46b), ('\u{46c}', 0x46d), ('\u{46e}', 0x46f), ('\u{470}', 0x471),
- ('\u{472}', 0x473), ('\u{474}', 0x475), ('\u{476}', 0x477), ('\u{478}', 0x479),
- ('\u{47a}', 0x47b), ('\u{47c}', 0x47d), ('\u{47e}', 0x47f), ('\u{480}', 0x481),
- ('\u{48a}', 0x48b), ('\u{48c}', 0x48d), ('\u{48e}', 0x48f), ('\u{490}', 0x491),
- ('\u{492}', 0x493), ('\u{494}', 0x495), ('\u{496}', 0x497), ('\u{498}', 0x499),
- ('\u{49a}', 0x49b), ('\u{49c}', 0x49d), ('\u{49e}', 0x49f), ('\u{4a0}', 0x4a1),
- ('\u{4a2}', 0x4a3), ('\u{4a4}', 0x4a5), ('\u{4a6}', 0x4a7), ('\u{4a8}', 0x4a9),
- ('\u{4aa}', 0x4ab), ('\u{4ac}', 0x4ad), ('\u{4ae}', 0x4af), ('\u{4b0}', 0x4b1),
- ('\u{4b2}', 0x4b3), ('\u{4b4}', 0x4b5), ('\u{4b6}', 0x4b7), ('\u{4b8}', 0x4b9),
- ('\u{4ba}', 0x4bb), ('\u{4bc}', 0x4bd), ('\u{4be}', 0x4bf), ('\u{4c0}', 0x4cf),
- ('\u{4c1}', 0x4c2), ('\u{4c3}', 0x4c4), ('\u{4c5}', 0x4c6), ('\u{4c7}', 0x4c8),
- ('\u{4c9}', 0x4ca), ('\u{4cb}', 0x4cc), ('\u{4cd}', 0x4ce), ('\u{4d0}', 0x4d1),
- ('\u{4d2}', 0x4d3), ('\u{4d4}', 0x4d5), ('\u{4d6}', 0x4d7), ('\u{4d8}', 0x4d9),
- ('\u{4da}', 0x4db), ('\u{4dc}', 0x4dd), ('\u{4de}', 0x4df), ('\u{4e0}', 0x4e1),
- ('\u{4e2}', 0x4e3), ('\u{4e4}', 0x4e5), ('\u{4e6}', 0x4e7), ('\u{4e8}', 0x4e9),
- ('\u{4ea}', 0x4eb), ('\u{4ec}', 0x4ed), ('\u{4ee}', 0x4ef), ('\u{4f0}', 0x4f1),
- ('\u{4f2}', 0x4f3), ('\u{4f4}', 0x4f5), ('\u{4f6}', 0x4f7), ('\u{4f8}', 0x4f9),
- ('\u{4fa}', 0x4fb), ('\u{4fc}', 0x4fd), ('\u{4fe}', 0x4ff), ('\u{500}', 0x501),
- ('\u{502}', 0x503), ('\u{504}', 0x505), ('\u{506}', 0x507), ('\u{508}', 0x509),
- ('\u{50a}', 0x50b), ('\u{50c}', 0x50d), ('\u{50e}', 0x50f), ('\u{510}', 0x511),
- ('\u{512}', 0x513), ('\u{514}', 0x515), ('\u{516}', 0x517), ('\u{518}', 0x519),
- ('\u{51a}', 0x51b), ('\u{51c}', 0x51d), ('\u{51e}', 0x51f), ('\u{520}', 0x521),
- ('\u{522}', 0x523), ('\u{524}', 0x525), ('\u{526}', 0x527), ('\u{528}', 0x529),
- ('\u{52a}', 0x52b), ('\u{52c}', 0x52d), ('\u{52e}', 0x52f), ('\u{531}', 0x561),
- ('\u{532}', 0x562), ('\u{533}', 0x563), ('\u{534}', 0x564), ('\u{535}', 0x565),
- ('\u{536}', 0x566), ('\u{537}', 0x567), ('\u{538}', 0x568), ('\u{539}', 0x569),
- ('\u{53a}', 0x56a), ('\u{53b}', 0x56b), ('\u{53c}', 0x56c), ('\u{53d}', 0x56d),
- ('\u{53e}', 0x56e), ('\u{53f}', 0x56f), ('\u{540}', 0x570), ('\u{541}', 0x571),
- ('\u{542}', 0x572), ('\u{543}', 0x573), ('\u{544}', 0x574), ('\u{545}', 0x575),
- ('\u{546}', 0x576), ('\u{547}', 0x577), ('\u{548}', 0x578), ('\u{549}', 0x579),
- ('\u{54a}', 0x57a), ('\u{54b}', 0x57b), ('\u{54c}', 0x57c), ('\u{54d}', 0x57d),
- ('\u{54e}', 0x57e), ('\u{54f}', 0x57f), ('\u{550}', 0x580), ('\u{551}', 0x581),
- ('\u{552}', 0x582), ('\u{553}', 0x583), ('\u{554}', 0x584), ('\u{555}', 0x585),
- ('\u{556}', 0x586), ('\u{10a0}', 0x2d00), ('\u{10a1}', 0x2d01), ('\u{10a2}', 0x2d02),
- ('\u{10a3}', 0x2d03), ('\u{10a4}', 0x2d04), ('\u{10a5}', 0x2d05), ('\u{10a6}', 0x2d06),
- ('\u{10a7}', 0x2d07), ('\u{10a8}', 0x2d08), ('\u{10a9}', 0x2d09), ('\u{10aa}', 0x2d0a),
- ('\u{10ab}', 0x2d0b), ('\u{10ac}', 0x2d0c), ('\u{10ad}', 0x2d0d), ('\u{10ae}', 0x2d0e),
- ('\u{10af}', 0x2d0f), ('\u{10b0}', 0x2d10), ('\u{10b1}', 0x2d11), ('\u{10b2}', 0x2d12),
- ('\u{10b3}', 0x2d13), ('\u{10b4}', 0x2d14), ('\u{10b5}', 0x2d15), ('\u{10b6}', 0x2d16),
- ('\u{10b7}', 0x2d17), ('\u{10b8}', 0x2d18), ('\u{10b9}', 0x2d19), ('\u{10ba}', 0x2d1a),
- ('\u{10bb}', 0x2d1b), ('\u{10bc}', 0x2d1c), ('\u{10bd}', 0x2d1d), ('\u{10be}', 0x2d1e),
- ('\u{10bf}', 0x2d1f), ('\u{10c0}', 0x2d20), ('\u{10c1}', 0x2d21), ('\u{10c2}', 0x2d22),
- ('\u{10c3}', 0x2d23), ('\u{10c4}', 0x2d24), ('\u{10c5}', 0x2d25), ('\u{10c7}', 0x2d27),
- ('\u{10cd}', 0x2d2d), ('\u{13a0}', 0xab70), ('\u{13a1}', 0xab71), ('\u{13a2}', 0xab72),
- ('\u{13a3}', 0xab73), ('\u{13a4}', 0xab74), ('\u{13a5}', 0xab75), ('\u{13a6}', 0xab76),
- ('\u{13a7}', 0xab77), ('\u{13a8}', 0xab78), ('\u{13a9}', 0xab79), ('\u{13aa}', 0xab7a),
- ('\u{13ab}', 0xab7b), ('\u{13ac}', 0xab7c), ('\u{13ad}', 0xab7d), ('\u{13ae}', 0xab7e),
- ('\u{13af}', 0xab7f), ('\u{13b0}', 0xab80), ('\u{13b1}', 0xab81), ('\u{13b2}', 0xab82),
- ('\u{13b3}', 0xab83), ('\u{13b4}', 0xab84), ('\u{13b5}', 0xab85), ('\u{13b6}', 0xab86),
- ('\u{13b7}', 0xab87), ('\u{13b8}', 0xab88), ('\u{13b9}', 0xab89), ('\u{13ba}', 0xab8a),
- ('\u{13bb}', 0xab8b), ('\u{13bc}', 0xab8c), ('\u{13bd}', 0xab8d), ('\u{13be}', 0xab8e),
- ('\u{13bf}', 0xab8f), ('\u{13c0}', 0xab90), ('\u{13c1}', 0xab91), ('\u{13c2}', 0xab92),
- ('\u{13c3}', 0xab93), ('\u{13c4}', 0xab94), ('\u{13c5}', 0xab95), ('\u{13c6}', 0xab96),
- ('\u{13c7}', 0xab97), ('\u{13c8}', 0xab98), ('\u{13c9}', 0xab99), ('\u{13ca}', 0xab9a),
- ('\u{13cb}', 0xab9b), ('\u{13cc}', 0xab9c), ('\u{13cd}', 0xab9d), ('\u{13ce}', 0xab9e),
- ('\u{13cf}', 0xab9f), ('\u{13d0}', 0xaba0), ('\u{13d1}', 0xaba1), ('\u{13d2}', 0xaba2),
- ('\u{13d3}', 0xaba3), ('\u{13d4}', 0xaba4), ('\u{13d5}', 0xaba5), ('\u{13d6}', 0xaba6),
- ('\u{13d7}', 0xaba7), ('\u{13d8}', 0xaba8), ('\u{13d9}', 0xaba9), ('\u{13da}', 0xabaa),
- ('\u{13db}', 0xabab), ('\u{13dc}', 0xabac), ('\u{13dd}', 0xabad), ('\u{13de}', 0xabae),
- ('\u{13df}', 0xabaf), ('\u{13e0}', 0xabb0), ('\u{13e1}', 0xabb1), ('\u{13e2}', 0xabb2),
- ('\u{13e3}', 0xabb3), ('\u{13e4}', 0xabb4), ('\u{13e5}', 0xabb5), ('\u{13e6}', 0xabb6),
- ('\u{13e7}', 0xabb7), ('\u{13e8}', 0xabb8), ('\u{13e9}', 0xabb9), ('\u{13ea}', 0xabba),
- ('\u{13eb}', 0xabbb), ('\u{13ec}', 0xabbc), ('\u{13ed}', 0xabbd), ('\u{13ee}', 0xabbe),
- ('\u{13ef}', 0xabbf), ('\u{13f0}', 0x13f8), ('\u{13f1}', 0x13f9), ('\u{13f2}', 0x13fa),
- ('\u{13f3}', 0x13fb), ('\u{13f4}', 0x13fc), ('\u{13f5}', 0x13fd), ('\u{1c89}', 0x1c8a),
- ('\u{1c90}', 0x10d0), ('\u{1c91}', 0x10d1), ('\u{1c92}', 0x10d2), ('\u{1c93}', 0x10d3),
- ('\u{1c94}', 0x10d4), ('\u{1c95}', 0x10d5), ('\u{1c96}', 0x10d6), ('\u{1c97}', 0x10d7),
- ('\u{1c98}', 0x10d8), ('\u{1c99}', 0x10d9), ('\u{1c9a}', 0x10da), ('\u{1c9b}', 0x10db),
- ('\u{1c9c}', 0x10dc), ('\u{1c9d}', 0x10dd), ('\u{1c9e}', 0x10de), ('\u{1c9f}', 0x10df),
- ('\u{1ca0}', 0x10e0), ('\u{1ca1}', 0x10e1), ('\u{1ca2}', 0x10e2), ('\u{1ca3}', 0x10e3),
- ('\u{1ca4}', 0x10e4), ('\u{1ca5}', 0x10e5), ('\u{1ca6}', 0x10e6), ('\u{1ca7}', 0x10e7),
- ('\u{1ca8}', 0x10e8), ('\u{1ca9}', 0x10e9), ('\u{1caa}', 0x10ea), ('\u{1cab}', 0x10eb),
- ('\u{1cac}', 0x10ec), ('\u{1cad}', 0x10ed), ('\u{1cae}', 0x10ee), ('\u{1caf}', 0x10ef),
- ('\u{1cb0}', 0x10f0), ('\u{1cb1}', 0x10f1), ('\u{1cb2}', 0x10f2), ('\u{1cb3}', 0x10f3),
- ('\u{1cb4}', 0x10f4), ('\u{1cb5}', 0x10f5), ('\u{1cb6}', 0x10f6), ('\u{1cb7}', 0x10f7),
- ('\u{1cb8}', 0x10f8), ('\u{1cb9}', 0x10f9), ('\u{1cba}', 0x10fa), ('\u{1cbd}', 0x10fd),
- ('\u{1cbe}', 0x10fe), ('\u{1cbf}', 0x10ff), ('\u{1e00}', 0x1e01), ('\u{1e02}', 0x1e03),
- ('\u{1e04}', 0x1e05), ('\u{1e06}', 0x1e07), ('\u{1e08}', 0x1e09), ('\u{1e0a}', 0x1e0b),
- ('\u{1e0c}', 0x1e0d), ('\u{1e0e}', 0x1e0f), ('\u{1e10}', 0x1e11), ('\u{1e12}', 0x1e13),
- ('\u{1e14}', 0x1e15), ('\u{1e16}', 0x1e17), ('\u{1e18}', 0x1e19), ('\u{1e1a}', 0x1e1b),
- ('\u{1e1c}', 0x1e1d), ('\u{1e1e}', 0x1e1f), ('\u{1e20}', 0x1e21), ('\u{1e22}', 0x1e23),
- ('\u{1e24}', 0x1e25), ('\u{1e26}', 0x1e27), ('\u{1e28}', 0x1e29), ('\u{1e2a}', 0x1e2b),
- ('\u{1e2c}', 0x1e2d), ('\u{1e2e}', 0x1e2f), ('\u{1e30}', 0x1e31), ('\u{1e32}', 0x1e33),
- ('\u{1e34}', 0x1e35), ('\u{1e36}', 0x1e37), ('\u{1e38}', 0x1e39), ('\u{1e3a}', 0x1e3b),
- ('\u{1e3c}', 0x1e3d), ('\u{1e3e}', 0x1e3f), ('\u{1e40}', 0x1e41), ('\u{1e42}', 0x1e43),
- ('\u{1e44}', 0x1e45), ('\u{1e46}', 0x1e47), ('\u{1e48}', 0x1e49), ('\u{1e4a}', 0x1e4b),
- ('\u{1e4c}', 0x1e4d), ('\u{1e4e}', 0x1e4f), ('\u{1e50}', 0x1e51), ('\u{1e52}', 0x1e53),
- ('\u{1e54}', 0x1e55), ('\u{1e56}', 0x1e57), ('\u{1e58}', 0x1e59), ('\u{1e5a}', 0x1e5b),
- ('\u{1e5c}', 0x1e5d), ('\u{1e5e}', 0x1e5f), ('\u{1e60}', 0x1e61), ('\u{1e62}', 0x1e63),
- ('\u{1e64}', 0x1e65), ('\u{1e66}', 0x1e67), ('\u{1e68}', 0x1e69), ('\u{1e6a}', 0x1e6b),
- ('\u{1e6c}', 0x1e6d), ('\u{1e6e}', 0x1e6f), ('\u{1e70}', 0x1e71), ('\u{1e72}', 0x1e73),
- ('\u{1e74}', 0x1e75), ('\u{1e76}', 0x1e77), ('\u{1e78}', 0x1e79), ('\u{1e7a}', 0x1e7b),
- ('\u{1e7c}', 0x1e7d), ('\u{1e7e}', 0x1e7f), ('\u{1e80}', 0x1e81), ('\u{1e82}', 0x1e83),
- ('\u{1e84}', 0x1e85), ('\u{1e86}', 0x1e87), ('\u{1e88}', 0x1e89), ('\u{1e8a}', 0x1e8b),
- ('\u{1e8c}', 0x1e8d), ('\u{1e8e}', 0x1e8f), ('\u{1e90}', 0x1e91), ('\u{1e92}', 0x1e93),
- ('\u{1e94}', 0x1e95), ('\u{1e9e}', 0xdf), ('\u{1ea0}', 0x1ea1), ('\u{1ea2}', 0x1ea3),
- ('\u{1ea4}', 0x1ea5), ('\u{1ea6}', 0x1ea7), ('\u{1ea8}', 0x1ea9), ('\u{1eaa}', 0x1eab),
- ('\u{1eac}', 0x1ead), ('\u{1eae}', 0x1eaf), ('\u{1eb0}', 0x1eb1), ('\u{1eb2}', 0x1eb3),
- ('\u{1eb4}', 0x1eb5), ('\u{1eb6}', 0x1eb7), ('\u{1eb8}', 0x1eb9), ('\u{1eba}', 0x1ebb),
- ('\u{1ebc}', 0x1ebd), ('\u{1ebe}', 0x1ebf), ('\u{1ec0}', 0x1ec1), ('\u{1ec2}', 0x1ec3),
- ('\u{1ec4}', 0x1ec5), ('\u{1ec6}', 0x1ec7), ('\u{1ec8}', 0x1ec9), ('\u{1eca}', 0x1ecb),
- ('\u{1ecc}', 0x1ecd), ('\u{1ece}', 0x1ecf), ('\u{1ed0}', 0x1ed1), ('\u{1ed2}', 0x1ed3),
- ('\u{1ed4}', 0x1ed5), ('\u{1ed6}', 0x1ed7), ('\u{1ed8}', 0x1ed9), ('\u{1eda}', 0x1edb),
- ('\u{1edc}', 0x1edd), ('\u{1ede}', 0x1edf), ('\u{1ee0}', 0x1ee1), ('\u{1ee2}', 0x1ee3),
- ('\u{1ee4}', 0x1ee5), ('\u{1ee6}', 0x1ee7), ('\u{1ee8}', 0x1ee9), ('\u{1eea}', 0x1eeb),
- ('\u{1eec}', 0x1eed), ('\u{1eee}', 0x1eef), ('\u{1ef0}', 0x1ef1), ('\u{1ef2}', 0x1ef3),
- ('\u{1ef4}', 0x1ef5), ('\u{1ef6}', 0x1ef7), ('\u{1ef8}', 0x1ef9), ('\u{1efa}', 0x1efb),
- ('\u{1efc}', 0x1efd), ('\u{1efe}', 0x1eff), ('\u{1f08}', 0x1f00), ('\u{1f09}', 0x1f01),
- ('\u{1f0a}', 0x1f02), ('\u{1f0b}', 0x1f03), ('\u{1f0c}', 0x1f04), ('\u{1f0d}', 0x1f05),
- ('\u{1f0e}', 0x1f06), ('\u{1f0f}', 0x1f07), ('\u{1f18}', 0x1f10), ('\u{1f19}', 0x1f11),
- ('\u{1f1a}', 0x1f12), ('\u{1f1b}', 0x1f13), ('\u{1f1c}', 0x1f14), ('\u{1f1d}', 0x1f15),
- ('\u{1f28}', 0x1f20), ('\u{1f29}', 0x1f21), ('\u{1f2a}', 0x1f22), ('\u{1f2b}', 0x1f23),
- ('\u{1f2c}', 0x1f24), ('\u{1f2d}', 0x1f25), ('\u{1f2e}', 0x1f26), ('\u{1f2f}', 0x1f27),
- ('\u{1f38}', 0x1f30), ('\u{1f39}', 0x1f31), ('\u{1f3a}', 0x1f32), ('\u{1f3b}', 0x1f33),
- ('\u{1f3c}', 0x1f34), ('\u{1f3d}', 0x1f35), ('\u{1f3e}', 0x1f36), ('\u{1f3f}', 0x1f37),
- ('\u{1f48}', 0x1f40), ('\u{1f49}', 0x1f41), ('\u{1f4a}', 0x1f42), ('\u{1f4b}', 0x1f43),
- ('\u{1f4c}', 0x1f44), ('\u{1f4d}', 0x1f45), ('\u{1f59}', 0x1f51), ('\u{1f5b}', 0x1f53),
- ('\u{1f5d}', 0x1f55), ('\u{1f5f}', 0x1f57), ('\u{1f68}', 0x1f60), ('\u{1f69}', 0x1f61),
- ('\u{1f6a}', 0x1f62), ('\u{1f6b}', 0x1f63), ('\u{1f6c}', 0x1f64), ('\u{1f6d}', 0x1f65),
- ('\u{1f6e}', 0x1f66), ('\u{1f6f}', 0x1f67), ('\u{1f88}', 0x1f80), ('\u{1f89}', 0x1f81),
- ('\u{1f8a}', 0x1f82), ('\u{1f8b}', 0x1f83), ('\u{1f8c}', 0x1f84), ('\u{1f8d}', 0x1f85),
- ('\u{1f8e}', 0x1f86), ('\u{1f8f}', 0x1f87), ('\u{1f98}', 0x1f90), ('\u{1f99}', 0x1f91),
- ('\u{1f9a}', 0x1f92), ('\u{1f9b}', 0x1f93), ('\u{1f9c}', 0x1f94), ('\u{1f9d}', 0x1f95),
- ('\u{1f9e}', 0x1f96), ('\u{1f9f}', 0x1f97), ('\u{1fa8}', 0x1fa0), ('\u{1fa9}', 0x1fa1),
- ('\u{1faa}', 0x1fa2), ('\u{1fab}', 0x1fa3), ('\u{1fac}', 0x1fa4), ('\u{1fad}', 0x1fa5),
- ('\u{1fae}', 0x1fa6), ('\u{1faf}', 0x1fa7), ('\u{1fb8}', 0x1fb0), ('\u{1fb9}', 0x1fb1),
- ('\u{1fba}', 0x1f70), ('\u{1fbb}', 0x1f71), ('\u{1fbc}', 0x1fb3), ('\u{1fc8}', 0x1f72),
- ('\u{1fc9}', 0x1f73), ('\u{1fca}', 0x1f74), ('\u{1fcb}', 0x1f75), ('\u{1fcc}', 0x1fc3),
- ('\u{1fd8}', 0x1fd0), ('\u{1fd9}', 0x1fd1), ('\u{1fda}', 0x1f76), ('\u{1fdb}', 0x1f77),
- ('\u{1fe8}', 0x1fe0), ('\u{1fe9}', 0x1fe1), ('\u{1fea}', 0x1f7a), ('\u{1feb}', 0x1f7b),
- ('\u{1fec}', 0x1fe5), ('\u{1ff8}', 0x1f78), ('\u{1ff9}', 0x1f79), ('\u{1ffa}', 0x1f7c),
- ('\u{1ffb}', 0x1f7d), ('\u{1ffc}', 0x1ff3), ('\u{2126}', 0x3c9), ('\u{212a}', 0x6b),
- ('\u{212b}', 0xe5), ('\u{2132}', 0x214e), ('\u{2160}', 0x2170), ('\u{2161}', 0x2171),
- ('\u{2162}', 0x2172), ('\u{2163}', 0x2173), ('\u{2164}', 0x2174), ('\u{2165}', 0x2175),
- ('\u{2166}', 0x2176), ('\u{2167}', 0x2177), ('\u{2168}', 0x2178), ('\u{2169}', 0x2179),
- ('\u{216a}', 0x217a), ('\u{216b}', 0x217b), ('\u{216c}', 0x217c), ('\u{216d}', 0x217d),
- ('\u{216e}', 0x217e), ('\u{216f}', 0x217f), ('\u{2183}', 0x2184), ('\u{24b6}', 0x24d0),
- ('\u{24b7}', 0x24d1), ('\u{24b8}', 0x24d2), ('\u{24b9}', 0x24d3), ('\u{24ba}', 0x24d4),
- ('\u{24bb}', 0x24d5), ('\u{24bc}', 0x24d6), ('\u{24bd}', 0x24d7), ('\u{24be}', 0x24d8),
- ('\u{24bf}', 0x24d9), ('\u{24c0}', 0x24da), ('\u{24c1}', 0x24db), ('\u{24c2}', 0x24dc),
- ('\u{24c3}', 0x24dd), ('\u{24c4}', 0x24de), ('\u{24c5}', 0x24df), ('\u{24c6}', 0x24e0),
- ('\u{24c7}', 0x24e1), ('\u{24c8}', 0x24e2), ('\u{24c9}', 0x24e3), ('\u{24ca}', 0x24e4),
- ('\u{24cb}', 0x24e5), ('\u{24cc}', 0x24e6), ('\u{24cd}', 0x24e7), ('\u{24ce}', 0x24e8),
- ('\u{24cf}', 0x24e9), ('\u{2c00}', 0x2c30), ('\u{2c01}', 0x2c31), ('\u{2c02}', 0x2c32),
- ('\u{2c03}', 0x2c33), ('\u{2c04}', 0x2c34), ('\u{2c05}', 0x2c35), ('\u{2c06}', 0x2c36),
- ('\u{2c07}', 0x2c37), ('\u{2c08}', 0x2c38), ('\u{2c09}', 0x2c39), ('\u{2c0a}', 0x2c3a),
- ('\u{2c0b}', 0x2c3b), ('\u{2c0c}', 0x2c3c), ('\u{2c0d}', 0x2c3d), ('\u{2c0e}', 0x2c3e),
- ('\u{2c0f}', 0x2c3f), ('\u{2c10}', 0x2c40), ('\u{2c11}', 0x2c41), ('\u{2c12}', 0x2c42),
- ('\u{2c13}', 0x2c43), ('\u{2c14}', 0x2c44), ('\u{2c15}', 0x2c45), ('\u{2c16}', 0x2c46),
- ('\u{2c17}', 0x2c47), ('\u{2c18}', 0x2c48), ('\u{2c19}', 0x2c49), ('\u{2c1a}', 0x2c4a),
- ('\u{2c1b}', 0x2c4b), ('\u{2c1c}', 0x2c4c), ('\u{2c1d}', 0x2c4d), ('\u{2c1e}', 0x2c4e),
- ('\u{2c1f}', 0x2c4f), ('\u{2c20}', 0x2c50), ('\u{2c21}', 0x2c51), ('\u{2c22}', 0x2c52),
- ('\u{2c23}', 0x2c53), ('\u{2c24}', 0x2c54), ('\u{2c25}', 0x2c55), ('\u{2c26}', 0x2c56),
- ('\u{2c27}', 0x2c57), ('\u{2c28}', 0x2c58), ('\u{2c29}', 0x2c59), ('\u{2c2a}', 0x2c5a),
- ('\u{2c2b}', 0x2c5b), ('\u{2c2c}', 0x2c5c), ('\u{2c2d}', 0x2c5d), ('\u{2c2e}', 0x2c5e),
- ('\u{2c2f}', 0x2c5f), ('\u{2c60}', 0x2c61), ('\u{2c62}', 0x26b), ('\u{2c63}', 0x1d7d),
- ('\u{2c64}', 0x27d), ('\u{2c67}', 0x2c68), ('\u{2c69}', 0x2c6a), ('\u{2c6b}', 0x2c6c),
- ('\u{2c6d}', 0x251), ('\u{2c6e}', 0x271), ('\u{2c6f}', 0x250), ('\u{2c70}', 0x252),
- ('\u{2c72}', 0x2c73), ('\u{2c75}', 0x2c76), ('\u{2c7e}', 0x23f), ('\u{2c7f}', 0x240),
- ('\u{2c80}', 0x2c81), ('\u{2c82}', 0x2c83), ('\u{2c84}', 0x2c85), ('\u{2c86}', 0x2c87),
- ('\u{2c88}', 0x2c89), ('\u{2c8a}', 0x2c8b), ('\u{2c8c}', 0x2c8d), ('\u{2c8e}', 0x2c8f),
- ('\u{2c90}', 0x2c91), ('\u{2c92}', 0x2c93), ('\u{2c94}', 0x2c95), ('\u{2c96}', 0x2c97),
- ('\u{2c98}', 0x2c99), ('\u{2c9a}', 0x2c9b), ('\u{2c9c}', 0x2c9d), ('\u{2c9e}', 0x2c9f),
- ('\u{2ca0}', 0x2ca1), ('\u{2ca2}', 0x2ca3), ('\u{2ca4}', 0x2ca5), ('\u{2ca6}', 0x2ca7),
- ('\u{2ca8}', 0x2ca9), ('\u{2caa}', 0x2cab), ('\u{2cac}', 0x2cad), ('\u{2cae}', 0x2caf),
- ('\u{2cb0}', 0x2cb1), ('\u{2cb2}', 0x2cb3), ('\u{2cb4}', 0x2cb5), ('\u{2cb6}', 0x2cb7),
- ('\u{2cb8}', 0x2cb9), ('\u{2cba}', 0x2cbb), ('\u{2cbc}', 0x2cbd), ('\u{2cbe}', 0x2cbf),
- ('\u{2cc0}', 0x2cc1), ('\u{2cc2}', 0x2cc3), ('\u{2cc4}', 0x2cc5), ('\u{2cc6}', 0x2cc7),
- ('\u{2cc8}', 0x2cc9), ('\u{2cca}', 0x2ccb), ('\u{2ccc}', 0x2ccd), ('\u{2cce}', 0x2ccf),
- ('\u{2cd0}', 0x2cd1), ('\u{2cd2}', 0x2cd3), ('\u{2cd4}', 0x2cd5), ('\u{2cd6}', 0x2cd7),
- ('\u{2cd8}', 0x2cd9), ('\u{2cda}', 0x2cdb), ('\u{2cdc}', 0x2cdd), ('\u{2cde}', 0x2cdf),
- ('\u{2ce0}', 0x2ce1), ('\u{2ce2}', 0x2ce3), ('\u{2ceb}', 0x2cec), ('\u{2ced}', 0x2cee),
- ('\u{2cf2}', 0x2cf3), ('\u{a640}', 0xa641), ('\u{a642}', 0xa643), ('\u{a644}', 0xa645),
- ('\u{a646}', 0xa647), ('\u{a648}', 0xa649), ('\u{a64a}', 0xa64b), ('\u{a64c}', 0xa64d),
- ('\u{a64e}', 0xa64f), ('\u{a650}', 0xa651), ('\u{a652}', 0xa653), ('\u{a654}', 0xa655),
- ('\u{a656}', 0xa657), ('\u{a658}', 0xa659), ('\u{a65a}', 0xa65b), ('\u{a65c}', 0xa65d),
- ('\u{a65e}', 0xa65f), ('\u{a660}', 0xa661), ('\u{a662}', 0xa663), ('\u{a664}', 0xa665),
- ('\u{a666}', 0xa667), ('\u{a668}', 0xa669), ('\u{a66a}', 0xa66b), ('\u{a66c}', 0xa66d),
- ('\u{a680}', 0xa681), ('\u{a682}', 0xa683), ('\u{a684}', 0xa685), ('\u{a686}', 0xa687),
- ('\u{a688}', 0xa689), ('\u{a68a}', 0xa68b), ('\u{a68c}', 0xa68d), ('\u{a68e}', 0xa68f),
- ('\u{a690}', 0xa691), ('\u{a692}', 0xa693), ('\u{a694}', 0xa695), ('\u{a696}', 0xa697),
- ('\u{a698}', 0xa699), ('\u{a69a}', 0xa69b), ('\u{a722}', 0xa723), ('\u{a724}', 0xa725),
- ('\u{a726}', 0xa727), ('\u{a728}', 0xa729), ('\u{a72a}', 0xa72b), ('\u{a72c}', 0xa72d),
- ('\u{a72e}', 0xa72f), ('\u{a732}', 0xa733), ('\u{a734}', 0xa735), ('\u{a736}', 0xa737),
- ('\u{a738}', 0xa739), ('\u{a73a}', 0xa73b), ('\u{a73c}', 0xa73d), ('\u{a73e}', 0xa73f),
- ('\u{a740}', 0xa741), ('\u{a742}', 0xa743), ('\u{a744}', 0xa745), ('\u{a746}', 0xa747),
- ('\u{a748}', 0xa749), ('\u{a74a}', 0xa74b), ('\u{a74c}', 0xa74d), ('\u{a74e}', 0xa74f),
- ('\u{a750}', 0xa751), ('\u{a752}', 0xa753), ('\u{a754}', 0xa755), ('\u{a756}', 0xa757),
- ('\u{a758}', 0xa759), ('\u{a75a}', 0xa75b), ('\u{a75c}', 0xa75d), ('\u{a75e}', 0xa75f),
- ('\u{a760}', 0xa761), ('\u{a762}', 0xa763), ('\u{a764}', 0xa765), ('\u{a766}', 0xa767),
- ('\u{a768}', 0xa769), ('\u{a76a}', 0xa76b), ('\u{a76c}', 0xa76d), ('\u{a76e}', 0xa76f),
- ('\u{a779}', 0xa77a), ('\u{a77b}', 0xa77c), ('\u{a77d}', 0x1d79), ('\u{a77e}', 0xa77f),
- ('\u{a780}', 0xa781), ('\u{a782}', 0xa783), ('\u{a784}', 0xa785), ('\u{a786}', 0xa787),
- ('\u{a78b}', 0xa78c), ('\u{a78d}', 0x265), ('\u{a790}', 0xa791), ('\u{a792}', 0xa793),
- ('\u{a796}', 0xa797), ('\u{a798}', 0xa799), ('\u{a79a}', 0xa79b), ('\u{a79c}', 0xa79d),
- ('\u{a79e}', 0xa79f), ('\u{a7a0}', 0xa7a1), ('\u{a7a2}', 0xa7a3), ('\u{a7a4}', 0xa7a5),
- ('\u{a7a6}', 0xa7a7), ('\u{a7a8}', 0xa7a9), ('\u{a7aa}', 0x266), ('\u{a7ab}', 0x25c),
- ('\u{a7ac}', 0x261), ('\u{a7ad}', 0x26c), ('\u{a7ae}', 0x26a), ('\u{a7b0}', 0x29e),
- ('\u{a7b1}', 0x287), ('\u{a7b2}', 0x29d), ('\u{a7b3}', 0xab53), ('\u{a7b4}', 0xa7b5),
- ('\u{a7b6}', 0xa7b7), ('\u{a7b8}', 0xa7b9), ('\u{a7ba}', 0xa7bb), ('\u{a7bc}', 0xa7bd),
- ('\u{a7be}', 0xa7bf), ('\u{a7c0}', 0xa7c1), ('\u{a7c2}', 0xa7c3), ('\u{a7c4}', 0xa794),
- ('\u{a7c5}', 0x282), ('\u{a7c6}', 0x1d8e), ('\u{a7c7}', 0xa7c8), ('\u{a7c9}', 0xa7ca),
- ('\u{a7cb}', 0x264), ('\u{a7cc}', 0xa7cd), ('\u{a7ce}', 0xa7cf), ('\u{a7d0}', 0xa7d1),
- ('\u{a7d2}', 0xa7d3), ('\u{a7d4}', 0xa7d5), ('\u{a7d6}', 0xa7d7), ('\u{a7d8}', 0xa7d9),
- ('\u{a7da}', 0xa7db), ('\u{a7dc}', 0x19b), ('\u{a7f5}', 0xa7f6), ('\u{ff21}', 0xff41),
- ('\u{ff22}', 0xff42), ('\u{ff23}', 0xff43), ('\u{ff24}', 0xff44), ('\u{ff25}', 0xff45),
- ('\u{ff26}', 0xff46), ('\u{ff27}', 0xff47), ('\u{ff28}', 0xff48), ('\u{ff29}', 0xff49),
- ('\u{ff2a}', 0xff4a), ('\u{ff2b}', 0xff4b), ('\u{ff2c}', 0xff4c), ('\u{ff2d}', 0xff4d),
- ('\u{ff2e}', 0xff4e), ('\u{ff2f}', 0xff4f), ('\u{ff30}', 0xff50), ('\u{ff31}', 0xff51),
- ('\u{ff32}', 0xff52), ('\u{ff33}', 0xff53), ('\u{ff34}', 0xff54), ('\u{ff35}', 0xff55),
- ('\u{ff36}', 0xff56), ('\u{ff37}', 0xff57), ('\u{ff38}', 0xff58), ('\u{ff39}', 0xff59),
- ('\u{ff3a}', 0xff5a), ('\u{10400}', 0x10428), ('\u{10401}', 0x10429),
- ('\u{10402}', 0x1042a), ('\u{10403}', 0x1042b), ('\u{10404}', 0x1042c),
- ('\u{10405}', 0x1042d), ('\u{10406}', 0x1042e), ('\u{10407}', 0x1042f),
- ('\u{10408}', 0x10430), ('\u{10409}', 0x10431), ('\u{1040a}', 0x10432),
- ('\u{1040b}', 0x10433), ('\u{1040c}', 0x10434), ('\u{1040d}', 0x10435),
- ('\u{1040e}', 0x10436), ('\u{1040f}', 0x10437), ('\u{10410}', 0x10438),
- ('\u{10411}', 0x10439), ('\u{10412}', 0x1043a), ('\u{10413}', 0x1043b),
- ('\u{10414}', 0x1043c), ('\u{10415}', 0x1043d), ('\u{10416}', 0x1043e),
- ('\u{10417}', 0x1043f), ('\u{10418}', 0x10440), ('\u{10419}', 0x10441),
- ('\u{1041a}', 0x10442), ('\u{1041b}', 0x10443), ('\u{1041c}', 0x10444),
- ('\u{1041d}', 0x10445), ('\u{1041e}', 0x10446), ('\u{1041f}', 0x10447),
- ('\u{10420}', 0x10448), ('\u{10421}', 0x10449), ('\u{10422}', 0x1044a),
- ('\u{10423}', 0x1044b), ('\u{10424}', 0x1044c), ('\u{10425}', 0x1044d),
- ('\u{10426}', 0x1044e), ('\u{10427}', 0x1044f), ('\u{104b0}', 0x104d8),
- ('\u{104b1}', 0x104d9), ('\u{104b2}', 0x104da), ('\u{104b3}', 0x104db),
- ('\u{104b4}', 0x104dc), ('\u{104b5}', 0x104dd), ('\u{104b6}', 0x104de),
- ('\u{104b7}', 0x104df), ('\u{104b8}', 0x104e0), ('\u{104b9}', 0x104e1),
- ('\u{104ba}', 0x104e2), ('\u{104bb}', 0x104e3), ('\u{104bc}', 0x104e4),
- ('\u{104bd}', 0x104e5), ('\u{104be}', 0x104e6), ('\u{104bf}', 0x104e7),
- ('\u{104c0}', 0x104e8), ('\u{104c1}', 0x104e9), ('\u{104c2}', 0x104ea),
- ('\u{104c3}', 0x104eb), ('\u{104c4}', 0x104ec), ('\u{104c5}', 0x104ed),
- ('\u{104c6}', 0x104ee), ('\u{104c7}', 0x104ef), ('\u{104c8}', 0x104f0),
- ('\u{104c9}', 0x104f1), ('\u{104ca}', 0x104f2), ('\u{104cb}', 0x104f3),
- ('\u{104cc}', 0x104f4), ('\u{104cd}', 0x104f5), ('\u{104ce}', 0x104f6),
- ('\u{104cf}', 0x104f7), ('\u{104d0}', 0x104f8), ('\u{104d1}', 0x104f9),
- ('\u{104d2}', 0x104fa), ('\u{104d3}', 0x104fb), ('\u{10570}', 0x10597),
- ('\u{10571}', 0x10598), ('\u{10572}', 0x10599), ('\u{10573}', 0x1059a),
- ('\u{10574}', 0x1059b), ('\u{10575}', 0x1059c), ('\u{10576}', 0x1059d),
- ('\u{10577}', 0x1059e), ('\u{10578}', 0x1059f), ('\u{10579}', 0x105a0),
- ('\u{1057a}', 0x105a1), ('\u{1057c}', 0x105a3), ('\u{1057d}', 0x105a4),
- ('\u{1057e}', 0x105a5), ('\u{1057f}', 0x105a6), ('\u{10580}', 0x105a7),
- ('\u{10581}', 0x105a8), ('\u{10582}', 0x105a9), ('\u{10583}', 0x105aa),
- ('\u{10584}', 0x105ab), ('\u{10585}', 0x105ac), ('\u{10586}', 0x105ad),
- ('\u{10587}', 0x105ae), ('\u{10588}', 0x105af), ('\u{10589}', 0x105b0),
- ('\u{1058a}', 0x105b1), ('\u{1058c}', 0x105b3), ('\u{1058d}', 0x105b4),
- ('\u{1058e}', 0x105b5), ('\u{1058f}', 0x105b6), ('\u{10590}', 0x105b7),
- ('\u{10591}', 0x105b8), ('\u{10592}', 0x105b9), ('\u{10594}', 0x105bb),
- ('\u{10595}', 0x105bc), ('\u{10c80}', 0x10cc0), ('\u{10c81}', 0x10cc1),
- ('\u{10c82}', 0x10cc2), ('\u{10c83}', 0x10cc3), ('\u{10c84}', 0x10cc4),
- ('\u{10c85}', 0x10cc5), ('\u{10c86}', 0x10cc6), ('\u{10c87}', 0x10cc7),
- ('\u{10c88}', 0x10cc8), ('\u{10c89}', 0x10cc9), ('\u{10c8a}', 0x10cca),
- ('\u{10c8b}', 0x10ccb), ('\u{10c8c}', 0x10ccc), ('\u{10c8d}', 0x10ccd),
- ('\u{10c8e}', 0x10cce), ('\u{10c8f}', 0x10ccf), ('\u{10c90}', 0x10cd0),
- ('\u{10c91}', 0x10cd1), ('\u{10c92}', 0x10cd2), ('\u{10c93}', 0x10cd3),
- ('\u{10c94}', 0x10cd4), ('\u{10c95}', 0x10cd5), ('\u{10c96}', 0x10cd6),
- ('\u{10c97}', 0x10cd7), ('\u{10c98}', 0x10cd8), ('\u{10c99}', 0x10cd9),
- ('\u{10c9a}', 0x10cda), ('\u{10c9b}', 0x10cdb), ('\u{10c9c}', 0x10cdc),
- ('\u{10c9d}', 0x10cdd), ('\u{10c9e}', 0x10cde), ('\u{10c9f}', 0x10cdf),
- ('\u{10ca0}', 0x10ce0), ('\u{10ca1}', 0x10ce1), ('\u{10ca2}', 0x10ce2),
- ('\u{10ca3}', 0x10ce3), ('\u{10ca4}', 0x10ce4), ('\u{10ca5}', 0x10ce5),
- ('\u{10ca6}', 0x10ce6), ('\u{10ca7}', 0x10ce7), ('\u{10ca8}', 0x10ce8),
- ('\u{10ca9}', 0x10ce9), ('\u{10caa}', 0x10cea), ('\u{10cab}', 0x10ceb),
- ('\u{10cac}', 0x10cec), ('\u{10cad}', 0x10ced), ('\u{10cae}', 0x10cee),
- ('\u{10caf}', 0x10cef), ('\u{10cb0}', 0x10cf0), ('\u{10cb1}', 0x10cf1),
- ('\u{10cb2}', 0x10cf2), ('\u{10d50}', 0x10d70), ('\u{10d51}', 0x10d71),
- ('\u{10d52}', 0x10d72), ('\u{10d53}', 0x10d73), ('\u{10d54}', 0x10d74),
- ('\u{10d55}', 0x10d75), ('\u{10d56}', 0x10d76), ('\u{10d57}', 0x10d77),
- ('\u{10d58}', 0x10d78), ('\u{10d59}', 0x10d79), ('\u{10d5a}', 0x10d7a),
- ('\u{10d5b}', 0x10d7b), ('\u{10d5c}', 0x10d7c), ('\u{10d5d}', 0x10d7d),
- ('\u{10d5e}', 0x10d7e), ('\u{10d5f}', 0x10d7f), ('\u{10d60}', 0x10d80),
- ('\u{10d61}', 0x10d81), ('\u{10d62}', 0x10d82), ('\u{10d63}', 0x10d83),
- ('\u{10d64}', 0x10d84), ('\u{10d65}', 0x10d85), ('\u{118a0}', 0x118c0),
- ('\u{118a1}', 0x118c1), ('\u{118a2}', 0x118c2), ('\u{118a3}', 0x118c3),
- ('\u{118a4}', 0x118c4), ('\u{118a5}', 0x118c5), ('\u{118a6}', 0x118c6),
- ('\u{118a7}', 0x118c7), ('\u{118a8}', 0x118c8), ('\u{118a9}', 0x118c9),
- ('\u{118aa}', 0x118ca), ('\u{118ab}', 0x118cb), ('\u{118ac}', 0x118cc),
- ('\u{118ad}', 0x118cd), ('\u{118ae}', 0x118ce), ('\u{118af}', 0x118cf),
- ('\u{118b0}', 0x118d0), ('\u{118b1}', 0x118d1), ('\u{118b2}', 0x118d2),
- ('\u{118b3}', 0x118d3), ('\u{118b4}', 0x118d4), ('\u{118b5}', 0x118d5),
- ('\u{118b6}', 0x118d6), ('\u{118b7}', 0x118d7), ('\u{118b8}', 0x118d8),
- ('\u{118b9}', 0x118d9), ('\u{118ba}', 0x118da), ('\u{118bb}', 0x118db),
- ('\u{118bc}', 0x118dc), ('\u{118bd}', 0x118dd), ('\u{118be}', 0x118de),
- ('\u{118bf}', 0x118df), ('\u{16e40}', 0x16e60), ('\u{16e41}', 0x16e61),
- ('\u{16e42}', 0x16e62), ('\u{16e43}', 0x16e63), ('\u{16e44}', 0x16e64),
- ('\u{16e45}', 0x16e65), ('\u{16e46}', 0x16e66), ('\u{16e47}', 0x16e67),
- ('\u{16e48}', 0x16e68), ('\u{16e49}', 0x16e69), ('\u{16e4a}', 0x16e6a),
- ('\u{16e4b}', 0x16e6b), ('\u{16e4c}', 0x16e6c), ('\u{16e4d}', 0x16e6d),
- ('\u{16e4e}', 0x16e6e), ('\u{16e4f}', 0x16e6f), ('\u{16e50}', 0x16e70),
- ('\u{16e51}', 0x16e71), ('\u{16e52}', 0x16e72), ('\u{16e53}', 0x16e73),
- ('\u{16e54}', 0x16e74), ('\u{16e55}', 0x16e75), ('\u{16e56}', 0x16e76),
- ('\u{16e57}', 0x16e77), ('\u{16e58}', 0x16e78), ('\u{16e59}', 0x16e79),
- ('\u{16e5a}', 0x16e7a), ('\u{16e5b}', 0x16e7b), ('\u{16e5c}', 0x16e7c),
- ('\u{16e5d}', 0x16e7d), ('\u{16e5e}', 0x16e7e), ('\u{16e5f}', 0x16e7f),
- ('\u{16ea0}', 0x16ebb), ('\u{16ea1}', 0x16ebc), ('\u{16ea2}', 0x16ebd),
- ('\u{16ea3}', 0x16ebe), ('\u{16ea4}', 0x16ebf), ('\u{16ea5}', 0x16ec0),
- ('\u{16ea6}', 0x16ec1), ('\u{16ea7}', 0x16ec2), ('\u{16ea8}', 0x16ec3),
- ('\u{16ea9}', 0x16ec4), ('\u{16eaa}', 0x16ec5), ('\u{16eab}', 0x16ec6),
- ('\u{16eac}', 0x16ec7), ('\u{16ead}', 0x16ec8), ('\u{16eae}', 0x16ec9),
- ('\u{16eaf}', 0x16eca), ('\u{16eb0}', 0x16ecb), ('\u{16eb1}', 0x16ecc),
- ('\u{16eb2}', 0x16ecd), ('\u{16eb3}', 0x16ece), ('\u{16eb4}', 0x16ecf),
- ('\u{16eb5}', 0x16ed0), ('\u{16eb6}', 0x16ed1), ('\u{16eb7}', 0x16ed2),
- ('\u{16eb8}', 0x16ed3), ('\u{1e900}', 0x1e922), ('\u{1e901}', 0x1e923),
- ('\u{1e902}', 0x1e924), ('\u{1e903}', 0x1e925), ('\u{1e904}', 0x1e926),
- ('\u{1e905}', 0x1e927), ('\u{1e906}', 0x1e928), ('\u{1e907}', 0x1e929),
- ('\u{1e908}', 0x1e92a), ('\u{1e909}', 0x1e92b), ('\u{1e90a}', 0x1e92c),
- ('\u{1e90b}', 0x1e92d), ('\u{1e90c}', 0x1e92e), ('\u{1e90d}', 0x1e92f),
- ('\u{1e90e}', 0x1e930), ('\u{1e90f}', 0x1e931), ('\u{1e910}', 0x1e932),
- ('\u{1e911}', 0x1e933), ('\u{1e912}', 0x1e934), ('\u{1e913}', 0x1e935),
- ('\u{1e914}', 0x1e936), ('\u{1e915}', 0x1e937), ('\u{1e916}', 0x1e938),
- ('\u{1e917}', 0x1e939), ('\u{1e918}', 0x1e93a), ('\u{1e919}', 0x1e93b),
- ('\u{1e91a}', 0x1e93c), ('\u{1e91b}', 0x1e93d), ('\u{1e91c}', 0x1e93e),
- ('\u{1e91d}', 0x1e93f), ('\u{1e91e}', 0x1e940), ('\u{1e91f}', 0x1e941),
- ('\u{1e920}', 0x1e942), ('\u{1e921}', 0x1e943),
- ];
+ const INDEX_MASK: u32 = 0x400000;
- #[rustfmt::skip]
- static LOWERCASE_TABLE_MULTI: &[[char; 3]; 1] = &[
- ['\u{69}', '\u{307}', '\u{0}'],
- ];
-
- #[inline]
pub fn to_lower(c: char) -> [char; 3] {
- const {
- let mut i = 0;
- while i < LOWERCASE_TABLE.len() {
- let (_, val) = LOWERCASE_TABLE[i];
- if val & (1 << 22) == 0 {
- assert!(char::from_u32(val).is_some());
- } else {
- let index = val & ((1 << 22) - 1);
- assert!((index as usize) < LOWERCASE_TABLE_MULTI.len());
- }
- i += 1;
- }
- }
-
- // SAFETY: Just checked that the tables are valid
- unsafe {
- super::case_conversion(
- c,
- |c| c.to_ascii_lowercase(),
- LOWERCASE_TABLE,
- LOWERCASE_TABLE_MULTI,
- )
+ if c.is_ascii() {
+ [(c as u8).to_ascii_lowercase() as char, '\0', '\0']
+ } else {
+ LOWERCASE_TABLE
+ .binary_search_by(|&(key, _)| key.cmp(&c))
+ .map(|i| {
+ let u = LOWERCASE_TABLE[i].1;
+ char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| {
+ // SAFETY: Index comes from statically generated table
+ unsafe { *LOWERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) }
+ })
+ })
+ .unwrap_or([c, '\0', '\0'])
}
}
- #[rustfmt::skip]
- static UPPERCASE_TABLE: &[(char, u32); 1554] = &[
- ('\u{b5}', 0x39c), ('\u{df}', 0x400000), ('\u{e0}', 0xc0), ('\u{e1}', 0xc1),
- ('\u{e2}', 0xc2), ('\u{e3}', 0xc3), ('\u{e4}', 0xc4), ('\u{e5}', 0xc5), ('\u{e6}', 0xc6),
- ('\u{e7}', 0xc7), ('\u{e8}', 0xc8), ('\u{e9}', 0xc9), ('\u{ea}', 0xca), ('\u{eb}', 0xcb),
- ('\u{ec}', 0xcc), ('\u{ed}', 0xcd), ('\u{ee}', 0xce), ('\u{ef}', 0xcf), ('\u{f0}', 0xd0),
- ('\u{f1}', 0xd1), ('\u{f2}', 0xd2), ('\u{f3}', 0xd3), ('\u{f4}', 0xd4), ('\u{f5}', 0xd5),
- ('\u{f6}', 0xd6), ('\u{f8}', 0xd8), ('\u{f9}', 0xd9), ('\u{fa}', 0xda), ('\u{fb}', 0xdb),
- ('\u{fc}', 0xdc), ('\u{fd}', 0xdd), ('\u{fe}', 0xde), ('\u{ff}', 0x178), ('\u{101}', 0x100),
- ('\u{103}', 0x102), ('\u{105}', 0x104), ('\u{107}', 0x106), ('\u{109}', 0x108),
- ('\u{10b}', 0x10a), ('\u{10d}', 0x10c), ('\u{10f}', 0x10e), ('\u{111}', 0x110),
- ('\u{113}', 0x112), ('\u{115}', 0x114), ('\u{117}', 0x116), ('\u{119}', 0x118),
- ('\u{11b}', 0x11a), ('\u{11d}', 0x11c), ('\u{11f}', 0x11e), ('\u{121}', 0x120),
- ('\u{123}', 0x122), ('\u{125}', 0x124), ('\u{127}', 0x126), ('\u{129}', 0x128),
- ('\u{12b}', 0x12a), ('\u{12d}', 0x12c), ('\u{12f}', 0x12e), ('\u{131}', 0x49),
- ('\u{133}', 0x132), ('\u{135}', 0x134), ('\u{137}', 0x136), ('\u{13a}', 0x139),
- ('\u{13c}', 0x13b), ('\u{13e}', 0x13d), ('\u{140}', 0x13f), ('\u{142}', 0x141),
- ('\u{144}', 0x143), ('\u{146}', 0x145), ('\u{148}', 0x147), ('\u{149}', 0x400001),
- ('\u{14b}', 0x14a), ('\u{14d}', 0x14c), ('\u{14f}', 0x14e), ('\u{151}', 0x150),
- ('\u{153}', 0x152), ('\u{155}', 0x154), ('\u{157}', 0x156), ('\u{159}', 0x158),
- ('\u{15b}', 0x15a), ('\u{15d}', 0x15c), ('\u{15f}', 0x15e), ('\u{161}', 0x160),
- ('\u{163}', 0x162), ('\u{165}', 0x164), ('\u{167}', 0x166), ('\u{169}', 0x168),
- ('\u{16b}', 0x16a), ('\u{16d}', 0x16c), ('\u{16f}', 0x16e), ('\u{171}', 0x170),
- ('\u{173}', 0x172), ('\u{175}', 0x174), ('\u{177}', 0x176), ('\u{17a}', 0x179),
- ('\u{17c}', 0x17b), ('\u{17e}', 0x17d), ('\u{17f}', 0x53), ('\u{180}', 0x243),
- ('\u{183}', 0x182), ('\u{185}', 0x184), ('\u{188}', 0x187), ('\u{18c}', 0x18b),
- ('\u{192}', 0x191), ('\u{195}', 0x1f6), ('\u{199}', 0x198), ('\u{19a}', 0x23d),
- ('\u{19b}', 0xa7dc), ('\u{19e}', 0x220), ('\u{1a1}', 0x1a0), ('\u{1a3}', 0x1a2),
- ('\u{1a5}', 0x1a4), ('\u{1a8}', 0x1a7), ('\u{1ad}', 0x1ac), ('\u{1b0}', 0x1af),
- ('\u{1b4}', 0x1b3), ('\u{1b6}', 0x1b5), ('\u{1b9}', 0x1b8), ('\u{1bd}', 0x1bc),
- ('\u{1bf}', 0x1f7), ('\u{1c5}', 0x1c4), ('\u{1c6}', 0x1c4), ('\u{1c8}', 0x1c7),
- ('\u{1c9}', 0x1c7), ('\u{1cb}', 0x1ca), ('\u{1cc}', 0x1ca), ('\u{1ce}', 0x1cd),
- ('\u{1d0}', 0x1cf), ('\u{1d2}', 0x1d1), ('\u{1d4}', 0x1d3), ('\u{1d6}', 0x1d5),
- ('\u{1d8}', 0x1d7), ('\u{1da}', 0x1d9), ('\u{1dc}', 0x1db), ('\u{1dd}', 0x18e),
- ('\u{1df}', 0x1de), ('\u{1e1}', 0x1e0), ('\u{1e3}', 0x1e2), ('\u{1e5}', 0x1e4),
- ('\u{1e7}', 0x1e6), ('\u{1e9}', 0x1e8), ('\u{1eb}', 0x1ea), ('\u{1ed}', 0x1ec),
- ('\u{1ef}', 0x1ee), ('\u{1f0}', 0x400002), ('\u{1f2}', 0x1f1), ('\u{1f3}', 0x1f1),
- ('\u{1f5}', 0x1f4), ('\u{1f9}', 0x1f8), ('\u{1fb}', 0x1fa), ('\u{1fd}', 0x1fc),
- ('\u{1ff}', 0x1fe), ('\u{201}', 0x200), ('\u{203}', 0x202), ('\u{205}', 0x204),
- ('\u{207}', 0x206), ('\u{209}', 0x208), ('\u{20b}', 0x20a), ('\u{20d}', 0x20c),
- ('\u{20f}', 0x20e), ('\u{211}', 0x210), ('\u{213}', 0x212), ('\u{215}', 0x214),
- ('\u{217}', 0x216), ('\u{219}', 0x218), ('\u{21b}', 0x21a), ('\u{21d}', 0x21c),
- ('\u{21f}', 0x21e), ('\u{223}', 0x222), ('\u{225}', 0x224), ('\u{227}', 0x226),
- ('\u{229}', 0x228), ('\u{22b}', 0x22a), ('\u{22d}', 0x22c), ('\u{22f}', 0x22e),
- ('\u{231}', 0x230), ('\u{233}', 0x232), ('\u{23c}', 0x23b), ('\u{23f}', 0x2c7e),
- ('\u{240}', 0x2c7f), ('\u{242}', 0x241), ('\u{247}', 0x246), ('\u{249}', 0x248),
- ('\u{24b}', 0x24a), ('\u{24d}', 0x24c), ('\u{24f}', 0x24e), ('\u{250}', 0x2c6f),
- ('\u{251}', 0x2c6d), ('\u{252}', 0x2c70), ('\u{253}', 0x181), ('\u{254}', 0x186),
- ('\u{256}', 0x189), ('\u{257}', 0x18a), ('\u{259}', 0x18f), ('\u{25b}', 0x190),
- ('\u{25c}', 0xa7ab), ('\u{260}', 0x193), ('\u{261}', 0xa7ac), ('\u{263}', 0x194),
- ('\u{264}', 0xa7cb), ('\u{265}', 0xa78d), ('\u{266}', 0xa7aa), ('\u{268}', 0x197),
- ('\u{269}', 0x196), ('\u{26a}', 0xa7ae), ('\u{26b}', 0x2c62), ('\u{26c}', 0xa7ad),
- ('\u{26f}', 0x19c), ('\u{271}', 0x2c6e), ('\u{272}', 0x19d), ('\u{275}', 0x19f),
- ('\u{27d}', 0x2c64), ('\u{280}', 0x1a6), ('\u{282}', 0xa7c5), ('\u{283}', 0x1a9),
- ('\u{287}', 0xa7b1), ('\u{288}', 0x1ae), ('\u{289}', 0x244), ('\u{28a}', 0x1b1),
- ('\u{28b}', 0x1b2), ('\u{28c}', 0x245), ('\u{292}', 0x1b7), ('\u{29d}', 0xa7b2),
- ('\u{29e}', 0xa7b0), ('\u{345}', 0x399), ('\u{371}', 0x370), ('\u{373}', 0x372),
- ('\u{377}', 0x376), ('\u{37b}', 0x3fd), ('\u{37c}', 0x3fe), ('\u{37d}', 0x3ff),
- ('\u{390}', 0x400003), ('\u{3ac}', 0x386), ('\u{3ad}', 0x388), ('\u{3ae}', 0x389),
- ('\u{3af}', 0x38a), ('\u{3b0}', 0x400004), ('\u{3b1}', 0x391), ('\u{3b2}', 0x392),
- ('\u{3b3}', 0x393), ('\u{3b4}', 0x394), ('\u{3b5}', 0x395), ('\u{3b6}', 0x396),
- ('\u{3b7}', 0x397), ('\u{3b8}', 0x398), ('\u{3b9}', 0x399), ('\u{3ba}', 0x39a),
- ('\u{3bb}', 0x39b), ('\u{3bc}', 0x39c), ('\u{3bd}', 0x39d), ('\u{3be}', 0x39e),
- ('\u{3bf}', 0x39f), ('\u{3c0}', 0x3a0), ('\u{3c1}', 0x3a1), ('\u{3c2}', 0x3a3),
- ('\u{3c3}', 0x3a3), ('\u{3c4}', 0x3a4), ('\u{3c5}', 0x3a5), ('\u{3c6}', 0x3a6),
- ('\u{3c7}', 0x3a7), ('\u{3c8}', 0x3a8), ('\u{3c9}', 0x3a9), ('\u{3ca}', 0x3aa),
- ('\u{3cb}', 0x3ab), ('\u{3cc}', 0x38c), ('\u{3cd}', 0x38e), ('\u{3ce}', 0x38f),
- ('\u{3d0}', 0x392), ('\u{3d1}', 0x398), ('\u{3d5}', 0x3a6), ('\u{3d6}', 0x3a0),
- ('\u{3d7}', 0x3cf), ('\u{3d9}', 0x3d8), ('\u{3db}', 0x3da), ('\u{3dd}', 0x3dc),
- ('\u{3df}', 0x3de), ('\u{3e1}', 0x3e0), ('\u{3e3}', 0x3e2), ('\u{3e5}', 0x3e4),
- ('\u{3e7}', 0x3e6), ('\u{3e9}', 0x3e8), ('\u{3eb}', 0x3ea), ('\u{3ed}', 0x3ec),
- ('\u{3ef}', 0x3ee), ('\u{3f0}', 0x39a), ('\u{3f1}', 0x3a1), ('\u{3f2}', 0x3f9),
- ('\u{3f3}', 0x37f), ('\u{3f5}', 0x395), ('\u{3f8}', 0x3f7), ('\u{3fb}', 0x3fa),
- ('\u{430}', 0x410), ('\u{431}', 0x411), ('\u{432}', 0x412), ('\u{433}', 0x413),
- ('\u{434}', 0x414), ('\u{435}', 0x415), ('\u{436}', 0x416), ('\u{437}', 0x417),
- ('\u{438}', 0x418), ('\u{439}', 0x419), ('\u{43a}', 0x41a), ('\u{43b}', 0x41b),
- ('\u{43c}', 0x41c), ('\u{43d}', 0x41d), ('\u{43e}', 0x41e), ('\u{43f}', 0x41f),
- ('\u{440}', 0x420), ('\u{441}', 0x421), ('\u{442}', 0x422), ('\u{443}', 0x423),
- ('\u{444}', 0x424), ('\u{445}', 0x425), ('\u{446}', 0x426), ('\u{447}', 0x427),
- ('\u{448}', 0x428), ('\u{449}', 0x429), ('\u{44a}', 0x42a), ('\u{44b}', 0x42b),
- ('\u{44c}', 0x42c), ('\u{44d}', 0x42d), ('\u{44e}', 0x42e), ('\u{44f}', 0x42f),
- ('\u{450}', 0x400), ('\u{451}', 0x401), ('\u{452}', 0x402), ('\u{453}', 0x403),
- ('\u{454}', 0x404), ('\u{455}', 0x405), ('\u{456}', 0x406), ('\u{457}', 0x407),
- ('\u{458}', 0x408), ('\u{459}', 0x409), ('\u{45a}', 0x40a), ('\u{45b}', 0x40b),
- ('\u{45c}', 0x40c), ('\u{45d}', 0x40d), ('\u{45e}', 0x40e), ('\u{45f}', 0x40f),
- ('\u{461}', 0x460), ('\u{463}', 0x462), ('\u{465}', 0x464), ('\u{467}', 0x466),
- ('\u{469}', 0x468), ('\u{46b}', 0x46a), ('\u{46d}', 0x46c), ('\u{46f}', 0x46e),
- ('\u{471}', 0x470), ('\u{473}', 0x472), ('\u{475}', 0x474), ('\u{477}', 0x476),
- ('\u{479}', 0x478), ('\u{47b}', 0x47a), ('\u{47d}', 0x47c), ('\u{47f}', 0x47e),
- ('\u{481}', 0x480), ('\u{48b}', 0x48a), ('\u{48d}', 0x48c), ('\u{48f}', 0x48e),
- ('\u{491}', 0x490), ('\u{493}', 0x492), ('\u{495}', 0x494), ('\u{497}', 0x496),
- ('\u{499}', 0x498), ('\u{49b}', 0x49a), ('\u{49d}', 0x49c), ('\u{49f}', 0x49e),
- ('\u{4a1}', 0x4a0), ('\u{4a3}', 0x4a2), ('\u{4a5}', 0x4a4), ('\u{4a7}', 0x4a6),
- ('\u{4a9}', 0x4a8), ('\u{4ab}', 0x4aa), ('\u{4ad}', 0x4ac), ('\u{4af}', 0x4ae),
- ('\u{4b1}', 0x4b0), ('\u{4b3}', 0x4b2), ('\u{4b5}', 0x4b4), ('\u{4b7}', 0x4b6),
- ('\u{4b9}', 0x4b8), ('\u{4bb}', 0x4ba), ('\u{4bd}', 0x4bc), ('\u{4bf}', 0x4be),
- ('\u{4c2}', 0x4c1), ('\u{4c4}', 0x4c3), ('\u{4c6}', 0x4c5), ('\u{4c8}', 0x4c7),
- ('\u{4ca}', 0x4c9), ('\u{4cc}', 0x4cb), ('\u{4ce}', 0x4cd), ('\u{4cf}', 0x4c0),
- ('\u{4d1}', 0x4d0), ('\u{4d3}', 0x4d2), ('\u{4d5}', 0x4d4), ('\u{4d7}', 0x4d6),
- ('\u{4d9}', 0x4d8), ('\u{4db}', 0x4da), ('\u{4dd}', 0x4dc), ('\u{4df}', 0x4de),
- ('\u{4e1}', 0x4e0), ('\u{4e3}', 0x4e2), ('\u{4e5}', 0x4e4), ('\u{4e7}', 0x4e6),
- ('\u{4e9}', 0x4e8), ('\u{4eb}', 0x4ea), ('\u{4ed}', 0x4ec), ('\u{4ef}', 0x4ee),
- ('\u{4f1}', 0x4f0), ('\u{4f3}', 0x4f2), ('\u{4f5}', 0x4f4), ('\u{4f7}', 0x4f6),
- ('\u{4f9}', 0x4f8), ('\u{4fb}', 0x4fa), ('\u{4fd}', 0x4fc), ('\u{4ff}', 0x4fe),
- ('\u{501}', 0x500), ('\u{503}', 0x502), ('\u{505}', 0x504), ('\u{507}', 0x506),
- ('\u{509}', 0x508), ('\u{50b}', 0x50a), ('\u{50d}', 0x50c), ('\u{50f}', 0x50e),
- ('\u{511}', 0x510), ('\u{513}', 0x512), ('\u{515}', 0x514), ('\u{517}', 0x516),
- ('\u{519}', 0x518), ('\u{51b}', 0x51a), ('\u{51d}', 0x51c), ('\u{51f}', 0x51e),
- ('\u{521}', 0x520), ('\u{523}', 0x522), ('\u{525}', 0x524), ('\u{527}', 0x526),
- ('\u{529}', 0x528), ('\u{52b}', 0x52a), ('\u{52d}', 0x52c), ('\u{52f}', 0x52e),
- ('\u{561}', 0x531), ('\u{562}', 0x532), ('\u{563}', 0x533), ('\u{564}', 0x534),
- ('\u{565}', 0x535), ('\u{566}', 0x536), ('\u{567}', 0x537), ('\u{568}', 0x538),
- ('\u{569}', 0x539), ('\u{56a}', 0x53a), ('\u{56b}', 0x53b), ('\u{56c}', 0x53c),
- ('\u{56d}', 0x53d), ('\u{56e}', 0x53e), ('\u{56f}', 0x53f), ('\u{570}', 0x540),
- ('\u{571}', 0x541), ('\u{572}', 0x542), ('\u{573}', 0x543), ('\u{574}', 0x544),
- ('\u{575}', 0x545), ('\u{576}', 0x546), ('\u{577}', 0x547), ('\u{578}', 0x548),
- ('\u{579}', 0x549), ('\u{57a}', 0x54a), ('\u{57b}', 0x54b), ('\u{57c}', 0x54c),
- ('\u{57d}', 0x54d), ('\u{57e}', 0x54e), ('\u{57f}', 0x54f), ('\u{580}', 0x550),
- ('\u{581}', 0x551), ('\u{582}', 0x552), ('\u{583}', 0x553), ('\u{584}', 0x554),
- ('\u{585}', 0x555), ('\u{586}', 0x556), ('\u{587}', 0x400005), ('\u{10d0}', 0x1c90),
- ('\u{10d1}', 0x1c91), ('\u{10d2}', 0x1c92), ('\u{10d3}', 0x1c93), ('\u{10d4}', 0x1c94),
- ('\u{10d5}', 0x1c95), ('\u{10d6}', 0x1c96), ('\u{10d7}', 0x1c97), ('\u{10d8}', 0x1c98),
- ('\u{10d9}', 0x1c99), ('\u{10da}', 0x1c9a), ('\u{10db}', 0x1c9b), ('\u{10dc}', 0x1c9c),
- ('\u{10dd}', 0x1c9d), ('\u{10de}', 0x1c9e), ('\u{10df}', 0x1c9f), ('\u{10e0}', 0x1ca0),
- ('\u{10e1}', 0x1ca1), ('\u{10e2}', 0x1ca2), ('\u{10e3}', 0x1ca3), ('\u{10e4}', 0x1ca4),
- ('\u{10e5}', 0x1ca5), ('\u{10e6}', 0x1ca6), ('\u{10e7}', 0x1ca7), ('\u{10e8}', 0x1ca8),
- ('\u{10e9}', 0x1ca9), ('\u{10ea}', 0x1caa), ('\u{10eb}', 0x1cab), ('\u{10ec}', 0x1cac),
- ('\u{10ed}', 0x1cad), ('\u{10ee}', 0x1cae), ('\u{10ef}', 0x1caf), ('\u{10f0}', 0x1cb0),
- ('\u{10f1}', 0x1cb1), ('\u{10f2}', 0x1cb2), ('\u{10f3}', 0x1cb3), ('\u{10f4}', 0x1cb4),
- ('\u{10f5}', 0x1cb5), ('\u{10f6}', 0x1cb6), ('\u{10f7}', 0x1cb7), ('\u{10f8}', 0x1cb8),
- ('\u{10f9}', 0x1cb9), ('\u{10fa}', 0x1cba), ('\u{10fd}', 0x1cbd), ('\u{10fe}', 0x1cbe),
- ('\u{10ff}', 0x1cbf), ('\u{13f8}', 0x13f0), ('\u{13f9}', 0x13f1), ('\u{13fa}', 0x13f2),
- ('\u{13fb}', 0x13f3), ('\u{13fc}', 0x13f4), ('\u{13fd}', 0x13f5), ('\u{1c80}', 0x412),
- ('\u{1c81}', 0x414), ('\u{1c82}', 0x41e), ('\u{1c83}', 0x421), ('\u{1c84}', 0x422),
- ('\u{1c85}', 0x422), ('\u{1c86}', 0x42a), ('\u{1c87}', 0x462), ('\u{1c88}', 0xa64a),
- ('\u{1c8a}', 0x1c89), ('\u{1d79}', 0xa77d), ('\u{1d7d}', 0x2c63), ('\u{1d8e}', 0xa7c6),
- ('\u{1e01}', 0x1e00), ('\u{1e03}', 0x1e02), ('\u{1e05}', 0x1e04), ('\u{1e07}', 0x1e06),
- ('\u{1e09}', 0x1e08), ('\u{1e0b}', 0x1e0a), ('\u{1e0d}', 0x1e0c), ('\u{1e0f}', 0x1e0e),
- ('\u{1e11}', 0x1e10), ('\u{1e13}', 0x1e12), ('\u{1e15}', 0x1e14), ('\u{1e17}', 0x1e16),
- ('\u{1e19}', 0x1e18), ('\u{1e1b}', 0x1e1a), ('\u{1e1d}', 0x1e1c), ('\u{1e1f}', 0x1e1e),
- ('\u{1e21}', 0x1e20), ('\u{1e23}', 0x1e22), ('\u{1e25}', 0x1e24), ('\u{1e27}', 0x1e26),
- ('\u{1e29}', 0x1e28), ('\u{1e2b}', 0x1e2a), ('\u{1e2d}', 0x1e2c), ('\u{1e2f}', 0x1e2e),
- ('\u{1e31}', 0x1e30), ('\u{1e33}', 0x1e32), ('\u{1e35}', 0x1e34), ('\u{1e37}', 0x1e36),
- ('\u{1e39}', 0x1e38), ('\u{1e3b}', 0x1e3a), ('\u{1e3d}', 0x1e3c), ('\u{1e3f}', 0x1e3e),
- ('\u{1e41}', 0x1e40), ('\u{1e43}', 0x1e42), ('\u{1e45}', 0x1e44), ('\u{1e47}', 0x1e46),
- ('\u{1e49}', 0x1e48), ('\u{1e4b}', 0x1e4a), ('\u{1e4d}', 0x1e4c), ('\u{1e4f}', 0x1e4e),
- ('\u{1e51}', 0x1e50), ('\u{1e53}', 0x1e52), ('\u{1e55}', 0x1e54), ('\u{1e57}', 0x1e56),
- ('\u{1e59}', 0x1e58), ('\u{1e5b}', 0x1e5a), ('\u{1e5d}', 0x1e5c), ('\u{1e5f}', 0x1e5e),
- ('\u{1e61}', 0x1e60), ('\u{1e63}', 0x1e62), ('\u{1e65}', 0x1e64), ('\u{1e67}', 0x1e66),
- ('\u{1e69}', 0x1e68), ('\u{1e6b}', 0x1e6a), ('\u{1e6d}', 0x1e6c), ('\u{1e6f}', 0x1e6e),
- ('\u{1e71}', 0x1e70), ('\u{1e73}', 0x1e72), ('\u{1e75}', 0x1e74), ('\u{1e77}', 0x1e76),
- ('\u{1e79}', 0x1e78), ('\u{1e7b}', 0x1e7a), ('\u{1e7d}', 0x1e7c), ('\u{1e7f}', 0x1e7e),
- ('\u{1e81}', 0x1e80), ('\u{1e83}', 0x1e82), ('\u{1e85}', 0x1e84), ('\u{1e87}', 0x1e86),
- ('\u{1e89}', 0x1e88), ('\u{1e8b}', 0x1e8a), ('\u{1e8d}', 0x1e8c), ('\u{1e8f}', 0x1e8e),
- ('\u{1e91}', 0x1e90), ('\u{1e93}', 0x1e92), ('\u{1e95}', 0x1e94), ('\u{1e96}', 0x400006),
- ('\u{1e97}', 0x400007), ('\u{1e98}', 0x400008), ('\u{1e99}', 0x400009),
- ('\u{1e9a}', 0x40000a), ('\u{1e9b}', 0x1e60), ('\u{1ea1}', 0x1ea0), ('\u{1ea3}', 0x1ea2),
- ('\u{1ea5}', 0x1ea4), ('\u{1ea7}', 0x1ea6), ('\u{1ea9}', 0x1ea8), ('\u{1eab}', 0x1eaa),
- ('\u{1ead}', 0x1eac), ('\u{1eaf}', 0x1eae), ('\u{1eb1}', 0x1eb0), ('\u{1eb3}', 0x1eb2),
- ('\u{1eb5}', 0x1eb4), ('\u{1eb7}', 0x1eb6), ('\u{1eb9}', 0x1eb8), ('\u{1ebb}', 0x1eba),
- ('\u{1ebd}', 0x1ebc), ('\u{1ebf}', 0x1ebe), ('\u{1ec1}', 0x1ec0), ('\u{1ec3}', 0x1ec2),
- ('\u{1ec5}', 0x1ec4), ('\u{1ec7}', 0x1ec6), ('\u{1ec9}', 0x1ec8), ('\u{1ecb}', 0x1eca),
- ('\u{1ecd}', 0x1ecc), ('\u{1ecf}', 0x1ece), ('\u{1ed1}', 0x1ed0), ('\u{1ed3}', 0x1ed2),
- ('\u{1ed5}', 0x1ed4), ('\u{1ed7}', 0x1ed6), ('\u{1ed9}', 0x1ed8), ('\u{1edb}', 0x1eda),
- ('\u{1edd}', 0x1edc), ('\u{1edf}', 0x1ede), ('\u{1ee1}', 0x1ee0), ('\u{1ee3}', 0x1ee2),
- ('\u{1ee5}', 0x1ee4), ('\u{1ee7}', 0x1ee6), ('\u{1ee9}', 0x1ee8), ('\u{1eeb}', 0x1eea),
- ('\u{1eed}', 0x1eec), ('\u{1eef}', 0x1eee), ('\u{1ef1}', 0x1ef0), ('\u{1ef3}', 0x1ef2),
- ('\u{1ef5}', 0x1ef4), ('\u{1ef7}', 0x1ef6), ('\u{1ef9}', 0x1ef8), ('\u{1efb}', 0x1efa),
- ('\u{1efd}', 0x1efc), ('\u{1eff}', 0x1efe), ('\u{1f00}', 0x1f08), ('\u{1f01}', 0x1f09),
- ('\u{1f02}', 0x1f0a), ('\u{1f03}', 0x1f0b), ('\u{1f04}', 0x1f0c), ('\u{1f05}', 0x1f0d),
- ('\u{1f06}', 0x1f0e), ('\u{1f07}', 0x1f0f), ('\u{1f10}', 0x1f18), ('\u{1f11}', 0x1f19),
- ('\u{1f12}', 0x1f1a), ('\u{1f13}', 0x1f1b), ('\u{1f14}', 0x1f1c), ('\u{1f15}', 0x1f1d),
- ('\u{1f20}', 0x1f28), ('\u{1f21}', 0x1f29), ('\u{1f22}', 0x1f2a), ('\u{1f23}', 0x1f2b),
- ('\u{1f24}', 0x1f2c), ('\u{1f25}', 0x1f2d), ('\u{1f26}', 0x1f2e), ('\u{1f27}', 0x1f2f),
- ('\u{1f30}', 0x1f38), ('\u{1f31}', 0x1f39), ('\u{1f32}', 0x1f3a), ('\u{1f33}', 0x1f3b),
- ('\u{1f34}', 0x1f3c), ('\u{1f35}', 0x1f3d), ('\u{1f36}', 0x1f3e), ('\u{1f37}', 0x1f3f),
- ('\u{1f40}', 0x1f48), ('\u{1f41}', 0x1f49), ('\u{1f42}', 0x1f4a), ('\u{1f43}', 0x1f4b),
- ('\u{1f44}', 0x1f4c), ('\u{1f45}', 0x1f4d), ('\u{1f50}', 0x40000b), ('\u{1f51}', 0x1f59),
- ('\u{1f52}', 0x40000c), ('\u{1f53}', 0x1f5b), ('\u{1f54}', 0x40000d), ('\u{1f55}', 0x1f5d),
- ('\u{1f56}', 0x40000e), ('\u{1f57}', 0x1f5f), ('\u{1f60}', 0x1f68), ('\u{1f61}', 0x1f69),
- ('\u{1f62}', 0x1f6a), ('\u{1f63}', 0x1f6b), ('\u{1f64}', 0x1f6c), ('\u{1f65}', 0x1f6d),
- ('\u{1f66}', 0x1f6e), ('\u{1f67}', 0x1f6f), ('\u{1f70}', 0x1fba), ('\u{1f71}', 0x1fbb),
- ('\u{1f72}', 0x1fc8), ('\u{1f73}', 0x1fc9), ('\u{1f74}', 0x1fca), ('\u{1f75}', 0x1fcb),
- ('\u{1f76}', 0x1fda), ('\u{1f77}', 0x1fdb), ('\u{1f78}', 0x1ff8), ('\u{1f79}', 0x1ff9),
- ('\u{1f7a}', 0x1fea), ('\u{1f7b}', 0x1feb), ('\u{1f7c}', 0x1ffa), ('\u{1f7d}', 0x1ffb),
- ('\u{1f80}', 0x40000f), ('\u{1f81}', 0x400010), ('\u{1f82}', 0x400011),
- ('\u{1f83}', 0x400012), ('\u{1f84}', 0x400013), ('\u{1f85}', 0x400014),
- ('\u{1f86}', 0x400015), ('\u{1f87}', 0x400016), ('\u{1f88}', 0x400017),
- ('\u{1f89}', 0x400018), ('\u{1f8a}', 0x400019), ('\u{1f8b}', 0x40001a),
- ('\u{1f8c}', 0x40001b), ('\u{1f8d}', 0x40001c), ('\u{1f8e}', 0x40001d),
- ('\u{1f8f}', 0x40001e), ('\u{1f90}', 0x40001f), ('\u{1f91}', 0x400020),
- ('\u{1f92}', 0x400021), ('\u{1f93}', 0x400022), ('\u{1f94}', 0x400023),
- ('\u{1f95}', 0x400024), ('\u{1f96}', 0x400025), ('\u{1f97}', 0x400026),
- ('\u{1f98}', 0x400027), ('\u{1f99}', 0x400028), ('\u{1f9a}', 0x400029),
- ('\u{1f9b}', 0x40002a), ('\u{1f9c}', 0x40002b), ('\u{1f9d}', 0x40002c),
- ('\u{1f9e}', 0x40002d), ('\u{1f9f}', 0x40002e), ('\u{1fa0}', 0x40002f),
- ('\u{1fa1}', 0x400030), ('\u{1fa2}', 0x400031), ('\u{1fa3}', 0x400032),
- ('\u{1fa4}', 0x400033), ('\u{1fa5}', 0x400034), ('\u{1fa6}', 0x400035),
- ('\u{1fa7}', 0x400036), ('\u{1fa8}', 0x400037), ('\u{1fa9}', 0x400038),
- ('\u{1faa}', 0x400039), ('\u{1fab}', 0x40003a), ('\u{1fac}', 0x40003b),
- ('\u{1fad}', 0x40003c), ('\u{1fae}', 0x40003d), ('\u{1faf}', 0x40003e),
- ('\u{1fb0}', 0x1fb8), ('\u{1fb1}', 0x1fb9), ('\u{1fb2}', 0x40003f), ('\u{1fb3}', 0x400040),
- ('\u{1fb4}', 0x400041), ('\u{1fb6}', 0x400042), ('\u{1fb7}', 0x400043),
- ('\u{1fbc}', 0x400044), ('\u{1fbe}', 0x399), ('\u{1fc2}', 0x400045), ('\u{1fc3}', 0x400046),
- ('\u{1fc4}', 0x400047), ('\u{1fc6}', 0x400048), ('\u{1fc7}', 0x400049),
- ('\u{1fcc}', 0x40004a), ('\u{1fd0}', 0x1fd8), ('\u{1fd1}', 0x1fd9), ('\u{1fd2}', 0x40004b),
- ('\u{1fd3}', 0x40004c), ('\u{1fd6}', 0x40004d), ('\u{1fd7}', 0x40004e),
- ('\u{1fe0}', 0x1fe8), ('\u{1fe1}', 0x1fe9), ('\u{1fe2}', 0x40004f), ('\u{1fe3}', 0x400050),
- ('\u{1fe4}', 0x400051), ('\u{1fe5}', 0x1fec), ('\u{1fe6}', 0x400052),
- ('\u{1fe7}', 0x400053), ('\u{1ff2}', 0x400054), ('\u{1ff3}', 0x400055),
- ('\u{1ff4}', 0x400056), ('\u{1ff6}', 0x400057), ('\u{1ff7}', 0x400058),
- ('\u{1ffc}', 0x400059), ('\u{214e}', 0x2132), ('\u{2170}', 0x2160), ('\u{2171}', 0x2161),
- ('\u{2172}', 0x2162), ('\u{2173}', 0x2163), ('\u{2174}', 0x2164), ('\u{2175}', 0x2165),
- ('\u{2176}', 0x2166), ('\u{2177}', 0x2167), ('\u{2178}', 0x2168), ('\u{2179}', 0x2169),
- ('\u{217a}', 0x216a), ('\u{217b}', 0x216b), ('\u{217c}', 0x216c), ('\u{217d}', 0x216d),
- ('\u{217e}', 0x216e), ('\u{217f}', 0x216f), ('\u{2184}', 0x2183), ('\u{24d0}', 0x24b6),
- ('\u{24d1}', 0x24b7), ('\u{24d2}', 0x24b8), ('\u{24d3}', 0x24b9), ('\u{24d4}', 0x24ba),
- ('\u{24d5}', 0x24bb), ('\u{24d6}', 0x24bc), ('\u{24d7}', 0x24bd), ('\u{24d8}', 0x24be),
- ('\u{24d9}', 0x24bf), ('\u{24da}', 0x24c0), ('\u{24db}', 0x24c1), ('\u{24dc}', 0x24c2),
- ('\u{24dd}', 0x24c3), ('\u{24de}', 0x24c4), ('\u{24df}', 0x24c5), ('\u{24e0}', 0x24c6),
- ('\u{24e1}', 0x24c7), ('\u{24e2}', 0x24c8), ('\u{24e3}', 0x24c9), ('\u{24e4}', 0x24ca),
- ('\u{24e5}', 0x24cb), ('\u{24e6}', 0x24cc), ('\u{24e7}', 0x24cd), ('\u{24e8}', 0x24ce),
- ('\u{24e9}', 0x24cf), ('\u{2c30}', 0x2c00), ('\u{2c31}', 0x2c01), ('\u{2c32}', 0x2c02),
- ('\u{2c33}', 0x2c03), ('\u{2c34}', 0x2c04), ('\u{2c35}', 0x2c05), ('\u{2c36}', 0x2c06),
- ('\u{2c37}', 0x2c07), ('\u{2c38}', 0x2c08), ('\u{2c39}', 0x2c09), ('\u{2c3a}', 0x2c0a),
- ('\u{2c3b}', 0x2c0b), ('\u{2c3c}', 0x2c0c), ('\u{2c3d}', 0x2c0d), ('\u{2c3e}', 0x2c0e),
- ('\u{2c3f}', 0x2c0f), ('\u{2c40}', 0x2c10), ('\u{2c41}', 0x2c11), ('\u{2c42}', 0x2c12),
- ('\u{2c43}', 0x2c13), ('\u{2c44}', 0x2c14), ('\u{2c45}', 0x2c15), ('\u{2c46}', 0x2c16),
- ('\u{2c47}', 0x2c17), ('\u{2c48}', 0x2c18), ('\u{2c49}', 0x2c19), ('\u{2c4a}', 0x2c1a),
- ('\u{2c4b}', 0x2c1b), ('\u{2c4c}', 0x2c1c), ('\u{2c4d}', 0x2c1d), ('\u{2c4e}', 0x2c1e),
- ('\u{2c4f}', 0x2c1f), ('\u{2c50}', 0x2c20), ('\u{2c51}', 0x2c21), ('\u{2c52}', 0x2c22),
- ('\u{2c53}', 0x2c23), ('\u{2c54}', 0x2c24), ('\u{2c55}', 0x2c25), ('\u{2c56}', 0x2c26),
- ('\u{2c57}', 0x2c27), ('\u{2c58}', 0x2c28), ('\u{2c59}', 0x2c29), ('\u{2c5a}', 0x2c2a),
- ('\u{2c5b}', 0x2c2b), ('\u{2c5c}', 0x2c2c), ('\u{2c5d}', 0x2c2d), ('\u{2c5e}', 0x2c2e),
- ('\u{2c5f}', 0x2c2f), ('\u{2c61}', 0x2c60), ('\u{2c65}', 0x23a), ('\u{2c66}', 0x23e),
- ('\u{2c68}', 0x2c67), ('\u{2c6a}', 0x2c69), ('\u{2c6c}', 0x2c6b), ('\u{2c73}', 0x2c72),
- ('\u{2c76}', 0x2c75), ('\u{2c81}', 0x2c80), ('\u{2c83}', 0x2c82), ('\u{2c85}', 0x2c84),
- ('\u{2c87}', 0x2c86), ('\u{2c89}', 0x2c88), ('\u{2c8b}', 0x2c8a), ('\u{2c8d}', 0x2c8c),
- ('\u{2c8f}', 0x2c8e), ('\u{2c91}', 0x2c90), ('\u{2c93}', 0x2c92), ('\u{2c95}', 0x2c94),
- ('\u{2c97}', 0x2c96), ('\u{2c99}', 0x2c98), ('\u{2c9b}', 0x2c9a), ('\u{2c9d}', 0x2c9c),
- ('\u{2c9f}', 0x2c9e), ('\u{2ca1}', 0x2ca0), ('\u{2ca3}', 0x2ca2), ('\u{2ca5}', 0x2ca4),
- ('\u{2ca7}', 0x2ca6), ('\u{2ca9}', 0x2ca8), ('\u{2cab}', 0x2caa), ('\u{2cad}', 0x2cac),
- ('\u{2caf}', 0x2cae), ('\u{2cb1}', 0x2cb0), ('\u{2cb3}', 0x2cb2), ('\u{2cb5}', 0x2cb4),
- ('\u{2cb7}', 0x2cb6), ('\u{2cb9}', 0x2cb8), ('\u{2cbb}', 0x2cba), ('\u{2cbd}', 0x2cbc),
- ('\u{2cbf}', 0x2cbe), ('\u{2cc1}', 0x2cc0), ('\u{2cc3}', 0x2cc2), ('\u{2cc5}', 0x2cc4),
- ('\u{2cc7}', 0x2cc6), ('\u{2cc9}', 0x2cc8), ('\u{2ccb}', 0x2cca), ('\u{2ccd}', 0x2ccc),
- ('\u{2ccf}', 0x2cce), ('\u{2cd1}', 0x2cd0), ('\u{2cd3}', 0x2cd2), ('\u{2cd5}', 0x2cd4),
- ('\u{2cd7}', 0x2cd6), ('\u{2cd9}', 0x2cd8), ('\u{2cdb}', 0x2cda), ('\u{2cdd}', 0x2cdc),
- ('\u{2cdf}', 0x2cde), ('\u{2ce1}', 0x2ce0), ('\u{2ce3}', 0x2ce2), ('\u{2cec}', 0x2ceb),
- ('\u{2cee}', 0x2ced), ('\u{2cf3}', 0x2cf2), ('\u{2d00}', 0x10a0), ('\u{2d01}', 0x10a1),
- ('\u{2d02}', 0x10a2), ('\u{2d03}', 0x10a3), ('\u{2d04}', 0x10a4), ('\u{2d05}', 0x10a5),
- ('\u{2d06}', 0x10a6), ('\u{2d07}', 0x10a7), ('\u{2d08}', 0x10a8), ('\u{2d09}', 0x10a9),
- ('\u{2d0a}', 0x10aa), ('\u{2d0b}', 0x10ab), ('\u{2d0c}', 0x10ac), ('\u{2d0d}', 0x10ad),
- ('\u{2d0e}', 0x10ae), ('\u{2d0f}', 0x10af), ('\u{2d10}', 0x10b0), ('\u{2d11}', 0x10b1),
- ('\u{2d12}', 0x10b2), ('\u{2d13}', 0x10b3), ('\u{2d14}', 0x10b4), ('\u{2d15}', 0x10b5),
- ('\u{2d16}', 0x10b6), ('\u{2d17}', 0x10b7), ('\u{2d18}', 0x10b8), ('\u{2d19}', 0x10b9),
- ('\u{2d1a}', 0x10ba), ('\u{2d1b}', 0x10bb), ('\u{2d1c}', 0x10bc), ('\u{2d1d}', 0x10bd),
- ('\u{2d1e}', 0x10be), ('\u{2d1f}', 0x10bf), ('\u{2d20}', 0x10c0), ('\u{2d21}', 0x10c1),
- ('\u{2d22}', 0x10c2), ('\u{2d23}', 0x10c3), ('\u{2d24}', 0x10c4), ('\u{2d25}', 0x10c5),
- ('\u{2d27}', 0x10c7), ('\u{2d2d}', 0x10cd), ('\u{a641}', 0xa640), ('\u{a643}', 0xa642),
- ('\u{a645}', 0xa644), ('\u{a647}', 0xa646), ('\u{a649}', 0xa648), ('\u{a64b}', 0xa64a),
- ('\u{a64d}', 0xa64c), ('\u{a64f}', 0xa64e), ('\u{a651}', 0xa650), ('\u{a653}', 0xa652),
- ('\u{a655}', 0xa654), ('\u{a657}', 0xa656), ('\u{a659}', 0xa658), ('\u{a65b}', 0xa65a),
- ('\u{a65d}', 0xa65c), ('\u{a65f}', 0xa65e), ('\u{a661}', 0xa660), ('\u{a663}', 0xa662),
- ('\u{a665}', 0xa664), ('\u{a667}', 0xa666), ('\u{a669}', 0xa668), ('\u{a66b}', 0xa66a),
- ('\u{a66d}', 0xa66c), ('\u{a681}', 0xa680), ('\u{a683}', 0xa682), ('\u{a685}', 0xa684),
- ('\u{a687}', 0xa686), ('\u{a689}', 0xa688), ('\u{a68b}', 0xa68a), ('\u{a68d}', 0xa68c),
- ('\u{a68f}', 0xa68e), ('\u{a691}', 0xa690), ('\u{a693}', 0xa692), ('\u{a695}', 0xa694),
- ('\u{a697}', 0xa696), ('\u{a699}', 0xa698), ('\u{a69b}', 0xa69a), ('\u{a723}', 0xa722),
- ('\u{a725}', 0xa724), ('\u{a727}', 0xa726), ('\u{a729}', 0xa728), ('\u{a72b}', 0xa72a),
- ('\u{a72d}', 0xa72c), ('\u{a72f}', 0xa72e), ('\u{a733}', 0xa732), ('\u{a735}', 0xa734),
- ('\u{a737}', 0xa736), ('\u{a739}', 0xa738), ('\u{a73b}', 0xa73a), ('\u{a73d}', 0xa73c),
- ('\u{a73f}', 0xa73e), ('\u{a741}', 0xa740), ('\u{a743}', 0xa742), ('\u{a745}', 0xa744),
- ('\u{a747}', 0xa746), ('\u{a749}', 0xa748), ('\u{a74b}', 0xa74a), ('\u{a74d}', 0xa74c),
- ('\u{a74f}', 0xa74e), ('\u{a751}', 0xa750), ('\u{a753}', 0xa752), ('\u{a755}', 0xa754),
- ('\u{a757}', 0xa756), ('\u{a759}', 0xa758), ('\u{a75b}', 0xa75a), ('\u{a75d}', 0xa75c),
- ('\u{a75f}', 0xa75e), ('\u{a761}', 0xa760), ('\u{a763}', 0xa762), ('\u{a765}', 0xa764),
- ('\u{a767}', 0xa766), ('\u{a769}', 0xa768), ('\u{a76b}', 0xa76a), ('\u{a76d}', 0xa76c),
- ('\u{a76f}', 0xa76e), ('\u{a77a}', 0xa779), ('\u{a77c}', 0xa77b), ('\u{a77f}', 0xa77e),
- ('\u{a781}', 0xa780), ('\u{a783}', 0xa782), ('\u{a785}', 0xa784), ('\u{a787}', 0xa786),
- ('\u{a78c}', 0xa78b), ('\u{a791}', 0xa790), ('\u{a793}', 0xa792), ('\u{a794}', 0xa7c4),
- ('\u{a797}', 0xa796), ('\u{a799}', 0xa798), ('\u{a79b}', 0xa79a), ('\u{a79d}', 0xa79c),
- ('\u{a79f}', 0xa79e), ('\u{a7a1}', 0xa7a0), ('\u{a7a3}', 0xa7a2), ('\u{a7a5}', 0xa7a4),
- ('\u{a7a7}', 0xa7a6), ('\u{a7a9}', 0xa7a8), ('\u{a7b5}', 0xa7b4), ('\u{a7b7}', 0xa7b6),
- ('\u{a7b9}', 0xa7b8), ('\u{a7bb}', 0xa7ba), ('\u{a7bd}', 0xa7bc), ('\u{a7bf}', 0xa7be),
- ('\u{a7c1}', 0xa7c0), ('\u{a7c3}', 0xa7c2), ('\u{a7c8}', 0xa7c7), ('\u{a7ca}', 0xa7c9),
- ('\u{a7cd}', 0xa7cc), ('\u{a7cf}', 0xa7ce), ('\u{a7d1}', 0xa7d0), ('\u{a7d3}', 0xa7d2),
- ('\u{a7d5}', 0xa7d4), ('\u{a7d7}', 0xa7d6), ('\u{a7d9}', 0xa7d8), ('\u{a7db}', 0xa7da),
- ('\u{a7f6}', 0xa7f5), ('\u{ab53}', 0xa7b3), ('\u{ab70}', 0x13a0), ('\u{ab71}', 0x13a1),
- ('\u{ab72}', 0x13a2), ('\u{ab73}', 0x13a3), ('\u{ab74}', 0x13a4), ('\u{ab75}', 0x13a5),
- ('\u{ab76}', 0x13a6), ('\u{ab77}', 0x13a7), ('\u{ab78}', 0x13a8), ('\u{ab79}', 0x13a9),
- ('\u{ab7a}', 0x13aa), ('\u{ab7b}', 0x13ab), ('\u{ab7c}', 0x13ac), ('\u{ab7d}', 0x13ad),
- ('\u{ab7e}', 0x13ae), ('\u{ab7f}', 0x13af), ('\u{ab80}', 0x13b0), ('\u{ab81}', 0x13b1),
- ('\u{ab82}', 0x13b2), ('\u{ab83}', 0x13b3), ('\u{ab84}', 0x13b4), ('\u{ab85}', 0x13b5),
- ('\u{ab86}', 0x13b6), ('\u{ab87}', 0x13b7), ('\u{ab88}', 0x13b8), ('\u{ab89}', 0x13b9),
- ('\u{ab8a}', 0x13ba), ('\u{ab8b}', 0x13bb), ('\u{ab8c}', 0x13bc), ('\u{ab8d}', 0x13bd),
- ('\u{ab8e}', 0x13be), ('\u{ab8f}', 0x13bf), ('\u{ab90}', 0x13c0), ('\u{ab91}', 0x13c1),
- ('\u{ab92}', 0x13c2), ('\u{ab93}', 0x13c3), ('\u{ab94}', 0x13c4), ('\u{ab95}', 0x13c5),
- ('\u{ab96}', 0x13c6), ('\u{ab97}', 0x13c7), ('\u{ab98}', 0x13c8), ('\u{ab99}', 0x13c9),
- ('\u{ab9a}', 0x13ca), ('\u{ab9b}', 0x13cb), ('\u{ab9c}', 0x13cc), ('\u{ab9d}', 0x13cd),
- ('\u{ab9e}', 0x13ce), ('\u{ab9f}', 0x13cf), ('\u{aba0}', 0x13d0), ('\u{aba1}', 0x13d1),
- ('\u{aba2}', 0x13d2), ('\u{aba3}', 0x13d3), ('\u{aba4}', 0x13d4), ('\u{aba5}', 0x13d5),
- ('\u{aba6}', 0x13d6), ('\u{aba7}', 0x13d7), ('\u{aba8}', 0x13d8), ('\u{aba9}', 0x13d9),
- ('\u{abaa}', 0x13da), ('\u{abab}', 0x13db), ('\u{abac}', 0x13dc), ('\u{abad}', 0x13dd),
- ('\u{abae}', 0x13de), ('\u{abaf}', 0x13df), ('\u{abb0}', 0x13e0), ('\u{abb1}', 0x13e1),
- ('\u{abb2}', 0x13e2), ('\u{abb3}', 0x13e3), ('\u{abb4}', 0x13e4), ('\u{abb5}', 0x13e5),
- ('\u{abb6}', 0x13e6), ('\u{abb7}', 0x13e7), ('\u{abb8}', 0x13e8), ('\u{abb9}', 0x13e9),
- ('\u{abba}', 0x13ea), ('\u{abbb}', 0x13eb), ('\u{abbc}', 0x13ec), ('\u{abbd}', 0x13ed),
- ('\u{abbe}', 0x13ee), ('\u{abbf}', 0x13ef), ('\u{fb00}', 0x40005a), ('\u{fb01}', 0x40005b),
- ('\u{fb02}', 0x40005c), ('\u{fb03}', 0x40005d), ('\u{fb04}', 0x40005e),
- ('\u{fb05}', 0x40005f), ('\u{fb06}', 0x400060), ('\u{fb13}', 0x400061),
- ('\u{fb14}', 0x400062), ('\u{fb15}', 0x400063), ('\u{fb16}', 0x400064),
- ('\u{fb17}', 0x400065), ('\u{ff41}', 0xff21), ('\u{ff42}', 0xff22), ('\u{ff43}', 0xff23),
- ('\u{ff44}', 0xff24), ('\u{ff45}', 0xff25), ('\u{ff46}', 0xff26), ('\u{ff47}', 0xff27),
- ('\u{ff48}', 0xff28), ('\u{ff49}', 0xff29), ('\u{ff4a}', 0xff2a), ('\u{ff4b}', 0xff2b),
- ('\u{ff4c}', 0xff2c), ('\u{ff4d}', 0xff2d), ('\u{ff4e}', 0xff2e), ('\u{ff4f}', 0xff2f),
- ('\u{ff50}', 0xff30), ('\u{ff51}', 0xff31), ('\u{ff52}', 0xff32), ('\u{ff53}', 0xff33),
- ('\u{ff54}', 0xff34), ('\u{ff55}', 0xff35), ('\u{ff56}', 0xff36), ('\u{ff57}', 0xff37),
- ('\u{ff58}', 0xff38), ('\u{ff59}', 0xff39), ('\u{ff5a}', 0xff3a), ('\u{10428}', 0x10400),
- ('\u{10429}', 0x10401), ('\u{1042a}', 0x10402), ('\u{1042b}', 0x10403),
- ('\u{1042c}', 0x10404), ('\u{1042d}', 0x10405), ('\u{1042e}', 0x10406),
- ('\u{1042f}', 0x10407), ('\u{10430}', 0x10408), ('\u{10431}', 0x10409),
- ('\u{10432}', 0x1040a), ('\u{10433}', 0x1040b), ('\u{10434}', 0x1040c),
- ('\u{10435}', 0x1040d), ('\u{10436}', 0x1040e), ('\u{10437}', 0x1040f),
- ('\u{10438}', 0x10410), ('\u{10439}', 0x10411), ('\u{1043a}', 0x10412),
- ('\u{1043b}', 0x10413), ('\u{1043c}', 0x10414), ('\u{1043d}', 0x10415),
- ('\u{1043e}', 0x10416), ('\u{1043f}', 0x10417), ('\u{10440}', 0x10418),
- ('\u{10441}', 0x10419), ('\u{10442}', 0x1041a), ('\u{10443}', 0x1041b),
- ('\u{10444}', 0x1041c), ('\u{10445}', 0x1041d), ('\u{10446}', 0x1041e),
- ('\u{10447}', 0x1041f), ('\u{10448}', 0x10420), ('\u{10449}', 0x10421),
- ('\u{1044a}', 0x10422), ('\u{1044b}', 0x10423), ('\u{1044c}', 0x10424),
- ('\u{1044d}', 0x10425), ('\u{1044e}', 0x10426), ('\u{1044f}', 0x10427),
- ('\u{104d8}', 0x104b0), ('\u{104d9}', 0x104b1), ('\u{104da}', 0x104b2),
- ('\u{104db}', 0x104b3), ('\u{104dc}', 0x104b4), ('\u{104dd}', 0x104b5),
- ('\u{104de}', 0x104b6), ('\u{104df}', 0x104b7), ('\u{104e0}', 0x104b8),
- ('\u{104e1}', 0x104b9), ('\u{104e2}', 0x104ba), ('\u{104e3}', 0x104bb),
- ('\u{104e4}', 0x104bc), ('\u{104e5}', 0x104bd), ('\u{104e6}', 0x104be),
- ('\u{104e7}', 0x104bf), ('\u{104e8}', 0x104c0), ('\u{104e9}', 0x104c1),
- ('\u{104ea}', 0x104c2), ('\u{104eb}', 0x104c3), ('\u{104ec}', 0x104c4),
- ('\u{104ed}', 0x104c5), ('\u{104ee}', 0x104c6), ('\u{104ef}', 0x104c7),
- ('\u{104f0}', 0x104c8), ('\u{104f1}', 0x104c9), ('\u{104f2}', 0x104ca),
- ('\u{104f3}', 0x104cb), ('\u{104f4}', 0x104cc), ('\u{104f5}', 0x104cd),
- ('\u{104f6}', 0x104ce), ('\u{104f7}', 0x104cf), ('\u{104f8}', 0x104d0),
- ('\u{104f9}', 0x104d1), ('\u{104fa}', 0x104d2), ('\u{104fb}', 0x104d3),
- ('\u{10597}', 0x10570), ('\u{10598}', 0x10571), ('\u{10599}', 0x10572),
- ('\u{1059a}', 0x10573), ('\u{1059b}', 0x10574), ('\u{1059c}', 0x10575),
- ('\u{1059d}', 0x10576), ('\u{1059e}', 0x10577), ('\u{1059f}', 0x10578),
- ('\u{105a0}', 0x10579), ('\u{105a1}', 0x1057a), ('\u{105a3}', 0x1057c),
- ('\u{105a4}', 0x1057d), ('\u{105a5}', 0x1057e), ('\u{105a6}', 0x1057f),
- ('\u{105a7}', 0x10580), ('\u{105a8}', 0x10581), ('\u{105a9}', 0x10582),
- ('\u{105aa}', 0x10583), ('\u{105ab}', 0x10584), ('\u{105ac}', 0x10585),
- ('\u{105ad}', 0x10586), ('\u{105ae}', 0x10587), ('\u{105af}', 0x10588),
- ('\u{105b0}', 0x10589), ('\u{105b1}', 0x1058a), ('\u{105b3}', 0x1058c),
- ('\u{105b4}', 0x1058d), ('\u{105b5}', 0x1058e), ('\u{105b6}', 0x1058f),
- ('\u{105b7}', 0x10590), ('\u{105b8}', 0x10591), ('\u{105b9}', 0x10592),
- ('\u{105bb}', 0x10594), ('\u{105bc}', 0x10595), ('\u{10cc0}', 0x10c80),
- ('\u{10cc1}', 0x10c81), ('\u{10cc2}', 0x10c82), ('\u{10cc3}', 0x10c83),
- ('\u{10cc4}', 0x10c84), ('\u{10cc5}', 0x10c85), ('\u{10cc6}', 0x10c86),
- ('\u{10cc7}', 0x10c87), ('\u{10cc8}', 0x10c88), ('\u{10cc9}', 0x10c89),
- ('\u{10cca}', 0x10c8a), ('\u{10ccb}', 0x10c8b), ('\u{10ccc}', 0x10c8c),
- ('\u{10ccd}', 0x10c8d), ('\u{10cce}', 0x10c8e), ('\u{10ccf}', 0x10c8f),
- ('\u{10cd0}', 0x10c90), ('\u{10cd1}', 0x10c91), ('\u{10cd2}', 0x10c92),
- ('\u{10cd3}', 0x10c93), ('\u{10cd4}', 0x10c94), ('\u{10cd5}', 0x10c95),
- ('\u{10cd6}', 0x10c96), ('\u{10cd7}', 0x10c97), ('\u{10cd8}', 0x10c98),
- ('\u{10cd9}', 0x10c99), ('\u{10cda}', 0x10c9a), ('\u{10cdb}', 0x10c9b),
- ('\u{10cdc}', 0x10c9c), ('\u{10cdd}', 0x10c9d), ('\u{10cde}', 0x10c9e),
- ('\u{10cdf}', 0x10c9f), ('\u{10ce0}', 0x10ca0), ('\u{10ce1}', 0x10ca1),
- ('\u{10ce2}', 0x10ca2), ('\u{10ce3}', 0x10ca3), ('\u{10ce4}', 0x10ca4),
- ('\u{10ce5}', 0x10ca5), ('\u{10ce6}', 0x10ca6), ('\u{10ce7}', 0x10ca7),
- ('\u{10ce8}', 0x10ca8), ('\u{10ce9}', 0x10ca9), ('\u{10cea}', 0x10caa),
- ('\u{10ceb}', 0x10cab), ('\u{10cec}', 0x10cac), ('\u{10ced}', 0x10cad),
- ('\u{10cee}', 0x10cae), ('\u{10cef}', 0x10caf), ('\u{10cf0}', 0x10cb0),
- ('\u{10cf1}', 0x10cb1), ('\u{10cf2}', 0x10cb2), ('\u{10d70}', 0x10d50),
- ('\u{10d71}', 0x10d51), ('\u{10d72}', 0x10d52), ('\u{10d73}', 0x10d53),
- ('\u{10d74}', 0x10d54), ('\u{10d75}', 0x10d55), ('\u{10d76}', 0x10d56),
- ('\u{10d77}', 0x10d57), ('\u{10d78}', 0x10d58), ('\u{10d79}', 0x10d59),
- ('\u{10d7a}', 0x10d5a), ('\u{10d7b}', 0x10d5b), ('\u{10d7c}', 0x10d5c),
- ('\u{10d7d}', 0x10d5d), ('\u{10d7e}', 0x10d5e), ('\u{10d7f}', 0x10d5f),
- ('\u{10d80}', 0x10d60), ('\u{10d81}', 0x10d61), ('\u{10d82}', 0x10d62),
- ('\u{10d83}', 0x10d63), ('\u{10d84}', 0x10d64), ('\u{10d85}', 0x10d65),
- ('\u{118c0}', 0x118a0), ('\u{118c1}', 0x118a1), ('\u{118c2}', 0x118a2),
- ('\u{118c3}', 0x118a3), ('\u{118c4}', 0x118a4), ('\u{118c5}', 0x118a5),
- ('\u{118c6}', 0x118a6), ('\u{118c7}', 0x118a7), ('\u{118c8}', 0x118a8),
- ('\u{118c9}', 0x118a9), ('\u{118ca}', 0x118aa), ('\u{118cb}', 0x118ab),
- ('\u{118cc}', 0x118ac), ('\u{118cd}', 0x118ad), ('\u{118ce}', 0x118ae),
- ('\u{118cf}', 0x118af), ('\u{118d0}', 0x118b0), ('\u{118d1}', 0x118b1),
- ('\u{118d2}', 0x118b2), ('\u{118d3}', 0x118b3), ('\u{118d4}', 0x118b4),
- ('\u{118d5}', 0x118b5), ('\u{118d6}', 0x118b6), ('\u{118d7}', 0x118b7),
- ('\u{118d8}', 0x118b8), ('\u{118d9}', 0x118b9), ('\u{118da}', 0x118ba),
- ('\u{118db}', 0x118bb), ('\u{118dc}', 0x118bc), ('\u{118dd}', 0x118bd),
- ('\u{118de}', 0x118be), ('\u{118df}', 0x118bf), ('\u{16e60}', 0x16e40),
- ('\u{16e61}', 0x16e41), ('\u{16e62}', 0x16e42), ('\u{16e63}', 0x16e43),
- ('\u{16e64}', 0x16e44), ('\u{16e65}', 0x16e45), ('\u{16e66}', 0x16e46),
- ('\u{16e67}', 0x16e47), ('\u{16e68}', 0x16e48), ('\u{16e69}', 0x16e49),
- ('\u{16e6a}', 0x16e4a), ('\u{16e6b}', 0x16e4b), ('\u{16e6c}', 0x16e4c),
- ('\u{16e6d}', 0x16e4d), ('\u{16e6e}', 0x16e4e), ('\u{16e6f}', 0x16e4f),
- ('\u{16e70}', 0x16e50), ('\u{16e71}', 0x16e51), ('\u{16e72}', 0x16e52),
- ('\u{16e73}', 0x16e53), ('\u{16e74}', 0x16e54), ('\u{16e75}', 0x16e55),
- ('\u{16e76}', 0x16e56), ('\u{16e77}', 0x16e57), ('\u{16e78}', 0x16e58),
- ('\u{16e79}', 0x16e59), ('\u{16e7a}', 0x16e5a), ('\u{16e7b}', 0x16e5b),
- ('\u{16e7c}', 0x16e5c), ('\u{16e7d}', 0x16e5d), ('\u{16e7e}', 0x16e5e),
- ('\u{16e7f}', 0x16e5f), ('\u{16ebb}', 0x16ea0), ('\u{16ebc}', 0x16ea1),
- ('\u{16ebd}', 0x16ea2), ('\u{16ebe}', 0x16ea3), ('\u{16ebf}', 0x16ea4),
- ('\u{16ec0}', 0x16ea5), ('\u{16ec1}', 0x16ea6), ('\u{16ec2}', 0x16ea7),
- ('\u{16ec3}', 0x16ea8), ('\u{16ec4}', 0x16ea9), ('\u{16ec5}', 0x16eaa),
- ('\u{16ec6}', 0x16eab), ('\u{16ec7}', 0x16eac), ('\u{16ec8}', 0x16ead),
- ('\u{16ec9}', 0x16eae), ('\u{16eca}', 0x16eaf), ('\u{16ecb}', 0x16eb0),
- ('\u{16ecc}', 0x16eb1), ('\u{16ecd}', 0x16eb2), ('\u{16ece}', 0x16eb3),
- ('\u{16ecf}', 0x16eb4), ('\u{16ed0}', 0x16eb5), ('\u{16ed1}', 0x16eb6),
- ('\u{16ed2}', 0x16eb7), ('\u{16ed3}', 0x16eb8), ('\u{1e922}', 0x1e900),
- ('\u{1e923}', 0x1e901), ('\u{1e924}', 0x1e902), ('\u{1e925}', 0x1e903),
- ('\u{1e926}', 0x1e904), ('\u{1e927}', 0x1e905), ('\u{1e928}', 0x1e906),
- ('\u{1e929}', 0x1e907), ('\u{1e92a}', 0x1e908), ('\u{1e92b}', 0x1e909),
- ('\u{1e92c}', 0x1e90a), ('\u{1e92d}', 0x1e90b), ('\u{1e92e}', 0x1e90c),
- ('\u{1e92f}', 0x1e90d), ('\u{1e930}', 0x1e90e), ('\u{1e931}', 0x1e90f),
- ('\u{1e932}', 0x1e910), ('\u{1e933}', 0x1e911), ('\u{1e934}', 0x1e912),
- ('\u{1e935}', 0x1e913), ('\u{1e936}', 0x1e914), ('\u{1e937}', 0x1e915),
- ('\u{1e938}', 0x1e916), ('\u{1e939}', 0x1e917), ('\u{1e93a}', 0x1e918),
- ('\u{1e93b}', 0x1e919), ('\u{1e93c}', 0x1e91a), ('\u{1e93d}', 0x1e91b),
- ('\u{1e93e}', 0x1e91c), ('\u{1e93f}', 0x1e91d), ('\u{1e940}', 0x1e91e),
- ('\u{1e941}', 0x1e91f), ('\u{1e942}', 0x1e920), ('\u{1e943}', 0x1e921),
+ pub fn to_upper(c: char) -> [char; 3] {
+ if c.is_ascii() {
+ [(c as u8).to_ascii_uppercase() as char, '\0', '\0']
+ } else {
+ UPPERCASE_TABLE
+ .binary_search_by(|&(key, _)| key.cmp(&c))
+ .map(|i| {
+ let u = UPPERCASE_TABLE[i].1;
+ char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| {
+ // SAFETY: Index comes from statically generated table
+ unsafe { *UPPERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) }
+ })
+ })
+ .unwrap_or([c, '\0', '\0'])
+ }
+ }
+
+ static LOWERCASE_TABLE: &[(char, u32); 1462] = &[
+ ('\u{c0}', 224), ('\u{c1}', 225), ('\u{c2}', 226), ('\u{c3}', 227), ('\u{c4}', 228),
+ ('\u{c5}', 229), ('\u{c6}', 230), ('\u{c7}', 231), ('\u{c8}', 232), ('\u{c9}', 233),
+ ('\u{ca}', 234), ('\u{cb}', 235), ('\u{cc}', 236), ('\u{cd}', 237), ('\u{ce}', 238),
+ ('\u{cf}', 239), ('\u{d0}', 240), ('\u{d1}', 241), ('\u{d2}', 242), ('\u{d3}', 243),
+ ('\u{d4}', 244), ('\u{d5}', 245), ('\u{d6}', 246), ('\u{d8}', 248), ('\u{d9}', 249),
+ ('\u{da}', 250), ('\u{db}', 251), ('\u{dc}', 252), ('\u{dd}', 253), ('\u{de}', 254),
+ ('\u{100}', 257), ('\u{102}', 259), ('\u{104}', 261), ('\u{106}', 263), ('\u{108}', 265),
+ ('\u{10a}', 267), ('\u{10c}', 269), ('\u{10e}', 271), ('\u{110}', 273), ('\u{112}', 275),
+ ('\u{114}', 277), ('\u{116}', 279), ('\u{118}', 281), ('\u{11a}', 283), ('\u{11c}', 285),
+ ('\u{11e}', 287), ('\u{120}', 289), ('\u{122}', 291), ('\u{124}', 293), ('\u{126}', 295),
+ ('\u{128}', 297), ('\u{12a}', 299), ('\u{12c}', 301), ('\u{12e}', 303),
+ ('\u{130}', 4194304), ('\u{132}', 307), ('\u{134}', 309), ('\u{136}', 311),
+ ('\u{139}', 314), ('\u{13b}', 316), ('\u{13d}', 318), ('\u{13f}', 320), ('\u{141}', 322),
+ ('\u{143}', 324), ('\u{145}', 326), ('\u{147}', 328), ('\u{14a}', 331), ('\u{14c}', 333),
+ ('\u{14e}', 335), ('\u{150}', 337), ('\u{152}', 339), ('\u{154}', 341), ('\u{156}', 343),
+ ('\u{158}', 345), ('\u{15a}', 347), ('\u{15c}', 349), ('\u{15e}', 351), ('\u{160}', 353),
+ ('\u{162}', 355), ('\u{164}', 357), ('\u{166}', 359), ('\u{168}', 361), ('\u{16a}', 363),
+ ('\u{16c}', 365), ('\u{16e}', 367), ('\u{170}', 369), ('\u{172}', 371), ('\u{174}', 373),
+ ('\u{176}', 375), ('\u{178}', 255), ('\u{179}', 378), ('\u{17b}', 380), ('\u{17d}', 382),
+ ('\u{181}', 595), ('\u{182}', 387), ('\u{184}', 389), ('\u{186}', 596), ('\u{187}', 392),
+ ('\u{189}', 598), ('\u{18a}', 599), ('\u{18b}', 396), ('\u{18e}', 477), ('\u{18f}', 601),
+ ('\u{190}', 603), ('\u{191}', 402), ('\u{193}', 608), ('\u{194}', 611), ('\u{196}', 617),
+ ('\u{197}', 616), ('\u{198}', 409), ('\u{19c}', 623), ('\u{19d}', 626), ('\u{19f}', 629),
+ ('\u{1a0}', 417), ('\u{1a2}', 419), ('\u{1a4}', 421), ('\u{1a6}', 640), ('\u{1a7}', 424),
+ ('\u{1a9}', 643), ('\u{1ac}', 429), ('\u{1ae}', 648), ('\u{1af}', 432), ('\u{1b1}', 650),
+ ('\u{1b2}', 651), ('\u{1b3}', 436), ('\u{1b5}', 438), ('\u{1b7}', 658), ('\u{1b8}', 441),
+ ('\u{1bc}', 445), ('\u{1c4}', 454), ('\u{1c5}', 454), ('\u{1c7}', 457), ('\u{1c8}', 457),
+ ('\u{1ca}', 460), ('\u{1cb}', 460), ('\u{1cd}', 462), ('\u{1cf}', 464), ('\u{1d1}', 466),
+ ('\u{1d3}', 468), ('\u{1d5}', 470), ('\u{1d7}', 472), ('\u{1d9}', 474), ('\u{1db}', 476),
+ ('\u{1de}', 479), ('\u{1e0}', 481), ('\u{1e2}', 483), ('\u{1e4}', 485), ('\u{1e6}', 487),
+ ('\u{1e8}', 489), ('\u{1ea}', 491), ('\u{1ec}', 493), ('\u{1ee}', 495), ('\u{1f1}', 499),
+ ('\u{1f2}', 499), ('\u{1f4}', 501), ('\u{1f6}', 405), ('\u{1f7}', 447), ('\u{1f8}', 505),
+ ('\u{1fa}', 507), ('\u{1fc}', 509), ('\u{1fe}', 511), ('\u{200}', 513), ('\u{202}', 515),
+ ('\u{204}', 517), ('\u{206}', 519), ('\u{208}', 521), ('\u{20a}', 523), ('\u{20c}', 525),
+ ('\u{20e}', 527), ('\u{210}', 529), ('\u{212}', 531), ('\u{214}', 533), ('\u{216}', 535),
+ ('\u{218}', 537), ('\u{21a}', 539), ('\u{21c}', 541), ('\u{21e}', 543), ('\u{220}', 414),
+ ('\u{222}', 547), ('\u{224}', 549), ('\u{226}', 551), ('\u{228}', 553), ('\u{22a}', 555),
+ ('\u{22c}', 557), ('\u{22e}', 559), ('\u{230}', 561), ('\u{232}', 563), ('\u{23a}', 11365),
+ ('\u{23b}', 572), ('\u{23d}', 410), ('\u{23e}', 11366), ('\u{241}', 578), ('\u{243}', 384),
+ ('\u{244}', 649), ('\u{245}', 652), ('\u{246}', 583), ('\u{248}', 585), ('\u{24a}', 587),
+ ('\u{24c}', 589), ('\u{24e}', 591), ('\u{370}', 881), ('\u{372}', 883), ('\u{376}', 887),
+ ('\u{37f}', 1011), ('\u{386}', 940), ('\u{388}', 941), ('\u{389}', 942), ('\u{38a}', 943),
+ ('\u{38c}', 972), ('\u{38e}', 973), ('\u{38f}', 974), ('\u{391}', 945), ('\u{392}', 946),
+ ('\u{393}', 947), ('\u{394}', 948), ('\u{395}', 949), ('\u{396}', 950), ('\u{397}', 951),
+ ('\u{398}', 952), ('\u{399}', 953), ('\u{39a}', 954), ('\u{39b}', 955), ('\u{39c}', 956),
+ ('\u{39d}', 957), ('\u{39e}', 958), ('\u{39f}', 959), ('\u{3a0}', 960), ('\u{3a1}', 961),
+ ('\u{3a3}', 963), ('\u{3a4}', 964), ('\u{3a5}', 965), ('\u{3a6}', 966), ('\u{3a7}', 967),
+ ('\u{3a8}', 968), ('\u{3a9}', 969), ('\u{3aa}', 970), ('\u{3ab}', 971), ('\u{3cf}', 983),
+ ('\u{3d8}', 985), ('\u{3da}', 987), ('\u{3dc}', 989), ('\u{3de}', 991), ('\u{3e0}', 993),
+ ('\u{3e2}', 995), ('\u{3e4}', 997), ('\u{3e6}', 999), ('\u{3e8}', 1001), ('\u{3ea}', 1003),
+ ('\u{3ec}', 1005), ('\u{3ee}', 1007), ('\u{3f4}', 952), ('\u{3f7}', 1016),
+ ('\u{3f9}', 1010), ('\u{3fa}', 1019), ('\u{3fd}', 891), ('\u{3fe}', 892), ('\u{3ff}', 893),
+ ('\u{400}', 1104), ('\u{401}', 1105), ('\u{402}', 1106), ('\u{403}', 1107),
+ ('\u{404}', 1108), ('\u{405}', 1109), ('\u{406}', 1110), ('\u{407}', 1111),
+ ('\u{408}', 1112), ('\u{409}', 1113), ('\u{40a}', 1114), ('\u{40b}', 1115),
+ ('\u{40c}', 1116), ('\u{40d}', 1117), ('\u{40e}', 1118), ('\u{40f}', 1119),
+ ('\u{410}', 1072), ('\u{411}', 1073), ('\u{412}', 1074), ('\u{413}', 1075),
+ ('\u{414}', 1076), ('\u{415}', 1077), ('\u{416}', 1078), ('\u{417}', 1079),
+ ('\u{418}', 1080), ('\u{419}', 1081), ('\u{41a}', 1082), ('\u{41b}', 1083),
+ ('\u{41c}', 1084), ('\u{41d}', 1085), ('\u{41e}', 1086), ('\u{41f}', 1087),
+ ('\u{420}', 1088), ('\u{421}', 1089), ('\u{422}', 1090), ('\u{423}', 1091),
+ ('\u{424}', 1092), ('\u{425}', 1093), ('\u{426}', 1094), ('\u{427}', 1095),
+ ('\u{428}', 1096), ('\u{429}', 1097), ('\u{42a}', 1098), ('\u{42b}', 1099),
+ ('\u{42c}', 1100), ('\u{42d}', 1101), ('\u{42e}', 1102), ('\u{42f}', 1103),
+ ('\u{460}', 1121), ('\u{462}', 1123), ('\u{464}', 1125), ('\u{466}', 1127),
+ ('\u{468}', 1129), ('\u{46a}', 1131), ('\u{46c}', 1133), ('\u{46e}', 1135),
+ ('\u{470}', 1137), ('\u{472}', 1139), ('\u{474}', 1141), ('\u{476}', 1143),
+ ('\u{478}', 1145), ('\u{47a}', 1147), ('\u{47c}', 1149), ('\u{47e}', 1151),
+ ('\u{480}', 1153), ('\u{48a}', 1163), ('\u{48c}', 1165), ('\u{48e}', 1167),
+ ('\u{490}', 1169), ('\u{492}', 1171), ('\u{494}', 1173), ('\u{496}', 1175),
+ ('\u{498}', 1177), ('\u{49a}', 1179), ('\u{49c}', 1181), ('\u{49e}', 1183),
+ ('\u{4a0}', 1185), ('\u{4a2}', 1187), ('\u{4a4}', 1189), ('\u{4a6}', 1191),
+ ('\u{4a8}', 1193), ('\u{4aa}', 1195), ('\u{4ac}', 1197), ('\u{4ae}', 1199),
+ ('\u{4b0}', 1201), ('\u{4b2}', 1203), ('\u{4b4}', 1205), ('\u{4b6}', 1207),
+ ('\u{4b8}', 1209), ('\u{4ba}', 1211), ('\u{4bc}', 1213), ('\u{4be}', 1215),
+ ('\u{4c0}', 1231), ('\u{4c1}', 1218), ('\u{4c3}', 1220), ('\u{4c5}', 1222),
+ ('\u{4c7}', 1224), ('\u{4c9}', 1226), ('\u{4cb}', 1228), ('\u{4cd}', 1230),
+ ('\u{4d0}', 1233), ('\u{4d2}', 1235), ('\u{4d4}', 1237), ('\u{4d6}', 1239),
+ ('\u{4d8}', 1241), ('\u{4da}', 1243), ('\u{4dc}', 1245), ('\u{4de}', 1247),
+ ('\u{4e0}', 1249), ('\u{4e2}', 1251), ('\u{4e4}', 1253), ('\u{4e6}', 1255),
+ ('\u{4e8}', 1257), ('\u{4ea}', 1259), ('\u{4ec}', 1261), ('\u{4ee}', 1263),
+ ('\u{4f0}', 1265), ('\u{4f2}', 1267), ('\u{4f4}', 1269), ('\u{4f6}', 1271),
+ ('\u{4f8}', 1273), ('\u{4fa}', 1275), ('\u{4fc}', 1277), ('\u{4fe}', 1279),
+ ('\u{500}', 1281), ('\u{502}', 1283), ('\u{504}', 1285), ('\u{506}', 1287),
+ ('\u{508}', 1289), ('\u{50a}', 1291), ('\u{50c}', 1293), ('\u{50e}', 1295),
+ ('\u{510}', 1297), ('\u{512}', 1299), ('\u{514}', 1301), ('\u{516}', 1303),
+ ('\u{518}', 1305), ('\u{51a}', 1307), ('\u{51c}', 1309), ('\u{51e}', 1311),
+ ('\u{520}', 1313), ('\u{522}', 1315), ('\u{524}', 1317), ('\u{526}', 1319),
+ ('\u{528}', 1321), ('\u{52a}', 1323), ('\u{52c}', 1325), ('\u{52e}', 1327),
+ ('\u{531}', 1377), ('\u{532}', 1378), ('\u{533}', 1379), ('\u{534}', 1380),
+ ('\u{535}', 1381), ('\u{536}', 1382), ('\u{537}', 1383), ('\u{538}', 1384),
+ ('\u{539}', 1385), ('\u{53a}', 1386), ('\u{53b}', 1387), ('\u{53c}', 1388),
+ ('\u{53d}', 1389), ('\u{53e}', 1390), ('\u{53f}', 1391), ('\u{540}', 1392),
+ ('\u{541}', 1393), ('\u{542}', 1394), ('\u{543}', 1395), ('\u{544}', 1396),
+ ('\u{545}', 1397), ('\u{546}', 1398), ('\u{547}', 1399), ('\u{548}', 1400),
+ ('\u{549}', 1401), ('\u{54a}', 1402), ('\u{54b}', 1403), ('\u{54c}', 1404),
+ ('\u{54d}', 1405), ('\u{54e}', 1406), ('\u{54f}', 1407), ('\u{550}', 1408),
+ ('\u{551}', 1409), ('\u{552}', 1410), ('\u{553}', 1411), ('\u{554}', 1412),
+ ('\u{555}', 1413), ('\u{556}', 1414), ('\u{10a0}', 11520), ('\u{10a1}', 11521),
+ ('\u{10a2}', 11522), ('\u{10a3}', 11523), ('\u{10a4}', 11524), ('\u{10a5}', 11525),
+ ('\u{10a6}', 11526), ('\u{10a7}', 11527), ('\u{10a8}', 11528), ('\u{10a9}', 11529),
+ ('\u{10aa}', 11530), ('\u{10ab}', 11531), ('\u{10ac}', 11532), ('\u{10ad}', 11533),
+ ('\u{10ae}', 11534), ('\u{10af}', 11535), ('\u{10b0}', 11536), ('\u{10b1}', 11537),
+ ('\u{10b2}', 11538), ('\u{10b3}', 11539), ('\u{10b4}', 11540), ('\u{10b5}', 11541),
+ ('\u{10b6}', 11542), ('\u{10b7}', 11543), ('\u{10b8}', 11544), ('\u{10b9}', 11545),
+ ('\u{10ba}', 11546), ('\u{10bb}', 11547), ('\u{10bc}', 11548), ('\u{10bd}', 11549),
+ ('\u{10be}', 11550), ('\u{10bf}', 11551), ('\u{10c0}', 11552), ('\u{10c1}', 11553),
+ ('\u{10c2}', 11554), ('\u{10c3}', 11555), ('\u{10c4}', 11556), ('\u{10c5}', 11557),
+ ('\u{10c7}', 11559), ('\u{10cd}', 11565), ('\u{13a0}', 43888), ('\u{13a1}', 43889),
+ ('\u{13a2}', 43890), ('\u{13a3}', 43891), ('\u{13a4}', 43892), ('\u{13a5}', 43893),
+ ('\u{13a6}', 43894), ('\u{13a7}', 43895), ('\u{13a8}', 43896), ('\u{13a9}', 43897),
+ ('\u{13aa}', 43898), ('\u{13ab}', 43899), ('\u{13ac}', 43900), ('\u{13ad}', 43901),
+ ('\u{13ae}', 43902), ('\u{13af}', 43903), ('\u{13b0}', 43904), ('\u{13b1}', 43905),
+ ('\u{13b2}', 43906), ('\u{13b3}', 43907), ('\u{13b4}', 43908), ('\u{13b5}', 43909),
+ ('\u{13b6}', 43910), ('\u{13b7}', 43911), ('\u{13b8}', 43912), ('\u{13b9}', 43913),
+ ('\u{13ba}', 43914), ('\u{13bb}', 43915), ('\u{13bc}', 43916), ('\u{13bd}', 43917),
+ ('\u{13be}', 43918), ('\u{13bf}', 43919), ('\u{13c0}', 43920), ('\u{13c1}', 43921),
+ ('\u{13c2}', 43922), ('\u{13c3}', 43923), ('\u{13c4}', 43924), ('\u{13c5}', 43925),
+ ('\u{13c6}', 43926), ('\u{13c7}', 43927), ('\u{13c8}', 43928), ('\u{13c9}', 43929),
+ ('\u{13ca}', 43930), ('\u{13cb}', 43931), ('\u{13cc}', 43932), ('\u{13cd}', 43933),
+ ('\u{13ce}', 43934), ('\u{13cf}', 43935), ('\u{13d0}', 43936), ('\u{13d1}', 43937),
+ ('\u{13d2}', 43938), ('\u{13d3}', 43939), ('\u{13d4}', 43940), ('\u{13d5}', 43941),
+ ('\u{13d6}', 43942), ('\u{13d7}', 43943), ('\u{13d8}', 43944), ('\u{13d9}', 43945),
+ ('\u{13da}', 43946), ('\u{13db}', 43947), ('\u{13dc}', 43948), ('\u{13dd}', 43949),
+ ('\u{13de}', 43950), ('\u{13df}', 43951), ('\u{13e0}', 43952), ('\u{13e1}', 43953),
+ ('\u{13e2}', 43954), ('\u{13e3}', 43955), ('\u{13e4}', 43956), ('\u{13e5}', 43957),
+ ('\u{13e6}', 43958), ('\u{13e7}', 43959), ('\u{13e8}', 43960), ('\u{13e9}', 43961),
+ ('\u{13ea}', 43962), ('\u{13eb}', 43963), ('\u{13ec}', 43964), ('\u{13ed}', 43965),
+ ('\u{13ee}', 43966), ('\u{13ef}', 43967), ('\u{13f0}', 5112), ('\u{13f1}', 5113),
+ ('\u{13f2}', 5114), ('\u{13f3}', 5115), ('\u{13f4}', 5116), ('\u{13f5}', 5117),
+ ('\u{1c89}', 7306), ('\u{1c90}', 4304), ('\u{1c91}', 4305), ('\u{1c92}', 4306),
+ ('\u{1c93}', 4307), ('\u{1c94}', 4308), ('\u{1c95}', 4309), ('\u{1c96}', 4310),
+ ('\u{1c97}', 4311), ('\u{1c98}', 4312), ('\u{1c99}', 4313), ('\u{1c9a}', 4314),
+ ('\u{1c9b}', 4315), ('\u{1c9c}', 4316), ('\u{1c9d}', 4317), ('\u{1c9e}', 4318),
+ ('\u{1c9f}', 4319), ('\u{1ca0}', 4320), ('\u{1ca1}', 4321), ('\u{1ca2}', 4322),
+ ('\u{1ca3}', 4323), ('\u{1ca4}', 4324), ('\u{1ca5}', 4325), ('\u{1ca6}', 4326),
+ ('\u{1ca7}', 4327), ('\u{1ca8}', 4328), ('\u{1ca9}', 4329), ('\u{1caa}', 4330),
+ ('\u{1cab}', 4331), ('\u{1cac}', 4332), ('\u{1cad}', 4333), ('\u{1cae}', 4334),
+ ('\u{1caf}', 4335), ('\u{1cb0}', 4336), ('\u{1cb1}', 4337), ('\u{1cb2}', 4338),
+ ('\u{1cb3}', 4339), ('\u{1cb4}', 4340), ('\u{1cb5}', 4341), ('\u{1cb6}', 4342),
+ ('\u{1cb7}', 4343), ('\u{1cb8}', 4344), ('\u{1cb9}', 4345), ('\u{1cba}', 4346),
+ ('\u{1cbd}', 4349), ('\u{1cbe}', 4350), ('\u{1cbf}', 4351), ('\u{1e00}', 7681),
+ ('\u{1e02}', 7683), ('\u{1e04}', 7685), ('\u{1e06}', 7687), ('\u{1e08}', 7689),
+ ('\u{1e0a}', 7691), ('\u{1e0c}', 7693), ('\u{1e0e}', 7695), ('\u{1e10}', 7697),
+ ('\u{1e12}', 7699), ('\u{1e14}', 7701), ('\u{1e16}', 7703), ('\u{1e18}', 7705),
+ ('\u{1e1a}', 7707), ('\u{1e1c}', 7709), ('\u{1e1e}', 7711), ('\u{1e20}', 7713),
+ ('\u{1e22}', 7715), ('\u{1e24}', 7717), ('\u{1e26}', 7719), ('\u{1e28}', 7721),
+ ('\u{1e2a}', 7723), ('\u{1e2c}', 7725), ('\u{1e2e}', 7727), ('\u{1e30}', 7729),
+ ('\u{1e32}', 7731), ('\u{1e34}', 7733), ('\u{1e36}', 7735), ('\u{1e38}', 7737),
+ ('\u{1e3a}', 7739), ('\u{1e3c}', 7741), ('\u{1e3e}', 7743), ('\u{1e40}', 7745),
+ ('\u{1e42}', 7747), ('\u{1e44}', 7749), ('\u{1e46}', 7751), ('\u{1e48}', 7753),
+ ('\u{1e4a}', 7755), ('\u{1e4c}', 7757), ('\u{1e4e}', 7759), ('\u{1e50}', 7761),
+ ('\u{1e52}', 7763), ('\u{1e54}', 7765), ('\u{1e56}', 7767), ('\u{1e58}', 7769),
+ ('\u{1e5a}', 7771), ('\u{1e5c}', 7773), ('\u{1e5e}', 7775), ('\u{1e60}', 7777),
+ ('\u{1e62}', 7779), ('\u{1e64}', 7781), ('\u{1e66}', 7783), ('\u{1e68}', 7785),
+ ('\u{1e6a}', 7787), ('\u{1e6c}', 7789), ('\u{1e6e}', 7791), ('\u{1e70}', 7793),
+ ('\u{1e72}', 7795), ('\u{1e74}', 7797), ('\u{1e76}', 7799), ('\u{1e78}', 7801),
+ ('\u{1e7a}', 7803), ('\u{1e7c}', 7805), ('\u{1e7e}', 7807), ('\u{1e80}', 7809),
+ ('\u{1e82}', 7811), ('\u{1e84}', 7813), ('\u{1e86}', 7815), ('\u{1e88}', 7817),
+ ('\u{1e8a}', 7819), ('\u{1e8c}', 7821), ('\u{1e8e}', 7823), ('\u{1e90}', 7825),
+ ('\u{1e92}', 7827), ('\u{1e94}', 7829), ('\u{1e9e}', 223), ('\u{1ea0}', 7841),
+ ('\u{1ea2}', 7843), ('\u{1ea4}', 7845), ('\u{1ea6}', 7847), ('\u{1ea8}', 7849),
+ ('\u{1eaa}', 7851), ('\u{1eac}', 7853), ('\u{1eae}', 7855), ('\u{1eb0}', 7857),
+ ('\u{1eb2}', 7859), ('\u{1eb4}', 7861), ('\u{1eb6}', 7863), ('\u{1eb8}', 7865),
+ ('\u{1eba}', 7867), ('\u{1ebc}', 7869), ('\u{1ebe}', 7871), ('\u{1ec0}', 7873),
+ ('\u{1ec2}', 7875), ('\u{1ec4}', 7877), ('\u{1ec6}', 7879), ('\u{1ec8}', 7881),
+ ('\u{1eca}', 7883), ('\u{1ecc}', 7885), ('\u{1ece}', 7887), ('\u{1ed0}', 7889),
+ ('\u{1ed2}', 7891), ('\u{1ed4}', 7893), ('\u{1ed6}', 7895), ('\u{1ed8}', 7897),
+ ('\u{1eda}', 7899), ('\u{1edc}', 7901), ('\u{1ede}', 7903), ('\u{1ee0}', 7905),
+ ('\u{1ee2}', 7907), ('\u{1ee4}', 7909), ('\u{1ee6}', 7911), ('\u{1ee8}', 7913),
+ ('\u{1eea}', 7915), ('\u{1eec}', 7917), ('\u{1eee}', 7919), ('\u{1ef0}', 7921),
+ ('\u{1ef2}', 7923), ('\u{1ef4}', 7925), ('\u{1ef6}', 7927), ('\u{1ef8}', 7929),
+ ('\u{1efa}', 7931), ('\u{1efc}', 7933), ('\u{1efe}', 7935), ('\u{1f08}', 7936),
+ ('\u{1f09}', 7937), ('\u{1f0a}', 7938), ('\u{1f0b}', 7939), ('\u{1f0c}', 7940),
+ ('\u{1f0d}', 7941), ('\u{1f0e}', 7942), ('\u{1f0f}', 7943), ('\u{1f18}', 7952),
+ ('\u{1f19}', 7953), ('\u{1f1a}', 7954), ('\u{1f1b}', 7955), ('\u{1f1c}', 7956),
+ ('\u{1f1d}', 7957), ('\u{1f28}', 7968), ('\u{1f29}', 7969), ('\u{1f2a}', 7970),
+ ('\u{1f2b}', 7971), ('\u{1f2c}', 7972), ('\u{1f2d}', 7973), ('\u{1f2e}', 7974),
+ ('\u{1f2f}', 7975), ('\u{1f38}', 7984), ('\u{1f39}', 7985), ('\u{1f3a}', 7986),
+ ('\u{1f3b}', 7987), ('\u{1f3c}', 7988), ('\u{1f3d}', 7989), ('\u{1f3e}', 7990),
+ ('\u{1f3f}', 7991), ('\u{1f48}', 8000), ('\u{1f49}', 8001), ('\u{1f4a}', 8002),
+ ('\u{1f4b}', 8003), ('\u{1f4c}', 8004), ('\u{1f4d}', 8005), ('\u{1f59}', 8017),
+ ('\u{1f5b}', 8019), ('\u{1f5d}', 8021), ('\u{1f5f}', 8023), ('\u{1f68}', 8032),
+ ('\u{1f69}', 8033), ('\u{1f6a}', 8034), ('\u{1f6b}', 8035), ('\u{1f6c}', 8036),
+ ('\u{1f6d}', 8037), ('\u{1f6e}', 8038), ('\u{1f6f}', 8039), ('\u{1f88}', 8064),
+ ('\u{1f89}', 8065), ('\u{1f8a}', 8066), ('\u{1f8b}', 8067), ('\u{1f8c}', 8068),
+ ('\u{1f8d}', 8069), ('\u{1f8e}', 8070), ('\u{1f8f}', 8071), ('\u{1f98}', 8080),
+ ('\u{1f99}', 8081), ('\u{1f9a}', 8082), ('\u{1f9b}', 8083), ('\u{1f9c}', 8084),
+ ('\u{1f9d}', 8085), ('\u{1f9e}', 8086), ('\u{1f9f}', 8087), ('\u{1fa8}', 8096),
+ ('\u{1fa9}', 8097), ('\u{1faa}', 8098), ('\u{1fab}', 8099), ('\u{1fac}', 8100),
+ ('\u{1fad}', 8101), ('\u{1fae}', 8102), ('\u{1faf}', 8103), ('\u{1fb8}', 8112),
+ ('\u{1fb9}', 8113), ('\u{1fba}', 8048), ('\u{1fbb}', 8049), ('\u{1fbc}', 8115),
+ ('\u{1fc8}', 8050), ('\u{1fc9}', 8051), ('\u{1fca}', 8052), ('\u{1fcb}', 8053),
+ ('\u{1fcc}', 8131), ('\u{1fd8}', 8144), ('\u{1fd9}', 8145), ('\u{1fda}', 8054),
+ ('\u{1fdb}', 8055), ('\u{1fe8}', 8160), ('\u{1fe9}', 8161), ('\u{1fea}', 8058),
+ ('\u{1feb}', 8059), ('\u{1fec}', 8165), ('\u{1ff8}', 8056), ('\u{1ff9}', 8057),
+ ('\u{1ffa}', 8060), ('\u{1ffb}', 8061), ('\u{1ffc}', 8179), ('\u{2126}', 969),
+ ('\u{212a}', 107), ('\u{212b}', 229), ('\u{2132}', 8526), ('\u{2160}', 8560),
+ ('\u{2161}', 8561), ('\u{2162}', 8562), ('\u{2163}', 8563), ('\u{2164}', 8564),
+ ('\u{2165}', 8565), ('\u{2166}', 8566), ('\u{2167}', 8567), ('\u{2168}', 8568),
+ ('\u{2169}', 8569), ('\u{216a}', 8570), ('\u{216b}', 8571), ('\u{216c}', 8572),
+ ('\u{216d}', 8573), ('\u{216e}', 8574), ('\u{216f}', 8575), ('\u{2183}', 8580),
+ ('\u{24b6}', 9424), ('\u{24b7}', 9425), ('\u{24b8}', 9426), ('\u{24b9}', 9427),
+ ('\u{24ba}', 9428), ('\u{24bb}', 9429), ('\u{24bc}', 9430), ('\u{24bd}', 9431),
+ ('\u{24be}', 9432), ('\u{24bf}', 9433), ('\u{24c0}', 9434), ('\u{24c1}', 9435),
+ ('\u{24c2}', 9436), ('\u{24c3}', 9437), ('\u{24c4}', 9438), ('\u{24c5}', 9439),
+ ('\u{24c6}', 9440), ('\u{24c7}', 9441), ('\u{24c8}', 9442), ('\u{24c9}', 9443),
+ ('\u{24ca}', 9444), ('\u{24cb}', 9445), ('\u{24cc}', 9446), ('\u{24cd}', 9447),
+ ('\u{24ce}', 9448), ('\u{24cf}', 9449), ('\u{2c00}', 11312), ('\u{2c01}', 11313),
+ ('\u{2c02}', 11314), ('\u{2c03}', 11315), ('\u{2c04}', 11316), ('\u{2c05}', 11317),
+ ('\u{2c06}', 11318), ('\u{2c07}', 11319), ('\u{2c08}', 11320), ('\u{2c09}', 11321),
+ ('\u{2c0a}', 11322), ('\u{2c0b}', 11323), ('\u{2c0c}', 11324), ('\u{2c0d}', 11325),
+ ('\u{2c0e}', 11326), ('\u{2c0f}', 11327), ('\u{2c10}', 11328), ('\u{2c11}', 11329),
+ ('\u{2c12}', 11330), ('\u{2c13}', 11331), ('\u{2c14}', 11332), ('\u{2c15}', 11333),
+ ('\u{2c16}', 11334), ('\u{2c17}', 11335), ('\u{2c18}', 11336), ('\u{2c19}', 11337),
+ ('\u{2c1a}', 11338), ('\u{2c1b}', 11339), ('\u{2c1c}', 11340), ('\u{2c1d}', 11341),
+ ('\u{2c1e}', 11342), ('\u{2c1f}', 11343), ('\u{2c20}', 11344), ('\u{2c21}', 11345),
+ ('\u{2c22}', 11346), ('\u{2c23}', 11347), ('\u{2c24}', 11348), ('\u{2c25}', 11349),
+ ('\u{2c26}', 11350), ('\u{2c27}', 11351), ('\u{2c28}', 11352), ('\u{2c29}', 11353),
+ ('\u{2c2a}', 11354), ('\u{2c2b}', 11355), ('\u{2c2c}', 11356), ('\u{2c2d}', 11357),
+ ('\u{2c2e}', 11358), ('\u{2c2f}', 11359), ('\u{2c60}', 11361), ('\u{2c62}', 619),
+ ('\u{2c63}', 7549), ('\u{2c64}', 637), ('\u{2c67}', 11368), ('\u{2c69}', 11370),
+ ('\u{2c6b}', 11372), ('\u{2c6d}', 593), ('\u{2c6e}', 625), ('\u{2c6f}', 592),
+ ('\u{2c70}', 594), ('\u{2c72}', 11379), ('\u{2c75}', 11382), ('\u{2c7e}', 575),
+ ('\u{2c7f}', 576), ('\u{2c80}', 11393), ('\u{2c82}', 11395), ('\u{2c84}', 11397),
+ ('\u{2c86}', 11399), ('\u{2c88}', 11401), ('\u{2c8a}', 11403), ('\u{2c8c}', 11405),
+ ('\u{2c8e}', 11407), ('\u{2c90}', 11409), ('\u{2c92}', 11411), ('\u{2c94}', 11413),
+ ('\u{2c96}', 11415), ('\u{2c98}', 11417), ('\u{2c9a}', 11419), ('\u{2c9c}', 11421),
+ ('\u{2c9e}', 11423), ('\u{2ca0}', 11425), ('\u{2ca2}', 11427), ('\u{2ca4}', 11429),
+ ('\u{2ca6}', 11431), ('\u{2ca8}', 11433), ('\u{2caa}', 11435), ('\u{2cac}', 11437),
+ ('\u{2cae}', 11439), ('\u{2cb0}', 11441), ('\u{2cb2}', 11443), ('\u{2cb4}', 11445),
+ ('\u{2cb6}', 11447), ('\u{2cb8}', 11449), ('\u{2cba}', 11451), ('\u{2cbc}', 11453),
+ ('\u{2cbe}', 11455), ('\u{2cc0}', 11457), ('\u{2cc2}', 11459), ('\u{2cc4}', 11461),
+ ('\u{2cc6}', 11463), ('\u{2cc8}', 11465), ('\u{2cca}', 11467), ('\u{2ccc}', 11469),
+ ('\u{2cce}', 11471), ('\u{2cd0}', 11473), ('\u{2cd2}', 11475), ('\u{2cd4}', 11477),
+ ('\u{2cd6}', 11479), ('\u{2cd8}', 11481), ('\u{2cda}', 11483), ('\u{2cdc}', 11485),
+ ('\u{2cde}', 11487), ('\u{2ce0}', 11489), ('\u{2ce2}', 11491), ('\u{2ceb}', 11500),
+ ('\u{2ced}', 11502), ('\u{2cf2}', 11507), ('\u{a640}', 42561), ('\u{a642}', 42563),
+ ('\u{a644}', 42565), ('\u{a646}', 42567), ('\u{a648}', 42569), ('\u{a64a}', 42571),
+ ('\u{a64c}', 42573), ('\u{a64e}', 42575), ('\u{a650}', 42577), ('\u{a652}', 42579),
+ ('\u{a654}', 42581), ('\u{a656}', 42583), ('\u{a658}', 42585), ('\u{a65a}', 42587),
+ ('\u{a65c}', 42589), ('\u{a65e}', 42591), ('\u{a660}', 42593), ('\u{a662}', 42595),
+ ('\u{a664}', 42597), ('\u{a666}', 42599), ('\u{a668}', 42601), ('\u{a66a}', 42603),
+ ('\u{a66c}', 42605), ('\u{a680}', 42625), ('\u{a682}', 42627), ('\u{a684}', 42629),
+ ('\u{a686}', 42631), ('\u{a688}', 42633), ('\u{a68a}', 42635), ('\u{a68c}', 42637),
+ ('\u{a68e}', 42639), ('\u{a690}', 42641), ('\u{a692}', 42643), ('\u{a694}', 42645),
+ ('\u{a696}', 42647), ('\u{a698}', 42649), ('\u{a69a}', 42651), ('\u{a722}', 42787),
+ ('\u{a724}', 42789), ('\u{a726}', 42791), ('\u{a728}', 42793), ('\u{a72a}', 42795),
+ ('\u{a72c}', 42797), ('\u{a72e}', 42799), ('\u{a732}', 42803), ('\u{a734}', 42805),
+ ('\u{a736}', 42807), ('\u{a738}', 42809), ('\u{a73a}', 42811), ('\u{a73c}', 42813),
+ ('\u{a73e}', 42815), ('\u{a740}', 42817), ('\u{a742}', 42819), ('\u{a744}', 42821),
+ ('\u{a746}', 42823), ('\u{a748}', 42825), ('\u{a74a}', 42827), ('\u{a74c}', 42829),
+ ('\u{a74e}', 42831), ('\u{a750}', 42833), ('\u{a752}', 42835), ('\u{a754}', 42837),
+ ('\u{a756}', 42839), ('\u{a758}', 42841), ('\u{a75a}', 42843), ('\u{a75c}', 42845),
+ ('\u{a75e}', 42847), ('\u{a760}', 42849), ('\u{a762}', 42851), ('\u{a764}', 42853),
+ ('\u{a766}', 42855), ('\u{a768}', 42857), ('\u{a76a}', 42859), ('\u{a76c}', 42861),
+ ('\u{a76e}', 42863), ('\u{a779}', 42874), ('\u{a77b}', 42876), ('\u{a77d}', 7545),
+ ('\u{a77e}', 42879), ('\u{a780}', 42881), ('\u{a782}', 42883), ('\u{a784}', 42885),
+ ('\u{a786}', 42887), ('\u{a78b}', 42892), ('\u{a78d}', 613), ('\u{a790}', 42897),
+ ('\u{a792}', 42899), ('\u{a796}', 42903), ('\u{a798}', 42905), ('\u{a79a}', 42907),
+ ('\u{a79c}', 42909), ('\u{a79e}', 42911), ('\u{a7a0}', 42913), ('\u{a7a2}', 42915),
+ ('\u{a7a4}', 42917), ('\u{a7a6}', 42919), ('\u{a7a8}', 42921), ('\u{a7aa}', 614),
+ ('\u{a7ab}', 604), ('\u{a7ac}', 609), ('\u{a7ad}', 620), ('\u{a7ae}', 618),
+ ('\u{a7b0}', 670), ('\u{a7b1}', 647), ('\u{a7b2}', 669), ('\u{a7b3}', 43859),
+ ('\u{a7b4}', 42933), ('\u{a7b6}', 42935), ('\u{a7b8}', 42937), ('\u{a7ba}', 42939),
+ ('\u{a7bc}', 42941), ('\u{a7be}', 42943), ('\u{a7c0}', 42945), ('\u{a7c2}', 42947),
+ ('\u{a7c4}', 42900), ('\u{a7c5}', 642), ('\u{a7c6}', 7566), ('\u{a7c7}', 42952),
+ ('\u{a7c9}', 42954), ('\u{a7cb}', 612), ('\u{a7cc}', 42957), ('\u{a7ce}', 42959),
+ ('\u{a7d0}', 42961), ('\u{a7d2}', 42963), ('\u{a7d4}', 42965), ('\u{a7d6}', 42967),
+ ('\u{a7d8}', 42969), ('\u{a7da}', 42971), ('\u{a7dc}', 411), ('\u{a7f5}', 42998),
+ ('\u{ff21}', 65345), ('\u{ff22}', 65346), ('\u{ff23}', 65347), ('\u{ff24}', 65348),
+ ('\u{ff25}', 65349), ('\u{ff26}', 65350), ('\u{ff27}', 65351), ('\u{ff28}', 65352),
+ ('\u{ff29}', 65353), ('\u{ff2a}', 65354), ('\u{ff2b}', 65355), ('\u{ff2c}', 65356),
+ ('\u{ff2d}', 65357), ('\u{ff2e}', 65358), ('\u{ff2f}', 65359), ('\u{ff30}', 65360),
+ ('\u{ff31}', 65361), ('\u{ff32}', 65362), ('\u{ff33}', 65363), ('\u{ff34}', 65364),
+ ('\u{ff35}', 65365), ('\u{ff36}', 65366), ('\u{ff37}', 65367), ('\u{ff38}', 65368),
+ ('\u{ff39}', 65369), ('\u{ff3a}', 65370), ('\u{10400}', 66600), ('\u{10401}', 66601),
+ ('\u{10402}', 66602), ('\u{10403}', 66603), ('\u{10404}', 66604), ('\u{10405}', 66605),
+ ('\u{10406}', 66606), ('\u{10407}', 66607), ('\u{10408}', 66608), ('\u{10409}', 66609),
+ ('\u{1040a}', 66610), ('\u{1040b}', 66611), ('\u{1040c}', 66612), ('\u{1040d}', 66613),
+ ('\u{1040e}', 66614), ('\u{1040f}', 66615), ('\u{10410}', 66616), ('\u{10411}', 66617),
+ ('\u{10412}', 66618), ('\u{10413}', 66619), ('\u{10414}', 66620), ('\u{10415}', 66621),
+ ('\u{10416}', 66622), ('\u{10417}', 66623), ('\u{10418}', 66624), ('\u{10419}', 66625),
+ ('\u{1041a}', 66626), ('\u{1041b}', 66627), ('\u{1041c}', 66628), ('\u{1041d}', 66629),
+ ('\u{1041e}', 66630), ('\u{1041f}', 66631), ('\u{10420}', 66632), ('\u{10421}', 66633),
+ ('\u{10422}', 66634), ('\u{10423}', 66635), ('\u{10424}', 66636), ('\u{10425}', 66637),
+ ('\u{10426}', 66638), ('\u{10427}', 66639), ('\u{104b0}', 66776), ('\u{104b1}', 66777),
+ ('\u{104b2}', 66778), ('\u{104b3}', 66779), ('\u{104b4}', 66780), ('\u{104b5}', 66781),
+ ('\u{104b6}', 66782), ('\u{104b7}', 66783), ('\u{104b8}', 66784), ('\u{104b9}', 66785),
+ ('\u{104ba}', 66786), ('\u{104bb}', 66787), ('\u{104bc}', 66788), ('\u{104bd}', 66789),
+ ('\u{104be}', 66790), ('\u{104bf}', 66791), ('\u{104c0}', 66792), ('\u{104c1}', 66793),
+ ('\u{104c2}', 66794), ('\u{104c3}', 66795), ('\u{104c4}', 66796), ('\u{104c5}', 66797),
+ ('\u{104c6}', 66798), ('\u{104c7}', 66799), ('\u{104c8}', 66800), ('\u{104c9}', 66801),
+ ('\u{104ca}', 66802), ('\u{104cb}', 66803), ('\u{104cc}', 66804), ('\u{104cd}', 66805),
+ ('\u{104ce}', 66806), ('\u{104cf}', 66807), ('\u{104d0}', 66808), ('\u{104d1}', 66809),
+ ('\u{104d2}', 66810), ('\u{104d3}', 66811), ('\u{10570}', 66967), ('\u{10571}', 66968),
+ ('\u{10572}', 66969), ('\u{10573}', 66970), ('\u{10574}', 66971), ('\u{10575}', 66972),
+ ('\u{10576}', 66973), ('\u{10577}', 66974), ('\u{10578}', 66975), ('\u{10579}', 66976),
+ ('\u{1057a}', 66977), ('\u{1057c}', 66979), ('\u{1057d}', 66980), ('\u{1057e}', 66981),
+ ('\u{1057f}', 66982), ('\u{10580}', 66983), ('\u{10581}', 66984), ('\u{10582}', 66985),
+ ('\u{10583}', 66986), ('\u{10584}', 66987), ('\u{10585}', 66988), ('\u{10586}', 66989),
+ ('\u{10587}', 66990), ('\u{10588}', 66991), ('\u{10589}', 66992), ('\u{1058a}', 66993),
+ ('\u{1058c}', 66995), ('\u{1058d}', 66996), ('\u{1058e}', 66997), ('\u{1058f}', 66998),
+ ('\u{10590}', 66999), ('\u{10591}', 67000), ('\u{10592}', 67001), ('\u{10594}', 67003),
+ ('\u{10595}', 67004), ('\u{10c80}', 68800), ('\u{10c81}', 68801), ('\u{10c82}', 68802),
+ ('\u{10c83}', 68803), ('\u{10c84}', 68804), ('\u{10c85}', 68805), ('\u{10c86}', 68806),
+ ('\u{10c87}', 68807), ('\u{10c88}', 68808), ('\u{10c89}', 68809), ('\u{10c8a}', 68810),
+ ('\u{10c8b}', 68811), ('\u{10c8c}', 68812), ('\u{10c8d}', 68813), ('\u{10c8e}', 68814),
+ ('\u{10c8f}', 68815), ('\u{10c90}', 68816), ('\u{10c91}', 68817), ('\u{10c92}', 68818),
+ ('\u{10c93}', 68819), ('\u{10c94}', 68820), ('\u{10c95}', 68821), ('\u{10c96}', 68822),
+ ('\u{10c97}', 68823), ('\u{10c98}', 68824), ('\u{10c99}', 68825), ('\u{10c9a}', 68826),
+ ('\u{10c9b}', 68827), ('\u{10c9c}', 68828), ('\u{10c9d}', 68829), ('\u{10c9e}', 68830),
+ ('\u{10c9f}', 68831), ('\u{10ca0}', 68832), ('\u{10ca1}', 68833), ('\u{10ca2}', 68834),
+ ('\u{10ca3}', 68835), ('\u{10ca4}', 68836), ('\u{10ca5}', 68837), ('\u{10ca6}', 68838),
+ ('\u{10ca7}', 68839), ('\u{10ca8}', 68840), ('\u{10ca9}', 68841), ('\u{10caa}', 68842),
+ ('\u{10cab}', 68843), ('\u{10cac}', 68844), ('\u{10cad}', 68845), ('\u{10cae}', 68846),
+ ('\u{10caf}', 68847), ('\u{10cb0}', 68848), ('\u{10cb1}', 68849), ('\u{10cb2}', 68850),
+ ('\u{10d50}', 68976), ('\u{10d51}', 68977), ('\u{10d52}', 68978), ('\u{10d53}', 68979),
+ ('\u{10d54}', 68980), ('\u{10d55}', 68981), ('\u{10d56}', 68982), ('\u{10d57}', 68983),
+ ('\u{10d58}', 68984), ('\u{10d59}', 68985), ('\u{10d5a}', 68986), ('\u{10d5b}', 68987),
+ ('\u{10d5c}', 68988), ('\u{10d5d}', 68989), ('\u{10d5e}', 68990), ('\u{10d5f}', 68991),
+ ('\u{10d60}', 68992), ('\u{10d61}', 68993), ('\u{10d62}', 68994), ('\u{10d63}', 68995),
+ ('\u{10d64}', 68996), ('\u{10d65}', 68997), ('\u{118a0}', 71872), ('\u{118a1}', 71873),
+ ('\u{118a2}', 71874), ('\u{118a3}', 71875), ('\u{118a4}', 71876), ('\u{118a5}', 71877),
+ ('\u{118a6}', 71878), ('\u{118a7}', 71879), ('\u{118a8}', 71880), ('\u{118a9}', 71881),
+ ('\u{118aa}', 71882), ('\u{118ab}', 71883), ('\u{118ac}', 71884), ('\u{118ad}', 71885),
+ ('\u{118ae}', 71886), ('\u{118af}', 71887), ('\u{118b0}', 71888), ('\u{118b1}', 71889),
+ ('\u{118b2}', 71890), ('\u{118b3}', 71891), ('\u{118b4}', 71892), ('\u{118b5}', 71893),
+ ('\u{118b6}', 71894), ('\u{118b7}', 71895), ('\u{118b8}', 71896), ('\u{118b9}', 71897),
+ ('\u{118ba}', 71898), ('\u{118bb}', 71899), ('\u{118bc}', 71900), ('\u{118bd}', 71901),
+ ('\u{118be}', 71902), ('\u{118bf}', 71903), ('\u{16e40}', 93792), ('\u{16e41}', 93793),
+ ('\u{16e42}', 93794), ('\u{16e43}', 93795), ('\u{16e44}', 93796), ('\u{16e45}', 93797),
+ ('\u{16e46}', 93798), ('\u{16e47}', 93799), ('\u{16e48}', 93800), ('\u{16e49}', 93801),
+ ('\u{16e4a}', 93802), ('\u{16e4b}', 93803), ('\u{16e4c}', 93804), ('\u{16e4d}', 93805),
+ ('\u{16e4e}', 93806), ('\u{16e4f}', 93807), ('\u{16e50}', 93808), ('\u{16e51}', 93809),
+ ('\u{16e52}', 93810), ('\u{16e53}', 93811), ('\u{16e54}', 93812), ('\u{16e55}', 93813),
+ ('\u{16e56}', 93814), ('\u{16e57}', 93815), ('\u{16e58}', 93816), ('\u{16e59}', 93817),
+ ('\u{16e5a}', 93818), ('\u{16e5b}', 93819), ('\u{16e5c}', 93820), ('\u{16e5d}', 93821),
+ ('\u{16e5e}', 93822), ('\u{16e5f}', 93823), ('\u{16ea0}', 93883), ('\u{16ea1}', 93884),
+ ('\u{16ea2}', 93885), ('\u{16ea3}', 93886), ('\u{16ea4}', 93887), ('\u{16ea5}', 93888),
+ ('\u{16ea6}', 93889), ('\u{16ea7}', 93890), ('\u{16ea8}', 93891), ('\u{16ea9}', 93892),
+ ('\u{16eaa}', 93893), ('\u{16eab}', 93894), ('\u{16eac}', 93895), ('\u{16ead}', 93896),
+ ('\u{16eae}', 93897), ('\u{16eaf}', 93898), ('\u{16eb0}', 93899), ('\u{16eb1}', 93900),
+ ('\u{16eb2}', 93901), ('\u{16eb3}', 93902), ('\u{16eb4}', 93903), ('\u{16eb5}', 93904),
+ ('\u{16eb6}', 93905), ('\u{16eb7}', 93906), ('\u{16eb8}', 93907), ('\u{1e900}', 125218),
+ ('\u{1e901}', 125219), ('\u{1e902}', 125220), ('\u{1e903}', 125221), ('\u{1e904}', 125222),
+ ('\u{1e905}', 125223), ('\u{1e906}', 125224), ('\u{1e907}', 125225), ('\u{1e908}', 125226),
+ ('\u{1e909}', 125227), ('\u{1e90a}', 125228), ('\u{1e90b}', 125229), ('\u{1e90c}', 125230),
+ ('\u{1e90d}', 125231), ('\u{1e90e}', 125232), ('\u{1e90f}', 125233), ('\u{1e910}', 125234),
+ ('\u{1e911}', 125235), ('\u{1e912}', 125236), ('\u{1e913}', 125237), ('\u{1e914}', 125238),
+ ('\u{1e915}', 125239), ('\u{1e916}', 125240), ('\u{1e917}', 125241), ('\u{1e918}', 125242),
+ ('\u{1e919}', 125243), ('\u{1e91a}', 125244), ('\u{1e91b}', 125245), ('\u{1e91c}', 125246),
+ ('\u{1e91d}', 125247), ('\u{1e91e}', 125248), ('\u{1e91f}', 125249), ('\u{1e920}', 125250),
+ ('\u{1e921}', 125251),
];
- #[rustfmt::skip]
+ static LOWERCASE_TABLE_MULTI: &[[char; 3]; 1] = &[
+ ['i', '\u{307}', '\u{0}'],
+ ];
+
+ static UPPERCASE_TABLE: &[(char, u32); 1554] = &[
+ ('\u{b5}', 924), ('\u{df}', 4194304), ('\u{e0}', 192), ('\u{e1}', 193), ('\u{e2}', 194),
+ ('\u{e3}', 195), ('\u{e4}', 196), ('\u{e5}', 197), ('\u{e6}', 198), ('\u{e7}', 199),
+ ('\u{e8}', 200), ('\u{e9}', 201), ('\u{ea}', 202), ('\u{eb}', 203), ('\u{ec}', 204),
+ ('\u{ed}', 205), ('\u{ee}', 206), ('\u{ef}', 207), ('\u{f0}', 208), ('\u{f1}', 209),
+ ('\u{f2}', 210), ('\u{f3}', 211), ('\u{f4}', 212), ('\u{f5}', 213), ('\u{f6}', 214),
+ ('\u{f8}', 216), ('\u{f9}', 217), ('\u{fa}', 218), ('\u{fb}', 219), ('\u{fc}', 220),
+ ('\u{fd}', 221), ('\u{fe}', 222), ('\u{ff}', 376), ('\u{101}', 256), ('\u{103}', 258),
+ ('\u{105}', 260), ('\u{107}', 262), ('\u{109}', 264), ('\u{10b}', 266), ('\u{10d}', 268),
+ ('\u{10f}', 270), ('\u{111}', 272), ('\u{113}', 274), ('\u{115}', 276), ('\u{117}', 278),
+ ('\u{119}', 280), ('\u{11b}', 282), ('\u{11d}', 284), ('\u{11f}', 286), ('\u{121}', 288),
+ ('\u{123}', 290), ('\u{125}', 292), ('\u{127}', 294), ('\u{129}', 296), ('\u{12b}', 298),
+ ('\u{12d}', 300), ('\u{12f}', 302), ('\u{131}', 73), ('\u{133}', 306), ('\u{135}', 308),
+ ('\u{137}', 310), ('\u{13a}', 313), ('\u{13c}', 315), ('\u{13e}', 317), ('\u{140}', 319),
+ ('\u{142}', 321), ('\u{144}', 323), ('\u{146}', 325), ('\u{148}', 327),
+ ('\u{149}', 4194305), ('\u{14b}', 330), ('\u{14d}', 332), ('\u{14f}', 334),
+ ('\u{151}', 336), ('\u{153}', 338), ('\u{155}', 340), ('\u{157}', 342), ('\u{159}', 344),
+ ('\u{15b}', 346), ('\u{15d}', 348), ('\u{15f}', 350), ('\u{161}', 352), ('\u{163}', 354),
+ ('\u{165}', 356), ('\u{167}', 358), ('\u{169}', 360), ('\u{16b}', 362), ('\u{16d}', 364),
+ ('\u{16f}', 366), ('\u{171}', 368), ('\u{173}', 370), ('\u{175}', 372), ('\u{177}', 374),
+ ('\u{17a}', 377), ('\u{17c}', 379), ('\u{17e}', 381), ('\u{17f}', 83), ('\u{180}', 579),
+ ('\u{183}', 386), ('\u{185}', 388), ('\u{188}', 391), ('\u{18c}', 395), ('\u{192}', 401),
+ ('\u{195}', 502), ('\u{199}', 408), ('\u{19a}', 573), ('\u{19b}', 42972), ('\u{19e}', 544),
+ ('\u{1a1}', 416), ('\u{1a3}', 418), ('\u{1a5}', 420), ('\u{1a8}', 423), ('\u{1ad}', 428),
+ ('\u{1b0}', 431), ('\u{1b4}', 435), ('\u{1b6}', 437), ('\u{1b9}', 440), ('\u{1bd}', 444),
+ ('\u{1bf}', 503), ('\u{1c5}', 452), ('\u{1c6}', 452), ('\u{1c8}', 455), ('\u{1c9}', 455),
+ ('\u{1cb}', 458), ('\u{1cc}', 458), ('\u{1ce}', 461), ('\u{1d0}', 463), ('\u{1d2}', 465),
+ ('\u{1d4}', 467), ('\u{1d6}', 469), ('\u{1d8}', 471), ('\u{1da}', 473), ('\u{1dc}', 475),
+ ('\u{1dd}', 398), ('\u{1df}', 478), ('\u{1e1}', 480), ('\u{1e3}', 482), ('\u{1e5}', 484),
+ ('\u{1e7}', 486), ('\u{1e9}', 488), ('\u{1eb}', 490), ('\u{1ed}', 492), ('\u{1ef}', 494),
+ ('\u{1f0}', 4194306), ('\u{1f2}', 497), ('\u{1f3}', 497), ('\u{1f5}', 500),
+ ('\u{1f9}', 504), ('\u{1fb}', 506), ('\u{1fd}', 508), ('\u{1ff}', 510), ('\u{201}', 512),
+ ('\u{203}', 514), ('\u{205}', 516), ('\u{207}', 518), ('\u{209}', 520), ('\u{20b}', 522),
+ ('\u{20d}', 524), ('\u{20f}', 526), ('\u{211}', 528), ('\u{213}', 530), ('\u{215}', 532),
+ ('\u{217}', 534), ('\u{219}', 536), ('\u{21b}', 538), ('\u{21d}', 540), ('\u{21f}', 542),
+ ('\u{223}', 546), ('\u{225}', 548), ('\u{227}', 550), ('\u{229}', 552), ('\u{22b}', 554),
+ ('\u{22d}', 556), ('\u{22f}', 558), ('\u{231}', 560), ('\u{233}', 562), ('\u{23c}', 571),
+ ('\u{23f}', 11390), ('\u{240}', 11391), ('\u{242}', 577), ('\u{247}', 582),
+ ('\u{249}', 584), ('\u{24b}', 586), ('\u{24d}', 588), ('\u{24f}', 590), ('\u{250}', 11375),
+ ('\u{251}', 11373), ('\u{252}', 11376), ('\u{253}', 385), ('\u{254}', 390),
+ ('\u{256}', 393), ('\u{257}', 394), ('\u{259}', 399), ('\u{25b}', 400), ('\u{25c}', 42923),
+ ('\u{260}', 403), ('\u{261}', 42924), ('\u{263}', 404), ('\u{264}', 42955),
+ ('\u{265}', 42893), ('\u{266}', 42922), ('\u{268}', 407), ('\u{269}', 406),
+ ('\u{26a}', 42926), ('\u{26b}', 11362), ('\u{26c}', 42925), ('\u{26f}', 412),
+ ('\u{271}', 11374), ('\u{272}', 413), ('\u{275}', 415), ('\u{27d}', 11364),
+ ('\u{280}', 422), ('\u{282}', 42949), ('\u{283}', 425), ('\u{287}', 42929),
+ ('\u{288}', 430), ('\u{289}', 580), ('\u{28a}', 433), ('\u{28b}', 434), ('\u{28c}', 581),
+ ('\u{292}', 439), ('\u{29d}', 42930), ('\u{29e}', 42928), ('\u{345}', 921),
+ ('\u{371}', 880), ('\u{373}', 882), ('\u{377}', 886), ('\u{37b}', 1021), ('\u{37c}', 1022),
+ ('\u{37d}', 1023), ('\u{390}', 4194307), ('\u{3ac}', 902), ('\u{3ad}', 904),
+ ('\u{3ae}', 905), ('\u{3af}', 906), ('\u{3b0}', 4194308), ('\u{3b1}', 913),
+ ('\u{3b2}', 914), ('\u{3b3}', 915), ('\u{3b4}', 916), ('\u{3b5}', 917), ('\u{3b6}', 918),
+ ('\u{3b7}', 919), ('\u{3b8}', 920), ('\u{3b9}', 921), ('\u{3ba}', 922), ('\u{3bb}', 923),
+ ('\u{3bc}', 924), ('\u{3bd}', 925), ('\u{3be}', 926), ('\u{3bf}', 927), ('\u{3c0}', 928),
+ ('\u{3c1}', 929), ('\u{3c2}', 931), ('\u{3c3}', 931), ('\u{3c4}', 932), ('\u{3c5}', 933),
+ ('\u{3c6}', 934), ('\u{3c7}', 935), ('\u{3c8}', 936), ('\u{3c9}', 937), ('\u{3ca}', 938),
+ ('\u{3cb}', 939), ('\u{3cc}', 908), ('\u{3cd}', 910), ('\u{3ce}', 911), ('\u{3d0}', 914),
+ ('\u{3d1}', 920), ('\u{3d5}', 934), ('\u{3d6}', 928), ('\u{3d7}', 975), ('\u{3d9}', 984),
+ ('\u{3db}', 986), ('\u{3dd}', 988), ('\u{3df}', 990), ('\u{3e1}', 992), ('\u{3e3}', 994),
+ ('\u{3e5}', 996), ('\u{3e7}', 998), ('\u{3e9}', 1000), ('\u{3eb}', 1002), ('\u{3ed}', 1004),
+ ('\u{3ef}', 1006), ('\u{3f0}', 922), ('\u{3f1}', 929), ('\u{3f2}', 1017), ('\u{3f3}', 895),
+ ('\u{3f5}', 917), ('\u{3f8}', 1015), ('\u{3fb}', 1018), ('\u{430}', 1040),
+ ('\u{431}', 1041), ('\u{432}', 1042), ('\u{433}', 1043), ('\u{434}', 1044),
+ ('\u{435}', 1045), ('\u{436}', 1046), ('\u{437}', 1047), ('\u{438}', 1048),
+ ('\u{439}', 1049), ('\u{43a}', 1050), ('\u{43b}', 1051), ('\u{43c}', 1052),
+ ('\u{43d}', 1053), ('\u{43e}', 1054), ('\u{43f}', 1055), ('\u{440}', 1056),
+ ('\u{441}', 1057), ('\u{442}', 1058), ('\u{443}', 1059), ('\u{444}', 1060),
+ ('\u{445}', 1061), ('\u{446}', 1062), ('\u{447}', 1063), ('\u{448}', 1064),
+ ('\u{449}', 1065), ('\u{44a}', 1066), ('\u{44b}', 1067), ('\u{44c}', 1068),
+ ('\u{44d}', 1069), ('\u{44e}', 1070), ('\u{44f}', 1071), ('\u{450}', 1024),
+ ('\u{451}', 1025), ('\u{452}', 1026), ('\u{453}', 1027), ('\u{454}', 1028),
+ ('\u{455}', 1029), ('\u{456}', 1030), ('\u{457}', 1031), ('\u{458}', 1032),
+ ('\u{459}', 1033), ('\u{45a}', 1034), ('\u{45b}', 1035), ('\u{45c}', 1036),
+ ('\u{45d}', 1037), ('\u{45e}', 1038), ('\u{45f}', 1039), ('\u{461}', 1120),
+ ('\u{463}', 1122), ('\u{465}', 1124), ('\u{467}', 1126), ('\u{469}', 1128),
+ ('\u{46b}', 1130), ('\u{46d}', 1132), ('\u{46f}', 1134), ('\u{471}', 1136),
+ ('\u{473}', 1138), ('\u{475}', 1140), ('\u{477}', 1142), ('\u{479}', 1144),
+ ('\u{47b}', 1146), ('\u{47d}', 1148), ('\u{47f}', 1150), ('\u{481}', 1152),
+ ('\u{48b}', 1162), ('\u{48d}', 1164), ('\u{48f}', 1166), ('\u{491}', 1168),
+ ('\u{493}', 1170), ('\u{495}', 1172), ('\u{497}', 1174), ('\u{499}', 1176),
+ ('\u{49b}', 1178), ('\u{49d}', 1180), ('\u{49f}', 1182), ('\u{4a1}', 1184),
+ ('\u{4a3}', 1186), ('\u{4a5}', 1188), ('\u{4a7}', 1190), ('\u{4a9}', 1192),
+ ('\u{4ab}', 1194), ('\u{4ad}', 1196), ('\u{4af}', 1198), ('\u{4b1}', 1200),
+ ('\u{4b3}', 1202), ('\u{4b5}', 1204), ('\u{4b7}', 1206), ('\u{4b9}', 1208),
+ ('\u{4bb}', 1210), ('\u{4bd}', 1212), ('\u{4bf}', 1214), ('\u{4c2}', 1217),
+ ('\u{4c4}', 1219), ('\u{4c6}', 1221), ('\u{4c8}', 1223), ('\u{4ca}', 1225),
+ ('\u{4cc}', 1227), ('\u{4ce}', 1229), ('\u{4cf}', 1216), ('\u{4d1}', 1232),
+ ('\u{4d3}', 1234), ('\u{4d5}', 1236), ('\u{4d7}', 1238), ('\u{4d9}', 1240),
+ ('\u{4db}', 1242), ('\u{4dd}', 1244), ('\u{4df}', 1246), ('\u{4e1}', 1248),
+ ('\u{4e3}', 1250), ('\u{4e5}', 1252), ('\u{4e7}', 1254), ('\u{4e9}', 1256),
+ ('\u{4eb}', 1258), ('\u{4ed}', 1260), ('\u{4ef}', 1262), ('\u{4f1}', 1264),
+ ('\u{4f3}', 1266), ('\u{4f5}', 1268), ('\u{4f7}', 1270), ('\u{4f9}', 1272),
+ ('\u{4fb}', 1274), ('\u{4fd}', 1276), ('\u{4ff}', 1278), ('\u{501}', 1280),
+ ('\u{503}', 1282), ('\u{505}', 1284), ('\u{507}', 1286), ('\u{509}', 1288),
+ ('\u{50b}', 1290), ('\u{50d}', 1292), ('\u{50f}', 1294), ('\u{511}', 1296),
+ ('\u{513}', 1298), ('\u{515}', 1300), ('\u{517}', 1302), ('\u{519}', 1304),
+ ('\u{51b}', 1306), ('\u{51d}', 1308), ('\u{51f}', 1310), ('\u{521}', 1312),
+ ('\u{523}', 1314), ('\u{525}', 1316), ('\u{527}', 1318), ('\u{529}', 1320),
+ ('\u{52b}', 1322), ('\u{52d}', 1324), ('\u{52f}', 1326), ('\u{561}', 1329),
+ ('\u{562}', 1330), ('\u{563}', 1331), ('\u{564}', 1332), ('\u{565}', 1333),
+ ('\u{566}', 1334), ('\u{567}', 1335), ('\u{568}', 1336), ('\u{569}', 1337),
+ ('\u{56a}', 1338), ('\u{56b}', 1339), ('\u{56c}', 1340), ('\u{56d}', 1341),
+ ('\u{56e}', 1342), ('\u{56f}', 1343), ('\u{570}', 1344), ('\u{571}', 1345),
+ ('\u{572}', 1346), ('\u{573}', 1347), ('\u{574}', 1348), ('\u{575}', 1349),
+ ('\u{576}', 1350), ('\u{577}', 1351), ('\u{578}', 1352), ('\u{579}', 1353),
+ ('\u{57a}', 1354), ('\u{57b}', 1355), ('\u{57c}', 1356), ('\u{57d}', 1357),
+ ('\u{57e}', 1358), ('\u{57f}', 1359), ('\u{580}', 1360), ('\u{581}', 1361),
+ ('\u{582}', 1362), ('\u{583}', 1363), ('\u{584}', 1364), ('\u{585}', 1365),
+ ('\u{586}', 1366), ('\u{587}', 4194309), ('\u{10d0}', 7312), ('\u{10d1}', 7313),
+ ('\u{10d2}', 7314), ('\u{10d3}', 7315), ('\u{10d4}', 7316), ('\u{10d5}', 7317),
+ ('\u{10d6}', 7318), ('\u{10d7}', 7319), ('\u{10d8}', 7320), ('\u{10d9}', 7321),
+ ('\u{10da}', 7322), ('\u{10db}', 7323), ('\u{10dc}', 7324), ('\u{10dd}', 7325),
+ ('\u{10de}', 7326), ('\u{10df}', 7327), ('\u{10e0}', 7328), ('\u{10e1}', 7329),
+ ('\u{10e2}', 7330), ('\u{10e3}', 7331), ('\u{10e4}', 7332), ('\u{10e5}', 7333),
+ ('\u{10e6}', 7334), ('\u{10e7}', 7335), ('\u{10e8}', 7336), ('\u{10e9}', 7337),
+ ('\u{10ea}', 7338), ('\u{10eb}', 7339), ('\u{10ec}', 7340), ('\u{10ed}', 7341),
+ ('\u{10ee}', 7342), ('\u{10ef}', 7343), ('\u{10f0}', 7344), ('\u{10f1}', 7345),
+ ('\u{10f2}', 7346), ('\u{10f3}', 7347), ('\u{10f4}', 7348), ('\u{10f5}', 7349),
+ ('\u{10f6}', 7350), ('\u{10f7}', 7351), ('\u{10f8}', 7352), ('\u{10f9}', 7353),
+ ('\u{10fa}', 7354), ('\u{10fd}', 7357), ('\u{10fe}', 7358), ('\u{10ff}', 7359),
+ ('\u{13f8}', 5104), ('\u{13f9}', 5105), ('\u{13fa}', 5106), ('\u{13fb}', 5107),
+ ('\u{13fc}', 5108), ('\u{13fd}', 5109), ('\u{1c80}', 1042), ('\u{1c81}', 1044),
+ ('\u{1c82}', 1054), ('\u{1c83}', 1057), ('\u{1c84}', 1058), ('\u{1c85}', 1058),
+ ('\u{1c86}', 1066), ('\u{1c87}', 1122), ('\u{1c88}', 42570), ('\u{1c8a}', 7305),
+ ('\u{1d79}', 42877), ('\u{1d7d}', 11363), ('\u{1d8e}', 42950), ('\u{1e01}', 7680),
+ ('\u{1e03}', 7682), ('\u{1e05}', 7684), ('\u{1e07}', 7686), ('\u{1e09}', 7688),
+ ('\u{1e0b}', 7690), ('\u{1e0d}', 7692), ('\u{1e0f}', 7694), ('\u{1e11}', 7696),
+ ('\u{1e13}', 7698), ('\u{1e15}', 7700), ('\u{1e17}', 7702), ('\u{1e19}', 7704),
+ ('\u{1e1b}', 7706), ('\u{1e1d}', 7708), ('\u{1e1f}', 7710), ('\u{1e21}', 7712),
+ ('\u{1e23}', 7714), ('\u{1e25}', 7716), ('\u{1e27}', 7718), ('\u{1e29}', 7720),
+ ('\u{1e2b}', 7722), ('\u{1e2d}', 7724), ('\u{1e2f}', 7726), ('\u{1e31}', 7728),
+ ('\u{1e33}', 7730), ('\u{1e35}', 7732), ('\u{1e37}', 7734), ('\u{1e39}', 7736),
+ ('\u{1e3b}', 7738), ('\u{1e3d}', 7740), ('\u{1e3f}', 7742), ('\u{1e41}', 7744),
+ ('\u{1e43}', 7746), ('\u{1e45}', 7748), ('\u{1e47}', 7750), ('\u{1e49}', 7752),
+ ('\u{1e4b}', 7754), ('\u{1e4d}', 7756), ('\u{1e4f}', 7758), ('\u{1e51}', 7760),
+ ('\u{1e53}', 7762), ('\u{1e55}', 7764), ('\u{1e57}', 7766), ('\u{1e59}', 7768),
+ ('\u{1e5b}', 7770), ('\u{1e5d}', 7772), ('\u{1e5f}', 7774), ('\u{1e61}', 7776),
+ ('\u{1e63}', 7778), ('\u{1e65}', 7780), ('\u{1e67}', 7782), ('\u{1e69}', 7784),
+ ('\u{1e6b}', 7786), ('\u{1e6d}', 7788), ('\u{1e6f}', 7790), ('\u{1e71}', 7792),
+ ('\u{1e73}', 7794), ('\u{1e75}', 7796), ('\u{1e77}', 7798), ('\u{1e79}', 7800),
+ ('\u{1e7b}', 7802), ('\u{1e7d}', 7804), ('\u{1e7f}', 7806), ('\u{1e81}', 7808),
+ ('\u{1e83}', 7810), ('\u{1e85}', 7812), ('\u{1e87}', 7814), ('\u{1e89}', 7816),
+ ('\u{1e8b}', 7818), ('\u{1e8d}', 7820), ('\u{1e8f}', 7822), ('\u{1e91}', 7824),
+ ('\u{1e93}', 7826), ('\u{1e95}', 7828), ('\u{1e96}', 4194310), ('\u{1e97}', 4194311),
+ ('\u{1e98}', 4194312), ('\u{1e99}', 4194313), ('\u{1e9a}', 4194314), ('\u{1e9b}', 7776),
+ ('\u{1ea1}', 7840), ('\u{1ea3}', 7842), ('\u{1ea5}', 7844), ('\u{1ea7}', 7846),
+ ('\u{1ea9}', 7848), ('\u{1eab}', 7850), ('\u{1ead}', 7852), ('\u{1eaf}', 7854),
+ ('\u{1eb1}', 7856), ('\u{1eb3}', 7858), ('\u{1eb5}', 7860), ('\u{1eb7}', 7862),
+ ('\u{1eb9}', 7864), ('\u{1ebb}', 7866), ('\u{1ebd}', 7868), ('\u{1ebf}', 7870),
+ ('\u{1ec1}', 7872), ('\u{1ec3}', 7874), ('\u{1ec5}', 7876), ('\u{1ec7}', 7878),
+ ('\u{1ec9}', 7880), ('\u{1ecb}', 7882), ('\u{1ecd}', 7884), ('\u{1ecf}', 7886),
+ ('\u{1ed1}', 7888), ('\u{1ed3}', 7890), ('\u{1ed5}', 7892), ('\u{1ed7}', 7894),
+ ('\u{1ed9}', 7896), ('\u{1edb}', 7898), ('\u{1edd}', 7900), ('\u{1edf}', 7902),
+ ('\u{1ee1}', 7904), ('\u{1ee3}', 7906), ('\u{1ee5}', 7908), ('\u{1ee7}', 7910),
+ ('\u{1ee9}', 7912), ('\u{1eeb}', 7914), ('\u{1eed}', 7916), ('\u{1eef}', 7918),
+ ('\u{1ef1}', 7920), ('\u{1ef3}', 7922), ('\u{1ef5}', 7924), ('\u{1ef7}', 7926),
+ ('\u{1ef9}', 7928), ('\u{1efb}', 7930), ('\u{1efd}', 7932), ('\u{1eff}', 7934),
+ ('\u{1f00}', 7944), ('\u{1f01}', 7945), ('\u{1f02}', 7946), ('\u{1f03}', 7947),
+ ('\u{1f04}', 7948), ('\u{1f05}', 7949), ('\u{1f06}', 7950), ('\u{1f07}', 7951),
+ ('\u{1f10}', 7960), ('\u{1f11}', 7961), ('\u{1f12}', 7962), ('\u{1f13}', 7963),
+ ('\u{1f14}', 7964), ('\u{1f15}', 7965), ('\u{1f20}', 7976), ('\u{1f21}', 7977),
+ ('\u{1f22}', 7978), ('\u{1f23}', 7979), ('\u{1f24}', 7980), ('\u{1f25}', 7981),
+ ('\u{1f26}', 7982), ('\u{1f27}', 7983), ('\u{1f30}', 7992), ('\u{1f31}', 7993),
+ ('\u{1f32}', 7994), ('\u{1f33}', 7995), ('\u{1f34}', 7996), ('\u{1f35}', 7997),
+ ('\u{1f36}', 7998), ('\u{1f37}', 7999), ('\u{1f40}', 8008), ('\u{1f41}', 8009),
+ ('\u{1f42}', 8010), ('\u{1f43}', 8011), ('\u{1f44}', 8012), ('\u{1f45}', 8013),
+ ('\u{1f50}', 4194315), ('\u{1f51}', 8025), ('\u{1f52}', 4194316), ('\u{1f53}', 8027),
+ ('\u{1f54}', 4194317), ('\u{1f55}', 8029), ('\u{1f56}', 4194318), ('\u{1f57}', 8031),
+ ('\u{1f60}', 8040), ('\u{1f61}', 8041), ('\u{1f62}', 8042), ('\u{1f63}', 8043),
+ ('\u{1f64}', 8044), ('\u{1f65}', 8045), ('\u{1f66}', 8046), ('\u{1f67}', 8047),
+ ('\u{1f70}', 8122), ('\u{1f71}', 8123), ('\u{1f72}', 8136), ('\u{1f73}', 8137),
+ ('\u{1f74}', 8138), ('\u{1f75}', 8139), ('\u{1f76}', 8154), ('\u{1f77}', 8155),
+ ('\u{1f78}', 8184), ('\u{1f79}', 8185), ('\u{1f7a}', 8170), ('\u{1f7b}', 8171),
+ ('\u{1f7c}', 8186), ('\u{1f7d}', 8187), ('\u{1f80}', 4194319), ('\u{1f81}', 4194320),
+ ('\u{1f82}', 4194321), ('\u{1f83}', 4194322), ('\u{1f84}', 4194323), ('\u{1f85}', 4194324),
+ ('\u{1f86}', 4194325), ('\u{1f87}', 4194326), ('\u{1f88}', 4194327), ('\u{1f89}', 4194328),
+ ('\u{1f8a}', 4194329), ('\u{1f8b}', 4194330), ('\u{1f8c}', 4194331), ('\u{1f8d}', 4194332),
+ ('\u{1f8e}', 4194333), ('\u{1f8f}', 4194334), ('\u{1f90}', 4194335), ('\u{1f91}', 4194336),
+ ('\u{1f92}', 4194337), ('\u{1f93}', 4194338), ('\u{1f94}', 4194339), ('\u{1f95}', 4194340),
+ ('\u{1f96}', 4194341), ('\u{1f97}', 4194342), ('\u{1f98}', 4194343), ('\u{1f99}', 4194344),
+ ('\u{1f9a}', 4194345), ('\u{1f9b}', 4194346), ('\u{1f9c}', 4194347), ('\u{1f9d}', 4194348),
+ ('\u{1f9e}', 4194349), ('\u{1f9f}', 4194350), ('\u{1fa0}', 4194351), ('\u{1fa1}', 4194352),
+ ('\u{1fa2}', 4194353), ('\u{1fa3}', 4194354), ('\u{1fa4}', 4194355), ('\u{1fa5}', 4194356),
+ ('\u{1fa6}', 4194357), ('\u{1fa7}', 4194358), ('\u{1fa8}', 4194359), ('\u{1fa9}', 4194360),
+ ('\u{1faa}', 4194361), ('\u{1fab}', 4194362), ('\u{1fac}', 4194363), ('\u{1fad}', 4194364),
+ ('\u{1fae}', 4194365), ('\u{1faf}', 4194366), ('\u{1fb0}', 8120), ('\u{1fb1}', 8121),
+ ('\u{1fb2}', 4194367), ('\u{1fb3}', 4194368), ('\u{1fb4}', 4194369), ('\u{1fb6}', 4194370),
+ ('\u{1fb7}', 4194371), ('\u{1fbc}', 4194372), ('\u{1fbe}', 921), ('\u{1fc2}', 4194373),
+ ('\u{1fc3}', 4194374), ('\u{1fc4}', 4194375), ('\u{1fc6}', 4194376), ('\u{1fc7}', 4194377),
+ ('\u{1fcc}', 4194378), ('\u{1fd0}', 8152), ('\u{1fd1}', 8153), ('\u{1fd2}', 4194379),
+ ('\u{1fd3}', 4194380), ('\u{1fd6}', 4194381), ('\u{1fd7}', 4194382), ('\u{1fe0}', 8168),
+ ('\u{1fe1}', 8169), ('\u{1fe2}', 4194383), ('\u{1fe3}', 4194384), ('\u{1fe4}', 4194385),
+ ('\u{1fe5}', 8172), ('\u{1fe6}', 4194386), ('\u{1fe7}', 4194387), ('\u{1ff2}', 4194388),
+ ('\u{1ff3}', 4194389), ('\u{1ff4}', 4194390), ('\u{1ff6}', 4194391), ('\u{1ff7}', 4194392),
+ ('\u{1ffc}', 4194393), ('\u{214e}', 8498), ('\u{2170}', 8544), ('\u{2171}', 8545),
+ ('\u{2172}', 8546), ('\u{2173}', 8547), ('\u{2174}', 8548), ('\u{2175}', 8549),
+ ('\u{2176}', 8550), ('\u{2177}', 8551), ('\u{2178}', 8552), ('\u{2179}', 8553),
+ ('\u{217a}', 8554), ('\u{217b}', 8555), ('\u{217c}', 8556), ('\u{217d}', 8557),
+ ('\u{217e}', 8558), ('\u{217f}', 8559), ('\u{2184}', 8579), ('\u{24d0}', 9398),
+ ('\u{24d1}', 9399), ('\u{24d2}', 9400), ('\u{24d3}', 9401), ('\u{24d4}', 9402),
+ ('\u{24d5}', 9403), ('\u{24d6}', 9404), ('\u{24d7}', 9405), ('\u{24d8}', 9406),
+ ('\u{24d9}', 9407), ('\u{24da}', 9408), ('\u{24db}', 9409), ('\u{24dc}', 9410),
+ ('\u{24dd}', 9411), ('\u{24de}', 9412), ('\u{24df}', 9413), ('\u{24e0}', 9414),
+ ('\u{24e1}', 9415), ('\u{24e2}', 9416), ('\u{24e3}', 9417), ('\u{24e4}', 9418),
+ ('\u{24e5}', 9419), ('\u{24e6}', 9420), ('\u{24e7}', 9421), ('\u{24e8}', 9422),
+ ('\u{24e9}', 9423), ('\u{2c30}', 11264), ('\u{2c31}', 11265), ('\u{2c32}', 11266),
+ ('\u{2c33}', 11267), ('\u{2c34}', 11268), ('\u{2c35}', 11269), ('\u{2c36}', 11270),
+ ('\u{2c37}', 11271), ('\u{2c38}', 11272), ('\u{2c39}', 11273), ('\u{2c3a}', 11274),
+ ('\u{2c3b}', 11275), ('\u{2c3c}', 11276), ('\u{2c3d}', 11277), ('\u{2c3e}', 11278),
+ ('\u{2c3f}', 11279), ('\u{2c40}', 11280), ('\u{2c41}', 11281), ('\u{2c42}', 11282),
+ ('\u{2c43}', 11283), ('\u{2c44}', 11284), ('\u{2c45}', 11285), ('\u{2c46}', 11286),
+ ('\u{2c47}', 11287), ('\u{2c48}', 11288), ('\u{2c49}', 11289), ('\u{2c4a}', 11290),
+ ('\u{2c4b}', 11291), ('\u{2c4c}', 11292), ('\u{2c4d}', 11293), ('\u{2c4e}', 11294),
+ ('\u{2c4f}', 11295), ('\u{2c50}', 11296), ('\u{2c51}', 11297), ('\u{2c52}', 11298),
+ ('\u{2c53}', 11299), ('\u{2c54}', 11300), ('\u{2c55}', 11301), ('\u{2c56}', 11302),
+ ('\u{2c57}', 11303), ('\u{2c58}', 11304), ('\u{2c59}', 11305), ('\u{2c5a}', 11306),
+ ('\u{2c5b}', 11307), ('\u{2c5c}', 11308), ('\u{2c5d}', 11309), ('\u{2c5e}', 11310),
+ ('\u{2c5f}', 11311), ('\u{2c61}', 11360), ('\u{2c65}', 570), ('\u{2c66}', 574),
+ ('\u{2c68}', 11367), ('\u{2c6a}', 11369), ('\u{2c6c}', 11371), ('\u{2c73}', 11378),
+ ('\u{2c76}', 11381), ('\u{2c81}', 11392), ('\u{2c83}', 11394), ('\u{2c85}', 11396),
+ ('\u{2c87}', 11398), ('\u{2c89}', 11400), ('\u{2c8b}', 11402), ('\u{2c8d}', 11404),
+ ('\u{2c8f}', 11406), ('\u{2c91}', 11408), ('\u{2c93}', 11410), ('\u{2c95}', 11412),
+ ('\u{2c97}', 11414), ('\u{2c99}', 11416), ('\u{2c9b}', 11418), ('\u{2c9d}', 11420),
+ ('\u{2c9f}', 11422), ('\u{2ca1}', 11424), ('\u{2ca3}', 11426), ('\u{2ca5}', 11428),
+ ('\u{2ca7}', 11430), ('\u{2ca9}', 11432), ('\u{2cab}', 11434), ('\u{2cad}', 11436),
+ ('\u{2caf}', 11438), ('\u{2cb1}', 11440), ('\u{2cb3}', 11442), ('\u{2cb5}', 11444),
+ ('\u{2cb7}', 11446), ('\u{2cb9}', 11448), ('\u{2cbb}', 11450), ('\u{2cbd}', 11452),
+ ('\u{2cbf}', 11454), ('\u{2cc1}', 11456), ('\u{2cc3}', 11458), ('\u{2cc5}', 11460),
+ ('\u{2cc7}', 11462), ('\u{2cc9}', 11464), ('\u{2ccb}', 11466), ('\u{2ccd}', 11468),
+ ('\u{2ccf}', 11470), ('\u{2cd1}', 11472), ('\u{2cd3}', 11474), ('\u{2cd5}', 11476),
+ ('\u{2cd7}', 11478), ('\u{2cd9}', 11480), ('\u{2cdb}', 11482), ('\u{2cdd}', 11484),
+ ('\u{2cdf}', 11486), ('\u{2ce1}', 11488), ('\u{2ce3}', 11490), ('\u{2cec}', 11499),
+ ('\u{2cee}', 11501), ('\u{2cf3}', 11506), ('\u{2d00}', 4256), ('\u{2d01}', 4257),
+ ('\u{2d02}', 4258), ('\u{2d03}', 4259), ('\u{2d04}', 4260), ('\u{2d05}', 4261),
+ ('\u{2d06}', 4262), ('\u{2d07}', 4263), ('\u{2d08}', 4264), ('\u{2d09}', 4265),
+ ('\u{2d0a}', 4266), ('\u{2d0b}', 4267), ('\u{2d0c}', 4268), ('\u{2d0d}', 4269),
+ ('\u{2d0e}', 4270), ('\u{2d0f}', 4271), ('\u{2d10}', 4272), ('\u{2d11}', 4273),
+ ('\u{2d12}', 4274), ('\u{2d13}', 4275), ('\u{2d14}', 4276), ('\u{2d15}', 4277),
+ ('\u{2d16}', 4278), ('\u{2d17}', 4279), ('\u{2d18}', 4280), ('\u{2d19}', 4281),
+ ('\u{2d1a}', 4282), ('\u{2d1b}', 4283), ('\u{2d1c}', 4284), ('\u{2d1d}', 4285),
+ ('\u{2d1e}', 4286), ('\u{2d1f}', 4287), ('\u{2d20}', 4288), ('\u{2d21}', 4289),
+ ('\u{2d22}', 4290), ('\u{2d23}', 4291), ('\u{2d24}', 4292), ('\u{2d25}', 4293),
+ ('\u{2d27}', 4295), ('\u{2d2d}', 4301), ('\u{a641}', 42560), ('\u{a643}', 42562),
+ ('\u{a645}', 42564), ('\u{a647}', 42566), ('\u{a649}', 42568), ('\u{a64b}', 42570),
+ ('\u{a64d}', 42572), ('\u{a64f}', 42574), ('\u{a651}', 42576), ('\u{a653}', 42578),
+ ('\u{a655}', 42580), ('\u{a657}', 42582), ('\u{a659}', 42584), ('\u{a65b}', 42586),
+ ('\u{a65d}', 42588), ('\u{a65f}', 42590), ('\u{a661}', 42592), ('\u{a663}', 42594),
+ ('\u{a665}', 42596), ('\u{a667}', 42598), ('\u{a669}', 42600), ('\u{a66b}', 42602),
+ ('\u{a66d}', 42604), ('\u{a681}', 42624), ('\u{a683}', 42626), ('\u{a685}', 42628),
+ ('\u{a687}', 42630), ('\u{a689}', 42632), ('\u{a68b}', 42634), ('\u{a68d}', 42636),
+ ('\u{a68f}', 42638), ('\u{a691}', 42640), ('\u{a693}', 42642), ('\u{a695}', 42644),
+ ('\u{a697}', 42646), ('\u{a699}', 42648), ('\u{a69b}', 42650), ('\u{a723}', 42786),
+ ('\u{a725}', 42788), ('\u{a727}', 42790), ('\u{a729}', 42792), ('\u{a72b}', 42794),
+ ('\u{a72d}', 42796), ('\u{a72f}', 42798), ('\u{a733}', 42802), ('\u{a735}', 42804),
+ ('\u{a737}', 42806), ('\u{a739}', 42808), ('\u{a73b}', 42810), ('\u{a73d}', 42812),
+ ('\u{a73f}', 42814), ('\u{a741}', 42816), ('\u{a743}', 42818), ('\u{a745}', 42820),
+ ('\u{a747}', 42822), ('\u{a749}', 42824), ('\u{a74b}', 42826), ('\u{a74d}', 42828),
+ ('\u{a74f}', 42830), ('\u{a751}', 42832), ('\u{a753}', 42834), ('\u{a755}', 42836),
+ ('\u{a757}', 42838), ('\u{a759}', 42840), ('\u{a75b}', 42842), ('\u{a75d}', 42844),
+ ('\u{a75f}', 42846), ('\u{a761}', 42848), ('\u{a763}', 42850), ('\u{a765}', 42852),
+ ('\u{a767}', 42854), ('\u{a769}', 42856), ('\u{a76b}', 42858), ('\u{a76d}', 42860),
+ ('\u{a76f}', 42862), ('\u{a77a}', 42873), ('\u{a77c}', 42875), ('\u{a77f}', 42878),
+ ('\u{a781}', 42880), ('\u{a783}', 42882), ('\u{a785}', 42884), ('\u{a787}', 42886),
+ ('\u{a78c}', 42891), ('\u{a791}', 42896), ('\u{a793}', 42898), ('\u{a794}', 42948),
+ ('\u{a797}', 42902), ('\u{a799}', 42904), ('\u{a79b}', 42906), ('\u{a79d}', 42908),
+ ('\u{a79f}', 42910), ('\u{a7a1}', 42912), ('\u{a7a3}', 42914), ('\u{a7a5}', 42916),
+ ('\u{a7a7}', 42918), ('\u{a7a9}', 42920), ('\u{a7b5}', 42932), ('\u{a7b7}', 42934),
+ ('\u{a7b9}', 42936), ('\u{a7bb}', 42938), ('\u{a7bd}', 42940), ('\u{a7bf}', 42942),
+ ('\u{a7c1}', 42944), ('\u{a7c3}', 42946), ('\u{a7c8}', 42951), ('\u{a7ca}', 42953),
+ ('\u{a7cd}', 42956), ('\u{a7cf}', 42958), ('\u{a7d1}', 42960), ('\u{a7d3}', 42962),
+ ('\u{a7d5}', 42964), ('\u{a7d7}', 42966), ('\u{a7d9}', 42968), ('\u{a7db}', 42970),
+ ('\u{a7f6}', 42997), ('\u{ab53}', 42931), ('\u{ab70}', 5024), ('\u{ab71}', 5025),
+ ('\u{ab72}', 5026), ('\u{ab73}', 5027), ('\u{ab74}', 5028), ('\u{ab75}', 5029),
+ ('\u{ab76}', 5030), ('\u{ab77}', 5031), ('\u{ab78}', 5032), ('\u{ab79}', 5033),
+ ('\u{ab7a}', 5034), ('\u{ab7b}', 5035), ('\u{ab7c}', 5036), ('\u{ab7d}', 5037),
+ ('\u{ab7e}', 5038), ('\u{ab7f}', 5039), ('\u{ab80}', 5040), ('\u{ab81}', 5041),
+ ('\u{ab82}', 5042), ('\u{ab83}', 5043), ('\u{ab84}', 5044), ('\u{ab85}', 5045),
+ ('\u{ab86}', 5046), ('\u{ab87}', 5047), ('\u{ab88}', 5048), ('\u{ab89}', 5049),
+ ('\u{ab8a}', 5050), ('\u{ab8b}', 5051), ('\u{ab8c}', 5052), ('\u{ab8d}', 5053),
+ ('\u{ab8e}', 5054), ('\u{ab8f}', 5055), ('\u{ab90}', 5056), ('\u{ab91}', 5057),
+ ('\u{ab92}', 5058), ('\u{ab93}', 5059), ('\u{ab94}', 5060), ('\u{ab95}', 5061),
+ ('\u{ab96}', 5062), ('\u{ab97}', 5063), ('\u{ab98}', 5064), ('\u{ab99}', 5065),
+ ('\u{ab9a}', 5066), ('\u{ab9b}', 5067), ('\u{ab9c}', 5068), ('\u{ab9d}', 5069),
+ ('\u{ab9e}', 5070), ('\u{ab9f}', 5071), ('\u{aba0}', 5072), ('\u{aba1}', 5073),
+ ('\u{aba2}', 5074), ('\u{aba3}', 5075), ('\u{aba4}', 5076), ('\u{aba5}', 5077),
+ ('\u{aba6}', 5078), ('\u{aba7}', 5079), ('\u{aba8}', 5080), ('\u{aba9}', 5081),
+ ('\u{abaa}', 5082), ('\u{abab}', 5083), ('\u{abac}', 5084), ('\u{abad}', 5085),
+ ('\u{abae}', 5086), ('\u{abaf}', 5087), ('\u{abb0}', 5088), ('\u{abb1}', 5089),
+ ('\u{abb2}', 5090), ('\u{abb3}', 5091), ('\u{abb4}', 5092), ('\u{abb5}', 5093),
+ ('\u{abb6}', 5094), ('\u{abb7}', 5095), ('\u{abb8}', 5096), ('\u{abb9}', 5097),
+ ('\u{abba}', 5098), ('\u{abbb}', 5099), ('\u{abbc}', 5100), ('\u{abbd}', 5101),
+ ('\u{abbe}', 5102), ('\u{abbf}', 5103), ('\u{fb00}', 4194394), ('\u{fb01}', 4194395),
+ ('\u{fb02}', 4194396), ('\u{fb03}', 4194397), ('\u{fb04}', 4194398), ('\u{fb05}', 4194399),
+ ('\u{fb06}', 4194400), ('\u{fb13}', 4194401), ('\u{fb14}', 4194402), ('\u{fb15}', 4194403),
+ ('\u{fb16}', 4194404), ('\u{fb17}', 4194405), ('\u{ff41}', 65313), ('\u{ff42}', 65314),
+ ('\u{ff43}', 65315), ('\u{ff44}', 65316), ('\u{ff45}', 65317), ('\u{ff46}', 65318),
+ ('\u{ff47}', 65319), ('\u{ff48}', 65320), ('\u{ff49}', 65321), ('\u{ff4a}', 65322),
+ ('\u{ff4b}', 65323), ('\u{ff4c}', 65324), ('\u{ff4d}', 65325), ('\u{ff4e}', 65326),
+ ('\u{ff4f}', 65327), ('\u{ff50}', 65328), ('\u{ff51}', 65329), ('\u{ff52}', 65330),
+ ('\u{ff53}', 65331), ('\u{ff54}', 65332), ('\u{ff55}', 65333), ('\u{ff56}', 65334),
+ ('\u{ff57}', 65335), ('\u{ff58}', 65336), ('\u{ff59}', 65337), ('\u{ff5a}', 65338),
+ ('\u{10428}', 66560), ('\u{10429}', 66561), ('\u{1042a}', 66562), ('\u{1042b}', 66563),
+ ('\u{1042c}', 66564), ('\u{1042d}', 66565), ('\u{1042e}', 66566), ('\u{1042f}', 66567),
+ ('\u{10430}', 66568), ('\u{10431}', 66569), ('\u{10432}', 66570), ('\u{10433}', 66571),
+ ('\u{10434}', 66572), ('\u{10435}', 66573), ('\u{10436}', 66574), ('\u{10437}', 66575),
+ ('\u{10438}', 66576), ('\u{10439}', 66577), ('\u{1043a}', 66578), ('\u{1043b}', 66579),
+ ('\u{1043c}', 66580), ('\u{1043d}', 66581), ('\u{1043e}', 66582), ('\u{1043f}', 66583),
+ ('\u{10440}', 66584), ('\u{10441}', 66585), ('\u{10442}', 66586), ('\u{10443}', 66587),
+ ('\u{10444}', 66588), ('\u{10445}', 66589), ('\u{10446}', 66590), ('\u{10447}', 66591),
+ ('\u{10448}', 66592), ('\u{10449}', 66593), ('\u{1044a}', 66594), ('\u{1044b}', 66595),
+ ('\u{1044c}', 66596), ('\u{1044d}', 66597), ('\u{1044e}', 66598), ('\u{1044f}', 66599),
+ ('\u{104d8}', 66736), ('\u{104d9}', 66737), ('\u{104da}', 66738), ('\u{104db}', 66739),
+ ('\u{104dc}', 66740), ('\u{104dd}', 66741), ('\u{104de}', 66742), ('\u{104df}', 66743),
+ ('\u{104e0}', 66744), ('\u{104e1}', 66745), ('\u{104e2}', 66746), ('\u{104e3}', 66747),
+ ('\u{104e4}', 66748), ('\u{104e5}', 66749), ('\u{104e6}', 66750), ('\u{104e7}', 66751),
+ ('\u{104e8}', 66752), ('\u{104e9}', 66753), ('\u{104ea}', 66754), ('\u{104eb}', 66755),
+ ('\u{104ec}', 66756), ('\u{104ed}', 66757), ('\u{104ee}', 66758), ('\u{104ef}', 66759),
+ ('\u{104f0}', 66760), ('\u{104f1}', 66761), ('\u{104f2}', 66762), ('\u{104f3}', 66763),
+ ('\u{104f4}', 66764), ('\u{104f5}', 66765), ('\u{104f6}', 66766), ('\u{104f7}', 66767),
+ ('\u{104f8}', 66768), ('\u{104f9}', 66769), ('\u{104fa}', 66770), ('\u{104fb}', 66771),
+ ('\u{10597}', 66928), ('\u{10598}', 66929), ('\u{10599}', 66930), ('\u{1059a}', 66931),
+ ('\u{1059b}', 66932), ('\u{1059c}', 66933), ('\u{1059d}', 66934), ('\u{1059e}', 66935),
+ ('\u{1059f}', 66936), ('\u{105a0}', 66937), ('\u{105a1}', 66938), ('\u{105a3}', 66940),
+ ('\u{105a4}', 66941), ('\u{105a5}', 66942), ('\u{105a6}', 66943), ('\u{105a7}', 66944),
+ ('\u{105a8}', 66945), ('\u{105a9}', 66946), ('\u{105aa}', 66947), ('\u{105ab}', 66948),
+ ('\u{105ac}', 66949), ('\u{105ad}', 66950), ('\u{105ae}', 66951), ('\u{105af}', 66952),
+ ('\u{105b0}', 66953), ('\u{105b1}', 66954), ('\u{105b3}', 66956), ('\u{105b4}', 66957),
+ ('\u{105b5}', 66958), ('\u{105b6}', 66959), ('\u{105b7}', 66960), ('\u{105b8}', 66961),
+ ('\u{105b9}', 66962), ('\u{105bb}', 66964), ('\u{105bc}', 66965), ('\u{10cc0}', 68736),
+ ('\u{10cc1}', 68737), ('\u{10cc2}', 68738), ('\u{10cc3}', 68739), ('\u{10cc4}', 68740),
+ ('\u{10cc5}', 68741), ('\u{10cc6}', 68742), ('\u{10cc7}', 68743), ('\u{10cc8}', 68744),
+ ('\u{10cc9}', 68745), ('\u{10cca}', 68746), ('\u{10ccb}', 68747), ('\u{10ccc}', 68748),
+ ('\u{10ccd}', 68749), ('\u{10cce}', 68750), ('\u{10ccf}', 68751), ('\u{10cd0}', 68752),
+ ('\u{10cd1}', 68753), ('\u{10cd2}', 68754), ('\u{10cd3}', 68755), ('\u{10cd4}', 68756),
+ ('\u{10cd5}', 68757), ('\u{10cd6}', 68758), ('\u{10cd7}', 68759), ('\u{10cd8}', 68760),
+ ('\u{10cd9}', 68761), ('\u{10cda}', 68762), ('\u{10cdb}', 68763), ('\u{10cdc}', 68764),
+ ('\u{10cdd}', 68765), ('\u{10cde}', 68766), ('\u{10cdf}', 68767), ('\u{10ce0}', 68768),
+ ('\u{10ce1}', 68769), ('\u{10ce2}', 68770), ('\u{10ce3}', 68771), ('\u{10ce4}', 68772),
+ ('\u{10ce5}', 68773), ('\u{10ce6}', 68774), ('\u{10ce7}', 68775), ('\u{10ce8}', 68776),
+ ('\u{10ce9}', 68777), ('\u{10cea}', 68778), ('\u{10ceb}', 68779), ('\u{10cec}', 68780),
+ ('\u{10ced}', 68781), ('\u{10cee}', 68782), ('\u{10cef}', 68783), ('\u{10cf0}', 68784),
+ ('\u{10cf1}', 68785), ('\u{10cf2}', 68786), ('\u{10d70}', 68944), ('\u{10d71}', 68945),
+ ('\u{10d72}', 68946), ('\u{10d73}', 68947), ('\u{10d74}', 68948), ('\u{10d75}', 68949),
+ ('\u{10d76}', 68950), ('\u{10d77}', 68951), ('\u{10d78}', 68952), ('\u{10d79}', 68953),
+ ('\u{10d7a}', 68954), ('\u{10d7b}', 68955), ('\u{10d7c}', 68956), ('\u{10d7d}', 68957),
+ ('\u{10d7e}', 68958), ('\u{10d7f}', 68959), ('\u{10d80}', 68960), ('\u{10d81}', 68961),
+ ('\u{10d82}', 68962), ('\u{10d83}', 68963), ('\u{10d84}', 68964), ('\u{10d85}', 68965),
+ ('\u{118c0}', 71840), ('\u{118c1}', 71841), ('\u{118c2}', 71842), ('\u{118c3}', 71843),
+ ('\u{118c4}', 71844), ('\u{118c5}', 71845), ('\u{118c6}', 71846), ('\u{118c7}', 71847),
+ ('\u{118c8}', 71848), ('\u{118c9}', 71849), ('\u{118ca}', 71850), ('\u{118cb}', 71851),
+ ('\u{118cc}', 71852), ('\u{118cd}', 71853), ('\u{118ce}', 71854), ('\u{118cf}', 71855),
+ ('\u{118d0}', 71856), ('\u{118d1}', 71857), ('\u{118d2}', 71858), ('\u{118d3}', 71859),
+ ('\u{118d4}', 71860), ('\u{118d5}', 71861), ('\u{118d6}', 71862), ('\u{118d7}', 71863),
+ ('\u{118d8}', 71864), ('\u{118d9}', 71865), ('\u{118da}', 71866), ('\u{118db}', 71867),
+ ('\u{118dc}', 71868), ('\u{118dd}', 71869), ('\u{118de}', 71870), ('\u{118df}', 71871),
+ ('\u{16e60}', 93760), ('\u{16e61}', 93761), ('\u{16e62}', 93762), ('\u{16e63}', 93763),
+ ('\u{16e64}', 93764), ('\u{16e65}', 93765), ('\u{16e66}', 93766), ('\u{16e67}', 93767),
+ ('\u{16e68}', 93768), ('\u{16e69}', 93769), ('\u{16e6a}', 93770), ('\u{16e6b}', 93771),
+ ('\u{16e6c}', 93772), ('\u{16e6d}', 93773), ('\u{16e6e}', 93774), ('\u{16e6f}', 93775),
+ ('\u{16e70}', 93776), ('\u{16e71}', 93777), ('\u{16e72}', 93778), ('\u{16e73}', 93779),
+ ('\u{16e74}', 93780), ('\u{16e75}', 93781), ('\u{16e76}', 93782), ('\u{16e77}', 93783),
+ ('\u{16e78}', 93784), ('\u{16e79}', 93785), ('\u{16e7a}', 93786), ('\u{16e7b}', 93787),
+ ('\u{16e7c}', 93788), ('\u{16e7d}', 93789), ('\u{16e7e}', 93790), ('\u{16e7f}', 93791),
+ ('\u{16ebb}', 93856), ('\u{16ebc}', 93857), ('\u{16ebd}', 93858), ('\u{16ebe}', 93859),
+ ('\u{16ebf}', 93860), ('\u{16ec0}', 93861), ('\u{16ec1}', 93862), ('\u{16ec2}', 93863),
+ ('\u{16ec3}', 93864), ('\u{16ec4}', 93865), ('\u{16ec5}', 93866), ('\u{16ec6}', 93867),
+ ('\u{16ec7}', 93868), ('\u{16ec8}', 93869), ('\u{16ec9}', 93870), ('\u{16eca}', 93871),
+ ('\u{16ecb}', 93872), ('\u{16ecc}', 93873), ('\u{16ecd}', 93874), ('\u{16ece}', 93875),
+ ('\u{16ecf}', 93876), ('\u{16ed0}', 93877), ('\u{16ed1}', 93878), ('\u{16ed2}', 93879),
+ ('\u{16ed3}', 93880), ('\u{1e922}', 125184), ('\u{1e923}', 125185), ('\u{1e924}', 125186),
+ ('\u{1e925}', 125187), ('\u{1e926}', 125188), ('\u{1e927}', 125189), ('\u{1e928}', 125190),
+ ('\u{1e929}', 125191), ('\u{1e92a}', 125192), ('\u{1e92b}', 125193), ('\u{1e92c}', 125194),
+ ('\u{1e92d}', 125195), ('\u{1e92e}', 125196), ('\u{1e92f}', 125197), ('\u{1e930}', 125198),
+ ('\u{1e931}', 125199), ('\u{1e932}', 125200), ('\u{1e933}', 125201), ('\u{1e934}', 125202),
+ ('\u{1e935}', 125203), ('\u{1e936}', 125204), ('\u{1e937}', 125205), ('\u{1e938}', 125206),
+ ('\u{1e939}', 125207), ('\u{1e93a}', 125208), ('\u{1e93b}', 125209), ('\u{1e93c}', 125210),
+ ('\u{1e93d}', 125211), ('\u{1e93e}', 125212), ('\u{1e93f}', 125213), ('\u{1e940}', 125214),
+ ('\u{1e941}', 125215), ('\u{1e942}', 125216), ('\u{1e943}', 125217),
+ ];
+
static UPPERCASE_TABLE_MULTI: &[[char; 3]; 102] = &[
- ['\u{53}', '\u{53}', '\u{0}'], ['\u{2bc}', '\u{4e}', '\u{0}'],
- ['\u{4a}', '\u{30c}', '\u{0}'], ['\u{399}', '\u{308}', '\u{301}'],
- ['\u{3a5}', '\u{308}', '\u{301}'], ['\u{535}', '\u{552}', '\u{0}'],
- ['\u{48}', '\u{331}', '\u{0}'], ['\u{54}', '\u{308}', '\u{0}'],
- ['\u{57}', '\u{30a}', '\u{0}'], ['\u{59}', '\u{30a}', '\u{0}'],
- ['\u{41}', '\u{2be}', '\u{0}'], ['\u{3a5}', '\u{313}', '\u{0}'],
- ['\u{3a5}', '\u{313}', '\u{300}'], ['\u{3a5}', '\u{313}', '\u{301}'],
- ['\u{3a5}', '\u{313}', '\u{342}'], ['\u{1f08}', '\u{399}', '\u{0}'],
- ['\u{1f09}', '\u{399}', '\u{0}'], ['\u{1f0a}', '\u{399}', '\u{0}'],
- ['\u{1f0b}', '\u{399}', '\u{0}'], ['\u{1f0c}', '\u{399}', '\u{0}'],
- ['\u{1f0d}', '\u{399}', '\u{0}'], ['\u{1f0e}', '\u{399}', '\u{0}'],
- ['\u{1f0f}', '\u{399}', '\u{0}'], ['\u{1f08}', '\u{399}', '\u{0}'],
- ['\u{1f09}', '\u{399}', '\u{0}'], ['\u{1f0a}', '\u{399}', '\u{0}'],
- ['\u{1f0b}', '\u{399}', '\u{0}'], ['\u{1f0c}', '\u{399}', '\u{0}'],
- ['\u{1f0d}', '\u{399}', '\u{0}'], ['\u{1f0e}', '\u{399}', '\u{0}'],
- ['\u{1f0f}', '\u{399}', '\u{0}'], ['\u{1f28}', '\u{399}', '\u{0}'],
- ['\u{1f29}', '\u{399}', '\u{0}'], ['\u{1f2a}', '\u{399}', '\u{0}'],
- ['\u{1f2b}', '\u{399}', '\u{0}'], ['\u{1f2c}', '\u{399}', '\u{0}'],
- ['\u{1f2d}', '\u{399}', '\u{0}'], ['\u{1f2e}', '\u{399}', '\u{0}'],
- ['\u{1f2f}', '\u{399}', '\u{0}'], ['\u{1f28}', '\u{399}', '\u{0}'],
- ['\u{1f29}', '\u{399}', '\u{0}'], ['\u{1f2a}', '\u{399}', '\u{0}'],
- ['\u{1f2b}', '\u{399}', '\u{0}'], ['\u{1f2c}', '\u{399}', '\u{0}'],
- ['\u{1f2d}', '\u{399}', '\u{0}'], ['\u{1f2e}', '\u{399}', '\u{0}'],
- ['\u{1f2f}', '\u{399}', '\u{0}'], ['\u{1f68}', '\u{399}', '\u{0}'],
- ['\u{1f69}', '\u{399}', '\u{0}'], ['\u{1f6a}', '\u{399}', '\u{0}'],
- ['\u{1f6b}', '\u{399}', '\u{0}'], ['\u{1f6c}', '\u{399}', '\u{0}'],
- ['\u{1f6d}', '\u{399}', '\u{0}'], ['\u{1f6e}', '\u{399}', '\u{0}'],
- ['\u{1f6f}', '\u{399}', '\u{0}'], ['\u{1f68}', '\u{399}', '\u{0}'],
- ['\u{1f69}', '\u{399}', '\u{0}'], ['\u{1f6a}', '\u{399}', '\u{0}'],
- ['\u{1f6b}', '\u{399}', '\u{0}'], ['\u{1f6c}', '\u{399}', '\u{0}'],
- ['\u{1f6d}', '\u{399}', '\u{0}'], ['\u{1f6e}', '\u{399}', '\u{0}'],
- ['\u{1f6f}', '\u{399}', '\u{0}'], ['\u{1fba}', '\u{399}', '\u{0}'],
- ['\u{391}', '\u{399}', '\u{0}'], ['\u{386}', '\u{399}', '\u{0}'],
- ['\u{391}', '\u{342}', '\u{0}'], ['\u{391}', '\u{342}', '\u{399}'],
- ['\u{391}', '\u{399}', '\u{0}'], ['\u{1fca}', '\u{399}', '\u{0}'],
- ['\u{397}', '\u{399}', '\u{0}'], ['\u{389}', '\u{399}', '\u{0}'],
- ['\u{397}', '\u{342}', '\u{0}'], ['\u{397}', '\u{342}', '\u{399}'],
- ['\u{397}', '\u{399}', '\u{0}'], ['\u{399}', '\u{308}', '\u{300}'],
- ['\u{399}', '\u{308}', '\u{301}'], ['\u{399}', '\u{342}', '\u{0}'],
- ['\u{399}', '\u{308}', '\u{342}'], ['\u{3a5}', '\u{308}', '\u{300}'],
- ['\u{3a5}', '\u{308}', '\u{301}'], ['\u{3a1}', '\u{313}', '\u{0}'],
- ['\u{3a5}', '\u{342}', '\u{0}'], ['\u{3a5}', '\u{308}', '\u{342}'],
- ['\u{1ffa}', '\u{399}', '\u{0}'], ['\u{3a9}', '\u{399}', '\u{0}'],
- ['\u{38f}', '\u{399}', '\u{0}'], ['\u{3a9}', '\u{342}', '\u{0}'],
- ['\u{3a9}', '\u{342}', '\u{399}'], ['\u{3a9}', '\u{399}', '\u{0}'],
- ['\u{46}', '\u{46}', '\u{0}'], ['\u{46}', '\u{49}', '\u{0}'], ['\u{46}', '\u{4c}', '\u{0}'],
- ['\u{46}', '\u{46}', '\u{49}'], ['\u{46}', '\u{46}', '\u{4c}'],
- ['\u{53}', '\u{54}', '\u{0}'], ['\u{53}', '\u{54}', '\u{0}'],
- ['\u{544}', '\u{546}', '\u{0}'], ['\u{544}', '\u{535}', '\u{0}'],
+ ['S', 'S', '\u{0}'], ['\u{2bc}', 'N', '\u{0}'], ['J', '\u{30c}', '\u{0}'],
+ ['\u{399}', '\u{308}', '\u{301}'], ['\u{3a5}', '\u{308}', '\u{301}'],
+ ['\u{535}', '\u{552}', '\u{0}'], ['H', '\u{331}', '\u{0}'], ['T', '\u{308}', '\u{0}'],
+ ['W', '\u{30a}', '\u{0}'], ['Y', '\u{30a}', '\u{0}'], ['A', '\u{2be}', '\u{0}'],
+ ['\u{3a5}', '\u{313}', '\u{0}'], ['\u{3a5}', '\u{313}', '\u{300}'],
+ ['\u{3a5}', '\u{313}', '\u{301}'], ['\u{3a5}', '\u{313}', '\u{342}'],
+ ['\u{1f08}', '\u{399}', '\u{0}'], ['\u{1f09}', '\u{399}', '\u{0}'],
+ ['\u{1f0a}', '\u{399}', '\u{0}'], ['\u{1f0b}', '\u{399}', '\u{0}'],
+ ['\u{1f0c}', '\u{399}', '\u{0}'], ['\u{1f0d}', '\u{399}', '\u{0}'],
+ ['\u{1f0e}', '\u{399}', '\u{0}'], ['\u{1f0f}', '\u{399}', '\u{0}'],
+ ['\u{1f08}', '\u{399}', '\u{0}'], ['\u{1f09}', '\u{399}', '\u{0}'],
+ ['\u{1f0a}', '\u{399}', '\u{0}'], ['\u{1f0b}', '\u{399}', '\u{0}'],
+ ['\u{1f0c}', '\u{399}', '\u{0}'], ['\u{1f0d}', '\u{399}', '\u{0}'],
+ ['\u{1f0e}', '\u{399}', '\u{0}'], ['\u{1f0f}', '\u{399}', '\u{0}'],
+ ['\u{1f28}', '\u{399}', '\u{0}'], ['\u{1f29}', '\u{399}', '\u{0}'],
+ ['\u{1f2a}', '\u{399}', '\u{0}'], ['\u{1f2b}', '\u{399}', '\u{0}'],
+ ['\u{1f2c}', '\u{399}', '\u{0}'], ['\u{1f2d}', '\u{399}', '\u{0}'],
+ ['\u{1f2e}', '\u{399}', '\u{0}'], ['\u{1f2f}', '\u{399}', '\u{0}'],
+ ['\u{1f28}', '\u{399}', '\u{0}'], ['\u{1f29}', '\u{399}', '\u{0}'],
+ ['\u{1f2a}', '\u{399}', '\u{0}'], ['\u{1f2b}', '\u{399}', '\u{0}'],
+ ['\u{1f2c}', '\u{399}', '\u{0}'], ['\u{1f2d}', '\u{399}', '\u{0}'],
+ ['\u{1f2e}', '\u{399}', '\u{0}'], ['\u{1f2f}', '\u{399}', '\u{0}'],
+ ['\u{1f68}', '\u{399}', '\u{0}'], ['\u{1f69}', '\u{399}', '\u{0}'],
+ ['\u{1f6a}', '\u{399}', '\u{0}'], ['\u{1f6b}', '\u{399}', '\u{0}'],
+ ['\u{1f6c}', '\u{399}', '\u{0}'], ['\u{1f6d}', '\u{399}', '\u{0}'],
+ ['\u{1f6e}', '\u{399}', '\u{0}'], ['\u{1f6f}', '\u{399}', '\u{0}'],
+ ['\u{1f68}', '\u{399}', '\u{0}'], ['\u{1f69}', '\u{399}', '\u{0}'],
+ ['\u{1f6a}', '\u{399}', '\u{0}'], ['\u{1f6b}', '\u{399}', '\u{0}'],
+ ['\u{1f6c}', '\u{399}', '\u{0}'], ['\u{1f6d}', '\u{399}', '\u{0}'],
+ ['\u{1f6e}', '\u{399}', '\u{0}'], ['\u{1f6f}', '\u{399}', '\u{0}'],
+ ['\u{1fba}', '\u{399}', '\u{0}'], ['\u{391}', '\u{399}', '\u{0}'],
+ ['\u{386}', '\u{399}', '\u{0}'], ['\u{391}', '\u{342}', '\u{0}'],
+ ['\u{391}', '\u{342}', '\u{399}'], ['\u{391}', '\u{399}', '\u{0}'],
+ ['\u{1fca}', '\u{399}', '\u{0}'], ['\u{397}', '\u{399}', '\u{0}'],
+ ['\u{389}', '\u{399}', '\u{0}'], ['\u{397}', '\u{342}', '\u{0}'],
+ ['\u{397}', '\u{342}', '\u{399}'], ['\u{397}', '\u{399}', '\u{0}'],
+ ['\u{399}', '\u{308}', '\u{300}'], ['\u{399}', '\u{308}', '\u{301}'],
+ ['\u{399}', '\u{342}', '\u{0}'], ['\u{399}', '\u{308}', '\u{342}'],
+ ['\u{3a5}', '\u{308}', '\u{300}'], ['\u{3a5}', '\u{308}', '\u{301}'],
+ ['\u{3a1}', '\u{313}', '\u{0}'], ['\u{3a5}', '\u{342}', '\u{0}'],
+ ['\u{3a5}', '\u{308}', '\u{342}'], ['\u{1ffa}', '\u{399}', '\u{0}'],
+ ['\u{3a9}', '\u{399}', '\u{0}'], ['\u{38f}', '\u{399}', '\u{0}'],
+ ['\u{3a9}', '\u{342}', '\u{0}'], ['\u{3a9}', '\u{342}', '\u{399}'],
+ ['\u{3a9}', '\u{399}', '\u{0}'], ['F', 'F', '\u{0}'], ['F', 'I', '\u{0}'],
+ ['F', 'L', '\u{0}'], ['F', 'F', 'I'], ['F', 'F', 'L'], ['S', 'T', '\u{0}'],
+ ['S', 'T', '\u{0}'], ['\u{544}', '\u{546}', '\u{0}'], ['\u{544}', '\u{535}', '\u{0}'],
['\u{544}', '\u{53b}', '\u{0}'], ['\u{54e}', '\u{546}', '\u{0}'],
['\u{544}', '\u{53d}', '\u{0}'],
];
-
- #[inline]
- pub fn to_upper(c: char) -> [char; 3] {
- const {
- let mut i = 0;
- while i < UPPERCASE_TABLE.len() {
- let (_, val) = UPPERCASE_TABLE[i];
- if val & (1 << 22) == 0 {
- assert!(char::from_u32(val).is_some());
- } else {
- let index = val & ((1 << 22) - 1);
- assert!((index as usize) < UPPERCASE_TABLE_MULTI.len());
- }
- i += 1;
- }
- }
-
- // SAFETY: Just checked that the tables are valid
- unsafe {
- super::case_conversion(
- c,
- |c| c.to_ascii_uppercase(),
- UPPERCASE_TABLE,
- UPPERCASE_TABLE_MULTI,
- )
- }
- }
}
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs
index 60a0998..80b6203 100644
--- a/library/coretests/tests/lib.rs
+++ b/library/coretests/tests/lib.rs
@@ -116,7 +116,6 @@
#![feature(try_find)]
#![feature(try_trait_v2)]
#![feature(uint_bit_width)]
-#![feature(unicode_internals)]
#![feature(unsize)]
#![feature(unwrap_infallible)]
// tidy-alphabetical-end
diff --git a/library/coretests/tests/unicode.rs b/library/coretests/tests/unicode.rs
index 445175c..bbace0e 100644
--- a/library/coretests/tests/unicode.rs
+++ b/library/coretests/tests/unicode.rs
@@ -1,101 +1,5 @@
-use core::unicode::unicode_data;
-use std::ops::RangeInclusive;
-
-mod test_data;
-
#[test]
pub fn version() {
let (major, _minor, _update) = core::char::UNICODE_VERSION;
assert!(major >= 10);
}
-
-#[track_caller]
-fn test_boolean_property(ranges: &[RangeInclusive<char>], lookup: fn(char) -> bool) {
- let mut start = '\u{80}';
- for range in ranges {
- for c in start..*range.start() {
- assert!(!lookup(c), "{c:?}");
- }
- for c in range.clone() {
- assert!(lookup(c), "{c:?}");
- }
- start = char::from_u32(*range.end() as u32 + 1).unwrap();
- }
- for c in start..=char::MAX {
- assert!(!lookup(c), "{c:?}");
- }
-}
-
-#[track_caller]
-fn test_case_mapping(ranges: &[(char, [char; 3])], lookup: fn(char) -> [char; 3]) {
- let mut start = '\u{80}';
- for &(key, val) in ranges {
- for c in start..key {
- assert_eq!(lookup(c), [c, '\0', '\0'], "{c:?}");
- }
- assert_eq!(lookup(key), val, "{key:?}");
- start = char::from_u32(key as u32 + 1).unwrap();
- }
- for c in start..=char::MAX {
- assert_eq!(lookup(c), [c, '\0', '\0'], "{c:?}");
- }
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn alphabetic() {
- test_boolean_property(test_data::ALPHABETIC, unicode_data::alphabetic::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn case_ignorable() {
- test_boolean_property(test_data::CASE_IGNORABLE, unicode_data::case_ignorable::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn cased() {
- test_boolean_property(test_data::CASED, unicode_data::cased::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn grapheme_extend() {
- test_boolean_property(test_data::GRAPHEME_EXTEND, unicode_data::grapheme_extend::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn lowercase() {
- test_boolean_property(test_data::LOWERCASE, unicode_data::lowercase::lookup);
-}
-
-#[test]
-fn n() {
- test_boolean_property(test_data::N, unicode_data::n::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn uppercase() {
- test_boolean_property(test_data::UPPERCASE, unicode_data::uppercase::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn white_space() {
- test_boolean_property(test_data::WHITE_SPACE, unicode_data::white_space::lookup);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn to_lowercase() {
- test_case_mapping(test_data::TO_LOWER, unicode_data::conversions::to_lower);
-}
-
-#[test]
-#[cfg_attr(miri, ignore)]
-fn to_uppercase() {
- test_case_mapping(test_data::TO_UPPER, unicode_data::conversions::to_upper);
-}
diff --git a/library/coretests/tests/unicode/test_data.rs b/library/coretests/tests/unicode/test_data.rs
deleted file mode 100644
index f53cd7d..0000000
--- a/library/coretests/tests/unicode/test_data.rs
+++ /dev/null
@@ -1,2928 +0,0 @@
-//! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually!
-// ignore-tidy-filelength
-
-use std::ops::RangeInclusive;
-
-#[rustfmt::skip]
-pub(super) static ALPHABETIC: &[RangeInclusive<char>; 759] = &[
- '\u{aa}'..='\u{aa}', '\u{b5}'..='\u{b5}', '\u{ba}'..='\u{ba}', '\u{c0}'..='\u{d6}',
- '\u{d8}'..='\u{f6}', '\u{f8}'..='\u{2c1}', '\u{2c6}'..='\u{2d1}', '\u{2e0}'..='\u{2e4}',
- '\u{2ec}'..='\u{2ec}', '\u{2ee}'..='\u{2ee}', '\u{345}'..='\u{345}', '\u{363}'..='\u{374}',
- '\u{376}'..='\u{377}', '\u{37a}'..='\u{37d}', '\u{37f}'..='\u{37f}', '\u{386}'..='\u{386}',
- '\u{388}'..='\u{38a}', '\u{38c}'..='\u{38c}', '\u{38e}'..='\u{3a1}', '\u{3a3}'..='\u{3f5}',
- '\u{3f7}'..='\u{481}', '\u{48a}'..='\u{52f}', '\u{531}'..='\u{556}', '\u{559}'..='\u{559}',
- '\u{560}'..='\u{588}', '\u{5b0}'..='\u{5bd}', '\u{5bf}'..='\u{5bf}', '\u{5c1}'..='\u{5c2}',
- '\u{5c4}'..='\u{5c5}', '\u{5c7}'..='\u{5c7}', '\u{5d0}'..='\u{5ea}', '\u{5ef}'..='\u{5f2}',
- '\u{610}'..='\u{61a}', '\u{620}'..='\u{657}', '\u{659}'..='\u{65f}', '\u{66e}'..='\u{6d3}',
- '\u{6d5}'..='\u{6dc}', '\u{6e1}'..='\u{6e8}', '\u{6ed}'..='\u{6ef}', '\u{6fa}'..='\u{6fc}',
- '\u{6ff}'..='\u{6ff}', '\u{710}'..='\u{73f}', '\u{74d}'..='\u{7b1}', '\u{7ca}'..='\u{7ea}',
- '\u{7f4}'..='\u{7f5}', '\u{7fa}'..='\u{7fa}', '\u{800}'..='\u{817}', '\u{81a}'..='\u{82c}',
- '\u{840}'..='\u{858}', '\u{860}'..='\u{86a}', '\u{870}'..='\u{887}', '\u{889}'..='\u{88f}',
- '\u{897}'..='\u{897}', '\u{8a0}'..='\u{8c9}', '\u{8d4}'..='\u{8df}', '\u{8e3}'..='\u{8e9}',
- '\u{8f0}'..='\u{93b}', '\u{93d}'..='\u{94c}', '\u{94e}'..='\u{950}', '\u{955}'..='\u{963}',
- '\u{971}'..='\u{983}', '\u{985}'..='\u{98c}', '\u{98f}'..='\u{990}', '\u{993}'..='\u{9a8}',
- '\u{9aa}'..='\u{9b0}', '\u{9b2}'..='\u{9b2}', '\u{9b6}'..='\u{9b9}', '\u{9bd}'..='\u{9c4}',
- '\u{9c7}'..='\u{9c8}', '\u{9cb}'..='\u{9cc}', '\u{9ce}'..='\u{9ce}', '\u{9d7}'..='\u{9d7}',
- '\u{9dc}'..='\u{9dd}', '\u{9df}'..='\u{9e3}', '\u{9f0}'..='\u{9f1}', '\u{9fc}'..='\u{9fc}',
- '\u{a01}'..='\u{a03}', '\u{a05}'..='\u{a0a}', '\u{a0f}'..='\u{a10}', '\u{a13}'..='\u{a28}',
- '\u{a2a}'..='\u{a30}', '\u{a32}'..='\u{a33}', '\u{a35}'..='\u{a36}', '\u{a38}'..='\u{a39}',
- '\u{a3e}'..='\u{a42}', '\u{a47}'..='\u{a48}', '\u{a4b}'..='\u{a4c}', '\u{a51}'..='\u{a51}',
- '\u{a59}'..='\u{a5c}', '\u{a5e}'..='\u{a5e}', '\u{a70}'..='\u{a75}', '\u{a81}'..='\u{a83}',
- '\u{a85}'..='\u{a8d}', '\u{a8f}'..='\u{a91}', '\u{a93}'..='\u{aa8}', '\u{aaa}'..='\u{ab0}',
- '\u{ab2}'..='\u{ab3}', '\u{ab5}'..='\u{ab9}', '\u{abd}'..='\u{ac5}', '\u{ac7}'..='\u{ac9}',
- '\u{acb}'..='\u{acc}', '\u{ad0}'..='\u{ad0}', '\u{ae0}'..='\u{ae3}', '\u{af9}'..='\u{afc}',
- '\u{b01}'..='\u{b03}', '\u{b05}'..='\u{b0c}', '\u{b0f}'..='\u{b10}', '\u{b13}'..='\u{b28}',
- '\u{b2a}'..='\u{b30}', '\u{b32}'..='\u{b33}', '\u{b35}'..='\u{b39}', '\u{b3d}'..='\u{b44}',
- '\u{b47}'..='\u{b48}', '\u{b4b}'..='\u{b4c}', '\u{b56}'..='\u{b57}', '\u{b5c}'..='\u{b5d}',
- '\u{b5f}'..='\u{b63}', '\u{b71}'..='\u{b71}', '\u{b82}'..='\u{b83}', '\u{b85}'..='\u{b8a}',
- '\u{b8e}'..='\u{b90}', '\u{b92}'..='\u{b95}', '\u{b99}'..='\u{b9a}', '\u{b9c}'..='\u{b9c}',
- '\u{b9e}'..='\u{b9f}', '\u{ba3}'..='\u{ba4}', '\u{ba8}'..='\u{baa}', '\u{bae}'..='\u{bb9}',
- '\u{bbe}'..='\u{bc2}', '\u{bc6}'..='\u{bc8}', '\u{bca}'..='\u{bcc}', '\u{bd0}'..='\u{bd0}',
- '\u{bd7}'..='\u{bd7}', '\u{c00}'..='\u{c0c}', '\u{c0e}'..='\u{c10}', '\u{c12}'..='\u{c28}',
- '\u{c2a}'..='\u{c39}', '\u{c3d}'..='\u{c44}', '\u{c46}'..='\u{c48}', '\u{c4a}'..='\u{c4c}',
- '\u{c55}'..='\u{c56}', '\u{c58}'..='\u{c5a}', '\u{c5c}'..='\u{c5d}', '\u{c60}'..='\u{c63}',
- '\u{c80}'..='\u{c83}', '\u{c85}'..='\u{c8c}', '\u{c8e}'..='\u{c90}', '\u{c92}'..='\u{ca8}',
- '\u{caa}'..='\u{cb3}', '\u{cb5}'..='\u{cb9}', '\u{cbd}'..='\u{cc4}', '\u{cc6}'..='\u{cc8}',
- '\u{cca}'..='\u{ccc}', '\u{cd5}'..='\u{cd6}', '\u{cdc}'..='\u{cde}', '\u{ce0}'..='\u{ce3}',
- '\u{cf1}'..='\u{cf3}', '\u{d00}'..='\u{d0c}', '\u{d0e}'..='\u{d10}', '\u{d12}'..='\u{d3a}',
- '\u{d3d}'..='\u{d44}', '\u{d46}'..='\u{d48}', '\u{d4a}'..='\u{d4c}', '\u{d4e}'..='\u{d4e}',
- '\u{d54}'..='\u{d57}', '\u{d5f}'..='\u{d63}', '\u{d7a}'..='\u{d7f}', '\u{d81}'..='\u{d83}',
- '\u{d85}'..='\u{d96}', '\u{d9a}'..='\u{db1}', '\u{db3}'..='\u{dbb}', '\u{dbd}'..='\u{dbd}',
- '\u{dc0}'..='\u{dc6}', '\u{dcf}'..='\u{dd4}', '\u{dd6}'..='\u{dd6}', '\u{dd8}'..='\u{ddf}',
- '\u{df2}'..='\u{df3}', '\u{e01}'..='\u{e3a}', '\u{e40}'..='\u{e46}', '\u{e4d}'..='\u{e4d}',
- '\u{e81}'..='\u{e82}', '\u{e84}'..='\u{e84}', '\u{e86}'..='\u{e8a}', '\u{e8c}'..='\u{ea3}',
- '\u{ea5}'..='\u{ea5}', '\u{ea7}'..='\u{eb9}', '\u{ebb}'..='\u{ebd}', '\u{ec0}'..='\u{ec4}',
- '\u{ec6}'..='\u{ec6}', '\u{ecd}'..='\u{ecd}', '\u{edc}'..='\u{edf}', '\u{f00}'..='\u{f00}',
- '\u{f40}'..='\u{f47}', '\u{f49}'..='\u{f6c}', '\u{f71}'..='\u{f83}', '\u{f88}'..='\u{f97}',
- '\u{f99}'..='\u{fbc}', '\u{1000}'..='\u{1036}', '\u{1038}'..='\u{1038}',
- '\u{103b}'..='\u{103f}', '\u{1050}'..='\u{108f}', '\u{109a}'..='\u{109d}',
- '\u{10a0}'..='\u{10c5}', '\u{10c7}'..='\u{10c7}', '\u{10cd}'..='\u{10cd}',
- '\u{10d0}'..='\u{10fa}', '\u{10fc}'..='\u{1248}', '\u{124a}'..='\u{124d}',
- '\u{1250}'..='\u{1256}', '\u{1258}'..='\u{1258}', '\u{125a}'..='\u{125d}',
- '\u{1260}'..='\u{1288}', '\u{128a}'..='\u{128d}', '\u{1290}'..='\u{12b0}',
- '\u{12b2}'..='\u{12b5}', '\u{12b8}'..='\u{12be}', '\u{12c0}'..='\u{12c0}',
- '\u{12c2}'..='\u{12c5}', '\u{12c8}'..='\u{12d6}', '\u{12d8}'..='\u{1310}',
- '\u{1312}'..='\u{1315}', '\u{1318}'..='\u{135a}', '\u{1380}'..='\u{138f}',
- '\u{13a0}'..='\u{13f5}', '\u{13f8}'..='\u{13fd}', '\u{1401}'..='\u{166c}',
- '\u{166f}'..='\u{167f}', '\u{1681}'..='\u{169a}', '\u{16a0}'..='\u{16ea}',
- '\u{16ee}'..='\u{16f8}', '\u{1700}'..='\u{1713}', '\u{171f}'..='\u{1733}',
- '\u{1740}'..='\u{1753}', '\u{1760}'..='\u{176c}', '\u{176e}'..='\u{1770}',
- '\u{1772}'..='\u{1773}', '\u{1780}'..='\u{17b3}', '\u{17b6}'..='\u{17c8}',
- '\u{17d7}'..='\u{17d7}', '\u{17dc}'..='\u{17dc}', '\u{1820}'..='\u{1878}',
- '\u{1880}'..='\u{18aa}', '\u{18b0}'..='\u{18f5}', '\u{1900}'..='\u{191e}',
- '\u{1920}'..='\u{192b}', '\u{1930}'..='\u{1938}', '\u{1950}'..='\u{196d}',
- '\u{1970}'..='\u{1974}', '\u{1980}'..='\u{19ab}', '\u{19b0}'..='\u{19c9}',
- '\u{1a00}'..='\u{1a1b}', '\u{1a20}'..='\u{1a5e}', '\u{1a61}'..='\u{1a74}',
- '\u{1aa7}'..='\u{1aa7}', '\u{1abf}'..='\u{1ac0}', '\u{1acc}'..='\u{1ace}',
- '\u{1b00}'..='\u{1b33}', '\u{1b35}'..='\u{1b43}', '\u{1b45}'..='\u{1b4c}',
- '\u{1b80}'..='\u{1ba9}', '\u{1bac}'..='\u{1baf}', '\u{1bba}'..='\u{1be5}',
- '\u{1be7}'..='\u{1bf1}', '\u{1c00}'..='\u{1c36}', '\u{1c4d}'..='\u{1c4f}',
- '\u{1c5a}'..='\u{1c7d}', '\u{1c80}'..='\u{1c8a}', '\u{1c90}'..='\u{1cba}',
- '\u{1cbd}'..='\u{1cbf}', '\u{1ce9}'..='\u{1cec}', '\u{1cee}'..='\u{1cf3}',
- '\u{1cf5}'..='\u{1cf6}', '\u{1cfa}'..='\u{1cfa}', '\u{1d00}'..='\u{1dbf}',
- '\u{1dd3}'..='\u{1df4}', '\u{1e00}'..='\u{1f15}', '\u{1f18}'..='\u{1f1d}',
- '\u{1f20}'..='\u{1f45}', '\u{1f48}'..='\u{1f4d}', '\u{1f50}'..='\u{1f57}',
- '\u{1f59}'..='\u{1f59}', '\u{1f5b}'..='\u{1f5b}', '\u{1f5d}'..='\u{1f5d}',
- '\u{1f5f}'..='\u{1f7d}', '\u{1f80}'..='\u{1fb4}', '\u{1fb6}'..='\u{1fbc}',
- '\u{1fbe}'..='\u{1fbe}', '\u{1fc2}'..='\u{1fc4}', '\u{1fc6}'..='\u{1fcc}',
- '\u{1fd0}'..='\u{1fd3}', '\u{1fd6}'..='\u{1fdb}', '\u{1fe0}'..='\u{1fec}',
- '\u{1ff2}'..='\u{1ff4}', '\u{1ff6}'..='\u{1ffc}', '\u{2071}'..='\u{2071}',
- '\u{207f}'..='\u{207f}', '\u{2090}'..='\u{209c}', '\u{2102}'..='\u{2102}',
- '\u{2107}'..='\u{2107}', '\u{210a}'..='\u{2113}', '\u{2115}'..='\u{2115}',
- '\u{2119}'..='\u{211d}', '\u{2124}'..='\u{2124}', '\u{2126}'..='\u{2126}',
- '\u{2128}'..='\u{2128}', '\u{212a}'..='\u{212d}', '\u{212f}'..='\u{2139}',
- '\u{213c}'..='\u{213f}', '\u{2145}'..='\u{2149}', '\u{214e}'..='\u{214e}',
- '\u{2160}'..='\u{2188}', '\u{24b6}'..='\u{24e9}', '\u{2c00}'..='\u{2ce4}',
- '\u{2ceb}'..='\u{2cee}', '\u{2cf2}'..='\u{2cf3}', '\u{2d00}'..='\u{2d25}',
- '\u{2d27}'..='\u{2d27}', '\u{2d2d}'..='\u{2d2d}', '\u{2d30}'..='\u{2d67}',
- '\u{2d6f}'..='\u{2d6f}', '\u{2d80}'..='\u{2d96}', '\u{2da0}'..='\u{2da6}',
- '\u{2da8}'..='\u{2dae}', '\u{2db0}'..='\u{2db6}', '\u{2db8}'..='\u{2dbe}',
- '\u{2dc0}'..='\u{2dc6}', '\u{2dc8}'..='\u{2dce}', '\u{2dd0}'..='\u{2dd6}',
- '\u{2dd8}'..='\u{2dde}', '\u{2de0}'..='\u{2dff}', '\u{2e2f}'..='\u{2e2f}',
- '\u{3005}'..='\u{3007}', '\u{3021}'..='\u{3029}', '\u{3031}'..='\u{3035}',
- '\u{3038}'..='\u{303c}', '\u{3041}'..='\u{3096}', '\u{309d}'..='\u{309f}',
- '\u{30a1}'..='\u{30fa}', '\u{30fc}'..='\u{30ff}', '\u{3105}'..='\u{312f}',
- '\u{3131}'..='\u{318e}', '\u{31a0}'..='\u{31bf}', '\u{31f0}'..='\u{31ff}',
- '\u{3400}'..='\u{4dbf}', '\u{4e00}'..='\u{a48c}', '\u{a4d0}'..='\u{a4fd}',
- '\u{a500}'..='\u{a60c}', '\u{a610}'..='\u{a61f}', '\u{a62a}'..='\u{a62b}',
- '\u{a640}'..='\u{a66e}', '\u{a674}'..='\u{a67b}', '\u{a67f}'..='\u{a6ef}',
- '\u{a717}'..='\u{a71f}', '\u{a722}'..='\u{a788}', '\u{a78b}'..='\u{a7dc}',
- '\u{a7f1}'..='\u{a805}', '\u{a807}'..='\u{a827}', '\u{a840}'..='\u{a873}',
- '\u{a880}'..='\u{a8c3}', '\u{a8c5}'..='\u{a8c5}', '\u{a8f2}'..='\u{a8f7}',
- '\u{a8fb}'..='\u{a8fb}', '\u{a8fd}'..='\u{a8ff}', '\u{a90a}'..='\u{a92a}',
- '\u{a930}'..='\u{a952}', '\u{a960}'..='\u{a97c}', '\u{a980}'..='\u{a9b2}',
- '\u{a9b4}'..='\u{a9bf}', '\u{a9cf}'..='\u{a9cf}', '\u{a9e0}'..='\u{a9ef}',
- '\u{a9fa}'..='\u{a9fe}', '\u{aa00}'..='\u{aa36}', '\u{aa40}'..='\u{aa4d}',
- '\u{aa60}'..='\u{aa76}', '\u{aa7a}'..='\u{aabe}', '\u{aac0}'..='\u{aac0}',
- '\u{aac2}'..='\u{aac2}', '\u{aadb}'..='\u{aadd}', '\u{aae0}'..='\u{aaef}',
- '\u{aaf2}'..='\u{aaf5}', '\u{ab01}'..='\u{ab06}', '\u{ab09}'..='\u{ab0e}',
- '\u{ab11}'..='\u{ab16}', '\u{ab20}'..='\u{ab26}', '\u{ab28}'..='\u{ab2e}',
- '\u{ab30}'..='\u{ab5a}', '\u{ab5c}'..='\u{ab69}', '\u{ab70}'..='\u{abea}',
- '\u{ac00}'..='\u{d7a3}', '\u{d7b0}'..='\u{d7c6}', '\u{d7cb}'..='\u{d7fb}',
- '\u{f900}'..='\u{fa6d}', '\u{fa70}'..='\u{fad9}', '\u{fb00}'..='\u{fb06}',
- '\u{fb13}'..='\u{fb17}', '\u{fb1d}'..='\u{fb28}', '\u{fb2a}'..='\u{fb36}',
- '\u{fb38}'..='\u{fb3c}', '\u{fb3e}'..='\u{fb3e}', '\u{fb40}'..='\u{fb41}',
- '\u{fb43}'..='\u{fb44}', '\u{fb46}'..='\u{fbb1}', '\u{fbd3}'..='\u{fd3d}',
- '\u{fd50}'..='\u{fd8f}', '\u{fd92}'..='\u{fdc7}', '\u{fdf0}'..='\u{fdfb}',
- '\u{fe70}'..='\u{fe74}', '\u{fe76}'..='\u{fefc}', '\u{ff21}'..='\u{ff3a}',
- '\u{ff41}'..='\u{ff5a}', '\u{ff66}'..='\u{ffbe}', '\u{ffc2}'..='\u{ffc7}',
- '\u{ffca}'..='\u{ffcf}', '\u{ffd2}'..='\u{ffd7}', '\u{ffda}'..='\u{ffdc}',
- '\u{10000}'..='\u{1000b}', '\u{1000d}'..='\u{10026}', '\u{10028}'..='\u{1003a}',
- '\u{1003c}'..='\u{1003d}', '\u{1003f}'..='\u{1004d}', '\u{10050}'..='\u{1005d}',
- '\u{10080}'..='\u{100fa}', '\u{10140}'..='\u{10174}', '\u{10280}'..='\u{1029c}',
- '\u{102a0}'..='\u{102d0}', '\u{10300}'..='\u{1031f}', '\u{1032d}'..='\u{1034a}',
- '\u{10350}'..='\u{1037a}', '\u{10380}'..='\u{1039d}', '\u{103a0}'..='\u{103c3}',
- '\u{103c8}'..='\u{103cf}', '\u{103d1}'..='\u{103d5}', '\u{10400}'..='\u{1049d}',
- '\u{104b0}'..='\u{104d3}', '\u{104d8}'..='\u{104fb}', '\u{10500}'..='\u{10527}',
- '\u{10530}'..='\u{10563}', '\u{10570}'..='\u{1057a}', '\u{1057c}'..='\u{1058a}',
- '\u{1058c}'..='\u{10592}', '\u{10594}'..='\u{10595}', '\u{10597}'..='\u{105a1}',
- '\u{105a3}'..='\u{105b1}', '\u{105b3}'..='\u{105b9}', '\u{105bb}'..='\u{105bc}',
- '\u{105c0}'..='\u{105f3}', '\u{10600}'..='\u{10736}', '\u{10740}'..='\u{10755}',
- '\u{10760}'..='\u{10767}', '\u{10780}'..='\u{10785}', '\u{10787}'..='\u{107b0}',
- '\u{107b2}'..='\u{107ba}', '\u{10800}'..='\u{10805}', '\u{10808}'..='\u{10808}',
- '\u{1080a}'..='\u{10835}', '\u{10837}'..='\u{10838}', '\u{1083c}'..='\u{1083c}',
- '\u{1083f}'..='\u{10855}', '\u{10860}'..='\u{10876}', '\u{10880}'..='\u{1089e}',
- '\u{108e0}'..='\u{108f2}', '\u{108f4}'..='\u{108f5}', '\u{10900}'..='\u{10915}',
- '\u{10920}'..='\u{10939}', '\u{10940}'..='\u{10959}', '\u{10980}'..='\u{109b7}',
- '\u{109be}'..='\u{109bf}', '\u{10a00}'..='\u{10a03}', '\u{10a05}'..='\u{10a06}',
- '\u{10a0c}'..='\u{10a13}', '\u{10a15}'..='\u{10a17}', '\u{10a19}'..='\u{10a35}',
- '\u{10a60}'..='\u{10a7c}', '\u{10a80}'..='\u{10a9c}', '\u{10ac0}'..='\u{10ac7}',
- '\u{10ac9}'..='\u{10ae4}', '\u{10b00}'..='\u{10b35}', '\u{10b40}'..='\u{10b55}',
- '\u{10b60}'..='\u{10b72}', '\u{10b80}'..='\u{10b91}', '\u{10c00}'..='\u{10c48}',
- '\u{10c80}'..='\u{10cb2}', '\u{10cc0}'..='\u{10cf2}', '\u{10d00}'..='\u{10d27}',
- '\u{10d4a}'..='\u{10d65}', '\u{10d69}'..='\u{10d69}', '\u{10d6f}'..='\u{10d85}',
- '\u{10e80}'..='\u{10ea9}', '\u{10eab}'..='\u{10eac}', '\u{10eb0}'..='\u{10eb1}',
- '\u{10ec2}'..='\u{10ec7}', '\u{10efa}'..='\u{10efc}', '\u{10f00}'..='\u{10f1c}',
- '\u{10f27}'..='\u{10f27}', '\u{10f30}'..='\u{10f45}', '\u{10f70}'..='\u{10f81}',
- '\u{10fb0}'..='\u{10fc4}', '\u{10fe0}'..='\u{10ff6}', '\u{11000}'..='\u{11045}',
- '\u{11071}'..='\u{11075}', '\u{11080}'..='\u{110b8}', '\u{110c2}'..='\u{110c2}',
- '\u{110d0}'..='\u{110e8}', '\u{11100}'..='\u{11132}', '\u{11144}'..='\u{11147}',
- '\u{11150}'..='\u{11172}', '\u{11176}'..='\u{11176}', '\u{11180}'..='\u{111bf}',
- '\u{111c1}'..='\u{111c4}', '\u{111ce}'..='\u{111cf}', '\u{111da}'..='\u{111da}',
- '\u{111dc}'..='\u{111dc}', '\u{11200}'..='\u{11211}', '\u{11213}'..='\u{11234}',
- '\u{11237}'..='\u{11237}', '\u{1123e}'..='\u{11241}', '\u{11280}'..='\u{11286}',
- '\u{11288}'..='\u{11288}', '\u{1128a}'..='\u{1128d}', '\u{1128f}'..='\u{1129d}',
- '\u{1129f}'..='\u{112a8}', '\u{112b0}'..='\u{112e8}', '\u{11300}'..='\u{11303}',
- '\u{11305}'..='\u{1130c}', '\u{1130f}'..='\u{11310}', '\u{11313}'..='\u{11328}',
- '\u{1132a}'..='\u{11330}', '\u{11332}'..='\u{11333}', '\u{11335}'..='\u{11339}',
- '\u{1133d}'..='\u{11344}', '\u{11347}'..='\u{11348}', '\u{1134b}'..='\u{1134c}',
- '\u{11350}'..='\u{11350}', '\u{11357}'..='\u{11357}', '\u{1135d}'..='\u{11363}',
- '\u{11380}'..='\u{11389}', '\u{1138b}'..='\u{1138b}', '\u{1138e}'..='\u{1138e}',
- '\u{11390}'..='\u{113b5}', '\u{113b7}'..='\u{113c0}', '\u{113c2}'..='\u{113c2}',
- '\u{113c5}'..='\u{113c5}', '\u{113c7}'..='\u{113ca}', '\u{113cc}'..='\u{113cd}',
- '\u{113d1}'..='\u{113d1}', '\u{113d3}'..='\u{113d3}', '\u{11400}'..='\u{11441}',
- '\u{11443}'..='\u{11445}', '\u{11447}'..='\u{1144a}', '\u{1145f}'..='\u{11461}',
- '\u{11480}'..='\u{114c1}', '\u{114c4}'..='\u{114c5}', '\u{114c7}'..='\u{114c7}',
- '\u{11580}'..='\u{115b5}', '\u{115b8}'..='\u{115be}', '\u{115d8}'..='\u{115dd}',
- '\u{11600}'..='\u{1163e}', '\u{11640}'..='\u{11640}', '\u{11644}'..='\u{11644}',
- '\u{11680}'..='\u{116b5}', '\u{116b8}'..='\u{116b8}', '\u{11700}'..='\u{1171a}',
- '\u{1171d}'..='\u{1172a}', '\u{11740}'..='\u{11746}', '\u{11800}'..='\u{11838}',
- '\u{118a0}'..='\u{118df}', '\u{118ff}'..='\u{11906}', '\u{11909}'..='\u{11909}',
- '\u{1190c}'..='\u{11913}', '\u{11915}'..='\u{11916}', '\u{11918}'..='\u{11935}',
- '\u{11937}'..='\u{11938}', '\u{1193b}'..='\u{1193c}', '\u{1193f}'..='\u{11942}',
- '\u{119a0}'..='\u{119a7}', '\u{119aa}'..='\u{119d7}', '\u{119da}'..='\u{119df}',
- '\u{119e1}'..='\u{119e1}', '\u{119e3}'..='\u{119e4}', '\u{11a00}'..='\u{11a32}',
- '\u{11a35}'..='\u{11a3e}', '\u{11a50}'..='\u{11a97}', '\u{11a9d}'..='\u{11a9d}',
- '\u{11ab0}'..='\u{11af8}', '\u{11b60}'..='\u{11b67}', '\u{11bc0}'..='\u{11be0}',
- '\u{11c00}'..='\u{11c08}', '\u{11c0a}'..='\u{11c36}', '\u{11c38}'..='\u{11c3e}',
- '\u{11c40}'..='\u{11c40}', '\u{11c72}'..='\u{11c8f}', '\u{11c92}'..='\u{11ca7}',
- '\u{11ca9}'..='\u{11cb6}', '\u{11d00}'..='\u{11d06}', '\u{11d08}'..='\u{11d09}',
- '\u{11d0b}'..='\u{11d36}', '\u{11d3a}'..='\u{11d3a}', '\u{11d3c}'..='\u{11d3d}',
- '\u{11d3f}'..='\u{11d41}', '\u{11d43}'..='\u{11d43}', '\u{11d46}'..='\u{11d47}',
- '\u{11d60}'..='\u{11d65}', '\u{11d67}'..='\u{11d68}', '\u{11d6a}'..='\u{11d8e}',
- '\u{11d90}'..='\u{11d91}', '\u{11d93}'..='\u{11d96}', '\u{11d98}'..='\u{11d98}',
- '\u{11db0}'..='\u{11ddb}', '\u{11ee0}'..='\u{11ef6}', '\u{11f00}'..='\u{11f10}',
- '\u{11f12}'..='\u{11f3a}', '\u{11f3e}'..='\u{11f40}', '\u{11fb0}'..='\u{11fb0}',
- '\u{12000}'..='\u{12399}', '\u{12400}'..='\u{1246e}', '\u{12480}'..='\u{12543}',
- '\u{12f90}'..='\u{12ff0}', '\u{13000}'..='\u{1342f}', '\u{13441}'..='\u{13446}',
- '\u{13460}'..='\u{143fa}', '\u{14400}'..='\u{14646}', '\u{16100}'..='\u{1612e}',
- '\u{16800}'..='\u{16a38}', '\u{16a40}'..='\u{16a5e}', '\u{16a70}'..='\u{16abe}',
- '\u{16ad0}'..='\u{16aed}', '\u{16b00}'..='\u{16b2f}', '\u{16b40}'..='\u{16b43}',
- '\u{16b63}'..='\u{16b77}', '\u{16b7d}'..='\u{16b8f}', '\u{16d40}'..='\u{16d6c}',
- '\u{16e40}'..='\u{16e7f}', '\u{16ea0}'..='\u{16eb8}', '\u{16ebb}'..='\u{16ed3}',
- '\u{16f00}'..='\u{16f4a}', '\u{16f4f}'..='\u{16f87}', '\u{16f8f}'..='\u{16f9f}',
- '\u{16fe0}'..='\u{16fe1}', '\u{16fe3}'..='\u{16fe3}', '\u{16ff0}'..='\u{16ff6}',
- '\u{17000}'..='\u{18cd5}', '\u{18cff}'..='\u{18d1e}', '\u{18d80}'..='\u{18df2}',
- '\u{1aff0}'..='\u{1aff3}', '\u{1aff5}'..='\u{1affb}', '\u{1affd}'..='\u{1affe}',
- '\u{1b000}'..='\u{1b122}', '\u{1b132}'..='\u{1b132}', '\u{1b150}'..='\u{1b152}',
- '\u{1b155}'..='\u{1b155}', '\u{1b164}'..='\u{1b167}', '\u{1b170}'..='\u{1b2fb}',
- '\u{1bc00}'..='\u{1bc6a}', '\u{1bc70}'..='\u{1bc7c}', '\u{1bc80}'..='\u{1bc88}',
- '\u{1bc90}'..='\u{1bc99}', '\u{1bc9e}'..='\u{1bc9e}', '\u{1d400}'..='\u{1d454}',
- '\u{1d456}'..='\u{1d49c}', '\u{1d49e}'..='\u{1d49f}', '\u{1d4a2}'..='\u{1d4a2}',
- '\u{1d4a5}'..='\u{1d4a6}', '\u{1d4a9}'..='\u{1d4ac}', '\u{1d4ae}'..='\u{1d4b9}',
- '\u{1d4bb}'..='\u{1d4bb}', '\u{1d4bd}'..='\u{1d4c3}', '\u{1d4c5}'..='\u{1d505}',
- '\u{1d507}'..='\u{1d50a}', '\u{1d50d}'..='\u{1d514}', '\u{1d516}'..='\u{1d51c}',
- '\u{1d51e}'..='\u{1d539}', '\u{1d53b}'..='\u{1d53e}', '\u{1d540}'..='\u{1d544}',
- '\u{1d546}'..='\u{1d546}', '\u{1d54a}'..='\u{1d550}', '\u{1d552}'..='\u{1d6a5}',
- '\u{1d6a8}'..='\u{1d6c0}', '\u{1d6c2}'..='\u{1d6da}', '\u{1d6dc}'..='\u{1d6fa}',
- '\u{1d6fc}'..='\u{1d714}', '\u{1d716}'..='\u{1d734}', '\u{1d736}'..='\u{1d74e}',
- '\u{1d750}'..='\u{1d76e}', '\u{1d770}'..='\u{1d788}', '\u{1d78a}'..='\u{1d7a8}',
- '\u{1d7aa}'..='\u{1d7c2}', '\u{1d7c4}'..='\u{1d7cb}', '\u{1df00}'..='\u{1df1e}',
- '\u{1df25}'..='\u{1df2a}', '\u{1e000}'..='\u{1e006}', '\u{1e008}'..='\u{1e018}',
- '\u{1e01b}'..='\u{1e021}', '\u{1e023}'..='\u{1e024}', '\u{1e026}'..='\u{1e02a}',
- '\u{1e030}'..='\u{1e06d}', '\u{1e08f}'..='\u{1e08f}', '\u{1e100}'..='\u{1e12c}',
- '\u{1e137}'..='\u{1e13d}', '\u{1e14e}'..='\u{1e14e}', '\u{1e290}'..='\u{1e2ad}',
- '\u{1e2c0}'..='\u{1e2eb}', '\u{1e4d0}'..='\u{1e4eb}', '\u{1e5d0}'..='\u{1e5ed}',
- '\u{1e5f0}'..='\u{1e5f0}', '\u{1e6c0}'..='\u{1e6de}', '\u{1e6e0}'..='\u{1e6f5}',
- '\u{1e6fe}'..='\u{1e6ff}', '\u{1e7e0}'..='\u{1e7e6}', '\u{1e7e8}'..='\u{1e7eb}',
- '\u{1e7ed}'..='\u{1e7ee}', '\u{1e7f0}'..='\u{1e7fe}', '\u{1e800}'..='\u{1e8c4}',
- '\u{1e900}'..='\u{1e943}', '\u{1e947}'..='\u{1e947}', '\u{1e94b}'..='\u{1e94b}',
- '\u{1ee00}'..='\u{1ee03}', '\u{1ee05}'..='\u{1ee1f}', '\u{1ee21}'..='\u{1ee22}',
- '\u{1ee24}'..='\u{1ee24}', '\u{1ee27}'..='\u{1ee27}', '\u{1ee29}'..='\u{1ee32}',
- '\u{1ee34}'..='\u{1ee37}', '\u{1ee39}'..='\u{1ee39}', '\u{1ee3b}'..='\u{1ee3b}',
- '\u{1ee42}'..='\u{1ee42}', '\u{1ee47}'..='\u{1ee47}', '\u{1ee49}'..='\u{1ee49}',
- '\u{1ee4b}'..='\u{1ee4b}', '\u{1ee4d}'..='\u{1ee4f}', '\u{1ee51}'..='\u{1ee52}',
- '\u{1ee54}'..='\u{1ee54}', '\u{1ee57}'..='\u{1ee57}', '\u{1ee59}'..='\u{1ee59}',
- '\u{1ee5b}'..='\u{1ee5b}', '\u{1ee5d}'..='\u{1ee5d}', '\u{1ee5f}'..='\u{1ee5f}',
- '\u{1ee61}'..='\u{1ee62}', '\u{1ee64}'..='\u{1ee64}', '\u{1ee67}'..='\u{1ee6a}',
- '\u{1ee6c}'..='\u{1ee72}', '\u{1ee74}'..='\u{1ee77}', '\u{1ee79}'..='\u{1ee7c}',
- '\u{1ee7e}'..='\u{1ee7e}', '\u{1ee80}'..='\u{1ee89}', '\u{1ee8b}'..='\u{1ee9b}',
- '\u{1eea1}'..='\u{1eea3}', '\u{1eea5}'..='\u{1eea9}', '\u{1eeab}'..='\u{1eebb}',
- '\u{1f130}'..='\u{1f149}', '\u{1f150}'..='\u{1f169}', '\u{1f170}'..='\u{1f189}',
- '\u{20000}'..='\u{2a6df}', '\u{2a700}'..='\u{2b81d}', '\u{2b820}'..='\u{2cead}',
- '\u{2ceb0}'..='\u{2ebe0}', '\u{2ebf0}'..='\u{2ee5d}', '\u{2f800}'..='\u{2fa1d}',
- '\u{30000}'..='\u{3134a}', '\u{31350}'..='\u{33479}',
-];
-
-#[rustfmt::skip]
-pub(super) static CASE_IGNORABLE: &[RangeInclusive<char>; 459] = &[
- '\u{a8}'..='\u{a8}', '\u{ad}'..='\u{ad}', '\u{af}'..='\u{af}', '\u{b4}'..='\u{b4}',
- '\u{b7}'..='\u{b8}', '\u{2b0}'..='\u{36f}', '\u{374}'..='\u{375}', '\u{37a}'..='\u{37a}',
- '\u{384}'..='\u{385}', '\u{387}'..='\u{387}', '\u{483}'..='\u{489}', '\u{559}'..='\u{559}',
- '\u{55f}'..='\u{55f}', '\u{591}'..='\u{5bd}', '\u{5bf}'..='\u{5bf}', '\u{5c1}'..='\u{5c2}',
- '\u{5c4}'..='\u{5c5}', '\u{5c7}'..='\u{5c7}', '\u{5f4}'..='\u{5f4}', '\u{600}'..='\u{605}',
- '\u{610}'..='\u{61a}', '\u{61c}'..='\u{61c}', '\u{640}'..='\u{640}', '\u{64b}'..='\u{65f}',
- '\u{670}'..='\u{670}', '\u{6d6}'..='\u{6dd}', '\u{6df}'..='\u{6e8}', '\u{6ea}'..='\u{6ed}',
- '\u{70f}'..='\u{70f}', '\u{711}'..='\u{711}', '\u{730}'..='\u{74a}', '\u{7a6}'..='\u{7b0}',
- '\u{7eb}'..='\u{7f5}', '\u{7fa}'..='\u{7fa}', '\u{7fd}'..='\u{7fd}', '\u{816}'..='\u{82d}',
- '\u{859}'..='\u{85b}', '\u{888}'..='\u{888}', '\u{890}'..='\u{891}', '\u{897}'..='\u{89f}',
- '\u{8c9}'..='\u{902}', '\u{93a}'..='\u{93a}', '\u{93c}'..='\u{93c}', '\u{941}'..='\u{948}',
- '\u{94d}'..='\u{94d}', '\u{951}'..='\u{957}', '\u{962}'..='\u{963}', '\u{971}'..='\u{971}',
- '\u{981}'..='\u{981}', '\u{9bc}'..='\u{9bc}', '\u{9c1}'..='\u{9c4}', '\u{9cd}'..='\u{9cd}',
- '\u{9e2}'..='\u{9e3}', '\u{9fe}'..='\u{9fe}', '\u{a01}'..='\u{a02}', '\u{a3c}'..='\u{a3c}',
- '\u{a41}'..='\u{a42}', '\u{a47}'..='\u{a48}', '\u{a4b}'..='\u{a4d}', '\u{a51}'..='\u{a51}',
- '\u{a70}'..='\u{a71}', '\u{a75}'..='\u{a75}', '\u{a81}'..='\u{a82}', '\u{abc}'..='\u{abc}',
- '\u{ac1}'..='\u{ac5}', '\u{ac7}'..='\u{ac8}', '\u{acd}'..='\u{acd}', '\u{ae2}'..='\u{ae3}',
- '\u{afa}'..='\u{aff}', '\u{b01}'..='\u{b01}', '\u{b3c}'..='\u{b3c}', '\u{b3f}'..='\u{b3f}',
- '\u{b41}'..='\u{b44}', '\u{b4d}'..='\u{b4d}', '\u{b55}'..='\u{b56}', '\u{b62}'..='\u{b63}',
- '\u{b82}'..='\u{b82}', '\u{bc0}'..='\u{bc0}', '\u{bcd}'..='\u{bcd}', '\u{c00}'..='\u{c00}',
- '\u{c04}'..='\u{c04}', '\u{c3c}'..='\u{c3c}', '\u{c3e}'..='\u{c40}', '\u{c46}'..='\u{c48}',
- '\u{c4a}'..='\u{c4d}', '\u{c55}'..='\u{c56}', '\u{c62}'..='\u{c63}', '\u{c81}'..='\u{c81}',
- '\u{cbc}'..='\u{cbc}', '\u{cbf}'..='\u{cbf}', '\u{cc6}'..='\u{cc6}', '\u{ccc}'..='\u{ccd}',
- '\u{ce2}'..='\u{ce3}', '\u{d00}'..='\u{d01}', '\u{d3b}'..='\u{d3c}', '\u{d41}'..='\u{d44}',
- '\u{d4d}'..='\u{d4d}', '\u{d62}'..='\u{d63}', '\u{d81}'..='\u{d81}', '\u{dca}'..='\u{dca}',
- '\u{dd2}'..='\u{dd4}', '\u{dd6}'..='\u{dd6}', '\u{e31}'..='\u{e31}', '\u{e34}'..='\u{e3a}',
- '\u{e46}'..='\u{e4e}', '\u{eb1}'..='\u{eb1}', '\u{eb4}'..='\u{ebc}', '\u{ec6}'..='\u{ec6}',
- '\u{ec8}'..='\u{ece}', '\u{f18}'..='\u{f19}', '\u{f35}'..='\u{f35}', '\u{f37}'..='\u{f37}',
- '\u{f39}'..='\u{f39}', '\u{f71}'..='\u{f7e}', '\u{f80}'..='\u{f84}', '\u{f86}'..='\u{f87}',
- '\u{f8d}'..='\u{f97}', '\u{f99}'..='\u{fbc}', '\u{fc6}'..='\u{fc6}',
- '\u{102d}'..='\u{1030}', '\u{1032}'..='\u{1037}', '\u{1039}'..='\u{103a}',
- '\u{103d}'..='\u{103e}', '\u{1058}'..='\u{1059}', '\u{105e}'..='\u{1060}',
- '\u{1071}'..='\u{1074}', '\u{1082}'..='\u{1082}', '\u{1085}'..='\u{1086}',
- '\u{108d}'..='\u{108d}', '\u{109d}'..='\u{109d}', '\u{10fc}'..='\u{10fc}',
- '\u{135d}'..='\u{135f}', '\u{1712}'..='\u{1714}', '\u{1732}'..='\u{1733}',
- '\u{1752}'..='\u{1753}', '\u{1772}'..='\u{1773}', '\u{17b4}'..='\u{17b5}',
- '\u{17b7}'..='\u{17bd}', '\u{17c6}'..='\u{17c6}', '\u{17c9}'..='\u{17d3}',
- '\u{17d7}'..='\u{17d7}', '\u{17dd}'..='\u{17dd}', '\u{180b}'..='\u{180f}',
- '\u{1843}'..='\u{1843}', '\u{1885}'..='\u{1886}', '\u{18a9}'..='\u{18a9}',
- '\u{1920}'..='\u{1922}', '\u{1927}'..='\u{1928}', '\u{1932}'..='\u{1932}',
- '\u{1939}'..='\u{193b}', '\u{1a17}'..='\u{1a18}', '\u{1a1b}'..='\u{1a1b}',
- '\u{1a56}'..='\u{1a56}', '\u{1a58}'..='\u{1a5e}', '\u{1a60}'..='\u{1a60}',
- '\u{1a62}'..='\u{1a62}', '\u{1a65}'..='\u{1a6c}', '\u{1a73}'..='\u{1a7c}',
- '\u{1a7f}'..='\u{1a7f}', '\u{1aa7}'..='\u{1aa7}', '\u{1ab0}'..='\u{1add}',
- '\u{1ae0}'..='\u{1aeb}', '\u{1b00}'..='\u{1b03}', '\u{1b34}'..='\u{1b34}',
- '\u{1b36}'..='\u{1b3a}', '\u{1b3c}'..='\u{1b3c}', '\u{1b42}'..='\u{1b42}',
- '\u{1b6b}'..='\u{1b73}', '\u{1b80}'..='\u{1b81}', '\u{1ba2}'..='\u{1ba5}',
- '\u{1ba8}'..='\u{1ba9}', '\u{1bab}'..='\u{1bad}', '\u{1be6}'..='\u{1be6}',
- '\u{1be8}'..='\u{1be9}', '\u{1bed}'..='\u{1bed}', '\u{1bef}'..='\u{1bf1}',
- '\u{1c2c}'..='\u{1c33}', '\u{1c36}'..='\u{1c37}', '\u{1c78}'..='\u{1c7d}',
- '\u{1cd0}'..='\u{1cd2}', '\u{1cd4}'..='\u{1ce0}', '\u{1ce2}'..='\u{1ce8}',
- '\u{1ced}'..='\u{1ced}', '\u{1cf4}'..='\u{1cf4}', '\u{1cf8}'..='\u{1cf9}',
- '\u{1d2c}'..='\u{1d6a}', '\u{1d78}'..='\u{1d78}', '\u{1d9b}'..='\u{1dff}',
- '\u{1fbd}'..='\u{1fbd}', '\u{1fbf}'..='\u{1fc1}', '\u{1fcd}'..='\u{1fcf}',
- '\u{1fdd}'..='\u{1fdf}', '\u{1fed}'..='\u{1fef}', '\u{1ffd}'..='\u{1ffe}',
- '\u{200b}'..='\u{200f}', '\u{2018}'..='\u{2019}', '\u{2024}'..='\u{2024}',
- '\u{2027}'..='\u{2027}', '\u{202a}'..='\u{202e}', '\u{2060}'..='\u{2064}',
- '\u{2066}'..='\u{206f}', '\u{2071}'..='\u{2071}', '\u{207f}'..='\u{207f}',
- '\u{2090}'..='\u{209c}', '\u{20d0}'..='\u{20f0}', '\u{2c7c}'..='\u{2c7d}',
- '\u{2cef}'..='\u{2cf1}', '\u{2d6f}'..='\u{2d6f}', '\u{2d7f}'..='\u{2d7f}',
- '\u{2de0}'..='\u{2dff}', '\u{2e2f}'..='\u{2e2f}', '\u{3005}'..='\u{3005}',
- '\u{302a}'..='\u{302d}', '\u{3031}'..='\u{3035}', '\u{303b}'..='\u{303b}',
- '\u{3099}'..='\u{309e}', '\u{30fc}'..='\u{30fe}', '\u{a015}'..='\u{a015}',
- '\u{a4f8}'..='\u{a4fd}', '\u{a60c}'..='\u{a60c}', '\u{a66f}'..='\u{a672}',
- '\u{a674}'..='\u{a67d}', '\u{a67f}'..='\u{a67f}', '\u{a69c}'..='\u{a69f}',
- '\u{a6f0}'..='\u{a6f1}', '\u{a700}'..='\u{a721}', '\u{a770}'..='\u{a770}',
- '\u{a788}'..='\u{a78a}', '\u{a7f1}'..='\u{a7f4}', '\u{a7f8}'..='\u{a7f9}',
- '\u{a802}'..='\u{a802}', '\u{a806}'..='\u{a806}', '\u{a80b}'..='\u{a80b}',
- '\u{a825}'..='\u{a826}', '\u{a82c}'..='\u{a82c}', '\u{a8c4}'..='\u{a8c5}',
- '\u{a8e0}'..='\u{a8f1}', '\u{a8ff}'..='\u{a8ff}', '\u{a926}'..='\u{a92d}',
- '\u{a947}'..='\u{a951}', '\u{a980}'..='\u{a982}', '\u{a9b3}'..='\u{a9b3}',
- '\u{a9b6}'..='\u{a9b9}', '\u{a9bc}'..='\u{a9bd}', '\u{a9cf}'..='\u{a9cf}',
- '\u{a9e5}'..='\u{a9e6}', '\u{aa29}'..='\u{aa2e}', '\u{aa31}'..='\u{aa32}',
- '\u{aa35}'..='\u{aa36}', '\u{aa43}'..='\u{aa43}', '\u{aa4c}'..='\u{aa4c}',
- '\u{aa70}'..='\u{aa70}', '\u{aa7c}'..='\u{aa7c}', '\u{aab0}'..='\u{aab0}',
- '\u{aab2}'..='\u{aab4}', '\u{aab7}'..='\u{aab8}', '\u{aabe}'..='\u{aabf}',
- '\u{aac1}'..='\u{aac1}', '\u{aadd}'..='\u{aadd}', '\u{aaec}'..='\u{aaed}',
- '\u{aaf3}'..='\u{aaf4}', '\u{aaf6}'..='\u{aaf6}', '\u{ab5b}'..='\u{ab5f}',
- '\u{ab69}'..='\u{ab6b}', '\u{abe5}'..='\u{abe5}', '\u{abe8}'..='\u{abe8}',
- '\u{abed}'..='\u{abed}', '\u{fb1e}'..='\u{fb1e}', '\u{fbb2}'..='\u{fbc2}',
- '\u{fe00}'..='\u{fe0f}', '\u{fe13}'..='\u{fe13}', '\u{fe20}'..='\u{fe2f}',
- '\u{fe52}'..='\u{fe52}', '\u{fe55}'..='\u{fe55}', '\u{feff}'..='\u{feff}',
- '\u{ff07}'..='\u{ff07}', '\u{ff0e}'..='\u{ff0e}', '\u{ff1a}'..='\u{ff1a}',
- '\u{ff3e}'..='\u{ff3e}', '\u{ff40}'..='\u{ff40}', '\u{ff70}'..='\u{ff70}',
- '\u{ff9e}'..='\u{ff9f}', '\u{ffe3}'..='\u{ffe3}', '\u{fff9}'..='\u{fffb}',
- '\u{101fd}'..='\u{101fd}', '\u{102e0}'..='\u{102e0}', '\u{10376}'..='\u{1037a}',
- '\u{10780}'..='\u{10785}', '\u{10787}'..='\u{107b0}', '\u{107b2}'..='\u{107ba}',
- '\u{10a01}'..='\u{10a03}', '\u{10a05}'..='\u{10a06}', '\u{10a0c}'..='\u{10a0f}',
- '\u{10a38}'..='\u{10a3a}', '\u{10a3f}'..='\u{10a3f}', '\u{10ae5}'..='\u{10ae6}',
- '\u{10d24}'..='\u{10d27}', '\u{10d4e}'..='\u{10d4e}', '\u{10d69}'..='\u{10d6d}',
- '\u{10d6f}'..='\u{10d6f}', '\u{10eab}'..='\u{10eac}', '\u{10ec5}'..='\u{10ec5}',
- '\u{10efa}'..='\u{10eff}', '\u{10f46}'..='\u{10f50}', '\u{10f82}'..='\u{10f85}',
- '\u{11001}'..='\u{11001}', '\u{11038}'..='\u{11046}', '\u{11070}'..='\u{11070}',
- '\u{11073}'..='\u{11074}', '\u{1107f}'..='\u{11081}', '\u{110b3}'..='\u{110b6}',
- '\u{110b9}'..='\u{110ba}', '\u{110bd}'..='\u{110bd}', '\u{110c2}'..='\u{110c2}',
- '\u{110cd}'..='\u{110cd}', '\u{11100}'..='\u{11102}', '\u{11127}'..='\u{1112b}',
- '\u{1112d}'..='\u{11134}', '\u{11173}'..='\u{11173}', '\u{11180}'..='\u{11181}',
- '\u{111b6}'..='\u{111be}', '\u{111c9}'..='\u{111cc}', '\u{111cf}'..='\u{111cf}',
- '\u{1122f}'..='\u{11231}', '\u{11234}'..='\u{11234}', '\u{11236}'..='\u{11237}',
- '\u{1123e}'..='\u{1123e}', '\u{11241}'..='\u{11241}', '\u{112df}'..='\u{112df}',
- '\u{112e3}'..='\u{112ea}', '\u{11300}'..='\u{11301}', '\u{1133b}'..='\u{1133c}',
- '\u{11340}'..='\u{11340}', '\u{11366}'..='\u{1136c}', '\u{11370}'..='\u{11374}',
- '\u{113bb}'..='\u{113c0}', '\u{113ce}'..='\u{113ce}', '\u{113d0}'..='\u{113d0}',
- '\u{113d2}'..='\u{113d2}', '\u{113e1}'..='\u{113e2}', '\u{11438}'..='\u{1143f}',
- '\u{11442}'..='\u{11444}', '\u{11446}'..='\u{11446}', '\u{1145e}'..='\u{1145e}',
- '\u{114b3}'..='\u{114b8}', '\u{114ba}'..='\u{114ba}', '\u{114bf}'..='\u{114c0}',
- '\u{114c2}'..='\u{114c3}', '\u{115b2}'..='\u{115b5}', '\u{115bc}'..='\u{115bd}',
- '\u{115bf}'..='\u{115c0}', '\u{115dc}'..='\u{115dd}', '\u{11633}'..='\u{1163a}',
- '\u{1163d}'..='\u{1163d}', '\u{1163f}'..='\u{11640}', '\u{116ab}'..='\u{116ab}',
- '\u{116ad}'..='\u{116ad}', '\u{116b0}'..='\u{116b5}', '\u{116b7}'..='\u{116b7}',
- '\u{1171d}'..='\u{1171d}', '\u{1171f}'..='\u{1171f}', '\u{11722}'..='\u{11725}',
- '\u{11727}'..='\u{1172b}', '\u{1182f}'..='\u{11837}', '\u{11839}'..='\u{1183a}',
- '\u{1193b}'..='\u{1193c}', '\u{1193e}'..='\u{1193e}', '\u{11943}'..='\u{11943}',
- '\u{119d4}'..='\u{119d7}', '\u{119da}'..='\u{119db}', '\u{119e0}'..='\u{119e0}',
- '\u{11a01}'..='\u{11a0a}', '\u{11a33}'..='\u{11a38}', '\u{11a3b}'..='\u{11a3e}',
- '\u{11a47}'..='\u{11a47}', '\u{11a51}'..='\u{11a56}', '\u{11a59}'..='\u{11a5b}',
- '\u{11a8a}'..='\u{11a96}', '\u{11a98}'..='\u{11a99}', '\u{11b60}'..='\u{11b60}',
- '\u{11b62}'..='\u{11b64}', '\u{11b66}'..='\u{11b66}', '\u{11c30}'..='\u{11c36}',
- '\u{11c38}'..='\u{11c3d}', '\u{11c3f}'..='\u{11c3f}', '\u{11c92}'..='\u{11ca7}',
- '\u{11caa}'..='\u{11cb0}', '\u{11cb2}'..='\u{11cb3}', '\u{11cb5}'..='\u{11cb6}',
- '\u{11d31}'..='\u{11d36}', '\u{11d3a}'..='\u{11d3a}', '\u{11d3c}'..='\u{11d3d}',
- '\u{11d3f}'..='\u{11d45}', '\u{11d47}'..='\u{11d47}', '\u{11d90}'..='\u{11d91}',
- '\u{11d95}'..='\u{11d95}', '\u{11d97}'..='\u{11d97}', '\u{11dd9}'..='\u{11dd9}',
- '\u{11ef3}'..='\u{11ef4}', '\u{11f00}'..='\u{11f01}', '\u{11f36}'..='\u{11f3a}',
- '\u{11f40}'..='\u{11f40}', '\u{11f42}'..='\u{11f42}', '\u{11f5a}'..='\u{11f5a}',
- '\u{13430}'..='\u{13440}', '\u{13447}'..='\u{13455}', '\u{1611e}'..='\u{16129}',
- '\u{1612d}'..='\u{1612f}', '\u{16af0}'..='\u{16af4}', '\u{16b30}'..='\u{16b36}',
- '\u{16b40}'..='\u{16b43}', '\u{16d40}'..='\u{16d42}', '\u{16d6b}'..='\u{16d6c}',
- '\u{16f4f}'..='\u{16f4f}', '\u{16f8f}'..='\u{16f9f}', '\u{16fe0}'..='\u{16fe1}',
- '\u{16fe3}'..='\u{16fe4}', '\u{16ff2}'..='\u{16ff3}', '\u{1aff0}'..='\u{1aff3}',
- '\u{1aff5}'..='\u{1affb}', '\u{1affd}'..='\u{1affe}', '\u{1bc9d}'..='\u{1bc9e}',
- '\u{1bca0}'..='\u{1bca3}', '\u{1cf00}'..='\u{1cf2d}', '\u{1cf30}'..='\u{1cf46}',
- '\u{1d167}'..='\u{1d169}', '\u{1d173}'..='\u{1d182}', '\u{1d185}'..='\u{1d18b}',
- '\u{1d1aa}'..='\u{1d1ad}', '\u{1d242}'..='\u{1d244}', '\u{1da00}'..='\u{1da36}',
- '\u{1da3b}'..='\u{1da6c}', '\u{1da75}'..='\u{1da75}', '\u{1da84}'..='\u{1da84}',
- '\u{1da9b}'..='\u{1da9f}', '\u{1daa1}'..='\u{1daaf}', '\u{1e000}'..='\u{1e006}',
- '\u{1e008}'..='\u{1e018}', '\u{1e01b}'..='\u{1e021}', '\u{1e023}'..='\u{1e024}',
- '\u{1e026}'..='\u{1e02a}', '\u{1e030}'..='\u{1e06d}', '\u{1e08f}'..='\u{1e08f}',
- '\u{1e130}'..='\u{1e13d}', '\u{1e2ae}'..='\u{1e2ae}', '\u{1e2ec}'..='\u{1e2ef}',
- '\u{1e4eb}'..='\u{1e4ef}', '\u{1e5ee}'..='\u{1e5ef}', '\u{1e6e3}'..='\u{1e6e3}',
- '\u{1e6e6}'..='\u{1e6e6}', '\u{1e6ee}'..='\u{1e6ef}', '\u{1e6f5}'..='\u{1e6f5}',
- '\u{1e6ff}'..='\u{1e6ff}', '\u{1e8d0}'..='\u{1e8d6}', '\u{1e944}'..='\u{1e94b}',
- '\u{1f3fb}'..='\u{1f3ff}', '\u{e0001}'..='\u{e0001}', '\u{e0020}'..='\u{e007f}',
- '\u{e0100}'..='\u{e01ef}',
-];
-
-#[rustfmt::skip]
-pub(super) static CASED: &[RangeInclusive<char>; 156] = &[
- '\u{aa}'..='\u{aa}', '\u{b5}'..='\u{b5}', '\u{ba}'..='\u{ba}', '\u{c0}'..='\u{d6}',
- '\u{d8}'..='\u{f6}', '\u{f8}'..='\u{1ba}', '\u{1bc}'..='\u{1bf}', '\u{1c4}'..='\u{293}',
- '\u{296}'..='\u{2b8}', '\u{2c0}'..='\u{2c1}', '\u{2e0}'..='\u{2e4}', '\u{345}'..='\u{345}',
- '\u{370}'..='\u{373}', '\u{376}'..='\u{377}', '\u{37a}'..='\u{37d}', '\u{37f}'..='\u{37f}',
- '\u{386}'..='\u{386}', '\u{388}'..='\u{38a}', '\u{38c}'..='\u{38c}', '\u{38e}'..='\u{3a1}',
- '\u{3a3}'..='\u{3f5}', '\u{3f7}'..='\u{481}', '\u{48a}'..='\u{52f}', '\u{531}'..='\u{556}',
- '\u{560}'..='\u{588}', '\u{10a0}'..='\u{10c5}', '\u{10c7}'..='\u{10c7}',
- '\u{10cd}'..='\u{10cd}', '\u{10d0}'..='\u{10fa}', '\u{10fc}'..='\u{10ff}',
- '\u{13a0}'..='\u{13f5}', '\u{13f8}'..='\u{13fd}', '\u{1c80}'..='\u{1c8a}',
- '\u{1c90}'..='\u{1cba}', '\u{1cbd}'..='\u{1cbf}', '\u{1d00}'..='\u{1dbf}',
- '\u{1e00}'..='\u{1f15}', '\u{1f18}'..='\u{1f1d}', '\u{1f20}'..='\u{1f45}',
- '\u{1f48}'..='\u{1f4d}', '\u{1f50}'..='\u{1f57}', '\u{1f59}'..='\u{1f59}',
- '\u{1f5b}'..='\u{1f5b}', '\u{1f5d}'..='\u{1f5d}', '\u{1f5f}'..='\u{1f7d}',
- '\u{1f80}'..='\u{1fb4}', '\u{1fb6}'..='\u{1fbc}', '\u{1fbe}'..='\u{1fbe}',
- '\u{1fc2}'..='\u{1fc4}', '\u{1fc6}'..='\u{1fcc}', '\u{1fd0}'..='\u{1fd3}',
- '\u{1fd6}'..='\u{1fdb}', '\u{1fe0}'..='\u{1fec}', '\u{1ff2}'..='\u{1ff4}',
- '\u{1ff6}'..='\u{1ffc}', '\u{2071}'..='\u{2071}', '\u{207f}'..='\u{207f}',
- '\u{2090}'..='\u{209c}', '\u{2102}'..='\u{2102}', '\u{2107}'..='\u{2107}',
- '\u{210a}'..='\u{2113}', '\u{2115}'..='\u{2115}', '\u{2119}'..='\u{211d}',
- '\u{2124}'..='\u{2124}', '\u{2126}'..='\u{2126}', '\u{2128}'..='\u{2128}',
- '\u{212a}'..='\u{212d}', '\u{212f}'..='\u{2134}', '\u{2139}'..='\u{2139}',
- '\u{213c}'..='\u{213f}', '\u{2145}'..='\u{2149}', '\u{214e}'..='\u{214e}',
- '\u{2160}'..='\u{217f}', '\u{2183}'..='\u{2184}', '\u{24b6}'..='\u{24e9}',
- '\u{2c00}'..='\u{2ce4}', '\u{2ceb}'..='\u{2cee}', '\u{2cf2}'..='\u{2cf3}',
- '\u{2d00}'..='\u{2d25}', '\u{2d27}'..='\u{2d27}', '\u{2d2d}'..='\u{2d2d}',
- '\u{a640}'..='\u{a66d}', '\u{a680}'..='\u{a69d}', '\u{a722}'..='\u{a787}',
- '\u{a78b}'..='\u{a78e}', '\u{a790}'..='\u{a7dc}', '\u{a7f1}'..='\u{a7f6}',
- '\u{a7f8}'..='\u{a7fa}', '\u{ab30}'..='\u{ab5a}', '\u{ab5c}'..='\u{ab69}',
- '\u{ab70}'..='\u{abbf}', '\u{fb00}'..='\u{fb06}', '\u{fb13}'..='\u{fb17}',
- '\u{ff21}'..='\u{ff3a}', '\u{ff41}'..='\u{ff5a}', '\u{10400}'..='\u{1044f}',
- '\u{104b0}'..='\u{104d3}', '\u{104d8}'..='\u{104fb}', '\u{10570}'..='\u{1057a}',
- '\u{1057c}'..='\u{1058a}', '\u{1058c}'..='\u{10592}', '\u{10594}'..='\u{10595}',
- '\u{10597}'..='\u{105a1}', '\u{105a3}'..='\u{105b1}', '\u{105b3}'..='\u{105b9}',
- '\u{105bb}'..='\u{105bc}', '\u{10780}'..='\u{10780}', '\u{10783}'..='\u{10785}',
- '\u{10787}'..='\u{107b0}', '\u{107b2}'..='\u{107ba}', '\u{10c80}'..='\u{10cb2}',
- '\u{10cc0}'..='\u{10cf2}', '\u{10d50}'..='\u{10d65}', '\u{10d70}'..='\u{10d85}',
- '\u{118a0}'..='\u{118df}', '\u{16e40}'..='\u{16e7f}', '\u{16ea0}'..='\u{16eb8}',
- '\u{16ebb}'..='\u{16ed3}', '\u{1d400}'..='\u{1d454}', '\u{1d456}'..='\u{1d49c}',
- '\u{1d49e}'..='\u{1d49f}', '\u{1d4a2}'..='\u{1d4a2}', '\u{1d4a5}'..='\u{1d4a6}',
- '\u{1d4a9}'..='\u{1d4ac}', '\u{1d4ae}'..='\u{1d4b9}', '\u{1d4bb}'..='\u{1d4bb}',
- '\u{1d4bd}'..='\u{1d4c3}', '\u{1d4c5}'..='\u{1d505}', '\u{1d507}'..='\u{1d50a}',
- '\u{1d50d}'..='\u{1d514}', '\u{1d516}'..='\u{1d51c}', '\u{1d51e}'..='\u{1d539}',
- '\u{1d53b}'..='\u{1d53e}', '\u{1d540}'..='\u{1d544}', '\u{1d546}'..='\u{1d546}',
- '\u{1d54a}'..='\u{1d550}', '\u{1d552}'..='\u{1d6a5}', '\u{1d6a8}'..='\u{1d6c0}',
- '\u{1d6c2}'..='\u{1d6da}', '\u{1d6dc}'..='\u{1d6fa}', '\u{1d6fc}'..='\u{1d714}',
- '\u{1d716}'..='\u{1d734}', '\u{1d736}'..='\u{1d74e}', '\u{1d750}'..='\u{1d76e}',
- '\u{1d770}'..='\u{1d788}', '\u{1d78a}'..='\u{1d7a8}', '\u{1d7aa}'..='\u{1d7c2}',
- '\u{1d7c4}'..='\u{1d7cb}', '\u{1df00}'..='\u{1df09}', '\u{1df0b}'..='\u{1df1e}',
- '\u{1df25}'..='\u{1df2a}', '\u{1e030}'..='\u{1e06d}', '\u{1e900}'..='\u{1e943}',
- '\u{1f130}'..='\u{1f149}', '\u{1f150}'..='\u{1f169}', '\u{1f170}'..='\u{1f189}',
-];
-
-#[rustfmt::skip]
-pub(super) static GRAPHEME_EXTEND: &[RangeInclusive<char>; 383] = &[
- '\u{300}'..='\u{36f}', '\u{483}'..='\u{489}', '\u{591}'..='\u{5bd}', '\u{5bf}'..='\u{5bf}',
- '\u{5c1}'..='\u{5c2}', '\u{5c4}'..='\u{5c5}', '\u{5c7}'..='\u{5c7}', '\u{610}'..='\u{61a}',
- '\u{64b}'..='\u{65f}', '\u{670}'..='\u{670}', '\u{6d6}'..='\u{6dc}', '\u{6df}'..='\u{6e4}',
- '\u{6e7}'..='\u{6e8}', '\u{6ea}'..='\u{6ed}', '\u{711}'..='\u{711}', '\u{730}'..='\u{74a}',
- '\u{7a6}'..='\u{7b0}', '\u{7eb}'..='\u{7f3}', '\u{7fd}'..='\u{7fd}', '\u{816}'..='\u{819}',
- '\u{81b}'..='\u{823}', '\u{825}'..='\u{827}', '\u{829}'..='\u{82d}', '\u{859}'..='\u{85b}',
- '\u{897}'..='\u{89f}', '\u{8ca}'..='\u{8e1}', '\u{8e3}'..='\u{902}', '\u{93a}'..='\u{93a}',
- '\u{93c}'..='\u{93c}', '\u{941}'..='\u{948}', '\u{94d}'..='\u{94d}', '\u{951}'..='\u{957}',
- '\u{962}'..='\u{963}', '\u{981}'..='\u{981}', '\u{9bc}'..='\u{9bc}', '\u{9be}'..='\u{9be}',
- '\u{9c1}'..='\u{9c4}', '\u{9cd}'..='\u{9cd}', '\u{9d7}'..='\u{9d7}', '\u{9e2}'..='\u{9e3}',
- '\u{9fe}'..='\u{9fe}', '\u{a01}'..='\u{a02}', '\u{a3c}'..='\u{a3c}', '\u{a41}'..='\u{a42}',
- '\u{a47}'..='\u{a48}', '\u{a4b}'..='\u{a4d}', '\u{a51}'..='\u{a51}', '\u{a70}'..='\u{a71}',
- '\u{a75}'..='\u{a75}', '\u{a81}'..='\u{a82}', '\u{abc}'..='\u{abc}', '\u{ac1}'..='\u{ac5}',
- '\u{ac7}'..='\u{ac8}', '\u{acd}'..='\u{acd}', '\u{ae2}'..='\u{ae3}', '\u{afa}'..='\u{aff}',
- '\u{b01}'..='\u{b01}', '\u{b3c}'..='\u{b3c}', '\u{b3e}'..='\u{b3f}', '\u{b41}'..='\u{b44}',
- '\u{b4d}'..='\u{b4d}', '\u{b55}'..='\u{b57}', '\u{b62}'..='\u{b63}', '\u{b82}'..='\u{b82}',
- '\u{bbe}'..='\u{bbe}', '\u{bc0}'..='\u{bc0}', '\u{bcd}'..='\u{bcd}', '\u{bd7}'..='\u{bd7}',
- '\u{c00}'..='\u{c00}', '\u{c04}'..='\u{c04}', '\u{c3c}'..='\u{c3c}', '\u{c3e}'..='\u{c40}',
- '\u{c46}'..='\u{c48}', '\u{c4a}'..='\u{c4d}', '\u{c55}'..='\u{c56}', '\u{c62}'..='\u{c63}',
- '\u{c81}'..='\u{c81}', '\u{cbc}'..='\u{cbc}', '\u{cbf}'..='\u{cc0}', '\u{cc2}'..='\u{cc2}',
- '\u{cc6}'..='\u{cc8}', '\u{cca}'..='\u{ccd}', '\u{cd5}'..='\u{cd6}', '\u{ce2}'..='\u{ce3}',
- '\u{d00}'..='\u{d01}', '\u{d3b}'..='\u{d3c}', '\u{d3e}'..='\u{d3e}', '\u{d41}'..='\u{d44}',
- '\u{d4d}'..='\u{d4d}', '\u{d57}'..='\u{d57}', '\u{d62}'..='\u{d63}', '\u{d81}'..='\u{d81}',
- '\u{dca}'..='\u{dca}', '\u{dcf}'..='\u{dcf}', '\u{dd2}'..='\u{dd4}', '\u{dd6}'..='\u{dd6}',
- '\u{ddf}'..='\u{ddf}', '\u{e31}'..='\u{e31}', '\u{e34}'..='\u{e3a}', '\u{e47}'..='\u{e4e}',
- '\u{eb1}'..='\u{eb1}', '\u{eb4}'..='\u{ebc}', '\u{ec8}'..='\u{ece}', '\u{f18}'..='\u{f19}',
- '\u{f35}'..='\u{f35}', '\u{f37}'..='\u{f37}', '\u{f39}'..='\u{f39}', '\u{f71}'..='\u{f7e}',
- '\u{f80}'..='\u{f84}', '\u{f86}'..='\u{f87}', '\u{f8d}'..='\u{f97}', '\u{f99}'..='\u{fbc}',
- '\u{fc6}'..='\u{fc6}', '\u{102d}'..='\u{1030}', '\u{1032}'..='\u{1037}',
- '\u{1039}'..='\u{103a}', '\u{103d}'..='\u{103e}', '\u{1058}'..='\u{1059}',
- '\u{105e}'..='\u{1060}', '\u{1071}'..='\u{1074}', '\u{1082}'..='\u{1082}',
- '\u{1085}'..='\u{1086}', '\u{108d}'..='\u{108d}', '\u{109d}'..='\u{109d}',
- '\u{135d}'..='\u{135f}', '\u{1712}'..='\u{1715}', '\u{1732}'..='\u{1734}',
- '\u{1752}'..='\u{1753}', '\u{1772}'..='\u{1773}', '\u{17b4}'..='\u{17b5}',
- '\u{17b7}'..='\u{17bd}', '\u{17c6}'..='\u{17c6}', '\u{17c9}'..='\u{17d3}',
- '\u{17dd}'..='\u{17dd}', '\u{180b}'..='\u{180d}', '\u{180f}'..='\u{180f}',
- '\u{1885}'..='\u{1886}', '\u{18a9}'..='\u{18a9}', '\u{1920}'..='\u{1922}',
- '\u{1927}'..='\u{1928}', '\u{1932}'..='\u{1932}', '\u{1939}'..='\u{193b}',
- '\u{1a17}'..='\u{1a18}', '\u{1a1b}'..='\u{1a1b}', '\u{1a56}'..='\u{1a56}',
- '\u{1a58}'..='\u{1a5e}', '\u{1a60}'..='\u{1a60}', '\u{1a62}'..='\u{1a62}',
- '\u{1a65}'..='\u{1a6c}', '\u{1a73}'..='\u{1a7c}', '\u{1a7f}'..='\u{1a7f}',
- '\u{1ab0}'..='\u{1add}', '\u{1ae0}'..='\u{1aeb}', '\u{1b00}'..='\u{1b03}',
- '\u{1b34}'..='\u{1b3d}', '\u{1b42}'..='\u{1b44}', '\u{1b6b}'..='\u{1b73}',
- '\u{1b80}'..='\u{1b81}', '\u{1ba2}'..='\u{1ba5}', '\u{1ba8}'..='\u{1bad}',
- '\u{1be6}'..='\u{1be6}', '\u{1be8}'..='\u{1be9}', '\u{1bed}'..='\u{1bed}',
- '\u{1bef}'..='\u{1bf3}', '\u{1c2c}'..='\u{1c33}', '\u{1c36}'..='\u{1c37}',
- '\u{1cd0}'..='\u{1cd2}', '\u{1cd4}'..='\u{1ce0}', '\u{1ce2}'..='\u{1ce8}',
- '\u{1ced}'..='\u{1ced}', '\u{1cf4}'..='\u{1cf4}', '\u{1cf8}'..='\u{1cf9}',
- '\u{1dc0}'..='\u{1dff}', '\u{200c}'..='\u{200c}', '\u{20d0}'..='\u{20f0}',
- '\u{2cef}'..='\u{2cf1}', '\u{2d7f}'..='\u{2d7f}', '\u{2de0}'..='\u{2dff}',
- '\u{302a}'..='\u{302f}', '\u{3099}'..='\u{309a}', '\u{a66f}'..='\u{a672}',
- '\u{a674}'..='\u{a67d}', '\u{a69e}'..='\u{a69f}', '\u{a6f0}'..='\u{a6f1}',
- '\u{a802}'..='\u{a802}', '\u{a806}'..='\u{a806}', '\u{a80b}'..='\u{a80b}',
- '\u{a825}'..='\u{a826}', '\u{a82c}'..='\u{a82c}', '\u{a8c4}'..='\u{a8c5}',
- '\u{a8e0}'..='\u{a8f1}', '\u{a8ff}'..='\u{a8ff}', '\u{a926}'..='\u{a92d}',
- '\u{a947}'..='\u{a951}', '\u{a953}'..='\u{a953}', '\u{a980}'..='\u{a982}',
- '\u{a9b3}'..='\u{a9b3}', '\u{a9b6}'..='\u{a9b9}', '\u{a9bc}'..='\u{a9bd}',
- '\u{a9c0}'..='\u{a9c0}', '\u{a9e5}'..='\u{a9e5}', '\u{aa29}'..='\u{aa2e}',
- '\u{aa31}'..='\u{aa32}', '\u{aa35}'..='\u{aa36}', '\u{aa43}'..='\u{aa43}',
- '\u{aa4c}'..='\u{aa4c}', '\u{aa7c}'..='\u{aa7c}', '\u{aab0}'..='\u{aab0}',
- '\u{aab2}'..='\u{aab4}', '\u{aab7}'..='\u{aab8}', '\u{aabe}'..='\u{aabf}',
- '\u{aac1}'..='\u{aac1}', '\u{aaec}'..='\u{aaed}', '\u{aaf6}'..='\u{aaf6}',
- '\u{abe5}'..='\u{abe5}', '\u{abe8}'..='\u{abe8}', '\u{abed}'..='\u{abed}',
- '\u{fb1e}'..='\u{fb1e}', '\u{fe00}'..='\u{fe0f}', '\u{fe20}'..='\u{fe2f}',
- '\u{ff9e}'..='\u{ff9f}', '\u{101fd}'..='\u{101fd}', '\u{102e0}'..='\u{102e0}',
- '\u{10376}'..='\u{1037a}', '\u{10a01}'..='\u{10a03}', '\u{10a05}'..='\u{10a06}',
- '\u{10a0c}'..='\u{10a0f}', '\u{10a38}'..='\u{10a3a}', '\u{10a3f}'..='\u{10a3f}',
- '\u{10ae5}'..='\u{10ae6}', '\u{10d24}'..='\u{10d27}', '\u{10d69}'..='\u{10d6d}',
- '\u{10eab}'..='\u{10eac}', '\u{10efa}'..='\u{10eff}', '\u{10f46}'..='\u{10f50}',
- '\u{10f82}'..='\u{10f85}', '\u{11001}'..='\u{11001}', '\u{11038}'..='\u{11046}',
- '\u{11070}'..='\u{11070}', '\u{11073}'..='\u{11074}', '\u{1107f}'..='\u{11081}',
- '\u{110b3}'..='\u{110b6}', '\u{110b9}'..='\u{110ba}', '\u{110c2}'..='\u{110c2}',
- '\u{11100}'..='\u{11102}', '\u{11127}'..='\u{1112b}', '\u{1112d}'..='\u{11134}',
- '\u{11173}'..='\u{11173}', '\u{11180}'..='\u{11181}', '\u{111b6}'..='\u{111be}',
- '\u{111c0}'..='\u{111c0}', '\u{111c9}'..='\u{111cc}', '\u{111cf}'..='\u{111cf}',
- '\u{1122f}'..='\u{11231}', '\u{11234}'..='\u{11237}', '\u{1123e}'..='\u{1123e}',
- '\u{11241}'..='\u{11241}', '\u{112df}'..='\u{112df}', '\u{112e3}'..='\u{112ea}',
- '\u{11300}'..='\u{11301}', '\u{1133b}'..='\u{1133c}', '\u{1133e}'..='\u{1133e}',
- '\u{11340}'..='\u{11340}', '\u{1134d}'..='\u{1134d}', '\u{11357}'..='\u{11357}',
- '\u{11366}'..='\u{1136c}', '\u{11370}'..='\u{11374}', '\u{113b8}'..='\u{113b8}',
- '\u{113bb}'..='\u{113c0}', '\u{113c2}'..='\u{113c2}', '\u{113c5}'..='\u{113c5}',
- '\u{113c7}'..='\u{113c9}', '\u{113ce}'..='\u{113d0}', '\u{113d2}'..='\u{113d2}',
- '\u{113e1}'..='\u{113e2}', '\u{11438}'..='\u{1143f}', '\u{11442}'..='\u{11444}',
- '\u{11446}'..='\u{11446}', '\u{1145e}'..='\u{1145e}', '\u{114b0}'..='\u{114b0}',
- '\u{114b3}'..='\u{114b8}', '\u{114ba}'..='\u{114ba}', '\u{114bd}'..='\u{114bd}',
- '\u{114bf}'..='\u{114c0}', '\u{114c2}'..='\u{114c3}', '\u{115af}'..='\u{115af}',
- '\u{115b2}'..='\u{115b5}', '\u{115bc}'..='\u{115bd}', '\u{115bf}'..='\u{115c0}',
- '\u{115dc}'..='\u{115dd}', '\u{11633}'..='\u{1163a}', '\u{1163d}'..='\u{1163d}',
- '\u{1163f}'..='\u{11640}', '\u{116ab}'..='\u{116ab}', '\u{116ad}'..='\u{116ad}',
- '\u{116b0}'..='\u{116b7}', '\u{1171d}'..='\u{1171d}', '\u{1171f}'..='\u{1171f}',
- '\u{11722}'..='\u{11725}', '\u{11727}'..='\u{1172b}', '\u{1182f}'..='\u{11837}',
- '\u{11839}'..='\u{1183a}', '\u{11930}'..='\u{11930}', '\u{1193b}'..='\u{1193e}',
- '\u{11943}'..='\u{11943}', '\u{119d4}'..='\u{119d7}', '\u{119da}'..='\u{119db}',
- '\u{119e0}'..='\u{119e0}', '\u{11a01}'..='\u{11a0a}', '\u{11a33}'..='\u{11a38}',
- '\u{11a3b}'..='\u{11a3e}', '\u{11a47}'..='\u{11a47}', '\u{11a51}'..='\u{11a56}',
- '\u{11a59}'..='\u{11a5b}', '\u{11a8a}'..='\u{11a96}', '\u{11a98}'..='\u{11a99}',
- '\u{11b60}'..='\u{11b60}', '\u{11b62}'..='\u{11b64}', '\u{11b66}'..='\u{11b66}',
- '\u{11c30}'..='\u{11c36}', '\u{11c38}'..='\u{11c3d}', '\u{11c3f}'..='\u{11c3f}',
- '\u{11c92}'..='\u{11ca7}', '\u{11caa}'..='\u{11cb0}', '\u{11cb2}'..='\u{11cb3}',
- '\u{11cb5}'..='\u{11cb6}', '\u{11d31}'..='\u{11d36}', '\u{11d3a}'..='\u{11d3a}',
- '\u{11d3c}'..='\u{11d3d}', '\u{11d3f}'..='\u{11d45}', '\u{11d47}'..='\u{11d47}',
- '\u{11d90}'..='\u{11d91}', '\u{11d95}'..='\u{11d95}', '\u{11d97}'..='\u{11d97}',
- '\u{11ef3}'..='\u{11ef4}', '\u{11f00}'..='\u{11f01}', '\u{11f36}'..='\u{11f3a}',
- '\u{11f40}'..='\u{11f42}', '\u{11f5a}'..='\u{11f5a}', '\u{13440}'..='\u{13440}',
- '\u{13447}'..='\u{13455}', '\u{1611e}'..='\u{16129}', '\u{1612d}'..='\u{1612f}',
- '\u{16af0}'..='\u{16af4}', '\u{16b30}'..='\u{16b36}', '\u{16f4f}'..='\u{16f4f}',
- '\u{16f8f}'..='\u{16f92}', '\u{16fe4}'..='\u{16fe4}', '\u{16ff0}'..='\u{16ff1}',
- '\u{1bc9d}'..='\u{1bc9e}', '\u{1cf00}'..='\u{1cf2d}', '\u{1cf30}'..='\u{1cf46}',
- '\u{1d165}'..='\u{1d169}', '\u{1d16d}'..='\u{1d172}', '\u{1d17b}'..='\u{1d182}',
- '\u{1d185}'..='\u{1d18b}', '\u{1d1aa}'..='\u{1d1ad}', '\u{1d242}'..='\u{1d244}',
- '\u{1da00}'..='\u{1da36}', '\u{1da3b}'..='\u{1da6c}', '\u{1da75}'..='\u{1da75}',
- '\u{1da84}'..='\u{1da84}', '\u{1da9b}'..='\u{1da9f}', '\u{1daa1}'..='\u{1daaf}',
- '\u{1e000}'..='\u{1e006}', '\u{1e008}'..='\u{1e018}', '\u{1e01b}'..='\u{1e021}',
- '\u{1e023}'..='\u{1e024}', '\u{1e026}'..='\u{1e02a}', '\u{1e08f}'..='\u{1e08f}',
- '\u{1e130}'..='\u{1e136}', '\u{1e2ae}'..='\u{1e2ae}', '\u{1e2ec}'..='\u{1e2ef}',
- '\u{1e4ec}'..='\u{1e4ef}', '\u{1e5ee}'..='\u{1e5ef}', '\u{1e6e3}'..='\u{1e6e3}',
- '\u{1e6e6}'..='\u{1e6e6}', '\u{1e6ee}'..='\u{1e6ef}', '\u{1e6f5}'..='\u{1e6f5}',
- '\u{1e8d0}'..='\u{1e8d6}', '\u{1e944}'..='\u{1e94a}', '\u{e0020}'..='\u{e007f}',
- '\u{e0100}'..='\u{e01ef}',
-];
-
-#[rustfmt::skip]
-pub(super) static LOWERCASE: &[RangeInclusive<char>; 676] = &[
- '\u{aa}'..='\u{aa}', '\u{b5}'..='\u{b5}', '\u{ba}'..='\u{ba}', '\u{df}'..='\u{f6}',
- '\u{f8}'..='\u{ff}', '\u{101}'..='\u{101}', '\u{103}'..='\u{103}', '\u{105}'..='\u{105}',
- '\u{107}'..='\u{107}', '\u{109}'..='\u{109}', '\u{10b}'..='\u{10b}', '\u{10d}'..='\u{10d}',
- '\u{10f}'..='\u{10f}', '\u{111}'..='\u{111}', '\u{113}'..='\u{113}', '\u{115}'..='\u{115}',
- '\u{117}'..='\u{117}', '\u{119}'..='\u{119}', '\u{11b}'..='\u{11b}', '\u{11d}'..='\u{11d}',
- '\u{11f}'..='\u{11f}', '\u{121}'..='\u{121}', '\u{123}'..='\u{123}', '\u{125}'..='\u{125}',
- '\u{127}'..='\u{127}', '\u{129}'..='\u{129}', '\u{12b}'..='\u{12b}', '\u{12d}'..='\u{12d}',
- '\u{12f}'..='\u{12f}', '\u{131}'..='\u{131}', '\u{133}'..='\u{133}', '\u{135}'..='\u{135}',
- '\u{137}'..='\u{138}', '\u{13a}'..='\u{13a}', '\u{13c}'..='\u{13c}', '\u{13e}'..='\u{13e}',
- '\u{140}'..='\u{140}', '\u{142}'..='\u{142}', '\u{144}'..='\u{144}', '\u{146}'..='\u{146}',
- '\u{148}'..='\u{149}', '\u{14b}'..='\u{14b}', '\u{14d}'..='\u{14d}', '\u{14f}'..='\u{14f}',
- '\u{151}'..='\u{151}', '\u{153}'..='\u{153}', '\u{155}'..='\u{155}', '\u{157}'..='\u{157}',
- '\u{159}'..='\u{159}', '\u{15b}'..='\u{15b}', '\u{15d}'..='\u{15d}', '\u{15f}'..='\u{15f}',
- '\u{161}'..='\u{161}', '\u{163}'..='\u{163}', '\u{165}'..='\u{165}', '\u{167}'..='\u{167}',
- '\u{169}'..='\u{169}', '\u{16b}'..='\u{16b}', '\u{16d}'..='\u{16d}', '\u{16f}'..='\u{16f}',
- '\u{171}'..='\u{171}', '\u{173}'..='\u{173}', '\u{175}'..='\u{175}', '\u{177}'..='\u{177}',
- '\u{17a}'..='\u{17a}', '\u{17c}'..='\u{17c}', '\u{17e}'..='\u{180}', '\u{183}'..='\u{183}',
- '\u{185}'..='\u{185}', '\u{188}'..='\u{188}', '\u{18c}'..='\u{18d}', '\u{192}'..='\u{192}',
- '\u{195}'..='\u{195}', '\u{199}'..='\u{19b}', '\u{19e}'..='\u{19e}', '\u{1a1}'..='\u{1a1}',
- '\u{1a3}'..='\u{1a3}', '\u{1a5}'..='\u{1a5}', '\u{1a8}'..='\u{1a8}', '\u{1aa}'..='\u{1ab}',
- '\u{1ad}'..='\u{1ad}', '\u{1b0}'..='\u{1b0}', '\u{1b4}'..='\u{1b4}', '\u{1b6}'..='\u{1b6}',
- '\u{1b9}'..='\u{1ba}', '\u{1bd}'..='\u{1bf}', '\u{1c6}'..='\u{1c6}', '\u{1c9}'..='\u{1c9}',
- '\u{1cc}'..='\u{1cc}', '\u{1ce}'..='\u{1ce}', '\u{1d0}'..='\u{1d0}', '\u{1d2}'..='\u{1d2}',
- '\u{1d4}'..='\u{1d4}', '\u{1d6}'..='\u{1d6}', '\u{1d8}'..='\u{1d8}', '\u{1da}'..='\u{1da}',
- '\u{1dc}'..='\u{1dd}', '\u{1df}'..='\u{1df}', '\u{1e1}'..='\u{1e1}', '\u{1e3}'..='\u{1e3}',
- '\u{1e5}'..='\u{1e5}', '\u{1e7}'..='\u{1e7}', '\u{1e9}'..='\u{1e9}', '\u{1eb}'..='\u{1eb}',
- '\u{1ed}'..='\u{1ed}', '\u{1ef}'..='\u{1f0}', '\u{1f3}'..='\u{1f3}', '\u{1f5}'..='\u{1f5}',
- '\u{1f9}'..='\u{1f9}', '\u{1fb}'..='\u{1fb}', '\u{1fd}'..='\u{1fd}', '\u{1ff}'..='\u{1ff}',
- '\u{201}'..='\u{201}', '\u{203}'..='\u{203}', '\u{205}'..='\u{205}', '\u{207}'..='\u{207}',
- '\u{209}'..='\u{209}', '\u{20b}'..='\u{20b}', '\u{20d}'..='\u{20d}', '\u{20f}'..='\u{20f}',
- '\u{211}'..='\u{211}', '\u{213}'..='\u{213}', '\u{215}'..='\u{215}', '\u{217}'..='\u{217}',
- '\u{219}'..='\u{219}', '\u{21b}'..='\u{21b}', '\u{21d}'..='\u{21d}', '\u{21f}'..='\u{21f}',
- '\u{221}'..='\u{221}', '\u{223}'..='\u{223}', '\u{225}'..='\u{225}', '\u{227}'..='\u{227}',
- '\u{229}'..='\u{229}', '\u{22b}'..='\u{22b}', '\u{22d}'..='\u{22d}', '\u{22f}'..='\u{22f}',
- '\u{231}'..='\u{231}', '\u{233}'..='\u{239}', '\u{23c}'..='\u{23c}', '\u{23f}'..='\u{240}',
- '\u{242}'..='\u{242}', '\u{247}'..='\u{247}', '\u{249}'..='\u{249}', '\u{24b}'..='\u{24b}',
- '\u{24d}'..='\u{24d}', '\u{24f}'..='\u{293}', '\u{296}'..='\u{2b8}', '\u{2c0}'..='\u{2c1}',
- '\u{2e0}'..='\u{2e4}', '\u{345}'..='\u{345}', '\u{371}'..='\u{371}', '\u{373}'..='\u{373}',
- '\u{377}'..='\u{377}', '\u{37a}'..='\u{37d}', '\u{390}'..='\u{390}', '\u{3ac}'..='\u{3ce}',
- '\u{3d0}'..='\u{3d1}', '\u{3d5}'..='\u{3d7}', '\u{3d9}'..='\u{3d9}', '\u{3db}'..='\u{3db}',
- '\u{3dd}'..='\u{3dd}', '\u{3df}'..='\u{3df}', '\u{3e1}'..='\u{3e1}', '\u{3e3}'..='\u{3e3}',
- '\u{3e5}'..='\u{3e5}', '\u{3e7}'..='\u{3e7}', '\u{3e9}'..='\u{3e9}', '\u{3eb}'..='\u{3eb}',
- '\u{3ed}'..='\u{3ed}', '\u{3ef}'..='\u{3f3}', '\u{3f5}'..='\u{3f5}', '\u{3f8}'..='\u{3f8}',
- '\u{3fb}'..='\u{3fc}', '\u{430}'..='\u{45f}', '\u{461}'..='\u{461}', '\u{463}'..='\u{463}',
- '\u{465}'..='\u{465}', '\u{467}'..='\u{467}', '\u{469}'..='\u{469}', '\u{46b}'..='\u{46b}',
- '\u{46d}'..='\u{46d}', '\u{46f}'..='\u{46f}', '\u{471}'..='\u{471}', '\u{473}'..='\u{473}',
- '\u{475}'..='\u{475}', '\u{477}'..='\u{477}', '\u{479}'..='\u{479}', '\u{47b}'..='\u{47b}',
- '\u{47d}'..='\u{47d}', '\u{47f}'..='\u{47f}', '\u{481}'..='\u{481}', '\u{48b}'..='\u{48b}',
- '\u{48d}'..='\u{48d}', '\u{48f}'..='\u{48f}', '\u{491}'..='\u{491}', '\u{493}'..='\u{493}',
- '\u{495}'..='\u{495}', '\u{497}'..='\u{497}', '\u{499}'..='\u{499}', '\u{49b}'..='\u{49b}',
- '\u{49d}'..='\u{49d}', '\u{49f}'..='\u{49f}', '\u{4a1}'..='\u{4a1}', '\u{4a3}'..='\u{4a3}',
- '\u{4a5}'..='\u{4a5}', '\u{4a7}'..='\u{4a7}', '\u{4a9}'..='\u{4a9}', '\u{4ab}'..='\u{4ab}',
- '\u{4ad}'..='\u{4ad}', '\u{4af}'..='\u{4af}', '\u{4b1}'..='\u{4b1}', '\u{4b3}'..='\u{4b3}',
- '\u{4b5}'..='\u{4b5}', '\u{4b7}'..='\u{4b7}', '\u{4b9}'..='\u{4b9}', '\u{4bb}'..='\u{4bb}',
- '\u{4bd}'..='\u{4bd}', '\u{4bf}'..='\u{4bf}', '\u{4c2}'..='\u{4c2}', '\u{4c4}'..='\u{4c4}',
- '\u{4c6}'..='\u{4c6}', '\u{4c8}'..='\u{4c8}', '\u{4ca}'..='\u{4ca}', '\u{4cc}'..='\u{4cc}',
- '\u{4ce}'..='\u{4cf}', '\u{4d1}'..='\u{4d1}', '\u{4d3}'..='\u{4d3}', '\u{4d5}'..='\u{4d5}',
- '\u{4d7}'..='\u{4d7}', '\u{4d9}'..='\u{4d9}', '\u{4db}'..='\u{4db}', '\u{4dd}'..='\u{4dd}',
- '\u{4df}'..='\u{4df}', '\u{4e1}'..='\u{4e1}', '\u{4e3}'..='\u{4e3}', '\u{4e5}'..='\u{4e5}',
- '\u{4e7}'..='\u{4e7}', '\u{4e9}'..='\u{4e9}', '\u{4eb}'..='\u{4eb}', '\u{4ed}'..='\u{4ed}',
- '\u{4ef}'..='\u{4ef}', '\u{4f1}'..='\u{4f1}', '\u{4f3}'..='\u{4f3}', '\u{4f5}'..='\u{4f5}',
- '\u{4f7}'..='\u{4f7}', '\u{4f9}'..='\u{4f9}', '\u{4fb}'..='\u{4fb}', '\u{4fd}'..='\u{4fd}',
- '\u{4ff}'..='\u{4ff}', '\u{501}'..='\u{501}', '\u{503}'..='\u{503}', '\u{505}'..='\u{505}',
- '\u{507}'..='\u{507}', '\u{509}'..='\u{509}', '\u{50b}'..='\u{50b}', '\u{50d}'..='\u{50d}',
- '\u{50f}'..='\u{50f}', '\u{511}'..='\u{511}', '\u{513}'..='\u{513}', '\u{515}'..='\u{515}',
- '\u{517}'..='\u{517}', '\u{519}'..='\u{519}', '\u{51b}'..='\u{51b}', '\u{51d}'..='\u{51d}',
- '\u{51f}'..='\u{51f}', '\u{521}'..='\u{521}', '\u{523}'..='\u{523}', '\u{525}'..='\u{525}',
- '\u{527}'..='\u{527}', '\u{529}'..='\u{529}', '\u{52b}'..='\u{52b}', '\u{52d}'..='\u{52d}',
- '\u{52f}'..='\u{52f}', '\u{560}'..='\u{588}', '\u{10d0}'..='\u{10fa}',
- '\u{10fc}'..='\u{10ff}', '\u{13f8}'..='\u{13fd}', '\u{1c80}'..='\u{1c88}',
- '\u{1c8a}'..='\u{1c8a}', '\u{1d00}'..='\u{1dbf}', '\u{1e01}'..='\u{1e01}',
- '\u{1e03}'..='\u{1e03}', '\u{1e05}'..='\u{1e05}', '\u{1e07}'..='\u{1e07}',
- '\u{1e09}'..='\u{1e09}', '\u{1e0b}'..='\u{1e0b}', '\u{1e0d}'..='\u{1e0d}',
- '\u{1e0f}'..='\u{1e0f}', '\u{1e11}'..='\u{1e11}', '\u{1e13}'..='\u{1e13}',
- '\u{1e15}'..='\u{1e15}', '\u{1e17}'..='\u{1e17}', '\u{1e19}'..='\u{1e19}',
- '\u{1e1b}'..='\u{1e1b}', '\u{1e1d}'..='\u{1e1d}', '\u{1e1f}'..='\u{1e1f}',
- '\u{1e21}'..='\u{1e21}', '\u{1e23}'..='\u{1e23}', '\u{1e25}'..='\u{1e25}',
- '\u{1e27}'..='\u{1e27}', '\u{1e29}'..='\u{1e29}', '\u{1e2b}'..='\u{1e2b}',
- '\u{1e2d}'..='\u{1e2d}', '\u{1e2f}'..='\u{1e2f}', '\u{1e31}'..='\u{1e31}',
- '\u{1e33}'..='\u{1e33}', '\u{1e35}'..='\u{1e35}', '\u{1e37}'..='\u{1e37}',
- '\u{1e39}'..='\u{1e39}', '\u{1e3b}'..='\u{1e3b}', '\u{1e3d}'..='\u{1e3d}',
- '\u{1e3f}'..='\u{1e3f}', '\u{1e41}'..='\u{1e41}', '\u{1e43}'..='\u{1e43}',
- '\u{1e45}'..='\u{1e45}', '\u{1e47}'..='\u{1e47}', '\u{1e49}'..='\u{1e49}',
- '\u{1e4b}'..='\u{1e4b}', '\u{1e4d}'..='\u{1e4d}', '\u{1e4f}'..='\u{1e4f}',
- '\u{1e51}'..='\u{1e51}', '\u{1e53}'..='\u{1e53}', '\u{1e55}'..='\u{1e55}',
- '\u{1e57}'..='\u{1e57}', '\u{1e59}'..='\u{1e59}', '\u{1e5b}'..='\u{1e5b}',
- '\u{1e5d}'..='\u{1e5d}', '\u{1e5f}'..='\u{1e5f}', '\u{1e61}'..='\u{1e61}',
- '\u{1e63}'..='\u{1e63}', '\u{1e65}'..='\u{1e65}', '\u{1e67}'..='\u{1e67}',
- '\u{1e69}'..='\u{1e69}', '\u{1e6b}'..='\u{1e6b}', '\u{1e6d}'..='\u{1e6d}',
- '\u{1e6f}'..='\u{1e6f}', '\u{1e71}'..='\u{1e71}', '\u{1e73}'..='\u{1e73}',
- '\u{1e75}'..='\u{1e75}', '\u{1e77}'..='\u{1e77}', '\u{1e79}'..='\u{1e79}',
- '\u{1e7b}'..='\u{1e7b}', '\u{1e7d}'..='\u{1e7d}', '\u{1e7f}'..='\u{1e7f}',
- '\u{1e81}'..='\u{1e81}', '\u{1e83}'..='\u{1e83}', '\u{1e85}'..='\u{1e85}',
- '\u{1e87}'..='\u{1e87}', '\u{1e89}'..='\u{1e89}', '\u{1e8b}'..='\u{1e8b}',
- '\u{1e8d}'..='\u{1e8d}', '\u{1e8f}'..='\u{1e8f}', '\u{1e91}'..='\u{1e91}',
- '\u{1e93}'..='\u{1e93}', '\u{1e95}'..='\u{1e9d}', '\u{1e9f}'..='\u{1e9f}',
- '\u{1ea1}'..='\u{1ea1}', '\u{1ea3}'..='\u{1ea3}', '\u{1ea5}'..='\u{1ea5}',
- '\u{1ea7}'..='\u{1ea7}', '\u{1ea9}'..='\u{1ea9}', '\u{1eab}'..='\u{1eab}',
- '\u{1ead}'..='\u{1ead}', '\u{1eaf}'..='\u{1eaf}', '\u{1eb1}'..='\u{1eb1}',
- '\u{1eb3}'..='\u{1eb3}', '\u{1eb5}'..='\u{1eb5}', '\u{1eb7}'..='\u{1eb7}',
- '\u{1eb9}'..='\u{1eb9}', '\u{1ebb}'..='\u{1ebb}', '\u{1ebd}'..='\u{1ebd}',
- '\u{1ebf}'..='\u{1ebf}', '\u{1ec1}'..='\u{1ec1}', '\u{1ec3}'..='\u{1ec3}',
- '\u{1ec5}'..='\u{1ec5}', '\u{1ec7}'..='\u{1ec7}', '\u{1ec9}'..='\u{1ec9}',
- '\u{1ecb}'..='\u{1ecb}', '\u{1ecd}'..='\u{1ecd}', '\u{1ecf}'..='\u{1ecf}',
- '\u{1ed1}'..='\u{1ed1}', '\u{1ed3}'..='\u{1ed3}', '\u{1ed5}'..='\u{1ed5}',
- '\u{1ed7}'..='\u{1ed7}', '\u{1ed9}'..='\u{1ed9}', '\u{1edb}'..='\u{1edb}',
- '\u{1edd}'..='\u{1edd}', '\u{1edf}'..='\u{1edf}', '\u{1ee1}'..='\u{1ee1}',
- '\u{1ee3}'..='\u{1ee3}', '\u{1ee5}'..='\u{1ee5}', '\u{1ee7}'..='\u{1ee7}',
- '\u{1ee9}'..='\u{1ee9}', '\u{1eeb}'..='\u{1eeb}', '\u{1eed}'..='\u{1eed}',
- '\u{1eef}'..='\u{1eef}', '\u{1ef1}'..='\u{1ef1}', '\u{1ef3}'..='\u{1ef3}',
- '\u{1ef5}'..='\u{1ef5}', '\u{1ef7}'..='\u{1ef7}', '\u{1ef9}'..='\u{1ef9}',
- '\u{1efb}'..='\u{1efb}', '\u{1efd}'..='\u{1efd}', '\u{1eff}'..='\u{1f07}',
- '\u{1f10}'..='\u{1f15}', '\u{1f20}'..='\u{1f27}', '\u{1f30}'..='\u{1f37}',
- '\u{1f40}'..='\u{1f45}', '\u{1f50}'..='\u{1f57}', '\u{1f60}'..='\u{1f67}',
- '\u{1f70}'..='\u{1f7d}', '\u{1f80}'..='\u{1f87}', '\u{1f90}'..='\u{1f97}',
- '\u{1fa0}'..='\u{1fa7}', '\u{1fb0}'..='\u{1fb4}', '\u{1fb6}'..='\u{1fb7}',
- '\u{1fbe}'..='\u{1fbe}', '\u{1fc2}'..='\u{1fc4}', '\u{1fc6}'..='\u{1fc7}',
- '\u{1fd0}'..='\u{1fd3}', '\u{1fd6}'..='\u{1fd7}', '\u{1fe0}'..='\u{1fe7}',
- '\u{1ff2}'..='\u{1ff4}', '\u{1ff6}'..='\u{1ff7}', '\u{2071}'..='\u{2071}',
- '\u{207f}'..='\u{207f}', '\u{2090}'..='\u{209c}', '\u{210a}'..='\u{210a}',
- '\u{210e}'..='\u{210f}', '\u{2113}'..='\u{2113}', '\u{212f}'..='\u{212f}',
- '\u{2134}'..='\u{2134}', '\u{2139}'..='\u{2139}', '\u{213c}'..='\u{213d}',
- '\u{2146}'..='\u{2149}', '\u{214e}'..='\u{214e}', '\u{2170}'..='\u{217f}',
- '\u{2184}'..='\u{2184}', '\u{24d0}'..='\u{24e9}', '\u{2c30}'..='\u{2c5f}',
- '\u{2c61}'..='\u{2c61}', '\u{2c65}'..='\u{2c66}', '\u{2c68}'..='\u{2c68}',
- '\u{2c6a}'..='\u{2c6a}', '\u{2c6c}'..='\u{2c6c}', '\u{2c71}'..='\u{2c71}',
- '\u{2c73}'..='\u{2c74}', '\u{2c76}'..='\u{2c7d}', '\u{2c81}'..='\u{2c81}',
- '\u{2c83}'..='\u{2c83}', '\u{2c85}'..='\u{2c85}', '\u{2c87}'..='\u{2c87}',
- '\u{2c89}'..='\u{2c89}', '\u{2c8b}'..='\u{2c8b}', '\u{2c8d}'..='\u{2c8d}',
- '\u{2c8f}'..='\u{2c8f}', '\u{2c91}'..='\u{2c91}', '\u{2c93}'..='\u{2c93}',
- '\u{2c95}'..='\u{2c95}', '\u{2c97}'..='\u{2c97}', '\u{2c99}'..='\u{2c99}',
- '\u{2c9b}'..='\u{2c9b}', '\u{2c9d}'..='\u{2c9d}', '\u{2c9f}'..='\u{2c9f}',
- '\u{2ca1}'..='\u{2ca1}', '\u{2ca3}'..='\u{2ca3}', '\u{2ca5}'..='\u{2ca5}',
- '\u{2ca7}'..='\u{2ca7}', '\u{2ca9}'..='\u{2ca9}', '\u{2cab}'..='\u{2cab}',
- '\u{2cad}'..='\u{2cad}', '\u{2caf}'..='\u{2caf}', '\u{2cb1}'..='\u{2cb1}',
- '\u{2cb3}'..='\u{2cb3}', '\u{2cb5}'..='\u{2cb5}', '\u{2cb7}'..='\u{2cb7}',
- '\u{2cb9}'..='\u{2cb9}', '\u{2cbb}'..='\u{2cbb}', '\u{2cbd}'..='\u{2cbd}',
- '\u{2cbf}'..='\u{2cbf}', '\u{2cc1}'..='\u{2cc1}', '\u{2cc3}'..='\u{2cc3}',
- '\u{2cc5}'..='\u{2cc5}', '\u{2cc7}'..='\u{2cc7}', '\u{2cc9}'..='\u{2cc9}',
- '\u{2ccb}'..='\u{2ccb}', '\u{2ccd}'..='\u{2ccd}', '\u{2ccf}'..='\u{2ccf}',
- '\u{2cd1}'..='\u{2cd1}', '\u{2cd3}'..='\u{2cd3}', '\u{2cd5}'..='\u{2cd5}',
- '\u{2cd7}'..='\u{2cd7}', '\u{2cd9}'..='\u{2cd9}', '\u{2cdb}'..='\u{2cdb}',
- '\u{2cdd}'..='\u{2cdd}', '\u{2cdf}'..='\u{2cdf}', '\u{2ce1}'..='\u{2ce1}',
- '\u{2ce3}'..='\u{2ce4}', '\u{2cec}'..='\u{2cec}', '\u{2cee}'..='\u{2cee}',
- '\u{2cf3}'..='\u{2cf3}', '\u{2d00}'..='\u{2d25}', '\u{2d27}'..='\u{2d27}',
- '\u{2d2d}'..='\u{2d2d}', '\u{a641}'..='\u{a641}', '\u{a643}'..='\u{a643}',
- '\u{a645}'..='\u{a645}', '\u{a647}'..='\u{a647}', '\u{a649}'..='\u{a649}',
- '\u{a64b}'..='\u{a64b}', '\u{a64d}'..='\u{a64d}', '\u{a64f}'..='\u{a64f}',
- '\u{a651}'..='\u{a651}', '\u{a653}'..='\u{a653}', '\u{a655}'..='\u{a655}',
- '\u{a657}'..='\u{a657}', '\u{a659}'..='\u{a659}', '\u{a65b}'..='\u{a65b}',
- '\u{a65d}'..='\u{a65d}', '\u{a65f}'..='\u{a65f}', '\u{a661}'..='\u{a661}',
- '\u{a663}'..='\u{a663}', '\u{a665}'..='\u{a665}', '\u{a667}'..='\u{a667}',
- '\u{a669}'..='\u{a669}', '\u{a66b}'..='\u{a66b}', '\u{a66d}'..='\u{a66d}',
- '\u{a681}'..='\u{a681}', '\u{a683}'..='\u{a683}', '\u{a685}'..='\u{a685}',
- '\u{a687}'..='\u{a687}', '\u{a689}'..='\u{a689}', '\u{a68b}'..='\u{a68b}',
- '\u{a68d}'..='\u{a68d}', '\u{a68f}'..='\u{a68f}', '\u{a691}'..='\u{a691}',
- '\u{a693}'..='\u{a693}', '\u{a695}'..='\u{a695}', '\u{a697}'..='\u{a697}',
- '\u{a699}'..='\u{a699}', '\u{a69b}'..='\u{a69d}', '\u{a723}'..='\u{a723}',
- '\u{a725}'..='\u{a725}', '\u{a727}'..='\u{a727}', '\u{a729}'..='\u{a729}',
- '\u{a72b}'..='\u{a72b}', '\u{a72d}'..='\u{a72d}', '\u{a72f}'..='\u{a731}',
- '\u{a733}'..='\u{a733}', '\u{a735}'..='\u{a735}', '\u{a737}'..='\u{a737}',
- '\u{a739}'..='\u{a739}', '\u{a73b}'..='\u{a73b}', '\u{a73d}'..='\u{a73d}',
- '\u{a73f}'..='\u{a73f}', '\u{a741}'..='\u{a741}', '\u{a743}'..='\u{a743}',
- '\u{a745}'..='\u{a745}', '\u{a747}'..='\u{a747}', '\u{a749}'..='\u{a749}',
- '\u{a74b}'..='\u{a74b}', '\u{a74d}'..='\u{a74d}', '\u{a74f}'..='\u{a74f}',
- '\u{a751}'..='\u{a751}', '\u{a753}'..='\u{a753}', '\u{a755}'..='\u{a755}',
- '\u{a757}'..='\u{a757}', '\u{a759}'..='\u{a759}', '\u{a75b}'..='\u{a75b}',
- '\u{a75d}'..='\u{a75d}', '\u{a75f}'..='\u{a75f}', '\u{a761}'..='\u{a761}',
- '\u{a763}'..='\u{a763}', '\u{a765}'..='\u{a765}', '\u{a767}'..='\u{a767}',
- '\u{a769}'..='\u{a769}', '\u{a76b}'..='\u{a76b}', '\u{a76d}'..='\u{a76d}',
- '\u{a76f}'..='\u{a778}', '\u{a77a}'..='\u{a77a}', '\u{a77c}'..='\u{a77c}',
- '\u{a77f}'..='\u{a77f}', '\u{a781}'..='\u{a781}', '\u{a783}'..='\u{a783}',
- '\u{a785}'..='\u{a785}', '\u{a787}'..='\u{a787}', '\u{a78c}'..='\u{a78c}',
- '\u{a78e}'..='\u{a78e}', '\u{a791}'..='\u{a791}', '\u{a793}'..='\u{a795}',
- '\u{a797}'..='\u{a797}', '\u{a799}'..='\u{a799}', '\u{a79b}'..='\u{a79b}',
- '\u{a79d}'..='\u{a79d}', '\u{a79f}'..='\u{a79f}', '\u{a7a1}'..='\u{a7a1}',
- '\u{a7a3}'..='\u{a7a3}', '\u{a7a5}'..='\u{a7a5}', '\u{a7a7}'..='\u{a7a7}',
- '\u{a7a9}'..='\u{a7a9}', '\u{a7af}'..='\u{a7af}', '\u{a7b5}'..='\u{a7b5}',
- '\u{a7b7}'..='\u{a7b7}', '\u{a7b9}'..='\u{a7b9}', '\u{a7bb}'..='\u{a7bb}',
- '\u{a7bd}'..='\u{a7bd}', '\u{a7bf}'..='\u{a7bf}', '\u{a7c1}'..='\u{a7c1}',
- '\u{a7c3}'..='\u{a7c3}', '\u{a7c8}'..='\u{a7c8}', '\u{a7ca}'..='\u{a7ca}',
- '\u{a7cd}'..='\u{a7cd}', '\u{a7cf}'..='\u{a7cf}', '\u{a7d1}'..='\u{a7d1}',
- '\u{a7d3}'..='\u{a7d3}', '\u{a7d5}'..='\u{a7d5}', '\u{a7d7}'..='\u{a7d7}',
- '\u{a7d9}'..='\u{a7d9}', '\u{a7db}'..='\u{a7db}', '\u{a7f1}'..='\u{a7f4}',
- '\u{a7f6}'..='\u{a7f6}', '\u{a7f8}'..='\u{a7fa}', '\u{ab30}'..='\u{ab5a}',
- '\u{ab5c}'..='\u{ab69}', '\u{ab70}'..='\u{abbf}', '\u{fb00}'..='\u{fb06}',
- '\u{fb13}'..='\u{fb17}', '\u{ff41}'..='\u{ff5a}', '\u{10428}'..='\u{1044f}',
- '\u{104d8}'..='\u{104fb}', '\u{10597}'..='\u{105a1}', '\u{105a3}'..='\u{105b1}',
- '\u{105b3}'..='\u{105b9}', '\u{105bb}'..='\u{105bc}', '\u{10780}'..='\u{10780}',
- '\u{10783}'..='\u{10785}', '\u{10787}'..='\u{107b0}', '\u{107b2}'..='\u{107ba}',
- '\u{10cc0}'..='\u{10cf2}', '\u{10d70}'..='\u{10d85}', '\u{118c0}'..='\u{118df}',
- '\u{16e60}'..='\u{16e7f}', '\u{16ebb}'..='\u{16ed3}', '\u{1d41a}'..='\u{1d433}',
- '\u{1d44e}'..='\u{1d454}', '\u{1d456}'..='\u{1d467}', '\u{1d482}'..='\u{1d49b}',
- '\u{1d4b6}'..='\u{1d4b9}', '\u{1d4bb}'..='\u{1d4bb}', '\u{1d4bd}'..='\u{1d4c3}',
- '\u{1d4c5}'..='\u{1d4cf}', '\u{1d4ea}'..='\u{1d503}', '\u{1d51e}'..='\u{1d537}',
- '\u{1d552}'..='\u{1d56b}', '\u{1d586}'..='\u{1d59f}', '\u{1d5ba}'..='\u{1d5d3}',
- '\u{1d5ee}'..='\u{1d607}', '\u{1d622}'..='\u{1d63b}', '\u{1d656}'..='\u{1d66f}',
- '\u{1d68a}'..='\u{1d6a5}', '\u{1d6c2}'..='\u{1d6da}', '\u{1d6dc}'..='\u{1d6e1}',
- '\u{1d6fc}'..='\u{1d714}', '\u{1d716}'..='\u{1d71b}', '\u{1d736}'..='\u{1d74e}',
- '\u{1d750}'..='\u{1d755}', '\u{1d770}'..='\u{1d788}', '\u{1d78a}'..='\u{1d78f}',
- '\u{1d7aa}'..='\u{1d7c2}', '\u{1d7c4}'..='\u{1d7c9}', '\u{1d7cb}'..='\u{1d7cb}',
- '\u{1df00}'..='\u{1df09}', '\u{1df0b}'..='\u{1df1e}', '\u{1df25}'..='\u{1df2a}',
- '\u{1e030}'..='\u{1e06d}', '\u{1e922}'..='\u{1e943}',
-];
-
-#[rustfmt::skip]
-pub(super) static N: &[RangeInclusive<char>; 145] = &[
- '\u{b2}'..='\u{b3}', '\u{b9}'..='\u{b9}', '\u{bc}'..='\u{be}', '\u{660}'..='\u{669}',
- '\u{6f0}'..='\u{6f9}', '\u{7c0}'..='\u{7c9}', '\u{966}'..='\u{96f}', '\u{9e6}'..='\u{9ef}',
- '\u{9f4}'..='\u{9f9}', '\u{a66}'..='\u{a6f}', '\u{ae6}'..='\u{aef}', '\u{b66}'..='\u{b6f}',
- '\u{b72}'..='\u{b77}', '\u{be6}'..='\u{bf2}', '\u{c66}'..='\u{c6f}', '\u{c78}'..='\u{c7e}',
- '\u{ce6}'..='\u{cef}', '\u{d58}'..='\u{d5e}', '\u{d66}'..='\u{d78}', '\u{de6}'..='\u{def}',
- '\u{e50}'..='\u{e59}', '\u{ed0}'..='\u{ed9}', '\u{f20}'..='\u{f33}',
- '\u{1040}'..='\u{1049}', '\u{1090}'..='\u{1099}', '\u{1369}'..='\u{137c}',
- '\u{16ee}'..='\u{16f0}', '\u{17e0}'..='\u{17e9}', '\u{17f0}'..='\u{17f9}',
- '\u{1810}'..='\u{1819}', '\u{1946}'..='\u{194f}', '\u{19d0}'..='\u{19da}',
- '\u{1a80}'..='\u{1a89}', '\u{1a90}'..='\u{1a99}', '\u{1b50}'..='\u{1b59}',
- '\u{1bb0}'..='\u{1bb9}', '\u{1c40}'..='\u{1c49}', '\u{1c50}'..='\u{1c59}',
- '\u{2070}'..='\u{2070}', '\u{2074}'..='\u{2079}', '\u{2080}'..='\u{2089}',
- '\u{2150}'..='\u{2182}', '\u{2185}'..='\u{2189}', '\u{2460}'..='\u{249b}',
- '\u{24ea}'..='\u{24ff}', '\u{2776}'..='\u{2793}', '\u{2cfd}'..='\u{2cfd}',
- '\u{3007}'..='\u{3007}', '\u{3021}'..='\u{3029}', '\u{3038}'..='\u{303a}',
- '\u{3192}'..='\u{3195}', '\u{3220}'..='\u{3229}', '\u{3248}'..='\u{324f}',
- '\u{3251}'..='\u{325f}', '\u{3280}'..='\u{3289}', '\u{32b1}'..='\u{32bf}',
- '\u{a620}'..='\u{a629}', '\u{a6e6}'..='\u{a6ef}', '\u{a830}'..='\u{a835}',
- '\u{a8d0}'..='\u{a8d9}', '\u{a900}'..='\u{a909}', '\u{a9d0}'..='\u{a9d9}',
- '\u{a9f0}'..='\u{a9f9}', '\u{aa50}'..='\u{aa59}', '\u{abf0}'..='\u{abf9}',
- '\u{ff10}'..='\u{ff19}', '\u{10107}'..='\u{10133}', '\u{10140}'..='\u{10178}',
- '\u{1018a}'..='\u{1018b}', '\u{102e1}'..='\u{102fb}', '\u{10320}'..='\u{10323}',
- '\u{10341}'..='\u{10341}', '\u{1034a}'..='\u{1034a}', '\u{103d1}'..='\u{103d5}',
- '\u{104a0}'..='\u{104a9}', '\u{10858}'..='\u{1085f}', '\u{10879}'..='\u{1087f}',
- '\u{108a7}'..='\u{108af}', '\u{108fb}'..='\u{108ff}', '\u{10916}'..='\u{1091b}',
- '\u{109bc}'..='\u{109bd}', '\u{109c0}'..='\u{109cf}', '\u{109d2}'..='\u{109ff}',
- '\u{10a40}'..='\u{10a48}', '\u{10a7d}'..='\u{10a7e}', '\u{10a9d}'..='\u{10a9f}',
- '\u{10aeb}'..='\u{10aef}', '\u{10b58}'..='\u{10b5f}', '\u{10b78}'..='\u{10b7f}',
- '\u{10ba9}'..='\u{10baf}', '\u{10cfa}'..='\u{10cff}', '\u{10d30}'..='\u{10d39}',
- '\u{10d40}'..='\u{10d49}', '\u{10e60}'..='\u{10e7e}', '\u{10f1d}'..='\u{10f26}',
- '\u{10f51}'..='\u{10f54}', '\u{10fc5}'..='\u{10fcb}', '\u{11052}'..='\u{1106f}',
- '\u{110f0}'..='\u{110f9}', '\u{11136}'..='\u{1113f}', '\u{111d0}'..='\u{111d9}',
- '\u{111e1}'..='\u{111f4}', '\u{112f0}'..='\u{112f9}', '\u{11450}'..='\u{11459}',
- '\u{114d0}'..='\u{114d9}', '\u{11650}'..='\u{11659}', '\u{116c0}'..='\u{116c9}',
- '\u{116d0}'..='\u{116e3}', '\u{11730}'..='\u{1173b}', '\u{118e0}'..='\u{118f2}',
- '\u{11950}'..='\u{11959}', '\u{11bf0}'..='\u{11bf9}', '\u{11c50}'..='\u{11c6c}',
- '\u{11d50}'..='\u{11d59}', '\u{11da0}'..='\u{11da9}', '\u{11de0}'..='\u{11de9}',
- '\u{11f50}'..='\u{11f59}', '\u{11fc0}'..='\u{11fd4}', '\u{12400}'..='\u{1246e}',
- '\u{16130}'..='\u{16139}', '\u{16a60}'..='\u{16a69}', '\u{16ac0}'..='\u{16ac9}',
- '\u{16b50}'..='\u{16b59}', '\u{16b5b}'..='\u{16b61}', '\u{16d70}'..='\u{16d79}',
- '\u{16e80}'..='\u{16e96}', '\u{16ff4}'..='\u{16ff6}', '\u{1ccf0}'..='\u{1ccf9}',
- '\u{1d2c0}'..='\u{1d2d3}', '\u{1d2e0}'..='\u{1d2f3}', '\u{1d360}'..='\u{1d378}',
- '\u{1d7ce}'..='\u{1d7ff}', '\u{1e140}'..='\u{1e149}', '\u{1e2f0}'..='\u{1e2f9}',
- '\u{1e4f0}'..='\u{1e4f9}', '\u{1e5f1}'..='\u{1e5fa}', '\u{1e8c7}'..='\u{1e8cf}',
- '\u{1e950}'..='\u{1e959}', '\u{1ec71}'..='\u{1ecab}', '\u{1ecad}'..='\u{1ecaf}',
- '\u{1ecb1}'..='\u{1ecb4}', '\u{1ed01}'..='\u{1ed2d}', '\u{1ed2f}'..='\u{1ed3d}',
- '\u{1f100}'..='\u{1f10c}', '\u{1fbf0}'..='\u{1fbf9}',
-];
-
-#[rustfmt::skip]
-pub(super) static UPPERCASE: &[RangeInclusive<char>; 659] = &[
- '\u{c0}'..='\u{d6}', '\u{d8}'..='\u{de}', '\u{100}'..='\u{100}', '\u{102}'..='\u{102}',
- '\u{104}'..='\u{104}', '\u{106}'..='\u{106}', '\u{108}'..='\u{108}', '\u{10a}'..='\u{10a}',
- '\u{10c}'..='\u{10c}', '\u{10e}'..='\u{10e}', '\u{110}'..='\u{110}', '\u{112}'..='\u{112}',
- '\u{114}'..='\u{114}', '\u{116}'..='\u{116}', '\u{118}'..='\u{118}', '\u{11a}'..='\u{11a}',
- '\u{11c}'..='\u{11c}', '\u{11e}'..='\u{11e}', '\u{120}'..='\u{120}', '\u{122}'..='\u{122}',
- '\u{124}'..='\u{124}', '\u{126}'..='\u{126}', '\u{128}'..='\u{128}', '\u{12a}'..='\u{12a}',
- '\u{12c}'..='\u{12c}', '\u{12e}'..='\u{12e}', '\u{130}'..='\u{130}', '\u{132}'..='\u{132}',
- '\u{134}'..='\u{134}', '\u{136}'..='\u{136}', '\u{139}'..='\u{139}', '\u{13b}'..='\u{13b}',
- '\u{13d}'..='\u{13d}', '\u{13f}'..='\u{13f}', '\u{141}'..='\u{141}', '\u{143}'..='\u{143}',
- '\u{145}'..='\u{145}', '\u{147}'..='\u{147}', '\u{14a}'..='\u{14a}', '\u{14c}'..='\u{14c}',
- '\u{14e}'..='\u{14e}', '\u{150}'..='\u{150}', '\u{152}'..='\u{152}', '\u{154}'..='\u{154}',
- '\u{156}'..='\u{156}', '\u{158}'..='\u{158}', '\u{15a}'..='\u{15a}', '\u{15c}'..='\u{15c}',
- '\u{15e}'..='\u{15e}', '\u{160}'..='\u{160}', '\u{162}'..='\u{162}', '\u{164}'..='\u{164}',
- '\u{166}'..='\u{166}', '\u{168}'..='\u{168}', '\u{16a}'..='\u{16a}', '\u{16c}'..='\u{16c}',
- '\u{16e}'..='\u{16e}', '\u{170}'..='\u{170}', '\u{172}'..='\u{172}', '\u{174}'..='\u{174}',
- '\u{176}'..='\u{176}', '\u{178}'..='\u{179}', '\u{17b}'..='\u{17b}', '\u{17d}'..='\u{17d}',
- '\u{181}'..='\u{182}', '\u{184}'..='\u{184}', '\u{186}'..='\u{187}', '\u{189}'..='\u{18b}',
- '\u{18e}'..='\u{191}', '\u{193}'..='\u{194}', '\u{196}'..='\u{198}', '\u{19c}'..='\u{19d}',
- '\u{19f}'..='\u{1a0}', '\u{1a2}'..='\u{1a2}', '\u{1a4}'..='\u{1a4}', '\u{1a6}'..='\u{1a7}',
- '\u{1a9}'..='\u{1a9}', '\u{1ac}'..='\u{1ac}', '\u{1ae}'..='\u{1af}', '\u{1b1}'..='\u{1b3}',
- '\u{1b5}'..='\u{1b5}', '\u{1b7}'..='\u{1b8}', '\u{1bc}'..='\u{1bc}', '\u{1c4}'..='\u{1c4}',
- '\u{1c7}'..='\u{1c7}', '\u{1ca}'..='\u{1ca}', '\u{1cd}'..='\u{1cd}', '\u{1cf}'..='\u{1cf}',
- '\u{1d1}'..='\u{1d1}', '\u{1d3}'..='\u{1d3}', '\u{1d5}'..='\u{1d5}', '\u{1d7}'..='\u{1d7}',
- '\u{1d9}'..='\u{1d9}', '\u{1db}'..='\u{1db}', '\u{1de}'..='\u{1de}', '\u{1e0}'..='\u{1e0}',
- '\u{1e2}'..='\u{1e2}', '\u{1e4}'..='\u{1e4}', '\u{1e6}'..='\u{1e6}', '\u{1e8}'..='\u{1e8}',
- '\u{1ea}'..='\u{1ea}', '\u{1ec}'..='\u{1ec}', '\u{1ee}'..='\u{1ee}', '\u{1f1}'..='\u{1f1}',
- '\u{1f4}'..='\u{1f4}', '\u{1f6}'..='\u{1f8}', '\u{1fa}'..='\u{1fa}', '\u{1fc}'..='\u{1fc}',
- '\u{1fe}'..='\u{1fe}', '\u{200}'..='\u{200}', '\u{202}'..='\u{202}', '\u{204}'..='\u{204}',
- '\u{206}'..='\u{206}', '\u{208}'..='\u{208}', '\u{20a}'..='\u{20a}', '\u{20c}'..='\u{20c}',
- '\u{20e}'..='\u{20e}', '\u{210}'..='\u{210}', '\u{212}'..='\u{212}', '\u{214}'..='\u{214}',
- '\u{216}'..='\u{216}', '\u{218}'..='\u{218}', '\u{21a}'..='\u{21a}', '\u{21c}'..='\u{21c}',
- '\u{21e}'..='\u{21e}', '\u{220}'..='\u{220}', '\u{222}'..='\u{222}', '\u{224}'..='\u{224}',
- '\u{226}'..='\u{226}', '\u{228}'..='\u{228}', '\u{22a}'..='\u{22a}', '\u{22c}'..='\u{22c}',
- '\u{22e}'..='\u{22e}', '\u{230}'..='\u{230}', '\u{232}'..='\u{232}', '\u{23a}'..='\u{23b}',
- '\u{23d}'..='\u{23e}', '\u{241}'..='\u{241}', '\u{243}'..='\u{246}', '\u{248}'..='\u{248}',
- '\u{24a}'..='\u{24a}', '\u{24c}'..='\u{24c}', '\u{24e}'..='\u{24e}', '\u{370}'..='\u{370}',
- '\u{372}'..='\u{372}', '\u{376}'..='\u{376}', '\u{37f}'..='\u{37f}', '\u{386}'..='\u{386}',
- '\u{388}'..='\u{38a}', '\u{38c}'..='\u{38c}', '\u{38e}'..='\u{38f}', '\u{391}'..='\u{3a1}',
- '\u{3a3}'..='\u{3ab}', '\u{3cf}'..='\u{3cf}', '\u{3d2}'..='\u{3d4}', '\u{3d8}'..='\u{3d8}',
- '\u{3da}'..='\u{3da}', '\u{3dc}'..='\u{3dc}', '\u{3de}'..='\u{3de}', '\u{3e0}'..='\u{3e0}',
- '\u{3e2}'..='\u{3e2}', '\u{3e4}'..='\u{3e4}', '\u{3e6}'..='\u{3e6}', '\u{3e8}'..='\u{3e8}',
- '\u{3ea}'..='\u{3ea}', '\u{3ec}'..='\u{3ec}', '\u{3ee}'..='\u{3ee}', '\u{3f4}'..='\u{3f4}',
- '\u{3f7}'..='\u{3f7}', '\u{3f9}'..='\u{3fa}', '\u{3fd}'..='\u{42f}', '\u{460}'..='\u{460}',
- '\u{462}'..='\u{462}', '\u{464}'..='\u{464}', '\u{466}'..='\u{466}', '\u{468}'..='\u{468}',
- '\u{46a}'..='\u{46a}', '\u{46c}'..='\u{46c}', '\u{46e}'..='\u{46e}', '\u{470}'..='\u{470}',
- '\u{472}'..='\u{472}', '\u{474}'..='\u{474}', '\u{476}'..='\u{476}', '\u{478}'..='\u{478}',
- '\u{47a}'..='\u{47a}', '\u{47c}'..='\u{47c}', '\u{47e}'..='\u{47e}', '\u{480}'..='\u{480}',
- '\u{48a}'..='\u{48a}', '\u{48c}'..='\u{48c}', '\u{48e}'..='\u{48e}', '\u{490}'..='\u{490}',
- '\u{492}'..='\u{492}', '\u{494}'..='\u{494}', '\u{496}'..='\u{496}', '\u{498}'..='\u{498}',
- '\u{49a}'..='\u{49a}', '\u{49c}'..='\u{49c}', '\u{49e}'..='\u{49e}', '\u{4a0}'..='\u{4a0}',
- '\u{4a2}'..='\u{4a2}', '\u{4a4}'..='\u{4a4}', '\u{4a6}'..='\u{4a6}', '\u{4a8}'..='\u{4a8}',
- '\u{4aa}'..='\u{4aa}', '\u{4ac}'..='\u{4ac}', '\u{4ae}'..='\u{4ae}', '\u{4b0}'..='\u{4b0}',
- '\u{4b2}'..='\u{4b2}', '\u{4b4}'..='\u{4b4}', '\u{4b6}'..='\u{4b6}', '\u{4b8}'..='\u{4b8}',
- '\u{4ba}'..='\u{4ba}', '\u{4bc}'..='\u{4bc}', '\u{4be}'..='\u{4be}', '\u{4c0}'..='\u{4c1}',
- '\u{4c3}'..='\u{4c3}', '\u{4c5}'..='\u{4c5}', '\u{4c7}'..='\u{4c7}', '\u{4c9}'..='\u{4c9}',
- '\u{4cb}'..='\u{4cb}', '\u{4cd}'..='\u{4cd}', '\u{4d0}'..='\u{4d0}', '\u{4d2}'..='\u{4d2}',
- '\u{4d4}'..='\u{4d4}', '\u{4d6}'..='\u{4d6}', '\u{4d8}'..='\u{4d8}', '\u{4da}'..='\u{4da}',
- '\u{4dc}'..='\u{4dc}', '\u{4de}'..='\u{4de}', '\u{4e0}'..='\u{4e0}', '\u{4e2}'..='\u{4e2}',
- '\u{4e4}'..='\u{4e4}', '\u{4e6}'..='\u{4e6}', '\u{4e8}'..='\u{4e8}', '\u{4ea}'..='\u{4ea}',
- '\u{4ec}'..='\u{4ec}', '\u{4ee}'..='\u{4ee}', '\u{4f0}'..='\u{4f0}', '\u{4f2}'..='\u{4f2}',
- '\u{4f4}'..='\u{4f4}', '\u{4f6}'..='\u{4f6}', '\u{4f8}'..='\u{4f8}', '\u{4fa}'..='\u{4fa}',
- '\u{4fc}'..='\u{4fc}', '\u{4fe}'..='\u{4fe}', '\u{500}'..='\u{500}', '\u{502}'..='\u{502}',
- '\u{504}'..='\u{504}', '\u{506}'..='\u{506}', '\u{508}'..='\u{508}', '\u{50a}'..='\u{50a}',
- '\u{50c}'..='\u{50c}', '\u{50e}'..='\u{50e}', '\u{510}'..='\u{510}', '\u{512}'..='\u{512}',
- '\u{514}'..='\u{514}', '\u{516}'..='\u{516}', '\u{518}'..='\u{518}', '\u{51a}'..='\u{51a}',
- '\u{51c}'..='\u{51c}', '\u{51e}'..='\u{51e}', '\u{520}'..='\u{520}', '\u{522}'..='\u{522}',
- '\u{524}'..='\u{524}', '\u{526}'..='\u{526}', '\u{528}'..='\u{528}', '\u{52a}'..='\u{52a}',
- '\u{52c}'..='\u{52c}', '\u{52e}'..='\u{52e}', '\u{531}'..='\u{556}',
- '\u{10a0}'..='\u{10c5}', '\u{10c7}'..='\u{10c7}', '\u{10cd}'..='\u{10cd}',
- '\u{13a0}'..='\u{13f5}', '\u{1c89}'..='\u{1c89}', '\u{1c90}'..='\u{1cba}',
- '\u{1cbd}'..='\u{1cbf}', '\u{1e00}'..='\u{1e00}', '\u{1e02}'..='\u{1e02}',
- '\u{1e04}'..='\u{1e04}', '\u{1e06}'..='\u{1e06}', '\u{1e08}'..='\u{1e08}',
- '\u{1e0a}'..='\u{1e0a}', '\u{1e0c}'..='\u{1e0c}', '\u{1e0e}'..='\u{1e0e}',
- '\u{1e10}'..='\u{1e10}', '\u{1e12}'..='\u{1e12}', '\u{1e14}'..='\u{1e14}',
- '\u{1e16}'..='\u{1e16}', '\u{1e18}'..='\u{1e18}', '\u{1e1a}'..='\u{1e1a}',
- '\u{1e1c}'..='\u{1e1c}', '\u{1e1e}'..='\u{1e1e}', '\u{1e20}'..='\u{1e20}',
- '\u{1e22}'..='\u{1e22}', '\u{1e24}'..='\u{1e24}', '\u{1e26}'..='\u{1e26}',
- '\u{1e28}'..='\u{1e28}', '\u{1e2a}'..='\u{1e2a}', '\u{1e2c}'..='\u{1e2c}',
- '\u{1e2e}'..='\u{1e2e}', '\u{1e30}'..='\u{1e30}', '\u{1e32}'..='\u{1e32}',
- '\u{1e34}'..='\u{1e34}', '\u{1e36}'..='\u{1e36}', '\u{1e38}'..='\u{1e38}',
- '\u{1e3a}'..='\u{1e3a}', '\u{1e3c}'..='\u{1e3c}', '\u{1e3e}'..='\u{1e3e}',
- '\u{1e40}'..='\u{1e40}', '\u{1e42}'..='\u{1e42}', '\u{1e44}'..='\u{1e44}',
- '\u{1e46}'..='\u{1e46}', '\u{1e48}'..='\u{1e48}', '\u{1e4a}'..='\u{1e4a}',
- '\u{1e4c}'..='\u{1e4c}', '\u{1e4e}'..='\u{1e4e}', '\u{1e50}'..='\u{1e50}',
- '\u{1e52}'..='\u{1e52}', '\u{1e54}'..='\u{1e54}', '\u{1e56}'..='\u{1e56}',
- '\u{1e58}'..='\u{1e58}', '\u{1e5a}'..='\u{1e5a}', '\u{1e5c}'..='\u{1e5c}',
- '\u{1e5e}'..='\u{1e5e}', '\u{1e60}'..='\u{1e60}', '\u{1e62}'..='\u{1e62}',
- '\u{1e64}'..='\u{1e64}', '\u{1e66}'..='\u{1e66}', '\u{1e68}'..='\u{1e68}',
- '\u{1e6a}'..='\u{1e6a}', '\u{1e6c}'..='\u{1e6c}', '\u{1e6e}'..='\u{1e6e}',
- '\u{1e70}'..='\u{1e70}', '\u{1e72}'..='\u{1e72}', '\u{1e74}'..='\u{1e74}',
- '\u{1e76}'..='\u{1e76}', '\u{1e78}'..='\u{1e78}', '\u{1e7a}'..='\u{1e7a}',
- '\u{1e7c}'..='\u{1e7c}', '\u{1e7e}'..='\u{1e7e}', '\u{1e80}'..='\u{1e80}',
- '\u{1e82}'..='\u{1e82}', '\u{1e84}'..='\u{1e84}', '\u{1e86}'..='\u{1e86}',
- '\u{1e88}'..='\u{1e88}', '\u{1e8a}'..='\u{1e8a}', '\u{1e8c}'..='\u{1e8c}',
- '\u{1e8e}'..='\u{1e8e}', '\u{1e90}'..='\u{1e90}', '\u{1e92}'..='\u{1e92}',
- '\u{1e94}'..='\u{1e94}', '\u{1e9e}'..='\u{1e9e}', '\u{1ea0}'..='\u{1ea0}',
- '\u{1ea2}'..='\u{1ea2}', '\u{1ea4}'..='\u{1ea4}', '\u{1ea6}'..='\u{1ea6}',
- '\u{1ea8}'..='\u{1ea8}', '\u{1eaa}'..='\u{1eaa}', '\u{1eac}'..='\u{1eac}',
- '\u{1eae}'..='\u{1eae}', '\u{1eb0}'..='\u{1eb0}', '\u{1eb2}'..='\u{1eb2}',
- '\u{1eb4}'..='\u{1eb4}', '\u{1eb6}'..='\u{1eb6}', '\u{1eb8}'..='\u{1eb8}',
- '\u{1eba}'..='\u{1eba}', '\u{1ebc}'..='\u{1ebc}', '\u{1ebe}'..='\u{1ebe}',
- '\u{1ec0}'..='\u{1ec0}', '\u{1ec2}'..='\u{1ec2}', '\u{1ec4}'..='\u{1ec4}',
- '\u{1ec6}'..='\u{1ec6}', '\u{1ec8}'..='\u{1ec8}', '\u{1eca}'..='\u{1eca}',
- '\u{1ecc}'..='\u{1ecc}', '\u{1ece}'..='\u{1ece}', '\u{1ed0}'..='\u{1ed0}',
- '\u{1ed2}'..='\u{1ed2}', '\u{1ed4}'..='\u{1ed4}', '\u{1ed6}'..='\u{1ed6}',
- '\u{1ed8}'..='\u{1ed8}', '\u{1eda}'..='\u{1eda}', '\u{1edc}'..='\u{1edc}',
- '\u{1ede}'..='\u{1ede}', '\u{1ee0}'..='\u{1ee0}', '\u{1ee2}'..='\u{1ee2}',
- '\u{1ee4}'..='\u{1ee4}', '\u{1ee6}'..='\u{1ee6}', '\u{1ee8}'..='\u{1ee8}',
- '\u{1eea}'..='\u{1eea}', '\u{1eec}'..='\u{1eec}', '\u{1eee}'..='\u{1eee}',
- '\u{1ef0}'..='\u{1ef0}', '\u{1ef2}'..='\u{1ef2}', '\u{1ef4}'..='\u{1ef4}',
- '\u{1ef6}'..='\u{1ef6}', '\u{1ef8}'..='\u{1ef8}', '\u{1efa}'..='\u{1efa}',
- '\u{1efc}'..='\u{1efc}', '\u{1efe}'..='\u{1efe}', '\u{1f08}'..='\u{1f0f}',
- '\u{1f18}'..='\u{1f1d}', '\u{1f28}'..='\u{1f2f}', '\u{1f38}'..='\u{1f3f}',
- '\u{1f48}'..='\u{1f4d}', '\u{1f59}'..='\u{1f59}', '\u{1f5b}'..='\u{1f5b}',
- '\u{1f5d}'..='\u{1f5d}', '\u{1f5f}'..='\u{1f5f}', '\u{1f68}'..='\u{1f6f}',
- '\u{1fb8}'..='\u{1fbb}', '\u{1fc8}'..='\u{1fcb}', '\u{1fd8}'..='\u{1fdb}',
- '\u{1fe8}'..='\u{1fec}', '\u{1ff8}'..='\u{1ffb}', '\u{2102}'..='\u{2102}',
- '\u{2107}'..='\u{2107}', '\u{210b}'..='\u{210d}', '\u{2110}'..='\u{2112}',
- '\u{2115}'..='\u{2115}', '\u{2119}'..='\u{211d}', '\u{2124}'..='\u{2124}',
- '\u{2126}'..='\u{2126}', '\u{2128}'..='\u{2128}', '\u{212a}'..='\u{212d}',
- '\u{2130}'..='\u{2133}', '\u{213e}'..='\u{213f}', '\u{2145}'..='\u{2145}',
- '\u{2160}'..='\u{216f}', '\u{2183}'..='\u{2183}', '\u{24b6}'..='\u{24cf}',
- '\u{2c00}'..='\u{2c2f}', '\u{2c60}'..='\u{2c60}', '\u{2c62}'..='\u{2c64}',
- '\u{2c67}'..='\u{2c67}', '\u{2c69}'..='\u{2c69}', '\u{2c6b}'..='\u{2c6b}',
- '\u{2c6d}'..='\u{2c70}', '\u{2c72}'..='\u{2c72}', '\u{2c75}'..='\u{2c75}',
- '\u{2c7e}'..='\u{2c80}', '\u{2c82}'..='\u{2c82}', '\u{2c84}'..='\u{2c84}',
- '\u{2c86}'..='\u{2c86}', '\u{2c88}'..='\u{2c88}', '\u{2c8a}'..='\u{2c8a}',
- '\u{2c8c}'..='\u{2c8c}', '\u{2c8e}'..='\u{2c8e}', '\u{2c90}'..='\u{2c90}',
- '\u{2c92}'..='\u{2c92}', '\u{2c94}'..='\u{2c94}', '\u{2c96}'..='\u{2c96}',
- '\u{2c98}'..='\u{2c98}', '\u{2c9a}'..='\u{2c9a}', '\u{2c9c}'..='\u{2c9c}',
- '\u{2c9e}'..='\u{2c9e}', '\u{2ca0}'..='\u{2ca0}', '\u{2ca2}'..='\u{2ca2}',
- '\u{2ca4}'..='\u{2ca4}', '\u{2ca6}'..='\u{2ca6}', '\u{2ca8}'..='\u{2ca8}',
- '\u{2caa}'..='\u{2caa}', '\u{2cac}'..='\u{2cac}', '\u{2cae}'..='\u{2cae}',
- '\u{2cb0}'..='\u{2cb0}', '\u{2cb2}'..='\u{2cb2}', '\u{2cb4}'..='\u{2cb4}',
- '\u{2cb6}'..='\u{2cb6}', '\u{2cb8}'..='\u{2cb8}', '\u{2cba}'..='\u{2cba}',
- '\u{2cbc}'..='\u{2cbc}', '\u{2cbe}'..='\u{2cbe}', '\u{2cc0}'..='\u{2cc0}',
- '\u{2cc2}'..='\u{2cc2}', '\u{2cc4}'..='\u{2cc4}', '\u{2cc6}'..='\u{2cc6}',
- '\u{2cc8}'..='\u{2cc8}', '\u{2cca}'..='\u{2cca}', '\u{2ccc}'..='\u{2ccc}',
- '\u{2cce}'..='\u{2cce}', '\u{2cd0}'..='\u{2cd0}', '\u{2cd2}'..='\u{2cd2}',
- '\u{2cd4}'..='\u{2cd4}', '\u{2cd6}'..='\u{2cd6}', '\u{2cd8}'..='\u{2cd8}',
- '\u{2cda}'..='\u{2cda}', '\u{2cdc}'..='\u{2cdc}', '\u{2cde}'..='\u{2cde}',
- '\u{2ce0}'..='\u{2ce0}', '\u{2ce2}'..='\u{2ce2}', '\u{2ceb}'..='\u{2ceb}',
- '\u{2ced}'..='\u{2ced}', '\u{2cf2}'..='\u{2cf2}', '\u{a640}'..='\u{a640}',
- '\u{a642}'..='\u{a642}', '\u{a644}'..='\u{a644}', '\u{a646}'..='\u{a646}',
- '\u{a648}'..='\u{a648}', '\u{a64a}'..='\u{a64a}', '\u{a64c}'..='\u{a64c}',
- '\u{a64e}'..='\u{a64e}', '\u{a650}'..='\u{a650}', '\u{a652}'..='\u{a652}',
- '\u{a654}'..='\u{a654}', '\u{a656}'..='\u{a656}', '\u{a658}'..='\u{a658}',
- '\u{a65a}'..='\u{a65a}', '\u{a65c}'..='\u{a65c}', '\u{a65e}'..='\u{a65e}',
- '\u{a660}'..='\u{a660}', '\u{a662}'..='\u{a662}', '\u{a664}'..='\u{a664}',
- '\u{a666}'..='\u{a666}', '\u{a668}'..='\u{a668}', '\u{a66a}'..='\u{a66a}',
- '\u{a66c}'..='\u{a66c}', '\u{a680}'..='\u{a680}', '\u{a682}'..='\u{a682}',
- '\u{a684}'..='\u{a684}', '\u{a686}'..='\u{a686}', '\u{a688}'..='\u{a688}',
- '\u{a68a}'..='\u{a68a}', '\u{a68c}'..='\u{a68c}', '\u{a68e}'..='\u{a68e}',
- '\u{a690}'..='\u{a690}', '\u{a692}'..='\u{a692}', '\u{a694}'..='\u{a694}',
- '\u{a696}'..='\u{a696}', '\u{a698}'..='\u{a698}', '\u{a69a}'..='\u{a69a}',
- '\u{a722}'..='\u{a722}', '\u{a724}'..='\u{a724}', '\u{a726}'..='\u{a726}',
- '\u{a728}'..='\u{a728}', '\u{a72a}'..='\u{a72a}', '\u{a72c}'..='\u{a72c}',
- '\u{a72e}'..='\u{a72e}', '\u{a732}'..='\u{a732}', '\u{a734}'..='\u{a734}',
- '\u{a736}'..='\u{a736}', '\u{a738}'..='\u{a738}', '\u{a73a}'..='\u{a73a}',
- '\u{a73c}'..='\u{a73c}', '\u{a73e}'..='\u{a73e}', '\u{a740}'..='\u{a740}',
- '\u{a742}'..='\u{a742}', '\u{a744}'..='\u{a744}', '\u{a746}'..='\u{a746}',
- '\u{a748}'..='\u{a748}', '\u{a74a}'..='\u{a74a}', '\u{a74c}'..='\u{a74c}',
- '\u{a74e}'..='\u{a74e}', '\u{a750}'..='\u{a750}', '\u{a752}'..='\u{a752}',
- '\u{a754}'..='\u{a754}', '\u{a756}'..='\u{a756}', '\u{a758}'..='\u{a758}',
- '\u{a75a}'..='\u{a75a}', '\u{a75c}'..='\u{a75c}', '\u{a75e}'..='\u{a75e}',
- '\u{a760}'..='\u{a760}', '\u{a762}'..='\u{a762}', '\u{a764}'..='\u{a764}',
- '\u{a766}'..='\u{a766}', '\u{a768}'..='\u{a768}', '\u{a76a}'..='\u{a76a}',
- '\u{a76c}'..='\u{a76c}', '\u{a76e}'..='\u{a76e}', '\u{a779}'..='\u{a779}',
- '\u{a77b}'..='\u{a77b}', '\u{a77d}'..='\u{a77e}', '\u{a780}'..='\u{a780}',
- '\u{a782}'..='\u{a782}', '\u{a784}'..='\u{a784}', '\u{a786}'..='\u{a786}',
- '\u{a78b}'..='\u{a78b}', '\u{a78d}'..='\u{a78d}', '\u{a790}'..='\u{a790}',
- '\u{a792}'..='\u{a792}', '\u{a796}'..='\u{a796}', '\u{a798}'..='\u{a798}',
- '\u{a79a}'..='\u{a79a}', '\u{a79c}'..='\u{a79c}', '\u{a79e}'..='\u{a79e}',
- '\u{a7a0}'..='\u{a7a0}', '\u{a7a2}'..='\u{a7a2}', '\u{a7a4}'..='\u{a7a4}',
- '\u{a7a6}'..='\u{a7a6}', '\u{a7a8}'..='\u{a7a8}', '\u{a7aa}'..='\u{a7ae}',
- '\u{a7b0}'..='\u{a7b4}', '\u{a7b6}'..='\u{a7b6}', '\u{a7b8}'..='\u{a7b8}',
- '\u{a7ba}'..='\u{a7ba}', '\u{a7bc}'..='\u{a7bc}', '\u{a7be}'..='\u{a7be}',
- '\u{a7c0}'..='\u{a7c0}', '\u{a7c2}'..='\u{a7c2}', '\u{a7c4}'..='\u{a7c7}',
- '\u{a7c9}'..='\u{a7c9}', '\u{a7cb}'..='\u{a7cc}', '\u{a7ce}'..='\u{a7ce}',
- '\u{a7d0}'..='\u{a7d0}', '\u{a7d2}'..='\u{a7d2}', '\u{a7d4}'..='\u{a7d4}',
- '\u{a7d6}'..='\u{a7d6}', '\u{a7d8}'..='\u{a7d8}', '\u{a7da}'..='\u{a7da}',
- '\u{a7dc}'..='\u{a7dc}', '\u{a7f5}'..='\u{a7f5}', '\u{ff21}'..='\u{ff3a}',
- '\u{10400}'..='\u{10427}', '\u{104b0}'..='\u{104d3}', '\u{10570}'..='\u{1057a}',
- '\u{1057c}'..='\u{1058a}', '\u{1058c}'..='\u{10592}', '\u{10594}'..='\u{10595}',
- '\u{10c80}'..='\u{10cb2}', '\u{10d50}'..='\u{10d65}', '\u{118a0}'..='\u{118bf}',
- '\u{16e40}'..='\u{16e5f}', '\u{16ea0}'..='\u{16eb8}', '\u{1d400}'..='\u{1d419}',
- '\u{1d434}'..='\u{1d44d}', '\u{1d468}'..='\u{1d481}', '\u{1d49c}'..='\u{1d49c}',
- '\u{1d49e}'..='\u{1d49f}', '\u{1d4a2}'..='\u{1d4a2}', '\u{1d4a5}'..='\u{1d4a6}',
- '\u{1d4a9}'..='\u{1d4ac}', '\u{1d4ae}'..='\u{1d4b5}', '\u{1d4d0}'..='\u{1d4e9}',
- '\u{1d504}'..='\u{1d505}', '\u{1d507}'..='\u{1d50a}', '\u{1d50d}'..='\u{1d514}',
- '\u{1d516}'..='\u{1d51c}', '\u{1d538}'..='\u{1d539}', '\u{1d53b}'..='\u{1d53e}',
- '\u{1d540}'..='\u{1d544}', '\u{1d546}'..='\u{1d546}', '\u{1d54a}'..='\u{1d550}',
- '\u{1d56c}'..='\u{1d585}', '\u{1d5a0}'..='\u{1d5b9}', '\u{1d5d4}'..='\u{1d5ed}',
- '\u{1d608}'..='\u{1d621}', '\u{1d63c}'..='\u{1d655}', '\u{1d670}'..='\u{1d689}',
- '\u{1d6a8}'..='\u{1d6c0}', '\u{1d6e2}'..='\u{1d6fa}', '\u{1d71c}'..='\u{1d734}',
- '\u{1d756}'..='\u{1d76e}', '\u{1d790}'..='\u{1d7a8}', '\u{1d7ca}'..='\u{1d7ca}',
- '\u{1e900}'..='\u{1e921}', '\u{1f130}'..='\u{1f149}', '\u{1f150}'..='\u{1f169}',
- '\u{1f170}'..='\u{1f189}',
-];
-
-#[rustfmt::skip]
-pub(super) static WHITE_SPACE: &[RangeInclusive<char>; 8] = &[
- '\u{85}'..='\u{85}', '\u{a0}'..='\u{a0}', '\u{1680}'..='\u{1680}', '\u{2000}'..='\u{200a}',
- '\u{2028}'..='\u{2029}', '\u{202f}'..='\u{202f}', '\u{205f}'..='\u{205f}',
- '\u{3000}'..='\u{3000}',
-];
-
-#[rustfmt::skip]
-pub(super) static TO_LOWER: &[(char, [char; 3]); 1488] = &[
- ('\u{41}', ['\u{61}', '\u{0}', '\u{0}']), ('\u{42}', ['\u{62}', '\u{0}', '\u{0}']),
- ('\u{43}', ['\u{63}', '\u{0}', '\u{0}']), ('\u{44}', ['\u{64}', '\u{0}', '\u{0}']),
- ('\u{45}', ['\u{65}', '\u{0}', '\u{0}']), ('\u{46}', ['\u{66}', '\u{0}', '\u{0}']),
- ('\u{47}', ['\u{67}', '\u{0}', '\u{0}']), ('\u{48}', ['\u{68}', '\u{0}', '\u{0}']),
- ('\u{49}', ['\u{69}', '\u{0}', '\u{0}']), ('\u{4a}', ['\u{6a}', '\u{0}', '\u{0}']),
- ('\u{4b}', ['\u{6b}', '\u{0}', '\u{0}']), ('\u{4c}', ['\u{6c}', '\u{0}', '\u{0}']),
- ('\u{4d}', ['\u{6d}', '\u{0}', '\u{0}']), ('\u{4e}', ['\u{6e}', '\u{0}', '\u{0}']),
- ('\u{4f}', ['\u{6f}', '\u{0}', '\u{0}']), ('\u{50}', ['\u{70}', '\u{0}', '\u{0}']),
- ('\u{51}', ['\u{71}', '\u{0}', '\u{0}']), ('\u{52}', ['\u{72}', '\u{0}', '\u{0}']),
- ('\u{53}', ['\u{73}', '\u{0}', '\u{0}']), ('\u{54}', ['\u{74}', '\u{0}', '\u{0}']),
- ('\u{55}', ['\u{75}', '\u{0}', '\u{0}']), ('\u{56}', ['\u{76}', '\u{0}', '\u{0}']),
- ('\u{57}', ['\u{77}', '\u{0}', '\u{0}']), ('\u{58}', ['\u{78}', '\u{0}', '\u{0}']),
- ('\u{59}', ['\u{79}', '\u{0}', '\u{0}']), ('\u{5a}', ['\u{7a}', '\u{0}', '\u{0}']),
- ('\u{c0}', ['\u{e0}', '\u{0}', '\u{0}']), ('\u{c1}', ['\u{e1}', '\u{0}', '\u{0}']),
- ('\u{c2}', ['\u{e2}', '\u{0}', '\u{0}']), ('\u{c3}', ['\u{e3}', '\u{0}', '\u{0}']),
- ('\u{c4}', ['\u{e4}', '\u{0}', '\u{0}']), ('\u{c5}', ['\u{e5}', '\u{0}', '\u{0}']),
- ('\u{c6}', ['\u{e6}', '\u{0}', '\u{0}']), ('\u{c7}', ['\u{e7}', '\u{0}', '\u{0}']),
- ('\u{c8}', ['\u{e8}', '\u{0}', '\u{0}']), ('\u{c9}', ['\u{e9}', '\u{0}', '\u{0}']),
- ('\u{ca}', ['\u{ea}', '\u{0}', '\u{0}']), ('\u{cb}', ['\u{eb}', '\u{0}', '\u{0}']),
- ('\u{cc}', ['\u{ec}', '\u{0}', '\u{0}']), ('\u{cd}', ['\u{ed}', '\u{0}', '\u{0}']),
- ('\u{ce}', ['\u{ee}', '\u{0}', '\u{0}']), ('\u{cf}', ['\u{ef}', '\u{0}', '\u{0}']),
- ('\u{d0}', ['\u{f0}', '\u{0}', '\u{0}']), ('\u{d1}', ['\u{f1}', '\u{0}', '\u{0}']),
- ('\u{d2}', ['\u{f2}', '\u{0}', '\u{0}']), ('\u{d3}', ['\u{f3}', '\u{0}', '\u{0}']),
- ('\u{d4}', ['\u{f4}', '\u{0}', '\u{0}']), ('\u{d5}', ['\u{f5}', '\u{0}', '\u{0}']),
- ('\u{d6}', ['\u{f6}', '\u{0}', '\u{0}']), ('\u{d8}', ['\u{f8}', '\u{0}', '\u{0}']),
- ('\u{d9}', ['\u{f9}', '\u{0}', '\u{0}']), ('\u{da}', ['\u{fa}', '\u{0}', '\u{0}']),
- ('\u{db}', ['\u{fb}', '\u{0}', '\u{0}']), ('\u{dc}', ['\u{fc}', '\u{0}', '\u{0}']),
- ('\u{dd}', ['\u{fd}', '\u{0}', '\u{0}']), ('\u{de}', ['\u{fe}', '\u{0}', '\u{0}']),
- ('\u{100}', ['\u{101}', '\u{0}', '\u{0}']), ('\u{102}', ['\u{103}', '\u{0}', '\u{0}']),
- ('\u{104}', ['\u{105}', '\u{0}', '\u{0}']), ('\u{106}', ['\u{107}', '\u{0}', '\u{0}']),
- ('\u{108}', ['\u{109}', '\u{0}', '\u{0}']), ('\u{10a}', ['\u{10b}', '\u{0}', '\u{0}']),
- ('\u{10c}', ['\u{10d}', '\u{0}', '\u{0}']), ('\u{10e}', ['\u{10f}', '\u{0}', '\u{0}']),
- ('\u{110}', ['\u{111}', '\u{0}', '\u{0}']), ('\u{112}', ['\u{113}', '\u{0}', '\u{0}']),
- ('\u{114}', ['\u{115}', '\u{0}', '\u{0}']), ('\u{116}', ['\u{117}', '\u{0}', '\u{0}']),
- ('\u{118}', ['\u{119}', '\u{0}', '\u{0}']), ('\u{11a}', ['\u{11b}', '\u{0}', '\u{0}']),
- ('\u{11c}', ['\u{11d}', '\u{0}', '\u{0}']), ('\u{11e}', ['\u{11f}', '\u{0}', '\u{0}']),
- ('\u{120}', ['\u{121}', '\u{0}', '\u{0}']), ('\u{122}', ['\u{123}', '\u{0}', '\u{0}']),
- ('\u{124}', ['\u{125}', '\u{0}', '\u{0}']), ('\u{126}', ['\u{127}', '\u{0}', '\u{0}']),
- ('\u{128}', ['\u{129}', '\u{0}', '\u{0}']), ('\u{12a}', ['\u{12b}', '\u{0}', '\u{0}']),
- ('\u{12c}', ['\u{12d}', '\u{0}', '\u{0}']), ('\u{12e}', ['\u{12f}', '\u{0}', '\u{0}']),
- ('\u{130}', ['\u{69}', '\u{307}', '\u{0}']), ('\u{132}', ['\u{133}', '\u{0}', '\u{0}']),
- ('\u{134}', ['\u{135}', '\u{0}', '\u{0}']), ('\u{136}', ['\u{137}', '\u{0}', '\u{0}']),
- ('\u{139}', ['\u{13a}', '\u{0}', '\u{0}']), ('\u{13b}', ['\u{13c}', '\u{0}', '\u{0}']),
- ('\u{13d}', ['\u{13e}', '\u{0}', '\u{0}']), ('\u{13f}', ['\u{140}', '\u{0}', '\u{0}']),
- ('\u{141}', ['\u{142}', '\u{0}', '\u{0}']), ('\u{143}', ['\u{144}', '\u{0}', '\u{0}']),
- ('\u{145}', ['\u{146}', '\u{0}', '\u{0}']), ('\u{147}', ['\u{148}', '\u{0}', '\u{0}']),
- ('\u{14a}', ['\u{14b}', '\u{0}', '\u{0}']), ('\u{14c}', ['\u{14d}', '\u{0}', '\u{0}']),
- ('\u{14e}', ['\u{14f}', '\u{0}', '\u{0}']), ('\u{150}', ['\u{151}', '\u{0}', '\u{0}']),
- ('\u{152}', ['\u{153}', '\u{0}', '\u{0}']), ('\u{154}', ['\u{155}', '\u{0}', '\u{0}']),
- ('\u{156}', ['\u{157}', '\u{0}', '\u{0}']), ('\u{158}', ['\u{159}', '\u{0}', '\u{0}']),
- ('\u{15a}', ['\u{15b}', '\u{0}', '\u{0}']), ('\u{15c}', ['\u{15d}', '\u{0}', '\u{0}']),
- ('\u{15e}', ['\u{15f}', '\u{0}', '\u{0}']), ('\u{160}', ['\u{161}', '\u{0}', '\u{0}']),
- ('\u{162}', ['\u{163}', '\u{0}', '\u{0}']), ('\u{164}', ['\u{165}', '\u{0}', '\u{0}']),
- ('\u{166}', ['\u{167}', '\u{0}', '\u{0}']), ('\u{168}', ['\u{169}', '\u{0}', '\u{0}']),
- ('\u{16a}', ['\u{16b}', '\u{0}', '\u{0}']), ('\u{16c}', ['\u{16d}', '\u{0}', '\u{0}']),
- ('\u{16e}', ['\u{16f}', '\u{0}', '\u{0}']), ('\u{170}', ['\u{171}', '\u{0}', '\u{0}']),
- ('\u{172}', ['\u{173}', '\u{0}', '\u{0}']), ('\u{174}', ['\u{175}', '\u{0}', '\u{0}']),
- ('\u{176}', ['\u{177}', '\u{0}', '\u{0}']), ('\u{178}', ['\u{ff}', '\u{0}', '\u{0}']),
- ('\u{179}', ['\u{17a}', '\u{0}', '\u{0}']), ('\u{17b}', ['\u{17c}', '\u{0}', '\u{0}']),
- ('\u{17d}', ['\u{17e}', '\u{0}', '\u{0}']), ('\u{181}', ['\u{253}', '\u{0}', '\u{0}']),
- ('\u{182}', ['\u{183}', '\u{0}', '\u{0}']), ('\u{184}', ['\u{185}', '\u{0}', '\u{0}']),
- ('\u{186}', ['\u{254}', '\u{0}', '\u{0}']), ('\u{187}', ['\u{188}', '\u{0}', '\u{0}']),
- ('\u{189}', ['\u{256}', '\u{0}', '\u{0}']), ('\u{18a}', ['\u{257}', '\u{0}', '\u{0}']),
- ('\u{18b}', ['\u{18c}', '\u{0}', '\u{0}']), ('\u{18e}', ['\u{1dd}', '\u{0}', '\u{0}']),
- ('\u{18f}', ['\u{259}', '\u{0}', '\u{0}']), ('\u{190}', ['\u{25b}', '\u{0}', '\u{0}']),
- ('\u{191}', ['\u{192}', '\u{0}', '\u{0}']), ('\u{193}', ['\u{260}', '\u{0}', '\u{0}']),
- ('\u{194}', ['\u{263}', '\u{0}', '\u{0}']), ('\u{196}', ['\u{269}', '\u{0}', '\u{0}']),
- ('\u{197}', ['\u{268}', '\u{0}', '\u{0}']), ('\u{198}', ['\u{199}', '\u{0}', '\u{0}']),
- ('\u{19c}', ['\u{26f}', '\u{0}', '\u{0}']), ('\u{19d}', ['\u{272}', '\u{0}', '\u{0}']),
- ('\u{19f}', ['\u{275}', '\u{0}', '\u{0}']), ('\u{1a0}', ['\u{1a1}', '\u{0}', '\u{0}']),
- ('\u{1a2}', ['\u{1a3}', '\u{0}', '\u{0}']), ('\u{1a4}', ['\u{1a5}', '\u{0}', '\u{0}']),
- ('\u{1a6}', ['\u{280}', '\u{0}', '\u{0}']), ('\u{1a7}', ['\u{1a8}', '\u{0}', '\u{0}']),
- ('\u{1a9}', ['\u{283}', '\u{0}', '\u{0}']), ('\u{1ac}', ['\u{1ad}', '\u{0}', '\u{0}']),
- ('\u{1ae}', ['\u{288}', '\u{0}', '\u{0}']), ('\u{1af}', ['\u{1b0}', '\u{0}', '\u{0}']),
- ('\u{1b1}', ['\u{28a}', '\u{0}', '\u{0}']), ('\u{1b2}', ['\u{28b}', '\u{0}', '\u{0}']),
- ('\u{1b3}', ['\u{1b4}', '\u{0}', '\u{0}']), ('\u{1b5}', ['\u{1b6}', '\u{0}', '\u{0}']),
- ('\u{1b7}', ['\u{292}', '\u{0}', '\u{0}']), ('\u{1b8}', ['\u{1b9}', '\u{0}', '\u{0}']),
- ('\u{1bc}', ['\u{1bd}', '\u{0}', '\u{0}']), ('\u{1c4}', ['\u{1c6}', '\u{0}', '\u{0}']),
- ('\u{1c5}', ['\u{1c6}', '\u{0}', '\u{0}']), ('\u{1c7}', ['\u{1c9}', '\u{0}', '\u{0}']),
- ('\u{1c8}', ['\u{1c9}', '\u{0}', '\u{0}']), ('\u{1ca}', ['\u{1cc}', '\u{0}', '\u{0}']),
- ('\u{1cb}', ['\u{1cc}', '\u{0}', '\u{0}']), ('\u{1cd}', ['\u{1ce}', '\u{0}', '\u{0}']),
- ('\u{1cf}', ['\u{1d0}', '\u{0}', '\u{0}']), ('\u{1d1}', ['\u{1d2}', '\u{0}', '\u{0}']),
- ('\u{1d3}', ['\u{1d4}', '\u{0}', '\u{0}']), ('\u{1d5}', ['\u{1d6}', '\u{0}', '\u{0}']),
- ('\u{1d7}', ['\u{1d8}', '\u{0}', '\u{0}']), ('\u{1d9}', ['\u{1da}', '\u{0}', '\u{0}']),
- ('\u{1db}', ['\u{1dc}', '\u{0}', '\u{0}']), ('\u{1de}', ['\u{1df}', '\u{0}', '\u{0}']),
- ('\u{1e0}', ['\u{1e1}', '\u{0}', '\u{0}']), ('\u{1e2}', ['\u{1e3}', '\u{0}', '\u{0}']),
- ('\u{1e4}', ['\u{1e5}', '\u{0}', '\u{0}']), ('\u{1e6}', ['\u{1e7}', '\u{0}', '\u{0}']),
- ('\u{1e8}', ['\u{1e9}', '\u{0}', '\u{0}']), ('\u{1ea}', ['\u{1eb}', '\u{0}', '\u{0}']),
- ('\u{1ec}', ['\u{1ed}', '\u{0}', '\u{0}']), ('\u{1ee}', ['\u{1ef}', '\u{0}', '\u{0}']),
- ('\u{1f1}', ['\u{1f3}', '\u{0}', '\u{0}']), ('\u{1f2}', ['\u{1f3}', '\u{0}', '\u{0}']),
- ('\u{1f4}', ['\u{1f5}', '\u{0}', '\u{0}']), ('\u{1f6}', ['\u{195}', '\u{0}', '\u{0}']),
- ('\u{1f7}', ['\u{1bf}', '\u{0}', '\u{0}']), ('\u{1f8}', ['\u{1f9}', '\u{0}', '\u{0}']),
- ('\u{1fa}', ['\u{1fb}', '\u{0}', '\u{0}']), ('\u{1fc}', ['\u{1fd}', '\u{0}', '\u{0}']),
- ('\u{1fe}', ['\u{1ff}', '\u{0}', '\u{0}']), ('\u{200}', ['\u{201}', '\u{0}', '\u{0}']),
- ('\u{202}', ['\u{203}', '\u{0}', '\u{0}']), ('\u{204}', ['\u{205}', '\u{0}', '\u{0}']),
- ('\u{206}', ['\u{207}', '\u{0}', '\u{0}']), ('\u{208}', ['\u{209}', '\u{0}', '\u{0}']),
- ('\u{20a}', ['\u{20b}', '\u{0}', '\u{0}']), ('\u{20c}', ['\u{20d}', '\u{0}', '\u{0}']),
- ('\u{20e}', ['\u{20f}', '\u{0}', '\u{0}']), ('\u{210}', ['\u{211}', '\u{0}', '\u{0}']),
- ('\u{212}', ['\u{213}', '\u{0}', '\u{0}']), ('\u{214}', ['\u{215}', '\u{0}', '\u{0}']),
- ('\u{216}', ['\u{217}', '\u{0}', '\u{0}']), ('\u{218}', ['\u{219}', '\u{0}', '\u{0}']),
- ('\u{21a}', ['\u{21b}', '\u{0}', '\u{0}']), ('\u{21c}', ['\u{21d}', '\u{0}', '\u{0}']),
- ('\u{21e}', ['\u{21f}', '\u{0}', '\u{0}']), ('\u{220}', ['\u{19e}', '\u{0}', '\u{0}']),
- ('\u{222}', ['\u{223}', '\u{0}', '\u{0}']), ('\u{224}', ['\u{225}', '\u{0}', '\u{0}']),
- ('\u{226}', ['\u{227}', '\u{0}', '\u{0}']), ('\u{228}', ['\u{229}', '\u{0}', '\u{0}']),
- ('\u{22a}', ['\u{22b}', '\u{0}', '\u{0}']), ('\u{22c}', ['\u{22d}', '\u{0}', '\u{0}']),
- ('\u{22e}', ['\u{22f}', '\u{0}', '\u{0}']), ('\u{230}', ['\u{231}', '\u{0}', '\u{0}']),
- ('\u{232}', ['\u{233}', '\u{0}', '\u{0}']), ('\u{23a}', ['\u{2c65}', '\u{0}', '\u{0}']),
- ('\u{23b}', ['\u{23c}', '\u{0}', '\u{0}']), ('\u{23d}', ['\u{19a}', '\u{0}', '\u{0}']),
- ('\u{23e}', ['\u{2c66}', '\u{0}', '\u{0}']), ('\u{241}', ['\u{242}', '\u{0}', '\u{0}']),
- ('\u{243}', ['\u{180}', '\u{0}', '\u{0}']), ('\u{244}', ['\u{289}', '\u{0}', '\u{0}']),
- ('\u{245}', ['\u{28c}', '\u{0}', '\u{0}']), ('\u{246}', ['\u{247}', '\u{0}', '\u{0}']),
- ('\u{248}', ['\u{249}', '\u{0}', '\u{0}']), ('\u{24a}', ['\u{24b}', '\u{0}', '\u{0}']),
- ('\u{24c}', ['\u{24d}', '\u{0}', '\u{0}']), ('\u{24e}', ['\u{24f}', '\u{0}', '\u{0}']),
- ('\u{370}', ['\u{371}', '\u{0}', '\u{0}']), ('\u{372}', ['\u{373}', '\u{0}', '\u{0}']),
- ('\u{376}', ['\u{377}', '\u{0}', '\u{0}']), ('\u{37f}', ['\u{3f3}', '\u{0}', '\u{0}']),
- ('\u{386}', ['\u{3ac}', '\u{0}', '\u{0}']), ('\u{388}', ['\u{3ad}', '\u{0}', '\u{0}']),
- ('\u{389}', ['\u{3ae}', '\u{0}', '\u{0}']), ('\u{38a}', ['\u{3af}', '\u{0}', '\u{0}']),
- ('\u{38c}', ['\u{3cc}', '\u{0}', '\u{0}']), ('\u{38e}', ['\u{3cd}', '\u{0}', '\u{0}']),
- ('\u{38f}', ['\u{3ce}', '\u{0}', '\u{0}']), ('\u{391}', ['\u{3b1}', '\u{0}', '\u{0}']),
- ('\u{392}', ['\u{3b2}', '\u{0}', '\u{0}']), ('\u{393}', ['\u{3b3}', '\u{0}', '\u{0}']),
- ('\u{394}', ['\u{3b4}', '\u{0}', '\u{0}']), ('\u{395}', ['\u{3b5}', '\u{0}', '\u{0}']),
- ('\u{396}', ['\u{3b6}', '\u{0}', '\u{0}']), ('\u{397}', ['\u{3b7}', '\u{0}', '\u{0}']),
- ('\u{398}', ['\u{3b8}', '\u{0}', '\u{0}']), ('\u{399}', ['\u{3b9}', '\u{0}', '\u{0}']),
- ('\u{39a}', ['\u{3ba}', '\u{0}', '\u{0}']), ('\u{39b}', ['\u{3bb}', '\u{0}', '\u{0}']),
- ('\u{39c}', ['\u{3bc}', '\u{0}', '\u{0}']), ('\u{39d}', ['\u{3bd}', '\u{0}', '\u{0}']),
- ('\u{39e}', ['\u{3be}', '\u{0}', '\u{0}']), ('\u{39f}', ['\u{3bf}', '\u{0}', '\u{0}']),
- ('\u{3a0}', ['\u{3c0}', '\u{0}', '\u{0}']), ('\u{3a1}', ['\u{3c1}', '\u{0}', '\u{0}']),
- ('\u{3a3}', ['\u{3c3}', '\u{0}', '\u{0}']), ('\u{3a4}', ['\u{3c4}', '\u{0}', '\u{0}']),
- ('\u{3a5}', ['\u{3c5}', '\u{0}', '\u{0}']), ('\u{3a6}', ['\u{3c6}', '\u{0}', '\u{0}']),
- ('\u{3a7}', ['\u{3c7}', '\u{0}', '\u{0}']), ('\u{3a8}', ['\u{3c8}', '\u{0}', '\u{0}']),
- ('\u{3a9}', ['\u{3c9}', '\u{0}', '\u{0}']), ('\u{3aa}', ['\u{3ca}', '\u{0}', '\u{0}']),
- ('\u{3ab}', ['\u{3cb}', '\u{0}', '\u{0}']), ('\u{3cf}', ['\u{3d7}', '\u{0}', '\u{0}']),
- ('\u{3d8}', ['\u{3d9}', '\u{0}', '\u{0}']), ('\u{3da}', ['\u{3db}', '\u{0}', '\u{0}']),
- ('\u{3dc}', ['\u{3dd}', '\u{0}', '\u{0}']), ('\u{3de}', ['\u{3df}', '\u{0}', '\u{0}']),
- ('\u{3e0}', ['\u{3e1}', '\u{0}', '\u{0}']), ('\u{3e2}', ['\u{3e3}', '\u{0}', '\u{0}']),
- ('\u{3e4}', ['\u{3e5}', '\u{0}', '\u{0}']), ('\u{3e6}', ['\u{3e7}', '\u{0}', '\u{0}']),
- ('\u{3e8}', ['\u{3e9}', '\u{0}', '\u{0}']), ('\u{3ea}', ['\u{3eb}', '\u{0}', '\u{0}']),
- ('\u{3ec}', ['\u{3ed}', '\u{0}', '\u{0}']), ('\u{3ee}', ['\u{3ef}', '\u{0}', '\u{0}']),
- ('\u{3f4}', ['\u{3b8}', '\u{0}', '\u{0}']), ('\u{3f7}', ['\u{3f8}', '\u{0}', '\u{0}']),
- ('\u{3f9}', ['\u{3f2}', '\u{0}', '\u{0}']), ('\u{3fa}', ['\u{3fb}', '\u{0}', '\u{0}']),
- ('\u{3fd}', ['\u{37b}', '\u{0}', '\u{0}']), ('\u{3fe}', ['\u{37c}', '\u{0}', '\u{0}']),
- ('\u{3ff}', ['\u{37d}', '\u{0}', '\u{0}']), ('\u{400}', ['\u{450}', '\u{0}', '\u{0}']),
- ('\u{401}', ['\u{451}', '\u{0}', '\u{0}']), ('\u{402}', ['\u{452}', '\u{0}', '\u{0}']),
- ('\u{403}', ['\u{453}', '\u{0}', '\u{0}']), ('\u{404}', ['\u{454}', '\u{0}', '\u{0}']),
- ('\u{405}', ['\u{455}', '\u{0}', '\u{0}']), ('\u{406}', ['\u{456}', '\u{0}', '\u{0}']),
- ('\u{407}', ['\u{457}', '\u{0}', '\u{0}']), ('\u{408}', ['\u{458}', '\u{0}', '\u{0}']),
- ('\u{409}', ['\u{459}', '\u{0}', '\u{0}']), ('\u{40a}', ['\u{45a}', '\u{0}', '\u{0}']),
- ('\u{40b}', ['\u{45b}', '\u{0}', '\u{0}']), ('\u{40c}', ['\u{45c}', '\u{0}', '\u{0}']),
- ('\u{40d}', ['\u{45d}', '\u{0}', '\u{0}']), ('\u{40e}', ['\u{45e}', '\u{0}', '\u{0}']),
- ('\u{40f}', ['\u{45f}', '\u{0}', '\u{0}']), ('\u{410}', ['\u{430}', '\u{0}', '\u{0}']),
- ('\u{411}', ['\u{431}', '\u{0}', '\u{0}']), ('\u{412}', ['\u{432}', '\u{0}', '\u{0}']),
- ('\u{413}', ['\u{433}', '\u{0}', '\u{0}']), ('\u{414}', ['\u{434}', '\u{0}', '\u{0}']),
- ('\u{415}', ['\u{435}', '\u{0}', '\u{0}']), ('\u{416}', ['\u{436}', '\u{0}', '\u{0}']),
- ('\u{417}', ['\u{437}', '\u{0}', '\u{0}']), ('\u{418}', ['\u{438}', '\u{0}', '\u{0}']),
- ('\u{419}', ['\u{439}', '\u{0}', '\u{0}']), ('\u{41a}', ['\u{43a}', '\u{0}', '\u{0}']),
- ('\u{41b}', ['\u{43b}', '\u{0}', '\u{0}']), ('\u{41c}', ['\u{43c}', '\u{0}', '\u{0}']),
- ('\u{41d}', ['\u{43d}', '\u{0}', '\u{0}']), ('\u{41e}', ['\u{43e}', '\u{0}', '\u{0}']),
- ('\u{41f}', ['\u{43f}', '\u{0}', '\u{0}']), ('\u{420}', ['\u{440}', '\u{0}', '\u{0}']),
- ('\u{421}', ['\u{441}', '\u{0}', '\u{0}']), ('\u{422}', ['\u{442}', '\u{0}', '\u{0}']),
- ('\u{423}', ['\u{443}', '\u{0}', '\u{0}']), ('\u{424}', ['\u{444}', '\u{0}', '\u{0}']),
- ('\u{425}', ['\u{445}', '\u{0}', '\u{0}']), ('\u{426}', ['\u{446}', '\u{0}', '\u{0}']),
- ('\u{427}', ['\u{447}', '\u{0}', '\u{0}']), ('\u{428}', ['\u{448}', '\u{0}', '\u{0}']),
- ('\u{429}', ['\u{449}', '\u{0}', '\u{0}']), ('\u{42a}', ['\u{44a}', '\u{0}', '\u{0}']),
- ('\u{42b}', ['\u{44b}', '\u{0}', '\u{0}']), ('\u{42c}', ['\u{44c}', '\u{0}', '\u{0}']),
- ('\u{42d}', ['\u{44d}', '\u{0}', '\u{0}']), ('\u{42e}', ['\u{44e}', '\u{0}', '\u{0}']),
- ('\u{42f}', ['\u{44f}', '\u{0}', '\u{0}']), ('\u{460}', ['\u{461}', '\u{0}', '\u{0}']),
- ('\u{462}', ['\u{463}', '\u{0}', '\u{0}']), ('\u{464}', ['\u{465}', '\u{0}', '\u{0}']),
- ('\u{466}', ['\u{467}', '\u{0}', '\u{0}']), ('\u{468}', ['\u{469}', '\u{0}', '\u{0}']),
- ('\u{46a}', ['\u{46b}', '\u{0}', '\u{0}']), ('\u{46c}', ['\u{46d}', '\u{0}', '\u{0}']),
- ('\u{46e}', ['\u{46f}', '\u{0}', '\u{0}']), ('\u{470}', ['\u{471}', '\u{0}', '\u{0}']),
- ('\u{472}', ['\u{473}', '\u{0}', '\u{0}']), ('\u{474}', ['\u{475}', '\u{0}', '\u{0}']),
- ('\u{476}', ['\u{477}', '\u{0}', '\u{0}']), ('\u{478}', ['\u{479}', '\u{0}', '\u{0}']),
- ('\u{47a}', ['\u{47b}', '\u{0}', '\u{0}']), ('\u{47c}', ['\u{47d}', '\u{0}', '\u{0}']),
- ('\u{47e}', ['\u{47f}', '\u{0}', '\u{0}']), ('\u{480}', ['\u{481}', '\u{0}', '\u{0}']),
- ('\u{48a}', ['\u{48b}', '\u{0}', '\u{0}']), ('\u{48c}', ['\u{48d}', '\u{0}', '\u{0}']),
- ('\u{48e}', ['\u{48f}', '\u{0}', '\u{0}']), ('\u{490}', ['\u{491}', '\u{0}', '\u{0}']),
- ('\u{492}', ['\u{493}', '\u{0}', '\u{0}']), ('\u{494}', ['\u{495}', '\u{0}', '\u{0}']),
- ('\u{496}', ['\u{497}', '\u{0}', '\u{0}']), ('\u{498}', ['\u{499}', '\u{0}', '\u{0}']),
- ('\u{49a}', ['\u{49b}', '\u{0}', '\u{0}']), ('\u{49c}', ['\u{49d}', '\u{0}', '\u{0}']),
- ('\u{49e}', ['\u{49f}', '\u{0}', '\u{0}']), ('\u{4a0}', ['\u{4a1}', '\u{0}', '\u{0}']),
- ('\u{4a2}', ['\u{4a3}', '\u{0}', '\u{0}']), ('\u{4a4}', ['\u{4a5}', '\u{0}', '\u{0}']),
- ('\u{4a6}', ['\u{4a7}', '\u{0}', '\u{0}']), ('\u{4a8}', ['\u{4a9}', '\u{0}', '\u{0}']),
- ('\u{4aa}', ['\u{4ab}', '\u{0}', '\u{0}']), ('\u{4ac}', ['\u{4ad}', '\u{0}', '\u{0}']),
- ('\u{4ae}', ['\u{4af}', '\u{0}', '\u{0}']), ('\u{4b0}', ['\u{4b1}', '\u{0}', '\u{0}']),
- ('\u{4b2}', ['\u{4b3}', '\u{0}', '\u{0}']), ('\u{4b4}', ['\u{4b5}', '\u{0}', '\u{0}']),
- ('\u{4b6}', ['\u{4b7}', '\u{0}', '\u{0}']), ('\u{4b8}', ['\u{4b9}', '\u{0}', '\u{0}']),
- ('\u{4ba}', ['\u{4bb}', '\u{0}', '\u{0}']), ('\u{4bc}', ['\u{4bd}', '\u{0}', '\u{0}']),
- ('\u{4be}', ['\u{4bf}', '\u{0}', '\u{0}']), ('\u{4c0}', ['\u{4cf}', '\u{0}', '\u{0}']),
- ('\u{4c1}', ['\u{4c2}', '\u{0}', '\u{0}']), ('\u{4c3}', ['\u{4c4}', '\u{0}', '\u{0}']),
- ('\u{4c5}', ['\u{4c6}', '\u{0}', '\u{0}']), ('\u{4c7}', ['\u{4c8}', '\u{0}', '\u{0}']),
- ('\u{4c9}', ['\u{4ca}', '\u{0}', '\u{0}']), ('\u{4cb}', ['\u{4cc}', '\u{0}', '\u{0}']),
- ('\u{4cd}', ['\u{4ce}', '\u{0}', '\u{0}']), ('\u{4d0}', ['\u{4d1}', '\u{0}', '\u{0}']),
- ('\u{4d2}', ['\u{4d3}', '\u{0}', '\u{0}']), ('\u{4d4}', ['\u{4d5}', '\u{0}', '\u{0}']),
- ('\u{4d6}', ['\u{4d7}', '\u{0}', '\u{0}']), ('\u{4d8}', ['\u{4d9}', '\u{0}', '\u{0}']),
- ('\u{4da}', ['\u{4db}', '\u{0}', '\u{0}']), ('\u{4dc}', ['\u{4dd}', '\u{0}', '\u{0}']),
- ('\u{4de}', ['\u{4df}', '\u{0}', '\u{0}']), ('\u{4e0}', ['\u{4e1}', '\u{0}', '\u{0}']),
- ('\u{4e2}', ['\u{4e3}', '\u{0}', '\u{0}']), ('\u{4e4}', ['\u{4e5}', '\u{0}', '\u{0}']),
- ('\u{4e6}', ['\u{4e7}', '\u{0}', '\u{0}']), ('\u{4e8}', ['\u{4e9}', '\u{0}', '\u{0}']),
- ('\u{4ea}', ['\u{4eb}', '\u{0}', '\u{0}']), ('\u{4ec}', ['\u{4ed}', '\u{0}', '\u{0}']),
- ('\u{4ee}', ['\u{4ef}', '\u{0}', '\u{0}']), ('\u{4f0}', ['\u{4f1}', '\u{0}', '\u{0}']),
- ('\u{4f2}', ['\u{4f3}', '\u{0}', '\u{0}']), ('\u{4f4}', ['\u{4f5}', '\u{0}', '\u{0}']),
- ('\u{4f6}', ['\u{4f7}', '\u{0}', '\u{0}']), ('\u{4f8}', ['\u{4f9}', '\u{0}', '\u{0}']),
- ('\u{4fa}', ['\u{4fb}', '\u{0}', '\u{0}']), ('\u{4fc}', ['\u{4fd}', '\u{0}', '\u{0}']),
- ('\u{4fe}', ['\u{4ff}', '\u{0}', '\u{0}']), ('\u{500}', ['\u{501}', '\u{0}', '\u{0}']),
- ('\u{502}', ['\u{503}', '\u{0}', '\u{0}']), ('\u{504}', ['\u{505}', '\u{0}', '\u{0}']),
- ('\u{506}', ['\u{507}', '\u{0}', '\u{0}']), ('\u{508}', ['\u{509}', '\u{0}', '\u{0}']),
- ('\u{50a}', ['\u{50b}', '\u{0}', '\u{0}']), ('\u{50c}', ['\u{50d}', '\u{0}', '\u{0}']),
- ('\u{50e}', ['\u{50f}', '\u{0}', '\u{0}']), ('\u{510}', ['\u{511}', '\u{0}', '\u{0}']),
- ('\u{512}', ['\u{513}', '\u{0}', '\u{0}']), ('\u{514}', ['\u{515}', '\u{0}', '\u{0}']),
- ('\u{516}', ['\u{517}', '\u{0}', '\u{0}']), ('\u{518}', ['\u{519}', '\u{0}', '\u{0}']),
- ('\u{51a}', ['\u{51b}', '\u{0}', '\u{0}']), ('\u{51c}', ['\u{51d}', '\u{0}', '\u{0}']),
- ('\u{51e}', ['\u{51f}', '\u{0}', '\u{0}']), ('\u{520}', ['\u{521}', '\u{0}', '\u{0}']),
- ('\u{522}', ['\u{523}', '\u{0}', '\u{0}']), ('\u{524}', ['\u{525}', '\u{0}', '\u{0}']),
- ('\u{526}', ['\u{527}', '\u{0}', '\u{0}']), ('\u{528}', ['\u{529}', '\u{0}', '\u{0}']),
- ('\u{52a}', ['\u{52b}', '\u{0}', '\u{0}']), ('\u{52c}', ['\u{52d}', '\u{0}', '\u{0}']),
- ('\u{52e}', ['\u{52f}', '\u{0}', '\u{0}']), ('\u{531}', ['\u{561}', '\u{0}', '\u{0}']),
- ('\u{532}', ['\u{562}', '\u{0}', '\u{0}']), ('\u{533}', ['\u{563}', '\u{0}', '\u{0}']),
- ('\u{534}', ['\u{564}', '\u{0}', '\u{0}']), ('\u{535}', ['\u{565}', '\u{0}', '\u{0}']),
- ('\u{536}', ['\u{566}', '\u{0}', '\u{0}']), ('\u{537}', ['\u{567}', '\u{0}', '\u{0}']),
- ('\u{538}', ['\u{568}', '\u{0}', '\u{0}']), ('\u{539}', ['\u{569}', '\u{0}', '\u{0}']),
- ('\u{53a}', ['\u{56a}', '\u{0}', '\u{0}']), ('\u{53b}', ['\u{56b}', '\u{0}', '\u{0}']),
- ('\u{53c}', ['\u{56c}', '\u{0}', '\u{0}']), ('\u{53d}', ['\u{56d}', '\u{0}', '\u{0}']),
- ('\u{53e}', ['\u{56e}', '\u{0}', '\u{0}']), ('\u{53f}', ['\u{56f}', '\u{0}', '\u{0}']),
- ('\u{540}', ['\u{570}', '\u{0}', '\u{0}']), ('\u{541}', ['\u{571}', '\u{0}', '\u{0}']),
- ('\u{542}', ['\u{572}', '\u{0}', '\u{0}']), ('\u{543}', ['\u{573}', '\u{0}', '\u{0}']),
- ('\u{544}', ['\u{574}', '\u{0}', '\u{0}']), ('\u{545}', ['\u{575}', '\u{0}', '\u{0}']),
- ('\u{546}', ['\u{576}', '\u{0}', '\u{0}']), ('\u{547}', ['\u{577}', '\u{0}', '\u{0}']),
- ('\u{548}', ['\u{578}', '\u{0}', '\u{0}']), ('\u{549}', ['\u{579}', '\u{0}', '\u{0}']),
- ('\u{54a}', ['\u{57a}', '\u{0}', '\u{0}']), ('\u{54b}', ['\u{57b}', '\u{0}', '\u{0}']),
- ('\u{54c}', ['\u{57c}', '\u{0}', '\u{0}']), ('\u{54d}', ['\u{57d}', '\u{0}', '\u{0}']),
- ('\u{54e}', ['\u{57e}', '\u{0}', '\u{0}']), ('\u{54f}', ['\u{57f}', '\u{0}', '\u{0}']),
- ('\u{550}', ['\u{580}', '\u{0}', '\u{0}']), ('\u{551}', ['\u{581}', '\u{0}', '\u{0}']),
- ('\u{552}', ['\u{582}', '\u{0}', '\u{0}']), ('\u{553}', ['\u{583}', '\u{0}', '\u{0}']),
- ('\u{554}', ['\u{584}', '\u{0}', '\u{0}']), ('\u{555}', ['\u{585}', '\u{0}', '\u{0}']),
- ('\u{556}', ['\u{586}', '\u{0}', '\u{0}']), ('\u{10a0}', ['\u{2d00}', '\u{0}', '\u{0}']),
- ('\u{10a1}', ['\u{2d01}', '\u{0}', '\u{0}']), ('\u{10a2}', ['\u{2d02}', '\u{0}', '\u{0}']),
- ('\u{10a3}', ['\u{2d03}', '\u{0}', '\u{0}']), ('\u{10a4}', ['\u{2d04}', '\u{0}', '\u{0}']),
- ('\u{10a5}', ['\u{2d05}', '\u{0}', '\u{0}']), ('\u{10a6}', ['\u{2d06}', '\u{0}', '\u{0}']),
- ('\u{10a7}', ['\u{2d07}', '\u{0}', '\u{0}']), ('\u{10a8}', ['\u{2d08}', '\u{0}', '\u{0}']),
- ('\u{10a9}', ['\u{2d09}', '\u{0}', '\u{0}']), ('\u{10aa}', ['\u{2d0a}', '\u{0}', '\u{0}']),
- ('\u{10ab}', ['\u{2d0b}', '\u{0}', '\u{0}']), ('\u{10ac}', ['\u{2d0c}', '\u{0}', '\u{0}']),
- ('\u{10ad}', ['\u{2d0d}', '\u{0}', '\u{0}']), ('\u{10ae}', ['\u{2d0e}', '\u{0}', '\u{0}']),
- ('\u{10af}', ['\u{2d0f}', '\u{0}', '\u{0}']), ('\u{10b0}', ['\u{2d10}', '\u{0}', '\u{0}']),
- ('\u{10b1}', ['\u{2d11}', '\u{0}', '\u{0}']), ('\u{10b2}', ['\u{2d12}', '\u{0}', '\u{0}']),
- ('\u{10b3}', ['\u{2d13}', '\u{0}', '\u{0}']), ('\u{10b4}', ['\u{2d14}', '\u{0}', '\u{0}']),
- ('\u{10b5}', ['\u{2d15}', '\u{0}', '\u{0}']), ('\u{10b6}', ['\u{2d16}', '\u{0}', '\u{0}']),
- ('\u{10b7}', ['\u{2d17}', '\u{0}', '\u{0}']), ('\u{10b8}', ['\u{2d18}', '\u{0}', '\u{0}']),
- ('\u{10b9}', ['\u{2d19}', '\u{0}', '\u{0}']), ('\u{10ba}', ['\u{2d1a}', '\u{0}', '\u{0}']),
- ('\u{10bb}', ['\u{2d1b}', '\u{0}', '\u{0}']), ('\u{10bc}', ['\u{2d1c}', '\u{0}', '\u{0}']),
- ('\u{10bd}', ['\u{2d1d}', '\u{0}', '\u{0}']), ('\u{10be}', ['\u{2d1e}', '\u{0}', '\u{0}']),
- ('\u{10bf}', ['\u{2d1f}', '\u{0}', '\u{0}']), ('\u{10c0}', ['\u{2d20}', '\u{0}', '\u{0}']),
- ('\u{10c1}', ['\u{2d21}', '\u{0}', '\u{0}']), ('\u{10c2}', ['\u{2d22}', '\u{0}', '\u{0}']),
- ('\u{10c3}', ['\u{2d23}', '\u{0}', '\u{0}']), ('\u{10c4}', ['\u{2d24}', '\u{0}', '\u{0}']),
- ('\u{10c5}', ['\u{2d25}', '\u{0}', '\u{0}']), ('\u{10c7}', ['\u{2d27}', '\u{0}', '\u{0}']),
- ('\u{10cd}', ['\u{2d2d}', '\u{0}', '\u{0}']), ('\u{13a0}', ['\u{ab70}', '\u{0}', '\u{0}']),
- ('\u{13a1}', ['\u{ab71}', '\u{0}', '\u{0}']), ('\u{13a2}', ['\u{ab72}', '\u{0}', '\u{0}']),
- ('\u{13a3}', ['\u{ab73}', '\u{0}', '\u{0}']), ('\u{13a4}', ['\u{ab74}', '\u{0}', '\u{0}']),
- ('\u{13a5}', ['\u{ab75}', '\u{0}', '\u{0}']), ('\u{13a6}', ['\u{ab76}', '\u{0}', '\u{0}']),
- ('\u{13a7}', ['\u{ab77}', '\u{0}', '\u{0}']), ('\u{13a8}', ['\u{ab78}', '\u{0}', '\u{0}']),
- ('\u{13a9}', ['\u{ab79}', '\u{0}', '\u{0}']), ('\u{13aa}', ['\u{ab7a}', '\u{0}', '\u{0}']),
- ('\u{13ab}', ['\u{ab7b}', '\u{0}', '\u{0}']), ('\u{13ac}', ['\u{ab7c}', '\u{0}', '\u{0}']),
- ('\u{13ad}', ['\u{ab7d}', '\u{0}', '\u{0}']), ('\u{13ae}', ['\u{ab7e}', '\u{0}', '\u{0}']),
- ('\u{13af}', ['\u{ab7f}', '\u{0}', '\u{0}']), ('\u{13b0}', ['\u{ab80}', '\u{0}', '\u{0}']),
- ('\u{13b1}', ['\u{ab81}', '\u{0}', '\u{0}']), ('\u{13b2}', ['\u{ab82}', '\u{0}', '\u{0}']),
- ('\u{13b3}', ['\u{ab83}', '\u{0}', '\u{0}']), ('\u{13b4}', ['\u{ab84}', '\u{0}', '\u{0}']),
- ('\u{13b5}', ['\u{ab85}', '\u{0}', '\u{0}']), ('\u{13b6}', ['\u{ab86}', '\u{0}', '\u{0}']),
- ('\u{13b7}', ['\u{ab87}', '\u{0}', '\u{0}']), ('\u{13b8}', ['\u{ab88}', '\u{0}', '\u{0}']),
- ('\u{13b9}', ['\u{ab89}', '\u{0}', '\u{0}']), ('\u{13ba}', ['\u{ab8a}', '\u{0}', '\u{0}']),
- ('\u{13bb}', ['\u{ab8b}', '\u{0}', '\u{0}']), ('\u{13bc}', ['\u{ab8c}', '\u{0}', '\u{0}']),
- ('\u{13bd}', ['\u{ab8d}', '\u{0}', '\u{0}']), ('\u{13be}', ['\u{ab8e}', '\u{0}', '\u{0}']),
- ('\u{13bf}', ['\u{ab8f}', '\u{0}', '\u{0}']), ('\u{13c0}', ['\u{ab90}', '\u{0}', '\u{0}']),
- ('\u{13c1}', ['\u{ab91}', '\u{0}', '\u{0}']), ('\u{13c2}', ['\u{ab92}', '\u{0}', '\u{0}']),
- ('\u{13c3}', ['\u{ab93}', '\u{0}', '\u{0}']), ('\u{13c4}', ['\u{ab94}', '\u{0}', '\u{0}']),
- ('\u{13c5}', ['\u{ab95}', '\u{0}', '\u{0}']), ('\u{13c6}', ['\u{ab96}', '\u{0}', '\u{0}']),
- ('\u{13c7}', ['\u{ab97}', '\u{0}', '\u{0}']), ('\u{13c8}', ['\u{ab98}', '\u{0}', '\u{0}']),
- ('\u{13c9}', ['\u{ab99}', '\u{0}', '\u{0}']), ('\u{13ca}', ['\u{ab9a}', '\u{0}', '\u{0}']),
- ('\u{13cb}', ['\u{ab9b}', '\u{0}', '\u{0}']), ('\u{13cc}', ['\u{ab9c}', '\u{0}', '\u{0}']),
- ('\u{13cd}', ['\u{ab9d}', '\u{0}', '\u{0}']), ('\u{13ce}', ['\u{ab9e}', '\u{0}', '\u{0}']),
- ('\u{13cf}', ['\u{ab9f}', '\u{0}', '\u{0}']), ('\u{13d0}', ['\u{aba0}', '\u{0}', '\u{0}']),
- ('\u{13d1}', ['\u{aba1}', '\u{0}', '\u{0}']), ('\u{13d2}', ['\u{aba2}', '\u{0}', '\u{0}']),
- ('\u{13d3}', ['\u{aba3}', '\u{0}', '\u{0}']), ('\u{13d4}', ['\u{aba4}', '\u{0}', '\u{0}']),
- ('\u{13d5}', ['\u{aba5}', '\u{0}', '\u{0}']), ('\u{13d6}', ['\u{aba6}', '\u{0}', '\u{0}']),
- ('\u{13d7}', ['\u{aba7}', '\u{0}', '\u{0}']), ('\u{13d8}', ['\u{aba8}', '\u{0}', '\u{0}']),
- ('\u{13d9}', ['\u{aba9}', '\u{0}', '\u{0}']), ('\u{13da}', ['\u{abaa}', '\u{0}', '\u{0}']),
- ('\u{13db}', ['\u{abab}', '\u{0}', '\u{0}']), ('\u{13dc}', ['\u{abac}', '\u{0}', '\u{0}']),
- ('\u{13dd}', ['\u{abad}', '\u{0}', '\u{0}']), ('\u{13de}', ['\u{abae}', '\u{0}', '\u{0}']),
- ('\u{13df}', ['\u{abaf}', '\u{0}', '\u{0}']), ('\u{13e0}', ['\u{abb0}', '\u{0}', '\u{0}']),
- ('\u{13e1}', ['\u{abb1}', '\u{0}', '\u{0}']), ('\u{13e2}', ['\u{abb2}', '\u{0}', '\u{0}']),
- ('\u{13e3}', ['\u{abb3}', '\u{0}', '\u{0}']), ('\u{13e4}', ['\u{abb4}', '\u{0}', '\u{0}']),
- ('\u{13e5}', ['\u{abb5}', '\u{0}', '\u{0}']), ('\u{13e6}', ['\u{abb6}', '\u{0}', '\u{0}']),
- ('\u{13e7}', ['\u{abb7}', '\u{0}', '\u{0}']), ('\u{13e8}', ['\u{abb8}', '\u{0}', '\u{0}']),
- ('\u{13e9}', ['\u{abb9}', '\u{0}', '\u{0}']), ('\u{13ea}', ['\u{abba}', '\u{0}', '\u{0}']),
- ('\u{13eb}', ['\u{abbb}', '\u{0}', '\u{0}']), ('\u{13ec}', ['\u{abbc}', '\u{0}', '\u{0}']),
- ('\u{13ed}', ['\u{abbd}', '\u{0}', '\u{0}']), ('\u{13ee}', ['\u{abbe}', '\u{0}', '\u{0}']),
- ('\u{13ef}', ['\u{abbf}', '\u{0}', '\u{0}']), ('\u{13f0}', ['\u{13f8}', '\u{0}', '\u{0}']),
- ('\u{13f1}', ['\u{13f9}', '\u{0}', '\u{0}']), ('\u{13f2}', ['\u{13fa}', '\u{0}', '\u{0}']),
- ('\u{13f3}', ['\u{13fb}', '\u{0}', '\u{0}']), ('\u{13f4}', ['\u{13fc}', '\u{0}', '\u{0}']),
- ('\u{13f5}', ['\u{13fd}', '\u{0}', '\u{0}']), ('\u{1c89}', ['\u{1c8a}', '\u{0}', '\u{0}']),
- ('\u{1c90}', ['\u{10d0}', '\u{0}', '\u{0}']), ('\u{1c91}', ['\u{10d1}', '\u{0}', '\u{0}']),
- ('\u{1c92}', ['\u{10d2}', '\u{0}', '\u{0}']), ('\u{1c93}', ['\u{10d3}', '\u{0}', '\u{0}']),
- ('\u{1c94}', ['\u{10d4}', '\u{0}', '\u{0}']), ('\u{1c95}', ['\u{10d5}', '\u{0}', '\u{0}']),
- ('\u{1c96}', ['\u{10d6}', '\u{0}', '\u{0}']), ('\u{1c97}', ['\u{10d7}', '\u{0}', '\u{0}']),
- ('\u{1c98}', ['\u{10d8}', '\u{0}', '\u{0}']), ('\u{1c99}', ['\u{10d9}', '\u{0}', '\u{0}']),
- ('\u{1c9a}', ['\u{10da}', '\u{0}', '\u{0}']), ('\u{1c9b}', ['\u{10db}', '\u{0}', '\u{0}']),
- ('\u{1c9c}', ['\u{10dc}', '\u{0}', '\u{0}']), ('\u{1c9d}', ['\u{10dd}', '\u{0}', '\u{0}']),
- ('\u{1c9e}', ['\u{10de}', '\u{0}', '\u{0}']), ('\u{1c9f}', ['\u{10df}', '\u{0}', '\u{0}']),
- ('\u{1ca0}', ['\u{10e0}', '\u{0}', '\u{0}']), ('\u{1ca1}', ['\u{10e1}', '\u{0}', '\u{0}']),
- ('\u{1ca2}', ['\u{10e2}', '\u{0}', '\u{0}']), ('\u{1ca3}', ['\u{10e3}', '\u{0}', '\u{0}']),
- ('\u{1ca4}', ['\u{10e4}', '\u{0}', '\u{0}']), ('\u{1ca5}', ['\u{10e5}', '\u{0}', '\u{0}']),
- ('\u{1ca6}', ['\u{10e6}', '\u{0}', '\u{0}']), ('\u{1ca7}', ['\u{10e7}', '\u{0}', '\u{0}']),
- ('\u{1ca8}', ['\u{10e8}', '\u{0}', '\u{0}']), ('\u{1ca9}', ['\u{10e9}', '\u{0}', '\u{0}']),
- ('\u{1caa}', ['\u{10ea}', '\u{0}', '\u{0}']), ('\u{1cab}', ['\u{10eb}', '\u{0}', '\u{0}']),
- ('\u{1cac}', ['\u{10ec}', '\u{0}', '\u{0}']), ('\u{1cad}', ['\u{10ed}', '\u{0}', '\u{0}']),
- ('\u{1cae}', ['\u{10ee}', '\u{0}', '\u{0}']), ('\u{1caf}', ['\u{10ef}', '\u{0}', '\u{0}']),
- ('\u{1cb0}', ['\u{10f0}', '\u{0}', '\u{0}']), ('\u{1cb1}', ['\u{10f1}', '\u{0}', '\u{0}']),
- ('\u{1cb2}', ['\u{10f2}', '\u{0}', '\u{0}']), ('\u{1cb3}', ['\u{10f3}', '\u{0}', '\u{0}']),
- ('\u{1cb4}', ['\u{10f4}', '\u{0}', '\u{0}']), ('\u{1cb5}', ['\u{10f5}', '\u{0}', '\u{0}']),
- ('\u{1cb6}', ['\u{10f6}', '\u{0}', '\u{0}']), ('\u{1cb7}', ['\u{10f7}', '\u{0}', '\u{0}']),
- ('\u{1cb8}', ['\u{10f8}', '\u{0}', '\u{0}']), ('\u{1cb9}', ['\u{10f9}', '\u{0}', '\u{0}']),
- ('\u{1cba}', ['\u{10fa}', '\u{0}', '\u{0}']), ('\u{1cbd}', ['\u{10fd}', '\u{0}', '\u{0}']),
- ('\u{1cbe}', ['\u{10fe}', '\u{0}', '\u{0}']), ('\u{1cbf}', ['\u{10ff}', '\u{0}', '\u{0}']),
- ('\u{1e00}', ['\u{1e01}', '\u{0}', '\u{0}']), ('\u{1e02}', ['\u{1e03}', '\u{0}', '\u{0}']),
- ('\u{1e04}', ['\u{1e05}', '\u{0}', '\u{0}']), ('\u{1e06}', ['\u{1e07}', '\u{0}', '\u{0}']),
- ('\u{1e08}', ['\u{1e09}', '\u{0}', '\u{0}']), ('\u{1e0a}', ['\u{1e0b}', '\u{0}', '\u{0}']),
- ('\u{1e0c}', ['\u{1e0d}', '\u{0}', '\u{0}']), ('\u{1e0e}', ['\u{1e0f}', '\u{0}', '\u{0}']),
- ('\u{1e10}', ['\u{1e11}', '\u{0}', '\u{0}']), ('\u{1e12}', ['\u{1e13}', '\u{0}', '\u{0}']),
- ('\u{1e14}', ['\u{1e15}', '\u{0}', '\u{0}']), ('\u{1e16}', ['\u{1e17}', '\u{0}', '\u{0}']),
- ('\u{1e18}', ['\u{1e19}', '\u{0}', '\u{0}']), ('\u{1e1a}', ['\u{1e1b}', '\u{0}', '\u{0}']),
- ('\u{1e1c}', ['\u{1e1d}', '\u{0}', '\u{0}']), ('\u{1e1e}', ['\u{1e1f}', '\u{0}', '\u{0}']),
- ('\u{1e20}', ['\u{1e21}', '\u{0}', '\u{0}']), ('\u{1e22}', ['\u{1e23}', '\u{0}', '\u{0}']),
- ('\u{1e24}', ['\u{1e25}', '\u{0}', '\u{0}']), ('\u{1e26}', ['\u{1e27}', '\u{0}', '\u{0}']),
- ('\u{1e28}', ['\u{1e29}', '\u{0}', '\u{0}']), ('\u{1e2a}', ['\u{1e2b}', '\u{0}', '\u{0}']),
- ('\u{1e2c}', ['\u{1e2d}', '\u{0}', '\u{0}']), ('\u{1e2e}', ['\u{1e2f}', '\u{0}', '\u{0}']),
- ('\u{1e30}', ['\u{1e31}', '\u{0}', '\u{0}']), ('\u{1e32}', ['\u{1e33}', '\u{0}', '\u{0}']),
- ('\u{1e34}', ['\u{1e35}', '\u{0}', '\u{0}']), ('\u{1e36}', ['\u{1e37}', '\u{0}', '\u{0}']),
- ('\u{1e38}', ['\u{1e39}', '\u{0}', '\u{0}']), ('\u{1e3a}', ['\u{1e3b}', '\u{0}', '\u{0}']),
- ('\u{1e3c}', ['\u{1e3d}', '\u{0}', '\u{0}']), ('\u{1e3e}', ['\u{1e3f}', '\u{0}', '\u{0}']),
- ('\u{1e40}', ['\u{1e41}', '\u{0}', '\u{0}']), ('\u{1e42}', ['\u{1e43}', '\u{0}', '\u{0}']),
- ('\u{1e44}', ['\u{1e45}', '\u{0}', '\u{0}']), ('\u{1e46}', ['\u{1e47}', '\u{0}', '\u{0}']),
- ('\u{1e48}', ['\u{1e49}', '\u{0}', '\u{0}']), ('\u{1e4a}', ['\u{1e4b}', '\u{0}', '\u{0}']),
- ('\u{1e4c}', ['\u{1e4d}', '\u{0}', '\u{0}']), ('\u{1e4e}', ['\u{1e4f}', '\u{0}', '\u{0}']),
- ('\u{1e50}', ['\u{1e51}', '\u{0}', '\u{0}']), ('\u{1e52}', ['\u{1e53}', '\u{0}', '\u{0}']),
- ('\u{1e54}', ['\u{1e55}', '\u{0}', '\u{0}']), ('\u{1e56}', ['\u{1e57}', '\u{0}', '\u{0}']),
- ('\u{1e58}', ['\u{1e59}', '\u{0}', '\u{0}']), ('\u{1e5a}', ['\u{1e5b}', '\u{0}', '\u{0}']),
- ('\u{1e5c}', ['\u{1e5d}', '\u{0}', '\u{0}']), ('\u{1e5e}', ['\u{1e5f}', '\u{0}', '\u{0}']),
- ('\u{1e60}', ['\u{1e61}', '\u{0}', '\u{0}']), ('\u{1e62}', ['\u{1e63}', '\u{0}', '\u{0}']),
- ('\u{1e64}', ['\u{1e65}', '\u{0}', '\u{0}']), ('\u{1e66}', ['\u{1e67}', '\u{0}', '\u{0}']),
- ('\u{1e68}', ['\u{1e69}', '\u{0}', '\u{0}']), ('\u{1e6a}', ['\u{1e6b}', '\u{0}', '\u{0}']),
- ('\u{1e6c}', ['\u{1e6d}', '\u{0}', '\u{0}']), ('\u{1e6e}', ['\u{1e6f}', '\u{0}', '\u{0}']),
- ('\u{1e70}', ['\u{1e71}', '\u{0}', '\u{0}']), ('\u{1e72}', ['\u{1e73}', '\u{0}', '\u{0}']),
- ('\u{1e74}', ['\u{1e75}', '\u{0}', '\u{0}']), ('\u{1e76}', ['\u{1e77}', '\u{0}', '\u{0}']),
- ('\u{1e78}', ['\u{1e79}', '\u{0}', '\u{0}']), ('\u{1e7a}', ['\u{1e7b}', '\u{0}', '\u{0}']),
- ('\u{1e7c}', ['\u{1e7d}', '\u{0}', '\u{0}']), ('\u{1e7e}', ['\u{1e7f}', '\u{0}', '\u{0}']),
- ('\u{1e80}', ['\u{1e81}', '\u{0}', '\u{0}']), ('\u{1e82}', ['\u{1e83}', '\u{0}', '\u{0}']),
- ('\u{1e84}', ['\u{1e85}', '\u{0}', '\u{0}']), ('\u{1e86}', ['\u{1e87}', '\u{0}', '\u{0}']),
- ('\u{1e88}', ['\u{1e89}', '\u{0}', '\u{0}']), ('\u{1e8a}', ['\u{1e8b}', '\u{0}', '\u{0}']),
- ('\u{1e8c}', ['\u{1e8d}', '\u{0}', '\u{0}']), ('\u{1e8e}', ['\u{1e8f}', '\u{0}', '\u{0}']),
- ('\u{1e90}', ['\u{1e91}', '\u{0}', '\u{0}']), ('\u{1e92}', ['\u{1e93}', '\u{0}', '\u{0}']),
- ('\u{1e94}', ['\u{1e95}', '\u{0}', '\u{0}']), ('\u{1e9e}', ['\u{df}', '\u{0}', '\u{0}']),
- ('\u{1ea0}', ['\u{1ea1}', '\u{0}', '\u{0}']), ('\u{1ea2}', ['\u{1ea3}', '\u{0}', '\u{0}']),
- ('\u{1ea4}', ['\u{1ea5}', '\u{0}', '\u{0}']), ('\u{1ea6}', ['\u{1ea7}', '\u{0}', '\u{0}']),
- ('\u{1ea8}', ['\u{1ea9}', '\u{0}', '\u{0}']), ('\u{1eaa}', ['\u{1eab}', '\u{0}', '\u{0}']),
- ('\u{1eac}', ['\u{1ead}', '\u{0}', '\u{0}']), ('\u{1eae}', ['\u{1eaf}', '\u{0}', '\u{0}']),
- ('\u{1eb0}', ['\u{1eb1}', '\u{0}', '\u{0}']), ('\u{1eb2}', ['\u{1eb3}', '\u{0}', '\u{0}']),
- ('\u{1eb4}', ['\u{1eb5}', '\u{0}', '\u{0}']), ('\u{1eb6}', ['\u{1eb7}', '\u{0}', '\u{0}']),
- ('\u{1eb8}', ['\u{1eb9}', '\u{0}', '\u{0}']), ('\u{1eba}', ['\u{1ebb}', '\u{0}', '\u{0}']),
- ('\u{1ebc}', ['\u{1ebd}', '\u{0}', '\u{0}']), ('\u{1ebe}', ['\u{1ebf}', '\u{0}', '\u{0}']),
- ('\u{1ec0}', ['\u{1ec1}', '\u{0}', '\u{0}']), ('\u{1ec2}', ['\u{1ec3}', '\u{0}', '\u{0}']),
- ('\u{1ec4}', ['\u{1ec5}', '\u{0}', '\u{0}']), ('\u{1ec6}', ['\u{1ec7}', '\u{0}', '\u{0}']),
- ('\u{1ec8}', ['\u{1ec9}', '\u{0}', '\u{0}']), ('\u{1eca}', ['\u{1ecb}', '\u{0}', '\u{0}']),
- ('\u{1ecc}', ['\u{1ecd}', '\u{0}', '\u{0}']), ('\u{1ece}', ['\u{1ecf}', '\u{0}', '\u{0}']),
- ('\u{1ed0}', ['\u{1ed1}', '\u{0}', '\u{0}']), ('\u{1ed2}', ['\u{1ed3}', '\u{0}', '\u{0}']),
- ('\u{1ed4}', ['\u{1ed5}', '\u{0}', '\u{0}']), ('\u{1ed6}', ['\u{1ed7}', '\u{0}', '\u{0}']),
- ('\u{1ed8}', ['\u{1ed9}', '\u{0}', '\u{0}']), ('\u{1eda}', ['\u{1edb}', '\u{0}', '\u{0}']),
- ('\u{1edc}', ['\u{1edd}', '\u{0}', '\u{0}']), ('\u{1ede}', ['\u{1edf}', '\u{0}', '\u{0}']),
- ('\u{1ee0}', ['\u{1ee1}', '\u{0}', '\u{0}']), ('\u{1ee2}', ['\u{1ee3}', '\u{0}', '\u{0}']),
- ('\u{1ee4}', ['\u{1ee5}', '\u{0}', '\u{0}']), ('\u{1ee6}', ['\u{1ee7}', '\u{0}', '\u{0}']),
- ('\u{1ee8}', ['\u{1ee9}', '\u{0}', '\u{0}']), ('\u{1eea}', ['\u{1eeb}', '\u{0}', '\u{0}']),
- ('\u{1eec}', ['\u{1eed}', '\u{0}', '\u{0}']), ('\u{1eee}', ['\u{1eef}', '\u{0}', '\u{0}']),
- ('\u{1ef0}', ['\u{1ef1}', '\u{0}', '\u{0}']), ('\u{1ef2}', ['\u{1ef3}', '\u{0}', '\u{0}']),
- ('\u{1ef4}', ['\u{1ef5}', '\u{0}', '\u{0}']), ('\u{1ef6}', ['\u{1ef7}', '\u{0}', '\u{0}']),
- ('\u{1ef8}', ['\u{1ef9}', '\u{0}', '\u{0}']), ('\u{1efa}', ['\u{1efb}', '\u{0}', '\u{0}']),
- ('\u{1efc}', ['\u{1efd}', '\u{0}', '\u{0}']), ('\u{1efe}', ['\u{1eff}', '\u{0}', '\u{0}']),
- ('\u{1f08}', ['\u{1f00}', '\u{0}', '\u{0}']), ('\u{1f09}', ['\u{1f01}', '\u{0}', '\u{0}']),
- ('\u{1f0a}', ['\u{1f02}', '\u{0}', '\u{0}']), ('\u{1f0b}', ['\u{1f03}', '\u{0}', '\u{0}']),
- ('\u{1f0c}', ['\u{1f04}', '\u{0}', '\u{0}']), ('\u{1f0d}', ['\u{1f05}', '\u{0}', '\u{0}']),
- ('\u{1f0e}', ['\u{1f06}', '\u{0}', '\u{0}']), ('\u{1f0f}', ['\u{1f07}', '\u{0}', '\u{0}']),
- ('\u{1f18}', ['\u{1f10}', '\u{0}', '\u{0}']), ('\u{1f19}', ['\u{1f11}', '\u{0}', '\u{0}']),
- ('\u{1f1a}', ['\u{1f12}', '\u{0}', '\u{0}']), ('\u{1f1b}', ['\u{1f13}', '\u{0}', '\u{0}']),
- ('\u{1f1c}', ['\u{1f14}', '\u{0}', '\u{0}']), ('\u{1f1d}', ['\u{1f15}', '\u{0}', '\u{0}']),
- ('\u{1f28}', ['\u{1f20}', '\u{0}', '\u{0}']), ('\u{1f29}', ['\u{1f21}', '\u{0}', '\u{0}']),
- ('\u{1f2a}', ['\u{1f22}', '\u{0}', '\u{0}']), ('\u{1f2b}', ['\u{1f23}', '\u{0}', '\u{0}']),
- ('\u{1f2c}', ['\u{1f24}', '\u{0}', '\u{0}']), ('\u{1f2d}', ['\u{1f25}', '\u{0}', '\u{0}']),
- ('\u{1f2e}', ['\u{1f26}', '\u{0}', '\u{0}']), ('\u{1f2f}', ['\u{1f27}', '\u{0}', '\u{0}']),
- ('\u{1f38}', ['\u{1f30}', '\u{0}', '\u{0}']), ('\u{1f39}', ['\u{1f31}', '\u{0}', '\u{0}']),
- ('\u{1f3a}', ['\u{1f32}', '\u{0}', '\u{0}']), ('\u{1f3b}', ['\u{1f33}', '\u{0}', '\u{0}']),
- ('\u{1f3c}', ['\u{1f34}', '\u{0}', '\u{0}']), ('\u{1f3d}', ['\u{1f35}', '\u{0}', '\u{0}']),
- ('\u{1f3e}', ['\u{1f36}', '\u{0}', '\u{0}']), ('\u{1f3f}', ['\u{1f37}', '\u{0}', '\u{0}']),
- ('\u{1f48}', ['\u{1f40}', '\u{0}', '\u{0}']), ('\u{1f49}', ['\u{1f41}', '\u{0}', '\u{0}']),
- ('\u{1f4a}', ['\u{1f42}', '\u{0}', '\u{0}']), ('\u{1f4b}', ['\u{1f43}', '\u{0}', '\u{0}']),
- ('\u{1f4c}', ['\u{1f44}', '\u{0}', '\u{0}']), ('\u{1f4d}', ['\u{1f45}', '\u{0}', '\u{0}']),
- ('\u{1f59}', ['\u{1f51}', '\u{0}', '\u{0}']), ('\u{1f5b}', ['\u{1f53}', '\u{0}', '\u{0}']),
- ('\u{1f5d}', ['\u{1f55}', '\u{0}', '\u{0}']), ('\u{1f5f}', ['\u{1f57}', '\u{0}', '\u{0}']),
- ('\u{1f68}', ['\u{1f60}', '\u{0}', '\u{0}']), ('\u{1f69}', ['\u{1f61}', '\u{0}', '\u{0}']),
- ('\u{1f6a}', ['\u{1f62}', '\u{0}', '\u{0}']), ('\u{1f6b}', ['\u{1f63}', '\u{0}', '\u{0}']),
- ('\u{1f6c}', ['\u{1f64}', '\u{0}', '\u{0}']), ('\u{1f6d}', ['\u{1f65}', '\u{0}', '\u{0}']),
- ('\u{1f6e}', ['\u{1f66}', '\u{0}', '\u{0}']), ('\u{1f6f}', ['\u{1f67}', '\u{0}', '\u{0}']),
- ('\u{1f88}', ['\u{1f80}', '\u{0}', '\u{0}']), ('\u{1f89}', ['\u{1f81}', '\u{0}', '\u{0}']),
- ('\u{1f8a}', ['\u{1f82}', '\u{0}', '\u{0}']), ('\u{1f8b}', ['\u{1f83}', '\u{0}', '\u{0}']),
- ('\u{1f8c}', ['\u{1f84}', '\u{0}', '\u{0}']), ('\u{1f8d}', ['\u{1f85}', '\u{0}', '\u{0}']),
- ('\u{1f8e}', ['\u{1f86}', '\u{0}', '\u{0}']), ('\u{1f8f}', ['\u{1f87}', '\u{0}', '\u{0}']),
- ('\u{1f98}', ['\u{1f90}', '\u{0}', '\u{0}']), ('\u{1f99}', ['\u{1f91}', '\u{0}', '\u{0}']),
- ('\u{1f9a}', ['\u{1f92}', '\u{0}', '\u{0}']), ('\u{1f9b}', ['\u{1f93}', '\u{0}', '\u{0}']),
- ('\u{1f9c}', ['\u{1f94}', '\u{0}', '\u{0}']), ('\u{1f9d}', ['\u{1f95}', '\u{0}', '\u{0}']),
- ('\u{1f9e}', ['\u{1f96}', '\u{0}', '\u{0}']), ('\u{1f9f}', ['\u{1f97}', '\u{0}', '\u{0}']),
- ('\u{1fa8}', ['\u{1fa0}', '\u{0}', '\u{0}']), ('\u{1fa9}', ['\u{1fa1}', '\u{0}', '\u{0}']),
- ('\u{1faa}', ['\u{1fa2}', '\u{0}', '\u{0}']), ('\u{1fab}', ['\u{1fa3}', '\u{0}', '\u{0}']),
- ('\u{1fac}', ['\u{1fa4}', '\u{0}', '\u{0}']), ('\u{1fad}', ['\u{1fa5}', '\u{0}', '\u{0}']),
- ('\u{1fae}', ['\u{1fa6}', '\u{0}', '\u{0}']), ('\u{1faf}', ['\u{1fa7}', '\u{0}', '\u{0}']),
- ('\u{1fb8}', ['\u{1fb0}', '\u{0}', '\u{0}']), ('\u{1fb9}', ['\u{1fb1}', '\u{0}', '\u{0}']),
- ('\u{1fba}', ['\u{1f70}', '\u{0}', '\u{0}']), ('\u{1fbb}', ['\u{1f71}', '\u{0}', '\u{0}']),
- ('\u{1fbc}', ['\u{1fb3}', '\u{0}', '\u{0}']), ('\u{1fc8}', ['\u{1f72}', '\u{0}', '\u{0}']),
- ('\u{1fc9}', ['\u{1f73}', '\u{0}', '\u{0}']), ('\u{1fca}', ['\u{1f74}', '\u{0}', '\u{0}']),
- ('\u{1fcb}', ['\u{1f75}', '\u{0}', '\u{0}']), ('\u{1fcc}', ['\u{1fc3}', '\u{0}', '\u{0}']),
- ('\u{1fd8}', ['\u{1fd0}', '\u{0}', '\u{0}']), ('\u{1fd9}', ['\u{1fd1}', '\u{0}', '\u{0}']),
- ('\u{1fda}', ['\u{1f76}', '\u{0}', '\u{0}']), ('\u{1fdb}', ['\u{1f77}', '\u{0}', '\u{0}']),
- ('\u{1fe8}', ['\u{1fe0}', '\u{0}', '\u{0}']), ('\u{1fe9}', ['\u{1fe1}', '\u{0}', '\u{0}']),
- ('\u{1fea}', ['\u{1f7a}', '\u{0}', '\u{0}']), ('\u{1feb}', ['\u{1f7b}', '\u{0}', '\u{0}']),
- ('\u{1fec}', ['\u{1fe5}', '\u{0}', '\u{0}']), ('\u{1ff8}', ['\u{1f78}', '\u{0}', '\u{0}']),
- ('\u{1ff9}', ['\u{1f79}', '\u{0}', '\u{0}']), ('\u{1ffa}', ['\u{1f7c}', '\u{0}', '\u{0}']),
- ('\u{1ffb}', ['\u{1f7d}', '\u{0}', '\u{0}']), ('\u{1ffc}', ['\u{1ff3}', '\u{0}', '\u{0}']),
- ('\u{2126}', ['\u{3c9}', '\u{0}', '\u{0}']), ('\u{212a}', ['\u{6b}', '\u{0}', '\u{0}']),
- ('\u{212b}', ['\u{e5}', '\u{0}', '\u{0}']), ('\u{2132}', ['\u{214e}', '\u{0}', '\u{0}']),
- ('\u{2160}', ['\u{2170}', '\u{0}', '\u{0}']), ('\u{2161}', ['\u{2171}', '\u{0}', '\u{0}']),
- ('\u{2162}', ['\u{2172}', '\u{0}', '\u{0}']), ('\u{2163}', ['\u{2173}', '\u{0}', '\u{0}']),
- ('\u{2164}', ['\u{2174}', '\u{0}', '\u{0}']), ('\u{2165}', ['\u{2175}', '\u{0}', '\u{0}']),
- ('\u{2166}', ['\u{2176}', '\u{0}', '\u{0}']), ('\u{2167}', ['\u{2177}', '\u{0}', '\u{0}']),
- ('\u{2168}', ['\u{2178}', '\u{0}', '\u{0}']), ('\u{2169}', ['\u{2179}', '\u{0}', '\u{0}']),
- ('\u{216a}', ['\u{217a}', '\u{0}', '\u{0}']), ('\u{216b}', ['\u{217b}', '\u{0}', '\u{0}']),
- ('\u{216c}', ['\u{217c}', '\u{0}', '\u{0}']), ('\u{216d}', ['\u{217d}', '\u{0}', '\u{0}']),
- ('\u{216e}', ['\u{217e}', '\u{0}', '\u{0}']), ('\u{216f}', ['\u{217f}', '\u{0}', '\u{0}']),
- ('\u{2183}', ['\u{2184}', '\u{0}', '\u{0}']), ('\u{24b6}', ['\u{24d0}', '\u{0}', '\u{0}']),
- ('\u{24b7}', ['\u{24d1}', '\u{0}', '\u{0}']), ('\u{24b8}', ['\u{24d2}', '\u{0}', '\u{0}']),
- ('\u{24b9}', ['\u{24d3}', '\u{0}', '\u{0}']), ('\u{24ba}', ['\u{24d4}', '\u{0}', '\u{0}']),
- ('\u{24bb}', ['\u{24d5}', '\u{0}', '\u{0}']), ('\u{24bc}', ['\u{24d6}', '\u{0}', '\u{0}']),
- ('\u{24bd}', ['\u{24d7}', '\u{0}', '\u{0}']), ('\u{24be}', ['\u{24d8}', '\u{0}', '\u{0}']),
- ('\u{24bf}', ['\u{24d9}', '\u{0}', '\u{0}']), ('\u{24c0}', ['\u{24da}', '\u{0}', '\u{0}']),
- ('\u{24c1}', ['\u{24db}', '\u{0}', '\u{0}']), ('\u{24c2}', ['\u{24dc}', '\u{0}', '\u{0}']),
- ('\u{24c3}', ['\u{24dd}', '\u{0}', '\u{0}']), ('\u{24c4}', ['\u{24de}', '\u{0}', '\u{0}']),
- ('\u{24c5}', ['\u{24df}', '\u{0}', '\u{0}']), ('\u{24c6}', ['\u{24e0}', '\u{0}', '\u{0}']),
- ('\u{24c7}', ['\u{24e1}', '\u{0}', '\u{0}']), ('\u{24c8}', ['\u{24e2}', '\u{0}', '\u{0}']),
- ('\u{24c9}', ['\u{24e3}', '\u{0}', '\u{0}']), ('\u{24ca}', ['\u{24e4}', '\u{0}', '\u{0}']),
- ('\u{24cb}', ['\u{24e5}', '\u{0}', '\u{0}']), ('\u{24cc}', ['\u{24e6}', '\u{0}', '\u{0}']),
- ('\u{24cd}', ['\u{24e7}', '\u{0}', '\u{0}']), ('\u{24ce}', ['\u{24e8}', '\u{0}', '\u{0}']),
- ('\u{24cf}', ['\u{24e9}', '\u{0}', '\u{0}']), ('\u{2c00}', ['\u{2c30}', '\u{0}', '\u{0}']),
- ('\u{2c01}', ['\u{2c31}', '\u{0}', '\u{0}']), ('\u{2c02}', ['\u{2c32}', '\u{0}', '\u{0}']),
- ('\u{2c03}', ['\u{2c33}', '\u{0}', '\u{0}']), ('\u{2c04}', ['\u{2c34}', '\u{0}', '\u{0}']),
- ('\u{2c05}', ['\u{2c35}', '\u{0}', '\u{0}']), ('\u{2c06}', ['\u{2c36}', '\u{0}', '\u{0}']),
- ('\u{2c07}', ['\u{2c37}', '\u{0}', '\u{0}']), ('\u{2c08}', ['\u{2c38}', '\u{0}', '\u{0}']),
- ('\u{2c09}', ['\u{2c39}', '\u{0}', '\u{0}']), ('\u{2c0a}', ['\u{2c3a}', '\u{0}', '\u{0}']),
- ('\u{2c0b}', ['\u{2c3b}', '\u{0}', '\u{0}']), ('\u{2c0c}', ['\u{2c3c}', '\u{0}', '\u{0}']),
- ('\u{2c0d}', ['\u{2c3d}', '\u{0}', '\u{0}']), ('\u{2c0e}', ['\u{2c3e}', '\u{0}', '\u{0}']),
- ('\u{2c0f}', ['\u{2c3f}', '\u{0}', '\u{0}']), ('\u{2c10}', ['\u{2c40}', '\u{0}', '\u{0}']),
- ('\u{2c11}', ['\u{2c41}', '\u{0}', '\u{0}']), ('\u{2c12}', ['\u{2c42}', '\u{0}', '\u{0}']),
- ('\u{2c13}', ['\u{2c43}', '\u{0}', '\u{0}']), ('\u{2c14}', ['\u{2c44}', '\u{0}', '\u{0}']),
- ('\u{2c15}', ['\u{2c45}', '\u{0}', '\u{0}']), ('\u{2c16}', ['\u{2c46}', '\u{0}', '\u{0}']),
- ('\u{2c17}', ['\u{2c47}', '\u{0}', '\u{0}']), ('\u{2c18}', ['\u{2c48}', '\u{0}', '\u{0}']),
- ('\u{2c19}', ['\u{2c49}', '\u{0}', '\u{0}']), ('\u{2c1a}', ['\u{2c4a}', '\u{0}', '\u{0}']),
- ('\u{2c1b}', ['\u{2c4b}', '\u{0}', '\u{0}']), ('\u{2c1c}', ['\u{2c4c}', '\u{0}', '\u{0}']),
- ('\u{2c1d}', ['\u{2c4d}', '\u{0}', '\u{0}']), ('\u{2c1e}', ['\u{2c4e}', '\u{0}', '\u{0}']),
- ('\u{2c1f}', ['\u{2c4f}', '\u{0}', '\u{0}']), ('\u{2c20}', ['\u{2c50}', '\u{0}', '\u{0}']),
- ('\u{2c21}', ['\u{2c51}', '\u{0}', '\u{0}']), ('\u{2c22}', ['\u{2c52}', '\u{0}', '\u{0}']),
- ('\u{2c23}', ['\u{2c53}', '\u{0}', '\u{0}']), ('\u{2c24}', ['\u{2c54}', '\u{0}', '\u{0}']),
- ('\u{2c25}', ['\u{2c55}', '\u{0}', '\u{0}']), ('\u{2c26}', ['\u{2c56}', '\u{0}', '\u{0}']),
- ('\u{2c27}', ['\u{2c57}', '\u{0}', '\u{0}']), ('\u{2c28}', ['\u{2c58}', '\u{0}', '\u{0}']),
- ('\u{2c29}', ['\u{2c59}', '\u{0}', '\u{0}']), ('\u{2c2a}', ['\u{2c5a}', '\u{0}', '\u{0}']),
- ('\u{2c2b}', ['\u{2c5b}', '\u{0}', '\u{0}']), ('\u{2c2c}', ['\u{2c5c}', '\u{0}', '\u{0}']),
- ('\u{2c2d}', ['\u{2c5d}', '\u{0}', '\u{0}']), ('\u{2c2e}', ['\u{2c5e}', '\u{0}', '\u{0}']),
- ('\u{2c2f}', ['\u{2c5f}', '\u{0}', '\u{0}']), ('\u{2c60}', ['\u{2c61}', '\u{0}', '\u{0}']),
- ('\u{2c62}', ['\u{26b}', '\u{0}', '\u{0}']), ('\u{2c63}', ['\u{1d7d}', '\u{0}', '\u{0}']),
- ('\u{2c64}', ['\u{27d}', '\u{0}', '\u{0}']), ('\u{2c67}', ['\u{2c68}', '\u{0}', '\u{0}']),
- ('\u{2c69}', ['\u{2c6a}', '\u{0}', '\u{0}']), ('\u{2c6b}', ['\u{2c6c}', '\u{0}', '\u{0}']),
- ('\u{2c6d}', ['\u{251}', '\u{0}', '\u{0}']), ('\u{2c6e}', ['\u{271}', '\u{0}', '\u{0}']),
- ('\u{2c6f}', ['\u{250}', '\u{0}', '\u{0}']), ('\u{2c70}', ['\u{252}', '\u{0}', '\u{0}']),
- ('\u{2c72}', ['\u{2c73}', '\u{0}', '\u{0}']), ('\u{2c75}', ['\u{2c76}', '\u{0}', '\u{0}']),
- ('\u{2c7e}', ['\u{23f}', '\u{0}', '\u{0}']), ('\u{2c7f}', ['\u{240}', '\u{0}', '\u{0}']),
- ('\u{2c80}', ['\u{2c81}', '\u{0}', '\u{0}']), ('\u{2c82}', ['\u{2c83}', '\u{0}', '\u{0}']),
- ('\u{2c84}', ['\u{2c85}', '\u{0}', '\u{0}']), ('\u{2c86}', ['\u{2c87}', '\u{0}', '\u{0}']),
- ('\u{2c88}', ['\u{2c89}', '\u{0}', '\u{0}']), ('\u{2c8a}', ['\u{2c8b}', '\u{0}', '\u{0}']),
- ('\u{2c8c}', ['\u{2c8d}', '\u{0}', '\u{0}']), ('\u{2c8e}', ['\u{2c8f}', '\u{0}', '\u{0}']),
- ('\u{2c90}', ['\u{2c91}', '\u{0}', '\u{0}']), ('\u{2c92}', ['\u{2c93}', '\u{0}', '\u{0}']),
- ('\u{2c94}', ['\u{2c95}', '\u{0}', '\u{0}']), ('\u{2c96}', ['\u{2c97}', '\u{0}', '\u{0}']),
- ('\u{2c98}', ['\u{2c99}', '\u{0}', '\u{0}']), ('\u{2c9a}', ['\u{2c9b}', '\u{0}', '\u{0}']),
- ('\u{2c9c}', ['\u{2c9d}', '\u{0}', '\u{0}']), ('\u{2c9e}', ['\u{2c9f}', '\u{0}', '\u{0}']),
- ('\u{2ca0}', ['\u{2ca1}', '\u{0}', '\u{0}']), ('\u{2ca2}', ['\u{2ca3}', '\u{0}', '\u{0}']),
- ('\u{2ca4}', ['\u{2ca5}', '\u{0}', '\u{0}']), ('\u{2ca6}', ['\u{2ca7}', '\u{0}', '\u{0}']),
- ('\u{2ca8}', ['\u{2ca9}', '\u{0}', '\u{0}']), ('\u{2caa}', ['\u{2cab}', '\u{0}', '\u{0}']),
- ('\u{2cac}', ['\u{2cad}', '\u{0}', '\u{0}']), ('\u{2cae}', ['\u{2caf}', '\u{0}', '\u{0}']),
- ('\u{2cb0}', ['\u{2cb1}', '\u{0}', '\u{0}']), ('\u{2cb2}', ['\u{2cb3}', '\u{0}', '\u{0}']),
- ('\u{2cb4}', ['\u{2cb5}', '\u{0}', '\u{0}']), ('\u{2cb6}', ['\u{2cb7}', '\u{0}', '\u{0}']),
- ('\u{2cb8}', ['\u{2cb9}', '\u{0}', '\u{0}']), ('\u{2cba}', ['\u{2cbb}', '\u{0}', '\u{0}']),
- ('\u{2cbc}', ['\u{2cbd}', '\u{0}', '\u{0}']), ('\u{2cbe}', ['\u{2cbf}', '\u{0}', '\u{0}']),
- ('\u{2cc0}', ['\u{2cc1}', '\u{0}', '\u{0}']), ('\u{2cc2}', ['\u{2cc3}', '\u{0}', '\u{0}']),
- ('\u{2cc4}', ['\u{2cc5}', '\u{0}', '\u{0}']), ('\u{2cc6}', ['\u{2cc7}', '\u{0}', '\u{0}']),
- ('\u{2cc8}', ['\u{2cc9}', '\u{0}', '\u{0}']), ('\u{2cca}', ['\u{2ccb}', '\u{0}', '\u{0}']),
- ('\u{2ccc}', ['\u{2ccd}', '\u{0}', '\u{0}']), ('\u{2cce}', ['\u{2ccf}', '\u{0}', '\u{0}']),
- ('\u{2cd0}', ['\u{2cd1}', '\u{0}', '\u{0}']), ('\u{2cd2}', ['\u{2cd3}', '\u{0}', '\u{0}']),
- ('\u{2cd4}', ['\u{2cd5}', '\u{0}', '\u{0}']), ('\u{2cd6}', ['\u{2cd7}', '\u{0}', '\u{0}']),
- ('\u{2cd8}', ['\u{2cd9}', '\u{0}', '\u{0}']), ('\u{2cda}', ['\u{2cdb}', '\u{0}', '\u{0}']),
- ('\u{2cdc}', ['\u{2cdd}', '\u{0}', '\u{0}']), ('\u{2cde}', ['\u{2cdf}', '\u{0}', '\u{0}']),
- ('\u{2ce0}', ['\u{2ce1}', '\u{0}', '\u{0}']), ('\u{2ce2}', ['\u{2ce3}', '\u{0}', '\u{0}']),
- ('\u{2ceb}', ['\u{2cec}', '\u{0}', '\u{0}']), ('\u{2ced}', ['\u{2cee}', '\u{0}', '\u{0}']),
- ('\u{2cf2}', ['\u{2cf3}', '\u{0}', '\u{0}']), ('\u{a640}', ['\u{a641}', '\u{0}', '\u{0}']),
- ('\u{a642}', ['\u{a643}', '\u{0}', '\u{0}']), ('\u{a644}', ['\u{a645}', '\u{0}', '\u{0}']),
- ('\u{a646}', ['\u{a647}', '\u{0}', '\u{0}']), ('\u{a648}', ['\u{a649}', '\u{0}', '\u{0}']),
- ('\u{a64a}', ['\u{a64b}', '\u{0}', '\u{0}']), ('\u{a64c}', ['\u{a64d}', '\u{0}', '\u{0}']),
- ('\u{a64e}', ['\u{a64f}', '\u{0}', '\u{0}']), ('\u{a650}', ['\u{a651}', '\u{0}', '\u{0}']),
- ('\u{a652}', ['\u{a653}', '\u{0}', '\u{0}']), ('\u{a654}', ['\u{a655}', '\u{0}', '\u{0}']),
- ('\u{a656}', ['\u{a657}', '\u{0}', '\u{0}']), ('\u{a658}', ['\u{a659}', '\u{0}', '\u{0}']),
- ('\u{a65a}', ['\u{a65b}', '\u{0}', '\u{0}']), ('\u{a65c}', ['\u{a65d}', '\u{0}', '\u{0}']),
- ('\u{a65e}', ['\u{a65f}', '\u{0}', '\u{0}']), ('\u{a660}', ['\u{a661}', '\u{0}', '\u{0}']),
- ('\u{a662}', ['\u{a663}', '\u{0}', '\u{0}']), ('\u{a664}', ['\u{a665}', '\u{0}', '\u{0}']),
- ('\u{a666}', ['\u{a667}', '\u{0}', '\u{0}']), ('\u{a668}', ['\u{a669}', '\u{0}', '\u{0}']),
- ('\u{a66a}', ['\u{a66b}', '\u{0}', '\u{0}']), ('\u{a66c}', ['\u{a66d}', '\u{0}', '\u{0}']),
- ('\u{a680}', ['\u{a681}', '\u{0}', '\u{0}']), ('\u{a682}', ['\u{a683}', '\u{0}', '\u{0}']),
- ('\u{a684}', ['\u{a685}', '\u{0}', '\u{0}']), ('\u{a686}', ['\u{a687}', '\u{0}', '\u{0}']),
- ('\u{a688}', ['\u{a689}', '\u{0}', '\u{0}']), ('\u{a68a}', ['\u{a68b}', '\u{0}', '\u{0}']),
- ('\u{a68c}', ['\u{a68d}', '\u{0}', '\u{0}']), ('\u{a68e}', ['\u{a68f}', '\u{0}', '\u{0}']),
- ('\u{a690}', ['\u{a691}', '\u{0}', '\u{0}']), ('\u{a692}', ['\u{a693}', '\u{0}', '\u{0}']),
- ('\u{a694}', ['\u{a695}', '\u{0}', '\u{0}']), ('\u{a696}', ['\u{a697}', '\u{0}', '\u{0}']),
- ('\u{a698}', ['\u{a699}', '\u{0}', '\u{0}']), ('\u{a69a}', ['\u{a69b}', '\u{0}', '\u{0}']),
- ('\u{a722}', ['\u{a723}', '\u{0}', '\u{0}']), ('\u{a724}', ['\u{a725}', '\u{0}', '\u{0}']),
- ('\u{a726}', ['\u{a727}', '\u{0}', '\u{0}']), ('\u{a728}', ['\u{a729}', '\u{0}', '\u{0}']),
- ('\u{a72a}', ['\u{a72b}', '\u{0}', '\u{0}']), ('\u{a72c}', ['\u{a72d}', '\u{0}', '\u{0}']),
- ('\u{a72e}', ['\u{a72f}', '\u{0}', '\u{0}']), ('\u{a732}', ['\u{a733}', '\u{0}', '\u{0}']),
- ('\u{a734}', ['\u{a735}', '\u{0}', '\u{0}']), ('\u{a736}', ['\u{a737}', '\u{0}', '\u{0}']),
- ('\u{a738}', ['\u{a739}', '\u{0}', '\u{0}']), ('\u{a73a}', ['\u{a73b}', '\u{0}', '\u{0}']),
- ('\u{a73c}', ['\u{a73d}', '\u{0}', '\u{0}']), ('\u{a73e}', ['\u{a73f}', '\u{0}', '\u{0}']),
- ('\u{a740}', ['\u{a741}', '\u{0}', '\u{0}']), ('\u{a742}', ['\u{a743}', '\u{0}', '\u{0}']),
- ('\u{a744}', ['\u{a745}', '\u{0}', '\u{0}']), ('\u{a746}', ['\u{a747}', '\u{0}', '\u{0}']),
- ('\u{a748}', ['\u{a749}', '\u{0}', '\u{0}']), ('\u{a74a}', ['\u{a74b}', '\u{0}', '\u{0}']),
- ('\u{a74c}', ['\u{a74d}', '\u{0}', '\u{0}']), ('\u{a74e}', ['\u{a74f}', '\u{0}', '\u{0}']),
- ('\u{a750}', ['\u{a751}', '\u{0}', '\u{0}']), ('\u{a752}', ['\u{a753}', '\u{0}', '\u{0}']),
- ('\u{a754}', ['\u{a755}', '\u{0}', '\u{0}']), ('\u{a756}', ['\u{a757}', '\u{0}', '\u{0}']),
- ('\u{a758}', ['\u{a759}', '\u{0}', '\u{0}']), ('\u{a75a}', ['\u{a75b}', '\u{0}', '\u{0}']),
- ('\u{a75c}', ['\u{a75d}', '\u{0}', '\u{0}']), ('\u{a75e}', ['\u{a75f}', '\u{0}', '\u{0}']),
- ('\u{a760}', ['\u{a761}', '\u{0}', '\u{0}']), ('\u{a762}', ['\u{a763}', '\u{0}', '\u{0}']),
- ('\u{a764}', ['\u{a765}', '\u{0}', '\u{0}']), ('\u{a766}', ['\u{a767}', '\u{0}', '\u{0}']),
- ('\u{a768}', ['\u{a769}', '\u{0}', '\u{0}']), ('\u{a76a}', ['\u{a76b}', '\u{0}', '\u{0}']),
- ('\u{a76c}', ['\u{a76d}', '\u{0}', '\u{0}']), ('\u{a76e}', ['\u{a76f}', '\u{0}', '\u{0}']),
- ('\u{a779}', ['\u{a77a}', '\u{0}', '\u{0}']), ('\u{a77b}', ['\u{a77c}', '\u{0}', '\u{0}']),
- ('\u{a77d}', ['\u{1d79}', '\u{0}', '\u{0}']), ('\u{a77e}', ['\u{a77f}', '\u{0}', '\u{0}']),
- ('\u{a780}', ['\u{a781}', '\u{0}', '\u{0}']), ('\u{a782}', ['\u{a783}', '\u{0}', '\u{0}']),
- ('\u{a784}', ['\u{a785}', '\u{0}', '\u{0}']), ('\u{a786}', ['\u{a787}', '\u{0}', '\u{0}']),
- ('\u{a78b}', ['\u{a78c}', '\u{0}', '\u{0}']), ('\u{a78d}', ['\u{265}', '\u{0}', '\u{0}']),
- ('\u{a790}', ['\u{a791}', '\u{0}', '\u{0}']), ('\u{a792}', ['\u{a793}', '\u{0}', '\u{0}']),
- ('\u{a796}', ['\u{a797}', '\u{0}', '\u{0}']), ('\u{a798}', ['\u{a799}', '\u{0}', '\u{0}']),
- ('\u{a79a}', ['\u{a79b}', '\u{0}', '\u{0}']), ('\u{a79c}', ['\u{a79d}', '\u{0}', '\u{0}']),
- ('\u{a79e}', ['\u{a79f}', '\u{0}', '\u{0}']), ('\u{a7a0}', ['\u{a7a1}', '\u{0}', '\u{0}']),
- ('\u{a7a2}', ['\u{a7a3}', '\u{0}', '\u{0}']), ('\u{a7a4}', ['\u{a7a5}', '\u{0}', '\u{0}']),
- ('\u{a7a6}', ['\u{a7a7}', '\u{0}', '\u{0}']), ('\u{a7a8}', ['\u{a7a9}', '\u{0}', '\u{0}']),
- ('\u{a7aa}', ['\u{266}', '\u{0}', '\u{0}']), ('\u{a7ab}', ['\u{25c}', '\u{0}', '\u{0}']),
- ('\u{a7ac}', ['\u{261}', '\u{0}', '\u{0}']), ('\u{a7ad}', ['\u{26c}', '\u{0}', '\u{0}']),
- ('\u{a7ae}', ['\u{26a}', '\u{0}', '\u{0}']), ('\u{a7b0}', ['\u{29e}', '\u{0}', '\u{0}']),
- ('\u{a7b1}', ['\u{287}', '\u{0}', '\u{0}']), ('\u{a7b2}', ['\u{29d}', '\u{0}', '\u{0}']),
- ('\u{a7b3}', ['\u{ab53}', '\u{0}', '\u{0}']), ('\u{a7b4}', ['\u{a7b5}', '\u{0}', '\u{0}']),
- ('\u{a7b6}', ['\u{a7b7}', '\u{0}', '\u{0}']), ('\u{a7b8}', ['\u{a7b9}', '\u{0}', '\u{0}']),
- ('\u{a7ba}', ['\u{a7bb}', '\u{0}', '\u{0}']), ('\u{a7bc}', ['\u{a7bd}', '\u{0}', '\u{0}']),
- ('\u{a7be}', ['\u{a7bf}', '\u{0}', '\u{0}']), ('\u{a7c0}', ['\u{a7c1}', '\u{0}', '\u{0}']),
- ('\u{a7c2}', ['\u{a7c3}', '\u{0}', '\u{0}']), ('\u{a7c4}', ['\u{a794}', '\u{0}', '\u{0}']),
- ('\u{a7c5}', ['\u{282}', '\u{0}', '\u{0}']), ('\u{a7c6}', ['\u{1d8e}', '\u{0}', '\u{0}']),
- ('\u{a7c7}', ['\u{a7c8}', '\u{0}', '\u{0}']), ('\u{a7c9}', ['\u{a7ca}', '\u{0}', '\u{0}']),
- ('\u{a7cb}', ['\u{264}', '\u{0}', '\u{0}']), ('\u{a7cc}', ['\u{a7cd}', '\u{0}', '\u{0}']),
- ('\u{a7ce}', ['\u{a7cf}', '\u{0}', '\u{0}']), ('\u{a7d0}', ['\u{a7d1}', '\u{0}', '\u{0}']),
- ('\u{a7d2}', ['\u{a7d3}', '\u{0}', '\u{0}']), ('\u{a7d4}', ['\u{a7d5}', '\u{0}', '\u{0}']),
- ('\u{a7d6}', ['\u{a7d7}', '\u{0}', '\u{0}']), ('\u{a7d8}', ['\u{a7d9}', '\u{0}', '\u{0}']),
- ('\u{a7da}', ['\u{a7db}', '\u{0}', '\u{0}']), ('\u{a7dc}', ['\u{19b}', '\u{0}', '\u{0}']),
- ('\u{a7f5}', ['\u{a7f6}', '\u{0}', '\u{0}']), ('\u{ff21}', ['\u{ff41}', '\u{0}', '\u{0}']),
- ('\u{ff22}', ['\u{ff42}', '\u{0}', '\u{0}']), ('\u{ff23}', ['\u{ff43}', '\u{0}', '\u{0}']),
- ('\u{ff24}', ['\u{ff44}', '\u{0}', '\u{0}']), ('\u{ff25}', ['\u{ff45}', '\u{0}', '\u{0}']),
- ('\u{ff26}', ['\u{ff46}', '\u{0}', '\u{0}']), ('\u{ff27}', ['\u{ff47}', '\u{0}', '\u{0}']),
- ('\u{ff28}', ['\u{ff48}', '\u{0}', '\u{0}']), ('\u{ff29}', ['\u{ff49}', '\u{0}', '\u{0}']),
- ('\u{ff2a}', ['\u{ff4a}', '\u{0}', '\u{0}']), ('\u{ff2b}', ['\u{ff4b}', '\u{0}', '\u{0}']),
- ('\u{ff2c}', ['\u{ff4c}', '\u{0}', '\u{0}']), ('\u{ff2d}', ['\u{ff4d}', '\u{0}', '\u{0}']),
- ('\u{ff2e}', ['\u{ff4e}', '\u{0}', '\u{0}']), ('\u{ff2f}', ['\u{ff4f}', '\u{0}', '\u{0}']),
- ('\u{ff30}', ['\u{ff50}', '\u{0}', '\u{0}']), ('\u{ff31}', ['\u{ff51}', '\u{0}', '\u{0}']),
- ('\u{ff32}', ['\u{ff52}', '\u{0}', '\u{0}']), ('\u{ff33}', ['\u{ff53}', '\u{0}', '\u{0}']),
- ('\u{ff34}', ['\u{ff54}', '\u{0}', '\u{0}']), ('\u{ff35}', ['\u{ff55}', '\u{0}', '\u{0}']),
- ('\u{ff36}', ['\u{ff56}', '\u{0}', '\u{0}']), ('\u{ff37}', ['\u{ff57}', '\u{0}', '\u{0}']),
- ('\u{ff38}', ['\u{ff58}', '\u{0}', '\u{0}']), ('\u{ff39}', ['\u{ff59}', '\u{0}', '\u{0}']),
- ('\u{ff3a}', ['\u{ff5a}', '\u{0}', '\u{0}']),
- ('\u{10400}', ['\u{10428}', '\u{0}', '\u{0}']),
- ('\u{10401}', ['\u{10429}', '\u{0}', '\u{0}']),
- ('\u{10402}', ['\u{1042a}', '\u{0}', '\u{0}']),
- ('\u{10403}', ['\u{1042b}', '\u{0}', '\u{0}']),
- ('\u{10404}', ['\u{1042c}', '\u{0}', '\u{0}']),
- ('\u{10405}', ['\u{1042d}', '\u{0}', '\u{0}']),
- ('\u{10406}', ['\u{1042e}', '\u{0}', '\u{0}']),
- ('\u{10407}', ['\u{1042f}', '\u{0}', '\u{0}']),
- ('\u{10408}', ['\u{10430}', '\u{0}', '\u{0}']),
- ('\u{10409}', ['\u{10431}', '\u{0}', '\u{0}']),
- ('\u{1040a}', ['\u{10432}', '\u{0}', '\u{0}']),
- ('\u{1040b}', ['\u{10433}', '\u{0}', '\u{0}']),
- ('\u{1040c}', ['\u{10434}', '\u{0}', '\u{0}']),
- ('\u{1040d}', ['\u{10435}', '\u{0}', '\u{0}']),
- ('\u{1040e}', ['\u{10436}', '\u{0}', '\u{0}']),
- ('\u{1040f}', ['\u{10437}', '\u{0}', '\u{0}']),
- ('\u{10410}', ['\u{10438}', '\u{0}', '\u{0}']),
- ('\u{10411}', ['\u{10439}', '\u{0}', '\u{0}']),
- ('\u{10412}', ['\u{1043a}', '\u{0}', '\u{0}']),
- ('\u{10413}', ['\u{1043b}', '\u{0}', '\u{0}']),
- ('\u{10414}', ['\u{1043c}', '\u{0}', '\u{0}']),
- ('\u{10415}', ['\u{1043d}', '\u{0}', '\u{0}']),
- ('\u{10416}', ['\u{1043e}', '\u{0}', '\u{0}']),
- ('\u{10417}', ['\u{1043f}', '\u{0}', '\u{0}']),
- ('\u{10418}', ['\u{10440}', '\u{0}', '\u{0}']),
- ('\u{10419}', ['\u{10441}', '\u{0}', '\u{0}']),
- ('\u{1041a}', ['\u{10442}', '\u{0}', '\u{0}']),
- ('\u{1041b}', ['\u{10443}', '\u{0}', '\u{0}']),
- ('\u{1041c}', ['\u{10444}', '\u{0}', '\u{0}']),
- ('\u{1041d}', ['\u{10445}', '\u{0}', '\u{0}']),
- ('\u{1041e}', ['\u{10446}', '\u{0}', '\u{0}']),
- ('\u{1041f}', ['\u{10447}', '\u{0}', '\u{0}']),
- ('\u{10420}', ['\u{10448}', '\u{0}', '\u{0}']),
- ('\u{10421}', ['\u{10449}', '\u{0}', '\u{0}']),
- ('\u{10422}', ['\u{1044a}', '\u{0}', '\u{0}']),
- ('\u{10423}', ['\u{1044b}', '\u{0}', '\u{0}']),
- ('\u{10424}', ['\u{1044c}', '\u{0}', '\u{0}']),
- ('\u{10425}', ['\u{1044d}', '\u{0}', '\u{0}']),
- ('\u{10426}', ['\u{1044e}', '\u{0}', '\u{0}']),
- ('\u{10427}', ['\u{1044f}', '\u{0}', '\u{0}']),
- ('\u{104b0}', ['\u{104d8}', '\u{0}', '\u{0}']),
- ('\u{104b1}', ['\u{104d9}', '\u{0}', '\u{0}']),
- ('\u{104b2}', ['\u{104da}', '\u{0}', '\u{0}']),
- ('\u{104b3}', ['\u{104db}', '\u{0}', '\u{0}']),
- ('\u{104b4}', ['\u{104dc}', '\u{0}', '\u{0}']),
- ('\u{104b5}', ['\u{104dd}', '\u{0}', '\u{0}']),
- ('\u{104b6}', ['\u{104de}', '\u{0}', '\u{0}']),
- ('\u{104b7}', ['\u{104df}', '\u{0}', '\u{0}']),
- ('\u{104b8}', ['\u{104e0}', '\u{0}', '\u{0}']),
- ('\u{104b9}', ['\u{104e1}', '\u{0}', '\u{0}']),
- ('\u{104ba}', ['\u{104e2}', '\u{0}', '\u{0}']),
- ('\u{104bb}', ['\u{104e3}', '\u{0}', '\u{0}']),
- ('\u{104bc}', ['\u{104e4}', '\u{0}', '\u{0}']),
- ('\u{104bd}', ['\u{104e5}', '\u{0}', '\u{0}']),
- ('\u{104be}', ['\u{104e6}', '\u{0}', '\u{0}']),
- ('\u{104bf}', ['\u{104e7}', '\u{0}', '\u{0}']),
- ('\u{104c0}', ['\u{104e8}', '\u{0}', '\u{0}']),
- ('\u{104c1}', ['\u{104e9}', '\u{0}', '\u{0}']),
- ('\u{104c2}', ['\u{104ea}', '\u{0}', '\u{0}']),
- ('\u{104c3}', ['\u{104eb}', '\u{0}', '\u{0}']),
- ('\u{104c4}', ['\u{104ec}', '\u{0}', '\u{0}']),
- ('\u{104c5}', ['\u{104ed}', '\u{0}', '\u{0}']),
- ('\u{104c6}', ['\u{104ee}', '\u{0}', '\u{0}']),
- ('\u{104c7}', ['\u{104ef}', '\u{0}', '\u{0}']),
- ('\u{104c8}', ['\u{104f0}', '\u{0}', '\u{0}']),
- ('\u{104c9}', ['\u{104f1}', '\u{0}', '\u{0}']),
- ('\u{104ca}', ['\u{104f2}', '\u{0}', '\u{0}']),
- ('\u{104cb}', ['\u{104f3}', '\u{0}', '\u{0}']),
- ('\u{104cc}', ['\u{104f4}', '\u{0}', '\u{0}']),
- ('\u{104cd}', ['\u{104f5}', '\u{0}', '\u{0}']),
- ('\u{104ce}', ['\u{104f6}', '\u{0}', '\u{0}']),
- ('\u{104cf}', ['\u{104f7}', '\u{0}', '\u{0}']),
- ('\u{104d0}', ['\u{104f8}', '\u{0}', '\u{0}']),
- ('\u{104d1}', ['\u{104f9}', '\u{0}', '\u{0}']),
- ('\u{104d2}', ['\u{104fa}', '\u{0}', '\u{0}']),
- ('\u{104d3}', ['\u{104fb}', '\u{0}', '\u{0}']),
- ('\u{10570}', ['\u{10597}', '\u{0}', '\u{0}']),
- ('\u{10571}', ['\u{10598}', '\u{0}', '\u{0}']),
- ('\u{10572}', ['\u{10599}', '\u{0}', '\u{0}']),
- ('\u{10573}', ['\u{1059a}', '\u{0}', '\u{0}']),
- ('\u{10574}', ['\u{1059b}', '\u{0}', '\u{0}']),
- ('\u{10575}', ['\u{1059c}', '\u{0}', '\u{0}']),
- ('\u{10576}', ['\u{1059d}', '\u{0}', '\u{0}']),
- ('\u{10577}', ['\u{1059e}', '\u{0}', '\u{0}']),
- ('\u{10578}', ['\u{1059f}', '\u{0}', '\u{0}']),
- ('\u{10579}', ['\u{105a0}', '\u{0}', '\u{0}']),
- ('\u{1057a}', ['\u{105a1}', '\u{0}', '\u{0}']),
- ('\u{1057c}', ['\u{105a3}', '\u{0}', '\u{0}']),
- ('\u{1057d}', ['\u{105a4}', '\u{0}', '\u{0}']),
- ('\u{1057e}', ['\u{105a5}', '\u{0}', '\u{0}']),
- ('\u{1057f}', ['\u{105a6}', '\u{0}', '\u{0}']),
- ('\u{10580}', ['\u{105a7}', '\u{0}', '\u{0}']),
- ('\u{10581}', ['\u{105a8}', '\u{0}', '\u{0}']),
- ('\u{10582}', ['\u{105a9}', '\u{0}', '\u{0}']),
- ('\u{10583}', ['\u{105aa}', '\u{0}', '\u{0}']),
- ('\u{10584}', ['\u{105ab}', '\u{0}', '\u{0}']),
- ('\u{10585}', ['\u{105ac}', '\u{0}', '\u{0}']),
- ('\u{10586}', ['\u{105ad}', '\u{0}', '\u{0}']),
- ('\u{10587}', ['\u{105ae}', '\u{0}', '\u{0}']),
- ('\u{10588}', ['\u{105af}', '\u{0}', '\u{0}']),
- ('\u{10589}', ['\u{105b0}', '\u{0}', '\u{0}']),
- ('\u{1058a}', ['\u{105b1}', '\u{0}', '\u{0}']),
- ('\u{1058c}', ['\u{105b3}', '\u{0}', '\u{0}']),
- ('\u{1058d}', ['\u{105b4}', '\u{0}', '\u{0}']),
- ('\u{1058e}', ['\u{105b5}', '\u{0}', '\u{0}']),
- ('\u{1058f}', ['\u{105b6}', '\u{0}', '\u{0}']),
- ('\u{10590}', ['\u{105b7}', '\u{0}', '\u{0}']),
- ('\u{10591}', ['\u{105b8}', '\u{0}', '\u{0}']),
- ('\u{10592}', ['\u{105b9}', '\u{0}', '\u{0}']),
- ('\u{10594}', ['\u{105bb}', '\u{0}', '\u{0}']),
- ('\u{10595}', ['\u{105bc}', '\u{0}', '\u{0}']),
- ('\u{10c80}', ['\u{10cc0}', '\u{0}', '\u{0}']),
- ('\u{10c81}', ['\u{10cc1}', '\u{0}', '\u{0}']),
- ('\u{10c82}', ['\u{10cc2}', '\u{0}', '\u{0}']),
- ('\u{10c83}', ['\u{10cc3}', '\u{0}', '\u{0}']),
- ('\u{10c84}', ['\u{10cc4}', '\u{0}', '\u{0}']),
- ('\u{10c85}', ['\u{10cc5}', '\u{0}', '\u{0}']),
- ('\u{10c86}', ['\u{10cc6}', '\u{0}', '\u{0}']),
- ('\u{10c87}', ['\u{10cc7}', '\u{0}', '\u{0}']),
- ('\u{10c88}', ['\u{10cc8}', '\u{0}', '\u{0}']),
- ('\u{10c89}', ['\u{10cc9}', '\u{0}', '\u{0}']),
- ('\u{10c8a}', ['\u{10cca}', '\u{0}', '\u{0}']),
- ('\u{10c8b}', ['\u{10ccb}', '\u{0}', '\u{0}']),
- ('\u{10c8c}', ['\u{10ccc}', '\u{0}', '\u{0}']),
- ('\u{10c8d}', ['\u{10ccd}', '\u{0}', '\u{0}']),
- ('\u{10c8e}', ['\u{10cce}', '\u{0}', '\u{0}']),
- ('\u{10c8f}', ['\u{10ccf}', '\u{0}', '\u{0}']),
- ('\u{10c90}', ['\u{10cd0}', '\u{0}', '\u{0}']),
- ('\u{10c91}', ['\u{10cd1}', '\u{0}', '\u{0}']),
- ('\u{10c92}', ['\u{10cd2}', '\u{0}', '\u{0}']),
- ('\u{10c93}', ['\u{10cd3}', '\u{0}', '\u{0}']),
- ('\u{10c94}', ['\u{10cd4}', '\u{0}', '\u{0}']),
- ('\u{10c95}', ['\u{10cd5}', '\u{0}', '\u{0}']),
- ('\u{10c96}', ['\u{10cd6}', '\u{0}', '\u{0}']),
- ('\u{10c97}', ['\u{10cd7}', '\u{0}', '\u{0}']),
- ('\u{10c98}', ['\u{10cd8}', '\u{0}', '\u{0}']),
- ('\u{10c99}', ['\u{10cd9}', '\u{0}', '\u{0}']),
- ('\u{10c9a}', ['\u{10cda}', '\u{0}', '\u{0}']),
- ('\u{10c9b}', ['\u{10cdb}', '\u{0}', '\u{0}']),
- ('\u{10c9c}', ['\u{10cdc}', '\u{0}', '\u{0}']),
- ('\u{10c9d}', ['\u{10cdd}', '\u{0}', '\u{0}']),
- ('\u{10c9e}', ['\u{10cde}', '\u{0}', '\u{0}']),
- ('\u{10c9f}', ['\u{10cdf}', '\u{0}', '\u{0}']),
- ('\u{10ca0}', ['\u{10ce0}', '\u{0}', '\u{0}']),
- ('\u{10ca1}', ['\u{10ce1}', '\u{0}', '\u{0}']),
- ('\u{10ca2}', ['\u{10ce2}', '\u{0}', '\u{0}']),
- ('\u{10ca3}', ['\u{10ce3}', '\u{0}', '\u{0}']),
- ('\u{10ca4}', ['\u{10ce4}', '\u{0}', '\u{0}']),
- ('\u{10ca5}', ['\u{10ce5}', '\u{0}', '\u{0}']),
- ('\u{10ca6}', ['\u{10ce6}', '\u{0}', '\u{0}']),
- ('\u{10ca7}', ['\u{10ce7}', '\u{0}', '\u{0}']),
- ('\u{10ca8}', ['\u{10ce8}', '\u{0}', '\u{0}']),
- ('\u{10ca9}', ['\u{10ce9}', '\u{0}', '\u{0}']),
- ('\u{10caa}', ['\u{10cea}', '\u{0}', '\u{0}']),
- ('\u{10cab}', ['\u{10ceb}', '\u{0}', '\u{0}']),
- ('\u{10cac}', ['\u{10cec}', '\u{0}', '\u{0}']),
- ('\u{10cad}', ['\u{10ced}', '\u{0}', '\u{0}']),
- ('\u{10cae}', ['\u{10cee}', '\u{0}', '\u{0}']),
- ('\u{10caf}', ['\u{10cef}', '\u{0}', '\u{0}']),
- ('\u{10cb0}', ['\u{10cf0}', '\u{0}', '\u{0}']),
- ('\u{10cb1}', ['\u{10cf1}', '\u{0}', '\u{0}']),
- ('\u{10cb2}', ['\u{10cf2}', '\u{0}', '\u{0}']),
- ('\u{10d50}', ['\u{10d70}', '\u{0}', '\u{0}']),
- ('\u{10d51}', ['\u{10d71}', '\u{0}', '\u{0}']),
- ('\u{10d52}', ['\u{10d72}', '\u{0}', '\u{0}']),
- ('\u{10d53}', ['\u{10d73}', '\u{0}', '\u{0}']),
- ('\u{10d54}', ['\u{10d74}', '\u{0}', '\u{0}']),
- ('\u{10d55}', ['\u{10d75}', '\u{0}', '\u{0}']),
- ('\u{10d56}', ['\u{10d76}', '\u{0}', '\u{0}']),
- ('\u{10d57}', ['\u{10d77}', '\u{0}', '\u{0}']),
- ('\u{10d58}', ['\u{10d78}', '\u{0}', '\u{0}']),
- ('\u{10d59}', ['\u{10d79}', '\u{0}', '\u{0}']),
- ('\u{10d5a}', ['\u{10d7a}', '\u{0}', '\u{0}']),
- ('\u{10d5b}', ['\u{10d7b}', '\u{0}', '\u{0}']),
- ('\u{10d5c}', ['\u{10d7c}', '\u{0}', '\u{0}']),
- ('\u{10d5d}', ['\u{10d7d}', '\u{0}', '\u{0}']),
- ('\u{10d5e}', ['\u{10d7e}', '\u{0}', '\u{0}']),
- ('\u{10d5f}', ['\u{10d7f}', '\u{0}', '\u{0}']),
- ('\u{10d60}', ['\u{10d80}', '\u{0}', '\u{0}']),
- ('\u{10d61}', ['\u{10d81}', '\u{0}', '\u{0}']),
- ('\u{10d62}', ['\u{10d82}', '\u{0}', '\u{0}']),
- ('\u{10d63}', ['\u{10d83}', '\u{0}', '\u{0}']),
- ('\u{10d64}', ['\u{10d84}', '\u{0}', '\u{0}']),
- ('\u{10d65}', ['\u{10d85}', '\u{0}', '\u{0}']),
- ('\u{118a0}', ['\u{118c0}', '\u{0}', '\u{0}']),
- ('\u{118a1}', ['\u{118c1}', '\u{0}', '\u{0}']),
- ('\u{118a2}', ['\u{118c2}', '\u{0}', '\u{0}']),
- ('\u{118a3}', ['\u{118c3}', '\u{0}', '\u{0}']),
- ('\u{118a4}', ['\u{118c4}', '\u{0}', '\u{0}']),
- ('\u{118a5}', ['\u{118c5}', '\u{0}', '\u{0}']),
- ('\u{118a6}', ['\u{118c6}', '\u{0}', '\u{0}']),
- ('\u{118a7}', ['\u{118c7}', '\u{0}', '\u{0}']),
- ('\u{118a8}', ['\u{118c8}', '\u{0}', '\u{0}']),
- ('\u{118a9}', ['\u{118c9}', '\u{0}', '\u{0}']),
- ('\u{118aa}', ['\u{118ca}', '\u{0}', '\u{0}']),
- ('\u{118ab}', ['\u{118cb}', '\u{0}', '\u{0}']),
- ('\u{118ac}', ['\u{118cc}', '\u{0}', '\u{0}']),
- ('\u{118ad}', ['\u{118cd}', '\u{0}', '\u{0}']),
- ('\u{118ae}', ['\u{118ce}', '\u{0}', '\u{0}']),
- ('\u{118af}', ['\u{118cf}', '\u{0}', '\u{0}']),
- ('\u{118b0}', ['\u{118d0}', '\u{0}', '\u{0}']),
- ('\u{118b1}', ['\u{118d1}', '\u{0}', '\u{0}']),
- ('\u{118b2}', ['\u{118d2}', '\u{0}', '\u{0}']),
- ('\u{118b3}', ['\u{118d3}', '\u{0}', '\u{0}']),
- ('\u{118b4}', ['\u{118d4}', '\u{0}', '\u{0}']),
- ('\u{118b5}', ['\u{118d5}', '\u{0}', '\u{0}']),
- ('\u{118b6}', ['\u{118d6}', '\u{0}', '\u{0}']),
- ('\u{118b7}', ['\u{118d7}', '\u{0}', '\u{0}']),
- ('\u{118b8}', ['\u{118d8}', '\u{0}', '\u{0}']),
- ('\u{118b9}', ['\u{118d9}', '\u{0}', '\u{0}']),
- ('\u{118ba}', ['\u{118da}', '\u{0}', '\u{0}']),
- ('\u{118bb}', ['\u{118db}', '\u{0}', '\u{0}']),
- ('\u{118bc}', ['\u{118dc}', '\u{0}', '\u{0}']),
- ('\u{118bd}', ['\u{118dd}', '\u{0}', '\u{0}']),
- ('\u{118be}', ['\u{118de}', '\u{0}', '\u{0}']),
- ('\u{118bf}', ['\u{118df}', '\u{0}', '\u{0}']),
- ('\u{16e40}', ['\u{16e60}', '\u{0}', '\u{0}']),
- ('\u{16e41}', ['\u{16e61}', '\u{0}', '\u{0}']),
- ('\u{16e42}', ['\u{16e62}', '\u{0}', '\u{0}']),
- ('\u{16e43}', ['\u{16e63}', '\u{0}', '\u{0}']),
- ('\u{16e44}', ['\u{16e64}', '\u{0}', '\u{0}']),
- ('\u{16e45}', ['\u{16e65}', '\u{0}', '\u{0}']),
- ('\u{16e46}', ['\u{16e66}', '\u{0}', '\u{0}']),
- ('\u{16e47}', ['\u{16e67}', '\u{0}', '\u{0}']),
- ('\u{16e48}', ['\u{16e68}', '\u{0}', '\u{0}']),
- ('\u{16e49}', ['\u{16e69}', '\u{0}', '\u{0}']),
- ('\u{16e4a}', ['\u{16e6a}', '\u{0}', '\u{0}']),
- ('\u{16e4b}', ['\u{16e6b}', '\u{0}', '\u{0}']),
- ('\u{16e4c}', ['\u{16e6c}', '\u{0}', '\u{0}']),
- ('\u{16e4d}', ['\u{16e6d}', '\u{0}', '\u{0}']),
- ('\u{16e4e}', ['\u{16e6e}', '\u{0}', '\u{0}']),
- ('\u{16e4f}', ['\u{16e6f}', '\u{0}', '\u{0}']),
- ('\u{16e50}', ['\u{16e70}', '\u{0}', '\u{0}']),
- ('\u{16e51}', ['\u{16e71}', '\u{0}', '\u{0}']),
- ('\u{16e52}', ['\u{16e72}', '\u{0}', '\u{0}']),
- ('\u{16e53}', ['\u{16e73}', '\u{0}', '\u{0}']),
- ('\u{16e54}', ['\u{16e74}', '\u{0}', '\u{0}']),
- ('\u{16e55}', ['\u{16e75}', '\u{0}', '\u{0}']),
- ('\u{16e56}', ['\u{16e76}', '\u{0}', '\u{0}']),
- ('\u{16e57}', ['\u{16e77}', '\u{0}', '\u{0}']),
- ('\u{16e58}', ['\u{16e78}', '\u{0}', '\u{0}']),
- ('\u{16e59}', ['\u{16e79}', '\u{0}', '\u{0}']),
- ('\u{16e5a}', ['\u{16e7a}', '\u{0}', '\u{0}']),
- ('\u{16e5b}', ['\u{16e7b}', '\u{0}', '\u{0}']),
- ('\u{16e5c}', ['\u{16e7c}', '\u{0}', '\u{0}']),
- ('\u{16e5d}', ['\u{16e7d}', '\u{0}', '\u{0}']),
- ('\u{16e5e}', ['\u{16e7e}', '\u{0}', '\u{0}']),
- ('\u{16e5f}', ['\u{16e7f}', '\u{0}', '\u{0}']),
- ('\u{16ea0}', ['\u{16ebb}', '\u{0}', '\u{0}']),
- ('\u{16ea1}', ['\u{16ebc}', '\u{0}', '\u{0}']),
- ('\u{16ea2}', ['\u{16ebd}', '\u{0}', '\u{0}']),
- ('\u{16ea3}', ['\u{16ebe}', '\u{0}', '\u{0}']),
- ('\u{16ea4}', ['\u{16ebf}', '\u{0}', '\u{0}']),
- ('\u{16ea5}', ['\u{16ec0}', '\u{0}', '\u{0}']),
- ('\u{16ea6}', ['\u{16ec1}', '\u{0}', '\u{0}']),
- ('\u{16ea7}', ['\u{16ec2}', '\u{0}', '\u{0}']),
- ('\u{16ea8}', ['\u{16ec3}', '\u{0}', '\u{0}']),
- ('\u{16ea9}', ['\u{16ec4}', '\u{0}', '\u{0}']),
- ('\u{16eaa}', ['\u{16ec5}', '\u{0}', '\u{0}']),
- ('\u{16eab}', ['\u{16ec6}', '\u{0}', '\u{0}']),
- ('\u{16eac}', ['\u{16ec7}', '\u{0}', '\u{0}']),
- ('\u{16ead}', ['\u{16ec8}', '\u{0}', '\u{0}']),
- ('\u{16eae}', ['\u{16ec9}', '\u{0}', '\u{0}']),
- ('\u{16eaf}', ['\u{16eca}', '\u{0}', '\u{0}']),
- ('\u{16eb0}', ['\u{16ecb}', '\u{0}', '\u{0}']),
- ('\u{16eb1}', ['\u{16ecc}', '\u{0}', '\u{0}']),
- ('\u{16eb2}', ['\u{16ecd}', '\u{0}', '\u{0}']),
- ('\u{16eb3}', ['\u{16ece}', '\u{0}', '\u{0}']),
- ('\u{16eb4}', ['\u{16ecf}', '\u{0}', '\u{0}']),
- ('\u{16eb5}', ['\u{16ed0}', '\u{0}', '\u{0}']),
- ('\u{16eb6}', ['\u{16ed1}', '\u{0}', '\u{0}']),
- ('\u{16eb7}', ['\u{16ed2}', '\u{0}', '\u{0}']),
- ('\u{16eb8}', ['\u{16ed3}', '\u{0}', '\u{0}']),
- ('\u{1e900}', ['\u{1e922}', '\u{0}', '\u{0}']),
- ('\u{1e901}', ['\u{1e923}', '\u{0}', '\u{0}']),
- ('\u{1e902}', ['\u{1e924}', '\u{0}', '\u{0}']),
- ('\u{1e903}', ['\u{1e925}', '\u{0}', '\u{0}']),
- ('\u{1e904}', ['\u{1e926}', '\u{0}', '\u{0}']),
- ('\u{1e905}', ['\u{1e927}', '\u{0}', '\u{0}']),
- ('\u{1e906}', ['\u{1e928}', '\u{0}', '\u{0}']),
- ('\u{1e907}', ['\u{1e929}', '\u{0}', '\u{0}']),
- ('\u{1e908}', ['\u{1e92a}', '\u{0}', '\u{0}']),
- ('\u{1e909}', ['\u{1e92b}', '\u{0}', '\u{0}']),
- ('\u{1e90a}', ['\u{1e92c}', '\u{0}', '\u{0}']),
- ('\u{1e90b}', ['\u{1e92d}', '\u{0}', '\u{0}']),
- ('\u{1e90c}', ['\u{1e92e}', '\u{0}', '\u{0}']),
- ('\u{1e90d}', ['\u{1e92f}', '\u{0}', '\u{0}']),
- ('\u{1e90e}', ['\u{1e930}', '\u{0}', '\u{0}']),
- ('\u{1e90f}', ['\u{1e931}', '\u{0}', '\u{0}']),
- ('\u{1e910}', ['\u{1e932}', '\u{0}', '\u{0}']),
- ('\u{1e911}', ['\u{1e933}', '\u{0}', '\u{0}']),
- ('\u{1e912}', ['\u{1e934}', '\u{0}', '\u{0}']),
- ('\u{1e913}', ['\u{1e935}', '\u{0}', '\u{0}']),
- ('\u{1e914}', ['\u{1e936}', '\u{0}', '\u{0}']),
- ('\u{1e915}', ['\u{1e937}', '\u{0}', '\u{0}']),
- ('\u{1e916}', ['\u{1e938}', '\u{0}', '\u{0}']),
- ('\u{1e917}', ['\u{1e939}', '\u{0}', '\u{0}']),
- ('\u{1e918}', ['\u{1e93a}', '\u{0}', '\u{0}']),
- ('\u{1e919}', ['\u{1e93b}', '\u{0}', '\u{0}']),
- ('\u{1e91a}', ['\u{1e93c}', '\u{0}', '\u{0}']),
- ('\u{1e91b}', ['\u{1e93d}', '\u{0}', '\u{0}']),
- ('\u{1e91c}', ['\u{1e93e}', '\u{0}', '\u{0}']),
- ('\u{1e91d}', ['\u{1e93f}', '\u{0}', '\u{0}']),
- ('\u{1e91e}', ['\u{1e940}', '\u{0}', '\u{0}']),
- ('\u{1e91f}', ['\u{1e941}', '\u{0}', '\u{0}']),
- ('\u{1e920}', ['\u{1e942}', '\u{0}', '\u{0}']),
- ('\u{1e921}', ['\u{1e943}', '\u{0}', '\u{0}']),
-];
-
-#[rustfmt::skip]
-pub(super) static TO_UPPER: &[(char, [char; 3]); 1580] = &[
- ('\u{61}', ['\u{41}', '\u{0}', '\u{0}']), ('\u{62}', ['\u{42}', '\u{0}', '\u{0}']),
- ('\u{63}', ['\u{43}', '\u{0}', '\u{0}']), ('\u{64}', ['\u{44}', '\u{0}', '\u{0}']),
- ('\u{65}', ['\u{45}', '\u{0}', '\u{0}']), ('\u{66}', ['\u{46}', '\u{0}', '\u{0}']),
- ('\u{67}', ['\u{47}', '\u{0}', '\u{0}']), ('\u{68}', ['\u{48}', '\u{0}', '\u{0}']),
- ('\u{69}', ['\u{49}', '\u{0}', '\u{0}']), ('\u{6a}', ['\u{4a}', '\u{0}', '\u{0}']),
- ('\u{6b}', ['\u{4b}', '\u{0}', '\u{0}']), ('\u{6c}', ['\u{4c}', '\u{0}', '\u{0}']),
- ('\u{6d}', ['\u{4d}', '\u{0}', '\u{0}']), ('\u{6e}', ['\u{4e}', '\u{0}', '\u{0}']),
- ('\u{6f}', ['\u{4f}', '\u{0}', '\u{0}']), ('\u{70}', ['\u{50}', '\u{0}', '\u{0}']),
- ('\u{71}', ['\u{51}', '\u{0}', '\u{0}']), ('\u{72}', ['\u{52}', '\u{0}', '\u{0}']),
- ('\u{73}', ['\u{53}', '\u{0}', '\u{0}']), ('\u{74}', ['\u{54}', '\u{0}', '\u{0}']),
- ('\u{75}', ['\u{55}', '\u{0}', '\u{0}']), ('\u{76}', ['\u{56}', '\u{0}', '\u{0}']),
- ('\u{77}', ['\u{57}', '\u{0}', '\u{0}']), ('\u{78}', ['\u{58}', '\u{0}', '\u{0}']),
- ('\u{79}', ['\u{59}', '\u{0}', '\u{0}']), ('\u{7a}', ['\u{5a}', '\u{0}', '\u{0}']),
- ('\u{b5}', ['\u{39c}', '\u{0}', '\u{0}']), ('\u{df}', ['\u{53}', '\u{53}', '\u{0}']),
- ('\u{e0}', ['\u{c0}', '\u{0}', '\u{0}']), ('\u{e1}', ['\u{c1}', '\u{0}', '\u{0}']),
- ('\u{e2}', ['\u{c2}', '\u{0}', '\u{0}']), ('\u{e3}', ['\u{c3}', '\u{0}', '\u{0}']),
- ('\u{e4}', ['\u{c4}', '\u{0}', '\u{0}']), ('\u{e5}', ['\u{c5}', '\u{0}', '\u{0}']),
- ('\u{e6}', ['\u{c6}', '\u{0}', '\u{0}']), ('\u{e7}', ['\u{c7}', '\u{0}', '\u{0}']),
- ('\u{e8}', ['\u{c8}', '\u{0}', '\u{0}']), ('\u{e9}', ['\u{c9}', '\u{0}', '\u{0}']),
- ('\u{ea}', ['\u{ca}', '\u{0}', '\u{0}']), ('\u{eb}', ['\u{cb}', '\u{0}', '\u{0}']),
- ('\u{ec}', ['\u{cc}', '\u{0}', '\u{0}']), ('\u{ed}', ['\u{cd}', '\u{0}', '\u{0}']),
- ('\u{ee}', ['\u{ce}', '\u{0}', '\u{0}']), ('\u{ef}', ['\u{cf}', '\u{0}', '\u{0}']),
- ('\u{f0}', ['\u{d0}', '\u{0}', '\u{0}']), ('\u{f1}', ['\u{d1}', '\u{0}', '\u{0}']),
- ('\u{f2}', ['\u{d2}', '\u{0}', '\u{0}']), ('\u{f3}', ['\u{d3}', '\u{0}', '\u{0}']),
- ('\u{f4}', ['\u{d4}', '\u{0}', '\u{0}']), ('\u{f5}', ['\u{d5}', '\u{0}', '\u{0}']),
- ('\u{f6}', ['\u{d6}', '\u{0}', '\u{0}']), ('\u{f8}', ['\u{d8}', '\u{0}', '\u{0}']),
- ('\u{f9}', ['\u{d9}', '\u{0}', '\u{0}']), ('\u{fa}', ['\u{da}', '\u{0}', '\u{0}']),
- ('\u{fb}', ['\u{db}', '\u{0}', '\u{0}']), ('\u{fc}', ['\u{dc}', '\u{0}', '\u{0}']),
- ('\u{fd}', ['\u{dd}', '\u{0}', '\u{0}']), ('\u{fe}', ['\u{de}', '\u{0}', '\u{0}']),
- ('\u{ff}', ['\u{178}', '\u{0}', '\u{0}']), ('\u{101}', ['\u{100}', '\u{0}', '\u{0}']),
- ('\u{103}', ['\u{102}', '\u{0}', '\u{0}']), ('\u{105}', ['\u{104}', '\u{0}', '\u{0}']),
- ('\u{107}', ['\u{106}', '\u{0}', '\u{0}']), ('\u{109}', ['\u{108}', '\u{0}', '\u{0}']),
- ('\u{10b}', ['\u{10a}', '\u{0}', '\u{0}']), ('\u{10d}', ['\u{10c}', '\u{0}', '\u{0}']),
- ('\u{10f}', ['\u{10e}', '\u{0}', '\u{0}']), ('\u{111}', ['\u{110}', '\u{0}', '\u{0}']),
- ('\u{113}', ['\u{112}', '\u{0}', '\u{0}']), ('\u{115}', ['\u{114}', '\u{0}', '\u{0}']),
- ('\u{117}', ['\u{116}', '\u{0}', '\u{0}']), ('\u{119}', ['\u{118}', '\u{0}', '\u{0}']),
- ('\u{11b}', ['\u{11a}', '\u{0}', '\u{0}']), ('\u{11d}', ['\u{11c}', '\u{0}', '\u{0}']),
- ('\u{11f}', ['\u{11e}', '\u{0}', '\u{0}']), ('\u{121}', ['\u{120}', '\u{0}', '\u{0}']),
- ('\u{123}', ['\u{122}', '\u{0}', '\u{0}']), ('\u{125}', ['\u{124}', '\u{0}', '\u{0}']),
- ('\u{127}', ['\u{126}', '\u{0}', '\u{0}']), ('\u{129}', ['\u{128}', '\u{0}', '\u{0}']),
- ('\u{12b}', ['\u{12a}', '\u{0}', '\u{0}']), ('\u{12d}', ['\u{12c}', '\u{0}', '\u{0}']),
- ('\u{12f}', ['\u{12e}', '\u{0}', '\u{0}']), ('\u{131}', ['\u{49}', '\u{0}', '\u{0}']),
- ('\u{133}', ['\u{132}', '\u{0}', '\u{0}']), ('\u{135}', ['\u{134}', '\u{0}', '\u{0}']),
- ('\u{137}', ['\u{136}', '\u{0}', '\u{0}']), ('\u{13a}', ['\u{139}', '\u{0}', '\u{0}']),
- ('\u{13c}', ['\u{13b}', '\u{0}', '\u{0}']), ('\u{13e}', ['\u{13d}', '\u{0}', '\u{0}']),
- ('\u{140}', ['\u{13f}', '\u{0}', '\u{0}']), ('\u{142}', ['\u{141}', '\u{0}', '\u{0}']),
- ('\u{144}', ['\u{143}', '\u{0}', '\u{0}']), ('\u{146}', ['\u{145}', '\u{0}', '\u{0}']),
- ('\u{148}', ['\u{147}', '\u{0}', '\u{0}']), ('\u{149}', ['\u{2bc}', '\u{4e}', '\u{0}']),
- ('\u{14b}', ['\u{14a}', '\u{0}', '\u{0}']), ('\u{14d}', ['\u{14c}', '\u{0}', '\u{0}']),
- ('\u{14f}', ['\u{14e}', '\u{0}', '\u{0}']), ('\u{151}', ['\u{150}', '\u{0}', '\u{0}']),
- ('\u{153}', ['\u{152}', '\u{0}', '\u{0}']), ('\u{155}', ['\u{154}', '\u{0}', '\u{0}']),
- ('\u{157}', ['\u{156}', '\u{0}', '\u{0}']), ('\u{159}', ['\u{158}', '\u{0}', '\u{0}']),
- ('\u{15b}', ['\u{15a}', '\u{0}', '\u{0}']), ('\u{15d}', ['\u{15c}', '\u{0}', '\u{0}']),
- ('\u{15f}', ['\u{15e}', '\u{0}', '\u{0}']), ('\u{161}', ['\u{160}', '\u{0}', '\u{0}']),
- ('\u{163}', ['\u{162}', '\u{0}', '\u{0}']), ('\u{165}', ['\u{164}', '\u{0}', '\u{0}']),
- ('\u{167}', ['\u{166}', '\u{0}', '\u{0}']), ('\u{169}', ['\u{168}', '\u{0}', '\u{0}']),
- ('\u{16b}', ['\u{16a}', '\u{0}', '\u{0}']), ('\u{16d}', ['\u{16c}', '\u{0}', '\u{0}']),
- ('\u{16f}', ['\u{16e}', '\u{0}', '\u{0}']), ('\u{171}', ['\u{170}', '\u{0}', '\u{0}']),
- ('\u{173}', ['\u{172}', '\u{0}', '\u{0}']), ('\u{175}', ['\u{174}', '\u{0}', '\u{0}']),
- ('\u{177}', ['\u{176}', '\u{0}', '\u{0}']), ('\u{17a}', ['\u{179}', '\u{0}', '\u{0}']),
- ('\u{17c}', ['\u{17b}', '\u{0}', '\u{0}']), ('\u{17e}', ['\u{17d}', '\u{0}', '\u{0}']),
- ('\u{17f}', ['\u{53}', '\u{0}', '\u{0}']), ('\u{180}', ['\u{243}', '\u{0}', '\u{0}']),
- ('\u{183}', ['\u{182}', '\u{0}', '\u{0}']), ('\u{185}', ['\u{184}', '\u{0}', '\u{0}']),
- ('\u{188}', ['\u{187}', '\u{0}', '\u{0}']), ('\u{18c}', ['\u{18b}', '\u{0}', '\u{0}']),
- ('\u{192}', ['\u{191}', '\u{0}', '\u{0}']), ('\u{195}', ['\u{1f6}', '\u{0}', '\u{0}']),
- ('\u{199}', ['\u{198}', '\u{0}', '\u{0}']), ('\u{19a}', ['\u{23d}', '\u{0}', '\u{0}']),
- ('\u{19b}', ['\u{a7dc}', '\u{0}', '\u{0}']), ('\u{19e}', ['\u{220}', '\u{0}', '\u{0}']),
- ('\u{1a1}', ['\u{1a0}', '\u{0}', '\u{0}']), ('\u{1a3}', ['\u{1a2}', '\u{0}', '\u{0}']),
- ('\u{1a5}', ['\u{1a4}', '\u{0}', '\u{0}']), ('\u{1a8}', ['\u{1a7}', '\u{0}', '\u{0}']),
- ('\u{1ad}', ['\u{1ac}', '\u{0}', '\u{0}']), ('\u{1b0}', ['\u{1af}', '\u{0}', '\u{0}']),
- ('\u{1b4}', ['\u{1b3}', '\u{0}', '\u{0}']), ('\u{1b6}', ['\u{1b5}', '\u{0}', '\u{0}']),
- ('\u{1b9}', ['\u{1b8}', '\u{0}', '\u{0}']), ('\u{1bd}', ['\u{1bc}', '\u{0}', '\u{0}']),
- ('\u{1bf}', ['\u{1f7}', '\u{0}', '\u{0}']), ('\u{1c5}', ['\u{1c4}', '\u{0}', '\u{0}']),
- ('\u{1c6}', ['\u{1c4}', '\u{0}', '\u{0}']), ('\u{1c8}', ['\u{1c7}', '\u{0}', '\u{0}']),
- ('\u{1c9}', ['\u{1c7}', '\u{0}', '\u{0}']), ('\u{1cb}', ['\u{1ca}', '\u{0}', '\u{0}']),
- ('\u{1cc}', ['\u{1ca}', '\u{0}', '\u{0}']), ('\u{1ce}', ['\u{1cd}', '\u{0}', '\u{0}']),
- ('\u{1d0}', ['\u{1cf}', '\u{0}', '\u{0}']), ('\u{1d2}', ['\u{1d1}', '\u{0}', '\u{0}']),
- ('\u{1d4}', ['\u{1d3}', '\u{0}', '\u{0}']), ('\u{1d6}', ['\u{1d5}', '\u{0}', '\u{0}']),
- ('\u{1d8}', ['\u{1d7}', '\u{0}', '\u{0}']), ('\u{1da}', ['\u{1d9}', '\u{0}', '\u{0}']),
- ('\u{1dc}', ['\u{1db}', '\u{0}', '\u{0}']), ('\u{1dd}', ['\u{18e}', '\u{0}', '\u{0}']),
- ('\u{1df}', ['\u{1de}', '\u{0}', '\u{0}']), ('\u{1e1}', ['\u{1e0}', '\u{0}', '\u{0}']),
- ('\u{1e3}', ['\u{1e2}', '\u{0}', '\u{0}']), ('\u{1e5}', ['\u{1e4}', '\u{0}', '\u{0}']),
- ('\u{1e7}', ['\u{1e6}', '\u{0}', '\u{0}']), ('\u{1e9}', ['\u{1e8}', '\u{0}', '\u{0}']),
- ('\u{1eb}', ['\u{1ea}', '\u{0}', '\u{0}']), ('\u{1ed}', ['\u{1ec}', '\u{0}', '\u{0}']),
- ('\u{1ef}', ['\u{1ee}', '\u{0}', '\u{0}']), ('\u{1f0}', ['\u{4a}', '\u{30c}', '\u{0}']),
- ('\u{1f2}', ['\u{1f1}', '\u{0}', '\u{0}']), ('\u{1f3}', ['\u{1f1}', '\u{0}', '\u{0}']),
- ('\u{1f5}', ['\u{1f4}', '\u{0}', '\u{0}']), ('\u{1f9}', ['\u{1f8}', '\u{0}', '\u{0}']),
- ('\u{1fb}', ['\u{1fa}', '\u{0}', '\u{0}']), ('\u{1fd}', ['\u{1fc}', '\u{0}', '\u{0}']),
- ('\u{1ff}', ['\u{1fe}', '\u{0}', '\u{0}']), ('\u{201}', ['\u{200}', '\u{0}', '\u{0}']),
- ('\u{203}', ['\u{202}', '\u{0}', '\u{0}']), ('\u{205}', ['\u{204}', '\u{0}', '\u{0}']),
- ('\u{207}', ['\u{206}', '\u{0}', '\u{0}']), ('\u{209}', ['\u{208}', '\u{0}', '\u{0}']),
- ('\u{20b}', ['\u{20a}', '\u{0}', '\u{0}']), ('\u{20d}', ['\u{20c}', '\u{0}', '\u{0}']),
- ('\u{20f}', ['\u{20e}', '\u{0}', '\u{0}']), ('\u{211}', ['\u{210}', '\u{0}', '\u{0}']),
- ('\u{213}', ['\u{212}', '\u{0}', '\u{0}']), ('\u{215}', ['\u{214}', '\u{0}', '\u{0}']),
- ('\u{217}', ['\u{216}', '\u{0}', '\u{0}']), ('\u{219}', ['\u{218}', '\u{0}', '\u{0}']),
- ('\u{21b}', ['\u{21a}', '\u{0}', '\u{0}']), ('\u{21d}', ['\u{21c}', '\u{0}', '\u{0}']),
- ('\u{21f}', ['\u{21e}', '\u{0}', '\u{0}']), ('\u{223}', ['\u{222}', '\u{0}', '\u{0}']),
- ('\u{225}', ['\u{224}', '\u{0}', '\u{0}']), ('\u{227}', ['\u{226}', '\u{0}', '\u{0}']),
- ('\u{229}', ['\u{228}', '\u{0}', '\u{0}']), ('\u{22b}', ['\u{22a}', '\u{0}', '\u{0}']),
- ('\u{22d}', ['\u{22c}', '\u{0}', '\u{0}']), ('\u{22f}', ['\u{22e}', '\u{0}', '\u{0}']),
- ('\u{231}', ['\u{230}', '\u{0}', '\u{0}']), ('\u{233}', ['\u{232}', '\u{0}', '\u{0}']),
- ('\u{23c}', ['\u{23b}', '\u{0}', '\u{0}']), ('\u{23f}', ['\u{2c7e}', '\u{0}', '\u{0}']),
- ('\u{240}', ['\u{2c7f}', '\u{0}', '\u{0}']), ('\u{242}', ['\u{241}', '\u{0}', '\u{0}']),
- ('\u{247}', ['\u{246}', '\u{0}', '\u{0}']), ('\u{249}', ['\u{248}', '\u{0}', '\u{0}']),
- ('\u{24b}', ['\u{24a}', '\u{0}', '\u{0}']), ('\u{24d}', ['\u{24c}', '\u{0}', '\u{0}']),
- ('\u{24f}', ['\u{24e}', '\u{0}', '\u{0}']), ('\u{250}', ['\u{2c6f}', '\u{0}', '\u{0}']),
- ('\u{251}', ['\u{2c6d}', '\u{0}', '\u{0}']), ('\u{252}', ['\u{2c70}', '\u{0}', '\u{0}']),
- ('\u{253}', ['\u{181}', '\u{0}', '\u{0}']), ('\u{254}', ['\u{186}', '\u{0}', '\u{0}']),
- ('\u{256}', ['\u{189}', '\u{0}', '\u{0}']), ('\u{257}', ['\u{18a}', '\u{0}', '\u{0}']),
- ('\u{259}', ['\u{18f}', '\u{0}', '\u{0}']), ('\u{25b}', ['\u{190}', '\u{0}', '\u{0}']),
- ('\u{25c}', ['\u{a7ab}', '\u{0}', '\u{0}']), ('\u{260}', ['\u{193}', '\u{0}', '\u{0}']),
- ('\u{261}', ['\u{a7ac}', '\u{0}', '\u{0}']), ('\u{263}', ['\u{194}', '\u{0}', '\u{0}']),
- ('\u{264}', ['\u{a7cb}', '\u{0}', '\u{0}']), ('\u{265}', ['\u{a78d}', '\u{0}', '\u{0}']),
- ('\u{266}', ['\u{a7aa}', '\u{0}', '\u{0}']), ('\u{268}', ['\u{197}', '\u{0}', '\u{0}']),
- ('\u{269}', ['\u{196}', '\u{0}', '\u{0}']), ('\u{26a}', ['\u{a7ae}', '\u{0}', '\u{0}']),
- ('\u{26b}', ['\u{2c62}', '\u{0}', '\u{0}']), ('\u{26c}', ['\u{a7ad}', '\u{0}', '\u{0}']),
- ('\u{26f}', ['\u{19c}', '\u{0}', '\u{0}']), ('\u{271}', ['\u{2c6e}', '\u{0}', '\u{0}']),
- ('\u{272}', ['\u{19d}', '\u{0}', '\u{0}']), ('\u{275}', ['\u{19f}', '\u{0}', '\u{0}']),
- ('\u{27d}', ['\u{2c64}', '\u{0}', '\u{0}']), ('\u{280}', ['\u{1a6}', '\u{0}', '\u{0}']),
- ('\u{282}', ['\u{a7c5}', '\u{0}', '\u{0}']), ('\u{283}', ['\u{1a9}', '\u{0}', '\u{0}']),
- ('\u{287}', ['\u{a7b1}', '\u{0}', '\u{0}']), ('\u{288}', ['\u{1ae}', '\u{0}', '\u{0}']),
- ('\u{289}', ['\u{244}', '\u{0}', '\u{0}']), ('\u{28a}', ['\u{1b1}', '\u{0}', '\u{0}']),
- ('\u{28b}', ['\u{1b2}', '\u{0}', '\u{0}']), ('\u{28c}', ['\u{245}', '\u{0}', '\u{0}']),
- ('\u{292}', ['\u{1b7}', '\u{0}', '\u{0}']), ('\u{29d}', ['\u{a7b2}', '\u{0}', '\u{0}']),
- ('\u{29e}', ['\u{a7b0}', '\u{0}', '\u{0}']), ('\u{345}', ['\u{399}', '\u{0}', '\u{0}']),
- ('\u{371}', ['\u{370}', '\u{0}', '\u{0}']), ('\u{373}', ['\u{372}', '\u{0}', '\u{0}']),
- ('\u{377}', ['\u{376}', '\u{0}', '\u{0}']), ('\u{37b}', ['\u{3fd}', '\u{0}', '\u{0}']),
- ('\u{37c}', ['\u{3fe}', '\u{0}', '\u{0}']), ('\u{37d}', ['\u{3ff}', '\u{0}', '\u{0}']),
- ('\u{390}', ['\u{399}', '\u{308}', '\u{301}']), ('\u{3ac}', ['\u{386}', '\u{0}', '\u{0}']),
- ('\u{3ad}', ['\u{388}', '\u{0}', '\u{0}']), ('\u{3ae}', ['\u{389}', '\u{0}', '\u{0}']),
- ('\u{3af}', ['\u{38a}', '\u{0}', '\u{0}']), ('\u{3b0}', ['\u{3a5}', '\u{308}', '\u{301}']),
- ('\u{3b1}', ['\u{391}', '\u{0}', '\u{0}']), ('\u{3b2}', ['\u{392}', '\u{0}', '\u{0}']),
- ('\u{3b3}', ['\u{393}', '\u{0}', '\u{0}']), ('\u{3b4}', ['\u{394}', '\u{0}', '\u{0}']),
- ('\u{3b5}', ['\u{395}', '\u{0}', '\u{0}']), ('\u{3b6}', ['\u{396}', '\u{0}', '\u{0}']),
- ('\u{3b7}', ['\u{397}', '\u{0}', '\u{0}']), ('\u{3b8}', ['\u{398}', '\u{0}', '\u{0}']),
- ('\u{3b9}', ['\u{399}', '\u{0}', '\u{0}']), ('\u{3ba}', ['\u{39a}', '\u{0}', '\u{0}']),
- ('\u{3bb}', ['\u{39b}', '\u{0}', '\u{0}']), ('\u{3bc}', ['\u{39c}', '\u{0}', '\u{0}']),
- ('\u{3bd}', ['\u{39d}', '\u{0}', '\u{0}']), ('\u{3be}', ['\u{39e}', '\u{0}', '\u{0}']),
- ('\u{3bf}', ['\u{39f}', '\u{0}', '\u{0}']), ('\u{3c0}', ['\u{3a0}', '\u{0}', '\u{0}']),
- ('\u{3c1}', ['\u{3a1}', '\u{0}', '\u{0}']), ('\u{3c2}', ['\u{3a3}', '\u{0}', '\u{0}']),
- ('\u{3c3}', ['\u{3a3}', '\u{0}', '\u{0}']), ('\u{3c4}', ['\u{3a4}', '\u{0}', '\u{0}']),
- ('\u{3c5}', ['\u{3a5}', '\u{0}', '\u{0}']), ('\u{3c6}', ['\u{3a6}', '\u{0}', '\u{0}']),
- ('\u{3c7}', ['\u{3a7}', '\u{0}', '\u{0}']), ('\u{3c8}', ['\u{3a8}', '\u{0}', '\u{0}']),
- ('\u{3c9}', ['\u{3a9}', '\u{0}', '\u{0}']), ('\u{3ca}', ['\u{3aa}', '\u{0}', '\u{0}']),
- ('\u{3cb}', ['\u{3ab}', '\u{0}', '\u{0}']), ('\u{3cc}', ['\u{38c}', '\u{0}', '\u{0}']),
- ('\u{3cd}', ['\u{38e}', '\u{0}', '\u{0}']), ('\u{3ce}', ['\u{38f}', '\u{0}', '\u{0}']),
- ('\u{3d0}', ['\u{392}', '\u{0}', '\u{0}']), ('\u{3d1}', ['\u{398}', '\u{0}', '\u{0}']),
- ('\u{3d5}', ['\u{3a6}', '\u{0}', '\u{0}']), ('\u{3d6}', ['\u{3a0}', '\u{0}', '\u{0}']),
- ('\u{3d7}', ['\u{3cf}', '\u{0}', '\u{0}']), ('\u{3d9}', ['\u{3d8}', '\u{0}', '\u{0}']),
- ('\u{3db}', ['\u{3da}', '\u{0}', '\u{0}']), ('\u{3dd}', ['\u{3dc}', '\u{0}', '\u{0}']),
- ('\u{3df}', ['\u{3de}', '\u{0}', '\u{0}']), ('\u{3e1}', ['\u{3e0}', '\u{0}', '\u{0}']),
- ('\u{3e3}', ['\u{3e2}', '\u{0}', '\u{0}']), ('\u{3e5}', ['\u{3e4}', '\u{0}', '\u{0}']),
- ('\u{3e7}', ['\u{3e6}', '\u{0}', '\u{0}']), ('\u{3e9}', ['\u{3e8}', '\u{0}', '\u{0}']),
- ('\u{3eb}', ['\u{3ea}', '\u{0}', '\u{0}']), ('\u{3ed}', ['\u{3ec}', '\u{0}', '\u{0}']),
- ('\u{3ef}', ['\u{3ee}', '\u{0}', '\u{0}']), ('\u{3f0}', ['\u{39a}', '\u{0}', '\u{0}']),
- ('\u{3f1}', ['\u{3a1}', '\u{0}', '\u{0}']), ('\u{3f2}', ['\u{3f9}', '\u{0}', '\u{0}']),
- ('\u{3f3}', ['\u{37f}', '\u{0}', '\u{0}']), ('\u{3f5}', ['\u{395}', '\u{0}', '\u{0}']),
- ('\u{3f8}', ['\u{3f7}', '\u{0}', '\u{0}']), ('\u{3fb}', ['\u{3fa}', '\u{0}', '\u{0}']),
- ('\u{430}', ['\u{410}', '\u{0}', '\u{0}']), ('\u{431}', ['\u{411}', '\u{0}', '\u{0}']),
- ('\u{432}', ['\u{412}', '\u{0}', '\u{0}']), ('\u{433}', ['\u{413}', '\u{0}', '\u{0}']),
- ('\u{434}', ['\u{414}', '\u{0}', '\u{0}']), ('\u{435}', ['\u{415}', '\u{0}', '\u{0}']),
- ('\u{436}', ['\u{416}', '\u{0}', '\u{0}']), ('\u{437}', ['\u{417}', '\u{0}', '\u{0}']),
- ('\u{438}', ['\u{418}', '\u{0}', '\u{0}']), ('\u{439}', ['\u{419}', '\u{0}', '\u{0}']),
- ('\u{43a}', ['\u{41a}', '\u{0}', '\u{0}']), ('\u{43b}', ['\u{41b}', '\u{0}', '\u{0}']),
- ('\u{43c}', ['\u{41c}', '\u{0}', '\u{0}']), ('\u{43d}', ['\u{41d}', '\u{0}', '\u{0}']),
- ('\u{43e}', ['\u{41e}', '\u{0}', '\u{0}']), ('\u{43f}', ['\u{41f}', '\u{0}', '\u{0}']),
- ('\u{440}', ['\u{420}', '\u{0}', '\u{0}']), ('\u{441}', ['\u{421}', '\u{0}', '\u{0}']),
- ('\u{442}', ['\u{422}', '\u{0}', '\u{0}']), ('\u{443}', ['\u{423}', '\u{0}', '\u{0}']),
- ('\u{444}', ['\u{424}', '\u{0}', '\u{0}']), ('\u{445}', ['\u{425}', '\u{0}', '\u{0}']),
- ('\u{446}', ['\u{426}', '\u{0}', '\u{0}']), ('\u{447}', ['\u{427}', '\u{0}', '\u{0}']),
- ('\u{448}', ['\u{428}', '\u{0}', '\u{0}']), ('\u{449}', ['\u{429}', '\u{0}', '\u{0}']),
- ('\u{44a}', ['\u{42a}', '\u{0}', '\u{0}']), ('\u{44b}', ['\u{42b}', '\u{0}', '\u{0}']),
- ('\u{44c}', ['\u{42c}', '\u{0}', '\u{0}']), ('\u{44d}', ['\u{42d}', '\u{0}', '\u{0}']),
- ('\u{44e}', ['\u{42e}', '\u{0}', '\u{0}']), ('\u{44f}', ['\u{42f}', '\u{0}', '\u{0}']),
- ('\u{450}', ['\u{400}', '\u{0}', '\u{0}']), ('\u{451}', ['\u{401}', '\u{0}', '\u{0}']),
- ('\u{452}', ['\u{402}', '\u{0}', '\u{0}']), ('\u{453}', ['\u{403}', '\u{0}', '\u{0}']),
- ('\u{454}', ['\u{404}', '\u{0}', '\u{0}']), ('\u{455}', ['\u{405}', '\u{0}', '\u{0}']),
- ('\u{456}', ['\u{406}', '\u{0}', '\u{0}']), ('\u{457}', ['\u{407}', '\u{0}', '\u{0}']),
- ('\u{458}', ['\u{408}', '\u{0}', '\u{0}']), ('\u{459}', ['\u{409}', '\u{0}', '\u{0}']),
- ('\u{45a}', ['\u{40a}', '\u{0}', '\u{0}']), ('\u{45b}', ['\u{40b}', '\u{0}', '\u{0}']),
- ('\u{45c}', ['\u{40c}', '\u{0}', '\u{0}']), ('\u{45d}', ['\u{40d}', '\u{0}', '\u{0}']),
- ('\u{45e}', ['\u{40e}', '\u{0}', '\u{0}']), ('\u{45f}', ['\u{40f}', '\u{0}', '\u{0}']),
- ('\u{461}', ['\u{460}', '\u{0}', '\u{0}']), ('\u{463}', ['\u{462}', '\u{0}', '\u{0}']),
- ('\u{465}', ['\u{464}', '\u{0}', '\u{0}']), ('\u{467}', ['\u{466}', '\u{0}', '\u{0}']),
- ('\u{469}', ['\u{468}', '\u{0}', '\u{0}']), ('\u{46b}', ['\u{46a}', '\u{0}', '\u{0}']),
- ('\u{46d}', ['\u{46c}', '\u{0}', '\u{0}']), ('\u{46f}', ['\u{46e}', '\u{0}', '\u{0}']),
- ('\u{471}', ['\u{470}', '\u{0}', '\u{0}']), ('\u{473}', ['\u{472}', '\u{0}', '\u{0}']),
- ('\u{475}', ['\u{474}', '\u{0}', '\u{0}']), ('\u{477}', ['\u{476}', '\u{0}', '\u{0}']),
- ('\u{479}', ['\u{478}', '\u{0}', '\u{0}']), ('\u{47b}', ['\u{47a}', '\u{0}', '\u{0}']),
- ('\u{47d}', ['\u{47c}', '\u{0}', '\u{0}']), ('\u{47f}', ['\u{47e}', '\u{0}', '\u{0}']),
- ('\u{481}', ['\u{480}', '\u{0}', '\u{0}']), ('\u{48b}', ['\u{48a}', '\u{0}', '\u{0}']),
- ('\u{48d}', ['\u{48c}', '\u{0}', '\u{0}']), ('\u{48f}', ['\u{48e}', '\u{0}', '\u{0}']),
- ('\u{491}', ['\u{490}', '\u{0}', '\u{0}']), ('\u{493}', ['\u{492}', '\u{0}', '\u{0}']),
- ('\u{495}', ['\u{494}', '\u{0}', '\u{0}']), ('\u{497}', ['\u{496}', '\u{0}', '\u{0}']),
- ('\u{499}', ['\u{498}', '\u{0}', '\u{0}']), ('\u{49b}', ['\u{49a}', '\u{0}', '\u{0}']),
- ('\u{49d}', ['\u{49c}', '\u{0}', '\u{0}']), ('\u{49f}', ['\u{49e}', '\u{0}', '\u{0}']),
- ('\u{4a1}', ['\u{4a0}', '\u{0}', '\u{0}']), ('\u{4a3}', ['\u{4a2}', '\u{0}', '\u{0}']),
- ('\u{4a5}', ['\u{4a4}', '\u{0}', '\u{0}']), ('\u{4a7}', ['\u{4a6}', '\u{0}', '\u{0}']),
- ('\u{4a9}', ['\u{4a8}', '\u{0}', '\u{0}']), ('\u{4ab}', ['\u{4aa}', '\u{0}', '\u{0}']),
- ('\u{4ad}', ['\u{4ac}', '\u{0}', '\u{0}']), ('\u{4af}', ['\u{4ae}', '\u{0}', '\u{0}']),
- ('\u{4b1}', ['\u{4b0}', '\u{0}', '\u{0}']), ('\u{4b3}', ['\u{4b2}', '\u{0}', '\u{0}']),
- ('\u{4b5}', ['\u{4b4}', '\u{0}', '\u{0}']), ('\u{4b7}', ['\u{4b6}', '\u{0}', '\u{0}']),
- ('\u{4b9}', ['\u{4b8}', '\u{0}', '\u{0}']), ('\u{4bb}', ['\u{4ba}', '\u{0}', '\u{0}']),
- ('\u{4bd}', ['\u{4bc}', '\u{0}', '\u{0}']), ('\u{4bf}', ['\u{4be}', '\u{0}', '\u{0}']),
- ('\u{4c2}', ['\u{4c1}', '\u{0}', '\u{0}']), ('\u{4c4}', ['\u{4c3}', '\u{0}', '\u{0}']),
- ('\u{4c6}', ['\u{4c5}', '\u{0}', '\u{0}']), ('\u{4c8}', ['\u{4c7}', '\u{0}', '\u{0}']),
- ('\u{4ca}', ['\u{4c9}', '\u{0}', '\u{0}']), ('\u{4cc}', ['\u{4cb}', '\u{0}', '\u{0}']),
- ('\u{4ce}', ['\u{4cd}', '\u{0}', '\u{0}']), ('\u{4cf}', ['\u{4c0}', '\u{0}', '\u{0}']),
- ('\u{4d1}', ['\u{4d0}', '\u{0}', '\u{0}']), ('\u{4d3}', ['\u{4d2}', '\u{0}', '\u{0}']),
- ('\u{4d5}', ['\u{4d4}', '\u{0}', '\u{0}']), ('\u{4d7}', ['\u{4d6}', '\u{0}', '\u{0}']),
- ('\u{4d9}', ['\u{4d8}', '\u{0}', '\u{0}']), ('\u{4db}', ['\u{4da}', '\u{0}', '\u{0}']),
- ('\u{4dd}', ['\u{4dc}', '\u{0}', '\u{0}']), ('\u{4df}', ['\u{4de}', '\u{0}', '\u{0}']),
- ('\u{4e1}', ['\u{4e0}', '\u{0}', '\u{0}']), ('\u{4e3}', ['\u{4e2}', '\u{0}', '\u{0}']),
- ('\u{4e5}', ['\u{4e4}', '\u{0}', '\u{0}']), ('\u{4e7}', ['\u{4e6}', '\u{0}', '\u{0}']),
- ('\u{4e9}', ['\u{4e8}', '\u{0}', '\u{0}']), ('\u{4eb}', ['\u{4ea}', '\u{0}', '\u{0}']),
- ('\u{4ed}', ['\u{4ec}', '\u{0}', '\u{0}']), ('\u{4ef}', ['\u{4ee}', '\u{0}', '\u{0}']),
- ('\u{4f1}', ['\u{4f0}', '\u{0}', '\u{0}']), ('\u{4f3}', ['\u{4f2}', '\u{0}', '\u{0}']),
- ('\u{4f5}', ['\u{4f4}', '\u{0}', '\u{0}']), ('\u{4f7}', ['\u{4f6}', '\u{0}', '\u{0}']),
- ('\u{4f9}', ['\u{4f8}', '\u{0}', '\u{0}']), ('\u{4fb}', ['\u{4fa}', '\u{0}', '\u{0}']),
- ('\u{4fd}', ['\u{4fc}', '\u{0}', '\u{0}']), ('\u{4ff}', ['\u{4fe}', '\u{0}', '\u{0}']),
- ('\u{501}', ['\u{500}', '\u{0}', '\u{0}']), ('\u{503}', ['\u{502}', '\u{0}', '\u{0}']),
- ('\u{505}', ['\u{504}', '\u{0}', '\u{0}']), ('\u{507}', ['\u{506}', '\u{0}', '\u{0}']),
- ('\u{509}', ['\u{508}', '\u{0}', '\u{0}']), ('\u{50b}', ['\u{50a}', '\u{0}', '\u{0}']),
- ('\u{50d}', ['\u{50c}', '\u{0}', '\u{0}']), ('\u{50f}', ['\u{50e}', '\u{0}', '\u{0}']),
- ('\u{511}', ['\u{510}', '\u{0}', '\u{0}']), ('\u{513}', ['\u{512}', '\u{0}', '\u{0}']),
- ('\u{515}', ['\u{514}', '\u{0}', '\u{0}']), ('\u{517}', ['\u{516}', '\u{0}', '\u{0}']),
- ('\u{519}', ['\u{518}', '\u{0}', '\u{0}']), ('\u{51b}', ['\u{51a}', '\u{0}', '\u{0}']),
- ('\u{51d}', ['\u{51c}', '\u{0}', '\u{0}']), ('\u{51f}', ['\u{51e}', '\u{0}', '\u{0}']),
- ('\u{521}', ['\u{520}', '\u{0}', '\u{0}']), ('\u{523}', ['\u{522}', '\u{0}', '\u{0}']),
- ('\u{525}', ['\u{524}', '\u{0}', '\u{0}']), ('\u{527}', ['\u{526}', '\u{0}', '\u{0}']),
- ('\u{529}', ['\u{528}', '\u{0}', '\u{0}']), ('\u{52b}', ['\u{52a}', '\u{0}', '\u{0}']),
- ('\u{52d}', ['\u{52c}', '\u{0}', '\u{0}']), ('\u{52f}', ['\u{52e}', '\u{0}', '\u{0}']),
- ('\u{561}', ['\u{531}', '\u{0}', '\u{0}']), ('\u{562}', ['\u{532}', '\u{0}', '\u{0}']),
- ('\u{563}', ['\u{533}', '\u{0}', '\u{0}']), ('\u{564}', ['\u{534}', '\u{0}', '\u{0}']),
- ('\u{565}', ['\u{535}', '\u{0}', '\u{0}']), ('\u{566}', ['\u{536}', '\u{0}', '\u{0}']),
- ('\u{567}', ['\u{537}', '\u{0}', '\u{0}']), ('\u{568}', ['\u{538}', '\u{0}', '\u{0}']),
- ('\u{569}', ['\u{539}', '\u{0}', '\u{0}']), ('\u{56a}', ['\u{53a}', '\u{0}', '\u{0}']),
- ('\u{56b}', ['\u{53b}', '\u{0}', '\u{0}']), ('\u{56c}', ['\u{53c}', '\u{0}', '\u{0}']),
- ('\u{56d}', ['\u{53d}', '\u{0}', '\u{0}']), ('\u{56e}', ['\u{53e}', '\u{0}', '\u{0}']),
- ('\u{56f}', ['\u{53f}', '\u{0}', '\u{0}']), ('\u{570}', ['\u{540}', '\u{0}', '\u{0}']),
- ('\u{571}', ['\u{541}', '\u{0}', '\u{0}']), ('\u{572}', ['\u{542}', '\u{0}', '\u{0}']),
- ('\u{573}', ['\u{543}', '\u{0}', '\u{0}']), ('\u{574}', ['\u{544}', '\u{0}', '\u{0}']),
- ('\u{575}', ['\u{545}', '\u{0}', '\u{0}']), ('\u{576}', ['\u{546}', '\u{0}', '\u{0}']),
- ('\u{577}', ['\u{547}', '\u{0}', '\u{0}']), ('\u{578}', ['\u{548}', '\u{0}', '\u{0}']),
- ('\u{579}', ['\u{549}', '\u{0}', '\u{0}']), ('\u{57a}', ['\u{54a}', '\u{0}', '\u{0}']),
- ('\u{57b}', ['\u{54b}', '\u{0}', '\u{0}']), ('\u{57c}', ['\u{54c}', '\u{0}', '\u{0}']),
- ('\u{57d}', ['\u{54d}', '\u{0}', '\u{0}']), ('\u{57e}', ['\u{54e}', '\u{0}', '\u{0}']),
- ('\u{57f}', ['\u{54f}', '\u{0}', '\u{0}']), ('\u{580}', ['\u{550}', '\u{0}', '\u{0}']),
- ('\u{581}', ['\u{551}', '\u{0}', '\u{0}']), ('\u{582}', ['\u{552}', '\u{0}', '\u{0}']),
- ('\u{583}', ['\u{553}', '\u{0}', '\u{0}']), ('\u{584}', ['\u{554}', '\u{0}', '\u{0}']),
- ('\u{585}', ['\u{555}', '\u{0}', '\u{0}']), ('\u{586}', ['\u{556}', '\u{0}', '\u{0}']),
- ('\u{587}', ['\u{535}', '\u{552}', '\u{0}']), ('\u{10d0}', ['\u{1c90}', '\u{0}', '\u{0}']),
- ('\u{10d1}', ['\u{1c91}', '\u{0}', '\u{0}']), ('\u{10d2}', ['\u{1c92}', '\u{0}', '\u{0}']),
- ('\u{10d3}', ['\u{1c93}', '\u{0}', '\u{0}']), ('\u{10d4}', ['\u{1c94}', '\u{0}', '\u{0}']),
- ('\u{10d5}', ['\u{1c95}', '\u{0}', '\u{0}']), ('\u{10d6}', ['\u{1c96}', '\u{0}', '\u{0}']),
- ('\u{10d7}', ['\u{1c97}', '\u{0}', '\u{0}']), ('\u{10d8}', ['\u{1c98}', '\u{0}', '\u{0}']),
- ('\u{10d9}', ['\u{1c99}', '\u{0}', '\u{0}']), ('\u{10da}', ['\u{1c9a}', '\u{0}', '\u{0}']),
- ('\u{10db}', ['\u{1c9b}', '\u{0}', '\u{0}']), ('\u{10dc}', ['\u{1c9c}', '\u{0}', '\u{0}']),
- ('\u{10dd}', ['\u{1c9d}', '\u{0}', '\u{0}']), ('\u{10de}', ['\u{1c9e}', '\u{0}', '\u{0}']),
- ('\u{10df}', ['\u{1c9f}', '\u{0}', '\u{0}']), ('\u{10e0}', ['\u{1ca0}', '\u{0}', '\u{0}']),
- ('\u{10e1}', ['\u{1ca1}', '\u{0}', '\u{0}']), ('\u{10e2}', ['\u{1ca2}', '\u{0}', '\u{0}']),
- ('\u{10e3}', ['\u{1ca3}', '\u{0}', '\u{0}']), ('\u{10e4}', ['\u{1ca4}', '\u{0}', '\u{0}']),
- ('\u{10e5}', ['\u{1ca5}', '\u{0}', '\u{0}']), ('\u{10e6}', ['\u{1ca6}', '\u{0}', '\u{0}']),
- ('\u{10e7}', ['\u{1ca7}', '\u{0}', '\u{0}']), ('\u{10e8}', ['\u{1ca8}', '\u{0}', '\u{0}']),
- ('\u{10e9}', ['\u{1ca9}', '\u{0}', '\u{0}']), ('\u{10ea}', ['\u{1caa}', '\u{0}', '\u{0}']),
- ('\u{10eb}', ['\u{1cab}', '\u{0}', '\u{0}']), ('\u{10ec}', ['\u{1cac}', '\u{0}', '\u{0}']),
- ('\u{10ed}', ['\u{1cad}', '\u{0}', '\u{0}']), ('\u{10ee}', ['\u{1cae}', '\u{0}', '\u{0}']),
- ('\u{10ef}', ['\u{1caf}', '\u{0}', '\u{0}']), ('\u{10f0}', ['\u{1cb0}', '\u{0}', '\u{0}']),
- ('\u{10f1}', ['\u{1cb1}', '\u{0}', '\u{0}']), ('\u{10f2}', ['\u{1cb2}', '\u{0}', '\u{0}']),
- ('\u{10f3}', ['\u{1cb3}', '\u{0}', '\u{0}']), ('\u{10f4}', ['\u{1cb4}', '\u{0}', '\u{0}']),
- ('\u{10f5}', ['\u{1cb5}', '\u{0}', '\u{0}']), ('\u{10f6}', ['\u{1cb6}', '\u{0}', '\u{0}']),
- ('\u{10f7}', ['\u{1cb7}', '\u{0}', '\u{0}']), ('\u{10f8}', ['\u{1cb8}', '\u{0}', '\u{0}']),
- ('\u{10f9}', ['\u{1cb9}', '\u{0}', '\u{0}']), ('\u{10fa}', ['\u{1cba}', '\u{0}', '\u{0}']),
- ('\u{10fd}', ['\u{1cbd}', '\u{0}', '\u{0}']), ('\u{10fe}', ['\u{1cbe}', '\u{0}', '\u{0}']),
- ('\u{10ff}', ['\u{1cbf}', '\u{0}', '\u{0}']), ('\u{13f8}', ['\u{13f0}', '\u{0}', '\u{0}']),
- ('\u{13f9}', ['\u{13f1}', '\u{0}', '\u{0}']), ('\u{13fa}', ['\u{13f2}', '\u{0}', '\u{0}']),
- ('\u{13fb}', ['\u{13f3}', '\u{0}', '\u{0}']), ('\u{13fc}', ['\u{13f4}', '\u{0}', '\u{0}']),
- ('\u{13fd}', ['\u{13f5}', '\u{0}', '\u{0}']), ('\u{1c80}', ['\u{412}', '\u{0}', '\u{0}']),
- ('\u{1c81}', ['\u{414}', '\u{0}', '\u{0}']), ('\u{1c82}', ['\u{41e}', '\u{0}', '\u{0}']),
- ('\u{1c83}', ['\u{421}', '\u{0}', '\u{0}']), ('\u{1c84}', ['\u{422}', '\u{0}', '\u{0}']),
- ('\u{1c85}', ['\u{422}', '\u{0}', '\u{0}']), ('\u{1c86}', ['\u{42a}', '\u{0}', '\u{0}']),
- ('\u{1c87}', ['\u{462}', '\u{0}', '\u{0}']), ('\u{1c88}', ['\u{a64a}', '\u{0}', '\u{0}']),
- ('\u{1c8a}', ['\u{1c89}', '\u{0}', '\u{0}']), ('\u{1d79}', ['\u{a77d}', '\u{0}', '\u{0}']),
- ('\u{1d7d}', ['\u{2c63}', '\u{0}', '\u{0}']), ('\u{1d8e}', ['\u{a7c6}', '\u{0}', '\u{0}']),
- ('\u{1e01}', ['\u{1e00}', '\u{0}', '\u{0}']), ('\u{1e03}', ['\u{1e02}', '\u{0}', '\u{0}']),
- ('\u{1e05}', ['\u{1e04}', '\u{0}', '\u{0}']), ('\u{1e07}', ['\u{1e06}', '\u{0}', '\u{0}']),
- ('\u{1e09}', ['\u{1e08}', '\u{0}', '\u{0}']), ('\u{1e0b}', ['\u{1e0a}', '\u{0}', '\u{0}']),
- ('\u{1e0d}', ['\u{1e0c}', '\u{0}', '\u{0}']), ('\u{1e0f}', ['\u{1e0e}', '\u{0}', '\u{0}']),
- ('\u{1e11}', ['\u{1e10}', '\u{0}', '\u{0}']), ('\u{1e13}', ['\u{1e12}', '\u{0}', '\u{0}']),
- ('\u{1e15}', ['\u{1e14}', '\u{0}', '\u{0}']), ('\u{1e17}', ['\u{1e16}', '\u{0}', '\u{0}']),
- ('\u{1e19}', ['\u{1e18}', '\u{0}', '\u{0}']), ('\u{1e1b}', ['\u{1e1a}', '\u{0}', '\u{0}']),
- ('\u{1e1d}', ['\u{1e1c}', '\u{0}', '\u{0}']), ('\u{1e1f}', ['\u{1e1e}', '\u{0}', '\u{0}']),
- ('\u{1e21}', ['\u{1e20}', '\u{0}', '\u{0}']), ('\u{1e23}', ['\u{1e22}', '\u{0}', '\u{0}']),
- ('\u{1e25}', ['\u{1e24}', '\u{0}', '\u{0}']), ('\u{1e27}', ['\u{1e26}', '\u{0}', '\u{0}']),
- ('\u{1e29}', ['\u{1e28}', '\u{0}', '\u{0}']), ('\u{1e2b}', ['\u{1e2a}', '\u{0}', '\u{0}']),
- ('\u{1e2d}', ['\u{1e2c}', '\u{0}', '\u{0}']), ('\u{1e2f}', ['\u{1e2e}', '\u{0}', '\u{0}']),
- ('\u{1e31}', ['\u{1e30}', '\u{0}', '\u{0}']), ('\u{1e33}', ['\u{1e32}', '\u{0}', '\u{0}']),
- ('\u{1e35}', ['\u{1e34}', '\u{0}', '\u{0}']), ('\u{1e37}', ['\u{1e36}', '\u{0}', '\u{0}']),
- ('\u{1e39}', ['\u{1e38}', '\u{0}', '\u{0}']), ('\u{1e3b}', ['\u{1e3a}', '\u{0}', '\u{0}']),
- ('\u{1e3d}', ['\u{1e3c}', '\u{0}', '\u{0}']), ('\u{1e3f}', ['\u{1e3e}', '\u{0}', '\u{0}']),
- ('\u{1e41}', ['\u{1e40}', '\u{0}', '\u{0}']), ('\u{1e43}', ['\u{1e42}', '\u{0}', '\u{0}']),
- ('\u{1e45}', ['\u{1e44}', '\u{0}', '\u{0}']), ('\u{1e47}', ['\u{1e46}', '\u{0}', '\u{0}']),
- ('\u{1e49}', ['\u{1e48}', '\u{0}', '\u{0}']), ('\u{1e4b}', ['\u{1e4a}', '\u{0}', '\u{0}']),
- ('\u{1e4d}', ['\u{1e4c}', '\u{0}', '\u{0}']), ('\u{1e4f}', ['\u{1e4e}', '\u{0}', '\u{0}']),
- ('\u{1e51}', ['\u{1e50}', '\u{0}', '\u{0}']), ('\u{1e53}', ['\u{1e52}', '\u{0}', '\u{0}']),
- ('\u{1e55}', ['\u{1e54}', '\u{0}', '\u{0}']), ('\u{1e57}', ['\u{1e56}', '\u{0}', '\u{0}']),
- ('\u{1e59}', ['\u{1e58}', '\u{0}', '\u{0}']), ('\u{1e5b}', ['\u{1e5a}', '\u{0}', '\u{0}']),
- ('\u{1e5d}', ['\u{1e5c}', '\u{0}', '\u{0}']), ('\u{1e5f}', ['\u{1e5e}', '\u{0}', '\u{0}']),
- ('\u{1e61}', ['\u{1e60}', '\u{0}', '\u{0}']), ('\u{1e63}', ['\u{1e62}', '\u{0}', '\u{0}']),
- ('\u{1e65}', ['\u{1e64}', '\u{0}', '\u{0}']), ('\u{1e67}', ['\u{1e66}', '\u{0}', '\u{0}']),
- ('\u{1e69}', ['\u{1e68}', '\u{0}', '\u{0}']), ('\u{1e6b}', ['\u{1e6a}', '\u{0}', '\u{0}']),
- ('\u{1e6d}', ['\u{1e6c}', '\u{0}', '\u{0}']), ('\u{1e6f}', ['\u{1e6e}', '\u{0}', '\u{0}']),
- ('\u{1e71}', ['\u{1e70}', '\u{0}', '\u{0}']), ('\u{1e73}', ['\u{1e72}', '\u{0}', '\u{0}']),
- ('\u{1e75}', ['\u{1e74}', '\u{0}', '\u{0}']), ('\u{1e77}', ['\u{1e76}', '\u{0}', '\u{0}']),
- ('\u{1e79}', ['\u{1e78}', '\u{0}', '\u{0}']), ('\u{1e7b}', ['\u{1e7a}', '\u{0}', '\u{0}']),
- ('\u{1e7d}', ['\u{1e7c}', '\u{0}', '\u{0}']), ('\u{1e7f}', ['\u{1e7e}', '\u{0}', '\u{0}']),
- ('\u{1e81}', ['\u{1e80}', '\u{0}', '\u{0}']), ('\u{1e83}', ['\u{1e82}', '\u{0}', '\u{0}']),
- ('\u{1e85}', ['\u{1e84}', '\u{0}', '\u{0}']), ('\u{1e87}', ['\u{1e86}', '\u{0}', '\u{0}']),
- ('\u{1e89}', ['\u{1e88}', '\u{0}', '\u{0}']), ('\u{1e8b}', ['\u{1e8a}', '\u{0}', '\u{0}']),
- ('\u{1e8d}', ['\u{1e8c}', '\u{0}', '\u{0}']), ('\u{1e8f}', ['\u{1e8e}', '\u{0}', '\u{0}']),
- ('\u{1e91}', ['\u{1e90}', '\u{0}', '\u{0}']), ('\u{1e93}', ['\u{1e92}', '\u{0}', '\u{0}']),
- ('\u{1e95}', ['\u{1e94}', '\u{0}', '\u{0}']), ('\u{1e96}', ['\u{48}', '\u{331}', '\u{0}']),
- ('\u{1e97}', ['\u{54}', '\u{308}', '\u{0}']), ('\u{1e98}', ['\u{57}', '\u{30a}', '\u{0}']),
- ('\u{1e99}', ['\u{59}', '\u{30a}', '\u{0}']), ('\u{1e9a}', ['\u{41}', '\u{2be}', '\u{0}']),
- ('\u{1e9b}', ['\u{1e60}', '\u{0}', '\u{0}']), ('\u{1ea1}', ['\u{1ea0}', '\u{0}', '\u{0}']),
- ('\u{1ea3}', ['\u{1ea2}', '\u{0}', '\u{0}']), ('\u{1ea5}', ['\u{1ea4}', '\u{0}', '\u{0}']),
- ('\u{1ea7}', ['\u{1ea6}', '\u{0}', '\u{0}']), ('\u{1ea9}', ['\u{1ea8}', '\u{0}', '\u{0}']),
- ('\u{1eab}', ['\u{1eaa}', '\u{0}', '\u{0}']), ('\u{1ead}', ['\u{1eac}', '\u{0}', '\u{0}']),
- ('\u{1eaf}', ['\u{1eae}', '\u{0}', '\u{0}']), ('\u{1eb1}', ['\u{1eb0}', '\u{0}', '\u{0}']),
- ('\u{1eb3}', ['\u{1eb2}', '\u{0}', '\u{0}']), ('\u{1eb5}', ['\u{1eb4}', '\u{0}', '\u{0}']),
- ('\u{1eb7}', ['\u{1eb6}', '\u{0}', '\u{0}']), ('\u{1eb9}', ['\u{1eb8}', '\u{0}', '\u{0}']),
- ('\u{1ebb}', ['\u{1eba}', '\u{0}', '\u{0}']), ('\u{1ebd}', ['\u{1ebc}', '\u{0}', '\u{0}']),
- ('\u{1ebf}', ['\u{1ebe}', '\u{0}', '\u{0}']), ('\u{1ec1}', ['\u{1ec0}', '\u{0}', '\u{0}']),
- ('\u{1ec3}', ['\u{1ec2}', '\u{0}', '\u{0}']), ('\u{1ec5}', ['\u{1ec4}', '\u{0}', '\u{0}']),
- ('\u{1ec7}', ['\u{1ec6}', '\u{0}', '\u{0}']), ('\u{1ec9}', ['\u{1ec8}', '\u{0}', '\u{0}']),
- ('\u{1ecb}', ['\u{1eca}', '\u{0}', '\u{0}']), ('\u{1ecd}', ['\u{1ecc}', '\u{0}', '\u{0}']),
- ('\u{1ecf}', ['\u{1ece}', '\u{0}', '\u{0}']), ('\u{1ed1}', ['\u{1ed0}', '\u{0}', '\u{0}']),
- ('\u{1ed3}', ['\u{1ed2}', '\u{0}', '\u{0}']), ('\u{1ed5}', ['\u{1ed4}', '\u{0}', '\u{0}']),
- ('\u{1ed7}', ['\u{1ed6}', '\u{0}', '\u{0}']), ('\u{1ed9}', ['\u{1ed8}', '\u{0}', '\u{0}']),
- ('\u{1edb}', ['\u{1eda}', '\u{0}', '\u{0}']), ('\u{1edd}', ['\u{1edc}', '\u{0}', '\u{0}']),
- ('\u{1edf}', ['\u{1ede}', '\u{0}', '\u{0}']), ('\u{1ee1}', ['\u{1ee0}', '\u{0}', '\u{0}']),
- ('\u{1ee3}', ['\u{1ee2}', '\u{0}', '\u{0}']), ('\u{1ee5}', ['\u{1ee4}', '\u{0}', '\u{0}']),
- ('\u{1ee7}', ['\u{1ee6}', '\u{0}', '\u{0}']), ('\u{1ee9}', ['\u{1ee8}', '\u{0}', '\u{0}']),
- ('\u{1eeb}', ['\u{1eea}', '\u{0}', '\u{0}']), ('\u{1eed}', ['\u{1eec}', '\u{0}', '\u{0}']),
- ('\u{1eef}', ['\u{1eee}', '\u{0}', '\u{0}']), ('\u{1ef1}', ['\u{1ef0}', '\u{0}', '\u{0}']),
- ('\u{1ef3}', ['\u{1ef2}', '\u{0}', '\u{0}']), ('\u{1ef5}', ['\u{1ef4}', '\u{0}', '\u{0}']),
- ('\u{1ef7}', ['\u{1ef6}', '\u{0}', '\u{0}']), ('\u{1ef9}', ['\u{1ef8}', '\u{0}', '\u{0}']),
- ('\u{1efb}', ['\u{1efa}', '\u{0}', '\u{0}']), ('\u{1efd}', ['\u{1efc}', '\u{0}', '\u{0}']),
- ('\u{1eff}', ['\u{1efe}', '\u{0}', '\u{0}']), ('\u{1f00}', ['\u{1f08}', '\u{0}', '\u{0}']),
- ('\u{1f01}', ['\u{1f09}', '\u{0}', '\u{0}']), ('\u{1f02}', ['\u{1f0a}', '\u{0}', '\u{0}']),
- ('\u{1f03}', ['\u{1f0b}', '\u{0}', '\u{0}']), ('\u{1f04}', ['\u{1f0c}', '\u{0}', '\u{0}']),
- ('\u{1f05}', ['\u{1f0d}', '\u{0}', '\u{0}']), ('\u{1f06}', ['\u{1f0e}', '\u{0}', '\u{0}']),
- ('\u{1f07}', ['\u{1f0f}', '\u{0}', '\u{0}']), ('\u{1f10}', ['\u{1f18}', '\u{0}', '\u{0}']),
- ('\u{1f11}', ['\u{1f19}', '\u{0}', '\u{0}']), ('\u{1f12}', ['\u{1f1a}', '\u{0}', '\u{0}']),
- ('\u{1f13}', ['\u{1f1b}', '\u{0}', '\u{0}']), ('\u{1f14}', ['\u{1f1c}', '\u{0}', '\u{0}']),
- ('\u{1f15}', ['\u{1f1d}', '\u{0}', '\u{0}']), ('\u{1f20}', ['\u{1f28}', '\u{0}', '\u{0}']),
- ('\u{1f21}', ['\u{1f29}', '\u{0}', '\u{0}']), ('\u{1f22}', ['\u{1f2a}', '\u{0}', '\u{0}']),
- ('\u{1f23}', ['\u{1f2b}', '\u{0}', '\u{0}']), ('\u{1f24}', ['\u{1f2c}', '\u{0}', '\u{0}']),
- ('\u{1f25}', ['\u{1f2d}', '\u{0}', '\u{0}']), ('\u{1f26}', ['\u{1f2e}', '\u{0}', '\u{0}']),
- ('\u{1f27}', ['\u{1f2f}', '\u{0}', '\u{0}']), ('\u{1f30}', ['\u{1f38}', '\u{0}', '\u{0}']),
- ('\u{1f31}', ['\u{1f39}', '\u{0}', '\u{0}']), ('\u{1f32}', ['\u{1f3a}', '\u{0}', '\u{0}']),
- ('\u{1f33}', ['\u{1f3b}', '\u{0}', '\u{0}']), ('\u{1f34}', ['\u{1f3c}', '\u{0}', '\u{0}']),
- ('\u{1f35}', ['\u{1f3d}', '\u{0}', '\u{0}']), ('\u{1f36}', ['\u{1f3e}', '\u{0}', '\u{0}']),
- ('\u{1f37}', ['\u{1f3f}', '\u{0}', '\u{0}']), ('\u{1f40}', ['\u{1f48}', '\u{0}', '\u{0}']),
- ('\u{1f41}', ['\u{1f49}', '\u{0}', '\u{0}']), ('\u{1f42}', ['\u{1f4a}', '\u{0}', '\u{0}']),
- ('\u{1f43}', ['\u{1f4b}', '\u{0}', '\u{0}']), ('\u{1f44}', ['\u{1f4c}', '\u{0}', '\u{0}']),
- ('\u{1f45}', ['\u{1f4d}', '\u{0}', '\u{0}']), ('\u{1f50}', ['\u{3a5}', '\u{313}', '\u{0}']),
- ('\u{1f51}', ['\u{1f59}', '\u{0}', '\u{0}']),
- ('\u{1f52}', ['\u{3a5}', '\u{313}', '\u{300}']),
- ('\u{1f53}', ['\u{1f5b}', '\u{0}', '\u{0}']),
- ('\u{1f54}', ['\u{3a5}', '\u{313}', '\u{301}']),
- ('\u{1f55}', ['\u{1f5d}', '\u{0}', '\u{0}']),
- ('\u{1f56}', ['\u{3a5}', '\u{313}', '\u{342}']),
- ('\u{1f57}', ['\u{1f5f}', '\u{0}', '\u{0}']), ('\u{1f60}', ['\u{1f68}', '\u{0}', '\u{0}']),
- ('\u{1f61}', ['\u{1f69}', '\u{0}', '\u{0}']), ('\u{1f62}', ['\u{1f6a}', '\u{0}', '\u{0}']),
- ('\u{1f63}', ['\u{1f6b}', '\u{0}', '\u{0}']), ('\u{1f64}', ['\u{1f6c}', '\u{0}', '\u{0}']),
- ('\u{1f65}', ['\u{1f6d}', '\u{0}', '\u{0}']), ('\u{1f66}', ['\u{1f6e}', '\u{0}', '\u{0}']),
- ('\u{1f67}', ['\u{1f6f}', '\u{0}', '\u{0}']), ('\u{1f70}', ['\u{1fba}', '\u{0}', '\u{0}']),
- ('\u{1f71}', ['\u{1fbb}', '\u{0}', '\u{0}']), ('\u{1f72}', ['\u{1fc8}', '\u{0}', '\u{0}']),
- ('\u{1f73}', ['\u{1fc9}', '\u{0}', '\u{0}']), ('\u{1f74}', ['\u{1fca}', '\u{0}', '\u{0}']),
- ('\u{1f75}', ['\u{1fcb}', '\u{0}', '\u{0}']), ('\u{1f76}', ['\u{1fda}', '\u{0}', '\u{0}']),
- ('\u{1f77}', ['\u{1fdb}', '\u{0}', '\u{0}']), ('\u{1f78}', ['\u{1ff8}', '\u{0}', '\u{0}']),
- ('\u{1f79}', ['\u{1ff9}', '\u{0}', '\u{0}']), ('\u{1f7a}', ['\u{1fea}', '\u{0}', '\u{0}']),
- ('\u{1f7b}', ['\u{1feb}', '\u{0}', '\u{0}']), ('\u{1f7c}', ['\u{1ffa}', '\u{0}', '\u{0}']),
- ('\u{1f7d}', ['\u{1ffb}', '\u{0}', '\u{0}']),
- ('\u{1f80}', ['\u{1f08}', '\u{399}', '\u{0}']),
- ('\u{1f81}', ['\u{1f09}', '\u{399}', '\u{0}']),
- ('\u{1f82}', ['\u{1f0a}', '\u{399}', '\u{0}']),
- ('\u{1f83}', ['\u{1f0b}', '\u{399}', '\u{0}']),
- ('\u{1f84}', ['\u{1f0c}', '\u{399}', '\u{0}']),
- ('\u{1f85}', ['\u{1f0d}', '\u{399}', '\u{0}']),
- ('\u{1f86}', ['\u{1f0e}', '\u{399}', '\u{0}']),
- ('\u{1f87}', ['\u{1f0f}', '\u{399}', '\u{0}']),
- ('\u{1f88}', ['\u{1f08}', '\u{399}', '\u{0}']),
- ('\u{1f89}', ['\u{1f09}', '\u{399}', '\u{0}']),
- ('\u{1f8a}', ['\u{1f0a}', '\u{399}', '\u{0}']),
- ('\u{1f8b}', ['\u{1f0b}', '\u{399}', '\u{0}']),
- ('\u{1f8c}', ['\u{1f0c}', '\u{399}', '\u{0}']),
- ('\u{1f8d}', ['\u{1f0d}', '\u{399}', '\u{0}']),
- ('\u{1f8e}', ['\u{1f0e}', '\u{399}', '\u{0}']),
- ('\u{1f8f}', ['\u{1f0f}', '\u{399}', '\u{0}']),
- ('\u{1f90}', ['\u{1f28}', '\u{399}', '\u{0}']),
- ('\u{1f91}', ['\u{1f29}', '\u{399}', '\u{0}']),
- ('\u{1f92}', ['\u{1f2a}', '\u{399}', '\u{0}']),
- ('\u{1f93}', ['\u{1f2b}', '\u{399}', '\u{0}']),
- ('\u{1f94}', ['\u{1f2c}', '\u{399}', '\u{0}']),
- ('\u{1f95}', ['\u{1f2d}', '\u{399}', '\u{0}']),
- ('\u{1f96}', ['\u{1f2e}', '\u{399}', '\u{0}']),
- ('\u{1f97}', ['\u{1f2f}', '\u{399}', '\u{0}']),
- ('\u{1f98}', ['\u{1f28}', '\u{399}', '\u{0}']),
- ('\u{1f99}', ['\u{1f29}', '\u{399}', '\u{0}']),
- ('\u{1f9a}', ['\u{1f2a}', '\u{399}', '\u{0}']),
- ('\u{1f9b}', ['\u{1f2b}', '\u{399}', '\u{0}']),
- ('\u{1f9c}', ['\u{1f2c}', '\u{399}', '\u{0}']),
- ('\u{1f9d}', ['\u{1f2d}', '\u{399}', '\u{0}']),
- ('\u{1f9e}', ['\u{1f2e}', '\u{399}', '\u{0}']),
- ('\u{1f9f}', ['\u{1f2f}', '\u{399}', '\u{0}']),
- ('\u{1fa0}', ['\u{1f68}', '\u{399}', '\u{0}']),
- ('\u{1fa1}', ['\u{1f69}', '\u{399}', '\u{0}']),
- ('\u{1fa2}', ['\u{1f6a}', '\u{399}', '\u{0}']),
- ('\u{1fa3}', ['\u{1f6b}', '\u{399}', '\u{0}']),
- ('\u{1fa4}', ['\u{1f6c}', '\u{399}', '\u{0}']),
- ('\u{1fa5}', ['\u{1f6d}', '\u{399}', '\u{0}']),
- ('\u{1fa6}', ['\u{1f6e}', '\u{399}', '\u{0}']),
- ('\u{1fa7}', ['\u{1f6f}', '\u{399}', '\u{0}']),
- ('\u{1fa8}', ['\u{1f68}', '\u{399}', '\u{0}']),
- ('\u{1fa9}', ['\u{1f69}', '\u{399}', '\u{0}']),
- ('\u{1faa}', ['\u{1f6a}', '\u{399}', '\u{0}']),
- ('\u{1fab}', ['\u{1f6b}', '\u{399}', '\u{0}']),
- ('\u{1fac}', ['\u{1f6c}', '\u{399}', '\u{0}']),
- ('\u{1fad}', ['\u{1f6d}', '\u{399}', '\u{0}']),
- ('\u{1fae}', ['\u{1f6e}', '\u{399}', '\u{0}']),
- ('\u{1faf}', ['\u{1f6f}', '\u{399}', '\u{0}']),
- ('\u{1fb0}', ['\u{1fb8}', '\u{0}', '\u{0}']), ('\u{1fb1}', ['\u{1fb9}', '\u{0}', '\u{0}']),
- ('\u{1fb2}', ['\u{1fba}', '\u{399}', '\u{0}']),
- ('\u{1fb3}', ['\u{391}', '\u{399}', '\u{0}']),
- ('\u{1fb4}', ['\u{386}', '\u{399}', '\u{0}']),
- ('\u{1fb6}', ['\u{391}', '\u{342}', '\u{0}']),
- ('\u{1fb7}', ['\u{391}', '\u{342}', '\u{399}']),
- ('\u{1fbc}', ['\u{391}', '\u{399}', '\u{0}']), ('\u{1fbe}', ['\u{399}', '\u{0}', '\u{0}']),
- ('\u{1fc2}', ['\u{1fca}', '\u{399}', '\u{0}']),
- ('\u{1fc3}', ['\u{397}', '\u{399}', '\u{0}']),
- ('\u{1fc4}', ['\u{389}', '\u{399}', '\u{0}']),
- ('\u{1fc6}', ['\u{397}', '\u{342}', '\u{0}']),
- ('\u{1fc7}', ['\u{397}', '\u{342}', '\u{399}']),
- ('\u{1fcc}', ['\u{397}', '\u{399}', '\u{0}']), ('\u{1fd0}', ['\u{1fd8}', '\u{0}', '\u{0}']),
- ('\u{1fd1}', ['\u{1fd9}', '\u{0}', '\u{0}']),
- ('\u{1fd2}', ['\u{399}', '\u{308}', '\u{300}']),
- ('\u{1fd3}', ['\u{399}', '\u{308}', '\u{301}']),
- ('\u{1fd6}', ['\u{399}', '\u{342}', '\u{0}']),
- ('\u{1fd7}', ['\u{399}', '\u{308}', '\u{342}']),
- ('\u{1fe0}', ['\u{1fe8}', '\u{0}', '\u{0}']), ('\u{1fe1}', ['\u{1fe9}', '\u{0}', '\u{0}']),
- ('\u{1fe2}', ['\u{3a5}', '\u{308}', '\u{300}']),
- ('\u{1fe3}', ['\u{3a5}', '\u{308}', '\u{301}']),
- ('\u{1fe4}', ['\u{3a1}', '\u{313}', '\u{0}']), ('\u{1fe5}', ['\u{1fec}', '\u{0}', '\u{0}']),
- ('\u{1fe6}', ['\u{3a5}', '\u{342}', '\u{0}']),
- ('\u{1fe7}', ['\u{3a5}', '\u{308}', '\u{342}']),
- ('\u{1ff2}', ['\u{1ffa}', '\u{399}', '\u{0}']),
- ('\u{1ff3}', ['\u{3a9}', '\u{399}', '\u{0}']),
- ('\u{1ff4}', ['\u{38f}', '\u{399}', '\u{0}']),
- ('\u{1ff6}', ['\u{3a9}', '\u{342}', '\u{0}']),
- ('\u{1ff7}', ['\u{3a9}', '\u{342}', '\u{399}']),
- ('\u{1ffc}', ['\u{3a9}', '\u{399}', '\u{0}']), ('\u{214e}', ['\u{2132}', '\u{0}', '\u{0}']),
- ('\u{2170}', ['\u{2160}', '\u{0}', '\u{0}']), ('\u{2171}', ['\u{2161}', '\u{0}', '\u{0}']),
- ('\u{2172}', ['\u{2162}', '\u{0}', '\u{0}']), ('\u{2173}', ['\u{2163}', '\u{0}', '\u{0}']),
- ('\u{2174}', ['\u{2164}', '\u{0}', '\u{0}']), ('\u{2175}', ['\u{2165}', '\u{0}', '\u{0}']),
- ('\u{2176}', ['\u{2166}', '\u{0}', '\u{0}']), ('\u{2177}', ['\u{2167}', '\u{0}', '\u{0}']),
- ('\u{2178}', ['\u{2168}', '\u{0}', '\u{0}']), ('\u{2179}', ['\u{2169}', '\u{0}', '\u{0}']),
- ('\u{217a}', ['\u{216a}', '\u{0}', '\u{0}']), ('\u{217b}', ['\u{216b}', '\u{0}', '\u{0}']),
- ('\u{217c}', ['\u{216c}', '\u{0}', '\u{0}']), ('\u{217d}', ['\u{216d}', '\u{0}', '\u{0}']),
- ('\u{217e}', ['\u{216e}', '\u{0}', '\u{0}']), ('\u{217f}', ['\u{216f}', '\u{0}', '\u{0}']),
- ('\u{2184}', ['\u{2183}', '\u{0}', '\u{0}']), ('\u{24d0}', ['\u{24b6}', '\u{0}', '\u{0}']),
- ('\u{24d1}', ['\u{24b7}', '\u{0}', '\u{0}']), ('\u{24d2}', ['\u{24b8}', '\u{0}', '\u{0}']),
- ('\u{24d3}', ['\u{24b9}', '\u{0}', '\u{0}']), ('\u{24d4}', ['\u{24ba}', '\u{0}', '\u{0}']),
- ('\u{24d5}', ['\u{24bb}', '\u{0}', '\u{0}']), ('\u{24d6}', ['\u{24bc}', '\u{0}', '\u{0}']),
- ('\u{24d7}', ['\u{24bd}', '\u{0}', '\u{0}']), ('\u{24d8}', ['\u{24be}', '\u{0}', '\u{0}']),
- ('\u{24d9}', ['\u{24bf}', '\u{0}', '\u{0}']), ('\u{24da}', ['\u{24c0}', '\u{0}', '\u{0}']),
- ('\u{24db}', ['\u{24c1}', '\u{0}', '\u{0}']), ('\u{24dc}', ['\u{24c2}', '\u{0}', '\u{0}']),
- ('\u{24dd}', ['\u{24c3}', '\u{0}', '\u{0}']), ('\u{24de}', ['\u{24c4}', '\u{0}', '\u{0}']),
- ('\u{24df}', ['\u{24c5}', '\u{0}', '\u{0}']), ('\u{24e0}', ['\u{24c6}', '\u{0}', '\u{0}']),
- ('\u{24e1}', ['\u{24c7}', '\u{0}', '\u{0}']), ('\u{24e2}', ['\u{24c8}', '\u{0}', '\u{0}']),
- ('\u{24e3}', ['\u{24c9}', '\u{0}', '\u{0}']), ('\u{24e4}', ['\u{24ca}', '\u{0}', '\u{0}']),
- ('\u{24e5}', ['\u{24cb}', '\u{0}', '\u{0}']), ('\u{24e6}', ['\u{24cc}', '\u{0}', '\u{0}']),
- ('\u{24e7}', ['\u{24cd}', '\u{0}', '\u{0}']), ('\u{24e8}', ['\u{24ce}', '\u{0}', '\u{0}']),
- ('\u{24e9}', ['\u{24cf}', '\u{0}', '\u{0}']), ('\u{2c30}', ['\u{2c00}', '\u{0}', '\u{0}']),
- ('\u{2c31}', ['\u{2c01}', '\u{0}', '\u{0}']), ('\u{2c32}', ['\u{2c02}', '\u{0}', '\u{0}']),
- ('\u{2c33}', ['\u{2c03}', '\u{0}', '\u{0}']), ('\u{2c34}', ['\u{2c04}', '\u{0}', '\u{0}']),
- ('\u{2c35}', ['\u{2c05}', '\u{0}', '\u{0}']), ('\u{2c36}', ['\u{2c06}', '\u{0}', '\u{0}']),
- ('\u{2c37}', ['\u{2c07}', '\u{0}', '\u{0}']), ('\u{2c38}', ['\u{2c08}', '\u{0}', '\u{0}']),
- ('\u{2c39}', ['\u{2c09}', '\u{0}', '\u{0}']), ('\u{2c3a}', ['\u{2c0a}', '\u{0}', '\u{0}']),
- ('\u{2c3b}', ['\u{2c0b}', '\u{0}', '\u{0}']), ('\u{2c3c}', ['\u{2c0c}', '\u{0}', '\u{0}']),
- ('\u{2c3d}', ['\u{2c0d}', '\u{0}', '\u{0}']), ('\u{2c3e}', ['\u{2c0e}', '\u{0}', '\u{0}']),
- ('\u{2c3f}', ['\u{2c0f}', '\u{0}', '\u{0}']), ('\u{2c40}', ['\u{2c10}', '\u{0}', '\u{0}']),
- ('\u{2c41}', ['\u{2c11}', '\u{0}', '\u{0}']), ('\u{2c42}', ['\u{2c12}', '\u{0}', '\u{0}']),
- ('\u{2c43}', ['\u{2c13}', '\u{0}', '\u{0}']), ('\u{2c44}', ['\u{2c14}', '\u{0}', '\u{0}']),
- ('\u{2c45}', ['\u{2c15}', '\u{0}', '\u{0}']), ('\u{2c46}', ['\u{2c16}', '\u{0}', '\u{0}']),
- ('\u{2c47}', ['\u{2c17}', '\u{0}', '\u{0}']), ('\u{2c48}', ['\u{2c18}', '\u{0}', '\u{0}']),
- ('\u{2c49}', ['\u{2c19}', '\u{0}', '\u{0}']), ('\u{2c4a}', ['\u{2c1a}', '\u{0}', '\u{0}']),
- ('\u{2c4b}', ['\u{2c1b}', '\u{0}', '\u{0}']), ('\u{2c4c}', ['\u{2c1c}', '\u{0}', '\u{0}']),
- ('\u{2c4d}', ['\u{2c1d}', '\u{0}', '\u{0}']), ('\u{2c4e}', ['\u{2c1e}', '\u{0}', '\u{0}']),
- ('\u{2c4f}', ['\u{2c1f}', '\u{0}', '\u{0}']), ('\u{2c50}', ['\u{2c20}', '\u{0}', '\u{0}']),
- ('\u{2c51}', ['\u{2c21}', '\u{0}', '\u{0}']), ('\u{2c52}', ['\u{2c22}', '\u{0}', '\u{0}']),
- ('\u{2c53}', ['\u{2c23}', '\u{0}', '\u{0}']), ('\u{2c54}', ['\u{2c24}', '\u{0}', '\u{0}']),
- ('\u{2c55}', ['\u{2c25}', '\u{0}', '\u{0}']), ('\u{2c56}', ['\u{2c26}', '\u{0}', '\u{0}']),
- ('\u{2c57}', ['\u{2c27}', '\u{0}', '\u{0}']), ('\u{2c58}', ['\u{2c28}', '\u{0}', '\u{0}']),
- ('\u{2c59}', ['\u{2c29}', '\u{0}', '\u{0}']), ('\u{2c5a}', ['\u{2c2a}', '\u{0}', '\u{0}']),
- ('\u{2c5b}', ['\u{2c2b}', '\u{0}', '\u{0}']), ('\u{2c5c}', ['\u{2c2c}', '\u{0}', '\u{0}']),
- ('\u{2c5d}', ['\u{2c2d}', '\u{0}', '\u{0}']), ('\u{2c5e}', ['\u{2c2e}', '\u{0}', '\u{0}']),
- ('\u{2c5f}', ['\u{2c2f}', '\u{0}', '\u{0}']), ('\u{2c61}', ['\u{2c60}', '\u{0}', '\u{0}']),
- ('\u{2c65}', ['\u{23a}', '\u{0}', '\u{0}']), ('\u{2c66}', ['\u{23e}', '\u{0}', '\u{0}']),
- ('\u{2c68}', ['\u{2c67}', '\u{0}', '\u{0}']), ('\u{2c6a}', ['\u{2c69}', '\u{0}', '\u{0}']),
- ('\u{2c6c}', ['\u{2c6b}', '\u{0}', '\u{0}']), ('\u{2c73}', ['\u{2c72}', '\u{0}', '\u{0}']),
- ('\u{2c76}', ['\u{2c75}', '\u{0}', '\u{0}']), ('\u{2c81}', ['\u{2c80}', '\u{0}', '\u{0}']),
- ('\u{2c83}', ['\u{2c82}', '\u{0}', '\u{0}']), ('\u{2c85}', ['\u{2c84}', '\u{0}', '\u{0}']),
- ('\u{2c87}', ['\u{2c86}', '\u{0}', '\u{0}']), ('\u{2c89}', ['\u{2c88}', '\u{0}', '\u{0}']),
- ('\u{2c8b}', ['\u{2c8a}', '\u{0}', '\u{0}']), ('\u{2c8d}', ['\u{2c8c}', '\u{0}', '\u{0}']),
- ('\u{2c8f}', ['\u{2c8e}', '\u{0}', '\u{0}']), ('\u{2c91}', ['\u{2c90}', '\u{0}', '\u{0}']),
- ('\u{2c93}', ['\u{2c92}', '\u{0}', '\u{0}']), ('\u{2c95}', ['\u{2c94}', '\u{0}', '\u{0}']),
- ('\u{2c97}', ['\u{2c96}', '\u{0}', '\u{0}']), ('\u{2c99}', ['\u{2c98}', '\u{0}', '\u{0}']),
- ('\u{2c9b}', ['\u{2c9a}', '\u{0}', '\u{0}']), ('\u{2c9d}', ['\u{2c9c}', '\u{0}', '\u{0}']),
- ('\u{2c9f}', ['\u{2c9e}', '\u{0}', '\u{0}']), ('\u{2ca1}', ['\u{2ca0}', '\u{0}', '\u{0}']),
- ('\u{2ca3}', ['\u{2ca2}', '\u{0}', '\u{0}']), ('\u{2ca5}', ['\u{2ca4}', '\u{0}', '\u{0}']),
- ('\u{2ca7}', ['\u{2ca6}', '\u{0}', '\u{0}']), ('\u{2ca9}', ['\u{2ca8}', '\u{0}', '\u{0}']),
- ('\u{2cab}', ['\u{2caa}', '\u{0}', '\u{0}']), ('\u{2cad}', ['\u{2cac}', '\u{0}', '\u{0}']),
- ('\u{2caf}', ['\u{2cae}', '\u{0}', '\u{0}']), ('\u{2cb1}', ['\u{2cb0}', '\u{0}', '\u{0}']),
- ('\u{2cb3}', ['\u{2cb2}', '\u{0}', '\u{0}']), ('\u{2cb5}', ['\u{2cb4}', '\u{0}', '\u{0}']),
- ('\u{2cb7}', ['\u{2cb6}', '\u{0}', '\u{0}']), ('\u{2cb9}', ['\u{2cb8}', '\u{0}', '\u{0}']),
- ('\u{2cbb}', ['\u{2cba}', '\u{0}', '\u{0}']), ('\u{2cbd}', ['\u{2cbc}', '\u{0}', '\u{0}']),
- ('\u{2cbf}', ['\u{2cbe}', '\u{0}', '\u{0}']), ('\u{2cc1}', ['\u{2cc0}', '\u{0}', '\u{0}']),
- ('\u{2cc3}', ['\u{2cc2}', '\u{0}', '\u{0}']), ('\u{2cc5}', ['\u{2cc4}', '\u{0}', '\u{0}']),
- ('\u{2cc7}', ['\u{2cc6}', '\u{0}', '\u{0}']), ('\u{2cc9}', ['\u{2cc8}', '\u{0}', '\u{0}']),
- ('\u{2ccb}', ['\u{2cca}', '\u{0}', '\u{0}']), ('\u{2ccd}', ['\u{2ccc}', '\u{0}', '\u{0}']),
- ('\u{2ccf}', ['\u{2cce}', '\u{0}', '\u{0}']), ('\u{2cd1}', ['\u{2cd0}', '\u{0}', '\u{0}']),
- ('\u{2cd3}', ['\u{2cd2}', '\u{0}', '\u{0}']), ('\u{2cd5}', ['\u{2cd4}', '\u{0}', '\u{0}']),
- ('\u{2cd7}', ['\u{2cd6}', '\u{0}', '\u{0}']), ('\u{2cd9}', ['\u{2cd8}', '\u{0}', '\u{0}']),
- ('\u{2cdb}', ['\u{2cda}', '\u{0}', '\u{0}']), ('\u{2cdd}', ['\u{2cdc}', '\u{0}', '\u{0}']),
- ('\u{2cdf}', ['\u{2cde}', '\u{0}', '\u{0}']), ('\u{2ce1}', ['\u{2ce0}', '\u{0}', '\u{0}']),
- ('\u{2ce3}', ['\u{2ce2}', '\u{0}', '\u{0}']), ('\u{2cec}', ['\u{2ceb}', '\u{0}', '\u{0}']),
- ('\u{2cee}', ['\u{2ced}', '\u{0}', '\u{0}']), ('\u{2cf3}', ['\u{2cf2}', '\u{0}', '\u{0}']),
- ('\u{2d00}', ['\u{10a0}', '\u{0}', '\u{0}']), ('\u{2d01}', ['\u{10a1}', '\u{0}', '\u{0}']),
- ('\u{2d02}', ['\u{10a2}', '\u{0}', '\u{0}']), ('\u{2d03}', ['\u{10a3}', '\u{0}', '\u{0}']),
- ('\u{2d04}', ['\u{10a4}', '\u{0}', '\u{0}']), ('\u{2d05}', ['\u{10a5}', '\u{0}', '\u{0}']),
- ('\u{2d06}', ['\u{10a6}', '\u{0}', '\u{0}']), ('\u{2d07}', ['\u{10a7}', '\u{0}', '\u{0}']),
- ('\u{2d08}', ['\u{10a8}', '\u{0}', '\u{0}']), ('\u{2d09}', ['\u{10a9}', '\u{0}', '\u{0}']),
- ('\u{2d0a}', ['\u{10aa}', '\u{0}', '\u{0}']), ('\u{2d0b}', ['\u{10ab}', '\u{0}', '\u{0}']),
- ('\u{2d0c}', ['\u{10ac}', '\u{0}', '\u{0}']), ('\u{2d0d}', ['\u{10ad}', '\u{0}', '\u{0}']),
- ('\u{2d0e}', ['\u{10ae}', '\u{0}', '\u{0}']), ('\u{2d0f}', ['\u{10af}', '\u{0}', '\u{0}']),
- ('\u{2d10}', ['\u{10b0}', '\u{0}', '\u{0}']), ('\u{2d11}', ['\u{10b1}', '\u{0}', '\u{0}']),
- ('\u{2d12}', ['\u{10b2}', '\u{0}', '\u{0}']), ('\u{2d13}', ['\u{10b3}', '\u{0}', '\u{0}']),
- ('\u{2d14}', ['\u{10b4}', '\u{0}', '\u{0}']), ('\u{2d15}', ['\u{10b5}', '\u{0}', '\u{0}']),
- ('\u{2d16}', ['\u{10b6}', '\u{0}', '\u{0}']), ('\u{2d17}', ['\u{10b7}', '\u{0}', '\u{0}']),
- ('\u{2d18}', ['\u{10b8}', '\u{0}', '\u{0}']), ('\u{2d19}', ['\u{10b9}', '\u{0}', '\u{0}']),
- ('\u{2d1a}', ['\u{10ba}', '\u{0}', '\u{0}']), ('\u{2d1b}', ['\u{10bb}', '\u{0}', '\u{0}']),
- ('\u{2d1c}', ['\u{10bc}', '\u{0}', '\u{0}']), ('\u{2d1d}', ['\u{10bd}', '\u{0}', '\u{0}']),
- ('\u{2d1e}', ['\u{10be}', '\u{0}', '\u{0}']), ('\u{2d1f}', ['\u{10bf}', '\u{0}', '\u{0}']),
- ('\u{2d20}', ['\u{10c0}', '\u{0}', '\u{0}']), ('\u{2d21}', ['\u{10c1}', '\u{0}', '\u{0}']),
- ('\u{2d22}', ['\u{10c2}', '\u{0}', '\u{0}']), ('\u{2d23}', ['\u{10c3}', '\u{0}', '\u{0}']),
- ('\u{2d24}', ['\u{10c4}', '\u{0}', '\u{0}']), ('\u{2d25}', ['\u{10c5}', '\u{0}', '\u{0}']),
- ('\u{2d27}', ['\u{10c7}', '\u{0}', '\u{0}']), ('\u{2d2d}', ['\u{10cd}', '\u{0}', '\u{0}']),
- ('\u{a641}', ['\u{a640}', '\u{0}', '\u{0}']), ('\u{a643}', ['\u{a642}', '\u{0}', '\u{0}']),
- ('\u{a645}', ['\u{a644}', '\u{0}', '\u{0}']), ('\u{a647}', ['\u{a646}', '\u{0}', '\u{0}']),
- ('\u{a649}', ['\u{a648}', '\u{0}', '\u{0}']), ('\u{a64b}', ['\u{a64a}', '\u{0}', '\u{0}']),
- ('\u{a64d}', ['\u{a64c}', '\u{0}', '\u{0}']), ('\u{a64f}', ['\u{a64e}', '\u{0}', '\u{0}']),
- ('\u{a651}', ['\u{a650}', '\u{0}', '\u{0}']), ('\u{a653}', ['\u{a652}', '\u{0}', '\u{0}']),
- ('\u{a655}', ['\u{a654}', '\u{0}', '\u{0}']), ('\u{a657}', ['\u{a656}', '\u{0}', '\u{0}']),
- ('\u{a659}', ['\u{a658}', '\u{0}', '\u{0}']), ('\u{a65b}', ['\u{a65a}', '\u{0}', '\u{0}']),
- ('\u{a65d}', ['\u{a65c}', '\u{0}', '\u{0}']), ('\u{a65f}', ['\u{a65e}', '\u{0}', '\u{0}']),
- ('\u{a661}', ['\u{a660}', '\u{0}', '\u{0}']), ('\u{a663}', ['\u{a662}', '\u{0}', '\u{0}']),
- ('\u{a665}', ['\u{a664}', '\u{0}', '\u{0}']), ('\u{a667}', ['\u{a666}', '\u{0}', '\u{0}']),
- ('\u{a669}', ['\u{a668}', '\u{0}', '\u{0}']), ('\u{a66b}', ['\u{a66a}', '\u{0}', '\u{0}']),
- ('\u{a66d}', ['\u{a66c}', '\u{0}', '\u{0}']), ('\u{a681}', ['\u{a680}', '\u{0}', '\u{0}']),
- ('\u{a683}', ['\u{a682}', '\u{0}', '\u{0}']), ('\u{a685}', ['\u{a684}', '\u{0}', '\u{0}']),
- ('\u{a687}', ['\u{a686}', '\u{0}', '\u{0}']), ('\u{a689}', ['\u{a688}', '\u{0}', '\u{0}']),
- ('\u{a68b}', ['\u{a68a}', '\u{0}', '\u{0}']), ('\u{a68d}', ['\u{a68c}', '\u{0}', '\u{0}']),
- ('\u{a68f}', ['\u{a68e}', '\u{0}', '\u{0}']), ('\u{a691}', ['\u{a690}', '\u{0}', '\u{0}']),
- ('\u{a693}', ['\u{a692}', '\u{0}', '\u{0}']), ('\u{a695}', ['\u{a694}', '\u{0}', '\u{0}']),
- ('\u{a697}', ['\u{a696}', '\u{0}', '\u{0}']), ('\u{a699}', ['\u{a698}', '\u{0}', '\u{0}']),
- ('\u{a69b}', ['\u{a69a}', '\u{0}', '\u{0}']), ('\u{a723}', ['\u{a722}', '\u{0}', '\u{0}']),
- ('\u{a725}', ['\u{a724}', '\u{0}', '\u{0}']), ('\u{a727}', ['\u{a726}', '\u{0}', '\u{0}']),
- ('\u{a729}', ['\u{a728}', '\u{0}', '\u{0}']), ('\u{a72b}', ['\u{a72a}', '\u{0}', '\u{0}']),
- ('\u{a72d}', ['\u{a72c}', '\u{0}', '\u{0}']), ('\u{a72f}', ['\u{a72e}', '\u{0}', '\u{0}']),
- ('\u{a733}', ['\u{a732}', '\u{0}', '\u{0}']), ('\u{a735}', ['\u{a734}', '\u{0}', '\u{0}']),
- ('\u{a737}', ['\u{a736}', '\u{0}', '\u{0}']), ('\u{a739}', ['\u{a738}', '\u{0}', '\u{0}']),
- ('\u{a73b}', ['\u{a73a}', '\u{0}', '\u{0}']), ('\u{a73d}', ['\u{a73c}', '\u{0}', '\u{0}']),
- ('\u{a73f}', ['\u{a73e}', '\u{0}', '\u{0}']), ('\u{a741}', ['\u{a740}', '\u{0}', '\u{0}']),
- ('\u{a743}', ['\u{a742}', '\u{0}', '\u{0}']), ('\u{a745}', ['\u{a744}', '\u{0}', '\u{0}']),
- ('\u{a747}', ['\u{a746}', '\u{0}', '\u{0}']), ('\u{a749}', ['\u{a748}', '\u{0}', '\u{0}']),
- ('\u{a74b}', ['\u{a74a}', '\u{0}', '\u{0}']), ('\u{a74d}', ['\u{a74c}', '\u{0}', '\u{0}']),
- ('\u{a74f}', ['\u{a74e}', '\u{0}', '\u{0}']), ('\u{a751}', ['\u{a750}', '\u{0}', '\u{0}']),
- ('\u{a753}', ['\u{a752}', '\u{0}', '\u{0}']), ('\u{a755}', ['\u{a754}', '\u{0}', '\u{0}']),
- ('\u{a757}', ['\u{a756}', '\u{0}', '\u{0}']), ('\u{a759}', ['\u{a758}', '\u{0}', '\u{0}']),
- ('\u{a75b}', ['\u{a75a}', '\u{0}', '\u{0}']), ('\u{a75d}', ['\u{a75c}', '\u{0}', '\u{0}']),
- ('\u{a75f}', ['\u{a75e}', '\u{0}', '\u{0}']), ('\u{a761}', ['\u{a760}', '\u{0}', '\u{0}']),
- ('\u{a763}', ['\u{a762}', '\u{0}', '\u{0}']), ('\u{a765}', ['\u{a764}', '\u{0}', '\u{0}']),
- ('\u{a767}', ['\u{a766}', '\u{0}', '\u{0}']), ('\u{a769}', ['\u{a768}', '\u{0}', '\u{0}']),
- ('\u{a76b}', ['\u{a76a}', '\u{0}', '\u{0}']), ('\u{a76d}', ['\u{a76c}', '\u{0}', '\u{0}']),
- ('\u{a76f}', ['\u{a76e}', '\u{0}', '\u{0}']), ('\u{a77a}', ['\u{a779}', '\u{0}', '\u{0}']),
- ('\u{a77c}', ['\u{a77b}', '\u{0}', '\u{0}']), ('\u{a77f}', ['\u{a77e}', '\u{0}', '\u{0}']),
- ('\u{a781}', ['\u{a780}', '\u{0}', '\u{0}']), ('\u{a783}', ['\u{a782}', '\u{0}', '\u{0}']),
- ('\u{a785}', ['\u{a784}', '\u{0}', '\u{0}']), ('\u{a787}', ['\u{a786}', '\u{0}', '\u{0}']),
- ('\u{a78c}', ['\u{a78b}', '\u{0}', '\u{0}']), ('\u{a791}', ['\u{a790}', '\u{0}', '\u{0}']),
- ('\u{a793}', ['\u{a792}', '\u{0}', '\u{0}']), ('\u{a794}', ['\u{a7c4}', '\u{0}', '\u{0}']),
- ('\u{a797}', ['\u{a796}', '\u{0}', '\u{0}']), ('\u{a799}', ['\u{a798}', '\u{0}', '\u{0}']),
- ('\u{a79b}', ['\u{a79a}', '\u{0}', '\u{0}']), ('\u{a79d}', ['\u{a79c}', '\u{0}', '\u{0}']),
- ('\u{a79f}', ['\u{a79e}', '\u{0}', '\u{0}']), ('\u{a7a1}', ['\u{a7a0}', '\u{0}', '\u{0}']),
- ('\u{a7a3}', ['\u{a7a2}', '\u{0}', '\u{0}']), ('\u{a7a5}', ['\u{a7a4}', '\u{0}', '\u{0}']),
- ('\u{a7a7}', ['\u{a7a6}', '\u{0}', '\u{0}']), ('\u{a7a9}', ['\u{a7a8}', '\u{0}', '\u{0}']),
- ('\u{a7b5}', ['\u{a7b4}', '\u{0}', '\u{0}']), ('\u{a7b7}', ['\u{a7b6}', '\u{0}', '\u{0}']),
- ('\u{a7b9}', ['\u{a7b8}', '\u{0}', '\u{0}']), ('\u{a7bb}', ['\u{a7ba}', '\u{0}', '\u{0}']),
- ('\u{a7bd}', ['\u{a7bc}', '\u{0}', '\u{0}']), ('\u{a7bf}', ['\u{a7be}', '\u{0}', '\u{0}']),
- ('\u{a7c1}', ['\u{a7c0}', '\u{0}', '\u{0}']), ('\u{a7c3}', ['\u{a7c2}', '\u{0}', '\u{0}']),
- ('\u{a7c8}', ['\u{a7c7}', '\u{0}', '\u{0}']), ('\u{a7ca}', ['\u{a7c9}', '\u{0}', '\u{0}']),
- ('\u{a7cd}', ['\u{a7cc}', '\u{0}', '\u{0}']), ('\u{a7cf}', ['\u{a7ce}', '\u{0}', '\u{0}']),
- ('\u{a7d1}', ['\u{a7d0}', '\u{0}', '\u{0}']), ('\u{a7d3}', ['\u{a7d2}', '\u{0}', '\u{0}']),
- ('\u{a7d5}', ['\u{a7d4}', '\u{0}', '\u{0}']), ('\u{a7d7}', ['\u{a7d6}', '\u{0}', '\u{0}']),
- ('\u{a7d9}', ['\u{a7d8}', '\u{0}', '\u{0}']), ('\u{a7db}', ['\u{a7da}', '\u{0}', '\u{0}']),
- ('\u{a7f6}', ['\u{a7f5}', '\u{0}', '\u{0}']), ('\u{ab53}', ['\u{a7b3}', '\u{0}', '\u{0}']),
- ('\u{ab70}', ['\u{13a0}', '\u{0}', '\u{0}']), ('\u{ab71}', ['\u{13a1}', '\u{0}', '\u{0}']),
- ('\u{ab72}', ['\u{13a2}', '\u{0}', '\u{0}']), ('\u{ab73}', ['\u{13a3}', '\u{0}', '\u{0}']),
- ('\u{ab74}', ['\u{13a4}', '\u{0}', '\u{0}']), ('\u{ab75}', ['\u{13a5}', '\u{0}', '\u{0}']),
- ('\u{ab76}', ['\u{13a6}', '\u{0}', '\u{0}']), ('\u{ab77}', ['\u{13a7}', '\u{0}', '\u{0}']),
- ('\u{ab78}', ['\u{13a8}', '\u{0}', '\u{0}']), ('\u{ab79}', ['\u{13a9}', '\u{0}', '\u{0}']),
- ('\u{ab7a}', ['\u{13aa}', '\u{0}', '\u{0}']), ('\u{ab7b}', ['\u{13ab}', '\u{0}', '\u{0}']),
- ('\u{ab7c}', ['\u{13ac}', '\u{0}', '\u{0}']), ('\u{ab7d}', ['\u{13ad}', '\u{0}', '\u{0}']),
- ('\u{ab7e}', ['\u{13ae}', '\u{0}', '\u{0}']), ('\u{ab7f}', ['\u{13af}', '\u{0}', '\u{0}']),
- ('\u{ab80}', ['\u{13b0}', '\u{0}', '\u{0}']), ('\u{ab81}', ['\u{13b1}', '\u{0}', '\u{0}']),
- ('\u{ab82}', ['\u{13b2}', '\u{0}', '\u{0}']), ('\u{ab83}', ['\u{13b3}', '\u{0}', '\u{0}']),
- ('\u{ab84}', ['\u{13b4}', '\u{0}', '\u{0}']), ('\u{ab85}', ['\u{13b5}', '\u{0}', '\u{0}']),
- ('\u{ab86}', ['\u{13b6}', '\u{0}', '\u{0}']), ('\u{ab87}', ['\u{13b7}', '\u{0}', '\u{0}']),
- ('\u{ab88}', ['\u{13b8}', '\u{0}', '\u{0}']), ('\u{ab89}', ['\u{13b9}', '\u{0}', '\u{0}']),
- ('\u{ab8a}', ['\u{13ba}', '\u{0}', '\u{0}']), ('\u{ab8b}', ['\u{13bb}', '\u{0}', '\u{0}']),
- ('\u{ab8c}', ['\u{13bc}', '\u{0}', '\u{0}']), ('\u{ab8d}', ['\u{13bd}', '\u{0}', '\u{0}']),
- ('\u{ab8e}', ['\u{13be}', '\u{0}', '\u{0}']), ('\u{ab8f}', ['\u{13bf}', '\u{0}', '\u{0}']),
- ('\u{ab90}', ['\u{13c0}', '\u{0}', '\u{0}']), ('\u{ab91}', ['\u{13c1}', '\u{0}', '\u{0}']),
- ('\u{ab92}', ['\u{13c2}', '\u{0}', '\u{0}']), ('\u{ab93}', ['\u{13c3}', '\u{0}', '\u{0}']),
- ('\u{ab94}', ['\u{13c4}', '\u{0}', '\u{0}']), ('\u{ab95}', ['\u{13c5}', '\u{0}', '\u{0}']),
- ('\u{ab96}', ['\u{13c6}', '\u{0}', '\u{0}']), ('\u{ab97}', ['\u{13c7}', '\u{0}', '\u{0}']),
- ('\u{ab98}', ['\u{13c8}', '\u{0}', '\u{0}']), ('\u{ab99}', ['\u{13c9}', '\u{0}', '\u{0}']),
- ('\u{ab9a}', ['\u{13ca}', '\u{0}', '\u{0}']), ('\u{ab9b}', ['\u{13cb}', '\u{0}', '\u{0}']),
- ('\u{ab9c}', ['\u{13cc}', '\u{0}', '\u{0}']), ('\u{ab9d}', ['\u{13cd}', '\u{0}', '\u{0}']),
- ('\u{ab9e}', ['\u{13ce}', '\u{0}', '\u{0}']), ('\u{ab9f}', ['\u{13cf}', '\u{0}', '\u{0}']),
- ('\u{aba0}', ['\u{13d0}', '\u{0}', '\u{0}']), ('\u{aba1}', ['\u{13d1}', '\u{0}', '\u{0}']),
- ('\u{aba2}', ['\u{13d2}', '\u{0}', '\u{0}']), ('\u{aba3}', ['\u{13d3}', '\u{0}', '\u{0}']),
- ('\u{aba4}', ['\u{13d4}', '\u{0}', '\u{0}']), ('\u{aba5}', ['\u{13d5}', '\u{0}', '\u{0}']),
- ('\u{aba6}', ['\u{13d6}', '\u{0}', '\u{0}']), ('\u{aba7}', ['\u{13d7}', '\u{0}', '\u{0}']),
- ('\u{aba8}', ['\u{13d8}', '\u{0}', '\u{0}']), ('\u{aba9}', ['\u{13d9}', '\u{0}', '\u{0}']),
- ('\u{abaa}', ['\u{13da}', '\u{0}', '\u{0}']), ('\u{abab}', ['\u{13db}', '\u{0}', '\u{0}']),
- ('\u{abac}', ['\u{13dc}', '\u{0}', '\u{0}']), ('\u{abad}', ['\u{13dd}', '\u{0}', '\u{0}']),
- ('\u{abae}', ['\u{13de}', '\u{0}', '\u{0}']), ('\u{abaf}', ['\u{13df}', '\u{0}', '\u{0}']),
- ('\u{abb0}', ['\u{13e0}', '\u{0}', '\u{0}']), ('\u{abb1}', ['\u{13e1}', '\u{0}', '\u{0}']),
- ('\u{abb2}', ['\u{13e2}', '\u{0}', '\u{0}']), ('\u{abb3}', ['\u{13e3}', '\u{0}', '\u{0}']),
- ('\u{abb4}', ['\u{13e4}', '\u{0}', '\u{0}']), ('\u{abb5}', ['\u{13e5}', '\u{0}', '\u{0}']),
- ('\u{abb6}', ['\u{13e6}', '\u{0}', '\u{0}']), ('\u{abb7}', ['\u{13e7}', '\u{0}', '\u{0}']),
- ('\u{abb8}', ['\u{13e8}', '\u{0}', '\u{0}']), ('\u{abb9}', ['\u{13e9}', '\u{0}', '\u{0}']),
- ('\u{abba}', ['\u{13ea}', '\u{0}', '\u{0}']), ('\u{abbb}', ['\u{13eb}', '\u{0}', '\u{0}']),
- ('\u{abbc}', ['\u{13ec}', '\u{0}', '\u{0}']), ('\u{abbd}', ['\u{13ed}', '\u{0}', '\u{0}']),
- ('\u{abbe}', ['\u{13ee}', '\u{0}', '\u{0}']), ('\u{abbf}', ['\u{13ef}', '\u{0}', '\u{0}']),
- ('\u{fb00}', ['\u{46}', '\u{46}', '\u{0}']), ('\u{fb01}', ['\u{46}', '\u{49}', '\u{0}']),
- ('\u{fb02}', ['\u{46}', '\u{4c}', '\u{0}']), ('\u{fb03}', ['\u{46}', '\u{46}', '\u{49}']),
- ('\u{fb04}', ['\u{46}', '\u{46}', '\u{4c}']), ('\u{fb05}', ['\u{53}', '\u{54}', '\u{0}']),
- ('\u{fb06}', ['\u{53}', '\u{54}', '\u{0}']), ('\u{fb13}', ['\u{544}', '\u{546}', '\u{0}']),
- ('\u{fb14}', ['\u{544}', '\u{535}', '\u{0}']),
- ('\u{fb15}', ['\u{544}', '\u{53b}', '\u{0}']),
- ('\u{fb16}', ['\u{54e}', '\u{546}', '\u{0}']),
- ('\u{fb17}', ['\u{544}', '\u{53d}', '\u{0}']), ('\u{ff41}', ['\u{ff21}', '\u{0}', '\u{0}']),
- ('\u{ff42}', ['\u{ff22}', '\u{0}', '\u{0}']), ('\u{ff43}', ['\u{ff23}', '\u{0}', '\u{0}']),
- ('\u{ff44}', ['\u{ff24}', '\u{0}', '\u{0}']), ('\u{ff45}', ['\u{ff25}', '\u{0}', '\u{0}']),
- ('\u{ff46}', ['\u{ff26}', '\u{0}', '\u{0}']), ('\u{ff47}', ['\u{ff27}', '\u{0}', '\u{0}']),
- ('\u{ff48}', ['\u{ff28}', '\u{0}', '\u{0}']), ('\u{ff49}', ['\u{ff29}', '\u{0}', '\u{0}']),
- ('\u{ff4a}', ['\u{ff2a}', '\u{0}', '\u{0}']), ('\u{ff4b}', ['\u{ff2b}', '\u{0}', '\u{0}']),
- ('\u{ff4c}', ['\u{ff2c}', '\u{0}', '\u{0}']), ('\u{ff4d}', ['\u{ff2d}', '\u{0}', '\u{0}']),
- ('\u{ff4e}', ['\u{ff2e}', '\u{0}', '\u{0}']), ('\u{ff4f}', ['\u{ff2f}', '\u{0}', '\u{0}']),
- ('\u{ff50}', ['\u{ff30}', '\u{0}', '\u{0}']), ('\u{ff51}', ['\u{ff31}', '\u{0}', '\u{0}']),
- ('\u{ff52}', ['\u{ff32}', '\u{0}', '\u{0}']), ('\u{ff53}', ['\u{ff33}', '\u{0}', '\u{0}']),
- ('\u{ff54}', ['\u{ff34}', '\u{0}', '\u{0}']), ('\u{ff55}', ['\u{ff35}', '\u{0}', '\u{0}']),
- ('\u{ff56}', ['\u{ff36}', '\u{0}', '\u{0}']), ('\u{ff57}', ['\u{ff37}', '\u{0}', '\u{0}']),
- ('\u{ff58}', ['\u{ff38}', '\u{0}', '\u{0}']), ('\u{ff59}', ['\u{ff39}', '\u{0}', '\u{0}']),
- ('\u{ff5a}', ['\u{ff3a}', '\u{0}', '\u{0}']),
- ('\u{10428}', ['\u{10400}', '\u{0}', '\u{0}']),
- ('\u{10429}', ['\u{10401}', '\u{0}', '\u{0}']),
- ('\u{1042a}', ['\u{10402}', '\u{0}', '\u{0}']),
- ('\u{1042b}', ['\u{10403}', '\u{0}', '\u{0}']),
- ('\u{1042c}', ['\u{10404}', '\u{0}', '\u{0}']),
- ('\u{1042d}', ['\u{10405}', '\u{0}', '\u{0}']),
- ('\u{1042e}', ['\u{10406}', '\u{0}', '\u{0}']),
- ('\u{1042f}', ['\u{10407}', '\u{0}', '\u{0}']),
- ('\u{10430}', ['\u{10408}', '\u{0}', '\u{0}']),
- ('\u{10431}', ['\u{10409}', '\u{0}', '\u{0}']),
- ('\u{10432}', ['\u{1040a}', '\u{0}', '\u{0}']),
- ('\u{10433}', ['\u{1040b}', '\u{0}', '\u{0}']),
- ('\u{10434}', ['\u{1040c}', '\u{0}', '\u{0}']),
- ('\u{10435}', ['\u{1040d}', '\u{0}', '\u{0}']),
- ('\u{10436}', ['\u{1040e}', '\u{0}', '\u{0}']),
- ('\u{10437}', ['\u{1040f}', '\u{0}', '\u{0}']),
- ('\u{10438}', ['\u{10410}', '\u{0}', '\u{0}']),
- ('\u{10439}', ['\u{10411}', '\u{0}', '\u{0}']),
- ('\u{1043a}', ['\u{10412}', '\u{0}', '\u{0}']),
- ('\u{1043b}', ['\u{10413}', '\u{0}', '\u{0}']),
- ('\u{1043c}', ['\u{10414}', '\u{0}', '\u{0}']),
- ('\u{1043d}', ['\u{10415}', '\u{0}', '\u{0}']),
- ('\u{1043e}', ['\u{10416}', '\u{0}', '\u{0}']),
- ('\u{1043f}', ['\u{10417}', '\u{0}', '\u{0}']),
- ('\u{10440}', ['\u{10418}', '\u{0}', '\u{0}']),
- ('\u{10441}', ['\u{10419}', '\u{0}', '\u{0}']),
- ('\u{10442}', ['\u{1041a}', '\u{0}', '\u{0}']),
- ('\u{10443}', ['\u{1041b}', '\u{0}', '\u{0}']),
- ('\u{10444}', ['\u{1041c}', '\u{0}', '\u{0}']),
- ('\u{10445}', ['\u{1041d}', '\u{0}', '\u{0}']),
- ('\u{10446}', ['\u{1041e}', '\u{0}', '\u{0}']),
- ('\u{10447}', ['\u{1041f}', '\u{0}', '\u{0}']),
- ('\u{10448}', ['\u{10420}', '\u{0}', '\u{0}']),
- ('\u{10449}', ['\u{10421}', '\u{0}', '\u{0}']),
- ('\u{1044a}', ['\u{10422}', '\u{0}', '\u{0}']),
- ('\u{1044b}', ['\u{10423}', '\u{0}', '\u{0}']),
- ('\u{1044c}', ['\u{10424}', '\u{0}', '\u{0}']),
- ('\u{1044d}', ['\u{10425}', '\u{0}', '\u{0}']),
- ('\u{1044e}', ['\u{10426}', '\u{0}', '\u{0}']),
- ('\u{1044f}', ['\u{10427}', '\u{0}', '\u{0}']),
- ('\u{104d8}', ['\u{104b0}', '\u{0}', '\u{0}']),
- ('\u{104d9}', ['\u{104b1}', '\u{0}', '\u{0}']),
- ('\u{104da}', ['\u{104b2}', '\u{0}', '\u{0}']),
- ('\u{104db}', ['\u{104b3}', '\u{0}', '\u{0}']),
- ('\u{104dc}', ['\u{104b4}', '\u{0}', '\u{0}']),
- ('\u{104dd}', ['\u{104b5}', '\u{0}', '\u{0}']),
- ('\u{104de}', ['\u{104b6}', '\u{0}', '\u{0}']),
- ('\u{104df}', ['\u{104b7}', '\u{0}', '\u{0}']),
- ('\u{104e0}', ['\u{104b8}', '\u{0}', '\u{0}']),
- ('\u{104e1}', ['\u{104b9}', '\u{0}', '\u{0}']),
- ('\u{104e2}', ['\u{104ba}', '\u{0}', '\u{0}']),
- ('\u{104e3}', ['\u{104bb}', '\u{0}', '\u{0}']),
- ('\u{104e4}', ['\u{104bc}', '\u{0}', '\u{0}']),
- ('\u{104e5}', ['\u{104bd}', '\u{0}', '\u{0}']),
- ('\u{104e6}', ['\u{104be}', '\u{0}', '\u{0}']),
- ('\u{104e7}', ['\u{104bf}', '\u{0}', '\u{0}']),
- ('\u{104e8}', ['\u{104c0}', '\u{0}', '\u{0}']),
- ('\u{104e9}', ['\u{104c1}', '\u{0}', '\u{0}']),
- ('\u{104ea}', ['\u{104c2}', '\u{0}', '\u{0}']),
- ('\u{104eb}', ['\u{104c3}', '\u{0}', '\u{0}']),
- ('\u{104ec}', ['\u{104c4}', '\u{0}', '\u{0}']),
- ('\u{104ed}', ['\u{104c5}', '\u{0}', '\u{0}']),
- ('\u{104ee}', ['\u{104c6}', '\u{0}', '\u{0}']),
- ('\u{104ef}', ['\u{104c7}', '\u{0}', '\u{0}']),
- ('\u{104f0}', ['\u{104c8}', '\u{0}', '\u{0}']),
- ('\u{104f1}', ['\u{104c9}', '\u{0}', '\u{0}']),
- ('\u{104f2}', ['\u{104ca}', '\u{0}', '\u{0}']),
- ('\u{104f3}', ['\u{104cb}', '\u{0}', '\u{0}']),
- ('\u{104f4}', ['\u{104cc}', '\u{0}', '\u{0}']),
- ('\u{104f5}', ['\u{104cd}', '\u{0}', '\u{0}']),
- ('\u{104f6}', ['\u{104ce}', '\u{0}', '\u{0}']),
- ('\u{104f7}', ['\u{104cf}', '\u{0}', '\u{0}']),
- ('\u{104f8}', ['\u{104d0}', '\u{0}', '\u{0}']),
- ('\u{104f9}', ['\u{104d1}', '\u{0}', '\u{0}']),
- ('\u{104fa}', ['\u{104d2}', '\u{0}', '\u{0}']),
- ('\u{104fb}', ['\u{104d3}', '\u{0}', '\u{0}']),
- ('\u{10597}', ['\u{10570}', '\u{0}', '\u{0}']),
- ('\u{10598}', ['\u{10571}', '\u{0}', '\u{0}']),
- ('\u{10599}', ['\u{10572}', '\u{0}', '\u{0}']),
- ('\u{1059a}', ['\u{10573}', '\u{0}', '\u{0}']),
- ('\u{1059b}', ['\u{10574}', '\u{0}', '\u{0}']),
- ('\u{1059c}', ['\u{10575}', '\u{0}', '\u{0}']),
- ('\u{1059d}', ['\u{10576}', '\u{0}', '\u{0}']),
- ('\u{1059e}', ['\u{10577}', '\u{0}', '\u{0}']),
- ('\u{1059f}', ['\u{10578}', '\u{0}', '\u{0}']),
- ('\u{105a0}', ['\u{10579}', '\u{0}', '\u{0}']),
- ('\u{105a1}', ['\u{1057a}', '\u{0}', '\u{0}']),
- ('\u{105a3}', ['\u{1057c}', '\u{0}', '\u{0}']),
- ('\u{105a4}', ['\u{1057d}', '\u{0}', '\u{0}']),
- ('\u{105a5}', ['\u{1057e}', '\u{0}', '\u{0}']),
- ('\u{105a6}', ['\u{1057f}', '\u{0}', '\u{0}']),
- ('\u{105a7}', ['\u{10580}', '\u{0}', '\u{0}']),
- ('\u{105a8}', ['\u{10581}', '\u{0}', '\u{0}']),
- ('\u{105a9}', ['\u{10582}', '\u{0}', '\u{0}']),
- ('\u{105aa}', ['\u{10583}', '\u{0}', '\u{0}']),
- ('\u{105ab}', ['\u{10584}', '\u{0}', '\u{0}']),
- ('\u{105ac}', ['\u{10585}', '\u{0}', '\u{0}']),
- ('\u{105ad}', ['\u{10586}', '\u{0}', '\u{0}']),
- ('\u{105ae}', ['\u{10587}', '\u{0}', '\u{0}']),
- ('\u{105af}', ['\u{10588}', '\u{0}', '\u{0}']),
- ('\u{105b0}', ['\u{10589}', '\u{0}', '\u{0}']),
- ('\u{105b1}', ['\u{1058a}', '\u{0}', '\u{0}']),
- ('\u{105b3}', ['\u{1058c}', '\u{0}', '\u{0}']),
- ('\u{105b4}', ['\u{1058d}', '\u{0}', '\u{0}']),
- ('\u{105b5}', ['\u{1058e}', '\u{0}', '\u{0}']),
- ('\u{105b6}', ['\u{1058f}', '\u{0}', '\u{0}']),
- ('\u{105b7}', ['\u{10590}', '\u{0}', '\u{0}']),
- ('\u{105b8}', ['\u{10591}', '\u{0}', '\u{0}']),
- ('\u{105b9}', ['\u{10592}', '\u{0}', '\u{0}']),
- ('\u{105bb}', ['\u{10594}', '\u{0}', '\u{0}']),
- ('\u{105bc}', ['\u{10595}', '\u{0}', '\u{0}']),
- ('\u{10cc0}', ['\u{10c80}', '\u{0}', '\u{0}']),
- ('\u{10cc1}', ['\u{10c81}', '\u{0}', '\u{0}']),
- ('\u{10cc2}', ['\u{10c82}', '\u{0}', '\u{0}']),
- ('\u{10cc3}', ['\u{10c83}', '\u{0}', '\u{0}']),
- ('\u{10cc4}', ['\u{10c84}', '\u{0}', '\u{0}']),
- ('\u{10cc5}', ['\u{10c85}', '\u{0}', '\u{0}']),
- ('\u{10cc6}', ['\u{10c86}', '\u{0}', '\u{0}']),
- ('\u{10cc7}', ['\u{10c87}', '\u{0}', '\u{0}']),
- ('\u{10cc8}', ['\u{10c88}', '\u{0}', '\u{0}']),
- ('\u{10cc9}', ['\u{10c89}', '\u{0}', '\u{0}']),
- ('\u{10cca}', ['\u{10c8a}', '\u{0}', '\u{0}']),
- ('\u{10ccb}', ['\u{10c8b}', '\u{0}', '\u{0}']),
- ('\u{10ccc}', ['\u{10c8c}', '\u{0}', '\u{0}']),
- ('\u{10ccd}', ['\u{10c8d}', '\u{0}', '\u{0}']),
- ('\u{10cce}', ['\u{10c8e}', '\u{0}', '\u{0}']),
- ('\u{10ccf}', ['\u{10c8f}', '\u{0}', '\u{0}']),
- ('\u{10cd0}', ['\u{10c90}', '\u{0}', '\u{0}']),
- ('\u{10cd1}', ['\u{10c91}', '\u{0}', '\u{0}']),
- ('\u{10cd2}', ['\u{10c92}', '\u{0}', '\u{0}']),
- ('\u{10cd3}', ['\u{10c93}', '\u{0}', '\u{0}']),
- ('\u{10cd4}', ['\u{10c94}', '\u{0}', '\u{0}']),
- ('\u{10cd5}', ['\u{10c95}', '\u{0}', '\u{0}']),
- ('\u{10cd6}', ['\u{10c96}', '\u{0}', '\u{0}']),
- ('\u{10cd7}', ['\u{10c97}', '\u{0}', '\u{0}']),
- ('\u{10cd8}', ['\u{10c98}', '\u{0}', '\u{0}']),
- ('\u{10cd9}', ['\u{10c99}', '\u{0}', '\u{0}']),
- ('\u{10cda}', ['\u{10c9a}', '\u{0}', '\u{0}']),
- ('\u{10cdb}', ['\u{10c9b}', '\u{0}', '\u{0}']),
- ('\u{10cdc}', ['\u{10c9c}', '\u{0}', '\u{0}']),
- ('\u{10cdd}', ['\u{10c9d}', '\u{0}', '\u{0}']),
- ('\u{10cde}', ['\u{10c9e}', '\u{0}', '\u{0}']),
- ('\u{10cdf}', ['\u{10c9f}', '\u{0}', '\u{0}']),
- ('\u{10ce0}', ['\u{10ca0}', '\u{0}', '\u{0}']),
- ('\u{10ce1}', ['\u{10ca1}', '\u{0}', '\u{0}']),
- ('\u{10ce2}', ['\u{10ca2}', '\u{0}', '\u{0}']),
- ('\u{10ce3}', ['\u{10ca3}', '\u{0}', '\u{0}']),
- ('\u{10ce4}', ['\u{10ca4}', '\u{0}', '\u{0}']),
- ('\u{10ce5}', ['\u{10ca5}', '\u{0}', '\u{0}']),
- ('\u{10ce6}', ['\u{10ca6}', '\u{0}', '\u{0}']),
- ('\u{10ce7}', ['\u{10ca7}', '\u{0}', '\u{0}']),
- ('\u{10ce8}', ['\u{10ca8}', '\u{0}', '\u{0}']),
- ('\u{10ce9}', ['\u{10ca9}', '\u{0}', '\u{0}']),
- ('\u{10cea}', ['\u{10caa}', '\u{0}', '\u{0}']),
- ('\u{10ceb}', ['\u{10cab}', '\u{0}', '\u{0}']),
- ('\u{10cec}', ['\u{10cac}', '\u{0}', '\u{0}']),
- ('\u{10ced}', ['\u{10cad}', '\u{0}', '\u{0}']),
- ('\u{10cee}', ['\u{10cae}', '\u{0}', '\u{0}']),
- ('\u{10cef}', ['\u{10caf}', '\u{0}', '\u{0}']),
- ('\u{10cf0}', ['\u{10cb0}', '\u{0}', '\u{0}']),
- ('\u{10cf1}', ['\u{10cb1}', '\u{0}', '\u{0}']),
- ('\u{10cf2}', ['\u{10cb2}', '\u{0}', '\u{0}']),
- ('\u{10d70}', ['\u{10d50}', '\u{0}', '\u{0}']),
- ('\u{10d71}', ['\u{10d51}', '\u{0}', '\u{0}']),
- ('\u{10d72}', ['\u{10d52}', '\u{0}', '\u{0}']),
- ('\u{10d73}', ['\u{10d53}', '\u{0}', '\u{0}']),
- ('\u{10d74}', ['\u{10d54}', '\u{0}', '\u{0}']),
- ('\u{10d75}', ['\u{10d55}', '\u{0}', '\u{0}']),
- ('\u{10d76}', ['\u{10d56}', '\u{0}', '\u{0}']),
- ('\u{10d77}', ['\u{10d57}', '\u{0}', '\u{0}']),
- ('\u{10d78}', ['\u{10d58}', '\u{0}', '\u{0}']),
- ('\u{10d79}', ['\u{10d59}', '\u{0}', '\u{0}']),
- ('\u{10d7a}', ['\u{10d5a}', '\u{0}', '\u{0}']),
- ('\u{10d7b}', ['\u{10d5b}', '\u{0}', '\u{0}']),
- ('\u{10d7c}', ['\u{10d5c}', '\u{0}', '\u{0}']),
- ('\u{10d7d}', ['\u{10d5d}', '\u{0}', '\u{0}']),
- ('\u{10d7e}', ['\u{10d5e}', '\u{0}', '\u{0}']),
- ('\u{10d7f}', ['\u{10d5f}', '\u{0}', '\u{0}']),
- ('\u{10d80}', ['\u{10d60}', '\u{0}', '\u{0}']),
- ('\u{10d81}', ['\u{10d61}', '\u{0}', '\u{0}']),
- ('\u{10d82}', ['\u{10d62}', '\u{0}', '\u{0}']),
- ('\u{10d83}', ['\u{10d63}', '\u{0}', '\u{0}']),
- ('\u{10d84}', ['\u{10d64}', '\u{0}', '\u{0}']),
- ('\u{10d85}', ['\u{10d65}', '\u{0}', '\u{0}']),
- ('\u{118c0}', ['\u{118a0}', '\u{0}', '\u{0}']),
- ('\u{118c1}', ['\u{118a1}', '\u{0}', '\u{0}']),
- ('\u{118c2}', ['\u{118a2}', '\u{0}', '\u{0}']),
- ('\u{118c3}', ['\u{118a3}', '\u{0}', '\u{0}']),
- ('\u{118c4}', ['\u{118a4}', '\u{0}', '\u{0}']),
- ('\u{118c5}', ['\u{118a5}', '\u{0}', '\u{0}']),
- ('\u{118c6}', ['\u{118a6}', '\u{0}', '\u{0}']),
- ('\u{118c7}', ['\u{118a7}', '\u{0}', '\u{0}']),
- ('\u{118c8}', ['\u{118a8}', '\u{0}', '\u{0}']),
- ('\u{118c9}', ['\u{118a9}', '\u{0}', '\u{0}']),
- ('\u{118ca}', ['\u{118aa}', '\u{0}', '\u{0}']),
- ('\u{118cb}', ['\u{118ab}', '\u{0}', '\u{0}']),
- ('\u{118cc}', ['\u{118ac}', '\u{0}', '\u{0}']),
- ('\u{118cd}', ['\u{118ad}', '\u{0}', '\u{0}']),
- ('\u{118ce}', ['\u{118ae}', '\u{0}', '\u{0}']),
- ('\u{118cf}', ['\u{118af}', '\u{0}', '\u{0}']),
- ('\u{118d0}', ['\u{118b0}', '\u{0}', '\u{0}']),
- ('\u{118d1}', ['\u{118b1}', '\u{0}', '\u{0}']),
- ('\u{118d2}', ['\u{118b2}', '\u{0}', '\u{0}']),
- ('\u{118d3}', ['\u{118b3}', '\u{0}', '\u{0}']),
- ('\u{118d4}', ['\u{118b4}', '\u{0}', '\u{0}']),
- ('\u{118d5}', ['\u{118b5}', '\u{0}', '\u{0}']),
- ('\u{118d6}', ['\u{118b6}', '\u{0}', '\u{0}']),
- ('\u{118d7}', ['\u{118b7}', '\u{0}', '\u{0}']),
- ('\u{118d8}', ['\u{118b8}', '\u{0}', '\u{0}']),
- ('\u{118d9}', ['\u{118b9}', '\u{0}', '\u{0}']),
- ('\u{118da}', ['\u{118ba}', '\u{0}', '\u{0}']),
- ('\u{118db}', ['\u{118bb}', '\u{0}', '\u{0}']),
- ('\u{118dc}', ['\u{118bc}', '\u{0}', '\u{0}']),
- ('\u{118dd}', ['\u{118bd}', '\u{0}', '\u{0}']),
- ('\u{118de}', ['\u{118be}', '\u{0}', '\u{0}']),
- ('\u{118df}', ['\u{118bf}', '\u{0}', '\u{0}']),
- ('\u{16e60}', ['\u{16e40}', '\u{0}', '\u{0}']),
- ('\u{16e61}', ['\u{16e41}', '\u{0}', '\u{0}']),
- ('\u{16e62}', ['\u{16e42}', '\u{0}', '\u{0}']),
- ('\u{16e63}', ['\u{16e43}', '\u{0}', '\u{0}']),
- ('\u{16e64}', ['\u{16e44}', '\u{0}', '\u{0}']),
- ('\u{16e65}', ['\u{16e45}', '\u{0}', '\u{0}']),
- ('\u{16e66}', ['\u{16e46}', '\u{0}', '\u{0}']),
- ('\u{16e67}', ['\u{16e47}', '\u{0}', '\u{0}']),
- ('\u{16e68}', ['\u{16e48}', '\u{0}', '\u{0}']),
- ('\u{16e69}', ['\u{16e49}', '\u{0}', '\u{0}']),
- ('\u{16e6a}', ['\u{16e4a}', '\u{0}', '\u{0}']),
- ('\u{16e6b}', ['\u{16e4b}', '\u{0}', '\u{0}']),
- ('\u{16e6c}', ['\u{16e4c}', '\u{0}', '\u{0}']),
- ('\u{16e6d}', ['\u{16e4d}', '\u{0}', '\u{0}']),
- ('\u{16e6e}', ['\u{16e4e}', '\u{0}', '\u{0}']),
- ('\u{16e6f}', ['\u{16e4f}', '\u{0}', '\u{0}']),
- ('\u{16e70}', ['\u{16e50}', '\u{0}', '\u{0}']),
- ('\u{16e71}', ['\u{16e51}', '\u{0}', '\u{0}']),
- ('\u{16e72}', ['\u{16e52}', '\u{0}', '\u{0}']),
- ('\u{16e73}', ['\u{16e53}', '\u{0}', '\u{0}']),
- ('\u{16e74}', ['\u{16e54}', '\u{0}', '\u{0}']),
- ('\u{16e75}', ['\u{16e55}', '\u{0}', '\u{0}']),
- ('\u{16e76}', ['\u{16e56}', '\u{0}', '\u{0}']),
- ('\u{16e77}', ['\u{16e57}', '\u{0}', '\u{0}']),
- ('\u{16e78}', ['\u{16e58}', '\u{0}', '\u{0}']),
- ('\u{16e79}', ['\u{16e59}', '\u{0}', '\u{0}']),
- ('\u{16e7a}', ['\u{16e5a}', '\u{0}', '\u{0}']),
- ('\u{16e7b}', ['\u{16e5b}', '\u{0}', '\u{0}']),
- ('\u{16e7c}', ['\u{16e5c}', '\u{0}', '\u{0}']),
- ('\u{16e7d}', ['\u{16e5d}', '\u{0}', '\u{0}']),
- ('\u{16e7e}', ['\u{16e5e}', '\u{0}', '\u{0}']),
- ('\u{16e7f}', ['\u{16e5f}', '\u{0}', '\u{0}']),
- ('\u{16ebb}', ['\u{16ea0}', '\u{0}', '\u{0}']),
- ('\u{16ebc}', ['\u{16ea1}', '\u{0}', '\u{0}']),
- ('\u{16ebd}', ['\u{16ea2}', '\u{0}', '\u{0}']),
- ('\u{16ebe}', ['\u{16ea3}', '\u{0}', '\u{0}']),
- ('\u{16ebf}', ['\u{16ea4}', '\u{0}', '\u{0}']),
- ('\u{16ec0}', ['\u{16ea5}', '\u{0}', '\u{0}']),
- ('\u{16ec1}', ['\u{16ea6}', '\u{0}', '\u{0}']),
- ('\u{16ec2}', ['\u{16ea7}', '\u{0}', '\u{0}']),
- ('\u{16ec3}', ['\u{16ea8}', '\u{0}', '\u{0}']),
- ('\u{16ec4}', ['\u{16ea9}', '\u{0}', '\u{0}']),
- ('\u{16ec5}', ['\u{16eaa}', '\u{0}', '\u{0}']),
- ('\u{16ec6}', ['\u{16eab}', '\u{0}', '\u{0}']),
- ('\u{16ec7}', ['\u{16eac}', '\u{0}', '\u{0}']),
- ('\u{16ec8}', ['\u{16ead}', '\u{0}', '\u{0}']),
- ('\u{16ec9}', ['\u{16eae}', '\u{0}', '\u{0}']),
- ('\u{16eca}', ['\u{16eaf}', '\u{0}', '\u{0}']),
- ('\u{16ecb}', ['\u{16eb0}', '\u{0}', '\u{0}']),
- ('\u{16ecc}', ['\u{16eb1}', '\u{0}', '\u{0}']),
- ('\u{16ecd}', ['\u{16eb2}', '\u{0}', '\u{0}']),
- ('\u{16ece}', ['\u{16eb3}', '\u{0}', '\u{0}']),
- ('\u{16ecf}', ['\u{16eb4}', '\u{0}', '\u{0}']),
- ('\u{16ed0}', ['\u{16eb5}', '\u{0}', '\u{0}']),
- ('\u{16ed1}', ['\u{16eb6}', '\u{0}', '\u{0}']),
- ('\u{16ed2}', ['\u{16eb7}', '\u{0}', '\u{0}']),
- ('\u{16ed3}', ['\u{16eb8}', '\u{0}', '\u{0}']),
- ('\u{1e922}', ['\u{1e900}', '\u{0}', '\u{0}']),
- ('\u{1e923}', ['\u{1e901}', '\u{0}', '\u{0}']),
- ('\u{1e924}', ['\u{1e902}', '\u{0}', '\u{0}']),
- ('\u{1e925}', ['\u{1e903}', '\u{0}', '\u{0}']),
- ('\u{1e926}', ['\u{1e904}', '\u{0}', '\u{0}']),
- ('\u{1e927}', ['\u{1e905}', '\u{0}', '\u{0}']),
- ('\u{1e928}', ['\u{1e906}', '\u{0}', '\u{0}']),
- ('\u{1e929}', ['\u{1e907}', '\u{0}', '\u{0}']),
- ('\u{1e92a}', ['\u{1e908}', '\u{0}', '\u{0}']),
- ('\u{1e92b}', ['\u{1e909}', '\u{0}', '\u{0}']),
- ('\u{1e92c}', ['\u{1e90a}', '\u{0}', '\u{0}']),
- ('\u{1e92d}', ['\u{1e90b}', '\u{0}', '\u{0}']),
- ('\u{1e92e}', ['\u{1e90c}', '\u{0}', '\u{0}']),
- ('\u{1e92f}', ['\u{1e90d}', '\u{0}', '\u{0}']),
- ('\u{1e930}', ['\u{1e90e}', '\u{0}', '\u{0}']),
- ('\u{1e931}', ['\u{1e90f}', '\u{0}', '\u{0}']),
- ('\u{1e932}', ['\u{1e910}', '\u{0}', '\u{0}']),
- ('\u{1e933}', ['\u{1e911}', '\u{0}', '\u{0}']),
- ('\u{1e934}', ['\u{1e912}', '\u{0}', '\u{0}']),
- ('\u{1e935}', ['\u{1e913}', '\u{0}', '\u{0}']),
- ('\u{1e936}', ['\u{1e914}', '\u{0}', '\u{0}']),
- ('\u{1e937}', ['\u{1e915}', '\u{0}', '\u{0}']),
- ('\u{1e938}', ['\u{1e916}', '\u{0}', '\u{0}']),
- ('\u{1e939}', ['\u{1e917}', '\u{0}', '\u{0}']),
- ('\u{1e93a}', ['\u{1e918}', '\u{0}', '\u{0}']),
- ('\u{1e93b}', ['\u{1e919}', '\u{0}', '\u{0}']),
- ('\u{1e93c}', ['\u{1e91a}', '\u{0}', '\u{0}']),
- ('\u{1e93d}', ['\u{1e91b}', '\u{0}', '\u{0}']),
- ('\u{1e93e}', ['\u{1e91c}', '\u{0}', '\u{0}']),
- ('\u{1e93f}', ['\u{1e91d}', '\u{0}', '\u{0}']),
- ('\u{1e940}', ['\u{1e91e}', '\u{0}', '\u{0}']),
- ('\u{1e941}', ['\u{1e91f}', '\u{0}', '\u{0}']),
- ('\u{1e942}', ['\u{1e920}', '\u{0}', '\u{0}']),
- ('\u{1e943}', ['\u{1e921}', '\u{0}', '\u{0}']),
-];
diff --git a/library/portable-simd/crates/core_simd/src/vector.rs b/library/portable-simd/crates/core_simd/src/vector.rs
index d76a6cd..f40031f 100644
--- a/library/portable-simd/crates/core_simd/src/vector.rs
+++ b/library/portable-simd/crates/core_simd/src/vector.rs
@@ -474,7 +474,14 @@ pub unsafe fn load_select_ptr(
or: Self,
) -> Self {
// SAFETY: The safety of reading elements through `ptr` is ensured by the caller.
- unsafe { core::intrinsics::simd::simd_masked_load(enable.to_int(), ptr, or) }
+ unsafe {
+ core::intrinsics::simd::simd_masked_load::<
+ _,
+ _,
+ _,
+ { core::intrinsics::simd::SimdAlign::Element },
+ >(enable.to_int(), ptr, or)
+ }
}
/// Reads from potentially discontiguous indices in `slice` to construct a SIMD vector.
@@ -723,7 +730,14 @@ pub unsafe fn store_select_unchecked(
#[inline]
pub unsafe fn store_select_ptr(self, ptr: *mut T, enable: Mask<<T as SimdElement>::Mask, N>) {
// SAFETY: The safety of writing elements through `ptr` is ensured by the caller.
- unsafe { core::intrinsics::simd::simd_masked_store(enable.to_int(), ptr, self) }
+ unsafe {
+ core::intrinsics::simd::simd_masked_store::<
+ _,
+ _,
+ _,
+ { core::intrinsics::simd::SimdAlign::Element },
+ >(enable.to_int(), ptr, self)
+ }
}
/// Writes the values in a SIMD vector to potentially discontiguous indices in `slice`.
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index b7be869..9af3e5f 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -215,10 +215,10 @@ pub fn take_hook() -> Box<dyn Fn(&PanicHookInfo<'_>) + 'static + Sync + Send> {
///
/// // Equivalent to
/// // let prev = panic::take_hook();
-/// // panic::set_hook(move |info| {
+/// // panic::set_hook(Box::new(move |info| {
/// // println!("...");
/// // prev(info);
-/// // );
+/// // }));
/// panic::update_hook(move |prev, info| {
/// println!("Print custom message and execute panic handler as usual");
/// prev(info);
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 6e3b1e6..1ae36a7 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2756,6 +2756,28 @@ fn _ends_with(&self, child: &Path) -> bool {
iter_after(self.components().rev(), child.components().rev()).is_some()
}
+ /// Checks whether the `Path` is empty.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #![feature(path_is_empty)]
+ /// use std::path::Path;
+ ///
+ /// let path = Path::new("");
+ /// assert!(path.is_empty());
+ ///
+ /// let path = Path::new("foo");
+ /// assert!(!path.is_empty());
+ ///
+ /// let path = Path::new(".");
+ /// assert!(!path.is_empty());
+ /// ```
+ #[unstable(feature = "path_is_empty", issue = "148494")]
+ pub fn is_empty(&self) -> bool {
+ self.as_os_str().is_empty()
+ }
+
/// Extracts the stem (non-extension) portion of [`self.file_name`].
///
/// [`self.file_name`]: Path::file_name
diff --git a/library/std/src/sys/net/connection/uefi/mod.rs b/library/std/src/sys/net/connection/uefi/mod.rs
index 004f6d4..d76e3e5 100644
--- a/library/std/src/sys/net/connection/uefi/mod.rs
+++ b/library/std/src/sys/net/connection/uefi/mod.rs
@@ -82,12 +82,11 @@ pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
}
pub fn write_vectored(&self, buf: &[IoSlice<'_>]) -> io::Result<usize> {
- // FIXME: UEFI does support vectored write, so implement that.
- crate::io::default_write_vectored(|b| self.write(b), buf)
+ self.inner.write_vectored(buf, self.write_timeout()?)
}
pub fn is_write_vectored(&self) -> bool {
- false
+ true
}
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
diff --git a/library/std/src/sys/net/connection/uefi/tcp.rs b/library/std/src/sys/net/connection/uefi/tcp.rs
index aac9700..16283e6 100644
--- a/library/std/src/sys/net/connection/uefi/tcp.rs
+++ b/library/std/src/sys/net/connection/uefi/tcp.rs
@@ -1,5 +1,5 @@
use super::tcp4;
-use crate::io;
+use crate::io::{self, IoSlice};
use crate::net::SocketAddr;
use crate::ptr::NonNull;
use crate::sys::{helpers, unsupported};
@@ -28,6 +28,16 @@ pub(crate) fn write(&self, buf: &[u8], timeout: Option<Duration>) -> io::Result<
}
}
+ pub(crate) fn write_vectored(
+ &self,
+ buf: &[IoSlice<'_>],
+ timeout: Option<Duration>,
+ ) -> io::Result<usize> {
+ match self {
+ Self::V4(client) => client.write_vectored(buf, timeout),
+ }
+ }
+
pub(crate) fn read(&self, buf: &mut [u8], timeout: Option<Duration>) -> io::Result<usize> {
match self {
Self::V4(client) => client.read(buf, timeout),
diff --git a/library/std/src/sys/net/connection/uefi/tcp4.rs b/library/std/src/sys/net/connection/uefi/tcp4.rs
index 75862ff..ba04244 100644
--- a/library/std/src/sys/net/connection/uefi/tcp4.rs
+++ b/library/std/src/sys/net/connection/uefi/tcp4.rs
@@ -1,7 +1,7 @@
use r_efi::efi::{self, Status};
use r_efi::protocols::tcp4;
-use crate::io;
+use crate::io::{self, IoSlice};
use crate::net::SocketAddrV4;
use crate::ptr::NonNull;
use crate::sync::atomic::{AtomicBool, Ordering};
@@ -108,11 +108,7 @@ pub(crate) fn connect(&self, timeout: Option<Duration>) -> io::Result<()> {
}
pub(crate) fn write(&self, buf: &[u8], timeout: Option<Duration>) -> io::Result<usize> {
- let evt = unsafe { self.create_evt() }?;
- let completion_token =
- tcp4::CompletionToken { event: evt.as_ptr(), status: Status::SUCCESS };
let data_len = u32::try_from(buf.len()).unwrap_or(u32::MAX);
-
let fragment = tcp4::FragmentData {
fragment_length: data_len,
fragment_buffer: buf.as_ptr().cast::<crate::ffi::c_void>().cast_mut(),
@@ -125,14 +121,63 @@ pub(crate) fn write(&self, buf: &[u8], timeout: Option<Duration>) -> io::Result<
fragment_table: [fragment],
};
- let protocol = self.protocol.as_ptr();
- let mut token = tcp4::IoToken {
- completion_token,
- packet: tcp4::IoTokenPacket {
- tx_data: (&raw mut tx_data).cast::<tcp4::TransmitData<0>>(),
- },
+ self.write_inner((&raw mut tx_data).cast(), timeout).map(|_| data_len as usize)
+ }
+
+ pub(crate) fn write_vectored(
+ &self,
+ buf: &[IoSlice<'_>],
+ timeout: Option<Duration>,
+ ) -> io::Result<usize> {
+ let mut data_length = 0u32;
+ let mut fragment_count = 0u32;
+
+ // Calculate how many IoSlice in buf can be transmitted.
+ for i in buf {
+ // IoSlice length is always <= u32::MAX in UEFI.
+ match data_length
+ .checked_add(u32::try_from(i.as_slice().len()).expect("value is stored as a u32"))
+ {
+ Some(x) => data_length = x,
+ None => break,
+ }
+ fragment_count += 1;
+ }
+
+ let tx_data_size = size_of::<tcp4::TransmitData<0>>()
+ + size_of::<tcp4::FragmentData>() * (fragment_count as usize);
+ let mut tx_data = helpers::UefiBox::<tcp4::TransmitData>::new(tx_data_size)?;
+ tx_data.write(tcp4::TransmitData {
+ push: r_efi::efi::Boolean::FALSE,
+ urgent: r_efi::efi::Boolean::FALSE,
+ data_length,
+ fragment_count,
+ fragment_table: [],
+ });
+ unsafe {
+ // SAFETY: IoSlice and FragmentData are guaranteed to have same layout.
+ crate::ptr::copy_nonoverlapping(
+ buf.as_ptr().cast(),
+ (*tx_data.as_mut_ptr()).fragment_table.as_mut_ptr(),
+ fragment_count as usize,
+ );
};
+ self.write_inner(tx_data.as_mut_ptr(), timeout).map(|_| data_length as usize)
+ }
+
+ fn write_inner(
+ &self,
+ tx_data: *mut tcp4::TransmitData,
+ timeout: Option<Duration>,
+ ) -> io::Result<()> {
+ let evt = unsafe { self.create_evt() }?;
+ let completion_token =
+ tcp4::CompletionToken { event: evt.as_ptr(), status: Status::SUCCESS };
+
+ let protocol = self.protocol.as_ptr();
+ let mut token = tcp4::IoToken { completion_token, packet: tcp4::IoTokenPacket { tx_data } };
+
let r = unsafe { ((*protocol).transmit)(protocol, &mut token) };
if r.is_error() {
return Err(io::Error::from_raw_os_error(r.as_usize()));
@@ -143,7 +188,7 @@ pub(crate) fn write(&self, buf: &[u8], timeout: Option<Duration>) -> io::Result<
if completion_token.status.is_error() {
Err(io::Error::from_raw_os_error(completion_token.status.as_usize()))
} else {
- Ok(data_len as usize)
+ Ok(())
}
}
diff --git a/library/std/src/sys/pal/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs
index c0d69c3..852e0d6 100644
--- a/library/std/src/sys/pal/uefi/helpers.rs
+++ b/library/std/src/sys/pal/uefi/helpers.rs
@@ -12,6 +12,7 @@
use r_efi::efi::{self, Guid};
use r_efi::protocols::{device_path, device_path_to_text, service_binding, shell};
+use crate::alloc::Layout;
use crate::ffi::{OsStr, OsString};
use crate::io::{self, const_error};
use crate::marker::PhantomData;
@@ -769,3 +770,39 @@ pub(crate) const fn ipv4_to_r_efi(addr: crate::net::Ipv4Addr) -> efi::Ipv4Addres
pub(crate) const fn ipv4_from_r_efi(ip: efi::Ipv4Address) -> crate::net::Ipv4Addr {
crate::net::Ipv4Addr::new(ip.addr[0], ip.addr[1], ip.addr[2], ip.addr[3])
}
+
+/// This type is intended for use with ZSTs. Since such types are unsized, a reference to such types
+/// is not valid in Rust. Thus, only pointers should be used when interacting with such types.
+pub(crate) struct UefiBox<T> {
+ inner: NonNull<T>,
+ size: usize,
+}
+
+impl<T> UefiBox<T> {
+ pub(crate) fn new(len: usize) -> io::Result<Self> {
+ assert!(len >= size_of::<T>());
+ // UEFI always expects types to be 8 byte aligned.
+ let layout = Layout::from_size_align(len, 8).unwrap();
+ let ptr = unsafe { crate::alloc::alloc(layout) };
+
+ match NonNull::new(ptr.cast()) {
+ Some(inner) => Ok(Self { inner, size: len }),
+ None => Err(io::Error::new(io::ErrorKind::OutOfMemory, "Allocation failed")),
+ }
+ }
+
+ pub(crate) fn write(&mut self, data: T) {
+ unsafe { self.inner.write(data) }
+ }
+
+ pub(crate) fn as_mut_ptr(&mut self) -> *mut T {
+ self.inner.as_ptr().cast()
+ }
+}
+
+impl<T> Drop for UefiBox<T> {
+ fn drop(&mut self) {
+ let layout = Layout::from_size_align(self.size, 8).unwrap();
+ unsafe { crate::alloc::dealloc(self.inner.as_ptr().cast(), layout) };
+ }
+}
diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs
index f4c51a4..6ab99ae 100644
--- a/src/bootstrap/src/core/build_steps/run.rs
+++ b/src/bootstrap/src/core/build_steps/run.rs
@@ -374,7 +374,6 @@ fn make_run(run: RunConfig<'_>) {
fn run(self, builder: &Builder<'_>) {
let mut cmd = builder.tool_cmd(Tool::UnicodeTableGenerator);
cmd.arg(builder.src.join("library/core/src/unicode/unicode_data.rs"));
- cmd.arg(builder.src.join("library/coretests/tests/unicode/test_data.rs"));
cmd.run(builder);
}
}
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index e1b3ff9..b66f965 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -29,6 +29,7 @@
};
use crate::core::config::TargetSelection;
use crate::core::config::flags::{Subcommand, get_completion, top_level_help};
+use crate::core::debuggers;
use crate::utils::build_stamp::{self, BuildStamp};
use crate::utils::exec::{BootstrapCommand, command};
use crate::utils::helpers::{
@@ -38,8 +39,6 @@
use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests};
use crate::{CLang, CodegenBackendKind, DocTests, GitRepo, Mode, PathSet, envify};
-const ADB_TEST_DIR: &str = "/data/local/tmp/work";
-
/// Runs `cargo test` on various internal tools used by bootstrap.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CrateBootstrap {
@@ -2078,27 +2077,28 @@ fn run(self, builder: &Builder<'_>) {
cmd.arg("--python").arg(builder.python());
- if let Some(ref gdb) = builder.config.gdb {
- cmd.arg("--gdb").arg(gdb);
+ // FIXME(#148099): Currently we set these Android-related flags in all
+ // modes, even though they should only be needed in "debuginfo" mode,
+ // because the GDB-discovery code in compiletest currently assumes that
+ // `--android-cross-path` is always set for Android targets.
+ if let Some(debuggers::Android { adb_path, adb_test_dir, android_cross_path }) =
+ debuggers::discover_android(builder, target)
+ {
+ cmd.arg("--adb-path").arg(adb_path);
+ cmd.arg("--adb-test-dir").arg(adb_test_dir);
+ cmd.arg("--android-cross-path").arg(android_cross_path);
}
- let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
- let lldb_version = command(&lldb_exe)
- .allow_failure()
- .arg("--version")
- .run_capture(builder)
- .stdout_if_ok()
- .and_then(|v| if v.trim().is_empty() { None } else { Some(v) });
- if let Some(ref vers) = lldb_version {
- cmd.arg("--lldb-version").arg(vers);
- let lldb_python_dir = command(&lldb_exe)
- .allow_failure()
- .arg("-P")
- .run_capture_stdout(builder)
- .stdout_if_ok()
- .map(|p| p.lines().next().expect("lldb Python dir not found").to_string());
- if let Some(ref dir) = lldb_python_dir {
- cmd.arg("--lldb-python-dir").arg(dir);
+ if mode == "debuginfo" {
+ if let Some(debuggers::Gdb { gdb }) = debuggers::discover_gdb(builder) {
+ cmd.arg("--gdb").arg(gdb);
+ }
+
+ if let Some(debuggers::Lldb { lldb_version, lldb_python_dir }) =
+ debuggers::discover_lldb(builder)
+ {
+ cmd.arg("--lldb-version").arg(lldb_version);
+ cmd.arg("--lldb-python-dir").arg(lldb_python_dir);
}
}
@@ -2332,16 +2332,6 @@ fn run(self, builder: &Builder<'_>) {
cmd.env("RUST_TEST_TMPDIR", builder.tempdir());
- cmd.arg("--adb-path").arg("adb");
- cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);
- if target.contains("android") && !builder.config.dry_run() {
- // Assume that cc for this target comes from the android sysroot
- cmd.arg("--android-cross-path")
- .arg(builder.cc(target).parent().unwrap().parent().unwrap());
- } else {
- cmd.arg("--android-cross-path").arg("");
- }
-
if builder.config.cmd.rustfix_coverage() {
cmd.arg("--rustfix-coverage");
}
@@ -3347,6 +3337,42 @@ fn distcheck_rustc_dev(builder: &Builder<'_>, dir: &Path) {
builder.remove_dir(dir);
}
+/// Runs unit tests in `bootstrap_test.py`, which test the Python parts of bootstrap.
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub(crate) struct BootstrapPy;
+
+impl Step for BootstrapPy {
+ type Output = ();
+ const DEFAULT: bool = true;
+ const IS_HOST: bool = true;
+
+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+ // Bootstrap tests might not be perfectly self-contained and can depend
+ // on the environment, so only run them by default in CI, not locally.
+ // See `test::Bootstrap::should_run`.
+ let is_ci = run.builder.config.is_running_on_ci;
+ run.alias("bootstrap-py").default_condition(is_ci)
+ }
+
+ fn make_run(run: RunConfig<'_>) {
+ run.builder.ensure(BootstrapPy)
+ }
+
+ fn run(self, builder: &Builder<'_>) -> Self::Output {
+ let mut check_bootstrap = command(builder.python());
+ check_bootstrap
+ .args(["-m", "unittest", "bootstrap_test.py"])
+ // Forward command-line args after `--` to unittest, for filtering etc.
+ .args(builder.config.test_args())
+ .env("BUILD_DIR", &builder.out)
+ .env("BUILD_PLATFORM", builder.build.host_target.triple)
+ .env("BOOTSTRAP_TEST_RUSTC_BIN", &builder.initial_rustc)
+ .env("BOOTSTRAP_TEST_CARGO_BIN", &builder.initial_cargo)
+ .current_dir(builder.src.join("src/bootstrap/"));
+ check_bootstrap.delay_failure().run(builder);
+ }
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Bootstrap;
@@ -3363,18 +3389,6 @@ fn run(self, builder: &Builder<'_>) {
// Some tests require cargo submodule to be present.
builder.build.require_submodule("src/tools/cargo", None);
- let mut check_bootstrap = command(builder.python());
- check_bootstrap
- .args(["-m", "unittest", "bootstrap_test.py"])
- .env("BUILD_DIR", &builder.out)
- .env("BUILD_PLATFORM", builder.build.host_target.triple)
- .env("BOOTSTRAP_TEST_RUSTC_BIN", &builder.initial_rustc)
- .env("BOOTSTRAP_TEST_CARGO_BIN", &builder.initial_cargo)
- .current_dir(builder.src.join("src/bootstrap/"));
- // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible.
- // Use `python -m unittest` manually if you want to pass arguments.
- check_bootstrap.delay_failure().run(builder);
-
let mut cargo = tool::prepare_tool_cargo(
builder,
build_compiler,
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index c7490c7..43faf92 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -869,6 +869,7 @@ macro_rules! describe {
Kind::Test => describe!(
crate::core::build_steps::toolstate::ToolStateCheck,
test::Tidy,
+ test::BootstrapPy,
test::Bootstrap,
test::Ui,
test::Crashes,
diff --git a/src/bootstrap/src/core/debuggers/android.rs b/src/bootstrap/src/core/debuggers/android.rs
new file mode 100644
index 0000000..b1ad9ca
--- /dev/null
+++ b/src/bootstrap/src/core/debuggers/android.rs
@@ -0,0 +1,24 @@
+use std::path::PathBuf;
+
+use crate::core::builder::Builder;
+use crate::core::config::TargetSelection;
+
+pub(crate) struct Android {
+ pub(crate) adb_path: &'static str,
+ pub(crate) adb_test_dir: &'static str,
+ pub(crate) android_cross_path: PathBuf,
+}
+
+pub(crate) fn discover_android(builder: &Builder<'_>, target: TargetSelection) -> Option<Android> {
+ let adb_path = "adb";
+ // See <https://github.com/rust-lang/rust/pull/102755>.
+ let adb_test_dir = "/data/local/tmp/work";
+
+ let android_cross_path = if target.contains("android") && !builder.config.dry_run() {
+ builder.cc(target).parent().unwrap().parent().unwrap().to_owned()
+ } else {
+ PathBuf::new()
+ };
+
+ Some(Android { adb_path, adb_test_dir, android_cross_path })
+}
diff --git a/src/bootstrap/src/core/debuggers/gdb.rs b/src/bootstrap/src/core/debuggers/gdb.rs
new file mode 100644
index 0000000..ddad090
--- /dev/null
+++ b/src/bootstrap/src/core/debuggers/gdb.rs
@@ -0,0 +1,13 @@
+use std::path::Path;
+
+use crate::core::builder::Builder;
+
+pub(crate) struct Gdb<'a> {
+ pub(crate) gdb: &'a Path,
+}
+
+pub(crate) fn discover_gdb<'a>(builder: &'a Builder<'_>) -> Option<Gdb<'a>> {
+ let gdb = builder.config.gdb.as_deref()?;
+
+ Some(Gdb { gdb })
+}
diff --git a/src/bootstrap/src/core/debuggers/lldb.rs b/src/bootstrap/src/core/debuggers/lldb.rs
new file mode 100644
index 0000000..66ab455
--- /dev/null
+++ b/src/bootstrap/src/core/debuggers/lldb.rs
@@ -0,0 +1,32 @@
+use std::path::PathBuf;
+
+use crate::core::builder::Builder;
+use crate::utils::exec::command;
+
+pub(crate) struct Lldb {
+ pub(crate) lldb_version: String,
+ pub(crate) lldb_python_dir: String,
+}
+
+pub(crate) fn discover_lldb(builder: &Builder<'_>) -> Option<Lldb> {
+ // FIXME(#148361): We probably should not be picking up whatever arbitrary
+ // lldb happens to be in the user's path, and instead require some kind of
+ // explicit opt-in or configuration.
+ let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
+
+ let lldb_version = command(&lldb_exe)
+ .allow_failure()
+ .arg("--version")
+ .run_capture(builder)
+ .stdout_if_ok()
+ .and_then(|v| if v.trim().is_empty() { None } else { Some(v) })?;
+
+ let lldb_python_dir = command(&lldb_exe)
+ .allow_failure()
+ .arg("-P")
+ .run_capture_stdout(builder)
+ .stdout_if_ok()
+ .map(|p| p.lines().next().expect("lldb Python dir not found").to_string())?;
+
+ Some(Lldb { lldb_version, lldb_python_dir })
+}
diff --git a/src/bootstrap/src/core/debuggers/mod.rs b/src/bootstrap/src/core/debuggers/mod.rs
new file mode 100644
index 0000000..011ce40
--- /dev/null
+++ b/src/bootstrap/src/core/debuggers/mod.rs
@@ -0,0 +1,10 @@
+//! Code for discovering debuggers and debugger-related configuration, so that
+//! it can be passed to compiletest when running debuginfo tests.
+
+pub(crate) use self::android::{Android, discover_android};
+pub(crate) use self::gdb::{Gdb, discover_gdb};
+pub(crate) use self::lldb::{Lldb, discover_lldb};
+
+mod android;
+mod gdb;
+mod lldb;
diff --git a/src/bootstrap/src/core/mod.rs b/src/bootstrap/src/core/mod.rs
index 9e18d67..f27a09c 100644
--- a/src/bootstrap/src/core/mod.rs
+++ b/src/bootstrap/src/core/mod.rs
@@ -1,6 +1,7 @@
pub(crate) mod build_steps;
pub(crate) mod builder;
pub(crate) mod config;
+pub(crate) mod debuggers;
pub(crate) mod download;
pub(crate) mod metadata;
pub(crate) mod sanity;
diff --git a/src/ci/docker/scripts/rfl-build.sh b/src/ci/docker/scripts/rfl-build.sh
index b7d7151..e7f86e10 100755
--- a/src/ci/docker/scripts/rfl-build.sh
+++ b/src/ci/docker/scripts/rfl-build.sh
@@ -2,7 +2,8 @@
set -euo pipefail
-LINUX_VERSION=v6.17-rc5
+# https://github.com/rust-lang/rust/pull/145974
+LINUX_VERSION=842cfd8e5aff3157cb25481b2900b49c188d628a
# Build rustc, rustdoc, cargo, clippy-driver and rustfmt
../x.py build --stage 2 library rustdoc clippy rustfmt
diff --git a/src/doc/book b/src/doc/book
index af415fc..f660f34 160000
--- a/src/doc/book
+++ b/src/doc/book
@@ -1 +1 @@
-Subproject commit af415fc6c8a6823dfb4595074f27d5a3e9e2fe49
+Subproject commit f660f341887c8bbcd6c24fbfdf5d2a262f523965
diff --git a/src/doc/edition-guide b/src/doc/edition-guide
index e2ed891..5c62125 160000
--- a/src/doc/edition-guide
+++ b/src/doc/edition-guide
@@ -1 +1 @@
-Subproject commit e2ed891f00361efc26616d82590b1c85d7a8920e
+Subproject commit 5c621253d8f2a5a4adb64a6365905db67dffe3a2
diff --git a/src/doc/reference b/src/doc/reference
index 752eab0..e122eef 160000
--- a/src/doc/reference
+++ b/src/doc/reference
@@ -1 +1 @@
-Subproject commit 752eab01cebdd6a2d90b53087298844c251859a1
+Subproject commit e122eefff3fef362eb7e0c08fb7ffbf5f9461905
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
index 2c9b490..160e6bb 160000
--- a/src/doc/rust-by-example
+++ b/src/doc/rust-by-example
@@ -1 +1 @@
-Subproject commit 2c9b490d70e535cf166bf17feba59e594579843f
+Subproject commit 160e6bbca70b0c01aa4de88d19db7fc5ff8447c3
diff --git a/src/doc/rustc-dev-guide/.github/workflows/ci.yml b/src/doc/rustc-dev-guide/.github/workflows/ci.yml
index 79d0308..c9c23bf 100644
--- a/src/doc/rustc-dev-guide/.github/workflows/ci.yml
+++ b/src/doc/rustc-dev-guide/.github/workflows/ci.yml
@@ -82,3 +82,9 @@
git add .
git commit -m "Deploy ${GITHUB_SHA} to gh-pages"
git push --quiet -f "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}" HEAD:gh-pages
+
+ - name: Check if files comply with semantic line breaks
+ continue-on-error: true
+ run: |
+ # using split_inclusive that uses regex feature that uses an unstable feature
+ RUSTC_BOOTSTRAP=1 cargo run --manifest-path ci/sembr/Cargo.toml src
diff --git a/src/doc/rustc-dev-guide/.gitignore b/src/doc/rustc-dev-guide/.gitignore
index f03fcae..f2e57fc 100644
--- a/src/doc/rustc-dev-guide/.gitignore
+++ b/src/doc/rustc-dev-guide/.gitignore
@@ -1,6 +1,7 @@
book
ci/date-check/target/
+ci/sembr/target/
# Generated by check-in.sh
pulls.json
diff --git a/src/doc/rustc-dev-guide/ci/sembr/Cargo.lock b/src/doc/rustc-dev-guide/ci/sembr/Cargo.lock
new file mode 100644
index 0000000..1e690cc
--- /dev/null
+++ b/src/doc/rustc-dev-guide/ci/sembr/Cargo.lock
@@ -0,0 +1,466 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "anstream"
+version = "0.6.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "is_terminal_polyfill",
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle"
+version = "1.0.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
+
+[[package]]
+name = "anstyle-parse"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
+dependencies = [
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
+dependencies = [
+ "anstyle",
+ "once_cell_polyfill",
+ "windows-sys 0.60.2",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
+
+[[package]]
+name = "bstr"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4"
+dependencies = [
+ "memchr",
+ "serde",
+]
+
+[[package]]
+name = "clap"
+version = "4.5.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623"
+dependencies = [
+ "clap_builder",
+ "clap_derive",
+]
+
+[[package]]
+name = "clap_builder"
+version = "4.5.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "clap_lex",
+ "strsim",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.5.49"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
+
+[[package]]
+name = "colorchoice"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
+dependencies = [
+ "crossbeam-epoch",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
+
+[[package]]
+name = "foldhash"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
+
+[[package]]
+name = "globset"
+version = "0.4.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
+dependencies = [
+ "aho-corasick",
+ "bstr",
+ "log",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.15.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
+dependencies = [
+ "foldhash",
+]
+
+[[package]]
+name = "heck"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
+
+[[package]]
+name = "ignore"
+version = "0.4.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81776e6f9464432afcc28d03e52eb101c93b6f0566f52aef2427663e700f0403"
+dependencies = [
+ "crossbeam-deque",
+ "globset",
+ "log",
+ "memchr",
+ "regex-automata",
+ "same-file",
+ "walkdir",
+ "winapi-util",
+]
+
+[[package]]
+name = "imara-diff"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f01d462f766df78ab820dd06f5eb700233c51f0f4c2e846520eaf4ba6aa5c5c"
+dependencies = [
+ "hashbrown",
+ "memchr",
+]
+
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
+
+[[package]]
+name = "log"
+version = "0.4.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
+
+[[package]]
+name = "memchr"
+version = "2.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
+
+[[package]]
+name = "once_cell_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.103"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "regex"
+version = "1.12.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "sembr"
+version = "0.0.0"
+dependencies = [
+ "anyhow",
+ "clap",
+ "ignore",
+ "imara-diff",
+ "regex",
+]
+
+[[package]]
+name = "serde"
+version = "1.0.228"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
+dependencies = [
+ "serde_core",
+]
+
+[[package]]
+name = "serde_core"
+version = "1.0.228"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.228"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "strsim"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
+
+[[package]]
+name = "syn"
+version = "2.0.108"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"
+
+[[package]]
+name = "utf8parse"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
+
+[[package]]
+name = "walkdir"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+dependencies = [
+ "same-file",
+ "winapi-util",
+]
+
+[[package]]
+name = "winapi-util"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "windows-link"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
+
+[[package]]
+name = "windows-sys"
+version = "0.60.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.61.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.53.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
+dependencies = [
+ "windows-link",
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
diff --git a/src/doc/rustc-dev-guide/ci/sembr/Cargo.toml b/src/doc/rustc-dev-guide/ci/sembr/Cargo.toml
new file mode 100644
index 0000000..00818e2
--- /dev/null
+++ b/src/doc/rustc-dev-guide/ci/sembr/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+name = "sembr"
+edition = "2024"
+
+[dependencies]
+anyhow = "1"
+ignore = "0.4"
+imara-diff = "0.2"
+
+[dependencies.regex]
+version = "1"
+features = ["pattern"]
+
+[dependencies.clap]
+version = "4"
+features = ["derive"]
diff --git a/src/doc/rustc-dev-guide/ci/sembr/src/main.rs b/src/doc/rustc-dev-guide/ci/sembr/src/main.rs
new file mode 100644
index 0000000..c056f68
--- /dev/null
+++ b/src/doc/rustc-dev-guide/ci/sembr/src/main.rs
@@ -0,0 +1,291 @@
+use std::path::PathBuf;
+use std::sync::LazyLock;
+use std::{fs, process};
+
+use anyhow::Result;
+use clap::Parser;
+use ignore::Walk;
+use imara_diff::{Algorithm, BasicLineDiffPrinter, Diff, InternedInput, UnifiedDiffConfig};
+use regex::Regex;
+
+#[derive(Parser)]
+struct Cli {
+ /// File or directory to check
+ path: PathBuf,
+ #[arg(long)]
+ /// Modify files that do not comply
+ overwrite: bool,
+ /// Applies to lines that are to be split
+ #[arg(long, default_value_t = 100)]
+ line_length_limit: usize,
+ #[arg(long)]
+ show_diff: bool,
+}
+
+static REGEX_IGNORE: LazyLock<Regex> =
+ LazyLock::new(|| Regex::new(r"^\s*(\d\.|\-|\*)\s+").unwrap());
+static REGEX_IGNORE_END: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|\?|;|!)$").unwrap());
+static REGEX_IGNORE_LINK_TARGETS: LazyLock<Regex> =
+ LazyLock::new(|| Regex::new(r"^\[.+\]: ").unwrap());
+static REGEX_SPLIT: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|[^r]\?|;|!)\s+").unwrap());
+
+fn main() -> Result<()> {
+ let cli = Cli::parse();
+ let mut compliant = Vec::new();
+ let mut not_compliant = Vec::new();
+ let mut made_compliant = Vec::new();
+ for result in Walk::new(cli.path) {
+ let entry = result?;
+ if entry.file_type().expect("no stdin").is_dir() {
+ continue;
+ }
+ let path = entry.into_path();
+ if let Some(extension) = path.extension() {
+ if extension != "md" {
+ continue;
+ }
+ let old = fs::read_to_string(&path)?;
+ let new = lengthen_lines(&comply(&old), cli.line_length_limit);
+ if new == old {
+ compliant.push(path.clone());
+ } else if cli.overwrite {
+ fs::write(&path, new)?;
+ made_compliant.push(path.clone());
+ } else if cli.show_diff {
+ println!("{}:", path.display());
+ show_diff(&old, &new);
+ println!("---");
+ } else {
+ not_compliant.push(path.clone());
+ }
+ }
+ }
+ if !compliant.is_empty() {
+ display("compliant", &compliant);
+ }
+ if !made_compliant.is_empty() {
+ display("made compliant", &made_compliant);
+ }
+ if !not_compliant.is_empty() {
+ display("not compliant", ¬_compliant);
+ process::exit(1);
+ }
+ Ok(())
+}
+
+fn show_diff(old: &str, new: &str) {
+ let input = InternedInput::new(old, new);
+ let mut diff = Diff::compute(Algorithm::Histogram, &input);
+ diff.postprocess_lines(&input);
+ let diff = diff
+ .unified_diff(&BasicLineDiffPrinter(&input.interner), UnifiedDiffConfig::default(), &input)
+ .to_string();
+ print!("{diff}");
+}
+
+fn display(header: &str, paths: &[PathBuf]) {
+ println!("{header}:");
+ for element in paths {
+ println!("- {}", element.display());
+ }
+}
+
+fn ignore(line: &str, in_code_block: bool) -> bool {
+ in_code_block
+ || line.to_lowercase().contains("e.g.")
+ || line.contains("i.e.")
+ || line.contains('|')
+ || line.trim_start().starts_with('>')
+ || line.starts_with('#')
+ || line.trim().is_empty()
+ || REGEX_IGNORE.is_match(line)
+ || REGEX_IGNORE_LINK_TARGETS.is_match(line)
+}
+
+fn comply(content: &str) -> String {
+ let content: Vec<_> = content.lines().map(std::borrow::ToOwned::to_owned).collect();
+ let mut new_content = content.clone();
+ let mut new_n = 0;
+ let mut in_code_block = false;
+ for (n, line) in content.into_iter().enumerate() {
+ if n != 0 {
+ new_n += 1;
+ }
+ if line.trim_start().starts_with("```") {
+ in_code_block = !in_code_block;
+ continue;
+ }
+ if ignore(&line, in_code_block) {
+ continue;
+ }
+ if REGEX_SPLIT.is_match(&line) {
+ let indent = line.find(|ch: char| !ch.is_whitespace()).unwrap();
+ let new_lines: Vec<_> = line
+ .split_inclusive(&*REGEX_SPLIT)
+ .map(|portion| format!("{:indent$}{}", "", portion.trim()))
+ .collect();
+ new_content.splice(new_n..=new_n, new_lines.clone());
+ new_n += new_lines.len() - 1;
+ }
+ }
+ new_content.join("\n") + "\n"
+}
+
+fn lengthen_lines(content: &str, limit: usize) -> String {
+ let content: Vec<_> = content.lines().map(std::borrow::ToOwned::to_owned).collect();
+ let mut new_content = content.clone();
+ let mut new_n = 0;
+ let mut in_code_block = false;
+ let mut skip_next = false;
+ for (n, line) in content.iter().enumerate() {
+ if skip_next {
+ skip_next = false;
+ continue;
+ }
+ if n != 0 {
+ new_n += 1;
+ }
+ if line.trim_start().starts_with("```") {
+ in_code_block = !in_code_block;
+ continue;
+ }
+ if ignore(line, in_code_block) || REGEX_SPLIT.is_match(line) {
+ continue;
+ }
+ let Some(next_line) = content.get(n + 1) else {
+ continue;
+ };
+ if ignore(next_line, in_code_block) || REGEX_IGNORE_END.is_match(line) {
+ continue;
+ }
+ if line.len() + next_line.len() < limit {
+ new_content[new_n] = format!("{line} {}", next_line.trim_start());
+ new_content.remove(new_n + 1);
+ skip_next = true;
+ }
+ }
+ new_content.join("\n") + "\n"
+}
+
+#[test]
+fn test_sembr() {
+ let original = "\
+# some. heading
+must! be; split? and. normalizes space
+1. ignore numbered
+ignore | tables
+ignore e.g. and
+ignore i.e. and
+ignore E.g. too
+- ignore. list
+* ignore. list
+```
+some code. block
+```
+sentence with *italics* should not be ignored. truly.
+";
+ let expected = "\
+# some. heading
+must!
+be;
+split?
+and.
+normalizes space
+1. ignore numbered
+ignore | tables
+ignore e.g. and
+ignore i.e. and
+ignore E.g. too
+- ignore. list
+* ignore. list
+```
+some code. block
+```
+sentence with *italics* should not be ignored.
+truly.
+";
+ assert_eq!(expected, comply(original));
+}
+
+#[test]
+fn test_prettify() {
+ let original = "\
+do not split
+short sentences
+";
+ let expected = "\
+do not split short sentences
+";
+ assert_eq!(expected, lengthen_lines(original, 50));
+}
+
+#[test]
+fn test_prettify_prefix_spaces() {
+ let original = "\
+ do not split
+ short sentences
+";
+ let expected = "\
+ do not split short sentences
+";
+ assert_eq!(expected, lengthen_lines(original, 50));
+}
+
+#[test]
+fn test_prettify_ignore_link_targets() {
+ let original = "\
+[a target]: https://example.com
+[another target]: https://example.com
+";
+ assert_eq!(original, lengthen_lines(original, 100));
+}
+
+#[test]
+fn test_sembr_then_prettify() {
+ let original = "\
+hi there. do
+not split
+short sentences.
+hi again.
+";
+ let expected = "\
+hi there.
+do
+not split
+short sentences.
+hi again.
+";
+ let processed = comply(original);
+ assert_eq!(expected, processed);
+ let expected = "\
+hi there.
+do not split
+short sentences.
+hi again.
+";
+ let processed = lengthen_lines(&processed, 50);
+ assert_eq!(expected, processed);
+ let expected = "\
+hi there.
+do not split short sentences.
+hi again.
+";
+ let processed = lengthen_lines(&processed, 50);
+ assert_eq!(expected, processed);
+}
+
+#[test]
+fn test_sembr_question_mark() {
+ let original = "\
+o? whatever
+r? @reviewer
+ r? @reviewer
+";
+ let expected = "\
+o?
+whatever
+r? @reviewer
+ r? @reviewer
+";
+ assert_eq!(expected, comply(original));
+}
diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version
index f100e41..0e89b4a 100644
--- a/src/doc/rustc-dev-guide/rust-version
+++ b/src/doc/rustc-dev-guide/rust-version
@@ -1 +1 @@
-b1b464d6f61ec8c4e609c1328106378c066a9729
+c5dabe8cf798123087d094f06417f5a767ca73e8
diff --git a/src/doc/rustc-dev-guide/src/autodiff/internals.md b/src/doc/rustc-dev-guide/src/autodiff/internals.md
index c8e304f..e381b09 100644
--- a/src/doc/rustc-dev-guide/src/autodiff/internals.md
+++ b/src/doc/rustc-dev-guide/src/autodiff/internals.md
@@ -20,7 +20,7 @@
Differentiable programming is used in various fields like numerical computing, [solid mechanics][ratel], [computational chemistry][molpipx], [fluid dynamics][waterlily] or for Neural Network training via Backpropagation, [ODE solver][diffsol], [differentiable rendering][libigl], [quantum computing][catalyst], and climate simulations.
[ratel]: https://gitlab.com/micromorph/ratel
-[molpipx]: https://arxiv.org/abs/2411.17011v
+[molpipx]: https://arxiv.org/abs/2411.17011
[waterlily]: https://github.com/WaterLily-jl/WaterLily.jl
[diffsol]: https://github.com/martinjrobins/diffsol
[libigl]: https://github.com/alecjacobson/libigl-enzyme-example?tab=readme-ov-file#run
diff --git a/src/doc/rustc-dev-guide/src/contributing.md b/src/doc/rustc-dev-guide/src/contributing.md
index 366c3e4..b8614e5 100644
--- a/src/doc/rustc-dev-guide/src/contributing.md
+++ b/src/doc/rustc-dev-guide/src/contributing.md
@@ -2,9 +2,9 @@
## Bug reports
-While bugs are unfortunate, they're a reality in software. We can't fix what we
-don't know about, so please report liberally. If you're not sure if something
-is a bug or not, feel free to file a bug anyway.
+While bugs are unfortunate, they're a reality in software.
+We can't fix what we don't know about, so please report liberally.
+If you're not sure if something is a bug, feel free to open an issue anyway.
**If you believe reporting your bug publicly represents a security risk to Rust users,
please follow our [instructions for reporting security vulnerabilities][vuln]**.
@@ -12,16 +12,18 @@
[vuln]: https://www.rust-lang.org/policies/security
If you're using the nightly channel, please check if the bug exists in the
-latest toolchain before filing your bug. It might be fixed already.
+latest toolchain before filing your bug.
+It might be fixed already.
If you have the chance, before reporting a bug, please [search existing issues],
-as it's possible that someone else has already reported your error. This doesn't
-always work, and sometimes it's hard to know what to search for, so consider this
-extra credit. We won't mind if you accidentally file a duplicate report.
+as it's possible that someone else has already reported your error.
+This doesn't always work, and sometimes it's hard to know what to search for, so consider this
+extra credit.
+We won't mind if you accidentally file a duplicate report.
Similarly, to help others who encountered the bug find your issue, consider
-filing an issue with a descriptive title, which contains information that might
-be unique to it. This can be the language or compiler feature used, the
+filing an issue with a descriptive title, which contains information that might be unique to it.
+This can be the language or compiler feature used, the
conditions that trigger the bug, or part of the error message if there is any.
An example could be: **"impossible case reached" on lifetime inference for impl
Trait in return position**.
@@ -31,14 +33,15 @@
## Bug fixes or "normal" code changes
-For most PRs, no special procedures are needed. You can just [open a PR], and it
-will be reviewed, approved, and merged. This includes most bug fixes,
-refactorings, and other user-invisible changes. The next few sections talk
-about exceptions to this rule.
+For most PRs, no special procedures are needed.
+You can just [open a PR], and it will be reviewed, approved, and merged.
+This includes most bug fixes, refactorings, and other user-invisible changes.
+The next few sections talk about exceptions to this rule.
Also, note that it is perfectly acceptable to open WIP PRs or GitHub [Draft PRs].
Some people prefer to do this so they can get feedback along the
-way or share their code with a collaborator. Others do this so they can utilize
+way or share their code with a collaborator.
+Others do this so they can utilize
the CI to build and test their PR (e.g. when developing on a slow machine).
[open a PR]: #pull-requests
@@ -46,9 +49,9 @@
## New features
-Rust has strong backwards-compatibility guarantees. Thus, new features can't
-just be implemented directly in stable Rust. Instead, we have 3 release
-channels: stable, beta, and nightly.
+Rust has strong backwards-compatibility guarantees.
+Thus, new features can't just be implemented directly in stable Rust.
+Instead, we have 3 release channels: stable, beta, and nightly.
- **Stable**: this is the latest stable release for general usage.
- **Beta**: this is the next release (will be stable within 6 weeks).
@@ -65,35 +68,36 @@
### Major changes
-The compiler team has a special process for large changes, whether or not they
-cause breakage. This process is called a Major Change Proposal (MCP). MCP is a
-relatively lightweight mechanism for getting feedback on large changes to the
+The compiler team has a special process for large changes, whether or not they cause breakage.
+This process is called a Major Change Proposal (MCP).
+MCP is a relatively lightweight mechanism for getting feedback on large changes to the
compiler (as opposed to a full RFC or a design meeting with the team).
Example of things that might require MCPs include major refactorings, changes
to important types, or important changes to how the compiler does something, or
smaller user-facing changes.
-**When in doubt, ask on [Zulip]. It would be a shame to put a lot of work
-into a PR that ends up not getting merged!** [See this document][mcpinfo] for
-more info on MCPs.
+**When in doubt, ask [on Zulip].
+It would be a shame to put a lot of work
+into a PR that ends up not getting merged!** [See this document][mcpinfo] for more info on MCPs.
[mcpinfo]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
-[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
+[on Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
### Performance
-Compiler performance is important. We have put a lot of effort over the last
-few years into [gradually improving it][perfdash].
+Compiler performance is important.
+We have put a lot of effort over the last few years into [gradually improving it][perfdash].
[perfdash]: https://perf.rust-lang.org/dashboard.html
If you suspect that your change may cause a performance regression (or
improvement), you can request a "perf run" (and your reviewer may also request one
-before approving). This is yet another bot that will compile a collection of
-benchmarks on a compiler with your changes. The numbers are reported
-[here][perf], and you can see a comparison of your changes against the latest
-master.
+before approving).
+This is yet another bot that will compile a collection of
+benchmarks on a compiler with your changes.
+The numbers are reported
+[here][perf], and you can see a comparison of your changes against the latest master.
> For an introduction to the performance of Rust code in general
> which would also be useful in rustc development, see [The Rust Performance Book].
@@ -104,11 +108,11 @@
## Pull requests
Pull requests (or PRs for short) are the primary mechanism we use to change Rust.
-GitHub itself has some [great documentation][about-pull-requests] on using the
-Pull Request feature. We use the "fork and pull" model [described here][development-models],
+GitHub itself has some [great documentation][about-pull-requests] on using the Pull Request feature.
+We use the ["fork and pull" model][development-models],
where contributors push changes to their personal fork and create pull requests to
-bring those changes into the source repository. We have more info about how to use git
-when contributing to Rust under [the git section](./git.md).
+bring those changes into the source repository.
+We have [a chapter](git.md) on how to use Git when contributing to Rust.
> **Advice for potentially large, complex, cross-cutting and/or very domain-specific changes**
>
@@ -150,7 +154,8 @@
### Keeping your branch up-to-date
The CI in rust-lang/rust applies your patches directly against the current master,
-not against the commit your branch is based on. This can lead to unexpected failures
+not against the commit your branch is based on.
+This can lead to unexpected failures
if your branch is outdated, even when there are no explicit merge conflicts.
Update your branch only when needed: when you have merge conflicts, upstream CI is broken and blocking your green PR, or a maintainer requests it.
@@ -159,30 +164,31 @@
Prefer to squash or rebase only at the end, or when a reviewer requests it.
When updating, use `git push --force-with-lease` and leave a brief comment explaining what changed.
-Some repos prefer merging from `upstream/master` instead of rebasing; follow the project's conventions.
+Some repos prefer merging from `upstream/master` instead of rebasing;
+follow the project's conventions.
See [keeping things up to date](git.md#keeping-things-up-to-date) for detailed instructions.
After rebasing, it's recommended to [run the relevant tests locally](tests/intro.md) to catch any issues before CI runs.
### r?
-All pull requests are reviewed by another person. We have a bot,
-[@rustbot], that will automatically assign a random person
+All pull requests are reviewed by another person.
+We have a bot, [@rustbot], that will automatically assign a random person
to review your request based on which files you changed.
If you want to request that a specific person reviews your pull request, you
-can add an `r?` to the pull request description or in a comment. For example,
-if you want to ask a review to @awesome-reviewer, add
+can add an `r?` to the pull request description or in a comment.
+For example, if you want to ask a review by @awesome-reviewer,
+add the following to the end of the pull request description:
r? @awesome-reviewer
-to the end of the pull request description, and [@rustbot] will assign
-them instead of a random person. This is entirely optional.
+[@rustbot] will then assign the PR to that reviewer instead of a random person.
+This is entirely optional.
You can also assign a random reviewer from a specific team by writing `r? rust-lang/groupname`.
-As an example,
-if you were making a diagnostics change,
-then you could get a reviewer from the diagnostics team by adding:
+As an example, if you were making a diagnostics change,
+you could get a reviewer from the diagnostics team by adding:
r? rust-lang/diagnostics
@@ -209,15 +215,15 @@
> the author is ready for a review,
> and this PR will be queued again in the reviewer's queue.
-Please note that the reviewers are humans, who for the most part work on `rustc`
-in their free time. This means that they can take some time to respond and review
-your PR. It also means that reviewers can miss some PRs that are assigned to them.
+Please note that the reviewers are humans, who for the most part work on `rustc` in their free time.
+This means that they can take some time to respond and review your PR.
+It also means that reviewers can miss some PRs that are assigned to them.
To try to move PRs forward, the Triage WG regularly goes through all PRs that
-are waiting for review and haven't been discussed for at least 2 weeks. If you
-don't get a review within 2 weeks, feel free to ask the Triage WG on
-Zulip ([#t-release/triage]). They have knowledge of when to ping, who might be
-on vacation, etc.
+are waiting for review and haven't been discussed for at least 2 weeks.
+If you don't get a review within 2 weeks, feel free to ask the Triage WG on
+Zulip ([#t-release/triage]).
+They have knowledge of when to ping, who might be on vacation, etc.
The reviewer may request some changes using the GitHub code review interface.
They may also request special procedures for some PRs.
@@ -230,7 +236,8 @@
### CI
In addition to being reviewed by a human, pull requests are automatically tested,
-thanks to continuous integration (CI). Basically, every time you open and update
+thanks to continuous integration (CI).
+Basically, every time you open and update
a pull request, CI builds the compiler and tests it against the
[compiler test suite], and also performs other tests such as checking that
your pull request is in compliance with Rust's style guidelines.
@@ -240,58 +247,64 @@
of the status of a particular pull request.
Rust has plenty of CI capacity, and you should never have to worry about wasting
-computational resources each time you push a change. It is also perfectly fine
-(and even encouraged!) to use the CI to test your changes if it can help your
-productivity. In particular, we don't recommend running the full `./x test` suite locally,
+computational resources each time you push a change.
+It is also perfectly fine
+(and even encouraged!) to use the CI to test your changes if it can help your productivity.
+In particular, we don't recommend running the full `./x test` suite locally,
since it takes a very long time to execute.
### r+
After someone has reviewed your pull request, they will leave an annotation
-on the pull request with an `r+`. It will look something like this:
+on the pull request with an `r+`.
+It will look something like this:
@bors r+
-This tells [@bors], our lovable integration bot, that your pull request has
-been approved. The PR then enters the [merge queue], where [@bors]
-will run *all* the tests on *every* platform we support. If it all works out,
-[@bors] will merge your code into `master` and close the pull request.
+This tells [@bors], our lovable integration bot, that your pull request has been approved.
+The PR then enters the [merge queue], where [@bors]
+will run *all* the tests on *every* platform we support.
+If it all works out, [@bors] will merge your code into `master` and close the pull request.
Depending on the scale of the change, you may see a slightly different form of `r+`:
@bors r+ rollup
The additional `rollup` tells [@bors] that this change should always be "rolled up".
-Changes that are rolled up are tested and merged alongside other PRs, to
-speed the process up. Typically only small changes that are expected not to conflict
+Changes that are rolled up are tested and merged alongside other PRs, to speed the process up.
+Typically, only small changes that are expected not to conflict
with one another are marked as "always roll up".
-Be patient; this can take a while and the queue can sometimes be long. PRs are never merged by hand.
+Be patient;
+this can take a while and the queue can sometimes be long.
+Also, note that PRs are never merged by hand.
[@rustbot]: https://github.com/rustbot
[@bors]: https://github.com/bors
### Opening a PR
-You are now ready to file a pull request? Great! Here are a few points you
-should be aware of.
+You are now ready to file a pull request (PR)?
+Great!
+Here are a few points you should be aware of.
All pull requests should be filed against the `master` branch,
unless you know for sure that you should target a different branch.
-Make sure your pull request is in compliance with Rust's style guidelines by running
+Run some style checks before you submit the PR:
- $ ./x test tidy --bless
+ ./x test tidy --bless
-We recommend to make this check before every pull request (and every new commit
-in a pull request); you can add [git hooks]
-before every push to make sure you never forget to make this check.
+We recommend to make this check before every pull request (and every new commit in a pull request);
+you can add [git hooks] before every push to make sure you never forget to make this check.
The CI will also run tidy and will fail if tidy fails.
-Rust follows a _no merge-commit policy_, meaning, when you encounter merge
-conflicts you are expected to always rebase instead of merging. E.g. always use
-rebase when bringing the latest changes from the master branch to your feature
-branch. If your PR contains merge commits, it will get marked as `has-merge-commits`.
+Rust follows a _no merge-commit policy_,
+meaning that when you encounter merge conflicts,
+you are expected to always rebase instead of merging.
+For example,
+always use rebase when bringing the latest changes from the master branch to your feature branch.
+If your PR contains merge commits, it will get marked as `has-merge-commits`.
Once you have removed the merge commits, e.g., through an interactive rebase, you
should remove the label again:
@@ -300,13 +313,14 @@
See [this chapter][labeling] for more details.
If you encounter merge conflicts or when a reviewer asks you to perform some
-changes, your PR will get marked as `S-waiting-on-author`. When you resolve
-them, you should use `@rustbot` to mark it as `S-waiting-on-review`:
+changes, your PR will get marked as `S-waiting-on-author`.
+When you resolve them, you should use `@rustbot` to mark it as `S-waiting-on-review`:
@rustbot ready
-GitHub allows [closing issues using keywords][closing-keywords]. This feature
-should be used to keep the issue tracker tidy. However, it is generally preferred
+GitHub allows [closing issues using keywords][closing-keywords].
+This feature should be used to keep the issue tracker tidy.
+However, it is generally preferred
to put the "closes #123" text in the PR description rather than the issue commit;
particularly during rebasing, citing the issue number in the commit can "spam"
the issue in question.
@@ -319,9 +333,10 @@
For example, you could write `Fixes (after beta backport) #NNN.`.
As for further actions, please keep a sharp look-out for a PR whose title begins with
-`[beta]` or `[stable]` and which backports the PR in question. When that one gets
-merged, the relevant issue can be closed. The closing comment should mention all
-PRs that were involved. If you don't have the permissions to close the issue, please
+`[beta]` or `[stable]` and which backports the PR in question.
+When that one gets merged, the relevant issue can be closed.
+The closing comment should mention all PRs that were involved.
+If you don't have the permissions to close the issue, please
leave a comment on the original PR asking the reviewer to close it for you.
[labeling]: ./rustbot.md#issue-relabeling
@@ -330,11 +345,13 @@
### Reverting a PR
When a PR leads to miscompile, significant performance regressions, or other critical issues, we may
-want to revert that PR with a regression test case. You can also check out the [revert policy] on
+want to revert that PR with a regression test case.
+You can also check out the [revert policy] on
Forge docs (which is mainly targeted for reviewers, but contains useful info for PR authors too).
If the PR contains huge changes, it can be challenging to revert, making it harder to review
-incremental fixes in subsequent updates. Or if certain code in that PR is heavily depended upon by
+incremental fixes in subsequent updates.
+Or if certain code in that PR is heavily depended upon by
subsequent PRs, reverting it can become difficult.
In such cases, we can identify the problematic code and disable it for some input, as shown in [#128271][#128271].
@@ -352,7 +369,8 @@
## Writing documentation
-Documentation improvements are very welcome. The source of `doc.rust-lang.org`
+Documentation improvements are very welcome.
+The source of `doc.rust-lang.org`
is located in [`src/doc`] in the tree, and standard API documentation is generated
from the source code itself (e.g. [`library/std/src/lib.rs`][std-root]). Documentation pull requests
function in the same way as other pull requests.
@@ -370,8 +388,8 @@
See [Building Documentation](./building/compiler-documenting.md#building-documentation) for more
information.
-You can also use `rustdoc` directly to check small fixes. For example,
-`rustdoc src/doc/reference.md` will render reference to `doc/reference.html`.
+You can also use `rustdoc` directly to check small fixes.
+For example, `rustdoc src/doc/reference.md` will render reference to `doc/reference.html`.
The CSS might be messed up, but you can verify that the HTML is right.
Please notice that we don't accept typography/spellcheck fixes to **internal documentation**
@@ -389,18 +407,25 @@
Just a few things to keep in mind:
- Please try to avoid overly long lines and use semantic line breaks (where you break the line after each sentence).
- There is no strict limit on line lengths; let the sentence or part of the sentence flow to its proper end on the same line.
+ There is no strict limit on line lengths;
+ let the sentence or part of the sentence flow to its proper end on the same line.
+
+ You can use a tool in ci/sembr to help with this.
+ Its help output can be seen with this command:
+
+ ```console
+ cargo run --manifest-path ci/sembr/Cargo.toml -- --help
+ ```
- When contributing text to the guide, please contextualize the information with some time period
and/or a reason so that the reader knows how much to trust the information.
Aim to provide a reasonable amount of context, possibly including but not limited to:
- - A reason for why the data may be out of date other than "change",
+ - A reason for why the text may be out of date other than "change",
as change is a constant across the project.
- The date the comment was added, e.g. instead of writing _"Currently, ..."_
- or _"As of now, ..."_,
- consider adding the date, in one of the following formats:
+ or _"As of now, ..."_, consider adding the date, in one of the following formats:
- Jan 2021
- January 2021
- jan 2021
@@ -410,24 +435,23 @@
that generates a monthly report showing those that are over 6 months old
([example](https://github.com/rust-lang/rustc-dev-guide/issues/2052)).
- For the action to pick the date,
- add a special annotation before specifying the date:
+ For the action to pick the date, add a special annotation before specifying the date:
```md
- <!-- date-check --> Apr 2025
+ <!-- date-check --> Nov 2025
```
Example:
```md
- As of <!-- date-check --> Apr 2025, the foo did the bar.
+ As of <!-- date-check --> Nov 2025, the foo did the bar.
```
For cases where the date should not be part of the visible rendered output,
use the following instead:
```md
- <!-- date-check: Apr 2025 -->
+ <!-- date-check: Nov 2025 -->
```
- A link to a relevant WG, tracking issue, `rustc` rustdoc page, or similar, that may provide
@@ -435,8 +459,7 @@
outdated.
- If a text grows rather long (more than a few page scrolls) or complicated (more than four
- subsections),
- it might benefit from having a Table of Contents at the beginning,
+ subsections), it might benefit from having a Table of Contents at the beginning,
which you can auto-generate by including the `<!-- toc -->` marker at the top.
#### ⚠️ Note: Where to contribute `rustc-dev-guide` changes
diff --git a/src/doc/rustc-dev-guide/src/tests/ci.md b/src/doc/rustc-dev-guide/src/tests/ci.md
index a36f8ab0..5b6acce 100644
--- a/src/doc/rustc-dev-guide/src/tests/ci.md
+++ b/src/doc/rustc-dev-guide/src/tests/ci.md
@@ -7,18 +7,18 @@
`rust-lang/rust`, the following will happen:
- A small [subset](#pull-request-builds) of tests and checks are run after each
- push to the PR. This should help catch common errors.
+ push to the PR.
+ This should help catch common errors.
- When the PR is approved, the [bors] bot enqueues the PR into a [merge queue].
- Once the PR gets to the front of the queue, bors will create a merge commit
- and run the [full test suite](#auto-builds) on it. The merge commit either
- contains only one specific PR or it can be a ["rollup"](#rollups) which
+ and run the [full test suite](#auto-builds) on it.
+ The merge commit either contains only one specific PR or it can be a ["rollup"](#rollups) which
combines multiple PRs together, to reduce CI costs and merge delays.
- Once the whole test suite finishes, two things can happen. Either CI fails
with an error that needs to be addressed by the developer, or CI succeeds and
the merge commit is then pushed to the `master` branch.
-If you want to modify what gets executed on CI, see [Modifying CI
-jobs](#modifying-ci-jobs).
+If you want to modify what gets executed on CI, see [Modifying CI jobs](#modifying-ci-jobs).
## CI workflow
@@ -26,10 +26,10 @@
Our CI is primarily executed on [GitHub Actions], with a single workflow defined
in [`.github/workflows/ci.yml`], which contains a bunch of steps that are
-unified for all CI jobs that we execute. When a commit is pushed to a
-corresponding branch or a PR, the workflow executes the
-[`src/ci/citool`] crate, which dynamically generates the specific CI
-jobs that should be executed. This script uses the [`jobs.yml`] file as an
+unified for all CI jobs that we execute.
+When a commit is pushed to a corresponding branch or a PR, the workflow executes the
+[`src/ci/citool`] crate, which dynamically generates the specific CI jobs that should be executed.
+This script uses the [`jobs.yml`] file as an
input, which contains a declarative configuration of all our CI jobs.
> Almost all build steps shell out to separate scripts. This keeps the CI fairly
@@ -38,21 +38,22 @@
> orchestrating the scripts that drive the process.
In essence, all CI jobs run `./x test`, `./x dist` or some other command with
-different configurations, across various operating systems, targets, and
-platforms. There are two broad categories of jobs that are executed, `dist` and
-non-`dist` jobs.
+different configurations, across various operating systems, targets, and platforms.
+There are two broad categories of jobs that are executed, `dist` and non-`dist` jobs.
- Dist jobs build a full release of the compiler for a specific platform,
- including all the tools we ship through rustup. Those builds are then uploaded
+ including all the tools we ship through rustup.
+ Those builds are then uploaded
to the `rust-lang-ci2` S3 bucket and are available to be locally installed
- with the [rustup-toolchain-install-master] tool. The same builds are also used
+ with the [rustup-toolchain-install-master] tool.
+ The same builds are also used
for actual releases: our release process basically consists of copying those
artifacts from `rust-lang-ci2` to the production endpoint and signing them.
- Non-dist jobs run our full test suite on the platform, and the test suite of
- all the tools we ship through rustup; The amount of stuff we test depends on
+ all the tools we ship through rustup;
+ The amount of stuff we test depends on
the platform (for example some tests are run only on Tier 1 platforms), and
- some quicker platforms are grouped together on the same builder to avoid
- wasting CI resources.
+ some quicker platforms are grouped together on the same builder to avoid wasting CI resources.
Based on an input event (usually a push to a branch), we execute one of three
kinds of builds (sets of jobs).
@@ -65,13 +66,15 @@
### Pull Request builds
-After each push to a pull request, a set of `pr` jobs are executed. Currently,
-these execute the `x86_64-gnu-llvm-X`, `x86_64-gnu-tools`, `pr-check-1`, `pr-check-2`
-and `tidy` jobs, all running on Linux. These execute a relatively short
-(~40 minutes) and lightweight test suite that should catch common issues. More
-specifically, they run a set of lints, they try to perform a cross-compile check
+After each push to a pull request, a set of `pr` jobs are executed.
+Currently, these execute the `x86_64-gnu-llvm-X`, `x86_64-gnu-tools`, `pr-check-1`, `pr-check-2`
+and `tidy` jobs, all running on Linux.
+These execute a relatively short
+(~40 minutes) and lightweight test suite that should catch common issues.
+More specifically, they run a set of lints, they try to perform a cross-compile check
build to Windows mingw (without producing any artifacts), and they test the
-compiler using a *system* version of LLVM. Unfortunately, it would take too many
+compiler using a *system* version of LLVM.
+Unfortunately, it would take too many
resources to run the full test suite for each commit on every PR.
> **Note on doc comments**
@@ -84,27 +87,28 @@
> Thus, it is a good idea to run `./x doc xxx` locally for any doc comment
> changes to help catch these early.
-PR jobs are defined in the `pr` section of [`jobs.yml`]. Their results can be observed
+PR jobs are defined in the `pr` section of [`jobs.yml`].
+Their results can be observed
directly on the PR, in the "CI checks" section at the bottom of the PR page.
### Auto builds
-Before a commit can be merged into the `master` branch, it needs to pass our
-complete test suite. We call this an `auto` build. This build runs tens of CI
-jobs that exercise various tests across operating systems and targets. The full
-test suite is quite slow; it can take several hours until all the `auto` CI
-jobs finish.
+Before a commit can be merged into the `master` branch, it needs to pass our complete test suite.
+We call this an `auto` build.
+This build runs tens of CI jobs that exercise various tests across operating systems and targets.
+The full test suite is quite slow;
+it can take several hours until all the `auto` CI jobs finish.
Most platforms only run the build steps, some run a restricted set of tests;
only a subset run the full suite of tests (see Rust's [platform tiers]).
-Auto jobs are defined in the `auto` section of [`jobs.yml`]. They are executed
-on the `auto` branch under the `rust-lang/rust` repository,
+Auto jobs are defined in the `auto` section of [`jobs.yml`].
+They are executed on the `auto` branch under the `rust-lang/rust` repository,
and the final result will be reported via a comment made by bors on the corresponding PR.
The live results can be seen on [the GitHub Actions workflows page].
-At any given time, at most a single `auto` build is being executed. Find out
-more in [Merging PRs serially with bors](#merging-prs-serially-with-bors).
+At any given time, at most a single `auto` build is being executed.
+Find out more in [Merging PRs serially with bors](#merging-prs-serially-with-bors).
[platform tiers]: https://forge.rust-lang.org/release/platform-support.html#rust-platform-support
@@ -112,7 +116,8 @@
Sometimes we want to run a subset of the test suite on CI for a given PR, or
build a set of compiler artifacts from that PR, without attempting to merge it.
-We call this a "try build". A try build is started after a user with the proper
+We call this a "try build".
+A try build is started after a user with the proper
permissions posts a PR comment with the `@bors try` command.
There are several use-cases for try builds:
@@ -121,9 +126,9 @@
For this, a working compiler build is needed, which can be generated with a
try build that runs the [dist-x86_64-linux] CI job, which builds an optimized
version of the compiler on Linux (this job is currently executed by default
- when you start a try build). To create a try build and schedule it for a
- performance benchmark, you can use the `@bors try @rust-timer queue` command
- combination.
+ when you start a try build).
+ To create a try build and schedule it for a
+ performance benchmark, you can use the `@bors try @rust-timer queue` command combination.
- Check the impact of the PR across the Rust ecosystem, using a [Crater](crater.md) run.
Again, a working compiler build is needed for this, which can be produced by
the [dist-x86_64-linux] CI job.
@@ -131,25 +136,32 @@
passes the test suite executed by that job.
By default, if you send a comment with `@bors try`, the jobs defined in the `try` section of
-[`jobs.yml`] will be executed. We call this mode a "fast try build". Such a try build
-will not execute any tests, and it will allow compilation warnings. It is useful when you want to
+[`jobs.yml`] will be executed.
+We call this mode a "fast try build".
+Such a try build will not execute any tests, and it will allow compilation warnings.
+It is useful when you want to
get an optimized toolchain as fast as possible, for a Crater run or performance benchmarks,
-even if it might not be working fully correctly. If you want to do a full build for the default try job,
+even if it might not be working fully correctly.
+If you want to do a full build for the default try job,
specify its job name in a job pattern (explained below).
If you want to run custom CI jobs in a try build and make sure that they pass all tests and do
not produce any compilation warnings, you can select CI jobs to be executed by specifying a *job pattern*,
which can be used in one of two ways:
- You can add a set of `try-job: <job pattern>` directives to the PR description (described below) and then
- simply run `@bors try`. CI will read these directives and run the jobs that you have specified. This is
+ simply run `@bors try`.
+ CI will read these directives and run the jobs that you have specified.
+ This is
useful if you want to rerun the same set of try jobs multiple times, after incrementally modifying a PR.
- You can specify the job pattern using the `jobs` parameter of the try command: `@bors try jobs=<job pattern>`.
- This is useful for one-off try builds with specific jobs. Note that the `jobs` parameter has a higher priority
- than the PR description directives.
+ This is useful for one-off try builds with specific jobs.
+ Note that the `jobs` parameter has a higher priority than the PR description directives.
- There can also be multiple patterns specified, e.g. `@bors try jobs=job1,job2,job3`.
Each job pattern can either be an exact name of a job or a glob pattern that matches multiple jobs,
-for example `*msvc*` or `*-alt`. You can start at most 20 jobs in a single try build. When using
+for example `*msvc*` or `*-alt`.
+You can start at most 20 jobs in a single try build.
+When using
glob patterns in the PR description, you can optionally wrap them in backticks (`` ` ``) to avoid GitHub rendering
the pattern as Markdown if it contains e.g. an asterisk. Note that this escaping will not work when using
the `@bors jobs=` parameter.
@@ -208,20 +220,20 @@
You can also modify what gets executed temporarily, for example to test a
particular platform or configuration that is challenging to test locally (for
-example, if a Windows build fails, but you don't have access to a Windows
-machine). Don't hesitate to use CI resources in such situations.
+example, if a Windows build fails, but you don't have access to a Windows machine).
+Don't hesitate to use CI resources in such situations.
You can perform an arbitrary CI job in two ways:
- Use the [try build](#try-builds) functionality, and specify the CI jobs that
you want to be executed in try builds in your PR description.
- Modify the [`pr`](#pull-request-builds) section of `jobs.yml` to specify which
- CI jobs should be executed after each push to your PR. This might be faster
- than repeatedly starting try builds.
+ CI jobs should be executed after each push to your PR.
+ This might be faster than repeatedly starting try builds.
To modify the jobs executed after each push to a PR, you can simply copy one of
-the job definitions from the `auto` section to the `pr` section. For example,
-the `x86_64-msvc` job is responsible for running the 64-bit MSVC tests. You can
-copy it to the `pr` section to cause it to be executed after a commit is pushed
+the job definitions from the `auto` section to the `pr` section.
+For example, the `x86_64-msvc` job is responsible for running the 64-bit MSVC tests.
+You can copy it to the `pr` section to cause it to be executed after a commit is pushed
to your PR, like this:
```yaml
@@ -238,8 +250,8 @@
<<: *job-windows-8c
```
-Then you can commit the file and push it to your PR branch on GitHub. GitHub
-Actions should then execute this CI job after each push to your PR.
+Then you can commit the file and push it to your PR branch on GitHub.
+GitHub Actions should then execute this CI job after each push to your PR.
<div class="warning">
@@ -247,12 +259,12 @@
you have made to `jobs.yml`, if they were supposed to be temporary!**
A good practice is to prefix `[WIP]` in PR title while still running try jobs
-and `[DO NOT MERGE]` in the commit that modifies the CI jobs for testing
-purposes.
+and `[DO NOT MERGE]` in the commit that modifies the CI jobs for testing purposes.
</div>
Although you are welcome to use CI, just be conscious that this is a shared
-resource with limited concurrency. Try not to enable too many jobs at once;
+resource with limited concurrency.
+Try not to enable too many jobs at once;
one or two should be sufficient in most cases.
## Merging PRs serially with bors
@@ -265,26 +277,28 @@
To ensure a `master` branch that works all the time, we forbid manual merges.
Instead, all PRs have to be approved through our bot, [bors] (the software
-behind it is called [homu]). All the approved PRs are put in a [merge queue]
-(sorted by priority and creation date) and are automatically tested one at the
-time. If all the builders are green, the PR is merged, otherwise the failure is
+behind it is called [homu]).
+All the approved PRs are put in a [merge queue]
+(sorted by priority and creation date) and are automatically tested one at the time.
+If all the builders are green, the PR is merged, otherwise the failure is
recorded and the PR will have to be re-approved again.
Bors doesn’t interact with CI services directly, but it works by pushing the
merge commit it wants to test to specific branches (like `auto` or `try`), which
-are configured to execute CI checks. Bors then detects the outcome of the build
-by listening for either Commit Statuses or Check Runs. Since the merge commit is
+are configured to execute CI checks.
+Bors then detects the outcome of the build by listening for either Commit Statuses or Check Runs.
+Since the merge commit is
based on the latest `master` and only one can be tested at the same time, when
the results are green, `master` is fast-forwarded to that merge commit.
Unfortunately, testing a single PR at a time, combined with our long CI (~2
hours for a full run), means we can’t merge a lot of PRs in a single day, and a
-single failure greatly impacts our throughput. The maximum number of
-PRs we can merge in a day is around ~10.
+single failure greatly impacts our throughput.
+The maximum number of PRs we can merge in a day is around ~10.
The long CI run times, and requirement for a large builder pool, is largely due
-to the fact that full release artifacts are built in the `dist-` builders. This
-is worth it because these release artifacts:
+to the fact that full release artifacts are built in the `dist-` builders.
+This is worth it because these release artifacts:
- Allow perf testing even at a later date.
- Allow bisection when bugs are discovered later.
@@ -295,23 +309,23 @@
Some PRs don’t need the full test suite to be executed: trivial changes like
typo fixes or README improvements *shouldn’t* break the build, and testing every
-single one of them for 2+ hours would be wasteful. To solve this, we
-regularly create a "rollup", a PR where we merge several pending trivial PRs so
-they can be tested together. Rollups are created manually by a team member using
-the "create a rollup" button on the [merge queue]. The team member uses their
-judgment to decide if a PR is risky or not.
+single one of them for 2+ hours would be wasteful.
+To solve this, we regularly create a "rollup", a PR where we merge several pending trivial PRs so
+they can be tested together.
+Rollups are created manually by a team member using
+the "create a rollup" button on the [merge queue].
+The team member uses their judgment to decide if a PR is risky or not.
## Docker
All CI jobs, except those on macOS and Windows, are executed inside that
-platform’s custom [Docker container]. This has a lot of advantages for us:
+platform’s custom [Docker container].
+This has a lot of advantages for us:
- The build environment is consistent regardless of the changes of the
- underlying image (switching from the trusty image to xenial was painless for
- us).
+ underlying image (switching from the trusty image to xenial was painless for us).
- We can use ancient build environments to ensure maximum binary compatibility,
- for example [using older CentOS releases][dist-x86_64-linux] on our Linux
- builders.
+ for example [using older CentOS releases][dist-x86_64-linux] on our Linux builders.
- We can avoid reinstalling tools (like QEMU or the Android emulator) every time,
thanks to Docker image caching.
- Users can run the same tests in the same environment locally by just running this command:
@@ -325,13 +339,11 @@
The Docker images prefixed with `dist-` are used for building artifacts while
those without that prefix run tests and checks.
-We also run tests for less common architectures (mainly Tier 2 and Tier 3
-platforms) in CI. Since those platforms are not x86, we either run everything
-inside QEMU, or we just cross-compile if we don’t want to run the tests for that
-platform.
+We also run tests for less common architectures (mainly Tier 2 and Tier 3 platforms) in CI.
+Since those platforms are not x86, we either run everything
+inside QEMU, or we just cross-compile if we don’t want to run the tests for that platform.
-These builders are running on a special pool of builders set up and maintained
-for us by GitHub.
+These builders are running on a special pool of builders set up and maintained for us by GitHub.
[Docker container]: https://github.com/rust-lang/rust/tree/HEAD/src/ci/docker
@@ -341,16 +353,16 @@
### Docker images caching
-The Docker images we use to run most of the Linux-based builders take a *long*
-time to fully build. To speed up the build, we cache them using [Docker registry
-caching], with the intermediate artifacts being stored on [ghcr.io]. We also
-push the built Docker images to ghcr, so that they can be reused by other tools
-(rustup) or by developers running the Docker build locally (to speed up their
-build).
+The Docker images we use to run most of the Linux-based builders take a *long* time to fully build.
+To speed up the build, we cache them using [Docker registry
+caching], with the intermediate artifacts being stored on [ghcr.io].
+We also push the built Docker images to ghcr, so that they can be reused by other tools
+(rustup) or by developers running the Docker build locally (to speed up their build).
Since we test multiple, diverged branches (`master`, `beta` and `stable`), we
can’t rely on a single cache for the images, otherwise builds on a branch would
-override the cache for the others. Instead, we store the images under different
+override the cache for the others.
+Instead, we store the images under different
tags, identifying them with a custom hash made from the contents of all the
Dockerfiles and related scripts.
@@ -367,17 +379,17 @@
### LLVM caching with Sccache
We build some C/C++ stuff in various CI jobs, and we rely on [Sccache] to cache
-the intermediate LLVM artifacts. Sccache is a distributed ccache developed by
+the intermediate LLVM artifacts.
+Sccache is a distributed ccache developed by
Mozilla, which can use an object storage bucket as the storage backend.
-With Sccache there's no need to calculate the hash key ourselves. Sccache
-invalidates the cache automatically when it detects changes to relevant inputs,
-such as the source code, the version of the compiler, and important environment
-variables.
+With Sccache there's no need to calculate the hash key ourselves.
+Sccache invalidates the cache automatically when it detects changes to relevant inputs,
+such as the source code, the version of the compiler, and important environment variables.
So we just pass the Sccache wrapper on top of Cargo and Sccache does the rest.
-We store the persistent artifacts on the S3 bucket, `rust-lang-ci-sccache2`. So
-when the CI runs, if Sccache sees that LLVM is being compiled with the same C/C++
+We store the persistent artifacts on the S3 bucket, `rust-lang-ci-sccache2`.
+So when the CI runs, if Sccache sees that LLVM is being compiled with the same C/C++
compiler and the LLVM source code is the same, Sccache retrieves the individual
compiled translation units from S3.
@@ -396,26 +408,28 @@
posting it on the PR thread.
The bot is not hardcoded to look for error strings, but was trained with a bunch
-of build failures to recognize which lines are common between builds and which
-are not. While the generated snippets can be weird sometimes, the bot is pretty
-good at identifying the relevant lines, even if it’s an error we've never seen
-before.
+of build failures to recognize which lines are common between builds and which are not.
+While the generated snippets can be weird sometimes, the bot is pretty
+good at identifying the relevant lines, even if it’s an error we've never seen before.
[rla]: https://github.com/rust-lang/rust-log-analyzer
### Toolstate to support allowed failures
The `rust-lang/rust` repo doesn’t only test the compiler on its CI, but also a
-variety of tools and documentation. Some documentation is pulled in via git
-submodules. If we blocked merging rustc PRs on the documentation being fixed, we
+variety of tools and documentation.
+Some documentation is pulled in via git submodules.
+If we blocked merging rustc PRs on the documentation being fixed, we
would be stuck in a chicken-and-egg problem, because the documentation's CI
would not pass since updating it would need the not-yet-merged version of rustc
to test against (and we usually require CI to be passing).
To avoid the problem, submodules are allowed to fail, and their status is
-recorded in [rust-toolstate]. When a submodule breaks, a bot automatically pings
+recorded in [rust-toolstate].
+When a submodule breaks, a bot automatically pings
the maintainers so they know about the breakage, and it records the failure on
-the toolstate repository. The release process will then ignore broken tools on
+the toolstate repository.
+The release process will then ignore broken tools on
nightly, removing them from the shipped nightlies.
While tool failures are allowed most of the time, they’re automatically
@@ -448,8 +462,8 @@
## Determining the CI configuration
If you want to determine which `bootstrap.toml` settings are used in CI for a
-particular job, it is probably easiest to just look at the build log. To do
-this:
+particular job, it is probably easiest to just look at the build log.
+To do this:
1. Go to
<https://github.com/rust-lang/rust/actions?query=branch%3Aauto+is%3Asuccess>
diff --git a/src/doc/rustc-dev-guide/src/tests/codegen-backend-tests/cg_gcc.md b/src/doc/rustc-dev-guide/src/tests/codegen-backend-tests/cg_gcc.md
index 6bd6007..4325cc5 100644
--- a/src/doc/rustc-dev-guide/src/tests/codegen-backend-tests/cg_gcc.md
+++ b/src/doc/rustc-dev-guide/src/tests/codegen-backend-tests/cg_gcc.md
@@ -21,7 +21,8 @@
If a different test suite has failed on CI, you will have to modify the `tests/ui` part.
-To reproduce the whole CI job locally, you can run `cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-gcc`. See [Testing with Docker](../docker.md) for more information.
+To reproduce the whole CI job locally, you can run `cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-gcc`.
+See [Testing with Docker](../docker.md) for more information.
### What to do in case of a GCC job failure?
@@ -32,23 +33,26 @@
## Choosing which codegen backends are built
The `rust.codegen-backends = [...]` bootstrap option affects which codegen backends will be built and
-included in the sysroot of the produced `rustc`. To use the GCC codegen backend, `"gcc"` has to
-be included in this array in `bootstrap.toml`:
+included in the sysroot of the produced `rustc`.
+To use the GCC codegen backend, `"gcc"` has to be included in this array in `bootstrap.toml`:
```toml
rust.codegen-backends = ["llvm", "gcc"]
```
If you don't want to change your `bootstrap.toml` file, you can alternatively run your `x`
-commands with `--set 'rust.codegen-backends=["llvm", "gcc"]'`. For example:
+commands with `--set 'rust.codegen-backends=["llvm", "gcc"]'`.
+For example:
```bash
./x build --set 'rust.codegen-backends=["llvm", "gcc"]'
```
The first backend in the `codegen-backends` array will determine which backend will be used as the
-*default backend* of the built `rustc`. This also determines which backend will be used to compile the
-stage 1 standard library (or anything built in stage 2+). To produce `rustc` that uses the GCC backend
+*default backend* of the built `rustc`.
+This also determines which backend will be used to compile the
+stage 1 standard library (or anything built in stage 2+).
+To produce `rustc` that uses the GCC backend
by default, you can thus put `"gcc"` as the first element of this array:
```bash
@@ -69,7 +73,8 @@
## Downloading GCC from CI
The `gcc.download-ci-gcc` bootstrap option controls if GCC (which is a dependency of the GCC codegen backend)
-will be downloaded from CI or built locally. The default value is `true`, which will download GCC from CI
+will be downloaded from CI or built locally.
+The default value is `true`, which will download GCC from CI
if there are no local changes to the GCC sources and the given host target is available on CI.
## Running tests of the backend itself
diff --git a/src/doc/rustc-dev-guide/src/tests/minicore.md b/src/doc/rustc-dev-guide/src/tests/minicore.md
index 2857037..5d05c2c 100644
--- a/src/doc/rustc-dev-guide/src/tests/minicore.md
+++ b/src/doc/rustc-dev-guide/src/tests/minicore.md
@@ -1,16 +1,15 @@
# `minicore` test auxiliary: using `core` stubs
-<!-- date-check Oct 2024 -->
+<!-- date-check: Oct 2025 -->
-[`tests/auxiliary/minicore.rs`][`minicore`] is a test auxiliary for
-ui/codegen/assembly test suites. It provides `core` stubs for tests that need to
+[`tests/auxiliary/minicore.rs`][`minicore`] is a test auxiliary for ui/codegen/assembly test suites.
+It provides `core` stubs for tests that need to
build for cross-compiled targets but do not need/want to run.
<div class="warning">
Please note that [`minicore`] is only intended for `core` items, and explicitly
-**not** `std` or `alloc` items because `core` items are applicable to a wider
-range of tests.
+**not** `std` or `alloc` items because `core` items are applicable to a wider range of tests.
</div>
@@ -41,8 +40,8 @@
## Staying in sync with `core`
-The `minicore` items must be kept up to date with `core`. For consistent
-diagnostic output between using `core` and `minicore`, any `diagnostic`
+The `minicore` items must be kept up to date with `core`.
+For consistent diagnostic output between using `core` and `minicore`, any `diagnostic`
attributes (e.g. `on_unimplemented`) should be replicated exactly in `minicore`.
## Example codegen test that uses `minicore`
diff --git a/src/doc/rustc-dev-guide/src/walkthrough.md b/src/doc/rustc-dev-guide/src/walkthrough.md
index d050f9d..5ba89f9 100644
--- a/src/doc/rustc-dev-guide/src/walkthrough.md
+++ b/src/doc/rustc-dev-guide/src/walkthrough.md
@@ -1,10 +1,10 @@
# Walkthrough: a typical contribution
There are _a lot_ of ways to contribute to the Rust compiler, including fixing
-bugs, improving performance, helping design features, providing feedback on
-existing features, etc. This chapter does not claim to scratch the surface.
-Instead, it walks through the design and implementation of a new feature. Not
-all of the steps and processes described here are needed for every
+bugs, improving performance, helping design features, providing feedback on existing features, etc.
+This chapter does not claim to scratch the surface.
+Instead, it walks through the design and implementation of a new feature.
+Not all of the steps and processes described here are needed for every
contribution, and I will try to point those out as they arise.
In general, if you are interested in making a contribution and aren't sure
@@ -12,8 +12,8 @@
## Overview
-The feature I will discuss in this chapter is the `?` Kleene operator for
-macros. Basically, we want to be able to write something like this:
+The feature I will discuss in this chapter is the `?` Kleene operator for macros.
+Basically, we want to be able to write something like this:
```rust,ignore
macro_rules! foo {
@@ -36,25 +36,30 @@
So basically, the `$(pat)?` matcher in the macro means "this pattern can occur
0 or 1 times", similar to other regex syntaxes.
-There were a number of steps to go from an idea to stable Rust feature. Here is
-a quick list. We will go through each of these in order below. As I mentioned
-before, not all of these are needed for every type of contribution.
+There were a number of steps to go from an idea to stable Rust feature.
+Here is a quick list.
+We will go through each of these in order below.
+As I mentioned before, not all of these are needed for every type of contribution.
- **Idea discussion/Pre-RFC** A Pre-RFC is an early draft or design discussion
- of a feature. This stage is intended to flesh out the design space a bit and
- get a grasp on the different merits and problems with an idea. It's a great
- way to get early feedback on your idea before presenting it to the wider
- audience. You can find the original discussion [here][prerfc].
+ of a feature.
+ This stage is intended to flesh out the design space a bit and
+ get a grasp on the different merits and problems with an idea.
+ It's a great way to get early feedback on your idea before presenting it to the wider
+ audience.
+ You can find the original discussion [here][prerfc].
- **RFC** This is when you formally present your idea to the community for
- consideration. You can find the RFC [here][rfc].
+ consideration.
+ You can find the RFC [here][rfc].
- **Implementation** Implement your idea unstably in the compiler. You can
find the original implementation [here][impl1].
- **Possibly iterate/refine** As the community gets experience with your
feature on the nightly compiler and in `std`, there may be additional
- feedback about design choice that might be adjusted. This particular feature
- went [through][impl2] a [number][impl3] of [iterations][impl4].
+ feedback about design choice that might be adjusted.
+ This particular feature went [through][impl2] a [number][impl3] of [iterations][impl4].
- **Stabilization** When your feature has baked enough, a Rust team member may
- [propose to stabilize it][merge]. If there is consensus, this is done.
+ [propose to stabilize it][merge].
+ If there is consensus, this is done.
- **Relax** Your feature is now a stable Rust feature!
[prerfc]: https://internals.rust-lang.org/t/pre-rfc-at-most-one-repetition-macro-patterns/6557
@@ -75,58 +80,63 @@
[rfcwhen]: https://github.com/rust-lang/rfcs#when-you-need-to-follow-this-process
-An RFC is a document that describes the feature or change you are proposing in
-detail. Anyone can write an RFC; the process is the same for everyone,
-including Rust team members.
+An RFC is a document that describes the feature or change you are proposing in detail.
+Anyone can write an RFC;
+the process is the same for everyone, including Rust team members.
-To open an RFC, open a PR on the
-[rust-lang/rfcs](https://github.com/rust-lang/rfcs) repo on GitHub. You can
-find detailed instructions in the
+To open an RFC, open a PR on the [rust-lang/rfcs](https://github.com/rust-lang/rfcs) repo on GitHub.
+You can find detailed instructions in the
[README](https://github.com/rust-lang/rfcs#what-the-process-is).
Before opening an RFC, you should do the research to "flesh out" your idea.
-Hastily-proposed RFCs tend not to be accepted. You should generally have a good
-description of the motivation, impact, disadvantages, and potential
+Hastily-proposed RFCs tend not to be accepted.
+You should generally have a good description of the motivation, impact, disadvantages, and potential
interactions with other features.
-If that sounds like a lot of work, it's because it is. But no fear! Even if
-you're not a compiler hacker, you can get great feedback by doing a _pre-RFC_.
-This is an _informal_ discussion of the idea. The best place to do this is
-internals.rust-lang.org. Your post doesn't have to follow any particular
-structure. It doesn't even need to be a cohesive idea. Generally, you will get
-tons of feedback that you can integrate back to produce a good RFC.
+If that sounds like a lot of work, it's because it is.
+But no fear!
+Even if you're not a compiler hacker, you can get great feedback by doing a _pre-RFC_.
+This is an _informal_ discussion of the idea.
+The best place to do this is internals.rust-lang.org.
+Your post doesn't have to follow any particular structure.
+It doesn't even need to be a cohesive idea.
+Generally, you will get tons of feedback that you can integrate back to produce a good RFC.
-(Another pro-tip: try searching the RFCs repo and internals for prior related
-ideas. A lot of times an idea has already been considered and was either
-rejected or postponed to be tried again later. This can save you and everybody
-else some time)
+(Another pro-tip: try searching the RFCs repo and internals for prior related ideas.
+A lot of times an idea has already been considered and was either
+rejected or postponed to be tried again later.
+This can save you and everybody else some time)
In the case of our example, a participant in the pre-RFC thread pointed out a
-syntax ambiguity and a potential resolution. Also, the overall feedback seemed
-positive. In this case, the discussion converged pretty quickly, but for some
+syntax ambiguity and a potential resolution.
+Also, the overall feedback seemed positive.
+In this case, the discussion converged pretty quickly, but for some
ideas, a lot more discussion can happen (e.g. see [this RFC][nonascii] which
-received a whopping 684 comments!). If that happens, don't be discouraged; it
-means the community is interested in your idea, but it perhaps needs some
+received a whopping 684 comments!).
+If that happens, don't be discouraged;
+it means the community is interested in your idea, but it perhaps needs some
adjustments.
[nonascii]: https://github.com/rust-lang/rfcs/pull/2457
-The RFC for our `?` macro feature did receive some discussion on the RFC thread
-too. As with most RFCs, there were a few questions that we couldn't answer by
-discussion: we needed experience using the feature to decide. Such questions
-are listed in the "Unresolved Questions" section of the RFC. Also, over the
-course of the RFC discussion, you will probably want to update the RFC document
+The RFC for our `?` macro feature did receive some discussion on the RFC thread too.
+As with most RFCs, there were a few questions that we couldn't answer by
+discussion: we needed experience using the feature to decide.
+Such questions are listed in the "Unresolved Questions" section of the RFC.
+Also, over the course of the RFC discussion, you will probably want to update the RFC document
itself to reflect the course of the discussion (e.g. new alternatives or prior
work may be added or you may decide to change parts of the proposal itself).
In the end, when the discussion seems to reach a consensus and die down a bit,
a Rust team member may propose to move to "final comment period" (FCP) with one
-of three possible dispositions. This means that they want the other members of
-the appropriate teams to review and comment on the RFC. More discussion may
-ensue, which may result in more changes or unresolved questions being added. At
-some point, when everyone is satisfied, the RFC enters the FCP, which is the
-last chance for people to bring up objections. When the FCP is over, the
-disposition is adopted. Here are the three possible dispositions:
+of three possible dispositions.
+This means that they want the other members of
+the appropriate teams to review and comment on the RFC.
+More discussion may ensue, which may result in more changes or unresolved questions being added.
+At some point, when everyone is satisfied, the RFC enters the FCP, which is the
+last chance for people to bring up objections.
+When the FCP is over, the disposition is adopted.
+Here are the three possible dispositions:
- _Merge_: accept the feature. Here is the proposal to merge for our [`?` macro
feature][rfcmerge].
@@ -136,14 +146,14 @@
will go a different direction.
- _Postpone_: there is interest in going this direction but not at the moment.
This happens most often because the appropriate Rust team doesn't have the
- bandwidth to shepherd the feature through the process to stabilization. Often
- this is the case when the feature doesn't fit into the team's roadmap.
+ bandwidth to shepherd the feature through the process to stabilization.
+ Often this is the case when the feature doesn't fit into the team's roadmap.
Postponed ideas may be revisited later.
[rfcmerge]: https://github.com/rust-lang/rfcs/pull/2298#issuecomment-360582667
-When an RFC is merged, the PR is merged into the RFCs repo. A new _tracking
-issue_ is created in the [rust-lang/rust] repo to track progress on the feature
+When an RFC is merged, the PR is merged into the RFCs repo.
+A new _tracking issue_ is created in the [rust-lang/rust] repo to track progress on the feature
and discuss unresolved questions, implementation progress and blockers, etc.
Here is the tracking issue on for our [`?` macro feature][tracking].
@@ -158,93 +168,98 @@
[rust-lang/rust]: https://github.com/rust-lang/rust
Depending on the feature/change/bug fix/improvement, implementation may be
-relatively-straightforward or it may be a major undertaking. You can always ask
-for help or mentorship from more experienced compiler devs. Also, you don't
-have to be the one to implement your feature; but keep in mind that if you
-don't, it might be a while before someone else does.
+relatively-straightforward or it may be a major undertaking.
+You can always ask for help or mentorship from more experienced compiler devs.
+Also, you don't have to be the one to implement your feature;
+but keep in mind that if you don't, it might be a while before someone else does.
For the `?` macro feature, I needed to go understand the relevant parts of
-macro expansion in the compiler. Personally, I find that [improving the
+macro expansion in the compiler.
+Personally, I find that [improving the
comments][comments] in the code is a helpful way of making sure I understand
it, but you don't have to do that if you don't want to.
[comments]: https://github.com/rust-lang/rust/pull/47732
-I then [implemented][impl1] the original feature, as described in the RFC. When
-a new feature is implemented, it goes behind a _feature gate_, which means that
-you have to use `#![feature(my_feature_name)]` to use the feature. The feature
-gate is removed when the feature is stabilized.
+I then [implemented][impl1] the original feature, as described in the RFC.
+When a new feature is implemented, it goes behind a _feature gate_, which means that
+you have to use `#![feature(my_feature_name)]` to use the feature.
+The feature gate is removed when the feature is stabilized.
**Most bug fixes and improvements** don't require a feature gate. You can just
make your changes/improvements.
-When you open a PR on the [rust-lang/rust], a bot will assign your PR to a
-reviewer. If there is a particular Rust team member you are working with, you can
+When you open a PR on the [rust-lang/rust], a bot will assign your PR to a reviewer.
+If there is a particular Rust team member you are working with, you can
request that reviewer by leaving a comment on the thread with `r?
@reviewer-github-id` (e.g. `r? @eddyb`). If you don't know who to request,
-don't request anyone; the bot will assign someone automatically based on which files you changed.
+don't request anyone;
+the bot will assign someone automatically based on which files you changed.
The reviewer may request changes before they approve your PR, they may mark the PR with label
"S-waiting-on-author" after leaving comments, this means that the PR is blocked on you to make
-some requested changes. When you finished iterating on the changes, you can mark the PR as
+some requested changes.
+When you finished iterating on the changes, you can mark the PR as
`S-waiting-on-review` again by leaving a comment with `@rustbot ready`, this will remove the
`S-waiting-on-author` label and add the `S-waiting-on-review` label.
-Feel free to ask questions or discuss things you don't understand or disagree with. However,
-recognize that the PR won't be merged unless someone on the Rust team approves
-it. If a reviewer leave a comment like `r=me after fixing ...`, that means they approve the PR and
+Feel free to ask questions or discuss things you don't understand or disagree with.
+However, recognize that the PR won't be merged unless someone on the Rust team approves
+it.
+If a reviewer leave a comment like `r=me after fixing ...`, that means they approve the PR and
you can merge it with comment with `@bors r=reviewer-github-id`(e.g. `@bors r=eddyb`) to merge it
-after fixing trivial issues. Note that `r=someone` requires permission and bors could say
-something like "🔑 Insufficient privileges..." when commenting `r=someone`. In that case,
-you have to ask the reviewer to revisit your PR.
+after fixing trivial issues.
+Note that `r=someone` requires permission and bors could say
+something like "🔑 Insufficient privileges..." when commenting `r=someone`.
+In that case, you have to ask the reviewer to revisit your PR.
-When your reviewer approves the PR, it will go into a queue for yet another bot
-called `@bors`. `@bors` manages the CI build/merge queue. When your PR reaches
-the head of the `@bors` queue, `@bors` will test out the merge by running all
-tests against your PR on GitHub Actions. This takes a lot of time to
-finish. If all tests pass, the PR is merged and becomes part of the next
-nightly compiler!
+When your reviewer approves the PR, it will go into a queue for yet another bot called `@bors`.
+`@bors` manages the CI build/merge queue.
+When your PR reaches the head of the `@bors` queue, `@bors` will test out the merge by running all
+tests against your PR on GitHub Actions.
+This takes a lot of time to finish.
+If all tests pass, the PR is merged and becomes part of the next nightly compiler!
There are a couple of things that may happen for some PRs during the review process
- If the change is substantial enough, the reviewer may request an FCP on
- the PR. This gives all members of the appropriate team a chance to review the
- changes.
+ the PR.
+ This gives all members of the appropriate team a chance to review the changes.
- If the change may cause breakage, the reviewer may request a [crater] run.
This compiles the compiler with your changes and then attempts to compile all
- crates on crates.io with your modified compiler. This is a great smoke test
+ crates on crates.io with your modified compiler.
+ This is a great smoke test
to check if you introduced a change to compiler behavior that affects a large
portion of the ecosystem.
- If the diff of your PR is large or the reviewer is busy, your PR may have
- some merge conflicts with other PRs that happen to get merged first. You
- should fix these merge conflicts using the normal git procedures.
+ some merge conflicts with other PRs that happen to get merged first.
+ You should fix these merge conflicts using the normal git procedures.
[crater]: ./tests/crater.html
If you are not doing a new feature or something like that (e.g. if you are
-fixing a bug), then that's it! Thanks for your contribution :)
+fixing a bug), then that's it!
+Thanks for your contribution :)
## Refining your implementation
As people get experience with your new feature on nightly, slight changes may
-be proposed and unresolved questions may become resolved. Updates/changes go
-through the same process for implementing any other changes, as described
+be proposed and unresolved questions may become resolved.
+Updates/changes go through the same process for implementing any other changes, as described
above (i.e. submit a PR, go through review, wait for `@bors`, etc).
-Some changes may be major enough to require an FCP and some review by Rust team
-members.
+Some changes may be major enough to require an FCP and some review by Rust team members.
For the `?` macro feature, we went through a few different iterations after the
original implementation: [1][impl2], [2][impl3], [3][impl4].
Along the way, we decided that `?` should not take a separator, which was
-previously an unresolved question listed in the RFC. We also changed the
-disambiguation strategy: we decided to remove the ability to use `?` as a
+previously an unresolved question listed in the RFC.
+We also changed the disambiguation strategy: we decided to remove the ability to use `?` as a
separator token for other repetition operators (e.g. `+` or `*`). However,
since this was a breaking change, we decided to do it over an edition boundary.
Thus, the new feature can be enabled only in edition 2018. These deviations
-from the original RFC required [another
-FCP](https://github.com/rust-lang/rust/issues/51934).
+from the original RFC required [another FCP](https://github.com/rust-lang/rust/issues/51934).
## Stabilization
@@ -264,8 +279,8 @@
[stabrep]: https://github.com/rust-lang/rust/issues/48075#issuecomment-433243048
After this, [a PR is made][stab] to remove the feature gate, enabling the feature by
-default (on the 2018 edition). A note is added to the [Release notes][relnotes]
-about the feature.
+default (on the 2018 edition).
+A note is added to the [Release notes][relnotes] about the feature.
[stab]: https://github.com/rust-lang/rust/pull/56245
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index f2cf1d4..f0f991e 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -209,6 +209,27 @@
format produced by the resulting instrumentation may change, and may not work
with coverage tools other than those built and shipped with the compiler.
+## jump-tables
+
+This option is used to allow or prevent the LLVM codegen backend from creating
+jump tables when lowering switches from Rust code.
+
+* `y`, `yes`, `on`, `true` or no value: allow jump tables (the default).
+* `n`, `no`, `off` or `false`: disable jump tables.
+
+To prevent jump tables being created from Rust code, a target must ensure
+all crates are compiled with jump tables disabled.
+
+Note, in many cases the Rust toolchain is distributed with precompiled
+crates, such as the core and std crates, which could possibly include
+jump tables. Furthermore, this option does not guarantee a target will
+be free of jump tables. They could arise from external dependencies,
+inline asm, or other complicated interactions when using crates which
+are compiled with jump table support.
+
+Disabling jump tables can be used to help provide protection against
+jump-oriented-programming (JOP) attacks.
+
## link-arg
This flag lets you append a single extra argument to the linker invocation.
diff --git a/src/doc/unstable-book/src/compiler-flags/no-jump-tables.md b/src/doc/unstable-book/src/compiler-flags/no-jump-tables.md
deleted file mode 100644
index f096c20..0000000
--- a/src/doc/unstable-book/src/compiler-flags/no-jump-tables.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# `no-jump-tables`
-
-The tracking issue for this feature is [#116592](https://github.com/rust-lang/rust/issues/116592)
-
----
-
-This option enables the `-fno-jump-tables` flag for LLVM, which makes the
-codegen backend avoid generating jump tables when lowering switches.
-
-This option adds the LLVM `no-jump-tables=true` attribute to every function.
-
-The option can be used to help provide protection against
-jump-oriented-programming (JOP) attacks, such as with the linux kernel's [IBT].
-
-```sh
-RUSTFLAGS="-Zno-jump-tables" cargo +nightly build -Z build-std
-```
-
-[IBT]: https://www.phoronix.com/news/Linux-IBT-By-Default-Tip
diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs
index c9cd9f7..631c48a 100644
--- a/src/librustdoc/doctest.rs
+++ b/src/librustdoc/doctest.rs
@@ -166,6 +166,7 @@ pub(crate) fn run(dcx: DiagCtxtHandle<'_>, input: Input, options: RustdocOptions
remap_path_prefix: options.remap_path_prefix.clone(),
unstable_opts: options.unstable_opts.clone(),
error_format: options.error_format.clone(),
+ target_modifiers: options.target_modifiers.clone(),
..config::Options::default()
};
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 752cd2e..a4d3774 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -264,9 +264,7 @@ fn next(&mut self) -> Option<Self::Item> {
</pre>\
</div>",
added_classes = added_classes.join(" "),
- text = Escape(
- original_text.strip_suffix('\n').unwrap_or(&original_text)
- ),
+ text = Escape(original_text.trim_suffix('\n')),
)
.into(),
));
diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs
index c79f63f..f04f944 100644
--- a/src/librustdoc/html/sources.rs
+++ b/src/librustdoc/html/sources.rs
@@ -185,7 +185,7 @@ fn emit_source(
};
// Remove the utf-8 BOM if any
- let contents = contents.strip_prefix('\u{feff}').unwrap_or(&contents);
+ let contents = contents.trim_prefix('\u{feff}');
let shared = &self.cx.shared;
// Create the intermediate directories
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index bdffd69..e88180c 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -1,4 +1,5 @@
// tidy-alphabetical-start
+#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/"
@@ -8,7 +9,6 @@
#![feature(assert_matches)]
#![feature(box_into_inner)]
#![feature(box_patterns)]
-#![feature(debug_closure_helpers)]
#![feature(file_buffered)]
#![feature(formatting_options)]
#![feature(if_let_guard)]
@@ -17,6 +17,7 @@
#![feature(iter_order_by)]
#![feature(rustc_private)]
#![feature(test)]
+#![feature(trim_prefix_suffix)]
#![warn(rustc::internal)]
// tidy-alphabetical-end
@@ -896,7 +897,7 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) {
// Register the loaded external files in the source map so they show up in depinfo.
// We can't load them via the source map because it gets created after we process the options.
for external_path in &loaded_paths {
- let _ = sess.source_map().load_file(external_path);
+ let _ = sess.source_map().load_binary_file(external_path);
}
if sess.opts.describe_lints {
diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs
index 471e966..1b3c96d 100644
--- a/src/librustdoc/scrape_examples.rs
+++ b/src/librustdoc/scrape_examples.rs
@@ -273,6 +273,7 @@ pub(crate) fn run(
bin_crate: bool,
) {
let inner = move || -> Result<(), String> {
+ let emit_dep_info = renderopts.dep_info().is_some();
// Generates source files for examples
renderopts.no_emit_shared = true;
let (cx, _) = Context::init(krate, renderopts, cache, tcx, Default::default())
@@ -320,6 +321,10 @@ pub(crate) fn run(
calls.encode(&mut encoder);
encoder.finish().map_err(|(_path, e)| e.to_string())?;
+ if emit_dep_info {
+ rustc_interface::passes::write_dep_info(tcx);
+ }
+
Ok(())
};
diff --git a/src/tools/clippy/tests/ui/new_without_default.stderr b/src/tools/clippy/tests/ui/new_without_default.stderr
index 1e0d5e2..0593dbb 100644
--- a/src/tools/clippy/tests/ui/new_without_default.stderr
+++ b/src/tools/clippy/tests/ui/new_without_default.stderr
@@ -191,7 +191,6 @@
LL + Self::new()
LL + }
LL + }
-LL | impl NewWithCfg {
|
error: you should consider adding a `Default` implementation for `NewWith2Cfgs`
@@ -212,7 +211,6 @@
LL + Self::new()
LL + }
LL + }
-LL | impl NewWith2Cfgs {
|
error: you should consider adding a `Default` implementation for `NewWithExtraneous`
@@ -250,7 +248,6 @@
LL + Self::new()
LL + }
LL + }
-LL | impl NewWithCfgAndExtraneous {
|
error: aborting due to 13 previous errors
diff --git a/src/tools/compiletest/src/debuggers.rs b/src/tools/compiletest/src/debuggers.rs
index 8afe328..93f27fb 100644
--- a/src/tools/compiletest/src/debuggers.rs
+++ b/src/tools/compiletest/src/debuggers.rs
@@ -103,22 +103,19 @@ fn find_cdb(target: &str) -> Option<Utf8PathBuf> {
}
/// Returns Path to CDB
-pub(crate) fn analyze_cdb(
- cdb: Option<String>,
- target: &str,
-) -> (Option<Utf8PathBuf>, Option<[u16; 4]>) {
+pub(crate) fn discover_cdb(cdb: Option<String>, target: &str) -> Option<Utf8PathBuf> {
let cdb = cdb.map(Utf8PathBuf::from).or_else(|| find_cdb(target));
+ cdb
+}
+pub(crate) fn query_cdb_version(cdb: &Utf8Path) -> Option<[u16; 4]> {
let mut version = None;
- if let Some(cdb) = cdb.as_ref() {
- if let Ok(output) = Command::new(cdb).arg("/version").output() {
- if let Some(first_line) = String::from_utf8_lossy(&output.stdout).lines().next() {
- version = extract_cdb_version(&first_line);
- }
+ if let Ok(output) = Command::new(cdb).arg("/version").output() {
+ if let Some(first_line) = String::from_utf8_lossy(&output.stdout).lines().next() {
+ version = extract_cdb_version(&first_line);
}
}
-
- (cdb, version)
+ version
}
pub(crate) fn extract_cdb_version(full_version_line: &str) -> Option<[u16; 4]> {
@@ -132,12 +129,11 @@ pub(crate) fn analyze_cdb(
Some([major, minor, patch, build])
}
-/// Returns (Path to GDB, GDB Version)
-pub(crate) fn analyze_gdb(
+pub(crate) fn discover_gdb(
gdb: Option<String>,
target: &str,
android_cross_path: &Utf8Path,
-) -> (Option<String>, Option<u32>) {
+) -> Option<String> {
#[cfg(not(windows))]
const GDB_FALLBACK: &str = "gdb";
#[cfg(windows)]
@@ -159,6 +155,10 @@ pub(crate) fn analyze_gdb(
Some(ref s) => s.to_owned(),
};
+ Some(gdb)
+}
+
+pub(crate) fn query_gdb_version(gdb: &str) -> Option<u32> {
let mut version_line = None;
if let Ok(output) = Command::new(&gdb).arg("--version").output() {
if let Some(first_line) = String::from_utf8_lossy(&output.stdout).lines().next() {
@@ -168,10 +168,10 @@ pub(crate) fn analyze_gdb(
let version = match version_line {
Some(line) => extract_gdb_version(&line),
- None => return (None, None),
+ None => return None,
};
- (Some(gdb), version)
+ version
}
pub(crate) fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
diff --git a/src/tools/compiletest/src/directives/directive_names.rs b/src/tools/compiletest/src/directives/directive_names.rs
index 44bf961..1474df1 100644
--- a/src/tools/compiletest/src/directives/directive_names.rs
+++ b/src/tools/compiletest/src/directives/directive_names.rs
@@ -190,6 +190,7 @@
"only-aarch64",
"only-aarch64-apple-darwin",
"only-aarch64-unknown-linux-gnu",
+ "only-aarch64-unknown-uefi",
"only-apple",
"only-arm",
"only-arm64ec",
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index b524017..89f5623 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -258,10 +258,11 @@ fn opt_path(m: &getopts::Matches, nm: &str) -> Utf8PathBuf {
let target = opt_str2(matches.opt_str("target"));
let android_cross_path = opt_path(matches, "android-cross-path");
// FIXME: `cdb_version` is *derived* from cdb, but it's *not* technically a config!
- let (cdb, cdb_version) = debuggers::analyze_cdb(matches.opt_str("cdb"), &target);
+ let cdb = debuggers::discover_cdb(matches.opt_str("cdb"), &target);
+ let cdb_version = cdb.as_deref().and_then(debuggers::query_cdb_version);
// FIXME: `gdb_version` is *derived* from gdb, but it's *not* technically a config!
- let (gdb, gdb_version) =
- debuggers::analyze_gdb(matches.opt_str("gdb"), &target, &android_cross_path);
+ let gdb = debuggers::discover_gdb(matches.opt_str("gdb"), &target, &android_cross_path);
+ let gdb_version = gdb.as_deref().and_then(debuggers::query_gdb_version);
// FIXME: `lldb_version` is *derived* from lldb, but it's *not* technically a config!
let lldb_version =
matches.opt_str("lldb-version").as_deref().and_then(debuggers::extract_lldb_version);
diff --git a/src/tools/miri/src/intrinsics/simd.rs b/src/tools/miri/src/intrinsics/simd.rs
index 1e7366b..2b17609 100644
--- a/src/tools/miri/src/intrinsics/simd.rs
+++ b/src/tools/miri/src/intrinsics/simd.rs
@@ -1,5 +1,3 @@
-use rand::Rng;
-use rustc_apfloat::Float;
use rustc_middle::ty;
use rustc_middle::ty::FloatTy;
@@ -83,62 +81,6 @@ fn emulate_simd_intrinsic(
this.write_scalar(val, &dest)?;
}
}
- "fma" | "relaxed_fma" => {
- let [a, b, c] = check_intrinsic_arg_count(args)?;
- let (a, a_len) = this.project_to_simd(a)?;
- let (b, b_len) = this.project_to_simd(b)?;
- let (c, c_len) = this.project_to_simd(c)?;
- let (dest, dest_len) = this.project_to_simd(dest)?;
-
- assert_eq!(dest_len, a_len);
- assert_eq!(dest_len, b_len);
- assert_eq!(dest_len, c_len);
-
- for i in 0..dest_len {
- let a = this.read_scalar(&this.project_index(&a, i)?)?;
- let b = this.read_scalar(&this.project_index(&b, i)?)?;
- let c = this.read_scalar(&this.project_index(&c, i)?)?;
- let dest = this.project_index(&dest, i)?;
-
- let fuse: bool = intrinsic_name == "fma"
- || (this.machine.float_nondet && this.machine.rng.get_mut().random());
-
- // Works for f32 and f64.
- // FIXME: using host floats to work around https://github.com/rust-lang/miri/issues/2468.
- let ty::Float(float_ty) = dest.layout.ty.kind() else {
- span_bug!(this.cur_span(), "{} operand is not a float", intrinsic_name)
- };
- let val = match float_ty {
- FloatTy::F16 => unimplemented!("f16_f128"),
- FloatTy::F32 => {
- let a = a.to_f32()?;
- let b = b.to_f32()?;
- let c = c.to_f32()?;
- let res = if fuse {
- a.mul_add(b, c).value
- } else {
- ((a * b).value + c).value
- };
- let res = this.adjust_nan(res, &[a, b, c]);
- Scalar::from(res)
- }
- FloatTy::F64 => {
- let a = a.to_f64()?;
- let b = b.to_f64()?;
- let c = c.to_f64()?;
- let res = if fuse {
- a.mul_add(b, c).value
- } else {
- ((a * b).value + c).value
- };
- let res = this.adjust_nan(res, &[a, b, c]);
- Scalar::from(res)
- }
- FloatTy::F128 => unimplemented!("f16_f128"),
- };
- this.write_scalar(val, &dest)?;
- }
- }
"expose_provenance" => {
let [op] = check_intrinsic_arg_count(args)?;
let (op, op_len) = this.project_to_simd(op)?;
diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs
index 33f854b..27d461f 100644
--- a/src/tools/miri/src/machine.rs
+++ b/src/tools/miri/src/machine.rs
@@ -31,6 +31,7 @@
use rustc_span::{Span, SpanData, Symbol};
use rustc_symbol_mangling::mangle_internal_symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use crate::alloc_addresses::EvalContextExt;
use crate::concurrency::cpu_affinity::{self, CpuAffinityMask};
@@ -716,9 +717,9 @@ pub(crate) fn new(
page_size
} else {
let target = &tcx.sess.target;
- match target.arch.as_ref() {
- "wasm32" | "wasm64" => 64 * 1024, // https://webassembly.github.io/spec/core/exec/runtime.html#memory-instances
- "aarch64" => {
+ match target.arch {
+ Arch::Wasm32 | Arch::Wasm64 => 64 * 1024, // https://webassembly.github.io/spec/core/exec/runtime.html#memory-instances
+ Arch::AArch64 => {
if target.options.vendor.as_ref() == "apple" {
// No "definitive" source, but see:
// https://www.wwdcnotes.com/notes/wwdc20/10214/
@@ -1347,8 +1348,8 @@ fn equal_float_min_max<F: Float>(ecx: &MiriInterpCx<'tcx>, a: F, b: F) -> F {
}
#[inline(always)]
- fn float_fuse_mul_add(ecx: &mut InterpCx<'tcx, Self>) -> bool {
- ecx.machine.float_nondet && ecx.machine.rng.get_mut().random()
+ fn float_fuse_mul_add(ecx: &InterpCx<'tcx, Self>) -> bool {
+ ecx.machine.float_nondet && ecx.machine.rng.borrow_mut().random()
}
#[inline(always)]
diff --git a/src/tools/miri/src/shims/alloc.rs b/src/tools/miri/src/shims/alloc.rs
index f498a21..217069b 100644
--- a/src/tools/miri/src/shims/alloc.rs
+++ b/src/tools/miri/src/shims/alloc.rs
@@ -3,6 +3,7 @@
use rustc_middle::ty::Ty;
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use crate::*;
@@ -19,14 +20,41 @@ fn malloc_align(&self, size: u64) -> Align {
// `library/std/src/sys/alloc/mod.rs` (where this is called `MIN_ALIGN`) and should
// be kept in sync.
let os = this.tcx.sess.target.os.as_ref();
- let max_fundamental_align = match this.tcx.sess.target.arch.as_ref() {
- "riscv32" if matches!(os, "espidf" | "zkvm") => 4,
- "xtensa" if matches!(os, "espidf") => 4,
- "x86" | "arm" | "m68k" | "csky" | "loongarch32" | "mips" | "mips32r6" | "powerpc"
- | "powerpc64" | "sparc" | "wasm32" | "hexagon" | "riscv32" | "xtensa" => 8,
- "x86_64" | "aarch64" | "arm64ec" | "loongarch64" | "mips64" | "mips64r6" | "s390x"
- | "sparc64" | "riscv64" | "wasm64" => 16,
- arch => bug!("unsupported target architecture for malloc: `{}`", arch),
+ let max_fundamental_align = match &this.tcx.sess.target.arch {
+ Arch::RiscV32 if matches!(os, "espidf" | "zkvm") => 4,
+ Arch::Xtensa if matches!(os, "espidf") => 4,
+ Arch::X86
+ | Arch::Arm
+ | Arch::M68k
+ | Arch::CSky
+ | Arch::LoongArch32
+ | Arch::Mips
+ | Arch::Mips32r6
+ | Arch::PowerPC
+ | Arch::PowerPC64
+ | Arch::Sparc
+ | Arch::Wasm32
+ | Arch::Hexagon
+ | Arch::RiscV32
+ | Arch::Xtensa => 8,
+ Arch::X86_64
+ | Arch::AArch64
+ | Arch::Arm64EC
+ | Arch::LoongArch64
+ | Arch::Mips64
+ | Arch::Mips64r6
+ | Arch::S390x
+ | Arch::Sparc64
+ | Arch::RiscV64
+ | Arch::Wasm64 => 16,
+ arch @ (Arch::AmdGpu
+ | Arch::Avr
+ | Arch::Bpf
+ | Arch::Msp430
+ | Arch::Nvptx64
+ | Arch::PowerPC64LE
+ | Arch::SpirV
+ | Arch::Unknown(_)) => bug!("unsupported target architecture for malloc: `{arch}`"),
};
// The C standard only requires sufficient alignment for any *type* with size less than or
// equal to the size requested. Types one can define in standard C seem to never have an alignment
diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs
index 74a1ac7..2507e0f 100644
--- a/src/tools/miri/src/shims/foreign_items.rs
+++ b/src/tools/miri/src/shims/foreign_items.rs
@@ -15,6 +15,7 @@
use rustc_session::config::OomStrategy;
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use super::alloc::EvalContextExt as _;
use super::backtrace::EvalContextExt as _;
@@ -800,20 +801,24 @@ fn emulate_foreign_item_inner(
// Target-specific shims
name if name.starts_with("llvm.x86.")
- && (this.tcx.sess.target.arch == "x86"
- || this.tcx.sess.target.arch == "x86_64") =>
+ && matches!(
+ this.tcx.sess.target.arch,
+ Arch::X86 | Arch::X86_64
+ ) =>
{
return shims::x86::EvalContextExt::emulate_x86_intrinsic(
this, link_name, abi, args, dest,
);
}
- name if name.starts_with("llvm.aarch64.") && this.tcx.sess.target.arch == "aarch64" => {
+ name if name.starts_with("llvm.aarch64.")
+ && this.tcx.sess.target.arch == Arch::AArch64 =>
+ {
return shims::aarch64::EvalContextExt::emulate_aarch64_intrinsic(
this, link_name, abi, args, dest,
);
}
// FIXME: Move this to an `arm` submodule.
- "llvm.arm.hint" if this.tcx.sess.target.arch == "arm" => {
+ "llvm.arm.hint" if this.tcx.sess.target.arch == Arch::Arm => {
let [arg] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
let arg = this.read_scalar(arg)?.to_i32()?;
// Note that different arguments might have different target feature requirements.
diff --git a/src/tools/miri/src/shims/windows/foreign_items.rs b/src/tools/miri/src/shims/windows/foreign_items.rs
index c3ca01b..21c9022 100644
--- a/src/tools/miri/src/shims/windows/foreign_items.rs
+++ b/src/tools/miri/src/shims/windows/foreign_items.rs
@@ -6,6 +6,7 @@
use rustc_middle::ty::Ty;
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use self::shims::windows::handle::{Handle, PseudoHandle};
use crate::shims::os_str::bytes_to_os_str;
@@ -140,7 +141,7 @@ fn emulate_foreign_item_inner(
// https://github.com/rust-lang/rust/blob/fb00adbdb69266f10df95a4527b767b0ad35ea48/compiler/rustc_target/src/spec/mod.rs#L2766-L2768,
// x86-32 Windows uses a different calling convention than other Windows targets
// for the "system" ABI.
- let sys_conv = if this.tcx.sess.target.arch == "x86" {
+ let sys_conv = if this.tcx.sess.target.arch == Arch::X86 {
CanonAbi::X86(X86Call::Stdcall)
} else {
CanonAbi::C
diff --git a/src/tools/miri/src/shims/x86/bmi.rs b/src/tools/miri/src/shims/x86/bmi.rs
index 140e31c..814823d 100644
--- a/src/tools/miri/src/shims/x86/bmi.rs
+++ b/src/tools/miri/src/shims/x86/bmi.rs
@@ -2,6 +2,7 @@
use rustc_middle::ty::Ty;
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use crate::*;
@@ -31,7 +32,7 @@ fn emulate_x86_bmi_intrinsic(
let target_feature = if unprefixed_name == "bextr" { "bmi1" } else { "bmi2" };
this.expect_target_feature_for_intrinsic(link_name, target_feature)?;
- if is_64_bit && this.tcx.sess.target.arch != "x86_64" {
+ if is_64_bit && this.tcx.sess.target.arch != Arch::X86_64 {
return interp_ok(EmulateItemResult::NotSupported);
}
diff --git a/src/tools/miri/src/shims/x86/mod.rs b/src/tools/miri/src/shims/x86/mod.rs
index 3324b7b..016cb76 100644
--- a/src/tools/miri/src/shims/x86/mod.rs
+++ b/src/tools/miri/src/shims/x86/mod.rs
@@ -5,6 +5,7 @@
use rustc_middle::{mir, ty};
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use self::helpers::bool_to_simd_element;
use crate::*;
@@ -41,7 +42,9 @@ fn emulate_x86_intrinsic(
// https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/addcarry-u32-addcarry-u64.html
// https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/subborrow-u32-subborrow-u64.html
"addcarry.32" | "addcarry.64" | "subborrow.32" | "subborrow.64" => {
- if unprefixed_name.ends_with("64") && this.tcx.sess.target.arch != "x86_64" {
+ if unprefixed_name.ends_with("64")
+ && this.tcx.sess.target.arch != Arch::X86_64
+ {
return interp_ok(EmulateItemResult::NotSupported);
}
@@ -65,7 +68,7 @@ fn emulate_x86_intrinsic(
this.expect_target_feature_for_intrinsic(link_name, "adx")?;
let is_u64 = unprefixed_name.ends_with("64");
- if is_u64 && this.tcx.sess.target.arch != "x86_64" {
+ if is_u64 && this.tcx.sess.target.arch != Arch::X86_64 {
return interp_ok(EmulateItemResult::NotSupported);
}
let [c_in, a, b, out] =
diff --git a/src/tools/miri/src/shims/x86/sse42.rs b/src/tools/miri/src/shims/x86/sse42.rs
index 72c5039..aa8aea3 100644
--- a/src/tools/miri/src/shims/x86/sse42.rs
+++ b/src/tools/miri/src/shims/x86/sse42.rs
@@ -3,6 +3,7 @@
use rustc_middle::ty::Ty;
use rustc_span::Symbol;
use rustc_target::callconv::FnAbi;
+use rustc_target::spec::Arch;
use crate::*;
@@ -431,7 +432,7 @@ fn emulate_x86_sse42_intrinsic(
_ => unreachable!(),
};
- if bit_size == 64 && this.tcx.sess.target.arch != "x86_64" {
+ if bit_size == 64 && this.tcx.sess.target.arch != Arch::X86_64 {
return interp_ok(EmulateItemResult::NotSupported);
}
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.rs b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.rs
new file mode 100644
index 0000000..3b5e389
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics, portable_simd)]
+
+use std::intrinsics::simd::*;
+use std::simd::*;
+
+fn main() {
+ unsafe {
+ let buf = [0u32; 5];
+ //~v ERROR: accessing memory with alignment
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ i32x4::splat(-1),
+ // This is not i32-aligned
+ buf.as_ptr().byte_offset(1),
+ i32x4::splat(0),
+ );
+ }
+}
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.stderr b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.stderr
new file mode 100644
index 0000000..155097cb
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_element_misaligned.stderr
@@ -0,0 +1,18 @@
+error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
+ --> tests/fail/intrinsics/simd_masked_load_element_misaligned.rs:LL:CC
+ |
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+LL | | i32x4::splat(-1),
+LL | | // This is not i32-aligned
+LL | | buf.as_ptr().byte_offset(1),
+LL | | i32x4::splat(0),
+LL | | );
+ | |_________^ Undefined Behavior occurred here
+ |
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
+
+note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
+
+error: aborting due to 1 previous error
+
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.rs b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.rs
new file mode 100644
index 0000000..9b1eeaa
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics, portable_simd)]
+
+use std::intrinsics::simd::*;
+use std::simd::*;
+
+fn main() {
+ unsafe {
+ let buf = Simd::<i32, 8>::splat(0);
+ //~v ERROR: accessing memory with alignment
+ simd_masked_load::<_, _, _, { SimdAlign::Vector }>(
+ i32x4::splat(-1),
+ // This is i32-aligned but not i32x4-aligned.
+ buf.as_array()[1..].as_ptr(),
+ i32x4::splat(0),
+ );
+ }
+}
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.stderr b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.stderr
new file mode 100644
index 0000000..8dfd1c1
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_load_vector_misaligned.stderr
@@ -0,0 +1,18 @@
+error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
+ --> tests/fail/intrinsics/simd_masked_load_vector_misaligned.rs:LL:CC
+ |
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Vector }>(
+LL | | i32x4::splat(-1),
+LL | | // This is i32-aligned but not i32x4-aligned.
+LL | | buf.as_array()[1..].as_ptr(),
+LL | | i32x4::splat(0),
+LL | | );
+ | |_________^ Undefined Behavior occurred here
+ |
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
+
+note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
+
+error: aborting due to 1 previous error
+
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.rs b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.rs
new file mode 100644
index 0000000..b7e23dd
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics, portable_simd)]
+
+use std::intrinsics::simd::*;
+use std::simd::*;
+
+fn main() {
+ unsafe {
+ let mut buf = [0u32; 5];
+ //~v ERROR: accessing memory with alignment
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ i32x4::splat(-1),
+ // This is not i32-aligned
+ buf.as_mut_ptr().byte_offset(1),
+ i32x4::splat(0),
+ );
+ }
+}
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.stderr b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.stderr
new file mode 100644
index 0000000..7b2ebaa
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_element_misaligned.stderr
@@ -0,0 +1,18 @@
+error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
+ --> tests/fail/intrinsics/simd_masked_store_element_misaligned.rs:LL:CC
+ |
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+LL | | i32x4::splat(-1),
+LL | | // This is not i32-aligned
+LL | | buf.as_mut_ptr().byte_offset(1),
+LL | | i32x4::splat(0),
+LL | | );
+ | |_________^ Undefined Behavior occurred here
+ |
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
+
+note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
+
+error: aborting due to 1 previous error
+
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.rs b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.rs
new file mode 100644
index 0000000..8982413
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics, portable_simd)]
+
+use std::intrinsics::simd::*;
+use std::simd::*;
+
+fn main() {
+ unsafe {
+ let mut buf = Simd::<i32, 8>::splat(0);
+ //~v ERROR: accessing memory with alignment
+ simd_masked_store::<_, _, _, { SimdAlign::Vector }>(
+ i32x4::splat(-1),
+ // This is i32-aligned but not i32x4-aligned.
+ buf.as_mut_array()[1..].as_mut_ptr(),
+ i32x4::splat(0),
+ );
+ }
+}
diff --git a/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.stderr b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.stderr
new file mode 100644
index 0000000..7f34e0d
--- /dev/null
+++ b/src/tools/miri/tests/fail/intrinsics/simd_masked_store_vector_misaligned.stderr
@@ -0,0 +1,18 @@
+error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
+ --> tests/fail/intrinsics/simd_masked_store_vector_misaligned.rs:LL:CC
+ |
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Vector }>(
+LL | | i32x4::splat(-1),
+LL | | // This is i32-aligned but not i32x4-aligned.
+LL | | buf.as_mut_array()[1..].as_mut_ptr(),
+LL | | i32x4::splat(0),
+LL | | );
+ | |_________^ Undefined Behavior occurred here
+ |
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
+
+note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
+
+error: aborting due to 1 previous error
+
diff --git a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs
index e2cd087..4ecbe16 100644
--- a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs
+++ b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs
@@ -6,18 +6,143 @@
rustc_attrs,
intrinsics,
core_intrinsics,
- repr_simd
+ repr_simd,
+ f16,
+ f128
)]
-#![allow(incomplete_features, internal_features)]
+#![allow(incomplete_features, internal_features, non_camel_case_types)]
+use std::fmt::{self, Debug, Formatter};
use std::intrinsics::simd as intrinsics;
use std::ptr;
use std::simd::StdFloat;
use std::simd::prelude::*;
+#[repr(simd, packed)]
+#[derive(Copy)]
+struct PackedSimd<T, const N: usize>([T; N]);
+
+impl<T: Copy, const N: usize> Clone for PackedSimd<T, N> {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+impl<T: PartialEq + Copy, const N: usize> PartialEq for PackedSimd<T, N> {
+ fn eq(&self, other: &Self) -> bool {
+ self.into_array() == other.into_array()
+ }
+}
+
+impl<T: Debug + Copy, const N: usize> Debug for PackedSimd<T, N> {
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ Debug::fmt(&self.into_array(), f)
+ }
+}
+
+type f16x2 = PackedSimd<f16, 2>;
+type f16x4 = PackedSimd<f16, 4>;
+
+type f128x2 = PackedSimd<f128, 2>;
+type f128x4 = PackedSimd<f128, 4>;
+
+impl<T: Copy, const N: usize> PackedSimd<T, N> {
+ fn splat(x: T) -> Self {
+ Self([x; N])
+ }
+ fn from_array(a: [T; N]) -> Self {
+ Self(a)
+ }
+ fn into_array(self) -> [T; N] {
+ // as we have `repr(packed)`, there shouldn't be any padding bytes
+ unsafe { std::mem::transmute_copy(&self) }
+ }
+}
+
#[rustc_intrinsic]
#[rustc_nounwind]
pub unsafe fn simd_shuffle_const_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
+pub fn simd_ops_f16() {
+ use intrinsics::*;
+
+ // small hack to make type inference better
+ macro_rules! assert_eq {
+ ($a:expr, $b:expr $(,$t:tt)*) => {{
+ let a = $a;
+ let b = $b;
+ if false { let _inference = b == a; }
+ ::std::assert_eq!(a, b, $(,$t)*)
+ }}
+ }
+
+ let a = f16x4::splat(10.0);
+ let b = f16x4::from_array([1.0, 2.0, 3.0, -4.0]);
+
+ unsafe {
+ assert_eq!(simd_neg(b), f16x4::from_array([-1.0, -2.0, -3.0, 4.0]));
+ assert_eq!(simd_add(a, b), f16x4::from_array([11.0, 12.0, 13.0, 6.0]));
+ assert_eq!(simd_sub(a, b), f16x4::from_array([9.0, 8.0, 7.0, 14.0]));
+ assert_eq!(simd_mul(a, b), f16x4::from_array([10.0, 20.0, 30.0, -40.0]));
+ assert_eq!(simd_div(b, a), f16x4::from_array([0.1, 0.2, 0.3, -0.4]));
+ assert_eq!(simd_div(a, f16x4::splat(2.0)), f16x4::splat(5.0));
+ assert_eq!(simd_rem(a, b), f16x4::from_array([0.0, 0.0, 1.0, 2.0]));
+ assert_eq!(simd_fabs(b), f16x4::from_array([1.0, 2.0, 3.0, 4.0]));
+ assert_eq!(
+ simd_fmax(a, simd_mul(b, f16x4::splat(4.0))),
+ f16x4::from_array([10.0, 10.0, 12.0, 10.0])
+ );
+ assert_eq!(
+ simd_fmin(a, simd_mul(b, f16x4::splat(4.0))),
+ f16x4::from_array([4.0, 8.0, 10.0, -16.0])
+ );
+
+ assert_eq!(simd_fma(a, b, a), simd_add(simd_mul(a, b), a));
+ assert_eq!(simd_fma(b, b, a), simd_add(simd_mul(b, b), a));
+ assert_eq!(simd_fma(a, b, b), simd_add(simd_mul(a, b), b));
+ assert_eq!(
+ simd_fma(f16x4::splat(-3.2), b, f16x4::splat(f16::NEG_INFINITY)),
+ f16x4::splat(f16::NEG_INFINITY)
+ );
+
+ assert_eq!(simd_relaxed_fma(a, b, a), simd_add(simd_mul(a, b), a));
+ assert_eq!(simd_relaxed_fma(b, b, a), simd_add(simd_mul(b, b), a));
+ assert_eq!(simd_relaxed_fma(a, b, b), simd_add(simd_mul(a, b), b));
+ assert_eq!(
+ simd_relaxed_fma(f16x4::splat(-3.2), b, f16x4::splat(f16::NEG_INFINITY)),
+ f16x4::splat(f16::NEG_INFINITY)
+ );
+
+ assert_eq!(simd_eq(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, !0, 0, 0]));
+ assert_eq!(simd_ne(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, 0, !0, !0]));
+ assert_eq!(simd_le(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, !0, !0, 0]));
+ assert_eq!(simd_lt(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, 0, !0, 0]));
+ assert_eq!(simd_ge(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, !0, 0, !0]));
+ assert_eq!(simd_gt(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, 0, 0, !0]));
+
+ assert_eq!(simd_reduce_add_ordered(a, 0.0), 40.0f16);
+ assert_eq!(simd_reduce_add_ordered(b, 0.0), 2.0f16);
+ assert_eq!(simd_reduce_mul_ordered(a, 1.0), 10000.0f16);
+ assert_eq!(simd_reduce_mul_ordered(b, 1.0), -24.0f16);
+ assert_eq!(simd_reduce_max(a), 10.0f16);
+ assert_eq!(simd_reduce_max(b), 3.0f16);
+ assert_eq!(simd_reduce_min(a), 10.0f16);
+ assert_eq!(simd_reduce_min(b), -4.0f16);
+
+ assert_eq!(
+ simd_fmax(f16x2::from_array([0.0, f16::NAN]), f16x2::from_array([f16::NAN, 0.0])),
+ f16x2::from_array([0.0, 0.0])
+ );
+ assert_eq!(simd_reduce_max(f16x2::from_array([0.0, f16::NAN])), 0.0f16);
+ assert_eq!(simd_reduce_max(f16x2::from_array([f16::NAN, 0.0])), 0.0f16);
+ assert_eq!(
+ simd_fmin(f16x2::from_array([0.0, f16::NAN]), f16x2::from_array([f16::NAN, 0.0])),
+ f16x2::from_array([0.0, 0.0])
+ );
+ assert_eq!(simd_reduce_min(f16x2::from_array([0.0, f16::NAN])), 0.0f16);
+ assert_eq!(simd_reduce_min(f16x2::from_array([f16::NAN, 0.0])), 0.0f16);
+ }
+}
+
fn simd_ops_f32() {
let a = f32x4::splat(10.0);
let b = f32x4::from_array([1.0, 2.0, 3.0, -4.0]);
@@ -148,6 +273,87 @@ fn simd_ops_f64() {
assert_eq!(f64x2::from_array([f64::NAN, 0.0]).reduce_min(), 0.0);
}
+pub fn simd_ops_f128() {
+ use intrinsics::*;
+
+ // small hack to make type inference better
+ macro_rules! assert_eq {
+ ($a:expr, $b:expr $(,$t:tt)*) => {{
+ let a = $a;
+ let b = $b;
+ if false { let _inference = b == a; }
+ ::std::assert_eq!(a, b, $(,$t)*)
+ }}
+ }
+
+ let a = f128x4::splat(10.0);
+ let b = f128x4::from_array([1.0, 2.0, 3.0, -4.0]);
+
+ unsafe {
+ assert_eq!(simd_neg(b), f128x4::from_array([-1.0, -2.0, -3.0, 4.0]));
+ assert_eq!(simd_add(a, b), f128x4::from_array([11.0, 12.0, 13.0, 6.0]));
+ assert_eq!(simd_sub(a, b), f128x4::from_array([9.0, 8.0, 7.0, 14.0]));
+ assert_eq!(simd_mul(a, b), f128x4::from_array([10.0, 20.0, 30.0, -40.0]));
+ assert_eq!(simd_div(b, a), f128x4::from_array([0.1, 0.2, 0.3, -0.4]));
+ assert_eq!(simd_div(a, f128x4::splat(2.0)), f128x4::splat(5.0));
+ assert_eq!(simd_rem(a, b), f128x4::from_array([0.0, 0.0, 1.0, 2.0]));
+ assert_eq!(simd_fabs(b), f128x4::from_array([1.0, 2.0, 3.0, 4.0]));
+ assert_eq!(
+ simd_fmax(a, simd_mul(b, f128x4::splat(4.0))),
+ f128x4::from_array([10.0, 10.0, 12.0, 10.0])
+ );
+ assert_eq!(
+ simd_fmin(a, simd_mul(b, f128x4::splat(4.0))),
+ f128x4::from_array([4.0, 8.0, 10.0, -16.0])
+ );
+
+ assert_eq!(simd_fma(a, b, a), simd_add(simd_mul(a, b), a));
+ assert_eq!(simd_fma(b, b, a), simd_add(simd_mul(b, b), a));
+ assert_eq!(simd_fma(a, b, b), simd_add(simd_mul(a, b), b));
+ assert_eq!(
+ simd_fma(f128x4::splat(-3.2), b, f128x4::splat(f128::NEG_INFINITY)),
+ f128x4::splat(f128::NEG_INFINITY)
+ );
+
+ assert_eq!(simd_relaxed_fma(a, b, a), simd_add(simd_mul(a, b), a));
+ assert_eq!(simd_relaxed_fma(b, b, a), simd_add(simd_mul(b, b), a));
+ assert_eq!(simd_relaxed_fma(a, b, b), simd_add(simd_mul(a, b), b));
+ assert_eq!(
+ simd_relaxed_fma(f128x4::splat(-3.2), b, f128x4::splat(f128::NEG_INFINITY)),
+ f128x4::splat(f128::NEG_INFINITY)
+ );
+
+ assert_eq!(simd_eq(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([0, !0, 0, 0]));
+ assert_eq!(simd_ne(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([!0, 0, !0, !0]));
+ assert_eq!(simd_le(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([0, !0, !0, 0]));
+ assert_eq!(simd_lt(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([0, 0, !0, 0]));
+ assert_eq!(simd_ge(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([!0, !0, 0, !0]));
+ assert_eq!(simd_gt(a, simd_mul(f128x4::splat(5.0), b)), i32x4::from_array([!0, 0, 0, !0]));
+
+ assert_eq!(simd_reduce_add_ordered(a, 0.0), 40.0f128);
+ assert_eq!(simd_reduce_add_ordered(b, 0.0), 2.0f128);
+ assert_eq!(simd_reduce_mul_ordered(a, 1.0), 10000.0f128);
+ assert_eq!(simd_reduce_mul_ordered(b, 1.0), -24.0f128);
+ assert_eq!(simd_reduce_max(a), 10.0f128);
+ assert_eq!(simd_reduce_max(b), 3.0f128);
+ assert_eq!(simd_reduce_min(a), 10.0f128);
+ assert_eq!(simd_reduce_min(b), -4.0f128);
+
+ assert_eq!(
+ simd_fmax(f128x2::from_array([0.0, f128::NAN]), f128x2::from_array([f128::NAN, 0.0])),
+ f128x2::from_array([0.0, 0.0])
+ );
+ assert_eq!(simd_reduce_max(f128x2::from_array([0.0, f128::NAN])), 0.0f128);
+ assert_eq!(simd_reduce_max(f128x2::from_array([f128::NAN, 0.0])), 0.0f128);
+ assert_eq!(
+ simd_fmin(f128x2::from_array([0.0, f128::NAN]), f128x2::from_array([f128::NAN, 0.0])),
+ f128x2::from_array([0.0, 0.0])
+ );
+ assert_eq!(simd_reduce_min(f128x2::from_array([0.0, f128::NAN])), 0.0f128);
+ assert_eq!(simd_reduce_min(f128x2::from_array([f128::NAN, 0.0])), 0.0f128);
+ }
+}
+
fn simd_ops_i32() {
let a = i32x4::splat(10);
let b = i32x4::from_array([1, 2, 3, -4]);
@@ -563,6 +769,31 @@ fn simd_gather_scatter() {
}
fn simd_round() {
+ unsafe {
+ use intrinsics::*;
+
+ assert_eq!(
+ simd_ceil(f16x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f16x4::from_array([1.0, 2.0, 2.0, -4.0])
+ );
+ assert_eq!(
+ simd_floor(f16x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f16x4::from_array([0.0, 1.0, 2.0, -5.0])
+ );
+ assert_eq!(
+ simd_round(f16x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f16x4::from_array([1.0, 1.0, 2.0, -5.0])
+ );
+ assert_eq!(
+ simd_round_ties_even(f16x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f16x4::from_array([1.0, 1.0, 2.0, -4.0])
+ );
+ assert_eq!(
+ simd_trunc(f16x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f16x4::from_array([0.0, 1.0, 2.0, -4.0])
+ );
+ }
+
assert_eq!(
f32x4::from_array([0.9, 1.001, 2.0, -4.5]).ceil(),
f32x4::from_array([1.0, 2.0, 2.0, -4.0])
@@ -604,6 +835,31 @@ fn simd_round() {
f64x4::from_array([0.9, 1.001, 2.0, -4.5]).trunc(),
f64x4::from_array([0.0, 1.0, 2.0, -4.0])
);
+
+ unsafe {
+ use intrinsics::*;
+
+ assert_eq!(
+ simd_ceil(f128x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f128x4::from_array([1.0, 2.0, 2.0, -4.0])
+ );
+ assert_eq!(
+ simd_floor(f128x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f128x4::from_array([0.0, 1.0, 2.0, -5.0])
+ );
+ assert_eq!(
+ simd_round(f128x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f128x4::from_array([1.0, 1.0, 2.0, -5.0])
+ );
+ assert_eq!(
+ simd_round_ties_even(f128x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f128x4::from_array([1.0, 1.0, 2.0, -4.0])
+ );
+ assert_eq!(
+ simd_trunc(f128x4::from_array([0.9, 1.001, 2.0, -4.5])),
+ f128x4::from_array([0.0, 1.0, 2.0, -4.0])
+ );
+ }
}
fn simd_intrinsics() {
@@ -680,26 +936,93 @@ fn simd_float_intrinsics() {
}
fn simd_masked_loadstore() {
+ use intrinsics::*;
+
// The buffer is deliberarely too short, so reading the last element would be UB.
let buf = [3i32; 3];
let default = i32x4::splat(0);
let mask = i32x4::from_array([!0, !0, !0, 0]);
- let vals = unsafe { intrinsics::simd_masked_load(mask, buf.as_ptr(), default) };
+ let vals =
+ unsafe { simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, buf.as_ptr(), default) };
assert_eq!(vals, i32x4::from_array([3, 3, 3, 0]));
// Also read in a way that the *first* element is OOB.
let mask2 = i32x4::from_array([0, !0, !0, !0]);
- let vals =
- unsafe { intrinsics::simd_masked_load(mask2, buf.as_ptr().wrapping_sub(1), default) };
+ let vals = unsafe {
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ mask2,
+ buf.as_ptr().wrapping_sub(1),
+ default,
+ )
+ };
assert_eq!(vals, i32x4::from_array([0, 3, 3, 3]));
// The buffer is deliberarely too short, so writing the last element would be UB.
let mut buf = [42i32; 3];
let vals = i32x4::from_array([1, 2, 3, 4]);
- unsafe { intrinsics::simd_masked_store(mask, buf.as_mut_ptr(), vals) };
+ unsafe { simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, buf.as_mut_ptr(), vals) };
assert_eq!(buf, [1, 2, 3]);
// Also write in a way that the *first* element is OOB.
- unsafe { intrinsics::simd_masked_store(mask2, buf.as_mut_ptr().wrapping_sub(1), vals) };
+ unsafe {
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ mask2,
+ buf.as_mut_ptr().wrapping_sub(1),
+ vals,
+ )
+ };
assert_eq!(buf, [2, 3, 4]);
+
+ // we use a purposely misaliged buffer to make sure Miri doesn't error in this case
+ let buf = [0x03030303_i32; 5];
+ let default = i32x4::splat(0);
+ let mask = i32x4::splat(!0);
+ let vals = unsafe {
+ simd_masked_load::<_, _, _, { SimdAlign::Unaligned }>(
+ mask,
+ buf.as_ptr().byte_offset(1), // this is guaranteed to be unaligned
+ default,
+ )
+ };
+ assert_eq!(vals, i32x4::splat(0x03030303));
+
+ let mut buf = [0i32; 5];
+ let mask = i32x4::splat(!0);
+ unsafe {
+ simd_masked_store::<_, _, _, { SimdAlign::Unaligned }>(
+ mask,
+ buf.as_mut_ptr().byte_offset(1), // this is guaranteed to be unaligned
+ vals,
+ )
+ };
+ assert_eq!(
+ buf,
+ [
+ i32::from_ne_bytes([0, 3, 3, 3]),
+ 0x03030303,
+ 0x03030303,
+ 0x03030303,
+ i32::from_ne_bytes([3, 0, 0, 0])
+ ]
+ );
+
+ // `repr(simd)` types like `Simd<T, N>` have the correct alignment for vectors
+ let buf = i32x4::splat(3);
+ let default = i32x4::splat(0);
+ let mask = i32x4::splat(!0);
+ let vals = unsafe {
+ simd_masked_load::<_, _, _, { SimdAlign::Vector }>(
+ mask,
+ &raw const buf as *const i32,
+ default,
+ )
+ };
+ assert_eq!(vals, buf);
+
+ let mut buf = i32x4::splat(0);
+ let mask = i32x4::splat(!0);
+ unsafe {
+ simd_masked_store::<_, _, _, { SimdAlign::Vector }>(mask, &raw mut buf as *mut i32, vals)
+ };
+ assert_eq!(buf, vals);
}
fn simd_ops_non_pow2() {
@@ -724,8 +1047,10 @@ fn simd_ops_non_pow2() {
fn main() {
simd_mask();
+ simd_ops_f16();
simd_ops_f32();
simd_ops_f64();
+ simd_ops_f128();
simd_ops_i32();
simd_ops_non_pow2();
simd_cast();
diff --git a/src/tools/rust-analyzer/.typos.toml b/src/tools/rust-analyzer/.typos.toml
index 9946415..e954b08 100644
--- a/src/tools/rust-analyzer/.typos.toml
+++ b/src/tools/rust-analyzer/.typos.toml
@@ -33,6 +33,7 @@
thir = "thir"
jod = "jod"
tructure = "tructure"
+taits = "taits"
[default.extend-identifiers]
anc = "anc"
diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock
index 535833d..12b5f8a 100644
--- a/src/tools/rust-analyzer/Cargo.lock
+++ b/src/tools/rust-analyzer/Cargo.lock
@@ -419,6 +419,22 @@
]
[[package]]
+name = "dhat"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98cd11d84628e233de0ce467de10b8633f4ddaecafadefc86e13b84b8739b827"
+dependencies = [
+ "backtrace",
+ "lazy_static",
+ "mintex",
+ "parking_lot",
+ "rustc-hash 1.1.0",
+ "serde",
+ "serde_json",
+ "thousands",
+]
+
+[[package]]
name = "dirs"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1384,6 +1400,12 @@
]
[[package]]
+name = "mintex"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c505b3e17ed6b70a7ed2e67fbb2c560ee327353556120d6e72f5232b6880d536"
+
+[[package]]
name = "mio"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1452,7 +1474,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.0",
]
[[package]]
@@ -2011,6 +2033,7 @@
"cargo_metadata 0.21.0",
"cfg",
"crossbeam-channel",
+ "dhat",
"dirs",
"dissimilar",
"expect-test",
@@ -2047,6 +2070,7 @@
"serde",
"serde_derive",
"serde_json",
+ "smallvec",
"stdx",
"syntax",
"syntax-bridge",
@@ -2529,6 +2553,12 @@
]
[[package]]
+name = "thousands"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
+
+[[package]]
name = "thread_local"
version = "1.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs b/src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs
index 454e063..db50e65 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs
@@ -370,18 +370,13 @@ fn lower_visibility(&mut self, item: &dyn ast::HasVisibility) -> RawVisibilityId
});
match &vis {
RawVisibility::Public => RawVisibilityId::PUB,
- RawVisibility::Module(path, explicitness) if path.segments().is_empty() => {
- match (path.kind, explicitness) {
- (PathKind::SELF, VisibilityExplicitness::Explicit) => {
- RawVisibilityId::PRIV_EXPLICIT
- }
- (PathKind::SELF, VisibilityExplicitness::Implicit) => {
- RawVisibilityId::PRIV_IMPLICIT
- }
- (PathKind::Crate, _) => RawVisibilityId::PUB_CRATE,
- _ => RawVisibilityId(self.visibilities.insert_full(vis).0 as u32),
- }
+ RawVisibility::PubSelf(VisibilityExplicitness::Explicit) => {
+ RawVisibilityId::PRIV_EXPLICIT
}
+ RawVisibility::PubSelf(VisibilityExplicitness::Implicit) => {
+ RawVisibilityId::PRIV_IMPLICIT
+ }
+ RawVisibility::PubCrate => RawVisibilityId::PUB_CRATE,
_ => RawVisibilityId(self.visibilities.insert_full(vis).0 as u32),
}
}
@@ -466,10 +461,7 @@ pub(crate) fn lower_use_tree(
}
fn private_vis() -> RawVisibility {
- RawVisibility::Module(
- Interned::new(ModPath::from_kind(PathKind::SELF)),
- VisibilityExplicitness::Implicit,
- )
+ RawVisibility::PubSelf(VisibilityExplicitness::Implicit)
}
pub(crate) fn visibility_from_ast(
@@ -486,9 +478,11 @@ pub(crate) fn visibility_from_ast(
Some(path) => path,
}
}
- ast::VisibilityKind::PubCrate => ModPath::from_kind(PathKind::Crate),
+ ast::VisibilityKind::PubCrate => return RawVisibility::PubCrate,
ast::VisibilityKind::PubSuper => ModPath::from_kind(PathKind::Super(1)),
- ast::VisibilityKind::PubSelf => ModPath::from_kind(PathKind::SELF),
+ ast::VisibilityKind::PubSelf => {
+ return RawVisibility::PubSelf(VisibilityExplicitness::Explicit);
+ }
ast::VisibilityKind::Pub => return RawVisibility::Public,
};
RawVisibility::Module(Interned::new(path), VisibilityExplicitness::Explicit)
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/meta_syntax.rs b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/meta_syntax.rs
index 9997455..311fdc3 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/meta_syntax.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mbe/meta_syntax.rs
@@ -98,7 +98,7 @@ macro_rules! m2 { () => ( ${invalid()} ) }
#[test]
fn test_rustc_issue_57597() {
- // <https://github.com/rust-lang/rust/blob/HEAD/tests/ui/issues/issue-57597.rs>
+ // <https://github.com/rust-lang/rust/blob/ec2cc76/tests/ui/macros/issue-57597.rs>
check(
r#"
macro_rules! m0 { ($($($i:ident)?)+) => {}; }
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/resolver.rs b/src/tools/rust-analyzer/crates/hir-def/src/resolver.rs
index 698292c..abcf0a3 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/resolver.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/resolver.rs
@@ -1075,7 +1075,9 @@ fn resolver_for_scope_<'db>(
if let Some(block) = scopes.block(scope) {
let def_map = block_def_map(db, block);
let local_def_map = block.lookup(db).module.only_local_def_map(db);
- r = r.push_block_scope(def_map, local_def_map);
+ // Using `DefMap::ROOT` is okay here since inside modules other than the root,
+ // there can't directly be expressions.
+ r = r.push_block_scope(def_map, local_def_map, DefMap::ROOT);
// FIXME: This adds as many module scopes as there are blocks, but resolving in each
// already traverses all parents, so this is O(n²). I think we could only store the
// innermost module scope instead?
@@ -1108,12 +1110,9 @@ fn push_block_scope(
self,
def_map: &'db DefMap,
local_def_map: &'db LocalDefMap,
+ module_id: LocalModuleId,
) -> Resolver<'db> {
- self.push_scope(Scope::BlockScope(ModuleItemMap {
- def_map,
- local_def_map,
- module_id: DefMap::ROOT,
- }))
+ self.push_scope(Scope::BlockScope(ModuleItemMap { def_map, local_def_map, module_id }))
}
fn push_expr_scope(
@@ -1273,7 +1272,7 @@ fn resolver(self, db: &dyn DefDatabase) -> Resolver<'_> {
let (mut def_map, local_def_map) = self.local_def_map(db);
let mut module_id = self.local_id;
- if !self.is_block_module() {
+ if !self.is_within_block() {
return Resolver {
scopes: vec![],
module_scope: ModuleItemMap { def_map, local_def_map, module_id },
@@ -1283,9 +1282,9 @@ fn resolver(self, db: &dyn DefDatabase) -> Resolver<'_> {
let mut modules: SmallVec<[_; 1]> = smallvec![];
while let Some(parent) = def_map.parent() {
let block_def_map = mem::replace(&mut def_map, parent.def_map(db));
- modules.push(block_def_map);
- if !parent.is_block_module() {
- module_id = parent.local_id;
+ let block_module_id = mem::replace(&mut module_id, parent.local_id);
+ modules.push((block_def_map, block_module_id));
+ if !parent.is_within_block() {
break;
}
}
@@ -1293,8 +1292,8 @@ fn resolver(self, db: &dyn DefDatabase) -> Resolver<'_> {
scopes: Vec::with_capacity(modules.len()),
module_scope: ModuleItemMap { def_map, local_def_map, module_id },
};
- for def_map in modules.into_iter().rev() {
- resolver = resolver.push_block_scope(def_map, local_def_map);
+ for (def_map, module_id) in modules.into_iter().rev() {
+ resolver = resolver.push_block_scope(def_map, local_def_map, module_id);
}
resolver
}
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/visibility.rs b/src/tools/rust-analyzer/crates/hir-def/src/visibility.rs
index b5eb84c..948f6ed 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/visibility.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/visibility.rs
@@ -289,18 +289,21 @@ pub(crate) fn field_visibilities_query(
pub fn visibility_from_ast(
db: &dyn DefDatabase,
- has_resolver: impl HasResolver,
+ has_resolver: impl HasResolver + HasModule,
ast_vis: InFile<Option<ast::Visibility>>,
) -> Visibility {
let mut span_map = None;
let raw_vis = crate::item_tree::visibility_from_ast(db, ast_vis.value, &mut |range| {
span_map.get_or_insert_with(|| db.span_map(ast_vis.file_id)).span_for_range(range).ctx
});
- if raw_vis == RawVisibility::Public {
- return Visibility::Public;
+ match raw_vis {
+ RawVisibility::PubSelf(explicitness) => {
+ Visibility::Module(has_resolver.module(db), explicitness)
+ }
+ RawVisibility::PubCrate => Visibility::PubCrate(has_resolver.krate(db)),
+ RawVisibility::Public => Visibility::Public,
+ RawVisibility::Module(..) => Visibility::resolve(db, &has_resolver.resolver(db), &raw_vis),
}
-
- Visibility::resolve(db, &has_resolver.resolver(db), &raw_vis)
}
/// Resolve visibility of a type alias.
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs
index 6dd3cdb..392b0b0 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs
@@ -38,7 +38,7 @@ pub fn autoderef<'db>(
env: Arc<TraitEnvironment<'db>>,
ty: Canonical<'db, Ty<'db>>,
) -> impl Iterator<Item = Ty<'db>> + use<'db> {
- let mut table = InferenceTable::new(db, env);
+ let mut table = InferenceTable::new(db, env, None);
let ty = table.instantiate_canonical(ty);
let mut autoderef = Autoderef::new_no_tracking(&mut table, ty);
let mut v = Vec::new();
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
index dd1b212..0a37966 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
@@ -2078,9 +2078,10 @@ pub fn write_visibility<'db>(
if vis_id == module_id {
// pub(self) or omitted
Ok(())
- } else if root_module_id == vis_id {
+ } else if root_module_id == vis_id && !root_module_id.is_within_block() {
write!(f, "pub(crate) ")
- } else if module_id.containing_module(f.db) == Some(vis_id) {
+ } else if module_id.containing_module(f.db) == Some(vis_id) && !vis_id.is_block_module()
+ {
write!(f, "pub(super) ")
} else {
write!(f, "pub(in ...) ")
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs
index 361e665..016edb2 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs
@@ -21,6 +21,7 @@
mod expr;
mod fallback;
mod mutability;
+mod opaques;
mod pat;
mod path;
pub(crate) mod unify;
@@ -31,8 +32,7 @@
use either::Either;
use hir_def::{
AdtId, AssocItemId, ConstId, DefWithBodyId, FieldId, FunctionId, GenericDefId, GenericParamId,
- ImplId, ItemContainerId, LocalFieldId, Lookup, TraitId, TupleFieldId, TupleId, TypeAliasId,
- VariantId,
+ ItemContainerId, LocalFieldId, Lookup, TraitId, TupleFieldId, TupleId, TypeAliasId, VariantId,
expr_store::{Body, ExpressionStore, HygieneId, path::Path},
hir::{BindingAnnotation, BindingId, ExprId, ExprOrPatId, LabelId, PatId},
lang_item::{LangItem, LangItemTarget, lang_item},
@@ -44,11 +44,11 @@
use hir_expand::{mod_path::ModPath, name::Name};
use indexmap::IndexSet;
use intern::sym;
-use la_arena::{ArenaMap, Entry};
+use la_arena::ArenaMap;
use rustc_ast_ir::Mutability;
use rustc_hash::{FxHashMap, FxHashSet};
use rustc_type_ir::{
- AliasTyKind, Flags, TypeFlags, TypeFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitor,
+ AliasTyKind, TypeFoldable,
inherent::{AdtDef, IntoKind, Region as _, SliceLike, Ty as _},
};
use stdx::never;
@@ -61,7 +61,6 @@
coerce::{CoerceMany, DynamicCoerceMany},
diagnostics::{Diagnostics, InferenceTyLoweringContext as TyLoweringContext},
expr::ExprIsRead,
- unify::InferenceTable,
},
lower::{
ImplTraitIdx, ImplTraitLoweringMode, LifetimeElisionKind, diagnostics::TyLoweringDiagnostic,
@@ -69,10 +68,7 @@
mir::MirSpan,
next_solver::{
AliasTy, Const, DbInterner, ErrorGuaranteed, GenericArg, GenericArgs, Region, Ty, TyKind,
- Tys,
- abi::Safety,
- fold::fold_tys,
- infer::traits::{Obligation, ObligationCause},
+ Tys, abi::Safety, infer::traits::ObligationCause,
},
traits::FnTrait,
utils::TargetFeatureIsSafeInTarget,
@@ -132,6 +128,8 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<Infer
ctx.infer_mut_body();
+ ctx.handle_opaque_type_uses();
+
ctx.type_inference_fallback();
// Comment from rustc:
@@ -148,6 +146,10 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<Infer
ctx.infer_closures();
+ ctx.table.select_obligations_where_possible();
+
+ ctx.handle_opaque_type_uses();
+
Arc::new(ctx.resolve_all())
}
@@ -454,7 +456,7 @@ pub struct InferenceResult<'db> {
/// unresolved or missing subpatterns or subpatterns of mismatched types.
pub(crate) type_of_pat: ArenaMap<PatId, Ty<'db>>,
pub(crate) type_of_binding: ArenaMap<BindingId, Ty<'db>>,
- pub(crate) type_of_rpit: ArenaMap<ImplTraitIdx<'db>, Ty<'db>>,
+ pub(crate) type_of_opaque: FxHashMap<InternedOpaqueTyId, Ty<'db>>,
type_mismatches: FxHashMap<ExprOrPatId, TypeMismatch<'db>>,
/// Whether there are any type-mismatching errors in the result.
// FIXME: This isn't as useful as initially thought due to us falling back placeholders to
@@ -499,7 +501,7 @@ fn new(error_ty: Ty<'db>) -> Self {
type_of_expr: Default::default(),
type_of_pat: Default::default(),
type_of_binding: Default::default(),
- type_of_rpit: Default::default(),
+ type_of_opaque: Default::default(),
type_mismatches: Default::default(),
has_errors: Default::default(),
error_ty,
@@ -640,8 +642,14 @@ pub fn binding_types(&self) -> impl Iterator<Item = (BindingId, Ty<'db>)> {
// This method is consumed by external tools to run rust-analyzer as a library. Don't remove, please.
pub fn return_position_impl_trait_types(
&self,
+ db: &'db dyn HirDatabase,
) -> impl Iterator<Item = (ImplTraitIdx<'db>, Ty<'db>)> {
- self.type_of_rpit.iter().map(|(k, v)| (k, *v))
+ self.type_of_opaque.iter().filter_map(move |(&id, &ty)| {
+ let ImplTraitId::ReturnTypeImplTrait(_, rpit_idx) = id.loc(db) else {
+ return None;
+ };
+ Some((rpit_idx, ty))
+ })
}
}
@@ -707,6 +715,7 @@ struct InternedStandardTypes<'db> {
re_static: Region<'db>,
re_error: Region<'db>,
+ re_erased: Region<'db>,
empty_args: GenericArgs<'db>,
empty_tys: Tys<'db>,
@@ -742,6 +751,7 @@ fn new(interner: DbInterner<'db>) -> Self {
re_static,
re_error: Region::error(interner),
+ re_erased: Region::new_erased(interner),
empty_args: GenericArgs::new_from_iter(interner, []),
empty_tys: Tys::new_from_iter(interner, []),
@@ -848,11 +858,6 @@ fn find_continuable<'a, 'db>(
}
}
-enum ImplTraitReplacingMode<'db> {
- ReturnPosition(FxHashSet<Ty<'db>>),
- TypeAlias,
-}
-
impl<'body, 'db> InferenceContext<'body, 'db> {
fn new(
db: &'db dyn HirDatabase,
@@ -861,7 +866,7 @@ fn new(
resolver: Resolver<'db>,
) -> Self {
let trait_env = db.trait_environment_for_body(owner);
- let table = unify::InferenceTable::new(db, trait_env);
+ let table = unify::InferenceTable::new(db, trait_env, Some(owner));
let types = InternedStandardTypes::new(table.interner());
InferenceContext {
result: InferenceResult::new(types.error),
@@ -952,7 +957,7 @@ pub(crate) fn fixme_resolve_all_clone(&self) -> InferenceResult<'db> {
// `InferenceResult` in the middle of inference. See the fixme comment in `consteval::eval_to_const`. If you
// used this function for another workaround, mention it here. If you really need this function and believe that
// there is no problem in it being `pub(crate)`, remove this comment.
- pub(crate) fn resolve_all(self) -> InferenceResult<'db> {
+ fn resolve_all(self) -> InferenceResult<'db> {
let InferenceContext {
mut table, mut result, tuple_field_accesses_rev, diagnostics, ..
} = self;
@@ -967,7 +972,7 @@ pub(crate) fn resolve_all(self) -> InferenceResult<'db> {
type_of_expr,
type_of_pat,
type_of_binding,
- type_of_rpit,
+ type_of_opaque,
type_mismatches,
has_errors,
error_ty: _,
@@ -999,11 +1004,7 @@ pub(crate) fn resolve_all(self) -> InferenceResult<'db> {
*has_errors = *has_errors || ty.references_non_lt_error();
}
type_of_binding.shrink_to_fit();
- for ty in type_of_rpit.values_mut() {
- *ty = table.resolve_completely(*ty);
- *has_errors = *has_errors || ty.references_non_lt_error();
- }
- type_of_rpit.shrink_to_fit();
+ type_of_opaque.shrink_to_fit();
*has_errors |= !type_mismatches.is_empty();
@@ -1084,9 +1085,6 @@ fn collect_const(&mut self, id: ConstId, data: &ConstSignature) {
LifetimeElisionKind::for_const(self.interner(), id.loc(self.db).container),
);
- // Constants might be defining usage sites of TAITs.
- self.make_tait_coercion_table(iter::once(return_ty));
-
self.return_ty = return_ty;
}
@@ -1098,9 +1096,6 @@ fn collect_static(&mut self, data: &StaticSignature) {
LifetimeElisionKind::Elided(self.types.re_static),
);
- // Statics might be defining usage sites of TAITs.
- self.make_tait_coercion_table(iter::once(return_ty));
-
self.return_ty = return_ty;
}
@@ -1138,16 +1133,12 @@ fn collect_fn(&mut self, func: FunctionId) {
let ty = self.process_user_written_ty(ty);
self.write_binding_ty(self_param, ty);
}
- let mut tait_candidates = FxHashSet::default();
for (ty, pat) in param_tys.zip(&*self.body.params) {
let ty = self.process_user_written_ty(ty);
self.infer_top_pat(*pat, ty, None);
- if ty.flags().intersects(TypeFlags::HAS_TY_OPAQUE.union(TypeFlags::HAS_TY_INFER)) {
- tait_candidates.insert(ty);
- }
}
- let return_ty = match data.ret_type {
+ self.return_ty = match data.ret_type {
Some(return_ty) => {
let return_ty = self.with_ty_lowering(
&data.store,
@@ -1158,45 +1149,12 @@ fn collect_fn(&mut self, func: FunctionId) {
ctx.lower_ty(return_ty)
},
);
- let return_ty = self.insert_type_vars(return_ty);
- if let Some(rpits) = self.db.return_type_impl_traits(func) {
- let mut mode = ImplTraitReplacingMode::ReturnPosition(FxHashSet::default());
- let result = self.insert_inference_vars_for_impl_trait(return_ty, &mut mode);
- if let ImplTraitReplacingMode::ReturnPosition(taits) = mode {
- tait_candidates.extend(taits);
- }
- let rpits = (*rpits).as_ref().skip_binder();
- for (id, _) in rpits.impl_traits.iter() {
- if let Entry::Vacant(e) = self.result.type_of_rpit.entry(id) {
- never!("Missed RPIT in `insert_inference_vars_for_rpit`");
- e.insert(self.types.error);
- }
- }
- result
- } else {
- return_ty
- }
+ self.process_user_written_ty(return_ty)
}
None => self.types.unit,
};
- self.return_ty = self.process_user_written_ty(return_ty);
self.return_coercion = Some(CoerceMany::new(self.return_ty));
-
- // Functions might be defining usage sites of TAITs.
- // To define an TAITs, that TAIT must appear in the function's signatures.
- // So, it suffices to check for params and return types.
- fold_tys(self.interner(), self.return_ty, |ty| {
- match ty.kind() {
- TyKind::Alias(AliasTyKind::Opaque, _) | TyKind::Infer(..) => {
- tait_candidates.insert(self.return_ty);
- }
- _ => {}
- }
- ty
- });
-
- self.make_tait_coercion_table(tait_candidates.iter().copied());
}
#[inline]
@@ -1204,193 +1162,6 @@ pub(crate) fn interner(&self) -> DbInterner<'db> {
self.table.interner()
}
- fn insert_inference_vars_for_impl_trait<T>(
- &mut self,
- t: T,
- mode: &mut ImplTraitReplacingMode<'db>,
- ) -> T
- where
- T: TypeFoldable<DbInterner<'db>>,
- {
- fold_tys(self.interner(), t, |ty| {
- let ty = self.table.try_structurally_resolve_type(ty);
- let opaque_ty_id = match ty.kind() {
- TyKind::Alias(AliasTyKind::Opaque, alias_ty) => alias_ty.def_id.expect_opaque_ty(),
- _ => return ty,
- };
- let (impl_traits, idx) = match self.db.lookup_intern_impl_trait_id(opaque_ty_id) {
- // We don't replace opaque types from other kind with inference vars
- // because `insert_inference_vars_for_impl_traits` for each kinds
- // and unreplaced opaque types of other kind are resolved while
- // inferencing because of `tait_coercion_table`.
- ImplTraitId::ReturnTypeImplTrait(def, idx) => {
- if matches!(mode, ImplTraitReplacingMode::TypeAlias) {
- // RPITs don't have `tait_coercion_table`, so use inserted inference
- // vars for them.
- if let Some(ty) = self.result.type_of_rpit.get(idx) {
- return *ty;
- }
- return ty;
- }
- (self.db.return_type_impl_traits(def), idx)
- }
- ImplTraitId::TypeAliasImplTrait(def, idx) => {
- if let ImplTraitReplacingMode::ReturnPosition(taits) = mode {
- // Gather TAITs while replacing RPITs because TAITs inside RPITs
- // may not visited while replacing TAITs
- taits.insert(ty);
- return ty;
- }
- (self.db.type_alias_impl_traits(def), idx)
- }
- };
- let Some(impl_traits) = impl_traits else {
- return ty;
- };
- let bounds =
- (*impl_traits).as_ref().map_bound(|its| its.impl_traits[idx].predicates.as_slice());
- let var = match self.result.type_of_rpit.entry(idx) {
- Entry::Occupied(entry) => return *entry.get(),
- Entry::Vacant(entry) => *entry.insert(self.table.next_ty_var()),
- };
- for clause in bounds.iter_identity_copied() {
- let clause = self.insert_inference_vars_for_impl_trait(clause, mode);
- self.table.register_predicate(Obligation::new(
- self.interner(),
- ObligationCause::new(),
- self.table.trait_env.env,
- clause,
- ));
- }
- var
- })
- }
-
- /// The coercion of a non-inference var into an opaque type should fail,
- /// but not in the defining sites of the TAITs.
- /// In such cases, we insert an proxy inference var for each TAIT,
- /// and coerce into it instead of TAIT itself.
- ///
- /// The inference var stretagy is effective because;
- ///
- /// - It can still unify types that coerced into TAITs
- /// - We are pushing `impl Trait` bounds into it
- ///
- /// This function inserts a map that maps the opaque type to that proxy inference var.
- fn make_tait_coercion_table(&mut self, tait_candidates: impl Iterator<Item = Ty<'db>>) {
- struct TypeAliasImplTraitCollector<'a, 'db> {
- db: &'a dyn HirDatabase,
- table: &'a mut InferenceTable<'db>,
- assocs: FxHashMap<InternedOpaqueTyId, (ImplId, Ty<'db>)>,
- non_assocs: FxHashMap<InternedOpaqueTyId, Ty<'db>>,
- }
-
- impl<'db> TypeVisitor<DbInterner<'db>> for TypeAliasImplTraitCollector<'_, 'db> {
- type Result = ();
-
- fn visit_ty(&mut self, ty: Ty<'db>) {
- let ty = self.table.try_structurally_resolve_type(ty);
-
- if let TyKind::Alias(AliasTyKind::Opaque, alias_ty) = ty.kind()
- && let id = alias_ty.def_id.expect_opaque_ty()
- && let ImplTraitId::TypeAliasImplTrait(alias_id, _) =
- self.db.lookup_intern_impl_trait_id(id)
- {
- let loc = self.db.lookup_intern_type_alias(alias_id);
- match loc.container {
- ItemContainerId::ImplId(impl_id) => {
- self.assocs.insert(id, (impl_id, ty));
- }
- ItemContainerId::ModuleId(..) | ItemContainerId::ExternBlockId(..) => {
- self.non_assocs.insert(id, ty);
- }
- _ => {}
- }
- }
-
- ty.super_visit_with(self)
- }
- }
-
- let mut collector = TypeAliasImplTraitCollector {
- db: self.db,
- table: &mut self.table,
- assocs: FxHashMap::default(),
- non_assocs: FxHashMap::default(),
- };
- for ty in tait_candidates {
- ty.visit_with(&mut collector);
- }
-
- // Non-assoc TAITs can be define-used everywhere as long as they are
- // in function signatures or const types, etc
- let mut taits = collector.non_assocs;
-
- // assoc TAITs(ATPITs) can be only define-used inside their impl block.
- // They cannot be define-used in inner items like in the following;
- //
- // ```
- // impl Trait for Struct {
- // type Assoc = impl Default;
- //
- // fn assoc_fn() -> Self::Assoc {
- // let foo: Self::Assoc = true; // Allowed here
- //
- // fn inner() -> Self::Assoc {
- // false // Not allowed here
- // }
- //
- // foo
- // }
- // }
- // ```
- let impl_id = match self.owner {
- DefWithBodyId::FunctionId(it) => {
- let loc = self.db.lookup_intern_function(it);
- if let ItemContainerId::ImplId(impl_id) = loc.container {
- Some(impl_id)
- } else {
- None
- }
- }
- DefWithBodyId::ConstId(it) => {
- let loc = self.db.lookup_intern_const(it);
- if let ItemContainerId::ImplId(impl_id) = loc.container {
- Some(impl_id)
- } else {
- None
- }
- }
- _ => None,
- };
-
- if let Some(impl_id) = impl_id {
- taits.extend(collector.assocs.into_iter().filter_map(|(id, (impl_, ty))| {
- if impl_ == impl_id { Some((id, ty)) } else { None }
- }));
- }
-
- let tait_coercion_table: FxHashMap<_, _> = taits
- .into_iter()
- .filter_map(|(id, ty)| {
- if let ImplTraitId::TypeAliasImplTrait(..) = self.db.lookup_intern_impl_trait_id(id)
- {
- let ty = self.insert_inference_vars_for_impl_trait(
- ty,
- &mut ImplTraitReplacingMode::TypeAlias,
- );
- Some((id, ty))
- } else {
- None
- }
- })
- .collect();
-
- if !tait_coercion_table.is_empty() {
- self.table.tait_coercion_table = Some(tait_coercion_table);
- }
- }
-
fn infer_body(&mut self) {
match self.return_coercion {
Some(_) => self.infer_return(self.body.body_expr),
@@ -2006,12 +1777,15 @@ fn resolve_va_list(&self) -> Option<AdtId> {
Some(struct_.into())
}
- fn get_traits_in_scope(&self) -> Either<FxHashSet<TraitId>, &FxHashSet<TraitId>> {
- let mut b_traits = self.resolver.traits_in_scope_from_block_scopes().peekable();
+ fn get_traits_in_scope<'a>(
+ resolver: &Resolver<'db>,
+ traits_in_scope: &'a FxHashSet<TraitId>,
+ ) -> Either<FxHashSet<TraitId>, &'a FxHashSet<TraitId>> {
+ let mut b_traits = resolver.traits_in_scope_from_block_scopes().peekable();
if b_traits.peek().is_some() {
- Either::Left(self.traits_in_scope.iter().copied().chain(b_traits).collect())
+ Either::Left(traits_in_scope.iter().copied().chain(b_traits).collect())
} else {
- Either::Right(&self.traits_in_scope)
+ Either::Right(traits_in_scope)
}
}
}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs
index 78889cc..40de923 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs
@@ -60,8 +60,7 @@
next_solver::{
Binder, BoundConst, BoundRegion, BoundRegionKind, BoundTy, BoundTyKind, CallableIdWrapper,
Canonical, ClauseKind, CoercePredicate, Const, ConstKind, DbInterner, ErrorGuaranteed,
- GenericArgs, PolyFnSig, PredicateKind, Region, RegionKind, SolverDefId, TraitRef, Ty,
- TyKind,
+ GenericArgs, PolyFnSig, PredicateKind, Region, RegionKind, TraitRef, Ty, TyKind,
infer::{
InferCtxt, InferOk, InferResult,
relate::RelateResult,
@@ -223,24 +222,6 @@ fn coerce(&mut self, a: Ty<'db>, b: Ty<'db>) -> CoerceResult<'db> {
}
}
- // If we are coercing into a TAIT, coerce into its proxy inference var, instead.
- // FIXME(next-solver): This should not be here. This is not how rustc does thing, and it also not allows us
- // to normalize opaques defined in our scopes. Instead, we should properly register
- // `TypingMode::Analysis::defining_opaque_types_and_generators`, and rely on the solver to reveal
- // them for us (we'll also need some global-like registry for the values, something we cannot
- // really implement, therefore we can really support only RPITs and ITIAT or the new `#[define_opaque]`
- // TAIT, not the old global TAIT).
- let mut b = b;
- if let Some(tait_table) = &self.table.tait_coercion_table
- && let TyKind::Alias(rustc_type_ir::Opaque, opaque_ty) = b.kind()
- && let SolverDefId::InternedOpaqueTyId(opaque_ty_id) = opaque_ty.def_id
- && !matches!(a.kind(), TyKind::Infer(..) | TyKind::Alias(rustc_type_ir::Opaque, _))
- && let Some(ty) = tait_table.get(&opaque_ty_id)
- {
- b = self.table.shallow_resolve(*ty);
- }
- let b = b;
-
// Coercing *from* an unresolved inference variable means that
// we have no information about the source type. This will always
// ultimately fall back to some form of subtyping.
@@ -1528,7 +1509,7 @@ fn coerce<'db>(
env: Arc<TraitEnvironment<'db>>,
tys: &Canonical<'db, (Ty<'db>, Ty<'db>)>,
) -> Result<(Vec<Adjustment<'db>>, Ty<'db>), TypeError<DbInterner<'db>>> {
- let mut table = InferenceTable::new(db, env);
+ let mut table = InferenceTable::new(db, env, None);
let interner = table.interner();
let ((ty1_with_vars, ty2_with_vars), vars) = table.infer_ctxt.instantiate_canonical(tys);
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs
index fd4e374..b7ab109 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs
@@ -1458,10 +1458,11 @@ fn infer_block(
) -> Ty<'db> {
let coerce_ty = expected.coercion_target_type(&mut self.table);
let g = self.resolver.update_to_inner_scope(self.db, self.owner, expr);
- let prev_env = block_id.map(|block_id| {
+ let prev_state = block_id.map(|block_id| {
let prev_env = self.table.trait_env.clone();
TraitEnvironment::with_block(&mut self.table.trait_env, block_id);
- prev_env
+ let prev_block = self.table.infer_ctxt.interner.block.replace(block_id);
+ (prev_env, prev_block)
});
let (break_ty, ty) =
@@ -1576,8 +1577,9 @@ fn infer_block(
}
});
self.resolver.reset_to_guard(g);
- if let Some(prev_env) = prev_env {
+ if let Some((prev_env, prev_block)) = prev_state {
self.table.trait_env = prev_env;
+ self.table.infer_ctxt.interner.block = prev_block;
}
break_ty.unwrap_or(ty)
@@ -1689,10 +1691,11 @@ fn infer_field_access(
// work out while people are typing
let canonicalized_receiver = self.canonicalize(receiver_ty);
let resolved = method_resolution::lookup_method(
- self.db,
&canonicalized_receiver,
- self.table.trait_env.clone(),
- self.get_traits_in_scope().as_ref().left_or_else(|&it| it),
+ &mut self.table,
+ Self::get_traits_in_scope(&self.resolver, &self.traits_in_scope)
+ .as_ref()
+ .left_or_else(|&it| it),
VisibleFromModule::Filter(self.resolver.module()),
name,
);
@@ -1844,10 +1847,11 @@ fn infer_method_call(
let canonicalized_receiver = self.canonicalize(receiver_ty);
let resolved = method_resolution::lookup_method(
- self.db,
&canonicalized_receiver,
- self.table.trait_env.clone(),
- self.get_traits_in_scope().as_ref().left_or_else(|&it| it),
+ &mut self.table,
+ Self::get_traits_in_scope(&self.resolver, &self.traits_in_scope)
+ .as_ref()
+ .left_or_else(|&it| it),
VisibleFromModule::Filter(self.resolver.module()),
method_name,
);
@@ -1892,9 +1896,10 @@ fn infer_method_call(
let assoc_func_with_same_name = method_resolution::iterate_method_candidates(
&canonicalized_receiver,
- self.db,
- self.table.trait_env.clone(),
- self.get_traits_in_scope().as_ref().left_or_else(|&it| it),
+ &mut self.table,
+ Self::get_traits_in_scope(&self.resolver, &self.traits_in_scope)
+ .as_ref()
+ .left_or_else(|&it| it),
VisibleFromModule::Filter(self.resolver.module()),
Some(method_name),
method_resolution::LookupMode::Path,
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/opaques.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/opaques.rs
new file mode 100644
index 0000000..f7719f5
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/opaques.rs
@@ -0,0 +1,147 @@
+//! Defining opaque types via inference.
+
+use rustc_type_ir::{TypeVisitableExt, fold_regions};
+use tracing::{debug, instrument};
+
+use crate::{
+ infer::InferenceContext,
+ next_solver::{
+ EarlyBinder, OpaqueTypeKey, SolverDefId, TypingMode,
+ infer::{opaque_types::OpaqueHiddenType, traits::ObligationCause},
+ },
+};
+
+impl<'db> InferenceContext<'_, 'db> {
+ /// This takes all the opaque type uses during HIR typeck. It first computes
+ /// the concrete hidden type by iterating over all defining uses.
+ ///
+ /// A use during HIR typeck is defining if all non-lifetime arguments are
+ /// unique generic parameters and the hidden type does not reference any
+ /// inference variables.
+ ///
+ /// It then uses these defining uses to guide inference for all other uses.
+ #[instrument(level = "debug", skip(self))]
+ pub(super) fn handle_opaque_type_uses(&mut self) {
+ // We clone the opaques instead of stealing them here as they are still used for
+ // normalization in the next generation trait solver.
+ let opaque_types: Vec<_> = self.table.infer_ctxt.clone_opaque_types();
+
+ self.compute_definition_site_hidden_types(opaque_types);
+ }
+}
+
+#[expect(unused, reason = "rustc has this")]
+#[derive(Copy, Clone, Debug)]
+enum UsageKind<'db> {
+ None,
+ NonDefiningUse(OpaqueTypeKey<'db>, OpaqueHiddenType<'db>),
+ UnconstrainedHiddenType(OpaqueHiddenType<'db>),
+ HasDefiningUse(OpaqueHiddenType<'db>),
+}
+
+impl<'db> UsageKind<'db> {
+ fn merge(&mut self, other: UsageKind<'db>) {
+ match (&*self, &other) {
+ (UsageKind::HasDefiningUse(_), _) | (_, UsageKind::None) => unreachable!(),
+ (UsageKind::None, _) => *self = other,
+ // When mergining non-defining uses, prefer earlier ones. This means
+ // the error happens as early as possible.
+ (
+ UsageKind::NonDefiningUse(..) | UsageKind::UnconstrainedHiddenType(..),
+ UsageKind::NonDefiningUse(..),
+ ) => {}
+ // When merging unconstrained hidden types, we prefer later ones. This is
+ // used as in most cases, the defining use is the final return statement
+ // of our function, and other uses with defining arguments are likely not
+ // intended to be defining.
+ (
+ UsageKind::NonDefiningUse(..) | UsageKind::UnconstrainedHiddenType(..),
+ UsageKind::UnconstrainedHiddenType(..) | UsageKind::HasDefiningUse(_),
+ ) => *self = other,
+ }
+ }
+}
+
+impl<'db> InferenceContext<'_, 'db> {
+ fn compute_definition_site_hidden_types(
+ &mut self,
+ mut opaque_types: Vec<(OpaqueTypeKey<'db>, OpaqueHiddenType<'db>)>,
+ ) {
+ for entry in opaque_types.iter_mut() {
+ *entry = self.table.infer_ctxt.resolve_vars_if_possible(*entry);
+ }
+ debug!(?opaque_types);
+
+ let interner = self.interner();
+ let TypingMode::Analysis { defining_opaque_types_and_generators } =
+ self.table.infer_ctxt.typing_mode()
+ else {
+ unreachable!();
+ };
+
+ for def_id in defining_opaque_types_and_generators {
+ let def_id = match def_id {
+ SolverDefId::InternedOpaqueTyId(it) => it,
+ _ => continue,
+ };
+
+ // We do actually need to check this the second pass (we can't just
+ // store this), because we can go from `UnconstrainedHiddenType` to
+ // `HasDefiningUse` (because of fallback)
+ let mut usage_kind = UsageKind::None;
+ for &(opaque_type_key, hidden_type) in &opaque_types {
+ if opaque_type_key.def_id != def_id.into() {
+ continue;
+ }
+
+ usage_kind.merge(self.consider_opaque_type_use(opaque_type_key, hidden_type));
+
+ if let UsageKind::HasDefiningUse(..) = usage_kind {
+ break;
+ }
+ }
+
+ if let UsageKind::HasDefiningUse(ty) = usage_kind {
+ for &(opaque_type_key, hidden_type) in &opaque_types {
+ if opaque_type_key.def_id != def_id.into() {
+ continue;
+ }
+
+ let expected =
+ EarlyBinder::bind(ty.ty).instantiate(interner, opaque_type_key.args);
+ self.demand_eqtype(expected, hidden_type.ty);
+ }
+
+ self.result.type_of_opaque.insert(def_id, ty.ty);
+
+ continue;
+ }
+
+ self.result.type_of_opaque.insert(def_id, self.types.error);
+ }
+ }
+
+ #[tracing::instrument(skip(self), ret)]
+ fn consider_opaque_type_use(
+ &self,
+ opaque_type_key: OpaqueTypeKey<'db>,
+ hidden_type: OpaqueHiddenType<'db>,
+ ) -> UsageKind<'db> {
+ // We ignore uses of the opaque if they have any inference variables
+ // as this can frequently happen with recursive calls.
+ //
+ // See `tests/ui/traits/next-solver/opaques/universal-args-non-defining.rs`.
+ if hidden_type.ty.has_non_region_infer() {
+ return UsageKind::UnconstrainedHiddenType(hidden_type);
+ }
+
+ let cause = ObligationCause::new();
+ let at = self.table.infer_ctxt.at(&cause, self.table.trait_env.env);
+ let hidden_type = match at.deeply_normalize(hidden_type) {
+ Ok(hidden_type) => hidden_type,
+ Err(_errors) => OpaqueHiddenType { ty: self.types.error },
+ };
+ let hidden_type = fold_regions(self.interner(), hidden_type, |_, _| self.types.re_erased);
+ UsageKind::HasDefiningUse(hidden_type)
+ }
+}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs
index 2dae7cb..9ade842 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs
@@ -310,9 +310,10 @@ fn resolve_ty_assoc_item(
let mut not_visible = None;
let res = method_resolution::iterate_method_candidates(
&canonical_ty,
- self.db,
- self.table.trait_env.clone(),
- self.get_traits_in_scope().as_ref().left_or_else(|&it| it),
+ &mut self.table,
+ Self::get_traits_in_scope(&self.resolver, &self.traits_in_scope)
+ .as_ref()
+ .left_or_else(|&it| it),
VisibleFromModule::Filter(self.resolver.module()),
Some(name),
method_resolution::LookupMode::Path,
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs b/src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs
index a18cdda..0f582a1 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs
@@ -2,10 +2,10 @@
use std::fmt;
-use hir_def::{AdtId, GenericParamId, lang_item::LangItem};
+use hir_def::{AdtId, DefWithBodyId, GenericParamId, lang_item::LangItem};
use hir_expand::name::Name;
use intern::sym;
-use rustc_hash::{FxHashMap, FxHashSet};
+use rustc_hash::FxHashSet;
use rustc_type_ir::{
DebruijnIndex, InferConst, InferTy, RegionVid, TyVid, TypeFoldable, TypeFolder,
TypeSuperFoldable, TypeVisitableExt, UpcastFrom,
@@ -17,12 +17,12 @@
use crate::{
TraitEnvironment,
- db::{HirDatabase, InternedOpaqueTyId},
+ db::HirDatabase,
infer::InferenceContext,
next_solver::{
self, AliasTy, Binder, Canonical, ClauseKind, Const, ConstKind, DbInterner,
ErrorGuaranteed, GenericArg, GenericArgs, Predicate, PredicateKind, Region, RegionKind,
- SolverDefId, SolverDefIds, TraitRef, Ty, TyKind, TypingMode,
+ SolverDefId, TraitRef, Ty, TyKind, TypingMode,
fulfill::{FulfillmentCtxt, NextSolverError},
infer::{
DbInternerInferExt, InferCtxt, InferOk, InferResult,
@@ -139,10 +139,7 @@ fn could_unify_impl<'db>(
select: for<'a> fn(&mut ObligationCtxt<'a, 'db>) -> Vec<NextSolverError<'db>>,
) -> bool {
let interner = DbInterner::new_with(db, Some(env.krate), env.block);
- // FIXME(next-solver): I believe this should use `PostAnalysis` (this is only used for IDE things),
- // but this causes some bug because of our incorrect impl of `type_of_opaque_hir_typeck()` for TAIT
- // and async blocks.
- let infcx = interner.infer_ctxt().build(TypingMode::non_body_analysis());
+ let infcx = interner.infer_ctxt().build(TypingMode::PostAnalysis);
let cause = ObligationCause::dummy();
let at = infcx.at(&cause, env.env);
let ((ty1_with_vars, ty2_with_vars), _) = infcx.instantiate_canonical(tys);
@@ -158,7 +155,6 @@ fn could_unify_impl<'db>(
pub(crate) struct InferenceTable<'db> {
pub(crate) db: &'db dyn HirDatabase,
pub(crate) trait_env: Arc<TraitEnvironment<'db>>,
- pub(crate) tait_coercion_table: Option<FxHashMap<InternedOpaqueTyId, Ty<'db>>>,
pub(crate) infer_ctxt: InferCtxt<'db>,
pub(super) fulfillment_cx: FulfillmentCtxt<'db>,
pub(super) diverging_type_vars: FxHashSet<Ty<'db>>,
@@ -170,15 +166,23 @@ pub(crate) struct InferenceTableSnapshot<'db> {
}
impl<'db> InferenceTable<'db> {
- pub(crate) fn new(db: &'db dyn HirDatabase, trait_env: Arc<TraitEnvironment<'db>>) -> Self {
+ /// Inside hir-ty you should use this for inference only, and always pass `owner`.
+ /// Outside it, always pass `owner = None`.
+ pub(crate) fn new(
+ db: &'db dyn HirDatabase,
+ trait_env: Arc<TraitEnvironment<'db>>,
+ owner: Option<DefWithBodyId>,
+ ) -> Self {
let interner = DbInterner::new_with(db, Some(trait_env.krate), trait_env.block);
- let infer_ctxt = interner.infer_ctxt().build(rustc_type_ir::TypingMode::Analysis {
- defining_opaque_types_and_generators: SolverDefIds::new_from_iter(interner, []),
- });
+ let typing_mode = match owner {
+ Some(owner) => TypingMode::typeck_for_body(interner, owner.into()),
+ // IDE things wants to reveal opaque types.
+ None => TypingMode::PostAnalysis,
+ };
+ let infer_ctxt = interner.infer_ctxt().build(typing_mode);
InferenceTable {
db,
trait_env,
- tait_coercion_table: None,
fulfillment_cx: FulfillmentCtxt::new(&infer_ctxt),
infer_ctxt,
diverging_type_vars: FxHashSet::default(),
@@ -698,40 +702,7 @@ pub(super) fn insert_type_vars<T>(&mut self, ty: T) -> T
where
T: TypeFoldable<DbInterner<'db>>,
{
- struct Folder<'a, 'db> {
- table: &'a mut InferenceTable<'db>,
- }
- impl<'db> TypeFolder<DbInterner<'db>> for Folder<'_, 'db> {
- fn cx(&self) -> DbInterner<'db> {
- self.table.interner()
- }
-
- fn fold_ty(&mut self, ty: Ty<'db>) -> Ty<'db> {
- if !ty.references_error() {
- return ty;
- }
-
- if ty.is_ty_error() { self.table.next_ty_var() } else { ty.super_fold_with(self) }
- }
-
- fn fold_const(&mut self, ct: Const<'db>) -> Const<'db> {
- if !ct.references_error() {
- return ct;
- }
-
- if ct.is_ct_error() {
- self.table.next_const_var()
- } else {
- ct.super_fold_with(self)
- }
- }
-
- fn fold_region(&mut self, r: Region<'db>) -> Region<'db> {
- if r.is_error() { self.table.next_region_var() } else { r }
- }
- }
-
- ty.fold_with(&mut Folder { table: self })
+ self.infer_ctxt.insert_type_vars(ty)
}
/// Replaces `Ty::Error` by a new type var, so we can maybe still infer it.
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/lib.rs b/src/tools/rust-analyzer/crates/hir-ty/src/lib.rs
index 25579e0..fdacc1d 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/lib.rs
@@ -27,9 +27,11 @@
mod inhabitedness;
mod lower;
pub mod next_solver;
+mod opaques;
mod specialization;
mod target_feature;
mod utils;
+mod variance;
pub mod autoderef;
pub mod consteval;
@@ -50,7 +52,6 @@
mod test_db;
#[cfg(test)]
mod tests;
-mod variance;
use std::hash::Hash;
@@ -471,6 +472,7 @@ fn try_fold_region(&mut self, region: Region<'db>) -> Result<Region<'db>, Self::
}
}
+/// To be used from `hir` only.
pub fn callable_sig_from_fn_trait<'db>(
self_ty: Ty<'db>,
trait_env: Arc<TraitEnvironment<'db>>,
@@ -482,7 +484,7 @@ pub fn callable_sig_from_fn_trait<'db>(
.trait_items(db)
.associated_type_by_name(&Name::new_symbol_root(sym::Output))?;
- let mut table = InferenceTable::new(db, trait_env.clone());
+ let mut table = InferenceTable::new(db, trait_env.clone(), None);
// Register two obligations:
// - Self: FnOnce<?args_ty>
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs b/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs
index cec6356..1e30897 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs
@@ -489,9 +489,8 @@ pub fn def_crates<'db>(
/// Look up the method with the given name.
pub(crate) fn lookup_method<'db>(
- db: &'db dyn HirDatabase,
ty: &Canonical<'db, Ty<'db>>,
- env: Arc<TraitEnvironment<'db>>,
+ table: &mut InferenceTable<'db>,
traits_in_scope: &FxHashSet<TraitId>,
visible_from_module: VisibleFromModule,
name: &Name,
@@ -499,8 +498,7 @@ pub(crate) fn lookup_method<'db>(
let mut not_visible = None;
let res = iterate_method_candidates(
ty,
- db,
- env,
+ table,
traits_in_scope,
visible_from_module,
Some(name),
@@ -656,8 +654,7 @@ fn with_autoref(&self, a: AutorefOrPtrAdjustment) -> ReceiverAdjustments {
// FIXME add a context type here?
pub(crate) fn iterate_method_candidates<'db, T>(
ty: &Canonical<'db, Ty<'db>>,
- db: &'db dyn HirDatabase,
- env: Arc<TraitEnvironment<'db>>,
+ table: &mut InferenceTable<'db>,
traits_in_scope: &FxHashSet<TraitId>,
visible_from_module: VisibleFromModule,
name: Option<&Name>,
@@ -665,10 +662,9 @@ pub(crate) fn iterate_method_candidates<'db, T>(
mut callback: impl FnMut(ReceiverAdjustments, AssocItemId, bool) -> Option<T>,
) -> Option<T> {
let mut slot = None;
- _ = iterate_method_candidates_dyn(
+ _ = iterate_method_candidates_dyn_impl(
ty,
- db,
- env,
+ table,
traits_in_scope,
visible_from_module,
name,
@@ -985,6 +981,7 @@ pub fn check_orphan_rules<'db>(db: &'db dyn HirDatabase, impl_: ImplId) -> bool
is_not_orphan
}
+/// To be used from `hir` only.
pub fn iterate_path_candidates<'db>(
ty: &Canonical<'db, Ty<'db>>,
db: &'db dyn HirDatabase,
@@ -1007,6 +1004,7 @@ pub fn iterate_path_candidates<'db>(
)
}
+/// To be used from `hir` only.
pub fn iterate_method_candidates_dyn<'db>(
ty: &Canonical<'db, Ty<'db>>,
db: &'db dyn HirDatabase,
@@ -1017,6 +1015,26 @@ pub fn iterate_method_candidates_dyn<'db>(
mode: LookupMode,
callback: &mut dyn MethodCandidateCallback,
) -> ControlFlow<()> {
+ iterate_method_candidates_dyn_impl(
+ ty,
+ &mut InferenceTable::new(db, env, None),
+ traits_in_scope,
+ visible_from_module,
+ name,
+ mode,
+ callback,
+ )
+}
+
+fn iterate_method_candidates_dyn_impl<'db>(
+ ty: &Canonical<'db, Ty<'db>>,
+ table: &mut InferenceTable<'db>,
+ traits_in_scope: &FxHashSet<TraitId>,
+ visible_from_module: VisibleFromModule,
+ name: Option<&Name>,
+ mode: LookupMode,
+ callback: &mut dyn MethodCandidateCallback,
+) -> ControlFlow<()> {
let _p = tracing::info_span!(
"iterate_method_candidates_dyn",
?mode,
@@ -1046,28 +1064,28 @@ pub fn iterate_method_candidates_dyn<'db>(
// the methods by autoderef order of *receiver types*, not *self
// types*.
- let mut table = InferenceTable::new(db, env);
- let ty = table.instantiate_canonical(*ty);
- let deref_chain = autoderef_method_receiver(&mut table, ty);
+ table.run_in_snapshot(|table| {
+ let ty = table.instantiate_canonical(*ty);
+ let deref_chain = autoderef_method_receiver(table, ty);
- deref_chain.into_iter().try_for_each(|(receiver_ty, adj)| {
- iterate_method_candidates_with_autoref(
- &mut table,
- receiver_ty,
- adj,
- traits_in_scope,
- visible_from_module,
- name,
- callback,
- )
+ deref_chain.into_iter().try_for_each(|(receiver_ty, adj)| {
+ iterate_method_candidates_with_autoref(
+ table,
+ receiver_ty,
+ adj,
+ traits_in_scope,
+ visible_from_module,
+ name,
+ callback,
+ )
+ })
})
}
LookupMode::Path => {
// No autoderef for path lookups
iterate_method_candidates_for_self_ty(
ty,
- db,
- env,
+ table,
traits_in_scope,
visible_from_module,
name,
@@ -1250,39 +1268,39 @@ fn iterate_method_candidates_by_receiver<'db>(
#[tracing::instrument(skip_all, fields(name = ?name))]
fn iterate_method_candidates_for_self_ty<'db>(
self_ty: &Canonical<'db, Ty<'db>>,
- db: &'db dyn HirDatabase,
- env: Arc<TraitEnvironment<'db>>,
+ table: &mut InferenceTable<'db>,
traits_in_scope: &FxHashSet<TraitId>,
visible_from_module: VisibleFromModule,
name: Option<&Name>,
callback: &mut dyn MethodCandidateCallback,
) -> ControlFlow<()> {
- let mut table = InferenceTable::new(db, env);
- let self_ty = table.instantiate_canonical(*self_ty);
- iterate_inherent_methods(
- self_ty,
- &mut table,
- name,
- None,
- None,
- visible_from_module,
- LookupMode::Path,
- &mut |adjustments, item, is_visible| {
- callback.on_inherent_method(adjustments, item, is_visible)
- },
- )?;
- iterate_trait_method_candidates(
- self_ty,
- &mut table,
- traits_in_scope,
- name,
- None,
- None,
- LookupMode::Path,
- &mut |adjustments, item, is_visible| {
- callback.on_trait_method(adjustments, item, is_visible)
- },
- )
+ table.run_in_snapshot(|table| {
+ let self_ty = table.instantiate_canonical(*self_ty);
+ iterate_inherent_methods(
+ self_ty,
+ table,
+ name,
+ None,
+ None,
+ visible_from_module,
+ LookupMode::Path,
+ &mut |adjustments, item, is_visible| {
+ callback.on_inherent_method(adjustments, item, is_visible)
+ },
+ )?;
+ iterate_trait_method_candidates(
+ self_ty,
+ table,
+ traits_in_scope,
+ name,
+ None,
+ None,
+ LookupMode::Path,
+ &mut |adjustments, item, is_visible| {
+ callback.on_trait_method(adjustments, item, is_visible)
+ },
+ )
+ })
}
#[tracing::instrument(skip_all, fields(name = ?name, visible_from_module, receiver_ty))]
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/mir/borrowck.rs b/src/tools/rust-analyzer/crates/hir-ty/src/mir/borrowck.rs
index db16c94..0189265 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/mir/borrowck.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/mir/borrowck.rs
@@ -17,7 +17,7 @@
display::DisplayTarget,
mir::OperandKind,
next_solver::{
- DbInterner, GenericArgs, SolverDefIds, Ty, TypingMode,
+ DbInterner, GenericArgs, Ty, TypingMode,
infer::{DbInternerInferExt, InferCtxt},
},
};
@@ -100,11 +100,11 @@ pub fn borrowck_query<'db>(
let interner = DbInterner::new_with(db, Some(module.krate()), module.containing_block());
let env = db.trait_environment_for_body(def);
let mut res = vec![];
+ // This calculates opaques defining scope which is a bit costly therefore is put outside `all_mir_bodies()`.
+ let typing_mode = TypingMode::borrowck(interner, def.into());
all_mir_bodies(db, def, |body| {
// FIXME(next-solver): Opaques.
- let infcx = interner.infer_ctxt().build(TypingMode::Borrowck {
- defining_opaque_types: SolverDefIds::new_from_iter(interner, []),
- });
+ let infcx = interner.infer_ctxt().build(typing_mode);
res.push(BorrowckResult {
mutability_of_locals: mutability_of_locals(&infcx, &body),
moved_out_of_ref: moved_out_of_ref(&infcx, &env, &body),
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs
index 0ff0b08..77f2106 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/def_id.rs
@@ -154,6 +154,29 @@ fn from(value: DefWithBodyId) -> Self {
}
}
+impl TryFrom<SolverDefId> for DefWithBodyId {
+ type Error = ();
+
+ #[inline]
+ fn try_from(value: SolverDefId) -> Result<Self, Self::Error> {
+ let id = match value {
+ SolverDefId::ConstId(id) => id.into(),
+ SolverDefId::FunctionId(id) => id.into(),
+ SolverDefId::StaticId(id) => id.into(),
+ SolverDefId::EnumVariantId(id) | SolverDefId::Ctor(Ctor::Enum(id)) => id.into(),
+ SolverDefId::InternedOpaqueTyId(_)
+ | SolverDefId::TraitId(_)
+ | SolverDefId::TypeAliasId(_)
+ | SolverDefId::ImplId(_)
+ | SolverDefId::InternedClosureId(_)
+ | SolverDefId::InternedCoroutineId(_)
+ | SolverDefId::Ctor(Ctor::Struct(_))
+ | SolverDefId::AdtId(_) => return Err(()),
+ };
+ Ok(id)
+ }
+}
+
impl TryFrom<SolverDefId> for GenericDefId {
type Error = ();
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs
index 90bd44a..dedd6a1 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/generic_arg.rs
@@ -63,6 +63,14 @@ pub fn region(self) -> Option<Region<'db>> {
}
}
+ #[inline]
+ pub(crate) fn expect_region(self) -> Region<'db> {
+ match self {
+ GenericArg::Lifetime(region) => region,
+ _ => panic!("expected a region, got {self:?}"),
+ }
+ }
+
pub fn error_from_id(interner: DbInterner<'db>, id: GenericParamId) -> GenericArg<'db> {
match id {
GenericParamId::TypeParamId(_) => Ty::new_error(interner, ErrorGuaranteed).into(),
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs
index 36c6c48..7b8f52b 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/mod.rs
@@ -13,27 +13,27 @@
use region_constraints::{RegionConstraintCollector, RegionConstraintStorage};
use rustc_next_trait_solver::solve::SolverDelegateEvalExt;
use rustc_pattern_analysis::Captures;
-use rustc_type_ir::TypeFoldable;
-use rustc_type_ir::error::{ExpectedFound, TypeError};
-use rustc_type_ir::inherent::{
- Const as _, GenericArg as _, GenericArgs as _, IntoKind, SliceLike, Term as _, Ty as _,
-};
use rustc_type_ir::{
ClosureKind, ConstVid, FloatVarValue, FloatVid, GenericArgKind, InferConst, InferTy,
- IntVarValue, IntVid, OutlivesPredicate, RegionVid, TyVid, UniverseIndex,
+ IntVarValue, IntVid, OutlivesPredicate, RegionVid, TermKind, TyVid, TypeFoldable, TypeFolder,
+ TypeSuperFoldable, TypeVisitableExt, UniverseIndex,
+ error::{ExpectedFound, TypeError},
+ inherent::{
+ Const as _, GenericArg as _, GenericArgs as _, IntoKind, SliceLike, Term as _, Ty as _,
+ },
};
-use rustc_type_ir::{TermKind, TypeVisitableExt};
use snapshot::undo_log::InferCtxtUndoLogs;
use tracing::{debug, instrument};
use traits::{ObligationCause, PredicateObligations};
use type_variable::TypeVariableOrigin;
use unify_key::{ConstVariableOrigin, ConstVariableValue, ConstVidKey};
-use crate::next_solver::fold::BoundVarReplacerDelegate;
-use crate::next_solver::infer::select::EvaluationResult;
-use crate::next_solver::infer::traits::PredicateObligation;
-use crate::next_solver::obligation_ctxt::ObligationCtxt;
-use crate::next_solver::{BoundConst, BoundRegion, BoundTy, BoundVarKind, Goal, SolverContext};
+use crate::next_solver::{
+ BoundConst, BoundRegion, BoundTy, BoundVarKind, Goal, SolverContext,
+ fold::BoundVarReplacerDelegate,
+ infer::{select::EvaluationResult, traits::PredicateObligation},
+ obligation_ctxt::ObligationCtxt,
+};
use super::{
AliasTerm, Binder, CanonicalQueryInput, CanonicalVarValues, Const, ConstKind, DbInterner,
@@ -46,7 +46,7 @@
pub mod at;
pub mod canonical;
mod context;
-mod opaque_types;
+pub mod opaque_types;
pub mod region_constraints;
pub mod relate;
pub mod resolve;
@@ -400,6 +400,46 @@ pub fn predicate_may_hold_opaque_types_jank(
))
}
+ pub(crate) fn insert_type_vars<T>(&self, ty: T) -> T
+ where
+ T: TypeFoldable<DbInterner<'db>>,
+ {
+ struct Folder<'a, 'db> {
+ infcx: &'a InferCtxt<'db>,
+ }
+ impl<'db> TypeFolder<DbInterner<'db>> for Folder<'_, 'db> {
+ fn cx(&self) -> DbInterner<'db> {
+ self.infcx.interner
+ }
+
+ fn fold_ty(&mut self, ty: Ty<'db>) -> Ty<'db> {
+ if !ty.references_error() {
+ return ty;
+ }
+
+ if ty.is_ty_error() { self.infcx.next_ty_var() } else { ty.super_fold_with(self) }
+ }
+
+ fn fold_const(&mut self, ct: Const<'db>) -> Const<'db> {
+ if !ct.references_error() {
+ return ct;
+ }
+
+ if ct.is_ct_error() {
+ self.infcx.next_const_var()
+ } else {
+ ct.super_fold_with(self)
+ }
+ }
+
+ fn fold_region(&mut self, r: Region<'db>) -> Region<'db> {
+ if r.is_error() { self.infcx.next_region_var() } else { r }
+ }
+ }
+
+ ty.fold_with(&mut Folder { infcx: self })
+ }
+
/// Evaluates whether the predicate can be satisfied in the given
/// `ParamEnv`, and returns `false` if not certain. However, this is
/// not entirely accurate if inference variables are involved.
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs
index 06d9984..6b6104b 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/mod.rs
@@ -4,9 +4,11 @@
pub(crate) use table::{OpaqueTypeStorage, OpaqueTypeTable};
+use macros::{TypeFoldable, TypeVisitable};
+
use crate::next_solver::{OpaqueTypeKey, Ty, infer::InferCtxt};
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, TypeVisitable, TypeFoldable)]
pub struct OpaqueHiddenType<'db> {
pub ty: Ty<'db>,
}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs
index 0f8b238..00177d2 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/opaque_types/table.rs
@@ -122,14 +122,6 @@ pub(crate) fn with_log<'a>(
}
}
-impl<'db> Drop for OpaqueTypeStorage<'db> {
- fn drop(&mut self) {
- if !self.opaque_types.is_empty() {
- panic!("{:?}", self.opaque_types)
- }
- }
-}
-
pub(crate) struct OpaqueTypeTable<'a, 'db> {
storage: &'a mut OpaqueTypeStorage<'db>,
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs
index c1ccbaf..b18e08b 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs
@@ -7,8 +7,8 @@
use base_db::Crate;
use hir_def::{
- AdtId, AttrDefId, BlockId, CallableDefId, EnumVariantId, ItemContainerId, StructId, UnionId,
- VariantId,
+ AdtId, AttrDefId, BlockId, CallableDefId, DefWithBodyId, EnumVariantId, ItemContainerId,
+ StructId, UnionId, VariantId,
lang_item::LangItem,
signatures::{FieldData, FnFlags, ImplFlags, StructFlags, TraitFlags},
};
@@ -29,7 +29,7 @@
use crate::{
FnAbi,
- db::{HirDatabase, InternedCoroutine},
+ db::{HirDatabase, InternedCoroutine, InternedCoroutineId},
method_resolution::{ALL_FLOAT_FPS, ALL_INT_FPS, TyFingerprint},
next_solver::{
AdtIdWrapper, BoundConst, CallableIdWrapper, CanonicalVarKind, ClosureIdWrapper,
@@ -96,7 +96,7 @@ fn visit_with<V: rustc_type_ir::TypeVisitor<DbInterner<'db>>>(
}
};
($name:ident, $ty:ty, nofold) => {
- #[salsa::interned(constructor = new_, debug)]
+ #[salsa::interned(constructor = new_)]
pub struct $name {
#[returns(ref)]
inner_: smallvec::SmallVec<[$ty; 2]>,
@@ -119,6 +119,12 @@ pub fn new_from_iter(
}
}
+ impl<'db> std::fmt::Debug for $name<'db> {
+ fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ self.as_slice().fmt(fmt)
+ }
+ }
+
impl<'db> rustc_type_ir::inherent::SliceLike for $name<'db> {
type Item = $ty;
@@ -1866,9 +1872,42 @@ fn replace_const(&mut self, bv: BoundConst) -> Const<'db> {
Binder::bind_with_vars(inner, bound_vars)
}
- fn opaque_types_defined_by(self, _defining_anchor: Self::LocalDefId) -> Self::LocalDefIds {
- // FIXME(next-solver)
- SolverDefIds::new_from_iter(self, [])
+ fn opaque_types_defined_by(self, def_id: Self::LocalDefId) -> Self::LocalDefIds {
+ let Ok(def_id) = DefWithBodyId::try_from(def_id) else {
+ return SolverDefIds::default();
+ };
+ let mut result = Vec::new();
+ crate::opaques::opaque_types_defined_by(self.db, def_id, &mut result);
+ SolverDefIds::new_from_iter(self, result)
+ }
+
+ fn opaque_types_and_coroutines_defined_by(self, def_id: Self::LocalDefId) -> Self::LocalDefIds {
+ let Ok(def_id) = DefWithBodyId::try_from(def_id) else {
+ return SolverDefIds::default();
+ };
+ let mut result = Vec::new();
+
+ crate::opaques::opaque_types_defined_by(self.db, def_id, &mut result);
+
+ // Collect coroutines.
+ let body = self.db.body(def_id);
+ body.exprs().for_each(|(expr_id, expr)| {
+ if matches!(
+ expr,
+ hir_def::hir::Expr::Async { .. }
+ | hir_def::hir::Expr::Closure {
+ closure_kind: hir_def::hir::ClosureKind::Async
+ | hir_def::hir::ClosureKind::Coroutine(_),
+ ..
+ }
+ ) {
+ let coroutine =
+ InternedCoroutineId::new(self.db, InternedCoroutine(def_id, expr_id));
+ result.push(coroutine.into());
+ }
+ });
+
+ SolverDefIds::new_from_iter(self, result)
}
fn alias_has_const_conditions(self, _def_id: Self::DefId) -> bool {
@@ -1913,12 +1952,10 @@ fn type_of_opaque_hir_typeck(self, def_id: Self::LocalDefId) -> EarlyBinder<Self
let impl_trait_id = self.db().lookup_intern_impl_trait_id(opaque);
match impl_trait_id {
crate::ImplTraitId::ReturnTypeImplTrait(func, idx) => {
- let infer = self.db().infer(func.into());
- EarlyBinder::bind(infer.type_of_rpit[idx])
+ crate::opaques::rpit_hidden_types(self.db, func)[idx]
}
- crate::ImplTraitId::TypeAliasImplTrait(..) => {
- // FIXME(next-solver)
- EarlyBinder::bind(Ty::new_error(self, ErrorGuaranteed))
+ crate::ImplTraitId::TypeAliasImplTrait(type_alias, idx) => {
+ crate::opaques::tait_hidden_types(self.db, type_alias)[idx]
}
}
}
@@ -1969,13 +2006,6 @@ fn next_trait_solver_globally(self) -> bool {
true
}
- fn opaque_types_and_coroutines_defined_by(
- self,
- _defining_anchor: Self::LocalDefId,
- ) -> Self::LocalDefIds {
- Default::default()
- }
-
type Probe = rustc_type_ir::solve::inspect::Probe<DbInterner<'db>>;
fn mk_probe(self, probe: rustc_type_ir::solve::inspect::Probe<Self>) -> Self::Probe {
probe
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs
index 487d164..7b96b40 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs
@@ -2,17 +2,22 @@
use hir_def::{AssocItemId, GeneralConstId};
use rustc_next_trait_solver::delegate::SolverDelegate;
-use rustc_type_ir::GenericArgKind;
-use rustc_type_ir::lang_items::SolverTraitLangItem;
use rustc_type_ir::{
- InferCtxtLike, Interner, PredicatePolarity, TypeFlags, TypeVisitableExt,
- inherent::{IntoKind, Term as _, Ty as _},
+ AliasTyKind, GenericArgKind, InferCtxtLike, Interner, PredicatePolarity, TypeFlags,
+ TypeVisitableExt,
+ inherent::{IntoKind, SliceLike, Term as _, Ty as _},
+ lang_items::SolverTraitLangItem,
solve::{Certainty, NoSolution},
};
+use tracing::debug;
-use crate::next_solver::{CanonicalVarKind, ImplIdWrapper};
-use crate::next_solver::{
- ClauseKind, CoercePredicate, PredicateKind, SubtypePredicate, util::sizedness_fast_path,
+use crate::{
+ ImplTraitId,
+ next_solver::{
+ AliasTy, CanonicalVarKind, Clause, ClauseKind, CoercePredicate, GenericArgs, ImplIdWrapper,
+ ParamEnv, Predicate, PredicateKind, SubtypePredicate, Ty, TyKind, fold::fold_tys,
+ util::sizedness_fast_path,
+ },
};
use super::{
@@ -76,7 +81,7 @@ fn leak_check(
fn well_formed_goals(
&self,
- _param_env: <Self::Interner as rustc_type_ir::Interner>::ParamEnv,
+ _param_env: ParamEnv<'db>,
_arg: <Self::Interner as rustc_type_ir::Interner>::Term,
) -> Option<
Vec<
@@ -125,18 +130,60 @@ fn instantiate_canonical_var(
fn add_item_bounds_for_hidden_type(
&self,
- _def_id: <Self::Interner as rustc_type_ir::Interner>::DefId,
- _args: <Self::Interner as rustc_type_ir::Interner>::GenericArgs,
- _param_env: <Self::Interner as rustc_type_ir::Interner>::ParamEnv,
- _hidden_ty: <Self::Interner as rustc_type_ir::Interner>::Ty,
- _goals: &mut Vec<
- rustc_type_ir::solve::Goal<
- Self::Interner,
- <Self::Interner as rustc_type_ir::Interner>::Predicate,
- >,
- >,
+ def_id: SolverDefId,
+ args: GenericArgs<'db>,
+ param_env: ParamEnv<'db>,
+ hidden_ty: Ty<'db>,
+ goals: &mut Vec<Goal<'db, Predicate<'db>>>,
) {
- unimplemented!()
+ let interner = self.interner;
+ let opaque_id = def_id.expect_opaque_ty();
+ // Require that the hidden type is well-formed. We have to
+ // make sure we wf-check the hidden type to fix #114728.
+ //
+ // However, we don't check that all types are well-formed.
+ // We only do so for types provided by the user or if they are
+ // "used", e.g. for method selection.
+ //
+ // This means we never check the wf requirements of the hidden
+ // type during MIR borrowck, causing us to infer the wrong
+ // lifetime for its member constraints which then results in
+ // unexpected region errors.
+ goals.push(Goal::new(interner, param_env, ClauseKind::WellFormed(hidden_ty.into())));
+
+ let replace_opaques_in = |clause: Clause<'db>| {
+ fold_tys(interner, clause, |ty| match ty.kind() {
+ // Replace all other mentions of the same opaque type with the hidden type,
+ // as the bounds must hold on the hidden type after all.
+ TyKind::Alias(
+ AliasTyKind::Opaque,
+ AliasTy { def_id: def_id2, args: args2, .. },
+ ) if def_id == def_id2 && args == args2 => hidden_ty,
+ _ => ty,
+ })
+ };
+
+ let db = interner.db;
+ let (opaques_table, opaque_idx) = match opaque_id.loc(db) {
+ ImplTraitId::ReturnTypeImplTrait(func, opaque_idx) => {
+ (db.return_type_impl_traits(func), opaque_idx)
+ }
+ ImplTraitId::TypeAliasImplTrait(type_alias, opaque_idx) => {
+ (db.type_alias_impl_traits(type_alias), opaque_idx)
+ }
+ };
+ let item_bounds = opaques_table
+ .as_deref()
+ .unwrap()
+ .as_ref()
+ .map_bound(|table| &table.impl_traits[opaque_idx].predicates);
+ for predicate in item_bounds.iter_instantiated_copied(interner, args.as_slice()) {
+ let predicate = replace_opaques_in(predicate);
+
+ // Require that the predicate holds for the concrete type.
+ debug!(?predicate);
+ goals.push(Goal::new(interner, param_env, predicate));
+ }
}
fn fetch_eligible_assoc_item(
@@ -190,8 +237,8 @@ fn fetch_eligible_assoc_item(
fn is_transmutable(
&self,
- _dst: <Self::Interner as rustc_type_ir::Interner>::Ty,
- _src: <Self::Interner as rustc_type_ir::Interner>::Ty,
+ _dst: Ty<'db>,
+ _src: Ty<'db>,
_assume: <Self::Interner as rustc_type_ir::Interner>::Const,
) -> Result<Certainty, NoSolution> {
unimplemented!()
@@ -199,7 +246,7 @@ fn is_transmutable(
fn evaluate_const(
&self,
- _param_env: <Self::Interner as rustc_type_ir::Interner>::ParamEnv,
+ _param_env: ParamEnv<'db>,
uv: rustc_type_ir::UnevaluatedConst<Self::Interner>,
) -> Option<<Self::Interner as rustc_type_ir::Interner>::Const> {
let c = match uv.def {
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/opaques.rs b/src/tools/rust-analyzer/crates/hir-ty/src/opaques.rs
new file mode 100644
index 0000000..8531f24
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/opaques.rs
@@ -0,0 +1,199 @@
+//! Handling of opaque types, detection of defining scope and hidden type.
+
+use hir_def::{
+ AssocItemId, AssocItemLoc, DefWithBodyId, FunctionId, HasModule, ItemContainerId, TypeAliasId,
+};
+use hir_expand::name::Name;
+use la_arena::ArenaMap;
+use rustc_type_ir::inherent::Ty as _;
+use syntax::ast;
+use triomphe::Arc;
+
+use crate::{
+ ImplTraitId,
+ db::{HirDatabase, InternedOpaqueTyId},
+ lower::{ImplTraitIdx, ImplTraits},
+ next_solver::{
+ DbInterner, EarlyBinder, ErrorGuaranteed, SolverDefId, Ty, TypingMode,
+ infer::{DbInternerInferExt, traits::ObligationCause},
+ obligation_ctxt::ObligationCtxt,
+ },
+};
+
+pub(crate) fn opaque_types_defined_by(
+ db: &dyn HirDatabase,
+ def_id: DefWithBodyId,
+ result: &mut Vec<SolverDefId>,
+) {
+ if let DefWithBodyId::FunctionId(func) = def_id {
+ // A function may define its own RPITs.
+ extend_with_opaques(
+ db,
+ db.return_type_impl_traits(func),
+ |opaque_idx| ImplTraitId::ReturnTypeImplTrait(func, opaque_idx),
+ result,
+ );
+ }
+
+ let extend_with_taits = |type_alias| {
+ extend_with_opaques(
+ db,
+ db.type_alias_impl_traits(type_alias),
+ |opaque_idx| ImplTraitId::TypeAliasImplTrait(type_alias, opaque_idx),
+ result,
+ );
+ };
+
+ // Collect opaques from assoc items.
+ let extend_with_atpit_from_assoc_items = |assoc_items: &[(Name, AssocItemId)]| {
+ assoc_items
+ .iter()
+ .filter_map(|&(_, assoc_id)| match assoc_id {
+ AssocItemId::TypeAliasId(it) => Some(it),
+ AssocItemId::FunctionId(_) | AssocItemId::ConstId(_) => None,
+ })
+ .for_each(extend_with_taits);
+ };
+ let extend_with_atpit_from_container = |container| match container {
+ ItemContainerId::ImplId(impl_id) => {
+ if db.impl_signature(impl_id).target_trait.is_some() {
+ extend_with_atpit_from_assoc_items(&impl_id.impl_items(db).items);
+ }
+ }
+ ItemContainerId::TraitId(trait_id) => {
+ extend_with_atpit_from_assoc_items(&trait_id.trait_items(db).items);
+ }
+ _ => {}
+ };
+ match def_id {
+ DefWithBodyId::ConstId(id) => extend_with_atpit_from_container(id.loc(db).container),
+ DefWithBodyId::FunctionId(id) => extend_with_atpit_from_container(id.loc(db).container),
+ DefWithBodyId::StaticId(_) | DefWithBodyId::VariantId(_) => {}
+ }
+
+ // FIXME: Collect opaques from `#[define_opaque]`.
+
+ fn extend_with_opaques<'db>(
+ db: &'db dyn HirDatabase,
+ opaques: Option<Arc<EarlyBinder<'db, ImplTraits<'db>>>>,
+ mut make_impl_trait: impl FnMut(ImplTraitIdx<'db>) -> ImplTraitId<'db>,
+ result: &mut Vec<SolverDefId>,
+ ) {
+ if let Some(opaques) = opaques {
+ for (opaque_idx, _) in (*opaques).as_ref().skip_binder().impl_traits.iter() {
+ let opaque_id = InternedOpaqueTyId::new(db, make_impl_trait(opaque_idx));
+ result.push(opaque_id.into());
+ }
+ }
+ }
+}
+
+// These are firewall queries to prevent drawing dependencies between infers:
+
+#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
+pub(crate) fn rpit_hidden_types<'db>(
+ db: &'db dyn HirDatabase,
+ function: FunctionId,
+) -> ArenaMap<ImplTraitIdx<'db>, EarlyBinder<'db, Ty<'db>>> {
+ let infer = db.infer(function.into());
+ let mut result = ArenaMap::new();
+ for (opaque, hidden_type) in infer.return_position_impl_trait_types(db) {
+ result.insert(opaque, EarlyBinder::bind(hidden_type));
+ }
+ result.shrink_to_fit();
+ result
+}
+
+#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
+pub(crate) fn tait_hidden_types<'db>(
+ db: &'db dyn HirDatabase,
+ type_alias: TypeAliasId,
+) -> ArenaMap<ImplTraitIdx<'db>, EarlyBinder<'db, Ty<'db>>> {
+ let loc = type_alias.loc(db);
+ let module = loc.module(db);
+ let interner = DbInterner::new_with(db, Some(module.krate()), module.containing_block());
+ let infcx = interner.infer_ctxt().build(TypingMode::non_body_analysis());
+ let mut ocx = ObligationCtxt::new(&infcx);
+ let cause = ObligationCause::dummy();
+ let param_env = db.trait_environment(type_alias.into()).env;
+
+ let defining_bodies = tait_defining_bodies(db, &loc);
+
+ let taits_count = db
+ .type_alias_impl_traits(type_alias)
+ .map_or(0, |taits| (*taits).as_ref().skip_binder().impl_traits.len());
+
+ let mut result = ArenaMap::with_capacity(taits_count);
+ for defining_body in defining_bodies {
+ let infer = db.infer(defining_body);
+ for (&opaque, &hidden_type) in &infer.type_of_opaque {
+ let ImplTraitId::TypeAliasImplTrait(opaque_owner, opaque_idx) = opaque.loc(db) else {
+ continue;
+ };
+ if opaque_owner != type_alias {
+ continue;
+ }
+ // In the presence of errors, we attempt to create a unified type from all
+ // types. rustc doesn't do that, but this should improve the experience.
+ let hidden_type = infcx.insert_type_vars(hidden_type);
+ match result.entry(opaque_idx) {
+ la_arena::Entry::Vacant(entry) => {
+ entry.insert(EarlyBinder::bind(hidden_type));
+ }
+ la_arena::Entry::Occupied(entry) => {
+ _ = ocx.eq(&cause, param_env, entry.get().instantiate_identity(), hidden_type);
+ }
+ }
+ }
+ }
+
+ _ = ocx.try_evaluate_obligations();
+
+ // Fill missing entries.
+ for idx in 0..taits_count {
+ let idx = la_arena::Idx::from_raw(la_arena::RawIdx::from_u32(idx as u32));
+ match result.entry(idx) {
+ la_arena::Entry::Vacant(entry) => {
+ entry.insert(EarlyBinder::bind(Ty::new_error(interner, ErrorGuaranteed)));
+ }
+ la_arena::Entry::Occupied(mut entry) => {
+ *entry.get_mut() = entry.get().map_bound(|hidden_type| {
+ infcx.resolve_vars_if_possible(hidden_type).replace_infer_with_error(interner)
+ });
+ }
+ }
+ }
+
+ result
+}
+
+fn tait_defining_bodies(
+ db: &dyn HirDatabase,
+ loc: &AssocItemLoc<ast::TypeAlias>,
+) -> Vec<DefWithBodyId> {
+ let from_assoc_items = |assoc_items: &[(Name, AssocItemId)]| {
+ // Associated Type Position Impl Trait.
+ assoc_items
+ .iter()
+ .filter_map(|&(_, assoc_id)| match assoc_id {
+ AssocItemId::FunctionId(it) => Some(it.into()),
+ AssocItemId::ConstId(it) => Some(it.into()),
+ AssocItemId::TypeAliasId(_) => None,
+ })
+ .collect()
+ };
+ match loc.container {
+ ItemContainerId::ImplId(impl_id) => {
+ if db.impl_signature(impl_id).target_trait.is_some() {
+ return from_assoc_items(&impl_id.impl_items(db).items);
+ }
+ }
+ ItemContainerId::TraitId(trait_id) => {
+ return from_assoc_items(&trait_id.trait_items(db).items);
+ }
+ _ => {}
+ }
+
+ // FIXME: Support general TAITs, or decisively decide not to.
+ Vec::new()
+}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs b/src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs
index 611947b..f4ee4de 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/specialization.rs
@@ -20,7 +20,7 @@
// and indeed I was unable to cause cycles even with erroneous code. However, in r-a we can
// create a cycle if there is an error in the impl's where clauses. I believe well formed code
// cannot create a cycle, but a cycle handler is required nevertheless.
-fn specializes_cycle(
+fn specializes_query_cycle(
_db: &dyn HirDatabase,
_specializing_impl_def_id: ImplId,
_parent_impl_def_id: ImplId,
@@ -39,31 +39,14 @@ fn specializes_cycle(
/// `parent_impl_def_id` is a const impl (conditionally based off of some `[const]`
/// bounds), then `specializing_impl_def_id` must also be const for the same
/// set of types.
-#[salsa::tracked(cycle_result = specializes_cycle)]
-pub(crate) fn specializes(
+#[salsa::tracked(cycle_result = specializes_query_cycle)]
+fn specializes_query(
db: &dyn HirDatabase,
specializing_impl_def_id: ImplId,
parent_impl_def_id: ImplId,
) -> bool {
- let module = specializing_impl_def_id.loc(db).container;
-
- // We check that the specializing impl comes from a crate that has specialization enabled.
- //
- // We don't really care if the specialized impl (the parent) is in a crate that has
- // specialization enabled, since it's not being specialized.
- //
- // rustc also checks whether the specializing impls comes from a macro marked
- // `#[allow_internal_unstable(specialization)]`, but `#[allow_internal_unstable]`
- // is an internal feature, std is not using it for specialization nor is likely to
- // ever use it, and we don't have the span information necessary to replicate that.
- let def_map = crate_def_map(db, module.krate());
- if !def_map.is_unstable_feature_enabled(&sym::specialization)
- && !def_map.is_unstable_feature_enabled(&sym::min_specialization)
- {
- return false;
- }
-
- let interner = DbInterner::new_with(db, Some(module.krate()), module.containing_block());
+ let trait_env = db.trait_environment(specializing_impl_def_id.into());
+ let interner = DbInterner::new_with(db, Some(trait_env.krate), trait_env.block);
let specializing_impl_signature = db.impl_signature(specializing_impl_def_id);
let parent_impl_signature = db.impl_signature(parent_impl_def_id);
@@ -87,7 +70,7 @@ pub(crate) fn specializes(
// create a parameter environment corresponding to an identity instantiation of the specializing impl,
// i.e. the most generic instantiation of the specializing impl.
- let param_env = db.trait_environment(specializing_impl_def_id.into()).env;
+ let param_env = trait_env.env;
// Create an infcx, taking the predicates of the specializing impl as assumptions:
let infcx = interner.infer_ctxt().build(TypingMode::non_body_analysis());
@@ -148,3 +131,31 @@ pub(crate) fn specializes(
true
}
+
+// This function is used to avoid creating the query for crates that does not define `#![feature(specialization)]`,
+// as the solver is calling this a lot, and creating the query consumes a lot of memory.
+pub(crate) fn specializes(
+ db: &dyn HirDatabase,
+ specializing_impl_def_id: ImplId,
+ parent_impl_def_id: ImplId,
+) -> bool {
+ let module = specializing_impl_def_id.loc(db).container;
+
+ // We check that the specializing impl comes from a crate that has specialization enabled.
+ //
+ // We don't really care if the specialized impl (the parent) is in a crate that has
+ // specialization enabled, since it's not being specialized.
+ //
+ // rustc also checks whether the specializing impls comes from a macro marked
+ // `#[allow_internal_unstable(specialization)]`, but `#[allow_internal_unstable]`
+ // is an internal feature, std is not using it for specialization nor is likely to
+ // ever use it, and we don't have the span information necessary to replicate that.
+ let def_map = crate_def_map(db, module.krate());
+ if !def_map.is_unstable_feature_enabled(&sym::specialization)
+ && !def_map.is_unstable_feature_enabled(&sym::min_specialization)
+ {
+ return false;
+ }
+
+ specializes_query(db, specializing_impl_def_id, parent_impl_def_id)
+}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs
index bc47019..14ec161 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/incremental.rs
@@ -591,6 +591,7 @@ fn main() {
"function_signature_shim",
"function_signature_with_source_map_shim",
"trait_environment_shim",
+ "return_type_impl_traits_shim",
"expr_scopes_shim",
"struct_signature_shim",
"struct_signature_with_source_map_shim",
@@ -686,6 +687,7 @@ fn main() {
"return_type_impl_traits_shim",
"infer_shim",
"function_signature_with_source_map_shim",
+ "return_type_impl_traits_shim",
"expr_scopes_shim",
"struct_signature_with_source_map_shim",
"generic_predicates_shim",
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs
index 5cdd170..ca98633 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/opaque_types.rs
@@ -31,7 +31,6 @@ fn test() {
}
#[test]
-#[ignore = "FIXME(next-solver): This currently generates a type mismatch, need to switch opaque type handling to the solver"]
fn associated_type_impl_traits_complex() {
check_types(
r#"
@@ -116,6 +115,7 @@ fn foo() {
);
}
+#[ignore = "FIXME(next-solver): TAIT support was removed, need to rework it to work with `#[define_opaque]`"]
#[test]
fn type_alias_impl_trait_simple() {
check_no_mismatches(
@@ -135,9 +135,6 @@ impl Trait for Struct {}
"#,
);
- // FIXME(next-solver): This should emit type mismatch error but leaving it for now
- // as we should fully migrate into next-solver without chalk-ir and TAIT should be
- // reworked on r-a to handle `#[define_opaque(T)]`
check_infer_with_mismatches(
r#"
trait Trait {}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs
index 7c79393..75d3203 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression.rs
@@ -725,7 +725,7 @@ fn bar<R, K>(key: &K) -> impl Future<Output = K::Bar>
138..146 'bar(key)': impl Future<Output = <K as Foo<R>>::Bar>
142..145 'key': &'? K
162..165 'key': &'? K
- 224..227 '{ }': ()
+ 224..227 '{ }': impl Future<Output = <K as Foo<R>>::Bar>
"#]],
);
}
@@ -2506,3 +2506,19 @@ fn main() {
"#,
);
}
+
+#[test]
+fn module_inside_block() {
+ check_types(
+ r#"
+fn foo() {
+ mod my_mod {
+ pub type Bool = bool;
+ }
+
+ let _: my_mod::Bool;
+ // ^ bool
+}
+ "#,
+ );
+}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs
index f8b73cd..64c69af 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs
@@ -180,7 +180,7 @@ fn into_iter(self) -> Self::IntoIter {
"#,
expect![[r#"
150..154 'self': &'a Grid
- 174..181 '{ }': impl Iterator<Item = &'a ()>
+ 174..181 '{ }': <&'a Grid as IntoIterator>::IntoIter
"#]],
);
}
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs
index f72ca22..c0e4393 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/traits.rs
@@ -1211,7 +1211,7 @@ fn test(x: impl Trait<u64>, y: &impl Trait<u64>) {
expect![[r#"
29..33 'self': &'? Self
54..58 'self': &'? Self
- 98..100 '{}': ()
+ 98..100 '{}': impl Trait<u64>
110..111 'x': impl Trait<u64>
130..131 'y': &'? impl Trait<u64>
151..268 '{ ...2(); }': ()
@@ -1373,11 +1373,11 @@ fn test() {
expect![[r#"
49..53 'self': &'? mut Self
101..105 'self': &'? Self
- 184..195 '{ loop {} }': ({unknown}, {unknown})
+ 184..195 '{ loop {} }': (impl Iterator<Item = impl Trait<u32>>, impl Trait<u64>)
186..193 'loop {}': !
191..193 '{}': ()
206..207 't': T
- 268..279 '{ loop {} }': ({unknown}, {unknown})
+ 268..279 '{ loop {} }': (impl Iterator<Item = impl Trait<T>>, impl Trait<T>)
270..277 'loop {}': !
275..277 '{}': ()
291..413 '{ ...o(); }': ()
@@ -1419,7 +1419,7 @@ fn foo<const C: u8, T>() -> (impl FnOnce(&str, T), impl Trait<u8>) {
}
"#,
expect![[r#"
- 134..165 '{ ...(C)) }': (impl FnOnce(&'? str, T), Bar<u8>)
+ 134..165 '{ ...(C)) }': (impl FnOnce(&'? str, T), impl Trait<u8>)
140..163 '(|inpu...ar(C))': (impl FnOnce(&'? str, T), Bar<u8>)
141..154 '|input, t| {}': impl FnOnce(&'? str, T)
142..147 'input': &'? str
@@ -1441,7 +1441,7 @@ fn return_pos_impl_trait_in_projection() {
trait Future { type Output; }
impl Future for () { type Output = i32; }
type Foo<F> = (<F as Future>::Output, F);
-fn foo<X>() -> Foo<impl Future<Output = ()>> {
+fn foo<X>() -> Foo<impl Future<Output = i32>> {
(0, ())
}
"#,
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/traits.rs b/src/tools/rust-analyzer/crates/hir-ty/src/traits.rs
index 7f6d4ff..00c8eb7 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/traits.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/traits.rs
@@ -107,24 +107,26 @@ pub fn next_trait_solve_canonical_in_ctxt<'db>(
infer_ctxt: &InferCtxt<'db>,
goal: Canonical<'db, Goal<'db, Predicate<'db>>>,
) -> NextTraitSolveResult {
- let context = SolverContext(infer_ctxt.clone());
+ infer_ctxt.probe(|_| {
+ let context = <&SolverContext<'db>>::from(infer_ctxt);
- tracing::info!(?goal);
+ tracing::info!(?goal);
- let (goal, var_values) = context.instantiate_canonical(&goal);
- tracing::info!(?var_values);
+ let (goal, var_values) = context.instantiate_canonical(&goal);
+ tracing::info!(?var_values);
- let res = context.evaluate_root_goal(goal, Span::dummy(), None);
+ let res = context.evaluate_root_goal(goal, Span::dummy(), None);
- let res = res.map(|r| (r.has_changed, r.certainty));
+ let res = res.map(|r| (r.has_changed, r.certainty));
- tracing::debug!("solve_nextsolver({:?}) => {:?}", goal, res);
+ tracing::debug!("solve_nextsolver({:?}) => {:?}", goal, res);
- match res {
- Err(_) => NextTraitSolveResult::NoSolution,
- Ok((_, Certainty::Yes)) => NextTraitSolveResult::Certain,
- Ok((_, Certainty::Maybe { .. })) => NextTraitSolveResult::Uncertain,
- }
+ match res {
+ Err(_) => NextTraitSolveResult::NoSolution,
+ Ok((_, Certainty::Yes)) => NextTraitSolveResult::Certain,
+ Ok((_, Certainty::Maybe { .. })) => NextTraitSolveResult::Uncertain,
+ }
+ })
}
/// Solve a trait goal using next trait solver.
diff --git a/src/tools/rust-analyzer/crates/hir/src/lib.rs b/src/tools/rust-analyzer/crates/hir/src/lib.rs
index 2bb2f80..f2faf99 100644
--- a/src/tools/rust-analyzer/crates/hir/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/hir/src/lib.rs
@@ -5136,10 +5136,7 @@ pub fn normalize_trait_assoc_type(
AliasTy::new(interner, alias.id.into(), args),
);
- // FIXME(next-solver): This needs to be `PostAnalysis`, but this currently causes errors due to our incorrect
- // handling of opaques. `non_body_analysis()` will also cause errors (from not revealing opaques inside their
- // defining places), so we choose between two bad options.
- let infcx = interner.infer_ctxt().build(TypingMode::non_body_analysis());
+ let infcx = interner.infer_ctxt().build(TypingMode::PostAnalysis);
let ty = structurally_normalize_ty(&infcx, projection, self.env.clone());
if ty.is_ty_error() { None } else { Some(self.derived(ty)) }
}
@@ -5758,8 +5755,7 @@ pub fn layout(&self, db: &'db dyn HirDatabase) -> Result<Layout, LayoutError> {
pub fn drop_glue(&self, db: &'db dyn HirDatabase) -> DropGlue {
let interner = DbInterner::new_with(db, Some(self.env.krate), self.env.block);
- // FIXME: This should be `PostAnalysis` I believe.
- let infcx = interner.infer_ctxt().build(TypingMode::non_body_analysis());
+ let infcx = interner.infer_ctxt().build(TypingMode::PostAnalysis);
hir_ty::drop::has_drop_glue(&infcx, self.ty, self.env.clone())
}
}
diff --git a/src/tools/rust-analyzer/crates/hir/src/semantics.rs b/src/tools/rust-analyzer/crates/hir/src/semantics.rs
index 62ce3da..ec43442 100644
--- a/src/tools/rust-analyzer/crates/hir/src/semantics.rs
+++ b/src/tools/rust-analyzer/crates/hir/src/semantics.rs
@@ -2105,6 +2105,22 @@ pub fn is_inside_unsafe(&self, expr: &ast::Expr) -> bool {
parent = parent_;
}
}
+
+ pub fn impl_generated_from_derive(&self, impl_: Impl) -> Option<Adt> {
+ let source = hir_def::src::HasSource::ast_ptr(&impl_.id.loc(self.db), self.db);
+ let mut file_id = source.file_id;
+ let adt_ast_id = loop {
+ let macro_call = file_id.macro_file()?;
+ match macro_call.loc(self.db).kind {
+ hir_expand::MacroCallKind::Derive { ast_id, .. } => break ast_id,
+ hir_expand::MacroCallKind::FnLike { ast_id, .. } => file_id = ast_id.file_id,
+ hir_expand::MacroCallKind::Attr { ast_id, .. } => file_id = ast_id.file_id,
+ }
+ };
+ let adt_source = adt_ast_id.to_in_file_node(self.db);
+ self.cache(adt_source.value.syntax().ancestors().last().unwrap(), adt_source.file_id);
+ ToDef::to_def(self, adt_source.as_ref())
+ }
}
// FIXME This can't be the best way to do this
diff --git a/src/tools/rust-analyzer/crates/hir/src/source_analyzer.rs b/src/tools/rust-analyzer/crates/hir/src/source_analyzer.rs
index 15eab14..f994ed2 100644
--- a/src/tools/rust-analyzer/crates/hir/src/source_analyzer.rs
+++ b/src/tools/rust-analyzer/crates/hir/src/source_analyzer.rs
@@ -1594,14 +1594,12 @@ fn resolve_hir_path_(
Some(unresolved) => resolver
.generic_def()
.and_then(|def| {
- hir_ty::attach_db(db, || {
- hir_ty::associated_type_shorthand_candidates(
- db,
- def,
- res.in_type_ns()?,
- |name, _| name == unresolved.name,
- )
- })
+ hir_ty::associated_type_shorthand_candidates(
+ db,
+ def,
+ res.in_type_ns()?,
+ |name, _| name == unresolved.name,
+ )
})
.map(TypeAlias::from)
.map(Into::into)
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_range_for_to_while.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
new file mode 100644
index 0000000..68cb764
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
@@ -0,0 +1,259 @@
+use ide_db::assists::AssistId;
+use itertools::Itertools;
+use syntax::{
+ AstNode, T,
+ algo::previous_non_trivia_token,
+ ast::{
+ self, HasArgList, HasLoopBody, HasName, RangeItem, edit::AstNodeEdit, make,
+ syntax_factory::SyntaxFactory,
+ },
+ syntax_editor::{Element, Position},
+};
+
+use crate::assist_context::{AssistContext, Assists};
+
+// Assist: convert_range_for_to_while
+//
+// Convert for each range into while loop.
+//
+// ```
+// fn foo() {
+// $0for i in 3..7 {
+// foo(i);
+// }
+// }
+// ```
+// ->
+// ```
+// fn foo() {
+// let mut i = 3;
+// while i < 7 {
+// foo(i);
+// i += 1;
+// }
+// }
+// ```
+pub(crate) fn convert_range_for_to_while(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
+ let for_kw = ctx.find_token_syntax_at_offset(T![for])?;
+ let for_ = ast::ForExpr::cast(for_kw.parent()?)?;
+ let ast::Pat::IdentPat(pat) = for_.pat()? else { return None };
+ let iterable = for_.iterable()?;
+ let (start, end, step, inclusive) = extract_range(&iterable)?;
+ let name = pat.name()?;
+ let body = for_.loop_body()?;
+ let last = previous_non_trivia_token(body.stmt_list()?.r_curly_token()?)?;
+
+ let description = if end.is_some() {
+ "Replace with while expression"
+ } else {
+ "Replace with loop expression"
+ };
+ acc.add(
+ AssistId::refactor("convert_range_for_to_while"),
+ description,
+ for_.syntax().text_range(),
+ |builder| {
+ let mut edit = builder.make_editor(for_.syntax());
+ let make = SyntaxFactory::with_mappings();
+
+ let indent = for_.indent_level();
+ let pat = make.ident_pat(pat.ref_token().is_some(), true, name.clone());
+ let let_stmt = make.let_stmt(pat.into(), None, Some(start));
+ edit.insert_all(
+ Position::before(for_.syntax()),
+ vec![
+ let_stmt.syntax().syntax_element(),
+ make.whitespace(&format!("\n{}", indent)).syntax_element(),
+ ],
+ );
+
+ let mut elements = vec![];
+
+ let var_expr = make.expr_path(make.ident_path(&name.text()));
+ let op = ast::BinaryOp::CmpOp(ast::CmpOp::Ord {
+ ordering: ast::Ordering::Less,
+ strict: !inclusive,
+ });
+ if let Some(end) = end {
+ elements.extend([
+ make.token(T![while]).syntax_element(),
+ make.whitespace(" ").syntax_element(),
+ make.expr_bin(var_expr.clone(), op, end).syntax().syntax_element(),
+ ]);
+ } else {
+ elements.push(make.token(T![loop]).syntax_element());
+ }
+
+ edit.replace_all(
+ for_kw.syntax_element()..=iterable.syntax().syntax_element(),
+ elements,
+ );
+
+ let op = ast::BinaryOp::Assignment { op: Some(ast::ArithOp::Add) };
+ edit.insert_all(
+ Position::after(last),
+ vec![
+ make.whitespace(&format!("\n{}", indent + 1)).syntax_element(),
+ make.expr_bin(var_expr, op, step).syntax().syntax_element(),
+ make.token(T![;]).syntax_element(),
+ ],
+ );
+
+ edit.add_mappings(make.finish_with_mappings());
+ builder.add_file_edits(ctx.vfs_file_id(), edit);
+ },
+ )
+}
+
+fn extract_range(iterable: &ast::Expr) -> Option<(ast::Expr, Option<ast::Expr>, ast::Expr, bool)> {
+ Some(match iterable {
+ ast::Expr::ParenExpr(expr) => extract_range(&expr.expr()?)?,
+ ast::Expr::RangeExpr(range) => {
+ let inclusive = range.op_kind()? == ast::RangeOp::Inclusive;
+ (range.start()?, range.end(), make::expr_literal("1").into(), inclusive)
+ }
+ ast::Expr::MethodCallExpr(call) if call.name_ref()?.text() == "step_by" => {
+ let [step] = call.arg_list()?.args().collect_array()?;
+ let (start, end, _, inclusive) = extract_range(&call.receiver()?)?;
+ (start, end, step, inclusive)
+ }
+ _ => return None,
+ })
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::tests::{check_assist, check_assist_not_applicable};
+
+ use super::*;
+
+ #[test]
+ fn test_convert_range_for_to_while() {
+ check_assist(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ $0for i in 3..7 {
+ foo(i);
+ }
+}
+ ",
+ "
+fn foo() {
+ let mut i = 3;
+ while i < 7 {
+ foo(i);
+ i += 1;
+ }
+}
+ ",
+ );
+ }
+
+ #[test]
+ fn test_convert_range_for_to_while_no_end_bound() {
+ check_assist(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ $0for i in 3.. {
+ foo(i);
+ }
+}
+ ",
+ "
+fn foo() {
+ let mut i = 3;
+ loop {
+ foo(i);
+ i += 1;
+ }
+}
+ ",
+ );
+ }
+
+ #[test]
+ fn test_convert_range_for_to_while_with_mut_binding() {
+ check_assist(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ $0for mut i in 3..7 {
+ foo(i);
+ }
+}
+ ",
+ "
+fn foo() {
+ let mut i = 3;
+ while i < 7 {
+ foo(i);
+ i += 1;
+ }
+}
+ ",
+ );
+ }
+
+ #[test]
+ fn test_convert_range_for_to_while_with_label() {
+ check_assist(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ 'a: $0for mut i in 3..7 {
+ foo(i);
+ }
+}
+ ",
+ "
+fn foo() {
+ let mut i = 3;
+ 'a: while i < 7 {
+ foo(i);
+ i += 1;
+ }
+}
+ ",
+ );
+ }
+
+ #[test]
+ fn test_convert_range_for_to_while_step_by() {
+ check_assist(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ $0for mut i in (3..7).step_by(2) {
+ foo(i);
+ }
+}
+ ",
+ "
+fn foo() {
+ let mut i = 3;
+ while i < 7 {
+ foo(i);
+ i += 2;
+ }
+}
+ ",
+ );
+ }
+
+ #[test]
+ fn test_convert_range_for_to_while_not_applicable_non_range() {
+ check_assist_not_applicable(
+ convert_range_for_to_while,
+ "
+fn foo() {
+ let ident = 3..7;
+ $0for mut i in ident {
+ foo(i);
+ }
+}
+ ",
+ );
+ }
+}
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs
index c25b0bb..b0fa9e6 100644
--- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs
@@ -13,7 +13,7 @@
AstNode,
ast::{
self, AssocItem, BlockExpr, GenericParam, HasAttrs, HasGenericParams, HasName,
- HasTypeBounds, HasVisibility, edit_in_place::Indent, make,
+ HasTypeBounds, HasVisibility, edit::AstNodeEdit, make,
},
syntax_editor::Position,
};
@@ -75,7 +75,7 @@ pub(crate) fn generate_blanket_trait_impl(
|builder| {
let mut edit = builder.make_editor(traitd.syntax());
let namety = make::ty_path(make::path_from_text(&name.text()));
- let trait_where_clause = traitd.where_clause().map(|it| it.clone_for_update());
+ let trait_where_clause = traitd.where_clause().map(|it| it.reset_indent());
let bounds = traitd.type_bound_list().and_then(exlucde_sized);
let is_unsafe = traitd.unsafe_token().is_some();
let thisname = this_name(&traitd);
@@ -90,10 +90,6 @@ pub(crate) fn generate_blanket_trait_impl(
let trait_gen_args =
traitd.generic_param_list().map(|param_list| param_list.to_generic_args());
- if let Some(ref where_clause) = trait_where_clause {
- where_clause.reindent_to(0.into());
- }
-
let impl_ = make::impl_trait(
cfg_attrs(&traitd),
is_unsafe,
@@ -112,20 +108,19 @@ pub(crate) fn generate_blanket_trait_impl(
if let Some(trait_assoc_list) = traitd.assoc_item_list() {
let assoc_item_list = impl_.get_or_create_assoc_item_list();
- for method in trait_assoc_list.assoc_items() {
- let AssocItem::Fn(method) = method else {
- continue;
+ for item in trait_assoc_list.assoc_items() {
+ let item = match item {
+ ast::AssocItem::Fn(method) if method.body().is_none() => {
+ todo_fn(&method, ctx.config).into()
+ }
+ ast::AssocItem::Const(_) | ast::AssocItem::TypeAlias(_) => item,
+ _ => continue,
};
- if method.body().is_some() {
- continue;
- }
- let f = todo_fn(&method, ctx.config).clone_for_update();
- f.indent(1.into());
- assoc_item_list.add_item(AssocItem::Fn(f));
+ assoc_item_list.add_item(item.reset_indent().indent(1.into()));
}
}
- impl_.indent(indent);
+ let impl_ = impl_.indent(indent);
edit.insert_all(
Position::after(traitd.syntax()),
@@ -507,6 +502,41 @@ fn each(&self) -> Self where Self: Sized {
}
#[test]
+ fn test_gen_blanket_other_assoc_items() {
+ check_assist(
+ generate_blanket_trait_impl,
+ r#"
+trait $0Foo {
+ type Item;
+
+ const N: usize;
+
+ fn foo(&self);
+}
+"#,
+ r#"
+trait Foo {
+ type Item;
+
+ const N: usize;
+
+ fn foo(&self);
+}
+
+impl<T: ?Sized> Foo for $0T {
+ type Item;
+
+ const N: usize;
+
+ fn foo(&self) {
+ todo!()
+ }
+}
+"#,
+ );
+ }
+
+ #[test]
fn test_gen_blanket_indent() {
check_assist(
generate_blanket_trait_impl,
@@ -742,6 +772,49 @@ fn foo(&self) -> i32 {
}
"#,
);
+ check_assist(
+ generate_blanket_trait_impl,
+ r#"
+mod foo {
+ mod bar {
+ trait $0Foo {
+ type Item: Bar<
+ Self,
+ >;
+
+ const N: Baz<
+ Self,
+ >;
+ }
+ }
+}
+ "#,
+ r#"
+mod foo {
+ mod bar {
+ trait Foo {
+ type Item: Bar<
+ Self,
+ >;
+
+ const N: Baz<
+ Self,
+ >;
+ }
+
+ impl<T: ?Sized> Foo for $0T {
+ type Item: Bar<
+ Self,
+ >;
+
+ const N: Baz<
+ Self,
+ >;
+ }
+ }
+}
+ "#,
+ );
}
#[test]
@@ -824,6 +897,8 @@ impl<T: Send, T1: ToOwned + ?Sized> Foo<T> for $0T1
where
Self::Owned: Default,
{
+ type X: Sync;
+
fn foo(&self, x: Self::X) -> T {
todo!()
}
@@ -871,6 +946,8 @@ impl<T: Send, T1: ?Sized> Foo<T> for $0T1
Self: ToOwned,
Self::Owned: Default,
{
+ type X: Sync;
+
fn foo(&self, x: Self::X) -> T {
todo!()
}
@@ -906,6 +983,8 @@ fn print_foo(&self) {
}
impl<T: Send, T1: ?Sized> Foo<T> for $0T1 {
+ type X: Sync;
+
fn foo(&self, x: Self::X) -> T {
todo!()
}
@@ -941,6 +1020,8 @@ fn print_foo(&self) {
}
impl<T: ?Sized> Foo for $0T {
+ type X: Sync;
+
fn foo(&self, x: Self::X) -> i32 {
todo!()
}
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs
index c57fd4d..5a23077 100644
--- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs
@@ -1,3 +1,4 @@
+use either::Either;
use ide_db::syntax_helpers::suggest_name;
use syntax::ast::{self, AstNode, syntax_factory::SyntaxFactory};
@@ -24,9 +25,9 @@ pub(crate) fn replace_is_method_with_if_let_method(
acc: &mut Assists,
ctx: &AssistContext<'_>,
) -> Option<()> {
- let if_expr = ctx.find_node_at_offset::<ast::IfExpr>()?;
+ let has_cond = ctx.find_node_at_offset::<Either<ast::IfExpr, ast::WhileExpr>>()?;
- let cond = if_expr.condition()?;
+ let cond = either::for_both!(&has_cond, it => it.condition())?;
let cond = cover_let_chain(cond, ctx.selection_trimmed())?;
let call_expr = match cond {
ast::Expr::MethodCallExpr(call) => call,
@@ -39,7 +40,7 @@ pub(crate) fn replace_is_method_with_if_let_method(
let receiver = call_expr.receiver()?;
let mut name_generator = suggest_name::NameGenerator::new_from_scope_locals(
- ctx.sema.scope(if_expr.syntax()),
+ ctx.sema.scope(has_cond.syntax()),
);
let var_name = if let ast::Expr::PathExpr(path_expr) = receiver.clone() {
name_generator.suggest_name(&path_expr.path()?.to_string())
@@ -48,9 +49,9 @@ pub(crate) fn replace_is_method_with_if_let_method(
};
let (assist_id, message, text) = if name_ref.text() == "is_some" {
- ("replace_is_some_with_if_let_some", "Replace `is_some` with `if let Some`", "Some")
+ ("replace_is_some_with_if_let_some", "Replace `is_some` with `let Some`", "Some")
} else {
- ("replace_is_ok_with_if_let_ok", "Replace `is_ok` with `if let Ok`", "Ok")
+ ("replace_is_ok_with_if_let_ok", "Replace `is_ok` with `let Ok`", "Ok")
};
acc.add(
@@ -251,6 +252,25 @@ fn main() {
}
#[test]
+ fn replace_is_some_with_while_let_some() {
+ check_assist(
+ replace_is_method_with_if_let_method,
+ r#"
+fn main() {
+ let mut x = Some(1);
+ while x.is_som$0e() { x = None }
+}
+"#,
+ r#"
+fn main() {
+ let mut x = Some(1);
+ while let Some(${0:x1}) = x { x = None }
+}
+"#,
+ );
+ }
+
+ #[test]
fn replace_is_some_with_if_let_some_not_applicable_after_l_curly() {
check_assist_not_applicable(
replace_is_method_with_if_let_method,
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs b/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs
index e9f2d68..4b4aa94 100644
--- a/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs
@@ -131,6 +131,7 @@ mod handlers {
mod convert_match_to_let_else;
mod convert_named_struct_to_tuple_struct;
mod convert_nested_function_to_closure;
+ mod convert_range_for_to_while;
mod convert_to_guarded_return;
mod convert_tuple_return_type_to_struct;
mod convert_tuple_struct_to_named_struct;
@@ -268,6 +269,7 @@ pub(crate) fn all() -> &'static [Handler] {
convert_match_to_let_else::convert_match_to_let_else,
convert_named_struct_to_tuple_struct::convert_named_struct_to_tuple_struct,
convert_nested_function_to_closure::convert_nested_function_to_closure,
+ convert_range_for_to_while::convert_range_for_to_while,
convert_to_guarded_return::convert_to_guarded_return,
convert_tuple_return_type_to_struct::convert_tuple_return_type_to_struct,
convert_tuple_struct_to_named_struct::convert_tuple_struct_to_named_struct,
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/tests/generated.rs b/src/tools/rust-analyzer/crates/ide-assists/src/tests/generated.rs
index a99fe8d..7f0836a 100644
--- a/src/tools/rust-analyzer/crates/ide-assists/src/tests/generated.rs
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/tests/generated.rs
@@ -732,6 +732,29 @@ fn main() {
}
#[test]
+fn doctest_convert_range_for_to_while() {
+ check_doc_test(
+ "convert_range_for_to_while",
+ r#####"
+fn foo() {
+ $0for i in 3..7 {
+ foo(i);
+ }
+}
+"#####,
+ r#####"
+fn foo() {
+ let mut i = 3;
+ while i < 7 {
+ foo(i);
+ i += 1;
+ }
+}
+"#####,
+ )
+}
+
+#[test]
fn doctest_convert_to_guarded_return() {
check_doc_test(
"convert_to_guarded_return",
diff --git a/src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs b/src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs
index 6162d98..eab2b90 100644
--- a/src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs
+++ b/src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs
@@ -532,6 +532,146 @@ fn main() {
}
#[test]
+ fn if_completion_in_format() {
+ check_edit(
+ "if",
+ r#"
+//- minicore: fmt
+fn main() {
+ format_args!("{}", $0);
+}
+"#,
+ r#"
+fn main() {
+ format_args!("{}", if $1 {
+ $2
+} else {
+ $0
+});
+}
+"#,
+ );
+
+ check_edit(
+ "if",
+ r#"
+//- minicore: fmt
+fn main() {
+ format_args!("{}", if$0);
+}
+"#,
+ r#"
+fn main() {
+ format_args!("{}", if $1 {
+ $2
+} else {
+ $0
+});
+}
+"#,
+ );
+ }
+
+ #[test]
+ fn if_completion_in_value_expected_expressions() {
+ check_edit(
+ "if",
+ r#"
+fn main() {
+ 2 + $0;
+}
+"#,
+ r#"
+fn main() {
+ 2 + if $1 {
+ $2
+} else {
+ $0
+};
+}
+"#,
+ );
+
+ check_edit(
+ "if",
+ r#"
+fn main() {
+ -$0;
+}
+"#,
+ r#"
+fn main() {
+ -if $1 {
+ $2
+} else {
+ $0
+};
+}
+"#,
+ );
+
+ check_edit(
+ "if",
+ r#"
+fn main() {
+ return $0;
+}
+"#,
+ r#"
+fn main() {
+ return if $1 {
+ $2
+} else {
+ $0
+};
+}
+"#,
+ );
+
+ check_edit(
+ "if",
+ r#"
+fn main() {
+ loop {
+ break $0;
+ }
+}
+"#,
+ r#"
+fn main() {
+ loop {
+ break if $1 {
+ $2
+} else {
+ $0
+};
+ }
+}
+"#,
+ );
+
+ check_edit(
+ "if",
+ r#"
+struct Foo { x: i32 }
+fn main() {
+ Foo { x: $0 }
+}
+"#,
+ r#"
+struct Foo { x: i32 }
+fn main() {
+ Foo { x: if $1 {
+ $2
+} else {
+ $0
+} }
+}
+"#,
+ );
+ }
+
+ #[test]
fn completes_let_in_block() {
check_edit(
"let",
diff --git a/src/tools/rust-analyzer/crates/ide-completion/src/context/analysis.rs b/src/tools/rust-analyzer/crates/ide-completion/src/context/analysis.rs
index b3d9ff0..d6d3978 100644
--- a/src/tools/rust-analyzer/crates/ide-completion/src/context/analysis.rs
+++ b/src/tools/rust-analyzer/crates/ide-completion/src/context/analysis.rs
@@ -1012,6 +1012,25 @@ fn classify_name_ref<'db>(
.and_then(|next| next.first_token())
.is_some_and(|token| token.kind() == SyntaxKind::ELSE_KW)
};
+ let is_in_value = |it: &SyntaxNode| {
+ let Some(node) = it.parent() else { return false };
+ let kind = node.kind();
+ ast::LetStmt::can_cast(kind)
+ || ast::ArgList::can_cast(kind)
+ || ast::ArrayExpr::can_cast(kind)
+ || ast::ParenExpr::can_cast(kind)
+ || ast::BreakExpr::can_cast(kind)
+ || ast::ReturnExpr::can_cast(kind)
+ || ast::PrefixExpr::can_cast(kind)
+ || ast::FormatArgsArg::can_cast(kind)
+ || ast::RecordExprField::can_cast(kind)
+ || ast::BinExpr::cast(node.clone())
+ .and_then(|expr| expr.rhs())
+ .is_some_and(|expr| expr.syntax() == it)
+ || ast::IndexExpr::cast(node)
+ .and_then(|expr| expr.index())
+ .is_some_and(|expr| expr.syntax() == it)
+ };
// We do not want to generate path completions when we are sandwiched between an item decl signature and its body.
// ex. trait Foo $0 {}
@@ -1307,7 +1326,7 @@ fn classify_name_ref<'db>(
.and_then(ast::LetStmt::cast)
.is_some_and(|it| it.semicolon_token().is_none())
|| after_incomplete_let && incomplete_expr_stmt.unwrap_or(true) && !before_else_kw;
- let in_value = it.parent().and_then(Either::<ast::LetStmt, ast::ArgList>::cast).is_some();
+ let in_value = is_in_value(it);
let impl_ = fetch_immediate_impl_or_trait(sema, original_file, expr.syntax())
.and_then(Either::left);
diff --git a/src/tools/rust-analyzer/crates/ide-completion/src/tests/flyimport.rs b/src/tools/rust-analyzer/crates/ide-completion/src/tests/flyimport.rs
index 0cd4208..e139a5e 100644
--- a/src/tools/rust-analyzer/crates/ide-completion/src/tests/flyimport.rs
+++ b/src/tools/rust-analyzer/crates/ide-completion/src/tests/flyimport.rs
@@ -1953,3 +1953,25 @@ fn foo() {
expect![""],
);
}
+
+#[test]
+fn multiple_matches_with_qualifier() {
+ check(
+ r#"
+//- /foo.rs crate:foo
+pub mod env {
+ pub fn var() {}
+ pub fn _var() {}
+}
+
+//- /bar.rs crate:bar deps:foo
+fn main() {
+ env::var$0
+}
+ "#,
+ expect![[r#"
+ fn _var() (use foo::env) fn()
+ fn var() (use foo::env) fn()
+ "#]],
+ );
+}
diff --git a/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs b/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs
index 0c235c8..50edfca 100644
--- a/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs
+++ b/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs
@@ -1,6 +1,6 @@
//! Look up accessible paths for items.
-use std::ops::ControlFlow;
+use std::{convert::Infallible, ops::ControlFlow};
use hir::{
AsAssocItem, AssocItem, AssocItemContainer, Complete, Crate, FindPathConfig, HasCrate,
@@ -9,6 +9,7 @@
};
use itertools::Itertools;
use rustc_hash::{FxHashMap, FxHashSet};
+use smallvec::SmallVec;
use syntax::{
AstNode, SyntaxNode,
ast::{self, HasName, make},
@@ -416,7 +417,7 @@ fn path_applicable_imports(
NameToImport::Exact(first_qsegment.as_str().to_owned(), true),
AssocSearchMode::Exclude,
)
- .filter_map(|(item, do_not_complete)| {
+ .flat_map(|(item, do_not_complete)| {
// we found imports for `first_qsegment`, now we need to filter these imports by whether
// they result in resolving the rest of the path successfully
validate_resolvable(
@@ -446,10 +447,10 @@ fn validate_resolvable(
resolved_qualifier: ItemInNs,
unresolved_qualifier: &[Name],
complete_in_flyimport: CompleteInFlyimport,
-) -> Option<LocatedImport> {
+) -> SmallVec<[LocatedImport; 1]> {
let _p = tracing::info_span!("ImportAssets::import_for_item").entered();
- let qualifier = {
+ let qualifier = (|| {
let mut adjusted_resolved_qualifier = resolved_qualifier;
if !unresolved_qualifier.is_empty() {
match resolved_qualifier {
@@ -464,69 +465,80 @@ fn validate_resolvable(
}
match adjusted_resolved_qualifier {
- ItemInNs::Types(def) => def,
- _ => return None,
+ ItemInNs::Types(def) => Some(def),
+ _ => None,
}
- };
- let import_path_candidate = mod_path(resolved_qualifier)?;
+ })();
+ let Some(qualifier) = qualifier else { return SmallVec::new() };
+ let Some(import_path_candidate) = mod_path(resolved_qualifier) else { return SmallVec::new() };
+ let mut result = SmallVec::new();
let ty = match qualifier {
ModuleDef::Module(module) => {
- return items_locator::items_with_name_in_module(
+ items_locator::items_with_name_in_module::<Infallible>(
db,
module,
candidate.clone(),
AssocSearchMode::Exclude,
- |it| match scope_filter(it) {
- true => ControlFlow::Break(it),
- false => ControlFlow::Continue(()),
+ |item| {
+ if scope_filter(item) {
+ result.push(LocatedImport::new(
+ import_path_candidate.clone(),
+ resolved_qualifier,
+ item,
+ complete_in_flyimport,
+ ));
+ }
+ ControlFlow::Continue(())
},
- )
- .map(|item| {
- LocatedImport::new(
- import_path_candidate,
- resolved_qualifier,
- item,
- complete_in_flyimport,
- )
- });
+ );
+ return result;
}
// FIXME
- ModuleDef::Trait(_) => return None,
+ ModuleDef::Trait(_) => return SmallVec::new(),
ModuleDef::TypeAlias(alias) => alias.ty(db),
ModuleDef::BuiltinType(builtin) => builtin.ty(db),
ModuleDef::Adt(adt) => adt.ty(db),
- _ => return None,
+ _ => return SmallVec::new(),
};
- ty.iterate_path_candidates(db, scope, &FxHashSet::default(), None, None, |assoc| {
- // FIXME: Support extra trait imports
- if assoc.container_or_implemented_trait(db).is_some() {
- return None;
- }
- let name = assoc.name(db)?;
- let is_match = match candidate {
- NameToImport::Prefix(text, true) => name.as_str().starts_with(text),
- NameToImport::Prefix(text, false) => {
- name.as_str().chars().zip(text.chars()).all(|(name_char, candidate_char)| {
- name_char.eq_ignore_ascii_case(&candidate_char)
- })
+ ty.iterate_path_candidates::<Infallible>(
+ db,
+ scope,
+ &FxHashSet::default(),
+ None,
+ None,
+ |assoc| {
+ // FIXME: Support extra trait imports
+ if assoc.container_or_implemented_trait(db).is_some() {
+ return None;
}
- NameToImport::Exact(text, true) => name.as_str() == text,
- NameToImport::Exact(text, false) => name.as_str().eq_ignore_ascii_case(text),
- NameToImport::Fuzzy(text, true) => text.chars().all(|c| name.as_str().contains(c)),
- NameToImport::Fuzzy(text, false) => text
- .chars()
- .all(|c| name.as_str().chars().any(|name_char| name_char.eq_ignore_ascii_case(&c))),
- };
- if !is_match {
- return None;
- }
- Some(LocatedImport::new(
- import_path_candidate.clone(),
- resolved_qualifier,
- assoc_to_item(assoc),
- complete_in_flyimport,
- ))
- })
+ let name = assoc.name(db)?;
+ let is_match = match candidate {
+ NameToImport::Prefix(text, true) => name.as_str().starts_with(text),
+ NameToImport::Prefix(text, false) => {
+ name.as_str().chars().zip(text.chars()).all(|(name_char, candidate_char)| {
+ name_char.eq_ignore_ascii_case(&candidate_char)
+ })
+ }
+ NameToImport::Exact(text, true) => name.as_str() == text,
+ NameToImport::Exact(text, false) => name.as_str().eq_ignore_ascii_case(text),
+ NameToImport::Fuzzy(text, true) => text.chars().all(|c| name.as_str().contains(c)),
+ NameToImport::Fuzzy(text, false) => text.chars().all(|c| {
+ name.as_str().chars().any(|name_char| name_char.eq_ignore_ascii_case(&c))
+ }),
+ };
+ if !is_match {
+ return None;
+ }
+ result.push(LocatedImport::new(
+ import_path_candidate.clone(),
+ resolved_qualifier,
+ assoc_to_item(assoc),
+ complete_in_flyimport,
+ ));
+ None
+ },
+ );
+ result
}
pub fn item_for_path_search(db: &RootDatabase, item: ItemInNs) -> Option<ItemInNs> {
diff --git a/src/tools/rust-analyzer/crates/ide-db/src/search.rs b/src/tools/rust-analyzer/crates/ide-db/src/search.rs
index f1d076e..018c841 100644
--- a/src/tools/rust-analyzer/crates/ide-db/src/search.rs
+++ b/src/tools/rust-analyzer/crates/ide-db/src/search.rs
@@ -387,12 +387,14 @@ fn search_scope(&self, db: &RootDatabase) -> SearchScope {
return SearchScope::reverse_dependencies(db, module.krate());
}
- let vis = self.visibility(db);
- if let Some(Visibility::Public) = vis {
- return SearchScope::reverse_dependencies(db, module.krate());
- }
- if let Some(Visibility::Module(module, _)) = vis {
- return SearchScope::module_and_children(db, module.into());
+ if let Some(vis) = self.visibility(db) {
+ return match vis {
+ Visibility::Module(module, _) => {
+ SearchScope::module_and_children(db, module.into())
+ }
+ Visibility::PubCrate(krate) => SearchScope::krate(db, krate.into()),
+ Visibility::Public => SearchScope::reverse_dependencies(db, module.krate()),
+ };
}
let range = match module_source {
diff --git a/src/tools/rust-analyzer/crates/ide/src/annotations.rs b/src/tools/rust-analyzer/crates/ide/src/annotations.rs
index 36c4404..6fb8ded 100644
--- a/src/tools/rust-analyzer/crates/ide/src/annotations.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/annotations.rs
@@ -9,7 +9,7 @@
use crate::{
NavigationTarget, RunnableKind,
annotations::fn_references::find_all_methods,
- goto_implementation::goto_implementation,
+ goto_implementation::{GotoImplementationConfig, goto_implementation},
navigation_target,
references::{FindAllRefsConfig, find_all_refs},
runnables::{Runnable, runnables},
@@ -44,6 +44,7 @@ pub struct AnnotationConfig<'a> {
pub annotate_method_references: bool,
pub annotate_enum_variant_references: bool,
pub location: AnnotationLocation,
+ pub filter_adjacent_derive_implementations: bool,
pub minicore: MiniCore<'a>,
}
@@ -204,7 +205,12 @@ pub(crate) fn resolve_annotation(
) -> Annotation {
match annotation.kind {
AnnotationKind::HasImpls { pos, ref mut data } => {
- *data = goto_implementation(db, pos).map(|range| range.info);
+ let goto_implementation_config = GotoImplementationConfig {
+ filter_adjacent_derive_implementations: config
+ .filter_adjacent_derive_implementations,
+ };
+ *data =
+ goto_implementation(db, &goto_implementation_config, pos).map(|range| range.info);
}
AnnotationKind::HasReferences { pos, ref mut data } => {
*data = find_all_refs(
@@ -253,6 +259,7 @@ mod tests {
annotate_enum_variant_references: true,
location: AnnotationLocation::AboveName,
minicore: MiniCore::default(),
+ filter_adjacent_derive_implementations: false,
};
fn check_with_config(
diff --git a/src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs b/src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs
index 875403c..0572bca 100644
--- a/src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs
@@ -8,6 +8,10 @@
use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav};
+pub struct GotoImplementationConfig {
+ pub filter_adjacent_derive_implementations: bool,
+}
+
// Feature: Go to Implementation
//
// Navigates to the impl items of types.
@@ -19,6 +23,7 @@
// 
pub(crate) fn goto_implementation(
db: &RootDatabase,
+ config: &GotoImplementationConfig,
FilePosition { file_id, offset }: FilePosition,
) -> Option<RangeInfo<Vec<NavigationTarget>>> {
let sema = Semantics::new(db);
@@ -55,7 +60,19 @@ pub(crate) fn goto_implementation(
.and_then(|def| {
let navs = match def {
Definition::Trait(trait_) => impls_for_trait(&sema, trait_),
- Definition::Adt(adt) => impls_for_ty(&sema, adt.ty(sema.db)),
+ Definition::Adt(adt) => {
+ let mut impls = Impl::all_for_type(db, adt.ty(sema.db));
+ if config.filter_adjacent_derive_implementations {
+ impls.retain(|impl_| {
+ sema.impl_generated_from_derive(*impl_) != Some(adt)
+ });
+ }
+ impls
+ .into_iter()
+ .filter_map(|imp| imp.try_to_nav(&sema))
+ .flatten()
+ .collect()
+ }
Definition::TypeAlias(alias) => impls_for_ty(&sema, alias.ty(sema.db)),
Definition::BuiltinType(builtin) => {
impls_for_ty(&sema, builtin.ty(sema.db))
@@ -125,12 +142,24 @@ mod tests {
use ide_db::FileRange;
use itertools::Itertools;
- use crate::fixture;
+ use crate::{GotoImplementationConfig, fixture};
+ const TEST_CONFIG: &GotoImplementationConfig =
+ &GotoImplementationConfig { filter_adjacent_derive_implementations: false };
+
+ #[track_caller]
fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str) {
+ check_with_config(TEST_CONFIG, ra_fixture);
+ }
+
+ #[track_caller]
+ fn check_with_config(
+ config: &GotoImplementationConfig,
+ #[rust_analyzer::rust_fixture] ra_fixture: &str,
+ ) {
let (analysis, position, expected) = fixture::annotations(ra_fixture);
- let navs = analysis.goto_implementation(position).unwrap().unwrap().info;
+ let navs = analysis.goto_implementation(config, position).unwrap().unwrap().info;
let cmp = |frange: &FileRange| (frange.file_id, frange.range.start());
@@ -416,4 +445,22 @@ fn foo() {}
"#,
);
}
+
+ #[test]
+ fn filter_adjacent_derives() {
+ check_with_config(
+ &GotoImplementationConfig { filter_adjacent_derive_implementations: true },
+ r#"
+//- minicore: clone, copy, derive
+
+#[derive(Clone, Copy)]
+struct Foo$0;
+
+trait Bar {}
+
+impl Bar for Foo {}
+ // ^^^
+ "#,
+ );
+ }
}
diff --git a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs
index 91fb4d0..3a19531 100644
--- a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs
@@ -10809,7 +10809,7 @@ struct DropField {
---
- needs Drop
+ no Drop
"#]],
);
check(
diff --git a/src/tools/rust-analyzer/crates/ide/src/lib.rs b/src/tools/rust-analyzer/crates/ide/src/lib.rs
index 8572528..2609457 100644
--- a/src/tools/rust-analyzer/crates/ide/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/lib.rs
@@ -86,6 +86,7 @@
file_structure::{FileStructureConfig, StructureNode, StructureNodeKind},
folding_ranges::{Fold, FoldKind},
goto_definition::GotoDefinitionConfig,
+ goto_implementation::GotoImplementationConfig,
highlight_related::{HighlightRelatedConfig, HighlightedRange},
hover::{
HoverAction, HoverConfig, HoverDocFormat, HoverGotoTypeData, HoverResult,
@@ -106,7 +107,7 @@
move_item::Direction,
navigation_target::{NavigationTarget, TryToNav, UpmappingResult},
references::{FindAllRefsConfig, ReferenceSearchResult},
- rename::RenameError,
+ rename::{RenameConfig, RenameError},
runnables::{Runnable, RunnableKind, TestId, UpdateTest},
signature_help::SignatureHelp,
static_index::{
@@ -537,9 +538,10 @@ pub fn goto_declaration(
/// Returns the impls from the symbol at `position`.
pub fn goto_implementation(
&self,
+ config: &GotoImplementationConfig,
position: FilePosition,
) -> Cancellable<Option<RangeInfo<Vec<NavigationTarget>>>> {
- self.with_db(|db| goto_implementation::goto_implementation(db, position))
+ self.with_db(|db| goto_implementation::goto_implementation(db, config, position))
}
/// Returns the type definitions for the symbol at `position`.
@@ -830,8 +832,9 @@ pub fn rename(
&self,
position: FilePosition,
new_name: &str,
+ config: &RenameConfig,
) -> Cancellable<Result<SourceChange, RenameError>> {
- self.with_db(|db| rename::rename(db, position, new_name))
+ self.with_db(|db| rename::rename(db, position, new_name, config))
}
pub fn prepare_rename(
diff --git a/src/tools/rust-analyzer/crates/ide/src/rename.rs b/src/tools/rust-analyzer/crates/ide/src/rename.rs
index 8922a8e..ce59639 100644
--- a/src/tools/rust-analyzer/crates/ide/src/rename.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/rename.rs
@@ -4,7 +4,7 @@
//! tests. This module also implements a couple of magic tricks, like renaming
//! `self` and to `self` (to switch between associated function and method).
-use hir::{AsAssocItem, InFile, Name, Semantics, sym};
+use hir::{AsAssocItem, FindPathConfig, HasContainer, HirDisplay, InFile, Name, Semantics, sym};
use ide_db::{
FileId, FileRange, RootDatabase,
defs::{Definition, NameClass, NameRefClass},
@@ -27,6 +27,23 @@
type RenameResult<T> = Result<T, RenameError>;
+pub struct RenameConfig {
+ pub prefer_no_std: bool,
+ pub prefer_prelude: bool,
+ pub prefer_absolute: bool,
+}
+
+impl RenameConfig {
+ fn find_path_config(&self) -> FindPathConfig {
+ FindPathConfig {
+ prefer_no_std: self.prefer_no_std,
+ prefer_prelude: self.prefer_prelude,
+ prefer_absolute: self.prefer_absolute,
+ allow_unstable: true,
+ }
+ }
+}
+
/// This is similar to `collect::<Result<Vec<_>, _>>`, but unlike it, it succeeds if there is *any* `Ok` item.
fn ok_if_any<T, E>(iter: impl Iterator<Item = Result<T, E>>) -> Result<Vec<T>, E> {
let mut err = None;
@@ -100,6 +117,7 @@ pub(crate) fn rename(
db: &RootDatabase,
position: FilePosition,
new_name: &str,
+ config: &RenameConfig,
) -> RenameResult<SourceChange> {
let sema = Semantics::new(db);
let file_id = sema
@@ -158,7 +176,14 @@ pub(crate) fn rename(
if let Definition::Local(local) = def {
if let Some(self_param) = local.as_self_param(sema.db) {
cov_mark::hit!(rename_self_to_param);
- return rename_self_to_param(&sema, local, self_param, &new_name, kind);
+ return rename_self_to_param(
+ &sema,
+ local,
+ self_param,
+ &new_name,
+ kind,
+ config.find_path_config(),
+ );
}
if kind == IdentifierKind::LowercaseSelf {
cov_mark::hit!(rename_to_self);
@@ -360,7 +385,7 @@ fn transform_assoc_fn_into_method_call(
f: hir::Function,
) {
let calls = Definition::Function(f).usages(sema).all();
- for (file_id, calls) in calls {
+ for (_file_id, calls) in calls {
for call in calls {
let Some(fn_name) = call.name.as_name_ref() else { continue };
let Some(path) = fn_name.syntax().parent().and_then(ast::PathSegment::cast) else {
@@ -409,6 +434,12 @@ fn transform_assoc_fn_into_method_call(
.unwrap_or_else(|| arg_list.syntax().text_range().end()),
};
let replace_range = TextRange::new(replace_start, replace_end);
+ let macro_file = sema.hir_file_for(fn_name.syntax());
+ let Some((replace_range, _)) =
+ InFile::new(macro_file, replace_range).original_node_file_range_opt(sema.db)
+ else {
+ continue;
+ };
let Some(macro_mapped_self) = sema.original_range_opt(self_arg.syntax()) else {
continue;
@@ -426,8 +457,8 @@ fn transform_assoc_fn_into_method_call(
replacement.push('(');
source_change.insert_source_edit(
- file_id.file_id(sema.db),
- TextEdit::replace(replace_range, replacement),
+ replace_range.file_id.file_id(sema.db),
+ TextEdit::replace(replace_range.range, replacement),
);
}
}
@@ -514,12 +545,189 @@ fn rename_to_self(
Ok(source_change)
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum CallReceiverAdjust {
+ Deref,
+ Ref,
+ RefMut,
+ None,
+}
+
+fn method_to_assoc_fn_call_self_adjust(
+ sema: &Semantics<'_, RootDatabase>,
+ self_arg: &ast::Expr,
+) -> CallReceiverAdjust {
+ let mut result = CallReceiverAdjust::None;
+ let self_adjust = sema.expr_adjustments(self_arg);
+ if let Some(self_adjust) = self_adjust {
+ let mut i = 0;
+ while i < self_adjust.len() {
+ if matches!(self_adjust[i].kind, hir::Adjust::Deref(..))
+ && matches!(
+ self_adjust.get(i + 1),
+ Some(hir::Adjustment { kind: hir::Adjust::Borrow(..), .. })
+ )
+ {
+ // Deref then ref (reborrow), skip them.
+ i += 2;
+ continue;
+ }
+
+ match self_adjust[i].kind {
+ hir::Adjust::Deref(_) if result == CallReceiverAdjust::None => {
+ // Autoref takes precedence over deref, because if given a `&Type` the compiler will deref
+ // it automatically.
+ result = CallReceiverAdjust::Deref;
+ }
+ hir::Adjust::Borrow(hir::AutoBorrow::Ref(mutability)) => {
+ match (result, mutability) {
+ (CallReceiverAdjust::RefMut, hir::Mutability::Shared) => {}
+ (_, hir::Mutability::Mut) => result = CallReceiverAdjust::RefMut,
+ (_, hir::Mutability::Shared) => result = CallReceiverAdjust::Ref,
+ }
+ }
+ _ => {}
+ }
+
+ i += 1;
+ }
+ }
+ result
+}
+
+fn transform_method_call_into_assoc_fn(
+ sema: &Semantics<'_, RootDatabase>,
+ source_change: &mut SourceChange,
+ f: hir::Function,
+ find_path_config: FindPathConfig,
+) {
+ let calls = Definition::Function(f).usages(sema).all();
+ for (_file_id, calls) in calls {
+ for call in calls {
+ let Some(fn_name) = call.name.as_name_ref() else { continue };
+ let Some(method_call) = fn_name.syntax().parent().and_then(ast::MethodCallExpr::cast)
+ else {
+ continue;
+ };
+ let Some(mut self_arg) = method_call.receiver() else {
+ continue;
+ };
+
+ let Some(scope) = sema.scope(fn_name.syntax()) else {
+ continue;
+ };
+ let self_adjust = method_to_assoc_fn_call_self_adjust(sema, &self_arg);
+
+ // Strip parentheses, function arguments have higher precedence than any operator.
+ while let ast::Expr::ParenExpr(it) = &self_arg {
+ self_arg = match it.expr() {
+ Some(it) => it,
+ None => break,
+ };
+ }
+
+ let needs_comma = method_call.arg_list().is_some_and(|it| it.args().next().is_some());
+
+ let self_needs_parens = self_adjust != CallReceiverAdjust::None
+ && self_arg.precedence().needs_parentheses_in(ExprPrecedence::Prefix);
+
+ let replace_start = method_call.syntax().text_range().start();
+ let replace_end = method_call
+ .arg_list()
+ .and_then(|it| it.l_paren_token())
+ .map(|it| it.text_range().end())
+ .unwrap_or_else(|| method_call.syntax().text_range().end());
+ let replace_range = TextRange::new(replace_start, replace_end);
+ let macro_file = sema.hir_file_for(fn_name.syntax());
+ let Some((replace_range, _)) =
+ InFile::new(macro_file, replace_range).original_node_file_range_opt(sema.db)
+ else {
+ continue;
+ };
+
+ let fn_container_path = match f.container(sema.db) {
+ hir::ItemContainer::Trait(trait_) => {
+ // FIXME: We always put it as `Trait::function`. Is it better to use `Type::function` (but
+ // that could conflict with an inherent method)? Or maybe `<Type as Trait>::function`?
+ // Or let the user decide?
+ let Some(path) = scope.module().find_path(
+ sema.db,
+ hir::ItemInNs::Types(trait_.into()),
+ find_path_config,
+ ) else {
+ continue;
+ };
+ path.display(sema.db, replace_range.file_id.edition(sema.db)).to_string()
+ }
+ hir::ItemContainer::Impl(impl_) => {
+ let ty = impl_.self_ty(sema.db);
+ match ty.as_adt() {
+ Some(adt) => {
+ let Some(path) = scope.module().find_path(
+ sema.db,
+ hir::ItemInNs::Types(adt.into()),
+ find_path_config,
+ ) else {
+ continue;
+ };
+ path.display(sema.db, replace_range.file_id.edition(sema.db))
+ .to_string()
+ }
+ None => {
+ let Ok(mut ty) =
+ ty.display_source_code(sema.db, scope.module().into(), false)
+ else {
+ continue;
+ };
+ ty.insert(0, '<');
+ ty.push('>');
+ ty
+ }
+ }
+ }
+ _ => continue,
+ };
+
+ let Some(macro_mapped_self) = sema.original_range_opt(self_arg.syntax()) else {
+ continue;
+ };
+ let mut replacement = String::new();
+ replacement.push_str(&fn_container_path);
+ replacement.push_str("::");
+ format_to!(replacement, "{fn_name}");
+ replacement.push('(');
+ replacement.push_str(match self_adjust {
+ CallReceiverAdjust::Deref => "*",
+ CallReceiverAdjust::Ref => "&",
+ CallReceiverAdjust::RefMut => "&mut ",
+ CallReceiverAdjust::None => "",
+ });
+ if self_needs_parens {
+ replacement.push('(');
+ }
+ replacement.push_str(macro_mapped_self.text(sema.db));
+ if self_needs_parens {
+ replacement.push(')');
+ }
+ if needs_comma {
+ replacement.push_str(", ");
+ }
+
+ source_change.insert_source_edit(
+ replace_range.file_id.file_id(sema.db),
+ TextEdit::replace(replace_range.range, replacement),
+ );
+ }
+ }
+}
+
fn rename_self_to_param(
sema: &Semantics<'_, RootDatabase>,
local: hir::Local,
self_param: hir::SelfParam,
new_name: &Name,
identifier_kind: IdentifierKind,
+ find_path_config: FindPathConfig,
) -> RenameResult<SourceChange> {
if identifier_kind == IdentifierKind::LowercaseSelf {
// Let's do nothing rather than complain.
@@ -527,6 +735,11 @@ fn rename_self_to_param(
return Ok(SourceChange::default());
}
+ let fn_def = match local.parent(sema.db) {
+ hir::DefWithBody::Function(func) => func,
+ _ => bail!("Cannot rename local to self outside of function"),
+ };
+
let InFile { file_id, value: self_param } =
sema.source(self_param).ok_or_else(|| format_err!("cannot find function source"))?;
@@ -554,6 +767,7 @@ fn rename_self_to_param(
),
)
}));
+ transform_method_call_into_assoc_fn(sema, &mut source_change, fn_def, find_path_config);
Ok(source_change)
}
@@ -587,7 +801,10 @@ mod tests {
use crate::fixture;
- use super::{RangeInfo, RenameError};
+ use super::{RangeInfo, RenameConfig, RenameError};
+
+ const TEST_CONFIG: RenameConfig =
+ RenameConfig { prefer_no_std: false, prefer_prelude: true, prefer_absolute: false };
#[track_caller]
fn check(
@@ -603,7 +820,7 @@ fn check(
panic!("Prepare rename to '{new_name}' was failed: {err}")
}
let rename_result = analysis
- .rename(position, new_name)
+ .rename(position, new_name, &TEST_CONFIG)
.unwrap_or_else(|err| panic!("Rename to '{new_name}' was cancelled: {err}"));
match rename_result {
Ok(source_change) => {
@@ -635,7 +852,7 @@ fn check(
#[track_caller]
fn check_conflicts(new_name: &str, #[rust_analyzer::rust_fixture] ra_fixture: &str) {
let (analysis, position, conflicts) = fixture::annotations(ra_fixture);
- let source_change = analysis.rename(position, new_name).unwrap().unwrap();
+ let source_change = analysis.rename(position, new_name, &TEST_CONFIG).unwrap().unwrap();
let expected_conflicts = conflicts
.into_iter()
.map(|(file_range, _)| (file_range.file_id, file_range.range))
@@ -662,8 +879,10 @@ fn check_expect(
expect: Expect,
) {
let (analysis, position) = fixture::position(ra_fixture);
- let source_change =
- analysis.rename(position, new_name).unwrap().expect("Expect returned a RenameError");
+ let source_change = analysis
+ .rename(position, new_name, &TEST_CONFIG)
+ .unwrap()
+ .expect("Expect returned a RenameError");
expect.assert_eq(&filter_expect(source_change))
}
@@ -3589,4 +3808,115 @@ fn bar(v: Foo) {
"#,
);
}
+
+ #[test]
+ fn rename_to_self_callers_in_macro() {
+ check(
+ "self",
+ r#"
+struct Foo;
+
+impl Foo {
+ fn foo(th$0is: &Self, v: i32) {}
+}
+
+macro_rules! m { ($it:expr) => { $it } }
+fn bar(v: Foo) {
+ m!(Foo::foo(&v, 123));
+}
+ "#,
+ r#"
+struct Foo;
+
+impl Foo {
+ fn foo(&self, v: i32) {}
+}
+
+macro_rules! m { ($it:expr) => { $it } }
+fn bar(v: Foo) {
+ m!(v.foo( 123));
+}
+ "#,
+ );
+ }
+
+ #[test]
+ fn rename_from_self_callers() {
+ check(
+ "this",
+ r#"
+//- minicore: add
+struct Foo;
+impl Foo {
+ fn foo(&sel$0f) {}
+}
+impl core::ops::Add for Foo {
+ type Output = Foo;
+
+ fn add(self, _rhs: Self) -> Self::Output {
+ Foo
+ }
+}
+
+fn bar(v: &Foo) {
+ v.foo();
+ (Foo + Foo).foo();
+}
+
+mod baz {
+ fn baz(v: super::Foo) {
+ v.foo();
+ }
+}
+ "#,
+ r#"
+struct Foo;
+impl Foo {
+ fn foo(this: &Self) {}
+}
+impl core::ops::Add for Foo {
+ type Output = Foo;
+
+ fn add(self, _rhs: Self) -> Self::Output {
+ Foo
+ }
+}
+
+fn bar(v: &Foo) {
+ Foo::foo(v);
+ Foo::foo(&(Foo + Foo));
+}
+
+mod baz {
+ fn baz(v: super::Foo) {
+ crate::Foo::foo(&v);
+ }
+}
+ "#,
+ );
+ // Multiple args:
+ check(
+ "this",
+ r#"
+struct Foo;
+impl Foo {
+ fn foo(&sel$0f, _v: i32) {}
+}
+
+fn bar() {
+ Foo.foo(1);
+}
+ "#,
+ r#"
+struct Foo;
+impl Foo {
+ fn foo(this: &Self, _v: i32) {}
+}
+
+fn bar() {
+ Foo::foo(&Foo, 1);
+}
+ "#,
+ );
+ }
}
diff --git a/src/tools/rust-analyzer/crates/ide/src/signature_help.rs b/src/tools/rust-analyzer/crates/ide/src/signature_help.rs
index 5f7e12c..f9ec448 100644
--- a/src/tools/rust-analyzer/crates/ide/src/signature_help.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/signature_help.rs
@@ -175,6 +175,9 @@ fn signature_help_for_call(
match callable.kind() {
hir::CallableKind::Function(func) => {
res.doc = func.docs(db);
+ if func.is_async(db) {
+ format_to!(res.signature, "async ");
+ }
format_to!(res.signature, "fn {}", func.name(db).display(db, edition));
let generic_params = GenericDef::Function(func)
@@ -283,13 +286,16 @@ fn signature_help_for_call(
}
};
match callable.kind() {
- hir::CallableKind::Function(func) if callable.return_type().contains_unknown() => {
- render(func.ret_type(db))
+ hir::CallableKind::Function(func) => render(func.async_ret_type(db).unwrap_or_else(|| {
+ if callable.return_type().contains_unknown() {
+ func.ret_type(db)
+ } else {
+ callable.return_type()
+ }
+ })),
+ hir::CallableKind::Closure(_) | hir::CallableKind::FnPtr | hir::CallableKind::FnImpl(_) => {
+ render(callable.return_type())
}
- hir::CallableKind::Function(_)
- | hir::CallableKind::Closure(_)
- | hir::CallableKind::FnPtr
- | hir::CallableKind::FnImpl(_) => render(callable.return_type()),
hir::CallableKind::TupleStruct(_) | hir::CallableKind::TupleEnumVariant(_) => {}
}
Some(res)
@@ -751,13 +757,7 @@ pub(crate) fn position(
#[track_caller]
fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) {
- let fixture = format!(
- r#"
-//- minicore: sized, fn
-{ra_fixture}
- "#
- );
- let (db, position) = position(&fixture);
+ let (db, position) = position(ra_fixture);
let sig_help = hir::attach_db(&db, || crate::signature_help::signature_help(&db, position));
let actual = match sig_help {
Some(sig_help) => {
@@ -795,6 +795,7 @@ fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) {
fn test_fn_signature_two_args() {
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo($03, ); }
"#,
@@ -805,6 +806,7 @@ fn foo(x: u32, y: u32) -> u32
);
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo(3$0, ); }
"#,
@@ -815,6 +817,7 @@ fn foo(x: u32, y: u32) -> u32
);
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo(3,$0 ); }
"#,
@@ -825,6 +828,7 @@ fn foo(x: u32, y: u32) -> u32
);
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo(3, $0); }
"#,
@@ -839,6 +843,7 @@ fn foo(x: u32, y: u32) -> u32
fn test_fn_signature_two_args_empty() {
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo($0); }
"#,
@@ -853,6 +858,7 @@ fn foo(x: u32, y: u32) -> u32
fn test_fn_signature_two_args_first_generics() {
check(
r#"
+//- minicore: sized, fn
fn foo<T, U: Copy + Display>(x: T, y: U) -> u32
where T: Copy + Display, U: Debug
{ x + y }
@@ -870,6 +876,7 @@ fn foo<T, U>(x: i32, y: U) -> u32
fn test_fn_signature_no_params() {
check(
r#"
+//- minicore: sized, fn
fn foo<T>() -> T where T: Copy + Display {}
fn bar() { foo($0); }
"#,
@@ -883,6 +890,7 @@ fn foo<T>() -> T
fn test_fn_signature_for_impl() {
check(
r#"
+//- minicore: sized, fn
struct F;
impl F { pub fn new() { } }
fn bar() {
@@ -899,6 +907,7 @@ fn new()
fn test_fn_signature_for_method_self() {
check(
r#"
+//- minicore: sized, fn
struct S;
impl S { pub fn do_it(&self) {} }
@@ -917,6 +926,7 @@ fn do_it(&self)
fn test_fn_signature_for_method_with_arg() {
check(
r#"
+//- minicore: sized, fn
struct S;
impl S {
fn foo(&self, x: i32) {}
@@ -935,6 +945,7 @@ fn foo(&self, x: i32)
fn test_fn_signature_for_generic_method() {
check(
r#"
+//- minicore: sized, fn
struct S<T>(T);
impl<T> S<T> {
fn foo(&self, x: T) {}
@@ -953,6 +964,7 @@ fn foo(&self, x: u32)
fn test_fn_signature_for_method_with_arg_as_assoc_fn() {
check(
r#"
+//- minicore: sized, fn
struct S;
impl S {
fn foo(&self, x: i32) {}
@@ -971,6 +983,7 @@ fn foo(self: &S, x: i32)
fn test_fn_signature_with_docs_simple() {
check(
r#"
+//- minicore: sized, fn
/// test
// non-doc-comment
fn foo(j: u32) -> u32 {
@@ -994,6 +1007,7 @@ fn foo(j: u32) -> u32
fn test_fn_signature_with_docs() {
check(
r#"
+//- minicore: sized, fn
/// Adds one to the number given.
///
/// # Examples
@@ -1031,6 +1045,7 @@ fn add_one(x: i32) -> i32
fn test_fn_signature_with_docs_impl() {
check(
r#"
+//- minicore: sized, fn
struct addr;
impl addr {
/// Adds one to the number given.
@@ -1073,6 +1088,7 @@ fn add_one(x: i32) -> i32
fn test_fn_signature_with_docs_from_actix() {
check(
r#"
+//- minicore: sized, fn
trait Actor {
/// Actor execution context type
type Context;
@@ -1106,6 +1122,7 @@ fn finished(&mut self, ctx: &mut <impl WriteHandler<()> as Actor>::Context)
fn call_info_bad_offset() {
check(
r#"
+//- minicore: sized, fn
fn foo(x: u32, y: u32) -> u32 {x + y}
fn bar() { foo $0 (3, ); }
"#,
@@ -1117,6 +1134,7 @@ fn foo(x: u32, y: u32) -> u32 {x + y}
fn outside_of_arg_list() {
check(
r#"
+//- minicore: sized, fn
fn foo(a: u8) {}
fn f() {
foo(123)$0
@@ -1126,6 +1144,7 @@ fn f() {
);
check(
r#"
+//- minicore: sized, fn
fn foo<T>(a: u8) {}
fn f() {
foo::<u32>$0()
@@ -1135,6 +1154,7 @@ fn f() {
);
check(
r#"
+//- minicore: sized, fn
fn foo(a: u8) -> u8 {a}
fn bar(a: u8) -> u8 {a}
fn f() {
@@ -1148,6 +1168,7 @@ fn foo(a: u8) -> u8
);
check(
r#"
+//- minicore: sized, fn
struct Vec<T>(T);
struct Vec2<T>(T);
fn f() {
@@ -1165,6 +1186,7 @@ struct Vec2<T>
fn test_nested_method_in_lambda() {
check(
r#"
+//- minicore: sized, fn
struct Foo;
impl Foo { fn bar(&self, _: u32) { } }
@@ -1186,6 +1208,7 @@ fn bar(&self, _: u32)
fn works_for_tuple_structs() {
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32);
fn main() {
@@ -1205,6 +1228,7 @@ struct S(u32, i32)
fn tuple_struct_pat() {
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32);
fn main() {
@@ -1224,6 +1248,7 @@ struct S (u32, i32)
fn tuple_struct_pat_rest() {
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16);
fn main() {
@@ -1239,6 +1264,7 @@ struct S (u32, i32, f32, u16)
);
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16, u8);
fn main() {
@@ -1254,6 +1280,7 @@ struct S (u32, i32, f32, u16, u8)
);
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16);
fn main() {
@@ -1269,6 +1296,7 @@ struct S (u32, i32, f32, u16)
);
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16, u8);
fn main() {
@@ -1284,6 +1312,7 @@ struct S (u32, i32, f32, u16, u8)
);
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16);
fn main() {
@@ -1299,6 +1328,7 @@ struct S (u32, i32, f32, u16)
);
check(
r#"
+//- minicore: sized, fn
/// A cool tuple struct
struct S(u32, i32, f32, u16);
fn main() {
@@ -1318,6 +1348,7 @@ struct S (u32, i32, f32, u16)
fn generic_struct() {
check(
r#"
+//- minicore: sized, fn
struct S<T>(T);
fn main() {
let s = S($0);
@@ -1334,6 +1365,7 @@ struct S<T>({unknown})
fn works_for_enum_variants() {
check(
r#"
+//- minicore: sized, fn
enum E {
/// A Variant
A(i32),
@@ -1360,6 +1392,7 @@ enum E::A(i32)
fn cant_call_struct_record() {
check(
r#"
+//- minicore: sized, fn
struct S { x: u32, y: i32 }
fn main() {
let s = S($0);
@@ -1373,6 +1406,7 @@ fn main() {
fn cant_call_enum_record() {
check(
r#"
+//- minicore: sized, fn
enum E {
/// A Variant
A(i32),
@@ -1394,6 +1428,7 @@ fn main() {
fn fn_signature_for_call_in_macro() {
check(
r#"
+//- minicore: sized, fn
macro_rules! id { ($($tt:tt)*) => { $($tt)* } }
fn foo() { }
id! {
@@ -1410,6 +1445,7 @@ fn foo()
fn fn_signature_for_method_call_defined_in_macro() {
check(
r#"
+//- minicore: sized, fn
macro_rules! id { ($($tt:tt)*) => { $($tt)* } }
struct S;
id! {
@@ -1429,6 +1465,7 @@ fn foo<'a>(&'a mut self)
fn call_info_for_lambdas() {
check(
r#"
+//- minicore: sized, fn
struct S;
fn foo(s: S) -> i32 { 92 }
fn main() {
@@ -1443,6 +1480,7 @@ impl FnOnce(s: S) -> i32
);
check(
r#"
+//- minicore: sized, fn
struct S;
fn foo(s: S) -> i32 { 92 }
fn main() {
@@ -1456,6 +1494,7 @@ impl Fn(s: S) -> i32
);
check(
r#"
+//- minicore: sized, fn
struct S;
fn foo(s: S) -> i32 { 92 }
fn main() {
@@ -1474,6 +1513,7 @@ impl FnMut(s: S) -> i32
fn call_info_for_fn_def_over_reference() {
check(
r#"
+//- minicore: sized, fn
struct S;
fn foo(s: S) -> i32 { 92 }
fn main() {
@@ -1492,6 +1532,7 @@ fn foo(s: S) -> i32
fn call_info_for_fn_ptr() {
check(
r#"
+//- minicore: sized, fn
fn main(f: fn(i32, f64) -> char) {
f(0, $0)
}
@@ -1507,6 +1548,7 @@ fn main(f: fn(i32, f64) -> char) {
fn call_info_for_fn_impl() {
check(
r#"
+//- minicore: sized, fn
struct S;
impl core::ops::FnOnce<(i32, f64)> for S {
type Output = char;
@@ -1524,6 +1566,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
struct S;
impl core::ops::FnOnce<(i32, f64)> for S {
type Output = char;
@@ -1541,6 +1584,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
struct S;
impl core::ops::FnOnce<(i32, f64)> for S {
type Output = char;
@@ -1556,6 +1600,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
struct S;
impl core::ops::FnOnce<(i32, f64)> for S {
type Output = char;
@@ -1576,6 +1621,7 @@ fn main() {
fn call_info_for_unclosed_call() {
check(
r#"
+//- minicore: sized, fn
fn foo(foo: u32, bar: u32) {}
fn main() {
foo($0
@@ -1588,6 +1634,7 @@ fn foo(foo: u32, bar: u32)
// check with surrounding space
check(
r#"
+//- minicore: sized, fn
fn foo(foo: u32, bar: u32) {}
fn main() {
foo( $0
@@ -1603,6 +1650,7 @@ fn foo(foo: u32, bar: u32)
fn test_multiline_argument() {
check(
r#"
+//- minicore: sized, fn
fn callee(a: u8, b: u8) {}
fn main() {
callee(match 0 {
@@ -1613,6 +1661,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn callee(a: u8, b: u8) {}
fn main() {
callee(match 0 {
@@ -1626,6 +1675,7 @@ fn callee(a: u8, b: u8)
);
check(
r#"
+//- minicore: sized, fn
fn callee(a: u8, b: u8) {}
fn main() {
callee($0match 0 {
@@ -1643,6 +1693,7 @@ fn callee(a: u8, b: u8)
fn test_generics_simple() {
check(
r#"
+//- minicore: sized, fn
/// Option docs.
enum Option<T> {
Some(T),
@@ -1666,6 +1717,7 @@ enum Option<T>
fn test_generics_on_variant() {
check(
r#"
+//- minicore: sized, fn
/// Option docs.
enum Option<T> {
/// Some docs.
@@ -1693,6 +1745,7 @@ enum Option<T>
fn test_lots_of_generics() {
check(
r#"
+//- minicore: sized, fn
trait Tr<T> {}
struct S<T>(T);
@@ -1716,6 +1769,7 @@ fn f<G: Tr<()>, H>
fn test_generics_in_trait_ufcs() {
check(
r#"
+//- minicore: sized, fn
trait Tr {
fn f<T: Tr, U>() {}
}
@@ -1739,6 +1793,7 @@ fn f<T: Tr, U>
fn test_generics_in_method_call() {
check(
r#"
+//- minicore: sized, fn
struct S;
impl S {
@@ -1760,6 +1815,7 @@ fn f<T>
fn test_generic_param_in_method_call() {
check(
r#"
+//- minicore: sized, fn
struct Foo;
impl Foo {
fn test<V>(&mut self, val: V) {}
@@ -1779,6 +1835,7 @@ fn test<V>(&mut self, val: V)
fn test_generic_kinds() {
check(
r#"
+//- minicore: sized, fn
fn callee<'a, const A: u8, T, const C: u8>() {}
fn f() {
@@ -1792,6 +1849,7 @@ fn callee<'a, const A: u8, T, const C: u8>
);
check(
r#"
+//- minicore: sized, fn
fn callee<'a, const A: u8, T, const C: u8>() {}
fn f() {
@@ -1809,6 +1867,7 @@ fn callee<'a, const A: u8, T, const C: u8>
fn test_trait_assoc_types() {
check(
r#"
+//- minicore: sized, fn
trait Trait<'a, T> {
type Assoc;
}
@@ -1821,6 +1880,7 @@ trait Trait<'a, T, Assoc = …>
);
check(
r#"
+//- minicore: sized, fn
trait Iterator {
type Item;
}
@@ -1833,6 +1893,7 @@ trait Iterator<Item = …>
);
check(
r#"
+//- minicore: sized, fn
trait Iterator {
type Item;
}
@@ -1845,6 +1906,7 @@ trait Iterator<Item = …>
);
check(
r#"
+//- minicore: sized, fn
trait Tr {
type A;
type B;
@@ -1858,6 +1920,7 @@ trait Tr<A = …, B = …>
);
check(
r#"
+//- minicore: sized, fn
trait Tr {
type A;
type B;
@@ -1871,6 +1934,7 @@ trait Tr<A = …, B = …>
);
check(
r#"
+//- minicore: sized, fn
trait Tr {
type A;
type B;
@@ -1884,6 +1948,7 @@ trait Tr<B = …, A = …>
);
check(
r#"
+//- minicore: sized, fn
trait Tr {
type A;
type B;
@@ -1901,6 +1966,7 @@ trait Tr<B = …, A = …>
fn test_supertrait_assoc() {
check(
r#"
+//- minicore: sized, fn
trait Super {
type SuperTy;
}
@@ -1920,6 +1986,7 @@ trait Sub<SubTy = …, SuperTy = …>
fn no_assoc_types_outside_type_bounds() {
check(
r#"
+//- minicore: sized, fn
trait Tr<T> {
type Assoc;
}
@@ -1938,6 +2005,7 @@ fn impl_trait() {
// FIXME: Substitute type vars in impl trait (`U` -> `i8`)
check(
r#"
+//- minicore: sized, fn
trait Trait<T> {}
struct Wrap<T>(T);
fn foo<U>(x: Wrap<impl Trait<U>>) {}
@@ -1956,6 +2024,7 @@ fn foo<U>(x: Wrap<impl Trait<U>>)
fn fully_qualified_syntax() {
check(
r#"
+//- minicore: sized, fn
fn f() {
trait A { fn foo(&self, other: Self); }
A::foo(&self$0, other);
@@ -1972,6 +2041,7 @@ fn foo(self: &Self, other: Self)
fn help_for_generic_call() {
check(
r#"
+//- minicore: sized, fn
fn f<F: FnOnce(u8, u16) -> i32>(f: F) {
f($0)
}
@@ -1983,6 +2053,7 @@ impl FnOnce(u8, u16) -> i32
);
check(
r#"
+//- minicore: sized, fn
fn f<T, F: FnMut(&T, u16) -> &T>(f: F) {
f($0)
}
@@ -1996,8 +2067,15 @@ impl FnMut(&T, u16) -> &T
#[test]
fn regression_13579() {
+ // FIXME(next-solver): There should be signature help available here.
+ // The reason it is not is because of a trait solver bug. Since `Error` is not provided
+ // nor it can be inferred, it becomes an error type. The bug is that the solver ignores
+ // predicates on error types, and they do not guide infer vars, not allowing us to infer
+ // that `take`'s return type is callable.
+ // https://github.com/rust-lang/rust/pull/146602 should fix the solver bug.
check(
r#"
+//- minicore: sized, fn
fn f() {
take(2)($0);
}
@@ -2008,9 +2086,7 @@ fn take<C, Error>(
move || count
}
"#,
- expect![[r#"
- impl Fn() -> i32
- "#]],
+ expect![""],
);
}
@@ -2018,6 +2094,7 @@ impl Fn() -> i32
fn record_literal() {
check(
r#"
+//- minicore: sized, fn
struct Strukt<T, U = ()> {
t: T,
u: U,
@@ -2041,6 +2118,7 @@ struct Strukt { u: i32, t: T, unit: () }
fn record_literal_nonexistent_field() {
check(
r#"
+//- minicore: sized, fn
struct Strukt {
a: u8,
}
@@ -2062,6 +2140,7 @@ struct Strukt { a: u8 }
fn tuple_variant_record_literal() {
check(
r#"
+//- minicore: sized, fn
enum Opt {
Some(u8),
}
@@ -2076,6 +2155,7 @@ enum Opt::Some { 0: u8 }
);
check(
r#"
+//- minicore: sized, fn
enum Opt {
Some(u8),
}
@@ -2094,6 +2174,7 @@ enum Opt::Some { 0: u8 }
fn record_literal_self() {
check(
r#"
+//- minicore: sized, fn
struct S { t: u8 }
impl S {
fn new() -> Self {
@@ -2112,6 +2193,7 @@ struct S { t: u8 }
fn record_pat() {
check(
r#"
+//- minicore: sized, fn
struct Strukt<T, U = ()> {
t: T,
u: U,
@@ -2135,6 +2217,7 @@ struct Strukt { u: i32, t: T, unit: () }
fn test_enum_in_nested_method_in_lambda() {
check(
r#"
+//- minicore: sized, fn
enum A {
A,
B
@@ -2158,6 +2241,7 @@ fn bar(_: A)
fn test_tuple_expr_free() {
check(
r#"
+//- minicore: sized, fn
fn main() {
(0$0, 1, 3);
}
@@ -2169,6 +2253,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
($0 1, 3);
}
@@ -2180,6 +2265,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
(1, 3 $0);
}
@@ -2191,6 +2277,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
(1, 3 $0,);
}
@@ -2206,6 +2293,7 @@ fn main() {
fn test_tuple_expr_expected() {
check(
r#"
+//- minicore: sized, fn
fn main() {
let _: (&str, u32, u32)= ($0, 1, 3);
}
@@ -2218,6 +2306,7 @@ fn main() {
// FIXME: Should typeck report a 4-ary tuple for the expression here?
check(
r#"
+//- minicore: sized, fn
fn main() {
let _: (&str, u32, u32, u32) = ($0, 1, 3);
}
@@ -2229,6 +2318,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let _: (&str, u32, u32)= ($0, 1, 3, 5);
}
@@ -2244,6 +2334,7 @@ fn main() {
fn test_tuple_pat_free() {
check(
r#"
+//- minicore: sized, fn
fn main() {
let ($0, 1, 3);
}
@@ -2255,6 +2346,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (0$0, 1, 3);
}
@@ -2266,6 +2358,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let ($0 1, 3);
}
@@ -2277,6 +2370,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0);
}
@@ -2288,6 +2382,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0,);
}
@@ -2299,6 +2394,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0, ..);
}
@@ -2310,6 +2406,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3, .., $0);
}
@@ -2326,6 +2423,7 @@ fn main() {
fn test_tuple_pat_expected() {
check(
r#"
+//- minicore: sized, fn
fn main() {
let (0$0, 1, 3): (i32, i32, i32);
}
@@ -2337,6 +2435,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let ($0, 1, 3): (i32, i32, i32);
}
@@ -2348,6 +2447,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0): (i32,);
}
@@ -2359,6 +2459,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0, ..): (i32, i32, i32, i32);
}
@@ -2370,6 +2471,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3, .., $0): (i32, i32, i32);
}
@@ -2384,6 +2486,7 @@ fn main() {
fn test_tuple_pat_expected_inferred() {
check(
r#"
+//- minicore: sized, fn
fn main() {
let (0$0, 1, 3) = (1, 2 ,3);
}
@@ -2395,6 +2498,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let ($0 1, 3) = (1, 2, 3);
}
@@ -2407,6 +2511,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0) = (1,);
}
@@ -2418,6 +2523,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3 $0, ..) = (1, 2, 3, 4);
}
@@ -2429,6 +2535,7 @@ fn main() {
);
check(
r#"
+//- minicore: sized, fn
fn main() {
let (1, 3, .., $0) = (1, 2, 3);
}
@@ -2444,6 +2551,7 @@ fn main() {
fn test_tuple_generic_param() {
check(
r#"
+//- minicore: sized, fn
struct S<T>(T);
fn main() {
@@ -2461,6 +2569,7 @@ struct S<T>
fn test_enum_generic_param() {
check(
r#"
+//- minicore: sized, fn
enum Option<T> {
Some(T),
None,
@@ -2481,6 +2590,7 @@ enum Option<T>
fn test_enum_variant_generic_param() {
check(
r#"
+//- minicore: sized, fn
enum Option<T> {
Some(T),
None,
@@ -2501,6 +2611,7 @@ enum Option<T>::Some({unknown})
fn test_generic_arg_with_default() {
check(
r#"
+//- minicore: sized, fn
struct S<T = u8> {
field: T,
}
@@ -2517,6 +2628,7 @@ struct S<T = u8>
check(
r#"
+//- minicore: sized, fn
struct S<const C: u8 = 5> {
field: C,
}
@@ -2531,4 +2643,27 @@ struct S<const C: u8 = 5>
"#]],
);
}
+
+ #[test]
+ fn test_async_function() {
+ check(
+ r#"
+//- minicore: sized, fn, future, result
+pub async fn conn_mut<F, T>(f: F) -> Result<T, i32>
+where
+ F: FnOnce() -> T,
+{
+ Ok(f())
+}
+
+fn main() {
+ conn_mut($0)
+}
+ "#,
+ expect![[r#"
+ async fn conn_mut<F: FnOnce() -> T, T>(f: F) -> Result<T, i32>
+ ^^^^
+ "#]],
+ );
+ }
}
diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs
index 66895cb..531c7e1 100644
--- a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs
@@ -114,9 +114,9 @@ pub struct HighlightConfig<'a> {
// |-----------|--------------------------------|
// |operator| Emitted for general operators.|
// |arithmetic| Emitted for the arithmetic operators `+`, `-`, `*`, `/`, `+=`, `-=`, `*=`, `/=`.|
-// |bitwise| Emitted for the bitwise operators `|`, `&`, `!`, `^`, `|=`, `&=`, `^=`.|
+// |bitwise| Emitted for the bitwise operators `\|`, `&`, `!`, `^`, `\|=`, `&=`, `^=`.|
// |comparison| Emitted for the comparison oerators `>`, `<`, `==`, `>=`, `<=`, `!=`.|
-// |logical| Emitted for the logical operators `||`, `&&`, `!`.|
+// |logical| Emitted for the logical operators `\|\|`, `&&`, `!`.|
//
// - For punctuation:
//
@@ -172,20 +172,20 @@ pub struct HighlightConfig<'a> {
// |constant| Emitted for const.|
// |consuming| Emitted for locals that are being consumed when use in a function call.|
// |controlFlow| Emitted for control-flow related tokens, this includes th `?` operator.|
-// |crateRoot| Emitted for crate names, like `serde` and `crate.|
+// |crateRoot| Emitted for crate names, like `serde` and `crate`.|
// |declaration| Emitted for names of definitions, like `foo` in `fn foo(){}`.|
-// |defaultLibrary| Emitted for items from built-in crates (std, core, allc, test and proc_macro).|
+// |defaultLibrary| Emitted for items from built-in crates (std, core, alloc, test and proc_macro).|
// |documentation| Emitted for documentation comment.|
// |injected| Emitted for doc-string injected highlighting like rust source blocks in documentation.|
// |intraDocLink| Emitted for intra doc links in doc-string.|
-// |library| Emitted for items that are defined outside of the current crae.|
+// |library| Emitted for items that are defined outside of the current crate.|
// |macro| Emitted for tokens inside macro call.|
// |mutable| Emitted for mutable locals and statics as well as functions taking `&mut self`.|
-// |public| Emitted for items that are from the current crate and are `pub.|
-// |reference| Emitted for locals behind a reference and functions taking self` by reference.|
-// |static| Emitted for "static" functions, also known as functions that d not take a `self` param, as well as statics and consts.|
+// |public| Emitted for items that are from the current crate and are `pub`.|
+// |reference| Emitted for locals behind a reference and functions taking `self` by reference.|
+// |static| Emitted for "static" functions, also known as functions that do not take a `self` param, as well as statics and consts.|
// |trait| Emitted for associated trait item.|
-// |unsafe| Emitted for unsafe operations, like unsafe function calls, as ell as the `unsafe` token.|
+// |unsafe| Emitted for unsafe operations, like unsafe function calls, as well as the `unsafe` token.|
//
// 
// 
diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_block_mod_items.html b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_block_mod_items.html
index 3beda39..711f534 100644
--- a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_block_mod_items.html
+++ b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_block_mod_items.html
@@ -53,7 +53,7 @@
<span class="macro public">foo</span><span class="macro_bang">!</span><span class="parenthesis">(</span><span class="struct declaration macro public">Bar</span><span class="parenthesis">)</span><span class="semicolon">;</span>
<span class="keyword">fn</span> <span class="function declaration">func</span><span class="parenthesis">(</span><span class="punctuation">_</span><span class="colon">:</span> <span class="module">y</span><span class="operator">::</span><span class="struct public">Bar</span><span class="parenthesis">)</span> <span class="brace">{</span>
<span class="keyword">mod</span> <span class="module declaration">inner</span> <span class="brace">{</span>
- <span class="keyword">struct</span> <span class="struct declaration">Innerest</span><span class="angle"><</span><span class="keyword const">const</span> <span class="const_param const declaration">C</span><span class="colon">:</span> <span class="unresolved_reference">usize</span><span class="angle">></span> <span class="brace">{</span> <span class="field declaration">field</span><span class="colon">:</span> <span class="bracket">[</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span> <span class="brace">{</span><span class="const_param const">C</span><span class="brace">}</span><span class="bracket">]</span> <span class="brace">}</span>
+ <span class="keyword">struct</span> <span class="struct declaration">Innerest</span><span class="angle"><</span><span class="keyword const">const</span> <span class="const_param const declaration">C</span><span class="colon">:</span> <span class="builtin_type">usize</span><span class="angle">></span> <span class="brace">{</span> <span class="field declaration">field</span><span class="colon">:</span> <span class="bracket">[</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span> <span class="brace">{</span><span class="const_param const">C</span><span class="brace">}</span><span class="bracket">]</span> <span class="brace">}</span>
<span class="brace">}</span>
<span class="brace">}</span>
<span class="brace">}</span>
diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/regression_20952.html b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/regression_20952.html
new file mode 100644
index 0000000..2c0250c
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/regression_20952.html
@@ -0,0 +1,45 @@
+
+<style>
+body { margin: 0; }
+pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; }
+
+.lifetime { color: #DFAF8F; font-style: italic; }
+.label { color: #DFAF8F; font-style: italic; }
+.comment { color: #7F9F7F; }
+.documentation { color: #629755; }
+.intra_doc_link { font-style: italic; }
+.injected { opacity: 0.65 ; }
+.struct, .enum { color: #7CB8BB; }
+.enum_variant { color: #BDE0F3; }
+.string_literal { color: #CC9393; }
+.field { color: #94BFF3; }
+.function { color: #93E0E3; }
+.parameter { color: #94BFF3; }
+.text { color: #DCDCCC; }
+.type { color: #7CB8BB; }
+.builtin_type { color: #8CD0D3; }
+.type_param { color: #DFAF8F; }
+.attribute { color: #94BFF3; }
+.numeric_literal { color: #BFEBBF; }
+.bool_literal { color: #BFE6EB; }
+.macro { color: #94BFF3; }
+.proc_macro { color: #94BFF3; text-decoration: underline; }
+.derive { color: #94BFF3; font-style: italic; }
+.module { color: #AFD8AF; }
+.value_param { color: #DCDCCC; }
+.variable { color: #DCDCCC; }
+.format_specifier { color: #CC696B; }
+.mutable { text-decoration: underline; }
+.escape_sequence { color: #94BFF3; }
+.keyword { color: #F0DFAF; font-weight: bold; }
+.control { font-style: italic; }
+.reference { font-style: italic; font-weight: bold; }
+.const { font-weight: bolder; }
+.unsafe { color: #BC8383; }
+
+.invalid_escape_sequence { color: #FC5555; text-decoration: wavy underline; }
+.unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
+</style>
+<pre><code><span class="keyword">fn</span> <span class="function declaration">main</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span>
+ <span class="macro default_library library">format_args</span><span class="macro_bang">!</span><span class="parenthesis">(</span>"{} {}, {} (подозрение на спам: {:.2}%)"б<span class="parenthesis">)</span><span class="semicolon">;</span>
+<span class="brace">}</span></code></pre>
\ No newline at end of file
diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs
index 4e84127..58c613e 100644
--- a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs
@@ -1497,3 +1497,17 @@ fn main() {
false,
);
}
+
+#[test]
+fn regression_20952() {
+ check_highlighting(
+ r#"
+//- minicore: fmt
+fn main() {
+ format_args!("{} {}, {} (подозрение на спам: {:.2}%)"б);
+}
+"#,
+ expect_file!["./test_data/regression_20952.html"],
+ false,
+ );
+}
diff --git a/src/tools/rust-analyzer/crates/parser/src/grammar.rs b/src/tools/rust-analyzer/crates/parser/src/grammar.rs
index 8ddf50d..bf84302 100644
--- a/src/tools/rust-analyzer/crates/parser/src/grammar.rs
+++ b/src/tools/rust-analyzer/crates/parser/src/grammar.rs
@@ -94,7 +94,17 @@ pub(crate) mod top {
pub(crate) fn source_file(p: &mut Parser<'_>) {
let m = p.start();
+ // test frontmatter
+ // #!/usr/bin/env cargo
+ //
+ // ---
+ // [dependencies]
+ // clap = { version = "4.2", features = ["derive"] }
+ // ---
+ //
+ // fn main() {}
p.eat(SHEBANG);
+ p.eat(FRONTMATTER);
items::mod_contents(p, false);
m.complete(p, SOURCE_FILE);
}
diff --git a/src/tools/rust-analyzer/crates/parser/src/grammar/expressions/atom.rs b/src/tools/rust-analyzer/crates/parser/src/grammar/expressions/atom.rs
index ed8a91c..cde62e0 100644
--- a/src/tools/rust-analyzer/crates/parser/src/grammar/expressions/atom.rs
+++ b/src/tools/rust-analyzer/crates/parser/src/grammar/expressions/atom.rs
@@ -588,6 +588,12 @@ fn closure_expr(p: &mut Parser<'_>) -> CompletedMarker {
}
params::param_list_closure(p);
if opt_ret_type(p) {
+ // test_err closure_ret_recovery
+ // fn foo() { || -> A> { let x = 1; } }
+ while p.at(T![>]) {
+ // recover from unbalanced return type brackets
+ p.err_and_bump("expected a curly brace");
+ }
// test lambda_ret_block
// fn main() { || -> i32 { 92 }(); }
block_expr(p);
diff --git a/src/tools/rust-analyzer/crates/parser/src/grammar/items.rs b/src/tools/rust-analyzer/crates/parser/src/grammar/items.rs
index 8e551b0..c609f93 100644
--- a/src/tools/rust-analyzer/crates/parser/src/grammar/items.rs
+++ b/src/tools/rust-analyzer/crates/parser/src/grammar/items.rs
@@ -424,6 +424,14 @@ fn fn_(p: &mut Parser<'_>, m: Marker) {
// fn bar() -> () {}
opt_ret_type(p);
+ // test_err fn_ret_recovery
+ // fn foo() -> A>]) { let x = 1; }
+ // fn foo() -> A>]) where T: Copy { let x = 1; }
+ while p.at(T![')']) | p.at(T![']']) | p.at(T![>]) {
+ // recover from unbalanced return type brackets
+ p.err_and_bump("expected a curly brace");
+ }
+
// test function_where_clause
// fn foo<T>() where T: Copy {}
generic_params::opt_where_clause(p);
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/generated/runner.rs b/src/tools/rust-analyzer/crates/parser/test_data/generated/runner.rs
index 9bdbe56..7f5ff0e 100644
--- a/src/tools/rust-analyzer/crates/parser/test_data/generated/runner.rs
+++ b/src/tools/rust-analyzer/crates/parser/test_data/generated/runner.rs
@@ -265,6 +265,8 @@ fn for_range_from() {
#[test]
fn for_type() { run_and_expect_no_errors("test_data/parser/inline/ok/for_type.rs"); }
#[test]
+ fn frontmatter() { run_and_expect_no_errors("test_data/parser/inline/ok/frontmatter.rs"); }
+ #[test]
fn full_range_expr() {
run_and_expect_no_errors("test_data/parser/inline/ok/full_range_expr.rs");
}
@@ -749,6 +751,10 @@ fn async_without_semicolon() {
#[test]
fn bad_asm_expr() { run_and_expect_errors("test_data/parser/inline/err/bad_asm_expr.rs"); }
#[test]
+ fn closure_ret_recovery() {
+ run_and_expect_errors("test_data/parser/inline/err/closure_ret_recovery.rs");
+ }
+ #[test]
fn comma_after_default_values_syntax() {
run_and_expect_errors("test_data/parser/inline/err/comma_after_default_values_syntax.rs");
}
@@ -773,6 +779,10 @@ fn fn_pointer_type_missing_fn() {
run_and_expect_errors("test_data/parser/inline/err/fn_pointer_type_missing_fn.rs");
}
#[test]
+ fn fn_ret_recovery() {
+ run_and_expect_errors("test_data/parser/inline/err/fn_ret_recovery.rs");
+ }
+ #[test]
fn gen_fn() {
run_and_expect_errors_with_edition(
"test_data/parser/inline/err/gen_fn.rs",
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rast b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rast
new file mode 100644
index 0000000..f626651
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rast
@@ -0,0 +1,52 @@
+SOURCE_FILE
+ FN
+ FN_KW "fn"
+ WHITESPACE " "
+ NAME
+ IDENT "foo"
+ PARAM_LIST
+ L_PAREN "("
+ R_PAREN ")"
+ WHITESPACE " "
+ BLOCK_EXPR
+ STMT_LIST
+ L_CURLY "{"
+ WHITESPACE " "
+ CLOSURE_EXPR
+ PARAM_LIST
+ PIPE "|"
+ PIPE "|"
+ WHITESPACE " "
+ RET_TYPE
+ THIN_ARROW "->"
+ WHITESPACE " "
+ PATH_TYPE
+ PATH
+ PATH_SEGMENT
+ NAME_REF
+ IDENT "A"
+ ERROR
+ R_ANGLE ">"
+ WHITESPACE " "
+ BLOCK_EXPR
+ STMT_LIST
+ L_CURLY "{"
+ WHITESPACE " "
+ LET_STMT
+ LET_KW "let"
+ WHITESPACE " "
+ IDENT_PAT
+ NAME
+ IDENT "x"
+ WHITESPACE " "
+ EQ "="
+ WHITESPACE " "
+ LITERAL
+ INT_NUMBER "1"
+ SEMICOLON ";"
+ WHITESPACE " "
+ R_CURLY "}"
+ WHITESPACE " "
+ R_CURLY "}"
+ WHITESPACE "\n"
+error 18: expected a curly brace
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rs b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rs
new file mode 100644
index 0000000..7a758ec
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/closure_ret_recovery.rs
@@ -0,0 +1 @@
+fn foo() { || -> A> { let x = 1; } }
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rast b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rast
new file mode 100644
index 0000000..0323df8
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rast
@@ -0,0 +1,112 @@
+SOURCE_FILE
+ FN
+ FN_KW "fn"
+ WHITESPACE " "
+ NAME
+ IDENT "foo"
+ PARAM_LIST
+ L_PAREN "("
+ R_PAREN ")"
+ WHITESPACE " "
+ RET_TYPE
+ THIN_ARROW "->"
+ WHITESPACE " "
+ PATH_TYPE
+ PATH
+ PATH_SEGMENT
+ NAME_REF
+ IDENT "A"
+ ERROR
+ R_ANGLE ">"
+ ERROR
+ R_BRACK "]"
+ ERROR
+ R_PAREN ")"
+ WHITESPACE " "
+ BLOCK_EXPR
+ STMT_LIST
+ L_CURLY "{"
+ WHITESPACE " "
+ LET_STMT
+ LET_KW "let"
+ WHITESPACE " "
+ IDENT_PAT
+ NAME
+ IDENT "x"
+ WHITESPACE " "
+ EQ "="
+ WHITESPACE " "
+ LITERAL
+ INT_NUMBER "1"
+ SEMICOLON ";"
+ WHITESPACE " "
+ R_CURLY "}"
+ WHITESPACE "\n"
+ FN
+ FN_KW "fn"
+ WHITESPACE " "
+ NAME
+ IDENT "foo"
+ PARAM_LIST
+ L_PAREN "("
+ R_PAREN ")"
+ WHITESPACE " "
+ RET_TYPE
+ THIN_ARROW "->"
+ WHITESPACE " "
+ PATH_TYPE
+ PATH
+ PATH_SEGMENT
+ NAME_REF
+ IDENT "A"
+ ERROR
+ R_ANGLE ">"
+ ERROR
+ R_BRACK "]"
+ ERROR
+ R_PAREN ")"
+ WHITESPACE " "
+ WHERE_CLAUSE
+ WHERE_KW "where"
+ WHITESPACE " "
+ WHERE_PRED
+ PATH_TYPE
+ PATH
+ PATH_SEGMENT
+ NAME_REF
+ IDENT "T"
+ COLON ":"
+ WHITESPACE " "
+ TYPE_BOUND_LIST
+ TYPE_BOUND
+ PATH_TYPE
+ PATH
+ PATH_SEGMENT
+ NAME_REF
+ IDENT "Copy"
+ WHITESPACE " "
+ BLOCK_EXPR
+ STMT_LIST
+ L_CURLY "{"
+ WHITESPACE " "
+ LET_STMT
+ LET_KW "let"
+ WHITESPACE " "
+ IDENT_PAT
+ NAME
+ IDENT "x"
+ WHITESPACE " "
+ EQ "="
+ WHITESPACE " "
+ LITERAL
+ INT_NUMBER "1"
+ SEMICOLON ";"
+ WHITESPACE " "
+ R_CURLY "}"
+ WHITESPACE "\n"
+error 13: expected a curly brace
+error 14: expected a curly brace
+error 15: expected a curly brace
+error 45: expected a curly brace
+error 46: expected a curly brace
+error 47: expected a curly brace
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rs b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rs
new file mode 100644
index 0000000..73e3d84
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err/fn_ret_recovery.rs
@@ -0,0 +1,2 @@
+fn foo() -> A>]) { let x = 1; }
+fn foo() -> A>]) where T: Copy { let x = 1; }
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rast b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rast
new file mode 100644
index 0000000..bad8959
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rast
@@ -0,0 +1,18 @@
+SOURCE_FILE
+ SHEBANG "#!/usr/bin/env cargo\n"
+ FRONTMATTER "\n---\n[dependencies]\nclap = { version = \"4.2\", features = [\"derive\"] }\n---\n"
+ WHITESPACE "\n"
+ FN
+ FN_KW "fn"
+ WHITESPACE " "
+ NAME
+ IDENT "main"
+ PARAM_LIST
+ L_PAREN "("
+ R_PAREN ")"
+ WHITESPACE " "
+ BLOCK_EXPR
+ STMT_LIST
+ L_CURLY "{"
+ R_CURLY "}"
+ WHITESPACE "\n"
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rs b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rs
new file mode 100644
index 0000000..1f9f7a7
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rs
@@ -0,0 +1,8 @@
+#!/usr/bin/env cargo
+
+---
+[dependencies]
+clap = { version = "4.2", features = ["derive"] }
+---
+
+fn main() {}
diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/tests/mod.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/tests/mod.rs
index 08495f5..d4f9976 100644
--- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/tests/mod.rs
+++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/tests/mod.rs
@@ -326,7 +326,7 @@ fn test_fn_like_macro_clone_literals() {
PUNCH , [alone] 1
LITERAL Str hello bridge 1
PUNCH , [alone] 1
- LITERAL Str suffixedsuffix 1
+ LITERAL Err(()) "suffixed"suffix 1
PUNCH , [alone] 1
LITERAL StrRaw(2) raw 1
PUNCH , [alone] 1
@@ -372,7 +372,7 @@ fn test_fn_like_macro_clone_literals() {
PUNCH , [alone] 42:Root[0000, 0]@27..28#ROOT2024
LITERAL Str hello bridge 42:Root[0000, 0]@29..43#ROOT2024
PUNCH , [alone] 42:Root[0000, 0]@43..44#ROOT2024
- LITERAL Str suffixedsuffix 42:Root[0000, 0]@45..61#ROOT2024
+ LITERAL Err(()) "suffixed"suffix 42:Root[0000, 0]@45..61#ROOT2024
PUNCH , [alone] 42:Root[0000, 0]@61..62#ROOT2024
LITERAL StrRaw(2) raw 42:Root[0000, 0]@63..73#ROOT2024
PUNCH , [alone] 42:Root[0000, 0]@73..74#ROOT2024
diff --git a/src/tools/rust-analyzer/crates/project-model/src/build_dependencies.rs b/src/tools/rust-analyzer/crates/project-model/src/build_dependencies.rs
index 3a682d5..fedc694 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/build_dependencies.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/build_dependencies.rs
@@ -86,6 +86,7 @@ pub(crate) fn run_for_workspace(
config,
&allowed_features,
workspace.manifest_path(),
+ workspace.target_directory().as_ref(),
current_dir,
sysroot,
toolchain,
@@ -106,8 +107,9 @@ pub(crate) fn run_once(
let (_guard, cmd) = Self::build_command(
config,
&Default::default(),
- // This is not gonna be used anyways, so just construct a dummy here
+ // These are not gonna be used anyways, so just construct a dummy here
&ManifestPath::try_from(working_directory.clone()).unwrap(),
+ working_directory.as_ref(),
working_directory,
&Sysroot::empty(),
None,
@@ -430,6 +432,7 @@ fn build_command(
config: &CargoConfig,
allowed_features: &FxHashSet<String>,
manifest_path: &ManifestPath,
+ target_dir: &Utf8Path,
current_dir: &AbsPath,
sysroot: &Sysroot,
toolchain: Option<&semver::Version>,
@@ -450,8 +453,9 @@ fn build_command(
cmd.arg("--manifest-path");
cmd.arg(manifest_path);
- if let Some(target_dir) = &config.target_dir {
- cmd.arg("--target-dir").arg(target_dir);
+ if let Some(target_dir) = config.target_dir_config.target_dir(Some(target_dir)) {
+ cmd.arg("--target-dir");
+ cmd.arg(target_dir.as_ref());
}
if let Some(target) = &config.target {
diff --git a/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs b/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
index 76ba01f..7311049 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/cargo_workspace.rs
@@ -1,7 +1,6 @@
//! See [`CargoWorkspace`].
-use std::ops;
-use std::str::from_utf8;
+use std::{borrow::Cow, ops, str::from_utf8};
use anyhow::Context;
use base_db::Env;
@@ -95,6 +94,29 @@ fn default() -> Self {
}
}
+#[derive(Clone, Debug, Default, PartialEq, Eq)]
+pub enum TargetDirectoryConfig {
+ #[default]
+ None,
+ UseSubdirectory,
+ Directory(Utf8PathBuf),
+}
+
+impl TargetDirectoryConfig {
+ pub fn target_dir<'a>(
+ &'a self,
+ ws_target_dir: Option<&'a Utf8Path>,
+ ) -> Option<Cow<'a, Utf8Path>> {
+ match self {
+ TargetDirectoryConfig::None => None,
+ TargetDirectoryConfig::UseSubdirectory => {
+ Some(Cow::Owned(ws_target_dir?.join("rust-analyzer")))
+ }
+ TargetDirectoryConfig::Directory(dir) => Some(Cow::Borrowed(dir)),
+ }
+ }
+}
+
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct CargoConfig {
/// Whether to pass `--all-targets` to cargo invocations.
@@ -121,7 +143,7 @@ pub struct CargoConfig {
pub extra_env: FxHashMap<String, Option<String>>,
pub invocation_strategy: InvocationStrategy,
/// Optional path to use instead of `target` when building
- pub target_dir: Option<Utf8PathBuf>,
+ pub target_dir_config: TargetDirectoryConfig,
/// Gate `#[test]` behind `#[cfg(test)]`
pub set_test: bool,
/// Load the project without any dependencies
@@ -715,21 +737,15 @@ pub(crate) fn new(
}
}
- pub(crate) fn no_deps_metadata(&self) -> Option<&cargo_metadata::Metadata> {
- self.no_deps_result.as_ref().ok()
- }
-
/// Executes the metadata-fetching command.
///
/// A successful result may still contain a metadata error if the full fetch failed,
/// but the fallback `--no-deps` pre-fetch succeeded during command construction.
pub(crate) fn exec(
self,
- target_dir: &Utf8Path,
locked: bool,
progress: &dyn Fn(String),
) -> anyhow::Result<(cargo_metadata::Metadata, Option<anyhow::Error>)> {
- _ = target_dir;
let Self {
mut command,
manifest_path: _,
diff --git a/src/tools/rust-analyzer/crates/project-model/src/lib.rs b/src/tools/rust-analyzer/crates/project-model/src/lib.rs
index e36b904..910bc0a 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/lib.rs
@@ -62,7 +62,7 @@ pub enum QueryConfig<'a> {
build_dependencies::{ProcMacroDylibPath, WorkspaceBuildScripts},
cargo_workspace::{
CargoConfig, CargoFeatures, CargoMetadataConfig, CargoWorkspace, Package, PackageData,
- PackageDependency, RustLibSource, Target, TargetData, TargetKind,
+ PackageDependency, RustLibSource, Target, TargetData, TargetDirectoryConfig, TargetKind,
},
manifest_path::ManifestPath,
project_json::{ProjectJson, ProjectJsonData},
diff --git a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
index 5cc399b..920afe6 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
@@ -9,7 +9,7 @@
use anyhow::{Result, format_err};
use itertools::Itertools;
-use paths::{AbsPath, AbsPathBuf, Utf8Path, Utf8PathBuf};
+use paths::{AbsPath, AbsPathBuf, Utf8PathBuf};
use rustc_hash::FxHashMap;
use stdx::format_to;
use toolchain::{Tool, probe_for_binary};
@@ -219,7 +219,6 @@ pub fn load_workspace(
&self,
sysroot_source_config: &RustSourceWorkspaceConfig,
no_deps: bool,
- target_dir: &Utf8Path,
progress: &dyn Fn(String),
) -> Option<RustLibSrcWorkspace> {
assert!(matches!(self.workspace, RustLibSrcWorkspace::Empty), "workspace already loaded");
@@ -233,7 +232,6 @@ pub fn load_workspace(
match self.load_library_via_cargo(
&library_manifest,
src_root,
- target_dir,
cargo_config,
no_deps,
progress,
@@ -328,7 +326,6 @@ fn load_library_via_cargo(
&self,
library_manifest: &ManifestPath,
current_dir: &AbsPath,
- target_dir: &Utf8Path,
cargo_config: &CargoMetadataConfig,
no_deps: bool,
progress: &dyn Fn(String),
@@ -345,7 +342,7 @@ fn load_library_via_cargo(
let locked = true;
let (mut res, err) =
FetchMetadata::new(library_manifest, current_dir, &cargo_config, self, no_deps)
- .exec(target_dir, locked, progress)?;
+ .exec(locked, progress)?;
// Patch out `rustc-std-workspace-*` crates to point to the real crates.
// This is done prior to `CrateGraph` construction to prevent de-duplication logic from failing.
diff --git a/src/tools/rust-analyzer/crates/project-model/src/tests.rs b/src/tools/rust-analyzer/crates/project-model/src/tests.rs
index 711cdd1..1908fc0 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/tests.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/tests.rs
@@ -238,12 +238,8 @@ fn smoke_test_real_sysroot_cargo() {
);
let cwd = AbsPathBuf::assert_utf8(temp_dir().join("smoke_test_real_sysroot_cargo"));
std::fs::create_dir_all(&cwd).unwrap();
- let loaded_sysroot = sysroot.load_workspace(
- &RustSourceWorkspaceConfig::default_cargo(),
- false,
- &Utf8PathBuf::default(),
- &|_| (),
- );
+ let loaded_sysroot =
+ sysroot.load_workspace(&RustSourceWorkspaceConfig::default_cargo(), false, &|_| ());
if let Some(loaded_sysroot) = loaded_sysroot {
sysroot.set_workspace(loaded_sysroot);
}
diff --git a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
index b88db41..aa2e159 100644
--- a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
+++ b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs
@@ -16,7 +16,7 @@
use rustc_hash::{FxHashMap, FxHashSet};
use semver::Version;
use span::{Edition, FileId};
-use toolchain::{NO_RUSTUP_AUTO_INSTALL_ENV, Tool};
+use toolchain::Tool;
use tracing::instrument;
use tracing::{debug, error, info};
use triomphe::Arc;
@@ -295,11 +295,6 @@ struct Root {
&sysroot,
*no_deps,
);
- let target_dir = config
- .target_dir
- .clone()
- .or_else(|| fetch_metadata.no_deps_metadata().map(|m| m.target_directory.clone()))
- .unwrap_or_else(|| workspace_dir.join("target").into());
// We spawn a bunch of processes to query various information about the workspace's
// toolchain and sysroot
@@ -345,7 +340,7 @@ struct Root {
},
&sysroot,
*no_deps,
- ).exec(&target_dir, true, progress) {
+ ).exec(true, progress) {
Ok((meta, _error)) => {
let workspace = CargoWorkspace::new(
meta,
@@ -374,16 +369,16 @@ struct Root {
})
});
- let cargo_metadata = s.spawn(|| fetch_metadata.exec(&target_dir, false, progress));
+ let cargo_metadata = s.spawn(|| fetch_metadata.exec(false, progress));
let loaded_sysroot = s.spawn(|| {
sysroot.load_workspace(
&RustSourceWorkspaceConfig::CargoMetadata(sysroot_metadata_config(
config,
+ workspace_dir,
&targets,
toolchain.clone(),
)),
config.no_deps,
- &target_dir,
progress,
)
});
@@ -463,12 +458,6 @@ pub fn load_inline(
let targets = target_tuple::get(query_config, config.target.as_deref(), &config.extra_env)
.unwrap_or_default();
let toolchain = version::get(query_config, &config.extra_env).ok().flatten();
- let project_root = project_json.project_root();
- let target_dir = config
- .target_dir
- .clone()
- .or_else(|| cargo_target_dir(project_json.manifest()?, &config.extra_env, &sysroot))
- .unwrap_or_else(|| project_root.join("target").into());
// We spawn a bunch of processes to query various information about the workspace's
// toolchain and sysroot
@@ -486,18 +475,17 @@ pub fn load_inline(
sysroot.load_workspace(
&RustSourceWorkspaceConfig::Json(*sysroot_project),
config.no_deps,
- &target_dir,
progress,
)
} else {
sysroot.load_workspace(
&RustSourceWorkspaceConfig::CargoMetadata(sysroot_metadata_config(
config,
+ project_json.project_root(),
&targets,
toolchain.clone(),
)),
config.no_deps,
- &target_dir,
progress,
)
}
@@ -545,20 +533,15 @@ pub fn load_detached_file(
.unwrap_or_default();
let rustc_cfg = rustc_cfg::get(query_config, None, &config.extra_env);
let target_data = target_data::get(query_config, None, &config.extra_env);
- let target_dir = config
- .target_dir
- .clone()
- .or_else(|| cargo_target_dir(detached_file, &config.extra_env, &sysroot))
- .unwrap_or_else(|| dir.join("target").into());
let loaded_sysroot = sysroot.load_workspace(
&RustSourceWorkspaceConfig::CargoMetadata(sysroot_metadata_config(
config,
+ dir,
&targets,
toolchain.clone(),
)),
config.no_deps,
- &target_dir,
&|_| (),
);
if let Some(loaded_sysroot) = loaded_sysroot {
@@ -579,21 +562,15 @@ pub fn load_detached_file(
&sysroot,
config.no_deps,
);
- let target_dir = config
- .target_dir
- .clone()
- .or_else(|| fetch_metadata.no_deps_metadata().map(|m| m.target_directory.clone()))
- .unwrap_or_else(|| dir.join("target").into());
- let cargo_script =
- fetch_metadata.exec(&target_dir, false, &|_| ()).ok().map(|(ws, error)| {
- let cargo_config_extra_env =
- cargo_config_env(detached_file, &config_file, &config.extra_env);
- (
- CargoWorkspace::new(ws, detached_file.clone(), cargo_config_extra_env, false),
- WorkspaceBuildScripts::default(),
- error.map(Arc::new),
- )
- });
+ let cargo_script = fetch_metadata.exec(false, &|_| ()).ok().map(|(ws, error)| {
+ let cargo_config_extra_env =
+ cargo_config_env(detached_file, &config_file, &config.extra_env);
+ (
+ CargoWorkspace::new(ws, detached_file.clone(), cargo_config_extra_env, false),
+ WorkspaceBuildScripts::default(),
+ error.map(Arc::new),
+ )
+ });
Ok(ProjectWorkspace {
kind: ProjectWorkspaceKind::DetachedFile {
@@ -1890,37 +1867,32 @@ fn add_dep_inner(graph: &mut CrateGraphBuilder, from: CrateBuilderId, dep: Depen
fn sysroot_metadata_config(
config: &CargoConfig,
+ current_dir: &AbsPath,
targets: &[String],
toolchain_version: Option<Version>,
) -> CargoMetadataConfig {
+ // We run `cargo metadata` on sysroot with sysroot dir as a working directory, but still pass
+ // the `targets` from the cargo config evaluated from the workspace's `current_dir`.
+ // So, we need to *canonicalize* those *might-be-relative-paths-to-custom-target-json-files*.
+ //
+ // See https://github.com/rust-lang/cargo/blob/f7acf448fc127df9a77c52cc2bba027790ac4931/src/cargo/core/compiler/compile_kind.rs#L171-L192
+ let targets = targets
+ .iter()
+ .map(|target| {
+ if target.ends_with(".json") {
+ current_dir.join(target).to_string()
+ } else {
+ target.to_owned()
+ }
+ })
+ .collect();
+
CargoMetadataConfig {
features: Default::default(),
- targets: targets.to_vec(),
+ targets,
extra_args: Default::default(),
extra_env: config.extra_env.clone(),
toolchain_version,
kind: "sysroot",
}
}
-
-fn cargo_target_dir(
- manifest: &ManifestPath,
- extra_env: &FxHashMap<String, Option<String>>,
- sysroot: &Sysroot,
-) -> Option<Utf8PathBuf> {
- let cargo = sysroot.tool(Tool::Cargo, manifest.parent(), extra_env);
- let mut meta = cargo_metadata::MetadataCommand::new();
- meta.env(NO_RUSTUP_AUTO_INSTALL_ENV.0, NO_RUSTUP_AUTO_INSTALL_ENV.1);
- meta.cargo_path(cargo.get_program());
- meta.manifest_path(manifest);
- // `--no-deps` doesn't (over)write lockfiles as it doesn't do any package resolve.
- // So we can use it to get `target_directory` before copying lockfiles
- meta.no_deps();
- let mut other_options = vec![];
- if manifest.is_rust_manifest() {
- meta.env("RUSTC_BOOTSTRAP", "1");
- other_options.push("-Zscript".to_owned());
- }
- meta.other_options(other_options);
- meta.exec().map(|m| m.target_directory).ok()
-}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml
index c746f84..b9dfe1f 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml
@@ -42,6 +42,7 @@
num_cpus = "1.17.0"
mimalloc = { version = "0.1.46", default-features = false, optional = true }
lsp-server.workspace = true
+smallvec.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-tree.workspace = true
@@ -53,6 +54,7 @@
memchr = "2.7.5"
cargo_metadata.workspace = true
process-wrap.workspace = true
+dhat = { version = "0.3.3", optional = true }
cfg.workspace = true
hir-def.workspace = true
@@ -105,6 +107,7 @@
"hir-ty/in-rust-tree",
"load-cargo/in-rust-tree",
]
+dhat = ["dep:dhat"]
[lints]
workspace = true
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
index de24bc0..5e4a277 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -1214,6 +1214,7 @@ fn run_ide_things(
annotate_method_references: false,
annotate_enum_variant_references: false,
location: ide::AnnotationLocation::AboveName,
+ filter_adjacent_derive_implementations: false,
minicore: MiniCore::default(),
};
for &file_id in file_ids {
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/rustc_tests.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/rustc_tests.rs
index 2056714..eb28a47 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/rustc_tests.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/rustc_tests.rs
@@ -9,7 +9,6 @@
use ide::{AnalysisHost, DiagnosticCode, DiagnosticsConfig};
use ide_db::base_db;
use itertools::Either;
-use paths::Utf8PathBuf;
use profile::StopWatch;
use project_model::toolchain_info::{QueryConfig, target_data};
use project_model::{
@@ -75,12 +74,8 @@ fn new() -> Result<Self> {
};
let mut sysroot = Sysroot::discover(tmp_file.parent().unwrap(), &cargo_config.extra_env);
- let loaded_sysroot = sysroot.load_workspace(
- &RustSourceWorkspaceConfig::default_cargo(),
- false,
- &Utf8PathBuf::default(),
- &|_| (),
- );
+ let loaded_sysroot =
+ sysroot.load_workspace(&RustSourceWorkspaceConfig::default_cargo(), false, &|_| ());
if let Some(loaded_sysroot) = loaded_sysroot {
sysroot.set_workspace(loaded_sysroot);
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
index 652c2e3..b8c4b9f 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
@@ -10,9 +10,9 @@
use ide::{
AnnotationConfig, AssistConfig, CallHierarchyConfig, CallableSnippets, CompletionConfig,
CompletionFieldsToResolve, DiagnosticsConfig, GenericParameterHints, GotoDefinitionConfig,
- HighlightConfig, HighlightRelatedConfig, HoverConfig, HoverDocFormat, InlayFieldsToResolve,
- InlayHintsConfig, JoinLinesConfig, MemoryLayoutHoverConfig, MemoryLayoutHoverRenderKind,
- Snippet, SnippetScope, SourceRootId,
+ GotoImplementationConfig, HighlightConfig, HighlightRelatedConfig, HoverConfig, HoverDocFormat,
+ InlayFieldsToResolve, InlayHintsConfig, JoinLinesConfig, MemoryLayoutHoverConfig,
+ MemoryLayoutHoverRenderKind, RenameConfig, Snippet, SnippetScope, SourceRootId,
};
use ide_db::{
MiniCore, SnippetCap,
@@ -23,7 +23,7 @@
use paths::{Utf8Path, Utf8PathBuf};
use project_model::{
CargoConfig, CargoFeatures, ProjectJson, ProjectJsonData, ProjectJsonFromCommand,
- ProjectManifest, RustLibSource,
+ ProjectManifest, RustLibSource, TargetDirectoryConfig,
};
use rustc_hash::{FxHashMap, FxHashSet};
use semver::Version;
@@ -98,6 +98,9 @@ pub enum MaxSubstitutionLength {
/// Code's `files.watcherExclude`.
files_exclude | files_excludeDirs: Vec<Utf8PathBuf> = vec![],
+ /// If this is `true`, when "Goto Implementations" and in "Implementations" lens, are triggered on a `struct` or `enum` or `union`, we filter out trait implementations that originate from `derive`s above the type.
+ gotoImplementations_filterAdjacentDerives: bool = false,
+
/// Highlight related return values while the cursor is on any `match`, `if`, or match arm
/// arrow (`=>`).
highlightRelated_branchExitPoints_enable: bool = true,
@@ -378,6 +381,12 @@ pub enum MaxSubstitutionLength {
/// Internal config, path to proc-macro server executable.
procMacro_server: Option<Utf8PathBuf> = None,
+ /// The path where to save memory profiling output.
+ ///
+ /// **Note:** Memory profiling is not enabled by default in rust-analyzer builds, you need to build
+ /// from source for it.
+ profiling_memoryProfile: Option<Utf8PathBuf> = None,
+
/// Exclude imports from find-all-references.
references_excludeImports: bool = false,
@@ -1413,6 +1422,7 @@ pub struct LensConfig {
// annotations
pub location: AnnotationLocation,
+ pub filter_adjacent_derive_implementations: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
@@ -1469,6 +1479,7 @@ pub fn into_annotation_config<'a>(
annotate_enum_variant_references: self.enum_variant_refs,
location: self.location.into(),
minicore,
+ filter_adjacent_derive_implementations: self.filter_adjacent_derive_implementations,
}
}
}
@@ -1705,6 +1716,14 @@ pub fn assist(&self, source_root: Option<SourceRootId>) -> AssistConfig {
}
}
+ pub fn rename(&self, source_root: Option<SourceRootId>) -> RenameConfig {
+ RenameConfig {
+ prefer_no_std: self.imports_preferNoStd(source_root).to_owned(),
+ prefer_prelude: self.imports_preferPrelude(source_root).to_owned(),
+ prefer_absolute: self.imports_prefixExternPrelude(source_root).to_owned(),
+ }
+ }
+
pub fn call_hierarchy<'a>(&self, minicore: MiniCore<'a>) -> CallHierarchyConfig<'a> {
CallHierarchyConfig { exclude_tests: self.references_excludeTests().to_owned(), minicore }
}
@@ -2157,6 +2176,11 @@ pub fn proc_macro_srv(&self) -> Option<AbsPathBuf> {
Some(AbsPathBuf::try_from(path).unwrap_or_else(|path| self.root_path.join(path)))
}
+ pub fn dhat_output_file(&self) -> Option<AbsPathBuf> {
+ let path = self.profiling_memoryProfile().clone()?;
+ Some(AbsPathBuf::try_from(path).unwrap_or_else(|path| self.root_path.join(path)))
+ }
+
pub fn ignored_proc_macros(
&self,
source_root: Option<SourceRootId>,
@@ -2277,7 +2301,7 @@ pub fn cargo(&self, source_root: Option<SourceRootId>) -> CargoConfig {
run_build_script_command: self.cargo_buildScripts_overrideCommand(source_root).clone(),
extra_args: self.cargo_extraArgs(source_root).clone(),
extra_env: self.cargo_extraEnv(source_root).clone(),
- target_dir: self.target_dir_from_config(source_root),
+ target_dir_config: self.target_dir_from_config(source_root),
set_test: *self.cfg_setTest(source_root),
no_deps: *self.cargo_noDeps(source_root),
}
@@ -2365,7 +2389,7 @@ pub(crate) fn cargo_test_options(&self, source_root: Option<SourceRootId>) -> Ca
extra_args: self.extra_args(source_root).clone(),
extra_test_bin_args: self.runnables_extraTestBinaryArgs(source_root).clone(),
extra_env: self.extra_env(source_root).clone(),
- target_dir: self.target_dir_from_config(source_root),
+ target_dir_config: self.target_dir_from_config(source_root),
set_test: true,
}
}
@@ -2423,7 +2447,7 @@ pub(crate) fn flycheck(&self, source_root: Option<SourceRootId>) -> FlycheckConf
extra_args: self.check_extra_args(source_root),
extra_test_bin_args: self.runnables_extraTestBinaryArgs(source_root).clone(),
extra_env: self.check_extra_env(source_root),
- target_dir: self.target_dir_from_config(source_root),
+ target_dir_config: self.target_dir_from_config(source_root),
set_test: *self.cfg_setTest(source_root),
},
ansi_color_output: self.color_diagnostic_output(),
@@ -2431,17 +2455,12 @@ pub(crate) fn flycheck(&self, source_root: Option<SourceRootId>) -> FlycheckConf
}
}
- fn target_dir_from_config(&self, source_root: Option<SourceRootId>) -> Option<Utf8PathBuf> {
- self.cargo_targetDir(source_root).as_ref().and_then(|target_dir| match target_dir {
- TargetDirectory::UseSubdirectory(true) => {
- let env_var = env::var("CARGO_TARGET_DIR").ok();
- let mut path = Utf8PathBuf::from(env_var.as_deref().unwrap_or("target"));
- path.push("rust-analyzer");
- Some(path)
- }
- TargetDirectory::UseSubdirectory(false) => None,
- TargetDirectory::Directory(dir) => Some(dir.clone()),
- })
+ fn target_dir_from_config(&self, source_root: Option<SourceRootId>) -> TargetDirectoryConfig {
+ match &self.cargo_targetDir(source_root) {
+ Some(TargetDirectory::UseSubdirectory(true)) => TargetDirectoryConfig::UseSubdirectory,
+ Some(TargetDirectory::UseSubdirectory(false)) | None => TargetDirectoryConfig::None,
+ Some(TargetDirectory::Directory(dir)) => TargetDirectoryConfig::Directory(dir.clone()),
+ }
}
pub fn check_on_save(&self, source_root: Option<SourceRootId>) -> bool {
@@ -2495,6 +2514,15 @@ pub fn lens(&self) -> LensConfig {
refs_trait: *self.lens_enable() && *self.lens_references_trait_enable(),
enum_variant_refs: *self.lens_enable() && *self.lens_references_enumVariant_enable(),
location: *self.lens_location(),
+ filter_adjacent_derive_implementations: *self
+ .gotoImplementations_filterAdjacentDerives(),
+ }
+ }
+
+ pub fn goto_implementation(&self) -> GotoImplementationConfig {
+ GotoImplementationConfig {
+ filter_adjacent_derive_implementations: *self
+ .gotoImplementations_filterAdjacentDerives(),
}
}
@@ -3958,7 +3986,7 @@ fn doc_comment_to_string(doc: &[&str]) -> String {
#[cfg(test)]
mod tests {
- use std::fs;
+ use std::{borrow::Cow, fs};
use test_utils::{ensure_file_contents, project_root};
@@ -4093,9 +4121,13 @@ fn cargo_target_dir_unset() {
(config, _, _) = config.apply_change(change);
assert_eq!(config.cargo_targetDir(None), &None);
- assert!(
- matches!(config.flycheck(None), FlycheckConfig::CargoCommand { options, .. } if options.target_dir.is_none())
- );
+ assert!(matches!(
+ config.flycheck(None),
+ FlycheckConfig::CargoCommand {
+ options: CargoOptions { target_dir_config: TargetDirectoryConfig::None, .. },
+ ..
+ }
+ ));
}
#[test]
@@ -4111,11 +4143,16 @@ fn cargo_target_dir_subdir() {
(config, _, _) = config.apply_change(change);
assert_eq!(config.cargo_targetDir(None), &Some(TargetDirectory::UseSubdirectory(true)));
- let target =
+ let ws_target_dir =
Utf8PathBuf::from(std::env::var("CARGO_TARGET_DIR").unwrap_or("target".to_owned()));
- assert!(
- matches!(config.flycheck(None), FlycheckConfig::CargoCommand { options, .. } if options.target_dir == Some(target.join("rust-analyzer")))
- );
+ assert!(matches!(
+ config.flycheck(None),
+ FlycheckConfig::CargoCommand {
+ options: CargoOptions { target_dir_config, .. },
+ ..
+ } if target_dir_config.target_dir(Some(&ws_target_dir)).map(Cow::into_owned)
+ == Some(ws_target_dir.join("rust-analyzer"))
+ ));
}
#[test]
@@ -4134,8 +4171,13 @@ fn cargo_target_dir_relative_dir() {
config.cargo_targetDir(None),
&Some(TargetDirectory::Directory(Utf8PathBuf::from("other_folder")))
);
- assert!(
- matches!(config.flycheck(None), FlycheckConfig::CargoCommand { options, .. } if options.target_dir == Some(Utf8PathBuf::from("other_folder")))
- );
+ assert!(matches!(
+ config.flycheck(None),
+ FlycheckConfig::CargoCommand {
+ options: CargoOptions { target_dir_config, .. },
+ ..
+ } if target_dir_config.target_dir(None).map(Cow::into_owned)
+ == Some(Utf8PathBuf::from("other_folder"))
+ ));
}
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
index 4bfad98..4a24780 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
@@ -1,5 +1,5 @@
//! Book keeping for keeping diagnostics easily in sync with the client.
-pub(crate) mod to_proto;
+pub(crate) mod flycheck_to_proto;
use std::mem;
@@ -8,6 +8,7 @@
use ide_db::{FxHashMap, base_db::DbPanicContext};
use itertools::Itertools;
use rustc_hash::FxHashSet;
+use smallvec::SmallVec;
use stdx::iter_eq_by;
use triomphe::Arc;
@@ -57,7 +58,7 @@ pub(crate) struct DiagnosticCollection {
#[derive(Debug, Clone)]
pub(crate) struct Fix {
// Fixes may be triggerable from multiple ranges.
- pub(crate) ranges: Vec<lsp_types::Range>,
+ pub(crate) ranges: SmallVec<[lsp_types::Range; 1]>,
pub(crate) action: lsp_ext::CodeAction,
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/to_proto.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/flycheck_to_proto.rs
similarity index 88%
rename from src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/to_proto.rs
rename to src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/flycheck_to_proto.rs
index 3f64628..a6d7bcb 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/to_proto.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/flycheck_to_proto.rs
@@ -4,6 +4,7 @@
use crate::flycheck::{Applicability, DiagnosticLevel, DiagnosticSpan};
use itertools::Itertools;
use rustc_hash::FxHashMap;
+use smallvec::SmallVec;
use stdx::format_to;
use vfs::{AbsPath, AbsPathBuf};
@@ -18,12 +19,12 @@
fn diagnostic_severity(
config: &DiagnosticsMapConfig,
level: crate::flycheck::DiagnosticLevel,
- code: Option<crate::flycheck::DiagnosticCode>,
+ code: Option<&crate::flycheck::DiagnosticCode>,
) -> Option<lsp_types::DiagnosticSeverity> {
let res = match level {
DiagnosticLevel::Ice => lsp_types::DiagnosticSeverity::ERROR,
DiagnosticLevel::Error => lsp_types::DiagnosticSeverity::ERROR,
- DiagnosticLevel::Warning => match &code {
+ DiagnosticLevel::Warning => match code {
// HACK: special case for `warnings` rustc lint.
Some(code)
if config.warnings_as_hint.iter().any(|lint| {
@@ -143,11 +144,11 @@ fn primary_location(
fn diagnostic_related_information(
config: &DiagnosticsMapConfig,
workspace_root: &AbsPath,
- span: &DiagnosticSpan,
+ span: DiagnosticSpan,
snap: &GlobalStateSnapshot,
) -> Option<lsp_types::DiagnosticRelatedInformation> {
- let message = span.label.clone()?;
- let location = location(config, workspace_root, span, snap);
+ let location = location(config, workspace_root, &span, snap);
+ let message = span.label?;
Some(lsp_types::DiagnosticRelatedInformation { location, message })
}
@@ -184,7 +185,7 @@ fn map_rust_child_diagnostic(
rd: &crate::flycheck::Diagnostic,
snap: &GlobalStateSnapshot,
) -> MappedRustChildDiagnostic {
- let spans: Vec<&DiagnosticSpan> = rd.spans.iter().filter(|s| s.is_primary).collect();
+ let spans: SmallVec<[&DiagnosticSpan; 1]> = rd.spans.iter().filter(|s| s.is_primary).collect();
if spans.is_empty() {
// `rustc` uses these spanless children as a way to print multi-line
// messages
@@ -227,42 +228,37 @@ fn map_rust_child_diagnostic(
message.push_str(&suggestions);
}
- if edit_map.is_empty() {
- MappedRustChildDiagnostic::SubDiagnostic(SubDiagnostic {
- related: lsp_types::DiagnosticRelatedInformation {
- location: location(config, workspace_root, spans[0], snap),
- message,
- },
- suggested_fix: None,
- })
+ let suggested_fix = if edit_map.is_empty() {
+ None
} else {
- MappedRustChildDiagnostic::SubDiagnostic(SubDiagnostic {
- related: lsp_types::DiagnosticRelatedInformation {
- location: location(config, workspace_root, spans[0], snap),
- message: message.clone(),
+ Some(Box::new(Fix {
+ ranges: spans
+ .iter()
+ .map(|&span| location(config, workspace_root, span, snap).range)
+ .collect(),
+ action: lsp_ext::CodeAction {
+ title: message.clone(),
+ group: None,
+ kind: Some(lsp_types::CodeActionKind::QUICKFIX),
+ edit: Some(lsp_ext::SnippetWorkspaceEdit {
+ // FIXME: there's no good reason to use edit_map here....
+ changes: Some(edit_map),
+ document_changes: None,
+ change_annotations: None,
+ }),
+ is_preferred: Some(is_preferred),
+ data: None,
+ command: None,
},
- suggested_fix: Some(Box::new(Fix {
- ranges: spans
- .iter()
- .map(|&span| location(config, workspace_root, span, snap).range)
- .collect(),
- action: lsp_ext::CodeAction {
- title: message,
- group: None,
- kind: Some(lsp_types::CodeActionKind::QUICKFIX),
- edit: Some(lsp_ext::SnippetWorkspaceEdit {
- // FIXME: there's no good reason to use edit_map here....
- changes: Some(edit_map),
- document_changes: None,
- change_annotations: None,
- }),
- is_preferred: Some(is_preferred),
- data: None,
- command: None,
- },
- })),
- })
- }
+ }))
+ };
+ MappedRustChildDiagnostic::SubDiagnostic(SubDiagnostic {
+ related: lsp_types::DiagnosticRelatedInformation {
+ location: location(config, workspace_root, spans[0], snap),
+ message,
+ },
+ suggested_fix,
+ })
}
#[derive(Debug)]
@@ -284,48 +280,56 @@ pub(crate) struct MappedRustDiagnostic {
/// If the diagnostic has no primary span this will return `None`
pub(crate) fn map_rust_diagnostic_to_lsp(
config: &DiagnosticsMapConfig,
- rd: &crate::flycheck::Diagnostic,
+ crate::flycheck::Diagnostic {
+ mut message,
+ code: diagnostic_code,
+ level,
+ spans,
+ children,
+ rendered,
+ ..
+ }: crate::flycheck::Diagnostic,
workspace_root: &AbsPath,
snap: &GlobalStateSnapshot,
) -> Vec<MappedRustDiagnostic> {
- let primary_spans: Vec<&DiagnosticSpan> = rd.spans.iter().filter(|s| s.is_primary).collect();
+ let (primary_spans, secondary_spans): (
+ SmallVec<[DiagnosticSpan; 1]>,
+ SmallVec<[DiagnosticSpan; 1]>,
+ ) = spans.into_iter().partition(|s| s.is_primary);
if primary_spans.is_empty() {
return Vec::new();
}
- let severity = diagnostic_severity(config, rd.level, rd.code.clone());
+ let mut code = diagnostic_code.as_ref().map(|c| &*c.code);
- let mut source = String::from("rustc");
- let mut code = rd.code.as_ref().map(|c| c.code.clone());
-
- if let Some(code_val) = &code
+ if let Some(code_val) = code
&& config.check_ignore.contains(code_val)
{
return Vec::new();
}
- if let Some(code_val) = &code {
+ let severity = diagnostic_severity(config, level, diagnostic_code.as_ref());
+
+ let mut source = "rustc";
+ if let Some(code_val) = code {
// See if this is an RFC #2103 scoped lint (e.g. from Clippy)
- let scoped_code: Vec<&str> = code_val.split("::").collect();
- if scoped_code.len() == 2 {
- source = String::from(scoped_code[0]);
- code = Some(String::from(scoped_code[1]));
+ if let Some((s, c)) = code_val.split("::").collect_tuple() {
+ source = s;
+ code = Some(c);
}
}
let mut needs_primary_span_label = true;
let mut subdiagnostics = Vec::new();
- let mut tags = Vec::new();
- for secondary_span in rd.spans.iter().filter(|s| !s.is_primary) {
+ for secondary_span in secondary_spans {
let related = diagnostic_related_information(config, workspace_root, secondary_span, snap);
if let Some(related) = related {
subdiagnostics.push(SubDiagnostic { related, suggested_fix: None });
}
}
- let mut message = rd.message.clone();
- for child in &rd.children {
+ for child in &children {
let child = map_rust_child_diagnostic(config, workspace_root, child, snap);
match child {
MappedRustChildDiagnostic::SubDiagnostic(sub) => {
@@ -340,155 +344,146 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
}
}
}
+ let message = message;
- if let Some(code) = &rd.code {
- let code = code.code.as_str();
- if matches!(
- code,
- "dead_code"
- | "unknown_lints"
- | "unreachable_code"
- | "unused_attributes"
- | "unused_imports"
- | "unused_macros"
- | "unused_variables"
- ) {
- tags.push(lsp_types::DiagnosticTag::UNNECESSARY);
- }
-
- if matches!(code, "deprecated") {
- tags.push(lsp_types::DiagnosticTag::DEPRECATED);
+ let mut tag = None;
+ if let Some(code) = &diagnostic_code {
+ match &*code.code {
+ "dead_code" | "unknown_lints" | "unreachable_code" | "unused_attributes"
+ | "unused_imports" | "unused_macros" | "unused_variables" => {
+ tag = Some(lsp_types::DiagnosticTag::UNNECESSARY);
+ }
+ "deprecated" => {
+ tag = Some(lsp_types::DiagnosticTag::DEPRECATED);
+ }
+ _ => {}
}
}
- let code_description = match source.as_str() {
- "rustc" => rustc_code_description(code.as_deref()),
- "clippy" => clippy_code_description(code.as_deref()),
+ let code_description = match source {
+ "rustc" => rustc_code_description(code),
+ "clippy" => clippy_code_description(code),
_ => None,
};
+ // Each primary diagnostic span may result in multiple LSP diagnostics.
+ let mut diagnostics = Vec::new();
- primary_spans
- .iter()
- .flat_map(|primary_span| {
- let primary_location = primary_location(config, workspace_root, primary_span, snap);
- let message = {
- let mut message = message.clone();
- if needs_primary_span_label && let Some(primary_span_label) = &primary_span.label {
- format_to!(message, "\n{}", primary_span_label);
- }
- message
- };
- // Each primary diagnostic span may result in multiple LSP diagnostics.
- let mut diagnostics = Vec::new();
+ for primary_span in primary_spans {
+ let primary_location = primary_location(config, workspace_root, &primary_span, snap);
+ let message = {
+ let mut message = message.clone();
+ if needs_primary_span_label && let Some(primary_span_label) = &primary_span.label {
+ format_to!(message, "\n{}", primary_span_label);
+ }
+ message
+ };
- let mut related_info_macro_calls = vec![];
+ let mut related_info_macro_calls = vec![];
- // If error occurs from macro expansion, add related info pointing to
- // where the error originated
- // Also, we would generate an additional diagnostic, so that exact place of macro
- // will be highlighted in the error origin place.
- let span_stack = std::iter::successors(Some(*primary_span), |span| {
- Some(&span.expansion.as_ref()?.span)
- });
- for (i, span) in span_stack.enumerate() {
- if is_dummy_macro_file(&span.file_name) {
- continue;
- }
-
- // First span is the original diagnostic, others are macro call locations that
- // generated that code.
- let is_in_macro_call = i != 0;
-
- let secondary_location = location(config, workspace_root, span, snap);
- if secondary_location == primary_location {
- continue;
- }
- related_info_macro_calls.push(lsp_types::DiagnosticRelatedInformation {
- location: secondary_location.clone(),
- message: if is_in_macro_call {
- "Error originated from macro call here".to_owned()
- } else {
- "Actual error occurred here".to_owned()
- },
- });
- // For the additional in-macro diagnostic we add the inverse message pointing to the error location in code.
- let information_for_additional_diagnostic =
- vec![lsp_types::DiagnosticRelatedInformation {
- location: primary_location.clone(),
- message: "Exact error occurred here".to_owned(),
- }];
-
- let diagnostic = lsp_types::Diagnostic {
- range: secondary_location.range,
- // downgrade to hint if we're pointing at the macro
- severity: Some(lsp_types::DiagnosticSeverity::HINT),
- code: code.clone().map(lsp_types::NumberOrString::String),
- code_description: code_description.clone(),
- source: Some(source.clone()),
- message: message.clone(),
- related_information: Some(information_for_additional_diagnostic),
- tags: if tags.is_empty() { None } else { Some(tags.clone()) },
- data: Some(serde_json::json!({ "rendered": rd.rendered })),
- };
- diagnostics.push(MappedRustDiagnostic {
- url: secondary_location.uri,
- diagnostic,
- fix: None,
- });
+ // If error occurs from macro expansion, add related info pointing to
+ // where the error originated
+ // Also, we would generate an additional diagnostic, so that exact place of macro
+ // will be highlighted in the error origin place.
+ let span_stack =
+ std::iter::successors(Some(&primary_span), |span| Some(&span.expansion.as_ref()?.span))
+ .skip(1);
+ for (i, span) in span_stack.enumerate() {
+ if is_dummy_macro_file(&span.file_name) {
+ continue;
+ }
+ let secondary_location = location(config, workspace_root, span, snap);
+ if secondary_location == primary_location {
+ continue;
}
- // Emit the primary diagnostic.
- diagnostics.push(MappedRustDiagnostic {
- url: primary_location.uri.clone(),
- diagnostic: lsp_types::Diagnostic {
- range: primary_location.range,
- severity,
- code: code.clone().map(lsp_types::NumberOrString::String),
- code_description: code_description.clone(),
- source: Some(source.clone()),
- message,
- related_information: {
- let info = related_info_macro_calls
- .iter()
- .cloned()
- .chain(subdiagnostics.iter().map(|sub| sub.related.clone()))
- .collect::<Vec<_>>();
- if info.is_empty() { None } else { Some(info) }
- },
- tags: if tags.is_empty() { None } else { Some(tags.clone()) },
- data: Some(serde_json::json!({ "rendered": rd.rendered })),
+ // First span is the original diagnostic, others are macro call locations that
+ // generated that code.
+ let is_in_macro_call = i != 0;
+
+ related_info_macro_calls.push(lsp_types::DiagnosticRelatedInformation {
+ location: secondary_location.clone(),
+ message: if is_in_macro_call {
+ "Error originated from macro call here".to_owned()
+ } else {
+ "Actual error occurred here".to_owned()
},
+ });
+ // For the additional in-macro diagnostic we add the inverse message pointing to the error location in code.
+ let information_for_additional_diagnostic =
+ vec![lsp_types::DiagnosticRelatedInformation {
+ location: primary_location.clone(),
+ message: "Exact error occurred here".to_owned(),
+ }];
+
+ let diagnostic = lsp_types::Diagnostic {
+ range: secondary_location.range,
+ // downgrade to hint if we're pointing at the macro
+ severity: Some(lsp_types::DiagnosticSeverity::HINT),
+ code: code.map(ToOwned::to_owned).map(lsp_types::NumberOrString::String),
+ code_description: code_description.clone(),
+ source: Some(source.to_owned()),
+ message: message.clone(),
+ related_information: Some(information_for_additional_diagnostic),
+ tags: tag.clone().map(|tag| vec![tag]),
+ data: Some(serde_json::json!({ "rendered": rendered })),
+ };
+ diagnostics.push(MappedRustDiagnostic {
+ url: secondary_location.uri,
+ diagnostic,
fix: None,
});
+ }
- // Emit hint-level diagnostics for all `related_information` entries such as "help"s.
- // This is useful because they will show up in the user's editor, unlike
- // `related_information`, which just produces hard-to-read links, at least in VS Code.
- let back_ref = lsp_types::DiagnosticRelatedInformation {
- location: primary_location,
- message: "original diagnostic".to_owned(),
- };
- for sub in &subdiagnostics {
- diagnostics.push(MappedRustDiagnostic {
- url: sub.related.location.uri.clone(),
- fix: sub.suggested_fix.clone(),
- diagnostic: lsp_types::Diagnostic {
- range: sub.related.location.range,
- severity: Some(lsp_types::DiagnosticSeverity::HINT),
- code: code.clone().map(lsp_types::NumberOrString::String),
- code_description: code_description.clone(),
- source: Some(source.clone()),
- message: sub.related.message.clone(),
- related_information: Some(vec![back_ref.clone()]),
- tags: None, // don't apply modifiers again
- data: None,
- },
- });
- }
+ // Emit the primary diagnostic.
+ diagnostics.push(MappedRustDiagnostic {
+ url: primary_location.uri.clone(),
+ diagnostic: lsp_types::Diagnostic {
+ range: primary_location.range,
+ severity,
+ code: code.map(ToOwned::to_owned).map(lsp_types::NumberOrString::String),
+ code_description: code_description.clone(),
+ source: Some(source.to_owned()),
+ message,
+ related_information: {
+ let info = related_info_macro_calls
+ .iter()
+ .cloned()
+ .chain(subdiagnostics.iter().map(|sub| sub.related.clone()))
+ .collect::<Vec<_>>();
+ if info.is_empty() { None } else { Some(info) }
+ },
+ tags: tag.clone().map(|tag| vec![tag]),
+ data: Some(serde_json::json!({ "rendered": rendered })),
+ },
+ fix: None,
+ });
- diagnostics
- })
- .collect()
+ // Emit hint-level diagnostics for all `related_information` entries such as "help"s.
+ // This is useful because they will show up in the user's editor, unlike
+ // `related_information`, which just produces hard-to-read links, at least in VS Code.
+ let back_ref = lsp_types::DiagnosticRelatedInformation {
+ location: primary_location,
+ message: "original diagnostic".to_owned(),
+ };
+ for sub in &subdiagnostics {
+ diagnostics.push(MappedRustDiagnostic {
+ url: sub.related.location.uri.clone(),
+ fix: sub.suggested_fix.clone(),
+ diagnostic: lsp_types::Diagnostic {
+ range: sub.related.location.range,
+ severity: Some(lsp_types::DiagnosticSeverity::HINT),
+ code: code.map(ToOwned::to_owned).map(lsp_types::NumberOrString::String),
+ code_description: code_description.clone(),
+ source: Some(source.to_owned()),
+ message: sub.related.message.clone(),
+ related_information: Some(vec![back_ref.clone()]),
+ tags: None, // don't apply modifiers again
+ data: None,
+ },
+ });
+ }
+ }
+ diagnostics
}
fn rustc_code_description(code: Option<&str>) -> Option<lsp_types::CodeDescription> {
@@ -545,7 +540,7 @@ fn check_with_config(config: DiagnosticsMapConfig, diagnostics_json: &str, expec
),
);
let snap = state.snapshot();
- let mut actual = map_rust_diagnostic_to_lsp(&config, &diagnostic, workspace_root, &snap);
+ let mut actual = map_rust_diagnostic_to_lsp(&config, diagnostic, workspace_root, &snap);
actual.iter_mut().for_each(|diag| diag.diagnostic.data = None);
expect.assert_debug_eq(&actual)
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
index fe5cf9b..b44569b 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
@@ -191,7 +191,7 @@
},
},
},
- message: "Error originated from macro call here",
+ message: "Actual error occurred here",
},
DiagnosticRelatedInformation {
location: Location {
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
index 73a51bb..68337dd 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
@@ -13,6 +13,7 @@
use ide_db::FxHashSet;
use itertools::Itertools;
use paths::{AbsPath, AbsPathBuf, Utf8Path, Utf8PathBuf};
+use project_model::TargetDirectoryConfig;
use rustc_hash::FxHashMap;
use serde::Deserialize as _;
use serde_derive::Deserialize;
@@ -46,7 +47,7 @@ pub(crate) struct CargoOptions {
pub(crate) extra_args: Vec<String>,
pub(crate) extra_test_bin_args: Vec<String>,
pub(crate) extra_env: FxHashMap<String, Option<String>>,
- pub(crate) target_dir: Option<Utf8PathBuf>,
+ pub(crate) target_dir_config: TargetDirectoryConfig,
}
#[derive(Clone, Debug)]
@@ -58,7 +59,7 @@ pub(crate) enum Target {
}
impl CargoOptions {
- pub(crate) fn apply_on_command(&self, cmd: &mut Command) {
+ pub(crate) fn apply_on_command(&self, cmd: &mut Command, ws_target_dir: Option<&Utf8Path>) {
for target in &self.target_tuples {
cmd.args(["--target", target.as_str()]);
}
@@ -82,8 +83,8 @@ pub(crate) fn apply_on_command(&self, cmd: &mut Command) {
cmd.arg(self.features.join(" "));
}
}
- if let Some(target_dir) = &self.target_dir {
- cmd.arg("--target-dir").arg(target_dir);
+ if let Some(target_dir) = self.target_dir_config.target_dir(ws_target_dir) {
+ cmd.arg("--target-dir").arg(target_dir.as_ref());
}
}
}
@@ -158,6 +159,7 @@ pub(crate) fn spawn(
sysroot_root: Option<AbsPathBuf>,
workspace_root: AbsPathBuf,
manifest_path: Option<AbsPathBuf>,
+ ws_target_dir: Option<Utf8PathBuf>,
) -> FlycheckHandle {
let actor = FlycheckActor::new(
id,
@@ -167,6 +169,7 @@ pub(crate) fn spawn(
sysroot_root,
workspace_root,
manifest_path,
+ ws_target_dir,
);
let (sender, receiver) = unbounded::<StateChange>();
let thread =
@@ -314,6 +317,7 @@ struct FlycheckActor {
sender: Sender<FlycheckMessage>,
config: FlycheckConfig,
manifest_path: Option<AbsPathBuf>,
+ ws_target_dir: Option<Utf8PathBuf>,
/// Either the workspace root of the workspace we are flychecking,
/// or the project root of the project.
root: Arc<AbsPathBuf>,
@@ -355,6 +359,7 @@ fn new(
sysroot_root: Option<AbsPathBuf>,
workspace_root: AbsPathBuf,
manifest_path: Option<AbsPathBuf>,
+ ws_target_dir: Option<Utf8PathBuf>,
) -> FlycheckActor {
tracing::info!(%id, ?workspace_root, "Spawning flycheck");
FlycheckActor {
@@ -366,6 +371,7 @@ fn new(
root: Arc::new(workspace_root),
scope: FlycheckScope::Workspace,
manifest_path,
+ ws_target_dir,
command_handle: None,
command_receiver: None,
diagnostics_cleared_for: Default::default(),
@@ -428,15 +434,32 @@ fn run(mut self, inbox: Receiver<StateChange>) {
CargoCheckParser,
sender,
match &self.config {
- FlycheckConfig::CargoCommand { options, .. } => Some(
- options
- .target_dir
- .as_deref()
- .unwrap_or(
- Utf8Path::new("target").join("rust-analyzer").as_path(),
- )
- .join(format!("flycheck{}", self.id)),
- ),
+ FlycheckConfig::CargoCommand { options, .. } => {
+ let ws_target_dir =
+ self.ws_target_dir.as_ref().map(Utf8PathBuf::as_path);
+ let target_dir =
+ options.target_dir_config.target_dir(ws_target_dir);
+
+ // If `"rust-analyzer.cargo.targetDir": null`, we should use
+ // workspace's target dir instead of hard-coded fallback.
+ let target_dir = target_dir.as_deref().or(ws_target_dir);
+
+ Some(
+ // As `CommandHandle::spawn`'s working directory is
+ // rust-analyzer's working directory, which might be different
+ // from the flycheck's working directory, we should canonicalize
+ // the output directory, otherwise we might write it into the
+ // wrong target dir.
+ // If `target_dir` is an absolute path, it will replace
+ // `self.root` and that's an intended behavior.
+ self.root
+ .join(target_dir.unwrap_or(
+ Utf8Path::new("target").join("rust-analyzer").as_path(),
+ ))
+ .join(format!("flycheck{}", self.id))
+ .into(),
+ )
+ }
_ => None,
},
) {
@@ -672,7 +695,10 @@ fn check_command(
cmd.arg("--keep-going");
- options.apply_on_command(&mut cmd);
+ options.apply_on_command(
+ &mut cmd,
+ self.ws_target_dir.as_ref().map(Utf8PathBuf::as_path),
+ );
cmd.args(&options.extra_args);
Some(cmd)
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs
index 55d092f..7e52673 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs
@@ -33,7 +33,9 @@
use vfs::{AbsPath, AbsPathBuf, FileId, VfsPath};
use crate::{
- config::{Config, RustfmtConfig, WorkspaceSymbolConfig},
+ config::{
+ ClientCommandsConfig, Config, HoverActionsConfig, RustfmtConfig, WorkspaceSymbolConfig,
+ },
diagnostics::convert_diagnostic,
global_state::{FetchWorkspaceRequest, GlobalState, GlobalStateSnapshot},
line_index::LineEndings,
@@ -124,17 +126,35 @@ pub(crate) fn handle_analyzer_status(
Ok(buf)
}
-pub(crate) fn handle_memory_usage(state: &mut GlobalState, _: ()) -> anyhow::Result<String> {
+pub(crate) fn handle_memory_usage(_state: &mut GlobalState, _: ()) -> anyhow::Result<String> {
let _p = tracing::info_span!("handle_memory_usage").entered();
- let mem = state.analysis_host.per_query_memory_usage();
- let mut out = String::new();
- for (name, bytes, entries) in mem {
- format_to!(out, "{:>8} {:>6} {}\n", bytes, entries, name);
+ #[cfg(not(feature = "dhat"))]
+ {
+ Err(anyhow::anyhow!(
+ "Memory profiling is not enabled for this build of rust-analyzer.\n\n\
+ To build rust-analyzer with profiling support, pass `--features dhat --profile dev-rel` to `cargo build`
+ when building from source, or pass `--enable-profiling` to `cargo xtask`."
+ ))
}
- format_to!(out, "{:>8} Remaining\n", profile::memory_usage().allocated);
-
- Ok(out)
+ #[cfg(feature = "dhat")]
+ {
+ if let Some(dhat_output_file) = _state.config.dhat_output_file() {
+ let mut profiler = crate::DHAT_PROFILER.lock().unwrap();
+ let old_profiler = profiler.take();
+ // Need to drop the old profiler before creating a new one.
+ drop(old_profiler);
+ *profiler = Some(dhat::Profiler::builder().file_name(&dhat_output_file).build());
+ Ok(format!(
+ "Memory profile was saved successfully to {dhat_output_file}.\n\n\
+ See https://docs.rs/dhat/latest/dhat/#viewing for how to inspect the profile."
+ ))
+ } else {
+ Err(anyhow::anyhow!(
+ "Please set `rust-analyzer.profiling.memoryProfile` to the path where you want to save the profile."
+ ))
+ }
+ }
}
pub(crate) fn handle_view_syntax_tree(
@@ -264,6 +284,7 @@ pub(crate) fn handle_run_test(
path,
state.config.cargo_test_options(None),
cargo.workspace_root(),
+ Some(cargo.target_directory().as_ref()),
target,
state.test_run_sender.clone(),
)?;
@@ -847,10 +868,11 @@ pub(crate) fn handle_goto_implementation(
let _p = tracing::info_span!("handle_goto_implementation").entered();
let position =
try_default!(from_proto::file_position(&snap, params.text_document_position_params)?);
- let nav_info = match snap.analysis.goto_implementation(position)? {
- None => return Ok(None),
- Some(it) => it,
- };
+ let nav_info =
+ match snap.analysis.goto_implementation(&snap.config.goto_implementation(), position)? {
+ None => return Ok(None),
+ Some(it) => it,
+ };
let src = FileRange { file_id: position.file_id, range: nav_info.range };
let res = to_proto::goto_definition_response(&snap, Some(src), nav_info.info)?;
Ok(Some(res))
@@ -1325,8 +1347,12 @@ pub(crate) fn handle_rename(
let _p = tracing::info_span!("handle_rename").entered();
let position = try_default!(from_proto::file_position(&snap, params.text_document_position)?);
- let mut change =
- snap.analysis.rename(position, ¶ms.new_name)?.map_err(to_proto::rename_error)?;
+ let source_root = snap.analysis.source_root_id(position.file_id).ok();
+ let config = snap.config.rename(source_root);
+ let mut change = snap
+ .analysis
+ .rename(position, ¶ms.new_name, &config)?
+ .map_err(to_proto::rename_error)?;
// this is kind of a hack to prevent double edits from happening when moving files
// When a module gets renamed by renaming the mod declaration this causes the file to move
@@ -1459,13 +1485,14 @@ pub(crate) fn handle_code_action(
resolve,
frange,
)?;
+ let client_commands = snap.config.client_commands();
for (index, assist) in assists.into_iter().enumerate() {
let resolve_data = if code_action_resolve_cap {
Some((index, params.clone(), snap.file_version(file_id)))
} else {
None
};
- let code_action = to_proto::code_action(&snap, assist, resolve_data)?;
+ let code_action = to_proto::code_action(&snap, &client_commands, assist, resolve_data)?;
// Check if the client supports the necessary `ResourceOperation`s.
let changes = code_action.edit.as_ref().and_then(|it| it.document_changes.as_ref());
@@ -1566,7 +1593,7 @@ pub(crate) fn handle_code_action_resolve(
))
.into());
}
- let ca = to_proto::code_action(&snap, assist.clone(), None)?;
+ let ca = to_proto::code_action(&snap, &snap.config.client_commands(), assist.clone(), None)?;
code_action.edit = ca.edit;
code_action.command = ca.command;
@@ -2130,10 +2157,15 @@ fn to_command_link(command: lsp_types::Command, tooltip: String) -> lsp_ext::Com
fn show_impl_command_link(
snap: &GlobalStateSnapshot,
position: &FilePosition,
+ implementations: bool,
+ show_references: bool,
) -> Option<lsp_ext::CommandLinkGroup> {
- if snap.config.hover_actions().implementations
- && snap.config.client_commands().show_reference
- && let Some(nav_data) = snap.analysis.goto_implementation(*position).unwrap_or(None)
+ if implementations
+ && show_references
+ && let Some(nav_data) = snap
+ .analysis
+ .goto_implementation(&snap.config.goto_implementation(), *position)
+ .unwrap_or(None)
{
let uri = to_proto::url(snap, position.file_id);
let line_index = snap.file_line_index(position.file_id).ok()?;
@@ -2157,9 +2189,11 @@ fn show_impl_command_link(
fn show_ref_command_link(
snap: &GlobalStateSnapshot,
position: &FilePosition,
+ references: bool,
+ show_reference: bool,
) -> Option<lsp_ext::CommandLinkGroup> {
- if snap.config.hover_actions().references
- && snap.config.client_commands().show_reference
+ if references
+ && show_reference
&& let Some(ref_search_res) = snap
.analysis
.find_all_refs(
@@ -2194,8 +2228,9 @@ fn show_ref_command_link(
fn runnable_action_links(
snap: &GlobalStateSnapshot,
runnable: Runnable,
+ hover_actions_config: &HoverActionsConfig,
+ client_commands_config: &ClientCommandsConfig,
) -> Option<lsp_ext::CommandLinkGroup> {
- let hover_actions_config = snap.config.hover_actions();
if !hover_actions_config.runnable() {
return None;
}
@@ -2205,7 +2240,6 @@ fn runnable_action_links(
return None;
}
- let client_commands_config = snap.config.client_commands();
if !(client_commands_config.run_single || client_commands_config.debug_single) {
return None;
}
@@ -2240,11 +2274,10 @@ fn runnable_action_links(
fn goto_type_action_links(
snap: &GlobalStateSnapshot,
nav_targets: &[HoverGotoTypeData],
+ hover_actions: &HoverActionsConfig,
+ client_commands: &ClientCommandsConfig,
) -> Option<lsp_ext::CommandLinkGroup> {
- if !snap.config.hover_actions().goto_type_def
- || nav_targets.is_empty()
- || !snap.config.client_commands().goto_location
- {
+ if !hover_actions.goto_type_def || nav_targets.is_empty() || !client_commands.goto_location {
return None;
}
@@ -2264,13 +2297,29 @@ fn prepare_hover_actions(
snap: &GlobalStateSnapshot,
actions: &[HoverAction],
) -> Vec<lsp_ext::CommandLinkGroup> {
+ let hover_actions = snap.config.hover_actions();
+ let client_commands = snap.config.client_commands();
actions
.iter()
.filter_map(|it| match it {
- HoverAction::Implementation(position) => show_impl_command_link(snap, position),
- HoverAction::Reference(position) => show_ref_command_link(snap, position),
- HoverAction::Runnable(r) => runnable_action_links(snap, r.clone()),
- HoverAction::GoToType(targets) => goto_type_action_links(snap, targets),
+ HoverAction::Implementation(position) => show_impl_command_link(
+ snap,
+ position,
+ hover_actions.implementations,
+ client_commands.show_reference,
+ ),
+ HoverAction::Reference(position) => show_ref_command_link(
+ snap,
+ position,
+ hover_actions.references,
+ client_commands.show_reference,
+ ),
+ HoverAction::Runnable(r) => {
+ runnable_action_links(snap, r.clone(), &hover_actions, &client_commands)
+ }
+ HoverAction::GoToType(targets) => {
+ goto_type_action_links(snap, targets, &hover_actions, &client_commands)
+ }
})
.collect()
}
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
index 44af8fb..6ae527a 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
@@ -82,3 +82,10 @@ macro_rules! try_default_ {
};
}
pub(crate) use try_default_ as try_default;
+
+#[cfg(feature = "dhat")]
+#[global_allocator]
+static ALLOC: dhat::Alloc = dhat::Alloc;
+
+#[cfg(feature = "dhat")]
+static DHAT_PROFILER: std::sync::Mutex<Option<dhat::Profiler>> = std::sync::Mutex::new(None);
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs
index 024c13e..995e6c4 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs
@@ -26,7 +26,7 @@
use vfs::AbsPath;
use crate::{
- config::{CallInfoConfig, Config},
+ config::{CallInfoConfig, ClientCommandsConfig, Config},
global_state::GlobalStateSnapshot,
line_index::{LineEndings, LineIndex, PositionEncoding},
lsp::{
@@ -258,10 +258,12 @@ pub(crate) fn completion_items(
let max_relevance = items.iter().map(|it| it.relevance.score()).max().unwrap_or_default();
let mut res = Vec::with_capacity(items.len());
+ let client_commands = config.client_commands();
for item in items {
completion_item(
&mut res,
config,
+ &client_commands,
fields_to_resolve,
line_index,
version,
@@ -283,6 +285,7 @@ pub(crate) fn completion_items(
fn completion_item(
acc: &mut Vec<lsp_types::CompletionItem>,
config: &Config,
+ client_commands: &ClientCommandsConfig,
fields_to_resolve: &CompletionFieldsToResolve,
line_index: &LineIndex,
version: Option<i32>,
@@ -342,7 +345,7 @@ fn completion_item(
} else {
item.deprecated.then(|| vec![lsp_types::CompletionItemTag::DEPRECATED])
};
- let command = if item.trigger_call_info && config.client_commands().trigger_parameter_hints {
+ let command = if item.trigger_call_info && client_commands.trigger_parameter_hints {
if fields_to_resolve.resolve_command {
something_to_resolve |= true;
None
@@ -1500,6 +1503,7 @@ pub(crate) fn code_action_kind(kind: AssistKind) -> lsp_types::CodeActionKind {
pub(crate) fn code_action(
snap: &GlobalStateSnapshot,
+ commands: &ClientCommandsConfig,
assist: Assist,
resolve_data: Option<(usize, lsp_types::CodeActionParams, Option<i32>)>,
) -> Cancellable<lsp_ext::CodeAction> {
@@ -1513,7 +1517,6 @@ pub(crate) fn code_action(
command: None,
};
- let commands = snap.config.client_commands();
res.command = match assist.command {
Some(assists::Command::TriggerParameterHints) if commands.trigger_parameter_hints => {
Some(command::trigger_parameter_hints())
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs
index c0947b2..c2b887c 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs
@@ -60,6 +60,14 @@ pub fn main_loop(config: Config, connection: Connection) -> anyhow::Result<()> {
SetThreadPriority(thread, thread_priority_above_normal);
}
+ #[cfg(feature = "dhat")]
+ {
+ if let Some(dhat_output_file) = config.dhat_output_file() {
+ *crate::DHAT_PROFILER.lock().unwrap() =
+ Some(dhat::Profiler::builder().file_name(&dhat_output_file).build());
+ }
+ }
+
GlobalState::new(connection.sender, config).run(connection.receiver)
}
@@ -1023,9 +1031,9 @@ fn handle_flycheck_msg(&mut self, message: FlycheckMessage) {
package_id,
} => {
let snap = self.snapshot();
- let diagnostics = crate::diagnostics::to_proto::map_rust_diagnostic_to_lsp(
+ let diagnostics = crate::diagnostics::flycheck_to_proto::map_rust_diagnostic_to_lsp(
&self.config.diagnostics_map(None),
- &diagnostic,
+ diagnostic,
&workspace_root,
&snap,
);
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs
index 1475f02..bb971eb 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs
@@ -23,6 +23,7 @@
use itertools::Itertools;
use load_cargo::{ProjectFolders, load_proc_macro};
use lsp_types::FileSystemWatcher;
+use paths::Utf8Path;
use proc_macro_api::ProcMacroClient;
use project_model::{ManifestPath, ProjectWorkspace, ProjectWorkspaceKind, WorkspaceBuildScripts};
use stdx::{format_to, thread::ThreadIntent};
@@ -876,6 +877,7 @@ fn reload_flycheck(&mut self) {
None,
self.config.root_path().clone(),
None,
+ None,
)]
}
crate::flycheck::InvocationStrategy::PerWorkspace => {
@@ -890,13 +892,17 @@ fn reload_flycheck(&mut self) {
| ProjectWorkspaceKind::DetachedFile {
cargo: Some((cargo, _, _)),
..
- } => (cargo.workspace_root(), Some(cargo.manifest_path())),
+ } => (
+ cargo.workspace_root(),
+ Some(cargo.manifest_path()),
+ Some(cargo.target_directory()),
+ ),
ProjectWorkspaceKind::Json(project) => {
// Enable flychecks for json projects if a custom flycheck command was supplied
// in the workspace configuration.
match config {
FlycheckConfig::CustomCommand { .. } => {
- (project.path(), None)
+ (project.path(), None, None)
}
_ => return None,
}
@@ -906,7 +912,7 @@ fn reload_flycheck(&mut self) {
ws.sysroot.root().map(ToOwned::to_owned),
))
})
- .map(|(id, (root, manifest_path), sysroot_root)| {
+ .map(|(id, (root, manifest_path, target_dir), sysroot_root)| {
FlycheckHandle::spawn(
id,
next_gen,
@@ -915,6 +921,7 @@ fn reload_flycheck(&mut self) {
sysroot_root,
root.to_path_buf(),
manifest_path.map(|it| it.to_path_buf()),
+ target_dir.map(|it| AsRef::<Utf8Path>::as_ref(it).to_path_buf()),
)
})
.collect()
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs
index 0c8658c..9a65e70 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs
@@ -2,7 +2,7 @@
//! thread and report the result of each test in a channel.
use crossbeam_channel::Sender;
-use paths::AbsPath;
+use paths::{AbsPath, Utf8Path};
use project_model::TargetKind;
use serde::Deserialize as _;
use serde_derive::Deserialize;
@@ -98,6 +98,7 @@ pub(crate) fn new(
path: Option<&str>,
options: CargoOptions,
root: &AbsPath,
+ ws_target_dir: Option<&Utf8Path>,
test_target: TestTarget,
sender: Sender<CargoTestMessage>,
) -> std::io::Result<Self> {
@@ -123,7 +124,7 @@ pub(crate) fn new(
cmd.arg("--no-fail-fast");
cmd.arg("--manifest-path");
cmd.arg(root.join("Cargo.toml"));
- options.apply_on_command(&mut cmd);
+ options.apply_on_command(&mut cmd, ws_target_dir);
cmd.arg("--");
if let Some(path) = path {
cmd.arg(path);
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs
index 051c583..dba3920 100644
--- a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs
+++ b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs
@@ -1355,7 +1355,7 @@ pub mod tokens {
pub(super) static SOURCE_FILE: LazyLock<Parse<SourceFile>> = LazyLock::new(|| {
SourceFile::parse(
- "use crate::foo; const C: <()>::Item = ( true && true , true || true , 1 != 1, 2 == 2, 3 < 3, 4 <= 4, 5 > 5, 6 >= 6, !true, *p, &p , &mut p, async { let _ @ [] })\n;\n\nunsafe impl A for B where: {}",
+ "use crate::foo; const C: <()>::Item = ( true && true , true || true , 1 != 1, 2 == 2, 3 < 3, 4 <= 4, 5 > 5, 6 >= 6, !true, *p, &p , &mut p, async { let _ @ [] }, while loop {} {})\n;\n\nunsafe impl A for B where: {}",
Edition::CURRENT,
)
});
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/syntax_factory/constructors.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/syntax_factory/constructors.rs
index 8bf27f9..9695523 100644
--- a/src/tools/rust-analyzer/crates/syntax/src/ast/syntax_factory/constructors.rs
+++ b/src/tools/rust-analyzer/crates/syntax/src/ast/syntax_factory/constructors.rs
@@ -644,6 +644,20 @@ pub fn expr_if(
ast
}
+ pub fn expr_loop(&self, body: ast::BlockExpr) -> ast::LoopExpr {
+ let ast::Expr::LoopExpr(ast) = make::expr_loop(body.clone()).clone_for_update() else {
+ unreachable!()
+ };
+
+ if let Some(mut mapping) = self.mappings() {
+ let mut builder = SyntaxMappingBuilder::new(ast.syntax().clone());
+ builder.map_node(body.syntax().clone(), ast.loop_body().unwrap().syntax().clone());
+ builder.finish(&mut mapping);
+ }
+
+ ast
+ }
+
pub fn expr_while_loop(&self, condition: ast::Expr, body: ast::BlockExpr) -> ast::WhileExpr {
let ast = make::expr_while_loop(condition.clone(), body.clone()).clone_for_update();
diff --git a/src/tools/rust-analyzer/crates/tt/src/lib.rs b/src/tools/rust-analyzer/crates/tt/src/lib.rs
index 243a27b..f9a547f 100644
--- a/src/tools/rust-analyzer/crates/tt/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/tt/src/lib.rs
@@ -622,6 +622,15 @@ pub fn token_to_literal<S>(text: &str, span: S) -> Literal<S>
let lit = &lit[start_offset..lit.len() - end_offset];
let suffix = match suffix {
"" | "_" => None,
+ // ill-suffixed literals
+ _ if !matches!(kind, LitKind::Integer | LitKind::Float | LitKind::Err(_)) => {
+ return Literal {
+ span,
+ symbol: Symbol::intern(text),
+ kind: LitKind::Err(()),
+ suffix: None,
+ };
+ }
suffix => Some(Symbol::intern(suffix)),
};
diff --git a/src/tools/rust-analyzer/docs/book/src/configuration_generated.md b/src/tools/rust-analyzer/docs/book/src/configuration_generated.md
index d768993..21e199c 100644
--- a/src/tools/rust-analyzer/docs/book/src/configuration_generated.md
+++ b/src/tools/rust-analyzer/docs/book/src/configuration_generated.md
@@ -635,6 +635,13 @@
Controls file watching implementation.
+## rust-analyzer.gotoImplementations.filterAdjacentDerives {#gotoImplementations.filterAdjacentDerives}
+
+Default: `false`
+
+If this is `true`, when "Goto Implementations" and in "Implementations" lens, are triggered on a `struct` or `enum` or `union`, we filter out trait implementations that originate from `derive`s above the type.
+
+
## rust-analyzer.highlightRelated.branchExitPoints.enable {#highlightRelated.branchExitPoints.enable}
Default: `true`
@@ -1289,6 +1296,16 @@
Internal config, path to proc-macro server executable.
+## rust-analyzer.profiling.memoryProfile {#profiling.memoryProfile}
+
+Default: `null`
+
+The path where to save memory profiling output.
+
+**Note:** Memory profiling is not enabled by default in rust-analyzer builds, you need to build
+from source for it.
+
+
## rust-analyzer.references.excludeImports {#references.excludeImports}
Default: `false`
diff --git a/src/tools/rust-analyzer/editors/code/package.json b/src/tools/rust-analyzer/editors/code/package.json
index d659421..7db4986 100644
--- a/src/tools/rust-analyzer/editors/code/package.json
+++ b/src/tools/rust-analyzer/editors/code/package.json
@@ -1628,6 +1628,16 @@
}
},
{
+ "title": "Goto Implementations",
+ "properties": {
+ "rust-analyzer.gotoImplementations.filterAdjacentDerives": {
+ "markdownDescription": "If this is `true`, when \"Goto Implementations\" and in \"Implementations\" lens, are triggered on a `struct` or `enum` or `union`, we filter out trait implementations that originate from `derive`s above the type.",
+ "default": false,
+ "type": "boolean"
+ }
+ }
+ },
+ {
"title": "Highlight Related",
"properties": {
"rust-analyzer.highlightRelated.branchExitPoints.enable": {
@@ -2750,6 +2760,19 @@
}
},
{
+ "title": "Profiling",
+ "properties": {
+ "rust-analyzer.profiling.memoryProfile": {
+ "markdownDescription": "The path where to save memory profiling output.\n\n**Note:** Memory profiling is not enabled by default in rust-analyzer builds, you need to build\nfrom source for it.",
+ "default": null,
+ "type": [
+ "null",
+ "string"
+ ]
+ }
+ }
+ },
+ {
"title": "References",
"properties": {
"rust-analyzer.references.excludeImports": {
diff --git a/src/tools/rust-analyzer/editors/code/src/commands.ts b/src/tools/rust-analyzer/editors/code/src/commands.ts
index 25b3001..16fc586 100644
--- a/src/tools/rust-analyzer/editors/code/src/commands.ts
+++ b/src/tools/rust-analyzer/editors/code/src/commands.ts
@@ -71,32 +71,9 @@
}
export function memoryUsage(ctx: CtxInit): Cmd {
- const tdcp = new (class implements vscode.TextDocumentContentProvider {
- readonly uri = vscode.Uri.parse("rust-analyzer-memory://memory");
- readonly eventEmitter = new vscode.EventEmitter<vscode.Uri>();
-
- provideTextDocumentContent(_uri: vscode.Uri): vscode.ProviderResult<string> {
- if (!vscode.window.activeTextEditor) return "";
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- return ctx.client.sendRequest(ra.memoryUsage).then((mem: any) => {
- return "Per-query memory usage:\n" + mem + "\n(note: database has been cleared)";
- });
- }
-
- get onDidChange(): vscode.Event<vscode.Uri> {
- return this.eventEmitter.event;
- }
- })();
-
- ctx.pushExtCleanup(
- vscode.workspace.registerTextDocumentContentProvider("rust-analyzer-memory", tdcp),
- );
-
return async () => {
- tdcp.eventEmitter.fire(tdcp.uri);
- const document = await vscode.workspace.openTextDocument(tdcp.uri);
- return vscode.window.showTextDocument(document, vscode.ViewColumn.Two, true);
+ const response = await ctx.client.sendRequest(ra.memoryUsage);
+ vscode.window.showInformationMessage(response);
};
}
diff --git a/src/tools/rust-analyzer/editors/code/src/snippets.ts b/src/tools/rust-analyzer/editors/code/src/snippets.ts
index e3f43a8..a469a9c 100644
--- a/src/tools/rust-analyzer/editors/code/src/snippets.ts
+++ b/src/tools/rust-analyzer/editors/code/src/snippets.ts
@@ -24,7 +24,9 @@
for (const indel of edits) {
assert(
!(indel instanceof vscode.SnippetTextEdit),
- `bad ws edit: snippet received with multiple edits: ${JSON.stringify(edit)}`,
+ `bad ws edit: snippet received with multiple edits: ${JSON.stringify(
+ edit,
+ )}`,
);
builder.replace(indel.range, indel.newText);
}
diff --git a/src/tools/rust-analyzer/rust-version b/src/tools/rust-analyzer/rust-version
index c9529fde..0e89b4a 100644
--- a/src/tools/rust-analyzer/rust-version
+++ b/src/tools/rust-analyzer/rust-version
@@ -1 +1 @@
-fb24b04b096a980bffd80154f6aba22fd07cb3d9
+c5dabe8cf798123087d094f06417f5a767ca73e8
diff --git a/src/tools/rust-analyzer/xtask/src/dist.rs b/src/tools/rust-analyzer/xtask/src/dist.rs
index dbfecdb..1b1fb53 100644
--- a/src/tools/rust-analyzer/xtask/src/dist.rs
+++ b/src/tools/rust-analyzer/xtask/src/dist.rs
@@ -45,11 +45,22 @@ pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
allocator,
self.zig,
self.pgo,
+ // Profiling requires debug information.
+ self.enable_profiling,
)?;
let release_tag = if stable { date_iso(sh)? } else { "nightly".to_owned() };
dist_client(sh, &version, &release_tag, &target)?;
} else {
- dist_server(sh, "0.0.0-standalone", &target, allocator, self.zig, self.pgo)?;
+ dist_server(
+ sh,
+ "0.0.0-standalone",
+ &target,
+ allocator,
+ self.zig,
+ self.pgo,
+ // Profiling requires debug information.
+ self.enable_profiling,
+ )?;
}
Ok(())
}
@@ -92,9 +103,11 @@ fn dist_server(
allocator: Malloc,
zig: bool,
pgo: Option<PgoTrainingCrate>,
+ dev_rel: bool,
) -> anyhow::Result<()> {
let _e = sh.push_env("CFG_RELEASE", release);
let _e = sh.push_env("CARGO_PROFILE_RELEASE_LTO", "thin");
+ let _e = sh.push_env("CARGO_PROFILE_DEV_REL_LTO", "thin");
// Uncomment to enable debug info for releases. Note that:
// * debug info is split on windows and macs, so it does nothing for those platforms,
@@ -120,7 +133,7 @@ fn dist_server(
None
};
- let mut cmd = build_command(sh, command, &target_name, features);
+ let mut cmd = build_command(sh, command, &target_name, features, dev_rel);
if let Some(profile) = pgo_profile {
cmd = cmd.env("RUSTFLAGS", format!("-Cprofile-use={}", profile.to_str().unwrap()));
}
@@ -141,10 +154,12 @@ fn build_command<'a>(
command: &str,
target_name: &str,
features: &[&str],
+ dev_rel: bool,
) -> Cmd<'a> {
+ let profile = if dev_rel { "dev-rel" } else { "release" };
cmd!(
sh,
- "cargo {command} --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target {target_name} {features...} --release"
+ "cargo {command} --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target {target_name} {features...} --profile {profile}"
)
}
diff --git a/src/tools/rust-analyzer/xtask/src/flags.rs b/src/tools/rust-analyzer/xtask/src/flags.rs
index 8f70a18..e72d8f2 100644
--- a/src/tools/rust-analyzer/xtask/src/flags.rs
+++ b/src/tools/rust-analyzer/xtask/src/flags.rs
@@ -42,6 +42,10 @@ fn from_str(s: &str) -> Result<Self, Self::Err> {
optional --mimalloc
/// Use jemalloc allocator for server.
optional --jemalloc
+ // Enable memory profiling support.
+ //
+ // **Warning:** This will produce a slower build of rust-analyzer, use only for profiling.
+ optional --enable-profiling
/// Install the proc-macro server.
optional --proc-macro-server
@@ -67,6 +71,10 @@ fn from_str(s: &str) -> Result<Self, Self::Err> {
optional --mimalloc
/// Use jemalloc allocator for server
optional --jemalloc
+ // Enable memory profiling support.
+ //
+ // **Warning:** This will produce a slower build of rust-analyzer, use only for profiling.
+ optional --enable-profiling
optional --client-patch-version version: String
/// Use cargo-zigbuild
optional --zig
@@ -125,6 +133,7 @@ pub struct Install {
pub server: bool,
pub mimalloc: bool,
pub jemalloc: bool,
+ pub enable_profiling: bool,
pub proc_macro_server: bool,
pub dev_rel: bool,
pub force_always_assert: bool,
@@ -143,6 +152,7 @@ pub struct Release {
pub struct Dist {
pub mimalloc: bool,
pub jemalloc: bool,
+ pub enable_profiling: bool,
pub client_patch_version: Option<String>,
pub zig: bool,
pub pgo: Option<PgoTrainingCrate>,
@@ -280,6 +290,7 @@ pub(crate) enum Malloc {
System,
Mimalloc,
Jemalloc,
+ Dhat,
}
impl Malloc {
@@ -288,6 +299,7 @@ pub(crate) fn to_features(self) -> &'static [&'static str] {
Malloc::System => &[][..],
Malloc::Mimalloc => &["--features", "mimalloc"],
Malloc::Jemalloc => &["--features", "jemalloc"],
+ Malloc::Dhat => &["--features", "dhat"],
}
}
}
@@ -301,12 +313,15 @@ pub(crate) fn server(&self) -> Option<ServerOpt> {
Malloc::Mimalloc
} else if self.jemalloc {
Malloc::Jemalloc
+ } else if self.enable_profiling {
+ Malloc::Dhat
} else {
Malloc::System
};
Some(ServerOpt {
malloc,
- dev_rel: self.dev_rel,
+ // Profiling requires debug information.
+ dev_rel: self.dev_rel || self.enable_profiling,
pgo: self.pgo.clone(),
force_always_assert: self.force_always_assert,
})
@@ -331,6 +346,8 @@ pub(crate) fn allocator(&self) -> Malloc {
Malloc::Mimalloc
} else if self.jemalloc {
Malloc::Jemalloc
+ } else if self.enable_profiling {
+ Malloc::Dhat
} else {
Malloc::System
}
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index dfca2cd..f03dde6 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -68,14 +68,20 @@
"library/std/src/io/error.rs", // Repr unpacked needed for UEFI
];
-pub fn check(path: &Path, tidy_ctx: TidyCtx) {
- let mut check = tidy_ctx.start_check(CheckId::new("pal").path(path));
+pub fn check(library_path: &Path, tidy_ctx: TidyCtx) {
+ let mut check = tidy_ctx.start_check(CheckId::new("pal").path(library_path));
+
+ let root_path = library_path.parent().unwrap();
+ // Let's double-check that this is the root path by making sure it has `x.py`.
+ assert!(root_path.join("x.py").is_file());
// Sanity check that the complex parsing here works.
let mut saw_target_arch = false;
let mut saw_cfg_bang = false;
- walk(path, |path, _is_dir| filter_dirs(path), &mut |entry, contents| {
+ walk(library_path, |path, _is_dir| filter_dirs(path), &mut |entry, contents| {
let file = entry.path();
+ // We don't want the absolute path to matter, so make it relative.
+ let file = file.strip_prefix(root_path).unwrap();
let filestr = file.to_string_lossy().replace("\\", "/");
if !filestr.ends_with(".rs") {
return;
diff --git a/src/tools/unicode-table-generator/src/cascading_map.rs b/src/tools/unicode-table-generator/src/cascading_map.rs
index 41124a8..56e6401 100644
--- a/src/tools/unicode-table-generator/src/cascading_map.rs
+++ b/src/tools/unicode-table-generator/src/cascading_map.rs
@@ -1,8 +1,9 @@
use std::collections::HashMap;
+use std::fmt::Write as _;
use std::ops::Range;
+use crate::fmt_list;
use crate::raw_emitter::RawEmitter;
-use crate::writeln;
impl RawEmitter {
pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool {
@@ -23,6 +24,8 @@ pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool {
.flat_map(|r| (r.start..r.end).collect::<Vec<u32>>())
.collect::<Vec<u32>>();
+ println!("there are {} points", points.len());
+
// how many distinct ranges need to be counted?
let mut codepoints_by_high_bytes = HashMap::<usize, Vec<u32>>::new();
for point in points {
@@ -34,7 +37,7 @@ pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool {
}
let mut bit_for_high_byte = 1u8;
- let mut arms = String::new();
+ let mut arms = Vec::<String>::new();
let mut high_bytes: Vec<usize> = codepoints_by_high_bytes.keys().copied().collect();
high_bytes.sort();
@@ -42,33 +45,33 @@ pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool {
let codepoints = codepoints_by_high_bytes.get_mut(&high_byte).unwrap();
if codepoints.len() == 1 {
let ch = codepoints.pop().unwrap();
- writeln!(arms, "{high_byte:#04x} => c as u32 == {ch:#04x},");
+ arms.push(format!("{high_byte} => c as u32 == {ch:#04x}"));
continue;
}
// more than 1 codepoint in this arm
for codepoint in codepoints {
map[(*codepoint & 0xff) as usize] |= bit_for_high_byte;
}
- writeln!(
- arms,
- "{high_byte:#04x} => WHITESPACE_MAP[c as usize & 0xff] & {bit_for_high_byte} != 0,"
- );
+ arms.push(format!(
+ "{high_byte} => WHITESPACE_MAP[c as usize & 0xff] & {bit_for_high_byte} != 0"
+ ));
bit_for_high_byte <<= 1;
}
+ writeln!(&mut self.file, "static WHITESPACE_MAP: [u8; 256] = [{}];", fmt_list(map.iter()))
+ .unwrap();
self.bytes_used += 256;
- self.file = format!(
- "static WHITESPACE_MAP: [u8; 256] = {map:?};
- #[inline]
- pub const fn lookup(c: char) -> bool {{
- debug_assert!(!c.is_ascii());
- match c as u32 >> 8 {{
- {arms}\
- _ => false,
- }}
- }}"
- );
+ writeln!(&mut self.file, "#[inline]").unwrap();
+ writeln!(&mut self.file, "pub const fn lookup(c: char) -> bool {{").unwrap();
+ writeln!(&mut self.file, " debug_assert!(!c.is_ascii());").unwrap();
+ writeln!(&mut self.file, " match c as u32 >> 8 {{").unwrap();
+ for arm in arms {
+ writeln!(&mut self.file, " {arm},").unwrap();
+ }
+ writeln!(&mut self.file, " _ => false,").unwrap();
+ writeln!(&mut self.file, " }}").unwrap();
+ writeln!(&mut self.file, "}}").unwrap();
true
}
diff --git a/src/tools/unicode-table-generator/src/case_mapping.rs b/src/tools/unicode-table-generator/src/case_mapping.rs
index 3280514..49aef3e 100644
--- a/src/tools/unicode-table-generator/src/case_mapping.rs
+++ b/src/tools/unicode-table-generator/src/case_mapping.rs
@@ -1,25 +1,27 @@
use std::char;
use std::collections::BTreeMap;
+use std::fmt::{self, Write};
-use crate::fmt_helpers::Hex;
-use crate::{CharEscape, UnicodeData, fmt_list};
+use crate::{UnicodeData, fmt_list};
const INDEX_MASK: u32 = 1 << 22;
pub(crate) fn generate_case_mapping(data: &UnicodeData) -> (String, [usize; 2]) {
+ let mut file = String::new();
+
+ write!(file, "const INDEX_MASK: u32 = 0x{INDEX_MASK:x};").unwrap();
+ file.push_str("\n\n");
+ file.push_str(HEADER.trim_start());
+ file.push('\n');
let (lower_tables, lower_size) = generate_tables("LOWER", &data.to_lower);
+ file.push_str(&lower_tables);
+ file.push_str("\n\n");
let (upper_tables, upper_size) = generate_tables("UPPER", &data.to_upper);
- let file = format!(
- "{lower_tables}
- {upper_tables}"
- );
+ file.push_str(&upper_tables);
(file, [lower_size, upper_size])
}
fn generate_tables(case: &str, data: &BTreeMap<u32, [u32; 3]>) -> (String, usize) {
- let case_lower = case.to_lowercase();
- let case_upper = case.to_uppercase();
-
let mut mappings = Vec::with_capacity(data.len());
let mut multis = Vec::new();
@@ -42,49 +44,77 @@
INDEX_MASK | (u32::try_from(multis.len()).unwrap() - 1)
};
- mappings.push((CharEscape(key), Hex(value)));
+ mappings.push((CharEscape(key), value));
}
- let size = size_of_val(mappings.as_slice()) + size_of_val(multis.as_slice());
- let file = format!(
- "
-#[rustfmt::skip]
-static {case}CASE_TABLE: &[(char, u32); {mappings_len}] = &[{mappings}];
+ let mut tables = String::new();
+ let mut size = 0;
-#[rustfmt::skip]
-static {case}CASE_TABLE_MULTI: &[[char; 3]; {multis_len}] = &[{multis}];
+ size += size_of_val(mappings.as_slice());
+ write!(
+ tables,
+ "static {}CASE_TABLE: &[(char, u32); {}] = &[{}];",
+ case,
+ mappings.len(),
+ fmt_list(mappings),
+ )
+ .unwrap();
-#[inline]
-pub fn to_{case_lower}(c: char) -> [char; 3] {{
- const {{
- let mut i = 0;
- while i < {case_upper}CASE_TABLE.len() {{
- let (_, val) = {case_upper}CASE_TABLE[i];
- if val & (1 << 22) == 0 {{
- assert!(char::from_u32(val).is_some());
- }} else {{
- let index = val & ((1 << 22) - 1);
- assert!((index as usize) < {case_upper}CASE_TABLE_MULTI.len());
- }}
- i += 1;
- }}
- }}
+ tables.push_str("\n\n");
- // SAFETY: Just checked that the tables are valid
- unsafe {{
- super::case_conversion(
- c,
- |c| c.to_ascii_{case_lower}case(),
- {case_upper}CASE_TABLE,
- {case_upper}CASE_TABLE_MULTI,
- )
- }}
-}}",
- mappings = fmt_list(&mappings),
- mappings_len = mappings.len(),
- multis = fmt_list(&multis),
- multis_len = multis.len(),
- );
+ size += size_of_val(multis.as_slice());
+ write!(
+ tables,
+ "static {}CASE_TABLE_MULTI: &[[char; 3]; {}] = &[{}];",
+ case,
+ multis.len(),
+ fmt_list(multis),
+ )
+ .unwrap();
- (file, size)
+ (tables, size)
}
+
+struct CharEscape(char);
+
+impl fmt::Debug for CharEscape {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "'{}'", self.0.escape_default())
+ }
+}
+
+static HEADER: &str = r"
+pub fn to_lower(c: char) -> [char; 3] {
+ if c.is_ascii() {
+ [(c as u8).to_ascii_lowercase() as char, '\0', '\0']
+ } else {
+ LOWERCASE_TABLE
+ .binary_search_by(|&(key, _)| key.cmp(&c))
+ .map(|i| {
+ let u = LOWERCASE_TABLE[i].1;
+ char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| {
+ // SAFETY: Index comes from statically generated table
+ unsafe { *LOWERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) }
+ })
+ })
+ .unwrap_or([c, '\0', '\0'])
+ }
+}
+
+pub fn to_upper(c: char) -> [char; 3] {
+ if c.is_ascii() {
+ [(c as u8).to_ascii_uppercase() as char, '\0', '\0']
+ } else {
+ UPPERCASE_TABLE
+ .binary_search_by(|&(key, _)| key.cmp(&c))
+ .map(|i| {
+ let u = UPPERCASE_TABLE[i].1;
+ char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| {
+ // SAFETY: Index comes from statically generated table
+ unsafe { *UPPERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) }
+ })
+ })
+ .unwrap_or([c, '\0', '\0'])
+ }
+}
+";
diff --git a/src/tools/unicode-table-generator/src/fmt_helpers.rs b/src/tools/unicode-table-generator/src/fmt_helpers.rs
deleted file mode 100644
index bd7417c..0000000
--- a/src/tools/unicode-table-generator/src/fmt_helpers.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-use std::fmt;
-
-// Convenience macros for writing and unwrapping.
-#[macro_export]
-macro_rules! writeln {
- ($($args:tt)*) => {{
- use std::fmt::Write as _;
- std::writeln!($($args)*).unwrap();
- }};
-}
-#[macro_export]
-macro_rules! write {
- ($($args:tt)*) => {{
- use std::fmt::Write as _;
- std::write!($($args)*).unwrap();
- }};
-}
-
-pub fn fmt_list<V: fmt::Debug>(values: impl IntoIterator<Item = V>) -> String {
- let pieces = values.into_iter().map(|b| format!("{b:?}, "));
- let mut out = String::new();
- let mut line = String::from("\n ");
- for piece in pieces {
- if line.len() + piece.len() < 98 {
- line.push_str(&piece);
- } else {
- writeln!(out, "{}", line.trim_end());
- line = format!(" {piece}");
- }
- }
- writeln!(out, "{}", line.trim_end());
- out
-}
-
-/// Wrapper type for formatting a `T` using its `Binary` implementation.
-#[derive(Copy, Clone)]
-pub struct Bin<T>(pub T);
-
-impl<T: fmt::Binary> fmt::Debug for Bin<T> {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- let bits = size_of::<T>() * 8;
- std::write!(f, "0b{:0bits$b}", self.0)
- }
-}
-
-impl<T: fmt::Binary> fmt::Display for Bin<T> {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Debug::fmt(self, f)
- }
-}
-
-/// Wrapper type for formatting a `T` using its `LowerHex` implementation.
-#[derive(Copy, Clone)]
-pub struct Hex<T>(pub T);
-
-impl<T: fmt::LowerHex> fmt::Debug for Hex<T> {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- std::write!(f, "{:#x}", self.0)
- }
-}
-
-impl<T: fmt::LowerHex> fmt::Display for Hex<T> {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Debug::fmt(self, f)
- }
-}
-
-/// Wrapper type for formatting a `char` using `escape_unicode`.
-#[derive(Copy, Clone)]
-pub struct CharEscape(pub char);
-
-impl fmt::Debug for CharEscape {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- std::write!(f, "'{}'", self.0.escape_unicode())
- }
-}
-
-impl fmt::Display for CharEscape {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Debug::fmt(self, f)
- }
-}
diff --git a/src/tools/unicode-table-generator/src/main.rs b/src/tools/unicode-table-generator/src/main.rs
index 78f63b5..ded9205 100644
--- a/src/tools/unicode-table-generator/src/main.rs
+++ b/src/tools/unicode-table-generator/src/main.rs
@@ -72,18 +72,18 @@
//! or not.
use std::collections::{BTreeMap, HashMap};
+use std::fmt;
+use std::fmt::Write;
use std::ops::Range;
use ucd_parse::Codepoints;
mod cascading_map;
mod case_mapping;
-mod fmt_helpers;
mod raw_emitter;
mod skiplist;
mod unicode_download;
-use fmt_helpers::*;
use raw_emitter::{RawEmitter, emit_codepoints, emit_whitespace};
static PROPERTIES: &[&str] = &[
@@ -207,27 +207,29 @@ fn load_data() -> UnicodeData {
}
fn main() {
- let args = std::env::args().collect::<Vec<_>>();
-
- if args.len() != 3 {
- eprintln!("Must provide paths to write unicode tables and tests to");
+ let write_location = std::env::args().nth(1).unwrap_or_else(|| {
+ eprintln!("Must provide path to write unicode tables to");
eprintln!(
- "e.g. {} library/core/src/unicode/unicode_data.rs library/coretests/tests/unicode/test_data.rs",
- args[0]
+ "e.g. {} library/core/src/unicode/unicode_data.rs",
+ std::env::args().next().unwrap_or_default()
);
std::process::exit(1);
- }
+ });
- let data_path = &args[1];
- let test_path = &args[2];
+ // Optional test path, which is a Rust source file testing that the unicode
+ // property lookups are correct.
+ let test_path = std::env::args().nth(2);
let unicode_data = load_data();
let ranges_by_property = &unicode_data.ranges;
+ if let Some(path) = test_path {
+ std::fs::write(&path, generate_tests(&unicode_data).unwrap()).unwrap();
+ }
+
let mut table_file = String::new();
- writeln!(
- table_file,
- "//! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually!",
+ table_file.push_str(
+ "//! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually!\n",
);
let mut total_bytes = 0;
@@ -243,9 +245,8 @@ fn main() {
}
modules.push((property.to_lowercase().to_string(), emitter.file));
- writeln!(
- table_file,
- "// {:16}: {:5} bytes, {:6} codepoints in {:3} ranges (U+{:06X} - U+{:06X}) using {}",
+ table_file.push_str(&format!(
+ "// {:16}: {:5} bytes, {:6} codepoints in {:3} ranges (U+{:06X} - U+{:06X}) using {}\n",
property,
emitter.bytes_used,
datapoints,
@@ -253,42 +254,47 @@ fn main() {
ranges.first().unwrap().start,
ranges.last().unwrap().end,
emitter.desc,
- );
+ ));
total_bytes += emitter.bytes_used;
}
let (conversions, sizes) = case_mapping::generate_case_mapping(&unicode_data);
for (name, size) in ["to_lower", "to_upper"].iter().zip(sizes) {
- writeln!(table_file, "// {:16}: {:5} bytes", name, size);
+ table_file.push_str(&format!("// {:16}: {:5} bytes\n", name, size));
total_bytes += size;
}
- writeln!(table_file, "// {:16}: {:5} bytes\n", "Total", total_bytes);
+ table_file.push_str(&format!("// {:16}: {:5} bytes\n", "Total", total_bytes));
- writeln!(table_file, "use super::rt::*;\n");
- writeln!(table_file, "{}\n", version());
+ // Include the range search function
+ table_file.push('\n');
+ table_file.push_str(include_str!("range_search.rs"));
+ table_file.push('\n');
+
+ table_file.push_str(&version());
+
+ table_file.push('\n');
modules.push((String::from("conversions"), conversions));
for (name, contents) in modules {
- writeln!(table_file, "pub mod {name} {{");
- for line in contents.trim().lines() {
- writeln!(table_file, " {line}");
+ table_file.push_str("#[rustfmt::skip]\n");
+ table_file.push_str(&format!("pub mod {name} {{\n"));
+ for line in contents.lines() {
+ if !line.trim().is_empty() {
+ table_file.push_str(" ");
+ table_file.push_str(line);
+ }
+ table_file.push('\n');
}
- writeln!(table_file, "}}\n");
+ table_file.push_str("}\n\n");
}
- let test_file = generate_tests(&unicode_data);
-
- std::fs::write(&test_path, test_file).unwrap();
- std::fs::write(&data_path, table_file).unwrap();
- rustfmt(&data_path);
- rustfmt(&test_path);
-}
-
-fn rustfmt(path: &str) {
- std::process::Command::new("rustfmt").arg(path).status().expect("rustfmt failed");
+ std::fs::write(&write_location, format!("{}\n", table_file.trim_end())).unwrap();
}
fn version() -> String {
+ let mut out = String::new();
+ out.push_str("pub const UNICODE_VERSION: (u8, u8, u8) = ");
+
let readme =
std::fs::read_to_string(std::path::Path::new(UNICODE_DIRECTORY).join("ReadMe.txt"))
.unwrap();
@@ -300,72 +306,109 @@ fn version() -> String {
readme[start..end].split('.').map(|v| v.parse::<u32>().expect(v)).collect::<Vec<_>>();
let [major, minor, micro] = [version[0], version[1], version[2]];
- format!("pub const UNICODE_VERSION: (u8, u8, u8) = ({major}, {minor}, {micro});")
+ out.push_str(&format!("({major}, {minor}, {micro});\n"));
+ out
}
-fn generate_tests(data: &UnicodeData) -> String {
+fn fmt_list<V: std::fmt::Debug>(values: impl IntoIterator<Item = V>) -> String {
+ let pieces = values.into_iter().map(|b| format!("{b:?}, ")).collect::<Vec<_>>();
+ let mut out = String::new();
+ let mut line = String::from("\n ");
+ for piece in pieces {
+ if line.len() + piece.len() < 98 {
+ line.push_str(&piece);
+ } else {
+ out.push_str(line.trim_end());
+ out.push('\n');
+ line = format!(" {piece}");
+ }
+ }
+ out.push_str(line.trim_end());
+ out.push('\n');
+ out
+}
+
+fn generate_tests(data: &UnicodeData) -> Result<String, fmt::Error> {
let mut s = String::new();
- writeln!(
- s,
- "//! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually!"
- );
- writeln!(s, "// ignore-tidy-filelength\n");
- writeln!(s, "use std::ops::RangeInclusive;\n");
+ writeln!(s, "#![feature(core_intrinsics)]")?;
+ writeln!(s, "#![allow(internal_features, dead_code)]")?;
+ writeln!(s, "// ignore-tidy-filelength")?;
+ writeln!(s, "use std::intrinsics;")?;
+ writeln!(s, "mod unicode_data;")?;
+ writeln!(s, "fn main() {{")?;
for (property, ranges) in &data.ranges {
- let prop_upper = property.to_uppercase();
- let is_true = (char::MIN..=char::MAX)
+ let prop = property.to_lowercase();
+ writeln!(s, r#" println!("Testing {prop}");"#)?;
+ writeln!(s, " {prop}_true();")?;
+ writeln!(s, " {prop}_false();")?;
+ let (is_true, is_false): (Vec<_>, Vec<_>) = (char::MIN..=char::MAX)
.filter(|c| !c.is_ascii())
.map(u32::from)
- .filter(|c| ranges.iter().any(|r| r.contains(c)))
- .collect::<Vec<_>>();
- let is_true = ranges_from_set(&is_true);
- let is_true = is_true
- .iter()
- .map(|r| {
- let start = char::from_u32(r.start).unwrap();
- let end = char::from_u32(r.end - 1).unwrap();
- CharEscape(start)..=CharEscape(end)
- })
- .collect::<Vec<_>>();
+ .partition(|c| ranges.iter().any(|r| r.contains(c)));
- writeln!(
- s,
- r#"
-#[rustfmt::skip]
-pub(super) static {prop_upper}: &[RangeInclusive<char>; {is_true_len}] = &[{is_true}];
-"#,
- is_true_len = is_true.len(),
- is_true = fmt_list(is_true),
- );
+ writeln!(s, " fn {prop}_true() {{")?;
+ generate_asserts(&mut s, &prop, &is_true, true)?;
+ writeln!(s, " }}")?;
+
+ writeln!(s, " fn {prop}_false() {{")?;
+ generate_asserts(&mut s, &prop, &is_false, false)?;
+ writeln!(s, " }}")?;
}
- for (prop_lower, conversion) in
- ["to_lower", "to_upper"].iter().zip([&data.to_lower, &data.to_upper])
+ for (name, conversion) in ["to_lower", "to_upper"].iter().zip([&data.to_lower, &data.to_upper])
{
- let prop_upper = prop_lower.to_uppercase();
+ writeln!(s, r#" println!("Testing {name}");"#)?;
+ for (c, mapping) in conversion {
+ let c = char::from_u32(*c).unwrap();
+ let mapping = mapping.map(|c| char::from_u32(c).unwrap());
+ writeln!(
+ s,
+ r#" assert_eq!(unicode_data::conversions::{name}({c:?}), {mapping:?});"#
+ )?;
+ }
+ let unmapped: Vec<_> = (char::MIN..=char::MAX)
+ .filter(|c| !c.is_ascii())
+ .map(u32::from)
+ .filter(|c| !conversion.contains_key(c))
+ .collect();
+ let unmapped_ranges = ranges_from_set(&unmapped);
+ for range in unmapped_ranges {
+ let start = char::from_u32(range.start).unwrap();
+ let end = char::from_u32(range.end - 1).unwrap();
+ writeln!(s, " for c in {start:?}..={end:?} {{")?;
+ writeln!(
+ s,
+ r#" assert_eq!(unicode_data::conversions::{name}(c), [c, '\0', '\0']);"#
+ )?;
- let mapped = conversion
- .iter()
- .map(|(c, chars)| {
- (
- CharEscape(char::from_u32(*c).unwrap()),
- chars.map(|c| CharEscape(char::from_u32(c).unwrap())),
- )
- })
- .collect::<Vec<_>>();
-
- writeln!(
- s,
- r#"
-#[rustfmt::skip]
-pub(super) static {prop_upper}: &[(char, [char; 3]); {mapped_len}] = &[{mapped}];
-"#,
- mapped_len = mapped.len(),
- mapped = fmt_list(mapped),
- );
+ writeln!(s, " }}")?;
+ }
}
- s
+ writeln!(s, "}}")?;
+ Ok(s)
+}
+
+fn generate_asserts(
+ s: &mut String,
+ prop: &str,
+ points: &[u32],
+ truthy: bool,
+) -> Result<(), fmt::Error> {
+ let truthy = if truthy { "" } else { "!" };
+ for range in ranges_from_set(points) {
+ let start = char::from_u32(range.start).unwrap();
+ let end = char::from_u32(range.end - 1).unwrap();
+ match range.len() {
+ 1 => writeln!(s, " assert!({truthy}unicode_data::{prop}::lookup({start:?}));")?,
+ _ => {
+ writeln!(s, " for c in {start:?}..={end:?} {{")?;
+ writeln!(s, " assert!({truthy}unicode_data::{prop}::lookup(c));")?;
+ writeln!(s, " }}")?;
+ }
+ }
+ }
+ Ok(())
}
/// Group the elements of `set` into contigous ranges
diff --git a/library/core/src/unicode/rt.rs b/src/tools/unicode-table-generator/src/range_search.rs
similarity index 75%
rename from library/core/src/unicode/rt.rs
rename to src/tools/unicode-table-generator/src/range_search.rs
index c438635..4d1dd9b 100644
--- a/library/core/src/unicode/rt.rs
+++ b/src/tools/unicode-table-generator/src/range_search.rs
@@ -1,7 +1,5 @@
-//! Runtime support for `unicode_data`.
-
#[inline(always)]
-pub(super) const fn bitset_search<
+const fn bitset_search<
const N: usize,
const CHUNK_SIZE: usize,
const N1: usize,
@@ -48,10 +46,10 @@ pub(super) const fn bitset_search<
}
#[repr(transparent)]
-pub(super) struct ShortOffsetRunHeader(pub(super) u32);
+struct ShortOffsetRunHeader(u32);
impl ShortOffsetRunHeader {
- pub(super) const fn new(start_index: usize, prefix_sum: u32) -> Self {
+ const fn new(start_index: usize, prefix_sum: u32) -> Self {
assert!(start_index < (1 << 11));
assert!(prefix_sum < (1 << 21));
@@ -59,12 +57,12 @@ pub(super) const fn new(start_index: usize, prefix_sum: u32) -> Self {
}
#[inline]
- pub(super) const fn start_index(&self) -> usize {
+ const fn start_index(&self) -> usize {
(self.0 >> 21) as usize
}
#[inline]
- pub(super) const fn prefix_sum(&self) -> u32 {
+ const fn prefix_sum(&self) -> u32 {
self.0 & ((1 << 21) - 1)
}
}
@@ -74,7 +72,7 @@ pub(super) const fn prefix_sum(&self) -> u32 {
/// - The last element of `short_offset_runs` must be greater than `std::char::MAX`.
/// - The start indices of all elements in `short_offset_runs` must be less than `OFFSETS`.
#[inline(always)]
-pub(super) unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
+unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
needle: char,
short_offset_runs: &[ShortOffsetRunHeader; SOR],
offsets: &[u8; OFFSETS],
@@ -128,35 +126,3 @@ pub(super) unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
}
offset_idx % 2 == 1
}
-
-/// # Safety
-/// The second component of each tuple in `table` must either be:
-/// - A valid `char`
-/// - A value with the high bit (1 << 22) set, and the lower 22 bits
-/// being a valid index into `multi`.
-#[inline(always)]
-pub(super) unsafe fn case_conversion(
- c: char,
- ascii_fn: fn(char) -> char,
- table: &[(char, u32)],
- multi: &[[char; 3]],
-) -> [char; 3] {
- const INDEX_MASK: u32 = 1 << 22;
-
- if c.is_ascii() {
- return [ascii_fn(c), '\0', '\0'];
- }
-
- let Ok(i) = table.binary_search_by(|&(key, _)| key.cmp(&c)) else {
- return [c, '\0', '\0'];
- };
-
- let u = table[i].1;
- match char::from_u32(u) {
- Option::Some(c) => [c, '\0', '\0'],
- Option::None => {
- // SAFETY: Index comes from statically generated table
- unsafe { *multi.get_unchecked((u & (INDEX_MASK - 1)) as usize) }
- }
- }
-}
diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs
index 048507a..2979656 100644
--- a/src/tools/unicode-table-generator/src/raw_emitter.rs
+++ b/src/tools/unicode-table-generator/src/raw_emitter.rs
@@ -1,7 +1,8 @@
use std::collections::{BTreeMap, BTreeSet, HashMap};
+use std::fmt::{self, Write};
use std::ops::Range;
-use crate::{Bin, fmt_list, writeln};
+use crate::fmt_list;
#[derive(Clone)]
pub struct RawEmitter {
@@ -15,6 +16,13 @@ pub fn new() -> RawEmitter {
RawEmitter { file: String::new(), bytes_used: 0, desc: String::new() }
}
+ fn blank_line(&mut self) {
+ if self.file.is_empty() || self.file.ends_with("\n\n") {
+ return;
+ }
+ writeln!(&mut self.file).unwrap();
+ }
+
fn emit_bitset(&mut self, ranges: &[Range<u32>]) -> Result<(), String> {
let first_code_point = ranges.first().unwrap().start;
let last_code_point = ranges.last().unwrap().end;
@@ -60,33 +68,48 @@ fn emit_bitset(&mut self, ranges: &[Range<u32>]) -> Result<(), String> {
}
self.emit_chunk_map(word_indices[&0], &compressed_words, best.unwrap().0);
+ struct Bits(u64);
+ impl fmt::Debug for Bits {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "0b{:064b}", self.0)
+ }
+ }
+
+ writeln!(
+ &mut self.file,
+ "static BITSET_CANONICAL: [u64; {}] = [{}];",
+ canonicalized.canonical_words.len(),
+ fmt_list(canonicalized.canonical_words.iter().map(|v| Bits(*v))),
+ )
+ .unwrap();
self.bytes_used += 8 * canonicalized.canonical_words.len();
+ writeln!(
+ &mut self.file,
+ "static BITSET_MAPPING: [(u8, u8); {}] = [{}];",
+ canonicalized.canonicalized_words.len(),
+ fmt_list(&canonicalized.canonicalized_words),
+ )
+ .unwrap();
// 8 bit index into shifted words, 7 bits for shift + optional flip
// We only need it for the words that we removed by applying a shift and
// flip to them.
self.bytes_used += 2 * canonicalized.canonicalized_words.len();
- writeln!(
- self.file,
- "static BITSET_CANONICAL: [u64; {canonical_words_len}] = {canonical_words:?};
- static BITSET_MAPPING: [(u8, u8); {canonicalized_words_len}] = {canonicalized_words:?};
+ self.blank_line();
- pub const fn lookup(c: char) -> bool {{
- debug_assert!(!c.is_ascii());
- (c as u32) >= {first_code_point:#04x} &&
- super::bitset_search(
- c as u32,
- &BITSET_CHUNKS_MAP,
- &BITSET_INDEX_CHUNKS,
- &BITSET_CANONICAL,
- &BITSET_MAPPING,
- )
- }}",
- canonical_words = canonicalized.canonical_words,
- canonical_words_len = canonicalized.canonical_words.len(),
- canonicalized_words = canonicalized.canonicalized_words,
- canonicalized_words_len = canonicalized.canonicalized_words.len(),
- );
+ writeln!(&mut self.file, "pub const fn lookup(c: char) -> bool {{").unwrap();
+ writeln!(&mut self.file, " debug_assert!(!c.is_ascii());").unwrap();
+ if first_code_point > 0x7f {
+ writeln!(&mut self.file, " (c as u32) >= {first_code_point:#04x} &&").unwrap();
+ }
+ writeln!(&mut self.file, " super::bitset_search(").unwrap();
+ writeln!(&mut self.file, " c as u32,").unwrap();
+ writeln!(&mut self.file, " &BITSET_CHUNKS_MAP,").unwrap();
+ writeln!(&mut self.file, " &BITSET_INDEX_CHUNKS,").unwrap();
+ writeln!(&mut self.file, " &BITSET_CANONICAL,").unwrap();
+ writeln!(&mut self.file, " &BITSET_MAPPING,").unwrap();
+ writeln!(&mut self.file, " )").unwrap();
+ writeln!(&mut self.file, "}}").unwrap();
Ok(())
}
@@ -110,21 +133,29 @@ fn emit_chunk_map(&mut self, zero_at: u8, compressed_words: &[u8], chunk_length:
chunk_indices.push(chunk_map[chunk]);
}
+ writeln!(
+ &mut self.file,
+ "static BITSET_CHUNKS_MAP: [u8; {}] = [{}];",
+ chunk_indices.len(),
+ fmt_list(&chunk_indices),
+ )
+ .unwrap();
self.bytes_used += chunk_indices.len();
writeln!(
- self.file,
- "static BITSET_CHUNKS_MAP: [u8; {chunk_indices_len}] = {chunk_indices:?};
- static BITSET_INDEX_CHUNKS: [[u8; {chunk_len}]; {chunks_len}] = [{chunks}];",
- chunk_indices_len = chunk_indices.len(),
- chunk_len = chunk_length,
- chunks_len = chunks.len(),
- chunks = fmt_list(chunks.iter()),
- );
+ &mut self.file,
+ "static BITSET_INDEX_CHUNKS: [[u8; {}]; {}] = [{}];",
+ chunk_length,
+ chunks.len(),
+ fmt_list(chunks.iter()),
+ )
+ .unwrap();
self.bytes_used += chunk_length * chunks.len();
}
}
pub fn emit_codepoints(emitter: &mut RawEmitter, ranges: &[Range<u32>]) {
+ emitter.blank_line();
+
let mut bitset = emitter.clone();
let bitset_ok = bitset.emit_bitset(ranges).is_ok();
@@ -141,6 +172,8 @@ pub fn emit_codepoints(emitter: &mut RawEmitter, ranges: &[Range<u32>]) {
}
pub fn emit_whitespace(emitter: &mut RawEmitter, ranges: &[Range<u32>]) {
+ emitter.blank_line();
+
let mut cascading = emitter.clone();
cascading.emit_cascading_map(ranges);
*emitter = cascading;
@@ -148,7 +181,7 @@ pub fn emit_whitespace(emitter: &mut RawEmitter, ranges: &[Range<u32>]) {
}
struct Canonicalized {
- canonical_words: Vec<Bin<u64>>,
+ canonical_words: Vec<u64>,
canonicalized_words: Vec<(u8, u8)>,
/// Maps an input unique word to the associated index (u8) which is into
@@ -361,7 +394,6 @@ enum UniqueMapping {
)
})
.collect::<Vec<(u8, u8)>>();
- let canonical_words = canonical_words.into_iter().map(Bin).collect::<Vec<_>>();
Canonicalized { unique_mapping, canonical_words, canonicalized_words }
}
}
diff --git a/src/tools/unicode-table-generator/src/skiplist.rs b/src/tools/unicode-table-generator/src/skiplist.rs
index 742d611..660a8f3 100644
--- a/src/tools/unicode-table-generator/src/skiplist.rs
+++ b/src/tools/unicode-table-generator/src/skiplist.rs
@@ -1,8 +1,8 @@
-use std::fmt::{self};
+use std::fmt::{self, Write as _};
use std::ops::Range;
+use crate::fmt_list;
use crate::raw_emitter::RawEmitter;
-use crate::writeln;
/// This will get packed into a single u32 before inserting into the data set.
#[derive(PartialEq)]
@@ -68,45 +68,79 @@ pub fn emit_skiplist(&mut self, ranges: &[Range<u32>]) {
assert!(inserted);
}
+ writeln!(&mut self.file, "use super::ShortOffsetRunHeader;\n").unwrap();
+ writeln!(
+ &mut self.file,
+ "static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; {}] = [{}];",
+ short_offset_runs.len(),
+ fmt_list(short_offset_runs.iter())
+ )
+ .unwrap();
self.bytes_used += 4 * short_offset_runs.len();
+ writeln!(
+ &mut self.file,
+ "static OFFSETS: [u8; {}] = [{}];",
+ coded_offsets.len(),
+ fmt_list(&coded_offsets)
+ )
+ .unwrap();
self.bytes_used += coded_offsets.len();
// The inlining in this code works like the following:
//
- // The `skip_search` function is always inlined into the parent `lookup_slow` fn,
+ // The `skip_search` function is always inlined into the parent `lookup` fn,
// thus the compiler can generate optimal code based on the referenced `static`s.
//
- // The lower-bounds check is inlined into the caller, and slower-path
- // `skip_search` is outlined into a separate `lookup_slow` fn.
- assert!(first_code_point > 0x7f);
- writeln!(self.file,
- "use super::ShortOffsetRunHeader;
-
- static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; {short_offset_runs_len}] = {short_offset_runs:?};
- static OFFSETS: [u8; {coded_offset_len}] = {coded_offsets:?};
-
- #[inline]
- pub fn lookup(c: char) -> bool {{
- debug_assert!(!c.is_ascii());
- (c as u32) >= {first_code_point:#04x} && lookup_slow(c)
- }}
-
- #[inline(never)]
- fn lookup_slow(c: char) -> bool {{
- const {{
- assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > char::MAX as u32);
- let mut i = 0;
- while i < SHORT_OFFSET_RUNS.len() {{
- assert!(SHORT_OFFSET_RUNS[i].start_index() < OFFSETS.len());
- i += 1;
- }}
- }}
- // SAFETY: We just ensured the last element of `SHORT_OFFSET_RUNS` is greater than `std::char::MAX`
- // and the start indices of all elements in `SHORT_OFFSET_RUNS` are smaller than `OFFSETS.len()`.
- unsafe {{ super::skip_search(c, &SHORT_OFFSET_RUNS, &OFFSETS) }}
- }}",
- short_offset_runs_len = short_offset_runs.len(),
- coded_offset_len = coded_offsets.len(),
- );
+ // In the case of ASCII optimization, the lower-bounds check is inlined into
+ // the caller, and slower-path `skip_search` is outlined into a separate `lookup_slow` fn.
+ //
+ // Thus, in both cases, the `skip_search` function is specialized for the `static`s,
+ // and outlined into the prebuilt `std`.
+ if first_code_point > 0x7f {
+ writeln!(&mut self.file, "#[inline]").unwrap();
+ writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap();
+ writeln!(&mut self.file, " debug_assert!(!c.is_ascii());").unwrap();
+ writeln!(&mut self.file, " (c as u32) >= {first_code_point:#04x} && lookup_slow(c)")
+ .unwrap();
+ writeln!(&mut self.file, "}}").unwrap();
+ writeln!(&mut self.file).unwrap();
+ writeln!(&mut self.file, "#[inline(never)]").unwrap();
+ writeln!(&mut self.file, "fn lookup_slow(c: char) -> bool {{").unwrap();
+ } else {
+ writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap();
+ writeln!(&mut self.file, " debug_assert!(!c.is_ascii());").unwrap();
+ }
+ writeln!(&mut self.file, " const {{").unwrap();
+ writeln!(
+ &mut self.file,
+ " assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > char::MAX as u32);",
+ )
+ .unwrap();
+ writeln!(&mut self.file, " let mut i = 0;").unwrap();
+ writeln!(&mut self.file, " while i < SHORT_OFFSET_RUNS.len() {{").unwrap();
+ writeln!(
+ &mut self.file,
+ " assert!(SHORT_OFFSET_RUNS[i].start_index() < OFFSETS.len());",
+ )
+ .unwrap();
+ writeln!(&mut self.file, " i += 1;").unwrap();
+ writeln!(&mut self.file, " }}").unwrap();
+ writeln!(&mut self.file, " }}").unwrap();
+ writeln!(
+ &mut self.file,
+ " // SAFETY: We just ensured the last element of `SHORT_OFFSET_RUNS` is greater than `std::char::MAX`",
+ )
+ .unwrap();
+ writeln!(
+ &mut self.file,
+ " // and the start indices of all elements in `SHORT_OFFSET_RUNS` are smaller than `OFFSETS.len()`.",
+ )
+ .unwrap();
+ writeln!(
+ &mut self.file,
+ " unsafe {{ super::skip_search(c, &SHORT_OFFSET_RUNS, &OFFSETS) }}"
+ )
+ .unwrap();
+ writeln!(&mut self.file, "}}").unwrap();
}
}
diff --git a/tests/assembly-llvm/simd-intrinsic-mask-load.rs b/tests/assembly-llvm/simd-intrinsic-mask-load.rs
index e9ad554..f77cdb6 100644
--- a/tests/assembly-llvm/simd-intrinsic-mask-load.rs
+++ b/tests/assembly-llvm/simd-intrinsic-mask-load.rs
@@ -9,7 +9,7 @@
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
-#![feature(no_core, lang_items, repr_simd, intrinsics)]
+#![feature(no_core, lang_items, repr_simd, intrinsics, adt_const_params)]
#![no_core]
#![allow(non_camel_case_types)]
@@ -35,7 +35,7 @@
pub struct m64x4([i64; 4]);
#[rustc_intrinsic]
-unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+unsafe fn simd_masked_load<M, P, T, const ALIGN: SimdAlign>(mask: M, pointer: P, values: T) -> T;
// CHECK-LABEL: load_i8x16
#[no_mangle]
@@ -56,7 +56,11 @@
// x86-avx512-NOT: vpsllw
// x86-avx512: vpmovb2m k1, xmm0
// x86-avx512-NEXT: vmovdqu8 xmm0 {k1} {z}, xmmword ptr [rdi]
- simd_masked_load(mask, pointer, i8x16([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]))
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ mask,
+ pointer,
+ i8x16([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
+ )
}
// CHECK-LABEL: load_f32x8
@@ -68,7 +72,29 @@
// x86-avx512-NOT: vpslld
// x86-avx512: vpmovd2m k1, ymm0
// x86-avx512-NEXT: vmovups ymm0 {k1} {z}, ymmword ptr [rdi]
- simd_masked_load(mask, pointer, f32x8([0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32]))
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ mask,
+ pointer,
+ f32x8([0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32]),
+ )
+}
+
+// CHECK-LABEL: load_f32x8_aligned
+#[no_mangle]
+pub unsafe extern "C" fn load_f32x8_aligned(mask: m32x8, pointer: *const f32) -> f32x8 {
+ // x86-avx2-NOT: vpslld
+ // x86-avx2: vmaskmovps ymm0, ymm0, ymmword ptr [rdi]
+ //
+ // x86-avx512-NOT: vpslld
+ // x86-avx512: vpmovd2m k1, ymm0
+ // x86-avx512-NEXT: vmovaps ymm0 {k1} {z}, ymmword ptr [rdi]
+ //
+ // this aligned version should generate `movaps` instead of `movups`
+ simd_masked_load::<_, _, _, { SimdAlign::Vector }>(
+ mask,
+ pointer,
+ f32x8([0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32, 0_f32]),
+ )
}
// CHECK-LABEL: load_f64x4
@@ -79,5 +105,9 @@
//
// x86-avx512-NOT: vpsllq
// x86-avx512: vpmovq2m k1, ymm0
- simd_masked_load(mask, pointer, f64x4([0_f64, 0_f64, 0_f64, 0_f64]))
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ mask,
+ pointer,
+ f64x4([0_f64, 0_f64, 0_f64, 0_f64]),
+ )
}
diff --git a/tests/assembly-llvm/simd-intrinsic-mask-store.rs b/tests/assembly-llvm/simd-intrinsic-mask-store.rs
index b8b76b6..2015407 100644
--- a/tests/assembly-llvm/simd-intrinsic-mask-store.rs
+++ b/tests/assembly-llvm/simd-intrinsic-mask-store.rs
@@ -9,7 +9,7 @@
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
-#![feature(no_core, lang_items, repr_simd, intrinsics)]
+#![feature(no_core, lang_items, repr_simd, intrinsics, adt_const_params)]
#![no_core]
#![allow(non_camel_case_types)]
@@ -35,7 +35,7 @@
pub struct m64x4([i64; 4]);
#[rustc_intrinsic]
-unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T);
+unsafe fn simd_masked_store<M, P, T, const ALIGN: SimdAlign>(mask: M, pointer: P, values: T);
// CHECK-LABEL: store_i8x16
#[no_mangle]
@@ -54,7 +54,7 @@
// x86-avx512-NOT: vpsllw
// x86-avx512: vpmovb2m k1, xmm0
// x86-avx512-NEXT: vmovdqu8 xmmword ptr [rdi] {k1}, xmm1
- simd_masked_store(mask, pointer, value)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, value)
}
// CHECK-LABEL: store_f32x8
@@ -66,7 +66,21 @@
// x86-avx512-NOT: vpslld
// x86-avx512: vpmovd2m k1, ymm0
// x86-avx512-NEXT: vmovups ymmword ptr [rdi] {k1}, ymm1
- simd_masked_store(mask, pointer, value)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, value)
+}
+
+// CHECK-LABEL: store_f32x8_aligned
+#[no_mangle]
+pub unsafe extern "C" fn store_f32x8_aligned(mask: m32x8, pointer: *mut f32, value: f32x8) {
+ // x86-avx2-NOT: vpslld
+ // x86-avx2: vmaskmovps ymmword ptr [rdi], ymm0, ymm1
+ //
+ // x86-avx512-NOT: vpslld
+ // x86-avx512: vpmovd2m k1, ymm0
+ // x86-avx512-NEXT: vmovaps ymmword ptr [rdi] {k1}, ymm1
+ //
+ // this aligned version should generate `movaps` instead of `movups`
+ simd_masked_store::<_, _, _, { SimdAlign::Vector }>(mask, pointer, value)
}
// CHECK-LABEL: store_f64x4
@@ -78,5 +92,5 @@
// x86-avx512-NOT: vpsllq
// x86-avx512: vpmovq2m k1, ymm0
// x86-avx512-NEXT: vmovupd ymmword ptr [rdi] {k1}, ymm1
- simd_masked_store(mask, pointer, value)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, value)
}
diff --git a/tests/assembly-llvm/x86_64-no-jump-tables.rs b/tests/assembly-llvm/x86_64-no-jump-tables.rs
index bb10042..e469aee 100644
--- a/tests/assembly-llvm/x86_64-no-jump-tables.rs
+++ b/tests/assembly-llvm/x86_64-no-jump-tables.rs
@@ -1,10 +1,10 @@
-// Test that jump tables are (not) emitted when the `-Zno-jump-tables`
+// Test that jump tables are (not) emitted when the `-Cjump-tables=no`
// flag is (not) set.
//@ revisions: unset set
//@ assembly-output: emit-asm
//@ compile-flags: -Copt-level=3
-//@ [set] compile-flags: -Zno-jump-tables
+//@ [set] compile-flags: -Cjump-tables=no
//@ only-x86_64
//@ ignore-sgx
diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs
index 4f4c653..a974dee 100644
--- a/tests/auxiliary/minicore.rs
+++ b/tests/auxiliary/minicore.rs
@@ -177,6 +177,21 @@ fn add(self, other: isize) -> isize {
}
}
+#[lang = "neg"]
+pub trait Neg {
+ type Output;
+
+ fn neg(self) -> Self::Output;
+}
+
+impl Neg for isize {
+ type Output = isize;
+
+ fn neg(self) -> isize {
+ loop {} // Dummy impl, not actually used
+ }
+}
+
#[lang = "sync"]
trait Sync {}
impl_marker_trait!(
@@ -231,6 +246,13 @@ pub mod mem {
#[rustc_nounwind]
#[rustc_intrinsic]
pub unsafe fn transmute<Src, Dst>(src: Src) -> Dst;
+
+ #[rustc_nounwind]
+ #[rustc_intrinsic]
+ pub const fn size_of<T>() -> usize;
+ #[rustc_nounwind]
+ #[rustc_intrinsic]
+ pub const fn align_of<T>() -> usize;
}
#[lang = "c_void"]
@@ -239,3 +261,17 @@ pub enum c_void {
__variant1,
__variant2,
}
+
+#[lang = "const_param_ty"]
+#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
+pub trait ConstParamTy_ {}
+
+pub enum SimdAlign {
+ // These values must match the compiler's `SimdAlign` defined in
+ // `rustc_middle/src/ty/consts/int.rs`!
+ Unaligned = 0,
+ Element = 1,
+ Vector = 2,
+}
+
+impl ConstParamTy_ for SimdAlign {}
diff --git a/tests/codegen-llvm/function-arguments.rs b/tests/codegen-llvm/function-arguments.rs
index aaa1d57..953b654 100644
--- a/tests/codegen-llvm/function-arguments.rs
+++ b/tests/codegen-llvm/function-arguments.rs
@@ -208,17 +208,23 @@ pub fn struct_return() -> S {
#[no_mangle]
pub fn helper(_: usize) {}
-// CHECK: @slice(ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))?}} %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @slice(
+// CHECK-SAME: ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))?}} %_1.0,
+// CHECK-SAME: [[USIZE]] noundef range({{i32 0, -2147483648|i64 0, -9223372036854775808}}) %_1.1)
// FIXME #25759 This should also have `nocapture`
#[no_mangle]
pub fn slice(_: &[u8]) {}
-// CHECK: @mutable_slice(ptr noalias noundef nonnull align 1 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @mutable_slice(
+// CHECK-SAME: ptr noalias noundef nonnull align 1 %_1.0,
+// CHECK-SAME: [[USIZE]] noundef range({{i32 0, -2147483648|i64 0, -9223372036854775808}}) %_1.1)
// FIXME #25759 This should also have `nocapture`
#[no_mangle]
pub fn mutable_slice(_: &mut [u8]) {}
-// CHECK: @unsafe_slice(ptr noundef nonnull align 2 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @unsafe_slice(
+// CHECK-SAME: ptr noundef nonnull align 2 %_1.0,
+// CHECK-SAME: [[USIZE]] noundef range({{i32 0, 1073741824|i64 0, 4611686018427387904}}) %_1.1)
// unsafe interior means this isn't actually readonly and there may be aliases ...
#[no_mangle]
pub fn unsafe_slice(_: &[UnsafeInner]) {}
@@ -227,7 +233,9 @@ pub fn unsafe_slice(_: &[UnsafeInner]) {}
#[no_mangle]
pub fn raw_slice(_: *const [u8]) {}
-// CHECK: @str(ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))?}} %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @str(
+// CHECK-SAME: ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))?}} %_1.0,
+// CHECK-SAME: [[USIZE]] noundef range({{i32 0, -2147483648|i64 0, -9223372036854775808}}) %_1.1)
// FIXME #25759 This should also have `nocapture`
#[no_mangle]
pub fn str(_: &[u8]) {}
@@ -259,7 +267,9 @@ pub fn trait_option(x: Option<Box<dyn Drop + Unpin>>) -> Option<Box<dyn Drop + U
x
}
-// CHECK: { ptr, [[USIZE]] } @return_slice(ptr noalias noundef nonnull readonly align 2{{( captures\(address, read_provenance\))?}} %x.0, [[USIZE]] noundef %x.1)
+// CHECK: { ptr, [[USIZE]] } @return_slice(
+// CHECK-SAME: ptr noalias noundef nonnull readonly align 2{{( captures\(address, read_provenance\))?}} %x.0,
+// CHECK-SAME: [[USIZE]] noundef range({{i32 0, 1073741824|i64 0, 4611686018427387904}}) %x.1)
#[no_mangle]
pub fn return_slice(x: &[u16]) -> &[u16] {
x
diff --git a/tests/codegen-llvm/no-jump-tables.rs b/tests/codegen-llvm/no-jump-tables.rs
index 8f607e3..ff79c43 100644
--- a/tests/codegen-llvm/no-jump-tables.rs
+++ b/tests/codegen-llvm/no-jump-tables.rs
@@ -1,11 +1,12 @@
// Test that the `no-jump-tables` function attribute are (not) emitted when
-// the `-Zno-jump-tables` flag is (not) set.
+// the `-Cjump-tables=no` flag is (not) set.
//@ add-minicore
-//@ revisions: unset set
+//@ revisions: unset set_no set_yes
//@ needs-llvm-components: x86
//@ compile-flags: --target x86_64-unknown-linux-gnu
-//@ [set] compile-flags: -Zno-jump-tables
+//@ [set_no] compile-flags: -Cjump-tables=no
+//@ [set_yes] compile-flags: -Cjump-tables=yes
#![crate_type = "lib"]
#![feature(no_core, lang_items)]
@@ -19,5 +20,6 @@ pub fn foo() {
// CHECK: @foo() unnamed_addr #0
// unset-NOT: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
- // set: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
+ // set_yes-NOT: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
+ // set_no: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
}
diff --git a/tests/codegen-llvm/range-attribute.rs b/tests/codegen-llvm/range-attribute.rs
index 865d36d..b057b23 100644
--- a/tests/codegen-llvm/range-attribute.rs
+++ b/tests/codegen-llvm/range-attribute.rs
@@ -67,8 +67,26 @@ pub fn enum2_value(x: Enum2) -> Enum2 {
x
}
-// CHECK: noundef [[USIZE]] @takes_slice(ptr {{.*}} %x.0, [[USIZE]] noundef %x.1)
+// CHECK: noundef [[USIZE]] @takes_slice_4(ptr {{.*}} %x.0, [[USIZE]] noundef
+// bit32-SAME: range(i32 0, [[#0x20000000]])
+// bit64-SAME: range(i64 0, [[#0x2000000000000000]])
+// CHECK-SAME: %x.1)
#[no_mangle]
-pub fn takes_slice(x: &[i32]) -> usize {
+pub fn takes_slice_4(x: &[i32]) -> usize {
+ x.len()
+}
+
+// CHECK: noundef [[USIZE]] @takes_slice_3(ptr {{.*}} %x.0, [[USIZE]] noundef
+// bit32-SAME: range(i32 0, [[#0x2AAAAAAB]])
+// bit64-SAME: range(i64 0, [[#0x2AAAAAAAAAAAAAAB]])
+// CHECK-SAME: %x.1)
+#[no_mangle]
+pub fn takes_slice_3(x: &[[u8; 3]]) -> usize {
+ x.len()
+}
+
+// CHECK: noundef [[USIZE]] @takes_zst_slice(ptr {{.*}} %x.0, [[USIZE]] noundef %x.1)
+#[no_mangle]
+pub fn takes_zst_slice(x: &[()]) -> usize {
x.len()
}
diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
index 7df73cb..ffe3851 100644
--- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
+++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
@@ -12,7 +12,7 @@
mod minisimd;
use minisimd::*;
-use std::intrinsics::simd::simd_masked_load;
+use std::intrinsics::simd::{SimdAlign, simd_masked_load};
pub type Vec2<T> = Simd<T, 2>;
pub type Vec4<T> = Simd<T, 4>;
@@ -23,8 +23,45 @@ pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32, values: Vec2<f32>
// CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
// CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
// LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}})
+ // ^^^^^
// LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
- simd_masked_load(mask, pointer, values)
+ // ^^^^^^^
+ // the align parameter should be equal to the alignment of the element type (assumed to be 4)
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
+}
+
+// CHECK-LABEL: @load_f32x2_aligned
+#[no_mangle]
+pub unsafe fn load_f32x2_aligned(
+ mask: Vec2<i32>,
+ pointer: *const f32,
+ values: Vec2<f32>,
+) -> Vec2<f32> {
+ // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
+ // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
+ // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 8, <2 x i1> [[B]], <2 x float> {{.*}})
+ // ^^^^^
+ // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 8 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
+ // ^^^^^^^
+ // the align parameter should be equal to the size of the vector
+ simd_masked_load::<_, _, _, { SimdAlign::Vector }>(mask, pointer, values)
+}
+
+// CHECK-LABEL: @load_f32x2_unaligned
+#[no_mangle]
+pub unsafe fn load_f32x2_unaligned(
+ mask: Vec2<i32>,
+ pointer: *const f32,
+ values: Vec2<f32>,
+) -> Vec2<f32> {
+ // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
+ // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
+ // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 1, <2 x i1> [[B]], <2 x float> {{.*}})
+ // ^^^^^
+ // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 1 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
+ // ^^^^^^^
+ // the align parameter should be 1
+ simd_masked_load::<_, _, _, { SimdAlign::Unaligned }>(mask, pointer, values)
}
// CHECK-LABEL: @load_f32x2_unsigned
@@ -38,7 +75,7 @@ pub unsafe fn load_f32x2_unsigned(
// CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
// LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}})
// LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
- simd_masked_load(mask, pointer, values)
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
}
// CHECK-LABEL: @load_pf32x4
@@ -52,5 +89,5 @@ pub unsafe fn load_pf32x4(
// CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1>
// LLVM21: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}})
// LLVM22: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr align {{.*}} {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}})
- simd_masked_load(mask, pointer, values)
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
}
diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
index 03119d8..efeecee 100644
--- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
+++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
@@ -12,7 +12,7 @@
mod minisimd;
use minisimd::*;
-use std::intrinsics::simd::simd_masked_store;
+use std::intrinsics::simd::{SimdAlign, simd_masked_store};
pub type Vec2<T> = Simd<T, 2>;
pub type Vec4<T> = Simd<T, 4>;
@@ -23,8 +23,37 @@ pub unsafe fn store_f32x2(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>)
// CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
// CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
// LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 4, <2 x i1> [[B]])
+ // ^^^^^
// LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]])
- simd_masked_store(mask, pointer, values)
+ // ^^^^^^^
+ // the align parameter should be equal to the alignment of the element type (assumed to be 4)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
+}
+
+// CHECK-LABEL: @store_f32x2_aligned
+#[no_mangle]
+pub unsafe fn store_f32x2_aligned(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>) {
+ // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
+ // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
+ // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 8, <2 x i1> [[B]])
+ // ^^^^^
+ // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 8 {{.*}}, <2 x i1> [[B]])
+ // ^^^^^^^
+ // the align parameter should be equal to the size of the vector
+ simd_masked_store::<_, _, _, { SimdAlign::Vector }>(mask, pointer, values)
+}
+
+// CHECK-LABEL: @store_f32x2_unaligned
+#[no_mangle]
+pub unsafe fn store_f32x2_unaligned(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>) {
+ // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
+ // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
+ // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 1, <2 x i1> [[B]])
+ // ^^^^^
+ // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 1 {{.*}}, <2 x i1> [[B]])
+ // ^^^^^^^
+ // the align parameter should be 1
+ simd_masked_store::<_, _, _, { SimdAlign::Unaligned }>(mask, pointer, values)
}
// CHECK-LABEL: @store_f32x2_unsigned
@@ -34,7 +63,7 @@ pub unsafe fn store_f32x2_unsigned(mask: Vec2<u32>, pointer: *mut f32, values: V
// CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
// LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 4, <2 x i1> [[B]])
// LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]])
- simd_masked_store(mask, pointer, values)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
}
// CHECK-LABEL: @store_pf32x4
@@ -44,5 +73,5 @@ pub unsafe fn store_pf32x4(mask: Vec4<i32>, pointer: *mut *const f32, values: Ve
// CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1>
// LLVM21: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]])
// LLVM22: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr align {{.*}} {{.*}}, <4 x i1> [[B]])
- simd_masked_store(mask, pointer, values)
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values)
}
diff --git a/tests/codegen-llvm/slice-as_chunks.rs b/tests/codegen-llvm/slice-as_chunks.rs
index 337eb89..0f6ae21 100644
--- a/tests/codegen-llvm/slice-as_chunks.rs
+++ b/tests/codegen-llvm/slice-as_chunks.rs
@@ -19,7 +19,7 @@
// CHECK-LABEL: @chunks4_with_remainder
#[no_mangle]
pub fn chunks4_with_remainder(x: &[u8]) -> (&[[u8; 4]], &[u8]) {
- // CHECK-DAG: and i64 %x.1, -4
+ // CHECK-DAG: and i64 %x.1, [[#0x7FFFFFFFFFFFFFFC]]
// CHECK-DAG: and i64 %x.1, 3
// CHECK-DAG: lshr
// CHECK-NOT: mul
diff --git a/tests/codegen-llvm/slice-iter-nonnull.rs b/tests/codegen-llvm/slice-iter-nonnull.rs
index 87907e7..2805944 100644
--- a/tests/codegen-llvm/slice-iter-nonnull.rs
+++ b/tests/codegen-llvm/slice-iter-nonnull.rs
@@ -51,7 +51,7 @@ pub fn slice_iter_next_back<'a>(it: &mut std::slice::Iter<'a, u32>) -> Option<&'
// attribute is there, and confirms adding the assume back doesn't do anything.
// CHECK-LABEL: @slice_iter_new
-// CHECK-SAME: (ptr noalias noundef nonnull {{.+}} %slice.0, {{.+}} noundef %slice.1)
+// CHECK-SAME: (ptr noalias noundef nonnull {{.+}} %slice.0, {{.+}} noundef range({{.+}}) %slice.1)
#[no_mangle]
pub fn slice_iter_new(slice: &[u32]) -> std::slice::Iter<'_, u32> {
// CHECK-NOT: slice
@@ -66,7 +66,7 @@ pub fn slice_iter_new(slice: &[u32]) -> std::slice::Iter<'_, u32> {
}
// CHECK-LABEL: @slice_iter_mut_new
-// CHECK-SAME: (ptr noalias noundef nonnull {{.+}} %slice.0, {{.+}} noundef %slice.1)
+// CHECK-SAME: (ptr noalias noundef nonnull {{.+}} %slice.0, {{.+}} noundef range({{.+}}) %slice.1)
#[no_mangle]
pub fn slice_iter_mut_new(slice: &mut [u32]) -> std::slice::IterMut<'_, u32> {
// CHECK-NOT: slice
diff --git a/tests/codegen-llvm/slice-len-math.rs b/tests/codegen-llvm/slice-len-math.rs
new file mode 100644
index 0000000..4b7a6ad
--- /dev/null
+++ b/tests/codegen-llvm/slice-len-math.rs
@@ -0,0 +1,32 @@
+//@ compile-flags: -C opt-level=3
+#![crate_type = "lib"]
+
+#[no_mangle]
+// CHECK-LABEL: @len_plus_ten_a
+pub fn len_plus_ten_a(s: &[u8]) -> usize {
+ // CHECK: start:
+ // CHECK-NOT: add
+ // CHECK: %[[R:.+]] = add nuw i{{.+}} %s.1, 10
+ // CHECK-NEXT: ret {{.+}} %[[R]]
+ s.len().wrapping_add(10)
+}
+
+#[no_mangle]
+// CHECK-LABEL: @len_plus_ten_b
+pub fn len_plus_ten_b(s: &[u32]) -> usize {
+ // CHECK: start:
+ // CHECK-NOT: add
+ // CHECK: %[[R:.+]] = add nuw nsw i{{.+}} %s.1, 10
+ // CHECK-NEXT: ret {{.+}} %[[R]]
+ s.len().wrapping_add(10)
+}
+
+#[no_mangle]
+// CHECK-LABEL: @len_plus_len
+pub fn len_plus_len(x: &[u8], y: &[u8]) -> usize {
+ // CHECK: start:
+ // CHECK-NOT: add
+ // CHECK: %[[R:.+]] = add nuw i{{.+}} {{%x.1, %y.1|%y.1, %x.1}}
+ // CHECK-NEXT: ret {{.+}} %[[R]]
+ usize::wrapping_add(x.len(), y.len())
+}
diff --git a/tests/codegen-llvm/slice-ref-equality.rs b/tests/codegen-llvm/slice-ref-equality.rs
index 2940378..a5994c8 100644
--- a/tests/codegen-llvm/slice-ref-equality.rs
+++ b/tests/codegen-llvm/slice-ref-equality.rs
@@ -42,8 +42,8 @@
// equality for non-byte types also just emit a `bcmp`, not a loop.
// CHECK-LABEL: @eq_slice_of_nested_u8(
-// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1
-// CHECK-SAME: [[USIZE]] noundef %y.1
+// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef range({{.+}}) %x.1
+// CHECK-SAME: [[USIZE]] noundef range({{.+}}) %y.1
#[no_mangle]
fn eq_slice_of_nested_u8(x: &[[u8; 3]], y: &[[u8; 3]]) -> bool {
// CHECK: icmp eq [[USIZE]] %x.1, %y.1
@@ -54,8 +54,8 @@
}
// CHECK-LABEL: @eq_slice_of_i32(
-// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1
-// CHECK-SAME: [[USIZE]] noundef %y.1
+// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef range({{.+}}) %x.1
+// CHECK-SAME: [[USIZE]] noundef range({{.+}}) %y.1
#[no_mangle]
fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool {
// CHECK: icmp eq [[USIZE]] %x.1, %y.1
@@ -66,8 +66,8 @@ fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool {
}
// CHECK-LABEL: @eq_slice_of_nonzero(
-// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1
-// CHECK-SAME: [[USIZE]] noundef %y.1
+// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef range({{.+}}) %x.1
+// CHECK-SAME: [[USIZE]] noundef range({{.+}}) %y.1
#[no_mangle]
fn eq_slice_of_nonzero(x: &[NonZero<i32>], y: &[NonZero<i32>]) -> bool {
// CHECK: icmp eq [[USIZE]] %x.1, %y.1
@@ -78,8 +78,8 @@ fn eq_slice_of_nonzero(x: &[NonZero<i32>], y: &[NonZero<i32>]) -> bool {
}
// CHECK-LABEL: @eq_slice_of_option_of_nonzero(
-// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1
-// CHECK-SAME: [[USIZE]] noundef %y.1
+// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef range({{.+}}) %x.1
+// CHECK-SAME: [[USIZE]] noundef range({{.+}}) %y.1
#[no_mangle]
fn eq_slice_of_option_of_nonzero(x: &[Option<NonZero<i16>>], y: &[Option<NonZero<i16>>]) -> bool {
// CHECK: icmp eq [[USIZE]] %x.1, %y.1
diff --git a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff
index a4900a1..20923d0 100644
--- a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff
+++ b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff
@@ -61,17 +61,11 @@
StorageDead(_1);
return;
}
-+ }
-+
-+ ALLOC0 (size: 4, align: 4) {
-+ 00 00 00 00 │ ....
-+ }
-+
-+ ALLOC1 (size: 4, align: 4) {
-+ 04 00 00 00 │ ....
-+ }
-+
-+ ALLOC2 (size: 4, align: 4) {
-+ 01 00 11 00 │ ....
}
++
++ ALLOC0 (size: 4, align: 4) { .. }
++
++ ALLOC1 (size: 4, align: 4) { .. }
++
++ ALLOC2 (size: 4, align: 4) { .. }
diff --git a/tests/mir-opt/const_prop/invalid_constant.rs b/tests/mir-opt/const_prop/invalid_constant.rs
index b591037..901c372 100644
--- a/tests/mir-opt/const_prop/invalid_constant.rs
+++ b/tests/mir-opt/const_prop/invalid_constant.rs
@@ -1,6 +1,6 @@
// skip-filecheck
//@ test-mir-pass: GVN
-//@ compile-flags: -Zmir-enable-passes=+RemoveZsts
+//@ compile-flags: -Zmir-enable-passes=+RemoveZsts -Zdump-mir-exclude-alloc-bytes
// Verify that we can pretty print invalid constants.
#![feature(adt_const_params, unsized_const_params)]
diff --git a/tests/mir-opt/const_prop/union.main.GVN.diff b/tests/mir-opt/const_prop/union.main.GVN.diff
index 16a0432..4212a44 100644
--- a/tests/mir-opt/const_prop/union.main.GVN.diff
+++ b/tests/mir-opt/const_prop/union.main.GVN.diff
@@ -34,9 +34,7 @@
StorageDead(_1);
return;
}
-+ }
-+
-+ ALLOC0 (size: 4, align: 4) {
-+ 01 00 00 00 │ ....
}
++
++ ALLOC0 (size: 4, align: 4) { .. }
diff --git a/tests/mir-opt/const_prop/union.rs b/tests/mir-opt/const_prop/union.rs
index 9f197a1..fb822ff 100644
--- a/tests/mir-opt/const_prop/union.rs
+++ b/tests/mir-opt/const_prop/union.rs
@@ -1,6 +1,6 @@
//! Tests that we can propagate into places that are projections into unions
//@ test-mir-pass: GVN
-//@ compile-flags: -Zinline-mir
+//@ compile-flags: -Zinline-mir -Zdump-mir-exclude-alloc-bytes
fn val() -> u32 {
1
diff --git a/tests/mir-opt/copy-prop/branch.rs b/tests/mir-opt/copy-prop/branch.rs
index fc9b8dc..a26e224 100644
--- a/tests/mir-opt/copy-prop/branch.rs
+++ b/tests/mir-opt/copy-prop/branch.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we bail out when there are multiple assignments to the same local.
//@ test-mir-pass: CopyProp
@@ -12,6 +11,14 @@ fn cond() -> bool {
// EMIT_MIR branch.foo.CopyProp.diff
fn foo() -> i32 {
+ // CHECK-LABEL: fn foo(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: debug y => [[y:_.*]];
+ // CHECK: bb3: {
+ // CHECK: [[y]] = copy [[x]];
+ // CHECK: bb5: {
+ // CHECK: [[y]] = copy [[x]];
+ // CHECK: _0 = copy [[y]];
let x = val();
let y = if cond() {
diff --git a/tests/mir-opt/copy-prop/calls.rs b/tests/mir-opt/copy-prop/calls.rs
index 8937c0d..f19b114 100644
--- a/tests/mir-opt/copy-prop/calls.rs
+++ b/tests/mir-opt/copy-prop/calls.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// Check that CopyProp does propagate return values of call terminators.
//@ test-mir-pass: CopyProp
//@ needs-unwind
@@ -13,6 +12,13 @@ fn dummy(x: u8) -> u8 {
// EMIT_MIR calls.nrvo.CopyProp.diff
fn nrvo() -> u8 {
+ // CHECK-LABEL: fn nrvo(
+ // CHECK: debug y => _0;
+ // CHECK-NOT: StorageLive(_1);
+ // CHECK-NOT: _1 = dummy(const 5_u8)
+ // CHECK: _0 = dummy(const 5_u8)
+ // CHECK-NOT: _0 = copy _1;
+ // CHECK-NOT: StorageDead(_1);
let y = dummy(5); // this should get NRVO
y
}
@@ -20,6 +26,11 @@ fn nrvo() -> u8 {
// EMIT_MIR calls.multiple_edges.CopyProp.diff
#[custom_mir(dialect = "runtime", phase = "initial")]
fn multiple_edges(t: bool) -> u8 {
+ // CHECK-LABEL: fn multiple_edges(
+ // CHECK: bb1: {
+ // CHECK: _2 = dummy(const 13_u8)
+ // CHECK: bb2: {
+ // CHECK: _0 = copy _2;
mir! {
let x: u8;
{
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.rs b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
index e062e1e..6c234c3 100644
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that CopyProp does not propagate an assignment to a function argument
// (doing so can break usages of the original argument value)
@@ -9,25 +8,46 @@ fn dummy(x: u8) -> u8 {
// EMIT_MIR copy_propagation_arg.foo.CopyProp.diff
fn foo(mut x: u8) {
+ // CHECK-LABEL: fn foo(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: [[three:_.*]] = copy [[x]];
+ // CHECK: [[two:_.*]] = dummy(move [[three]])
+ // CHECK: [[x]] = move [[two]];
// calling `dummy` to make a use of `x` that copyprop cannot eliminate
x = dummy(x); // this will assign a local to `x`
}
// EMIT_MIR copy_propagation_arg.bar.CopyProp.diff
fn bar(mut x: u8) {
+ // CHECK-LABEL: fn bar(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: [[three:_.*]] = copy [[x]];
+ // CHECK: dummy(move [[three]])
+ // CHECK: [[x]] = const 5_u8;
dummy(x);
x = 5;
}
// EMIT_MIR copy_propagation_arg.baz.CopyProp.diff
fn baz(mut x: i32) -> i32 {
- // self-assignment to a function argument should be eliminated
+ // CHECK-LABEL: fn baz(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: [[x2:_.*]] = copy [[x]];
+ // CHECK: [[x]] = move [[x2]];
+ // CHECK: _0 = copy [[x]];
+ // In the original case for DestProp, the self-assignment to a function argument is eliminated,
+ // but in CopyProp it is not eliminated.
x = x;
x
}
// EMIT_MIR copy_propagation_arg.arg_src.CopyProp.diff
fn arg_src(mut x: i32) -> i32 {
+ // CHECK-LABEL: fn arg_src(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: debug y => [[y:_.*]];
+ // CHECK: [[y]] = copy [[x]];
+ // CHECK: [[x]] = const 123_i32;
let y = x;
x = 123; // Don't propagate this assignment to `y`
y
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs
index 3dce780..54490b0 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.rs
+++ b/tests/mir-opt/copy-prop/custom_move_arg.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: CopyProp
@@ -12,6 +11,13 @@
// EMIT_MIR custom_move_arg.f.CopyProp.diff
#[custom_mir(dialect = "runtime")]
fn f(_1: NotCopy) {
+ // CHECK-LABEL: fn f(
+ // CHECK: bb0: {
+ // CHECK-NOT: _2 = copy _1;
+ // CHECK: _0 = opaque::<NotCopy>(copy _1)
+ // CHECK: bb1: {
+ // CHECK-NOT: _3 = move _2;
+ // CHECK: _0 = opaque::<NotCopy>(copy _1)
mir! {
{
let _2 = _1;
diff --git a/tests/mir-opt/copy-prop/cycle.rs b/tests/mir-opt/copy-prop/cycle.rs
index 1c0c9ea..9f8312c 100644
--- a/tests/mir-opt/copy-prop/cycle.rs
+++ b/tests/mir-opt/copy-prop/cycle.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that cyclic assignments don't hang CopyProp, and result in reasonable code.
//@ test-mir-pass: CopyProp
@@ -8,6 +7,18 @@ fn val() -> i32 {
// EMIT_MIR cycle.main.CopyProp.diff
fn main() {
+ // CHECK-LABEL: fn main(
+ // CHECK: debug x => [[x:_.*]];
+ // CHECK: debug y => [[y:_.*]];
+ // CHECK: debug z => [[y]];
+ // CHECK-NOT: StorageLive([[y]]);
+ // CHECK: [[y]] = copy [[x]];
+ // CHECK-NOT: StorageLive(_3);
+ // CHECK-NOT: _3 = copy [[y]];
+ // CHECK-NOT: StorageLive(_4);
+ // CHECK-NOT: _4 = copy _3;
+ // CHECK-NOT: _1 = move _4;
+ // CHECK: [[x]] = copy [[y]];
let mut x = val();
let y = x;
let z = y;
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.rs b/tests/mir-opt/copy-prop/dead_stores_79191.rs
index 24420e1..016680b 100644
--- a/tests/mir-opt/copy-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: CopyProp
@@ -8,6 +7,14 @@ fn id<T>(x: T) -> T {
// EMIT_MIR dead_stores_79191.f.CopyProp.after.mir
fn f(mut a: usize) -> usize {
+ // CHECK-LABEL: fn f(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug b => [[b:_.*]];
+ // CHECK: [[b]] = copy [[a]];
+ // CHECK: [[a]] = const 5_usize;
+ // CHECK: [[a]] = copy [[b]];
+ // CHECK: [[c:_.*]] = copy [[a]]
+ // CHECK: id::<usize>(move [[c]])
let b = a;
a = 5;
a = b;
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir
deleted file mode 100644
index 4781fdf..0000000
--- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir
+++ /dev/null
@@ -1,26 +0,0 @@
-// MIR for `f` after CopyProp
-
-fn f(_1: usize) -> usize {
- debug a => _1;
- let mut _0: usize;
- let _2: usize;
- let mut _3: usize;
- let mut _4: usize;
- scope 1 {
- debug b => _2;
- }
-
- bb0: {
- _2 = copy _1;
- _1 = const 5_usize;
- _1 = copy _2;
- StorageLive(_4);
- _4 = copy _1;
- _0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable];
- }
-
- bb1: {
- StorageDead(_4);
- return;
- }
-}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir
deleted file mode 100644
index f5fded4..0000000
--- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir
+++ /dev/null
@@ -1,26 +0,0 @@
-// MIR for `f` after CopyProp
-
-fn f(_1: usize) -> usize {
- debug a => _1;
- let mut _0: usize;
- let _2: usize;
- let mut _3: usize;
- let mut _4: usize;
- scope 1 {
- debug b => _2;
- }
-
- bb0: {
- _2 = copy _1;
- _1 = const 5_usize;
- _1 = copy _2;
- StorageLive(_4);
- _4 = copy _1;
- _0 = id::<usize>(move _4) -> [return: bb1, unwind continue];
- }
-
- bb1: {
- StorageDead(_4);
- return;
- }
-}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.rs b/tests/mir-opt/copy-prop/dead_stores_better.rs
deleted file mode 100644
index 4b18742..0000000
--- a/tests/mir-opt/copy-prop/dead_stores_better.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// skip-filecheck
-// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
-// This is a copy of the `dead_stores_79191` test, except that we turn on DSE. This demonstrates
-// that that pass enables this one to do more optimizations.
-
-//@ test-mir-pass: CopyProp
-//@ compile-flags: -Zmir-enable-passes=+DeadStoreElimination
-
-fn id<T>(x: T) -> T {
- x
-}
-
-// EMIT_MIR dead_stores_better.f.CopyProp.after.mir
-pub fn f(mut a: usize) -> usize {
- let b = a;
- a = 5;
- a = b;
- id(a)
-}
-
-fn main() {
- f(0);
-}
diff --git a/tests/mir-opt/copy-prop/issue_107511.rs b/tests/mir-opt/copy-prop/issue_107511.rs
index 5e8fc8d..d345d2d 100644
--- a/tests/mir-opt/copy-prop/issue_107511.rs
+++ b/tests/mir-opt/copy-prop/issue_107511.rs
@@ -1,9 +1,12 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: CopyProp
// EMIT_MIR issue_107511.main.CopyProp.diff
fn main() {
+ // CHECK-LABEL: fn main(
+ // CHECK: debug i => [[i:_.*]];
+ // CHECK-NOT: StorageLive([[i]]);
+ // CHECK-NOT: StorageDead([[i]]);
let mut sum = 0;
let a = [0, 10, 20, 30];
diff --git a/tests/mir-opt/copy-prop/move_arg.rs b/tests/mir-opt/copy-prop/move_arg.rs
index 4983405..b7adae3 100644
--- a/tests/mir-opt/copy-prop/move_arg.rs
+++ b/tests/mir-opt/copy-prop/move_arg.rs
@@ -1,10 +1,13 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that we do not move multiple times from the same local.
//@ test-mir-pass: CopyProp
// EMIT_MIR move_arg.f.CopyProp.diff
pub fn f<T: Copy>(a: T) {
+ // CHECK-LABEL: fn f(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug b => [[a]];
+ // CHECK: g::<T>(copy [[a]], copy [[a]])
let b = a;
g(a, b);
}
diff --git a/tests/mir-opt/copy-prop/move_projection.rs b/tests/mir-opt/copy-prop/move_projection.rs
index 0ac1c4e..73473ee7 100644
--- a/tests/mir-opt/copy-prop/move_projection.rs
+++ b/tests/mir-opt/copy-prop/move_projection.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: CopyProp
@@ -15,6 +14,15 @@ fn opaque(_: impl Sized) -> bool {
#[custom_mir(dialect = "runtime")]
fn f(a: Foo) -> bool {
+ // CHECK-LABEL: fn f(
+ // CHECK-SAME: [[a:_.*]]: Foo)
+ // CHECK: bb0: {
+ // CHECK-NOT: _2 = copy [[a]];
+ // CHECK-NOT: _3 = move (_2.0: u8);
+ // CHECK: [[c:_.*]] = copy ([[a]].0: u8);
+ // CHECK: _0 = opaque::<Foo>(copy [[a]])
+ // CHECK: bb1: {
+ // CHECK: _0 = opaque::<u8>(move [[c]])
mir! {
{
let b = a;
diff --git a/tests/mir-opt/copy-prop/mutate_through_pointer.rs b/tests/mir-opt/copy-prop/mutate_through_pointer.rs
index 53cca04..7523da8 100644
--- a/tests/mir-opt/copy-prop/mutate_through_pointer.rs
+++ b/tests/mir-opt/copy-prop/mutate_through_pointer.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
//@ test-mir-pass: CopyProp
//
// This attempts to mutate `a` via a pointer derived from `addr_of!(a)`. That is UB
@@ -18,6 +17,10 @@
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
fn f(c: bool) -> bool {
+ // CHECK-LABEL: fn f(
+ // CHECK: _2 = copy _1;
+ // CHECK-NOT: _3 = &raw const _1;
+ // CHECK: _3 = &raw const _2;
mir! {
{
let a = c;
diff --git a/tests/mir-opt/copy-prop/non_dominate.rs b/tests/mir-opt/copy-prop/non_dominate.rs
index c012753..a6db10c 100644
--- a/tests/mir-opt/copy-prop/non_dominate.rs
+++ b/tests/mir-opt/copy-prop/non_dominate.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
//@ test-mir-pass: CopyProp
#![feature(custom_mir, core_intrinsics)]
@@ -8,6 +7,11 @@
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
fn f(c: bool) -> bool {
+ // CHECK-LABEL: fn f(
+ // CHECK: bb2: {
+ // CHECK: _2 = copy _3;
+ // CHECK: bb3: {
+ // CHECK: _0 = copy _2;
mir! {
let a: bool;
let b: bool;
diff --git a/tests/mir-opt/copy-prop/partial_init.rs b/tests/mir-opt/copy-prop/partial_init.rs
index 88e9498..0135d7c3 100644
--- a/tests/mir-opt/copy-prop/partial_init.rs
+++ b/tests/mir-opt/copy-prop/partial_init.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
//@ test-mir-pass: CopyProp
// Verify that we do not ICE on partial initializations.
@@ -9,6 +8,9 @@
// EMIT_MIR partial_init.main.CopyProp.diff
#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
pub fn main() {
+ // CHECK-LABEL: fn main(
+ // CHECK: let mut [[x:_.*]]: (isize,);
+ // CHECK: ([[x]].0: isize) = const 1_isize;
mir! (
let x: (isize, );
{
diff --git a/tests/mir-opt/copy-prop/reborrow.rs b/tests/mir-opt/copy-prop/reborrow.rs
index 51a1f92..8bc8110 100644
--- a/tests/mir-opt/copy-prop/reborrow.rs
+++ b/tests/mir-opt/copy-prop/reborrow.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that CopyProp considers reborrows as not mutating the pointer.
//@ test-mir-pass: CopyProp
@@ -8,6 +7,9 @@ fn opaque(_: impl Sized) {}
// EMIT_MIR reborrow.remut.CopyProp.diff
fn remut(mut x: u8) {
+ // CHECK-LABEL: fn remut(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug c => [[a]];
let a = &mut x;
let b = &mut *a; //< this cannot mutate a.
let c = a; //< so `c` and `a` can be merged.
@@ -16,6 +18,9 @@ fn remut(mut x: u8) {
// EMIT_MIR reborrow.reraw.CopyProp.diff
fn reraw(mut x: u8) {
+ // CHECK-LABEL: fn reraw(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug c => [[a]];
let a = &mut x;
let b = &raw mut *a; //< this cannot mutate a.
let c = a; //< so `c` and `a` can be merged.
@@ -24,6 +29,9 @@ fn reraw(mut x: u8) {
// EMIT_MIR reborrow.miraw.CopyProp.diff
fn miraw(mut x: u8) {
+ // CHECK-LABEL: fn miraw(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug c => [[a]];
let a = &raw mut x;
let b = unsafe { &raw mut *a }; //< this cannot mutate a.
let c = a; //< so `c` and `a` can be merged.
@@ -32,6 +40,9 @@ fn miraw(mut x: u8) {
// EMIT_MIR reborrow.demiraw.CopyProp.diff
fn demiraw(mut x: u8) {
+ // CHECK-LABEL: fn demiraw(
+ // CHECK: debug a => [[a:_.*]];
+ // CHECK: debug c => [[a]];
let a = &raw mut x;
let b = unsafe { &mut *a }; //< this cannot mutate a.
let c = a; //< so `c` and `a` can be merged.
diff --git a/tests/mir-opt/gvn_loop.loop_deref_mut.GVN.diff b/tests/mir-opt/gvn_loop.loop_deref_mut.GVN.diff
index 92e5cca..e5d719c 100644
--- a/tests/mir-opt/gvn_loop.loop_deref_mut.GVN.diff
+++ b/tests/mir-opt/gvn_loop.loop_deref_mut.GVN.diff
@@ -107,9 +107,7 @@
StorageDead(_11);
goto -> bb4;
}
-+ }
-+
-+ ALLOC0 (size: 8, align: 4) {
-+ 01 00 00 00 __ __ __ __ │ ....░░░░
}
++
++ ALLOC0 (size: 8, align: 4) { .. }
diff --git a/tests/mir-opt/gvn_loop.rs b/tests/mir-opt/gvn_loop.rs
index 6e9df55..4a94d516 100644
--- a/tests/mir-opt/gvn_loop.rs
+++ b/tests/mir-opt/gvn_loop.rs
@@ -1,4 +1,5 @@
//@ test-mir-pass: GVN
+//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
#![crate_type = "lib"]
#![feature(core_intrinsics, rustc_attrs)]
diff --git a/tests/run-make/rustdoc-scrape-examples-dep-info/examples/ex.rs b/tests/run-make/rustdoc-scrape-examples-dep-info/examples/ex.rs
new file mode 100644
index 0000000..c37b8dd
--- /dev/null
+++ b/tests/run-make/rustdoc-scrape-examples-dep-info/examples/ex.rs
@@ -0,0 +1,6 @@
+fn main() {}
+
+#[test]
+fn a_test() {
+ foobar::ok();
+}
diff --git a/tests/run-make/rustdoc-scrape-examples-dep-info/rmake.rs b/tests/run-make/rustdoc-scrape-examples-dep-info/rmake.rs
new file mode 100644
index 0000000..00a8747
--- /dev/null
+++ b/tests/run-make/rustdoc-scrape-examples-dep-info/rmake.rs
@@ -0,0 +1,19 @@
+//@ needs-target-std
+use run_make_support::{assert_contains, rfs};
+
+#[path = "../rustdoc-scrape-examples-remap/scrape.rs"]
+mod scrape;
+
+fn main() {
+ scrape::scrape(
+ &["--scrape-tests", "--emit=dep-info"],
+ &["--emit=dep-info,invocation-specific"],
+ );
+
+ let content = rfs::read_to_string("foobar.d").replace(r"\", "/");
+ assert_contains(&content, "lib.rs:");
+ assert_contains(&content, "rustdoc/ex.calls:");
+
+ let content = rfs::read_to_string("ex.d").replace(r"\", "/");
+ assert_contains(&content, "examples/ex.rs:");
+}
diff --git a/tests/run-make/rustdoc-scrape-examples-dep-info/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-dep-info/src/lib.rs
new file mode 100644
index 0000000..93d56b7
--- /dev/null
+++ b/tests/run-make/rustdoc-scrape-examples-dep-info/src/lib.rs
@@ -0,0 +1,3 @@
+//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' ''
+
+pub fn ok() {}
diff --git a/tests/run-make/rustdoc-scrape-examples-invalid-expr/rmake.rs b/tests/run-make/rustdoc-scrape-examples-invalid-expr/rmake.rs
index 8996ff1..38943b6 100644
--- a/tests/run-make/rustdoc-scrape-examples-invalid-expr/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-invalid-expr/rmake.rs
@@ -3,5 +3,5 @@
mod scrape;
fn main() {
- scrape::scrape(&[]);
+ scrape::scrape(&[], &[]);
}
diff --git a/tests/run-make/rustdoc-scrape-examples-multiple/rmake.rs b/tests/run-make/rustdoc-scrape-examples-multiple/rmake.rs
index 8996ff1..38943b6 100644
--- a/tests/run-make/rustdoc-scrape-examples-multiple/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-multiple/rmake.rs
@@ -3,5 +3,5 @@
mod scrape;
fn main() {
- scrape::scrape(&[]);
+ scrape::scrape(&[], &[]);
}
diff --git a/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs b/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
index 8996ff1..38943b6 100644
--- a/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
@@ -3,5 +3,5 @@
mod scrape;
fn main() {
- scrape::scrape(&[]);
+ scrape::scrape(&[], &[]);
}
diff --git a/tests/run-make/rustdoc-scrape-examples-remap/rmake.rs b/tests/run-make/rustdoc-scrape-examples-remap/rmake.rs
index ead3920..920a65d 100644
--- a/tests/run-make/rustdoc-scrape-examples-remap/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-remap/rmake.rs
@@ -2,5 +2,5 @@
mod scrape;
fn main() {
- scrape::scrape(&[]);
+ scrape::scrape(&[], &[]);
}
diff --git a/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs b/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
index c4d7814..668cb37 100644
--- a/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
+++ b/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
@@ -2,7 +2,7 @@
use run_make_support::{htmldocck, rfs, rustc, rustdoc};
-pub fn scrape(extra_args: &[&str]) {
+pub fn scrape(extra_args_scrape: &[&str], extra_args_doc: &[&str]) {
let out_dir = Path::new("rustdoc");
let crate_name = "foobar";
let deps = rfs::read_dir("examples")
@@ -27,7 +27,7 @@ pub fn scrape(extra_args: &[&str]) {
.arg(&out_example)
.arg("--scrape-examples-target-crate")
.arg(crate_name)
- .args(extra_args)
+ .args(extra_args_scrape)
.run();
out_deps.push(out_example);
}
@@ -42,6 +42,7 @@ pub fn scrape(extra_args: &[&str]) {
for dep in out_deps {
rustdoc.arg("--with-examples").arg(dep);
}
+ rustdoc.args(extra_args_doc);
rustdoc.run();
htmldocck().arg(out_dir).arg("src/lib.rs").run();
diff --git a/tests/run-make/rustdoc-scrape-examples-test/rmake.rs b/tests/run-make/rustdoc-scrape-examples-test/rmake.rs
index 0868507..c0c4df9 100644
--- a/tests/run-make/rustdoc-scrape-examples-test/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-test/rmake.rs
@@ -3,5 +3,5 @@
mod scrape;
fn main() {
- scrape::scrape(&["--scrape-tests"]);
+ scrape::scrape(&["--scrape-tests"], &[]);
}
diff --git a/tests/run-make/rustdoc-scrape-examples-whitespace/rmake.rs b/tests/run-make/rustdoc-scrape-examples-whitespace/rmake.rs
index 8996ff1..38943b6 100644
--- a/tests/run-make/rustdoc-scrape-examples-whitespace/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-whitespace/rmake.rs
@@ -3,5 +3,5 @@
mod scrape;
fn main() {
- scrape::scrape(&[]);
+ scrape::scrape(&[], &[]);
}
diff --git a/tests/run-make/rustdoc-target-modifiers/rmake.rs b/tests/run-make/rustdoc-target-modifiers/rmake.rs
index ee52250..ffe87f3 100644
--- a/tests/run-make/rustdoc-target-modifiers/rmake.rs
+++ b/tests/run-make/rustdoc-target-modifiers/rmake.rs
@@ -25,4 +25,43 @@ fn main() {
.target("aarch64-unknown-none-softfloat")
.arg("-Zfixed-x18")
.run();
+
+ rustdoc()
+ .input("c.rs")
+ .crate_type("rlib")
+ .extern_("d", "libd.rmeta")
+ .target("aarch64-unknown-none-softfloat")
+ .arg("-Zfixed-x18")
+ .arg("--test")
+ .run();
+
+ rustdoc()
+ .input("c.rs")
+ .edition("2024")
+ .crate_type("rlib")
+ .extern_("d", "libd.rmeta")
+ .target("aarch64-unknown-none-softfloat")
+ .arg("-Zfixed-x18")
+ .arg("--test")
+ .run();
+
+ // rustdoc --test detects ABI mismatch
+ rustdoc()
+ .input("c.rs")
+ .crate_type("rlib")
+ .extern_("d", "libd.rmeta")
+ .target("aarch64-unknown-none-softfloat")
+ .arg("--test")
+ .run_fail()
+ .assert_stderr_contains("mixing `-Zfixed-x18` will cause an ABI mismatch");
+
+ // rustdoc --test -Cunsafe-allow-abi-mismatch=... ignores the mismatch
+ rustdoc()
+ .input("c.rs")
+ .crate_type("rlib")
+ .extern_("d", "libd.rmeta")
+ .target("aarch64-unknown-none-softfloat")
+ .arg("--test")
+ .arg("-Cunsafe-allow-abi-mismatch=fixed-x18")
+ .run();
}
diff --git a/tests/ui/abi/pass-indirectly-attr.rs b/tests/ui/abi/pass-indirectly-attr.rs
new file mode 100644
index 0000000..54aafc7
--- /dev/null
+++ b/tests/ui/abi/pass-indirectly-attr.rs
@@ -0,0 +1,38 @@
+//@ add-minicore
+//@ check-fail
+//@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED"
+//@ ignore-backends: gcc
+
+#![feature(rustc_attrs)]
+#![crate_type = "lib"]
+#![feature(no_core)]
+#![no_std]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+#[repr(C)]
+#[rustc_pass_indirectly_in_non_rustic_abis]
+pub struct Type(u8);
+
+#[rustc_abi(debug)]
+pub extern "C" fn extern_c(_: Type) {}
+//~^ ERROR fn_abi_of(extern_c) = FnAbi {
+//~| ERROR mode: Indirect
+//~| ERROR on_stack: false,
+//~| ERROR conv: C,
+
+#[rustc_abi(debug)]
+pub extern "Rust" fn extern_rust(_: Type) {}
+//~^ ERROR fn_abi_of(extern_rust) = FnAbi {
+//~| ERROR mode: Cast
+//~| ERROR conv: Rust
+
+#[repr(transparent)]
+struct Inner(u64);
+
+#[rustc_pass_indirectly_in_non_rustic_abis]
+//~^ ERROR transparent struct cannot have other repr hints
+#[repr(transparent)]
+struct Wrapper(Inner);
diff --git a/tests/ui/abi/pass-indirectly-attr.stderr b/tests/ui/abi/pass-indirectly-attr.stderr
new file mode 100644
index 0000000..a93982d
--- /dev/null
+++ b/tests/ui/abi/pass-indirectly-attr.stderr
@@ -0,0 +1,194 @@
+error[E0692]: transparent struct cannot have other repr hints
+ --> $DIR/pass-indirectly-attr.rs:35:1
+ |
+LL | #[rustc_pass_indirectly_in_non_rustic_abis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | struct Wrapper(Inner);
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: fn_abi_of(extern_c) = FnAbi {
+ args: [
+ ArgAbi {
+ layout: TyAndLayout {
+ ty: Type,
+ layout: Layout {
+ size: Size(1 bytes),
+ align: AbiAlign {
+ abi: Align(1 bytes),
+ },
+ backend_repr: Memory {
+ sized: true,
+ },
+ fields: Arbitrary {
+ offsets: [
+ Size(0 bytes),
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ largest_niche: None,
+ uninhabited: false,
+ variants: Single {
+ index: 0,
+ },
+ max_repr_align: None,
+ unadjusted_abi_align: Align(1 bytes),
+ randomization_seed: $SEED,
+ },
+ },
+ mode: Indirect {
+ attrs: ArgAttributes {
+ regular: CapturesAddress | NoAlias | NonNull | NoUndef,
+ arg_ext: None,
+ pointee_size: Size(1 bytes),
+ pointee_align: Some(
+ Align(1 bytes),
+ ),
+ },
+ meta_attrs: None,
+ on_stack: false,
+ },
+ },
+ ],
+ ret: ArgAbi {
+ layout: TyAndLayout {
+ ty: (),
+ layout: Layout {
+ size: Size(0 bytes),
+ align: AbiAlign {
+ abi: Align(1 bytes),
+ },
+ backend_repr: Memory {
+ sized: true,
+ },
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ largest_niche: None,
+ uninhabited: false,
+ variants: Single {
+ index: 0,
+ },
+ max_repr_align: None,
+ unadjusted_abi_align: Align(1 bytes),
+ randomization_seed: $SEED,
+ },
+ },
+ mode: Ignore,
+ },
+ c_variadic: false,
+ fixed_count: 1,
+ conv: C,
+ can_unwind: false,
+ }
+ --> $DIR/pass-indirectly-attr.rs:20:1
+ |
+LL | pub extern "C" fn extern_c(_: Type) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: fn_abi_of(extern_rust) = FnAbi {
+ args: [
+ ArgAbi {
+ layout: TyAndLayout {
+ ty: Type,
+ layout: Layout {
+ size: Size(1 bytes),
+ align: AbiAlign {
+ abi: Align(1 bytes),
+ },
+ backend_repr: Memory {
+ sized: true,
+ },
+ fields: Arbitrary {
+ offsets: [
+ Size(0 bytes),
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ largest_niche: None,
+ uninhabited: false,
+ variants: Single {
+ index: 0,
+ },
+ max_repr_align: None,
+ unadjusted_abi_align: Align(1 bytes),
+ randomization_seed: $SEED,
+ },
+ },
+ mode: Cast {
+ pad_i32: false,
+ cast: CastTarget {
+ prefix: [
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ ],
+ rest_offset: None,
+ rest: Uniform {
+ unit: Reg {
+ kind: Integer,
+ size: Size(1 bytes),
+ },
+ total: Size(1 bytes),
+ is_consecutive: false,
+ },
+ attrs: ArgAttributes {
+ regular: ,
+ arg_ext: None,
+ pointee_size: Size(0 bytes),
+ pointee_align: None,
+ },
+ },
+ },
+ },
+ ],
+ ret: ArgAbi {
+ layout: TyAndLayout {
+ ty: (),
+ layout: Layout {
+ size: Size(0 bytes),
+ align: AbiAlign {
+ abi: Align(1 bytes),
+ },
+ backend_repr: Memory {
+ sized: true,
+ },
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ largest_niche: None,
+ uninhabited: false,
+ variants: Single {
+ index: 0,
+ },
+ max_repr_align: None,
+ unadjusted_abi_align: Align(1 bytes),
+ randomization_seed: $SEED,
+ },
+ },
+ mode: Ignore,
+ },
+ c_variadic: false,
+ fixed_count: 1,
+ conv: Rust,
+ can_unwind: false,
+ }
+ --> $DIR/pass-indirectly-attr.rs:27:1
+ |
+LL | pub extern "Rust" fn extern_rust(_: Type) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0692`.
diff --git a/tests/ui/associated-item/associated-item-duplicate-bounds.stderr b/tests/ui/associated-item/associated-item-duplicate-bounds.stderr
index 8898880..9f8faf9 100644
--- a/tests/ui/associated-item/associated-item-duplicate-bounds.stderr
+++ b/tests/ui/associated-item/associated-item-duplicate-bounds.stderr
@@ -2,7 +2,7 @@
--> $DIR/associated-item-duplicate-bounds.rs:7:18
|
LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
- | ^^^^^^^^ cannot perform const operation using `A`
+ | ^ cannot perform const operation using `A`
|
= note: type parameters may not be used in const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
diff --git a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr
index 95f3142..dd0f4da 100644
--- a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr
+++ b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr
@@ -25,6 +25,8 @@
LL | fn needs_async_fn(_: impl AsyncFn()) {}
| -------------- change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = 1;
+ | ----- `x` declared here, outside the closure
LL | needs_async_fn(async || {
| -------------- ^^^^^^^^
| | |
diff --git a/tests/ui/attributes/pass-indirectly.rs b/tests/ui/attributes/pass-indirectly.rs
new file mode 100644
index 0000000..0eacffb
--- /dev/null
+++ b/tests/ui/attributes/pass-indirectly.rs
@@ -0,0 +1,15 @@
+//@ check-fail
+
+#![feature(rustc_attrs)]
+#![crate_type = "lib"]
+
+#[rustc_pass_indirectly_in_non_rustic_abis]
+//~^ ERROR: `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute cannot be used on functions
+fn not_a_struct() {}
+
+#[repr(C)]
+#[rustc_pass_indirectly_in_non_rustic_abis]
+struct YesAStruct {
+ foo: u8,
+ bar: u16,
+}
diff --git a/tests/ui/attributes/pass-indirectly.stderr b/tests/ui/attributes/pass-indirectly.stderr
new file mode 100644
index 0000000..2011f3d
--- /dev/null
+++ b/tests/ui/attributes/pass-indirectly.stderr
@@ -0,0 +1,10 @@
+error: `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute cannot be used on functions
+ --> $DIR/pass-indirectly.rs:6:1
+ |
+LL | #[rustc_pass_indirectly_in_non_rustic_abis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: `#[rustc_pass_indirectly_in_non_rustic_abis]` can only be applied to structs
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/borrowck/borrow-immutable-upvar-mutation.stderr b/tests/ui/borrowck/borrow-immutable-upvar-mutation.stderr
index a0eaf1f..4e40ebf 100644
--- a/tests/ui/borrowck/borrow-immutable-upvar-mutation.stderr
+++ b/tests/ui/borrowck/borrow-immutable-upvar-mutation.stderr
@@ -4,6 +4,8 @@
LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F {
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = 0;
+ | ----- `x` declared here, outside the closure
LL | let _f = to_fn(|| x = 42);
| ----- -- ^^^^^^ cannot assign
| | |
@@ -16,6 +18,8 @@
LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F {
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut y = 0;
+ | ----- `y` declared here, outside the closure
LL | let _g = to_fn(|| set(&mut y));
| ----- -- ^^^^^^ cannot borrow as mutable
| | |
@@ -28,6 +32,9 @@
LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F {
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut z = 0;
+ | ----- `z` declared here, outside the closure
+...
LL | to_fn(|| z = 42);
| ----- -- ^^^^^^ cannot assign
| | |
diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
index f81a8c9..c4b9795 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
+++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
@@ -40,6 +40,8 @@
LL | fn make_fn<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = 0;
+ | ----- `x` declared here, outside the closure
LL | let f = make_fn(|| {
| ------- -- in this closure
| |
diff --git a/tests/ui/borrowck/mut-borrow-of-mut-ref.rs b/tests/ui/borrowck/mut-borrow-of-mut-ref.rs
index 477a2aa..3395459 100644
--- a/tests/ui/borrowck/mut-borrow-of-mut-ref.rs
+++ b/tests/ui/borrowck/mut-borrow-of-mut-ref.rs
@@ -2,22 +2,24 @@
#![crate_type = "rlib"]
pub fn f(b: &mut i32) {
- //~^ ERROR cannot borrow
- //~| NOTE not mutable
- //~| NOTE the binding is already a mutable borrow
+ //~^ ERROR: cannot borrow
+ //~| NOTE: not mutable
+ //~| NOTE: the binding is already a mutable borrow
+ //~| HELP: consider making the binding mutable if you need to reborrow multiple times
h(&mut b);
- //~^ NOTE cannot borrow as mutable
- //~| HELP try removing `&mut` here
+ //~^ NOTE: cannot borrow as mutable
+ //~| HELP: if there is only one mutable reborrow, remove the `&mut`
g(&mut &mut b);
- //~^ NOTE cannot borrow as mutable
- //~| HELP try removing `&mut` here
+ //~^ NOTE: cannot borrow as mutable
+ //~| HELP: if there is only one mutable reborrow, remove the `&mut`
}
-pub fn g(b: &mut i32) { //~ NOTE the binding is already a mutable borrow
+pub fn g(b: &mut i32) { //~ NOTE: the binding is already a mutable borrow
+ //~^ HELP: consider making the binding mutable if you need to reborrow multiple times
h(&mut &mut b);
- //~^ ERROR cannot borrow
- //~| NOTE cannot borrow as mutable
- //~| HELP try removing `&mut` here
+ //~^ ERROR: cannot borrow
+ //~| NOTE: cannot borrow as mutable
+ //~| HELP: if there is only one mutable reborrow, remove the `&mut`
}
pub fn h(_: &mut i32) {}
diff --git a/tests/ui/borrowck/mut-borrow-of-mut-ref.stderr b/tests/ui/borrowck/mut-borrow-of-mut-ref.stderr
index f448e00..4c4a5e7 100644
--- a/tests/ui/borrowck/mut-borrow-of-mut-ref.stderr
+++ b/tests/ui/borrowck/mut-borrow-of-mut-ref.stderr
@@ -15,36 +15,44 @@
|
LL | pub fn f(b: &mut i32) {
| ^^^^^^^^
-help: try removing `&mut` here
+help: consider making the binding mutable if you need to reborrow multiple times
+ |
+LL | pub fn f(mut b: &mut i32) {
+ | +++
+help: if there is only one mutable reborrow, remove the `&mut`
|
LL - h(&mut b);
LL + h(b);
|
-help: try removing `&mut` here
+help: if there is only one mutable reborrow, remove the `&mut`
|
LL - g(&mut &mut b);
LL + g(&mut b);
|
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
- --> $DIR/mut-borrow-of-mut-ref.rs:17:12
+ --> $DIR/mut-borrow-of-mut-ref.rs:19:12
|
LL | h(&mut &mut b);
| ^^^^^^ cannot borrow as mutable
|
note: the binding is already a mutable borrow
- --> $DIR/mut-borrow-of-mut-ref.rs:16:13
+ --> $DIR/mut-borrow-of-mut-ref.rs:17:13
|
LL | pub fn g(b: &mut i32) {
| ^^^^^^^^
-help: try removing `&mut` here
+help: consider making the binding mutable if you need to reborrow multiple times
+ |
+LL | pub fn g(mut b: &mut i32) {
+ | +++
+help: if there is only one mutable reborrow, remove the `&mut`
|
LL - h(&mut &mut b);
LL + h(&mut b);
|
error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
- --> $DIR/mut-borrow-of-mut-ref.rs:34:5
+ --> $DIR/mut-borrow-of-mut-ref.rs:36:5
|
LL | f.bar();
| ^ cannot borrow as mutable
diff --git a/tests/ui/borrowck/mutability-errors.stderr b/tests/ui/borrowck/mutability-errors.stderr
index 3cab3cc..7307e1f 100644
--- a/tests/ui/borrowck/mutability-errors.stderr
+++ b/tests/ui/borrowck/mutability-errors.stderr
@@ -139,7 +139,9 @@
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
-...
+LL |
+LL | fn ref_closure(mut x: (i32,)) {
+ | ----- `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
@@ -152,7 +154,9 @@
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
-...
+LL |
+LL | fn ref_closure(mut x: (i32,)) {
+ | ----- `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
@@ -166,7 +170,9 @@
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
-...
+LL |
+LL | fn ref_closure(mut x: (i32,)) {
+ | ----- `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
@@ -180,7 +186,9 @@
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
-...
+LL |
+LL | fn ref_closure(mut x: (i32,)) {
+ | ----- `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
diff --git a/tests/ui/check-cfg/my-awesome-platform.json b/tests/ui/check-cfg/my-awesome-platform.json
index 3a1f6b1..c3b3b89 100644
--- a/tests/ui/check-cfg/my-awesome-platform.json
+++ b/tests/ui/check-cfg/my-awesome-platform.json
@@ -1,7 +1,7 @@
{
"llvm-target": "x86_64-unknown-none-gnu",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
- "arch": "x86_64",
+ "arch": "tamirdarch",
"target-endian": "little",
"target-pointer-width": 64,
"os": "ericos",
diff --git a/tests/ui/check-cfg/values-target-json.rs b/tests/ui/check-cfg/values-target-json.rs
index ddfcb24..2912c83 100644
--- a/tests/ui/check-cfg/values-target-json.rs
+++ b/tests/ui/check-cfg/values-target-json.rs
@@ -6,14 +6,19 @@
//@ needs-llvm-components: x86
//@ compile-flags: --crate-type=lib --check-cfg=cfg() --target={{src-base}}/check-cfg/my-awesome-platform.json
-#![feature(lang_items, no_core, auto_traits)]
+#![feature(lang_items, no_core, auto_traits, rustc_attrs)]
#![no_core]
extern crate minicore;
use minicore::*;
-#[cfg(target_os = "linux")]
-fn target_os_linux() {}
+#[rustc_builtin_macro]
+macro_rules! compile_error {
+ () => {};
+}
-#[cfg(target_os = "ericos")]
-fn target_os_ericos() {}
+#[cfg(not(target_os = "ericos"))]
+compile_error!("target_os from target JSON not wired through");
+
+#[cfg(not(target_arch = "tamirdarch"))]
+compile_error!("target_arch from target JSON not wired through");
diff --git a/tests/ui/closures/aliasability-violation-with-closure-21600.stderr b/tests/ui/closures/aliasability-violation-with-closure-21600.stderr
index 2d2397a..2f4135b 100644
--- a/tests/ui/closures/aliasability-violation-with-closure-21600.stderr
+++ b/tests/ui/closures/aliasability-violation-with-closure-21600.stderr
@@ -4,6 +4,9 @@
LL | fn call_it<F>(f: F) where F: Fn() { f(); }
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = A;
+ | ----- `x` declared here, outside the closure
+...
LL | call_it(|| x.gen_mut());
| ------- -- ^ cannot borrow as mutable
| | |
@@ -16,6 +19,8 @@
LL | fn call_it<F>(f: F) where F: Fn() { f(); }
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = A;
+ | ----- `x` declared here, outside the closure
LL | call_it(|| {
| ------- -- in this closure
| |
diff --git a/tests/ui/closures/wrong-closure-arg-suggestion-125325.stderr b/tests/ui/closures/wrong-closure-arg-suggestion-125325.stderr
index e0cce8c..f419f7c 100644
--- a/tests/ui/closures/wrong-closure-arg-suggestion-125325.stderr
+++ b/tests/ui/closures/wrong-closure-arg-suggestion-125325.stderr
@@ -4,6 +4,8 @@
LL | fn assoc_func(&self, _f: impl Fn()) -> usize {
| --------- change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = ();
+ | ----- `x` declared here, outside the closure
LL | s.assoc_func(|| x = ());
| --------------^^^^^^-
| | | |
@@ -17,6 +19,9 @@
LL | fn func(_f: impl Fn()) -> usize {
| --------- change this to accept `FnMut` instead of `Fn`
...
+LL | let mut x = ();
+ | ----- `x` declared here, outside the closure
+...
LL | func(|| x = ())
| ---- -- ^^^^^^ cannot assign
| | |
diff --git a/tests/ui/const-generics/argument_order.rs b/tests/ui/const-generics/argument_order.rs
index 196d9b8..f8980c9 100644
--- a/tests/ui/const-generics/argument_order.rs
+++ b/tests/ui/const-generics/argument_order.rs
@@ -1,15 +1,17 @@
-struct Bad<const N: usize, T> {
+//@ reference: items.generics.syntax.decl-order
+
+struct Good<const N: usize, T> {
arr: [u8; { N }],
another: T,
}
-struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
+struct Bad<const N: usize, 'a, T, 'b, const M: usize, U> {
//~^ ERROR lifetime parameters must be declared prior
a: &'a T,
b: &'b U,
}
fn main() {
- let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
+ let _: Bad<7, 'static, u32, 'static, 17, u16>;
//~^ ERROR lifetime provided when a type was expected
}
diff --git a/tests/ui/const-generics/argument_order.stderr b/tests/ui/const-generics/argument_order.stderr
index 99122c6..ef6d168 100644
--- a/tests/ui/const-generics/argument_order.stderr
+++ b/tests/ui/const-generics/argument_order.stderr
@@ -1,14 +1,14 @@
error: lifetime parameters must be declared prior to type and const parameters
- --> $DIR/argument_order.rs:6:32
+ --> $DIR/argument_order.rs:8:28
|
-LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
- | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>`
+LL | struct Bad<const N: usize, 'a, T, 'b, const M: usize, U> {
+ | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>`
error[E0747]: lifetime provided when a type was expected
- --> $DIR/argument_order.rs:13:23
+ --> $DIR/argument_order.rs:15:19
|
-LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
- | ^^^^^^^
+LL | let _: Bad<7, 'static, u32, 'static, 17, u16>;
+ | ^^^^^^^
|
= note: lifetime arguments must be provided before type arguments
= help: reorder the arguments: lifetimes, then type and consts: `<'a, 'b, N, T, M, U>`
diff --git a/tests/ui/const-generics/early/const-param-from-outer-fn.stderr b/tests/ui/const-generics/early/const-param-from-outer-fn.stderr
index 3c25dff..7aab983 100644
--- a/tests/ui/const-generics/early/const-param-from-outer-fn.stderr
+++ b/tests/ui/const-generics/early/const-param-from-outer-fn.stderr
@@ -8,6 +8,7 @@
LL | X
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<X>() -> u32 {
diff --git a/tests/ui/delegation/target-expr.stderr b/tests/ui/delegation/target-expr.stderr
index edd1a58..e26d12e 100644
--- a/tests/ui/delegation/target-expr.stderr
+++ b/tests/ui/delegation/target-expr.stderr
@@ -7,7 +7,9 @@
| ------------- generic parameter used in this inner delegated function
LL |
LL | let _ = T::Default();
- | ^^^^^^^^^^ use of generic parameter from outer item
+ | ^ use of generic parameter from outer item
+ |
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
error[E0434]: can't capture dynamic environment in a fn item
--> $DIR/target-expr.rs:26:17
diff --git a/tests/ui/did_you_mean/c-style-pointer-types.fixed b/tests/ui/did_you_mean/c-style-pointer-types.fixed
new file mode 100644
index 0000000..2517c8f
--- /dev/null
+++ b/tests/ui/did_you_mean/c-style-pointer-types.fixed
@@ -0,0 +1,113 @@
+//@ run-rustfix
+
+#![allow(unused)]
+
+pub const P1: *const u8 = 0 as _;
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P2: *mut u8 = 1 as _;
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P3: *const i32 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P4: *const i32 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P5: *mut i32 = std::ptr::null_mut();
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P6: *mut i32 = std::ptr::null_mut();
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P7: *const Vec<u8> = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P8: *const std::collections::HashMap<String, i32> = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func1(p: *const u8) {}
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func2(p: *mut u8) {}
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+fn func3() -> *const u8 { std::ptr::null() }
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func4() -> *mut u8 { std::ptr::null_mut() }
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+struct S1 {
+ field: *const u8,
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+struct S2 {
+ field: *mut u8,
+ //~^ ERROR: raw pointer types must be written as `*mut T`
+ //~| HELP: put the `*` before `mut`
+}
+
+type Tuple1 = (*const u8, i32);
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Tuple2 = (*mut u8, i32);
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+type Array1 = [*const u8; 10];
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Array2 = [*mut u8; 10];
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+type Alias1 = *const u8;
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Alias2 = *mut u8;
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P9: *const u8 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P10: *const u8 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+impl S1 {
+ fn method(self, size: *const u32) {}
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+trait Trait1 {
+ fn method(p: *const u8);
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+fn generic_func<T>() -> *const T { std::ptr::null() }
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn main() {}
diff --git a/tests/ui/did_you_mean/c-style-pointer-types.rs b/tests/ui/did_you_mean/c-style-pointer-types.rs
new file mode 100644
index 0000000..562d85f
--- /dev/null
+++ b/tests/ui/did_you_mean/c-style-pointer-types.rs
@@ -0,0 +1,113 @@
+//@ run-rustfix
+
+#![allow(unused)]
+
+pub const P1: const* u8 = 0 as _;
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P2: mut* u8 = 1 as _;
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P3: const* i32 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P4: const* i32 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P5: mut* i32 = std::ptr::null_mut();
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P6: mut* i32 = std::ptr::null_mut();
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P7: const* Vec<u8> = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P8: const* std::collections::HashMap<String, i32> = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func1(p: const* u8) {}
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func2(p: mut* u8) {}
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+fn func3() -> const* u8 { std::ptr::null() }
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn func4() -> mut* u8 { std::ptr::null_mut() }
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+struct S1 {
+ field: const* u8,
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+struct S2 {
+ field: mut* u8,
+ //~^ ERROR: raw pointer types must be written as `*mut T`
+ //~| HELP: put the `*` before `mut`
+}
+
+type Tuple1 = (const* u8, i32);
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Tuple2 = (mut* u8, i32);
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+type Array1 = [const* u8; 10];
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Array2 = [mut* u8; 10];
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+type Alias1 = const* u8;
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+type Alias2 = mut* u8;
+//~^ ERROR: raw pointer types must be written as `*mut T`
+//~| HELP: put the `*` before `mut`
+
+pub const P9: const *u8 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+pub const P10: const * u8 = std::ptr::null();
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+impl S1 {
+ fn method(self, size: const* u32) {}
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+trait Trait1 {
+ fn method(p: const* u8);
+ //~^ ERROR: raw pointer types must be written as `*const T`
+ //~| HELP: put the `*` before `const`
+}
+
+fn generic_func<T>() -> const* T { std::ptr::null() }
+//~^ ERROR: raw pointer types must be written as `*const T`
+//~| HELP: put the `*` before `const`
+
+fn main() {}
diff --git a/tests/ui/did_you_mean/c-style-pointer-types.stderr b/tests/ui/did_you_mean/c-style-pointer-types.stderr
new file mode 100644
index 0000000..bbab72c
--- /dev/null
+++ b/tests/ui/did_you_mean/c-style-pointer-types.stderr
@@ -0,0 +1,302 @@
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:5:15
+ |
+LL | pub const P1: const* u8 = 0 as _;
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P1: const* u8 = 0 as _;
+LL + pub const P1: *const u8 = 0 as _;
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:9:15
+ |
+LL | pub const P2: mut* u8 = 1 as _;
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - pub const P2: mut* u8 = 1 as _;
+LL + pub const P2: *mut u8 = 1 as _;
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:13:15
+ |
+LL | pub const P3: const* i32 = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P3: const* i32 = std::ptr::null();
+LL + pub const P3: *const i32 = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:17:15
+ |
+LL | pub const P4: const* i32 = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P4: const* i32 = std::ptr::null();
+LL + pub const P4: *const i32 = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:21:15
+ |
+LL | pub const P5: mut* i32 = std::ptr::null_mut();
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - pub const P5: mut* i32 = std::ptr::null_mut();
+LL + pub const P5: *mut i32 = std::ptr::null_mut();
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:25:15
+ |
+LL | pub const P6: mut* i32 = std::ptr::null_mut();
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - pub const P6: mut* i32 = std::ptr::null_mut();
+LL + pub const P6: *mut i32 = std::ptr::null_mut();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:29:15
+ |
+LL | pub const P7: const* Vec<u8> = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P7: const* Vec<u8> = std::ptr::null();
+LL + pub const P7: *const Vec<u8> = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:33:15
+ |
+LL | pub const P8: const* std::collections::HashMap<String, i32> = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P8: const* std::collections::HashMap<String, i32> = std::ptr::null();
+LL + pub const P8: *const std::collections::HashMap<String, i32> = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:37:13
+ |
+LL | fn func1(p: const* u8) {}
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - fn func1(p: const* u8) {}
+LL + fn func1(p: *const u8) {}
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:41:13
+ |
+LL | fn func2(p: mut* u8) {}
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - fn func2(p: mut* u8) {}
+LL + fn func2(p: *mut u8) {}
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:45:15
+ |
+LL | fn func3() -> const* u8 { std::ptr::null() }
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - fn func3() -> const* u8 { std::ptr::null() }
+LL + fn func3() -> *const u8 { std::ptr::null() }
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:49:15
+ |
+LL | fn func4() -> mut* u8 { std::ptr::null_mut() }
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - fn func4() -> mut* u8 { std::ptr::null_mut() }
+LL + fn func4() -> *mut u8 { std::ptr::null_mut() }
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:54:12
+ |
+LL | field: const* u8,
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - field: const* u8,
+LL + field: *const u8,
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:60:12
+ |
+LL | field: mut* u8,
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - field: mut* u8,
+LL + field: *mut u8,
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:65:16
+ |
+LL | type Tuple1 = (const* u8, i32);
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - type Tuple1 = (const* u8, i32);
+LL + type Tuple1 = (*const u8, i32);
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:69:16
+ |
+LL | type Tuple2 = (mut* u8, i32);
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - type Tuple2 = (mut* u8, i32);
+LL + type Tuple2 = (*mut u8, i32);
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:73:16
+ |
+LL | type Array1 = [const* u8; 10];
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - type Array1 = [const* u8; 10];
+LL + type Array1 = [*const u8; 10];
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:77:16
+ |
+LL | type Array2 = [mut* u8; 10];
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - type Array2 = [mut* u8; 10];
+LL + type Array2 = [*mut u8; 10];
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:81:15
+ |
+LL | type Alias1 = const* u8;
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - type Alias1 = const* u8;
+LL + type Alias1 = *const u8;
+ |
+
+error: raw pointer types must be written as `*mut T`
+ --> $DIR/c-style-pointer-types.rs:85:15
+ |
+LL | type Alias2 = mut* u8;
+ | ^^^
+ |
+help: put the `*` before `mut`
+ |
+LL - type Alias2 = mut* u8;
+LL + type Alias2 = *mut u8;
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:89:15
+ |
+LL | pub const P9: const *u8 = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P9: const *u8 = std::ptr::null();
+LL + pub const P9: *const u8 = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:93:16
+ |
+LL | pub const P10: const * u8 = std::ptr::null();
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - pub const P10: const * u8 = std::ptr::null();
+LL + pub const P10: *const u8 = std::ptr::null();
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:98:27
+ |
+LL | fn method(self, size: const* u32) {}
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - fn method(self, size: const* u32) {}
+LL + fn method(self, size: *const u32) {}
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:104:18
+ |
+LL | fn method(p: const* u8);
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - fn method(p: const* u8);
+LL + fn method(p: *const u8);
+ |
+
+error: raw pointer types must be written as `*const T`
+ --> $DIR/c-style-pointer-types.rs:109:25
+ |
+LL | fn generic_func<T>() -> const* T { std::ptr::null() }
+ | ^^^^^
+ |
+help: put the `*` before `const`
+ |
+LL - fn generic_func<T>() -> const* T { std::ptr::null() }
+LL + fn generic_func<T>() -> *const T { std::ptr::null() }
+ |
+
+error: aborting due to 25 previous errors
+
diff --git a/tests/ui/did_you_mean/issue-31424.rs b/tests/ui/did_you_mean/issue-31424.rs
index 2821d5b..3b3820b 100644
--- a/tests/ui/did_you_mean/issue-31424.rs
+++ b/tests/ui/did_you_mean/issue-31424.rs
@@ -4,17 +4,18 @@
impl Struct {
fn foo(&mut self) {
- (&mut self).bar(); //~ ERROR cannot borrow
- //~^ HELP try removing `&mut` here
+ (&mut self).bar(); //~ ERROR: cannot borrow
+ //~^ HELP: try removing `&mut` here
}
// In this case we could keep the suggestion, but to distinguish the
// two cases is pretty hard. It's an obscure case anyway.
fn bar(self: &mut Self) {
- //~^ WARN function cannot return without recursing
- //~^^ HELP a `loop` may express intention better if this is on purpose
+ //~^ WARN: function cannot return without recursing
+ //~| HELP: a `loop` may express intention better if this is on purpose
+ //~| HELP: consider making the binding mutable if you need to reborrow multiple times
(&mut self).bar(); //~ ERROR cannot borrow
- //~^ HELP try removing `&mut` here
+ //~^ HELP: try removing `&mut` here
}
}
diff --git a/tests/ui/did_you_mean/issue-31424.stderr b/tests/ui/did_you_mean/issue-31424.stderr
index 8fe38bf..5752397 100644
--- a/tests/ui/did_you_mean/issue-31424.stderr
+++ b/tests/ui/did_you_mean/issue-31424.stderr
@@ -28,7 +28,7 @@
= note: `#[warn(unconditional_recursion)]` on by default
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-31424.rs:16:9
+ --> $DIR/issue-31424.rs:17:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
@@ -39,10 +39,14 @@
LL | fn bar(self: &mut Self) {
| ^^^^^^^^^
help: try removing `&mut` here
- --> $DIR/issue-31424.rs:16:9
+ --> $DIR/issue-31424.rs:17:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
+help: consider making the binding mutable if you need to reborrow multiple times
+ |
+LL | fn bar(mut self: &mut Self) {
+ | +++
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/did_you_mean/issue-34126.rs b/tests/ui/did_you_mean/issue-34126.rs
index 53516f4..82ffadb 100644
--- a/tests/ui/did_you_mean/issue-34126.rs
+++ b/tests/ui/did_you_mean/issue-34126.rs
@@ -3,9 +3,9 @@
impl Z {
fn run(&self, z: &mut Z) { }
fn start(&mut self) {
- self.run(&mut self); //~ ERROR cannot borrow
- //~| ERROR cannot borrow
- //~| HELP try removing `&mut` here
+ self.run(&mut self); //~ ERROR: cannot borrow
+ //~| ERROR: cannot borrow
+ //~| HELP: if there is only one mutable reborrow, remove the `&mut`
}
}
diff --git a/tests/ui/did_you_mean/issue-34126.stderr b/tests/ui/did_you_mean/issue-34126.stderr
index 9f792070..ec02dfe 100644
--- a/tests/ui/did_you_mean/issue-34126.stderr
+++ b/tests/ui/did_you_mean/issue-34126.stderr
@@ -9,7 +9,7 @@
|
LL | fn start(&mut self) {
| ^^^^^^^^^
-help: try removing `&mut` here
+help: if there is only one mutable reborrow, remove the `&mut`
|
LL - self.run(&mut self);
LL + self.run(self);
diff --git a/tests/ui/enum-discriminant/discriminant_size.rs b/tests/ui/enum-discriminant/discriminant_size.rs
index b1feff3..537940c 100644
--- a/tests/ui/enum-discriminant/discriminant_size.rs
+++ b/tests/ui/enum-discriminant/discriminant_size.rs
@@ -2,6 +2,7 @@
#![feature(core_intrinsics)]
use std::intrinsics::discriminant_value;
+use std::mem::size_of;
enum E1 {
A,
@@ -20,6 +21,14 @@ enum E3 {
B = 100,
}
+// Enums like this are found in the ecosystem, let's make sure they get the right size.
+#[repr(C)]
+#[allow(overflowing_literals)]
+enum UnsignedIntEnum {
+ A = 0,
+ O = 0xffffffff, // doesn't fit into `int`, but fits into `unsigned int`
+}
+
#[repr(i128)]
enum E4 {
A = 0x1223_3445_5667_7889,
@@ -27,24 +36,38 @@ enum E4 {
}
fn main() {
+ assert_eq!(size_of::<E1>(), 1);
let mut target: [isize; 3] = [0, 0, 0];
target[1] = discriminant_value(&E1::A);
assert_eq!(target, [0, 0, 0]);
target[1] = discriminant_value(&E1::B);
assert_eq!(target, [0, 1, 0]);
+ assert_eq!(size_of::<E2>(), 1);
let mut target: [i8; 3] = [0, 0, 0];
target[1] = discriminant_value(&E2::A);
assert_eq!(target, [0, 7, 0]);
target[1] = discriminant_value(&E2::B);
assert_eq!(target, [0, -2, 0]);
+ // E3's size is target-dependent
let mut target: [isize; 3] = [0, 0, 0];
target[1] = discriminant_value(&E3::A);
assert_eq!(target, [0, 42, 0]);
target[1] = discriminant_value(&E3::B);
assert_eq!(target, [0, 100, 0]);
+ #[allow(overflowing_literals)]
+ {
+ assert_eq!(size_of::<UnsignedIntEnum>(), 4);
+ let mut target: [isize; 3] = [0, -1, 0];
+ target[1] = discriminant_value(&UnsignedIntEnum::A);
+ assert_eq!(target, [0, 0, 0]);
+ target[1] = discriminant_value(&UnsignedIntEnum::O);
+ assert_eq!(target, [0, 0xffffffff as isize, 0]);
+ }
+
+ assert_eq!(size_of::<E4>(), 16);
let mut target: [i128; 3] = [0, 0, 0];
target[1] = discriminant_value(&E4::A);
assert_eq!(target, [0, 0x1223_3445_5667_7889, 0]);
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr32.stderr b/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr32.stderr
new file mode 100644
index 0000000..db60fd1
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr32.stderr
@@ -0,0 +1,35 @@
+error: literal out of range for `isize`
+ --> $DIR/repr-c-big-discriminant1.rs:18:9
+ |
+LL | A = 9223372036854775807, // i64::MAX
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the literal `9223372036854775807` does not fit into the type `isize` whose range is `-2147483648..=2147483647`
+ = note: `#[deny(overflowing_literals)]` on by default
+
+error: literal out of range for `isize`
+ --> $DIR/repr-c-big-discriminant1.rs:26:9
+ |
+LL | A = -2147483649, // i32::MIN-1
+ | ^^^^^^^^^^^
+ |
+ = note: the literal `-2147483649` does not fit into the type `isize` whose range is `-2147483648..=2147483647`
+
+error: literal out of range for `isize`
+ --> $DIR/repr-c-big-discriminant1.rs:34:9
+ |
+LL | A = 2147483648, // i32::MAX+1
+ | ^^^^^^^^^^
+ |
+ = note: the literal `2147483648` does not fit into the type `isize` whose range is `-2147483648..=2147483647`
+
+error: literal out of range for `isize`
+ --> $DIR/repr-c-big-discriminant1.rs:43:9
+ |
+LL | A = 2147483648, // i32::MAX+1
+ | ^^^^^^^^^^
+ |
+ = note: the literal `2147483648` does not fit into the type `isize` whose range is `-2147483648..=2147483647`
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr64.stderr b/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr64.stderr
new file mode 100644
index 0000000..e2517ab
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant1.ptr64.stderr
@@ -0,0 +1,62 @@
+error: `repr(C)` enum discriminant does not fit into C `int` nor into C `unsigned int`
+ --> $DIR/repr-c-big-discriminant1.rs:18:5
+ |
+LL | A = 9223372036854775807, // i64::MAX
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+note: the lint level is defined here
+ --> $DIR/repr-c-big-discriminant1.rs:8:9
+ |
+LL | #![deny(repr_c_enums_larger_than_int)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `repr(C)` enum discriminant does not fit into C `int` nor into C `unsigned int`
+ --> $DIR/repr-c-big-discriminant1.rs:26:5
+ |
+LL | A = -2147483649, // i32::MIN-1
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+
+error: `repr(C)` enum discriminant does not fit into C `unsigned int`, and a previous discriminant does not fit into C `int`
+ --> $DIR/repr-c-big-discriminant1.rs:36:5
+ |
+LL | B = -1,
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+
+error: `repr(C)` enum discriminant does not fit into C `int`, and a previous discriminant does not fit into C `unsigned int`
+ --> $DIR/repr-c-big-discriminant1.rs:43:5
+ |
+LL | A = 2147483648, // i32::MAX+1
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+
+error: `repr(C)` enum discriminant does not fit into C `int` nor into C `unsigned int`
+ --> $DIR/repr-c-big-discriminant1.rs:53:5
+ |
+LL | A = I64_MAX as isize,
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant1.rs b/tests/ui/enum-discriminant/repr-c-big-discriminant1.rs
new file mode 100644
index 0000000..739f7cb
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant1.rs
@@ -0,0 +1,67 @@
+//@ revisions: ptr32 ptr64
+//@[ptr32] compile-flags: --target i686-unknown-linux-gnu
+//@[ptr32] needs-llvm-components: x86
+//@[ptr64] compile-flags: --target x86_64-unknown-linux-gnu
+//@[ptr64] needs-llvm-components: x86
+// GCC doesn't like cross-compilation
+//@ ignore-backends: gcc
+#![deny(repr_c_enums_larger_than_int)]
+
+//@ add-minicore
+#![feature(no_core)]
+#![no_core]
+extern crate minicore;
+use minicore::*;
+
+#[repr(C)]
+enum OverflowingEnum1 {
+ A = 9223372036854775807, // i64::MAX
+ //[ptr32]~^ ERROR: literal out of range
+ //[ptr64]~^^ ERROR: discriminant does not fit into C `int` nor into C `unsigned int`
+ //[ptr64]~^^^ WARN: previously accepted
+}
+
+#[repr(C)]
+enum OverflowingEnum2 {
+ A = -2147483649, // i32::MIN-1
+ //[ptr32]~^ ERROR: literal out of range
+ //[ptr64]~^^ ERROR: discriminant does not fit into C `int` nor into C `unsigned int`
+ //[ptr64]~^^^ WARN: previously accepted
+}
+
+#[repr(C)]
+enum OverflowingEnum3a {
+ A = 2147483648, // i32::MAX+1
+ //[ptr32]~^ ERROR: literal out of range
+ B = -1,
+ //[ptr64]~^ ERROR: discriminant does not fit into C `unsigned int`, and a previous
+ //[ptr64]~^^ WARN: previously accepted
+}
+#[repr(C)]
+enum OverflowingEnum3b {
+ B = -1,
+ A = 2147483648, // i32::MAX+1
+ //[ptr32]~^ ERROR: literal out of range
+ //[ptr64]~^^ ERROR: discriminant does not fit into C `int`, and a previous
+ //[ptr64]~^^^ WARN: previously accepted
+}
+
+const I64_MAX: i64 = 9223372036854775807;
+
+#[repr(C)]
+enum OverflowingEnum4 {
+ A = I64_MAX as isize,
+ //[ptr64]~^ ERROR: discriminant does not fit into C `int` nor into C `unsigned int`
+ //[ptr64]~^^ WARN: previously accepted
+ // No warning/error on 32bit targets, but the `as isize` hints that wrapping is occurring.
+}
+
+// Enums like this are found in the ecosystem, let's make sure they get accepted.
+#[repr(C)]
+#[allow(overflowing_literals)]
+enum OkayEnum {
+ A = 0,
+ O = 0xffffffff,
+}
+
+fn main() {}
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr32.stderr b/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr32.stderr
new file mode 100644
index 0000000..85aaff4
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr32.stderr
@@ -0,0 +1,11 @@
+error[E0370]: enum discriminant overflowed
+ --> $DIR/repr-c-big-discriminant2.rs:24:5
+ |
+LL | B, // +1
+ | ^ overflowed on value after 2147483647
+ |
+ = note: explicitly set `B = -2147483648` if that is desired outcome
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0370`.
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr64.stderr b/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr64.stderr
new file mode 100644
index 0000000..8cd978c
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant2.ptr64.stderr
@@ -0,0 +1,18 @@
+error: `repr(C)` enum discriminant does not fit into C `int`, and a previous discriminant does not fit into C `unsigned int`
+ --> $DIR/repr-c-big-discriminant2.rs:24:5
+ |
+LL | B, // +1
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #124403 <https://github.com/rust-lang/rust/issues/124403>
+ = note: `repr(C)` enums with big discriminants are non-portable, and their size in Rust might not match their size in C
+ = help: use `repr($int_ty)` instead to explicitly set the size of this enum
+note: the lint level is defined here
+ --> $DIR/repr-c-big-discriminant2.rs:8:9
+ |
+LL | #![deny(repr_c_enums_larger_than_int)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/enum-discriminant/repr-c-big-discriminant2.rs b/tests/ui/enum-discriminant/repr-c-big-discriminant2.rs
new file mode 100644
index 0000000..8e333b7
--- /dev/null
+++ b/tests/ui/enum-discriminant/repr-c-big-discriminant2.rs
@@ -0,0 +1,30 @@
+//@ revisions: ptr32 ptr64
+//@[ptr32] compile-flags: --target i686-unknown-linux-gnu
+//@[ptr32] needs-llvm-components: x86
+//@[ptr64] compile-flags: --target x86_64-unknown-linux-gnu
+//@[ptr64] needs-llvm-components: x86
+// GCC doesn't like cross-compilation
+//@ ignore-backends: gcc
+#![deny(repr_c_enums_larger_than_int)]
+
+//@ add-minicore
+#![feature(no_core)]
+#![no_core]
+extern crate minicore;
+use minicore::*;
+
+// Separate test since it suppresses other errors on ptr32:
+// ensure we find the bad discriminant when it is implicitly computed by incrementing
+// the previous discriminant.
+
+#[repr(C)]
+enum OverflowingEnum {
+ NEG = -1,
+ A = 2147483647, // i32::MAX
+ B, // +1
+ //[ptr32]~^ ERROR: enum discriminant overflowed
+ //[ptr64]~^^ ERROR: discriminant does not fit into C `int`
+ //[ptr64]~^^^ WARN: previously accepted
+}
+
+fn main() {}
diff --git a/tests/ui/error-codes/E0401.stderr b/tests/ui/error-codes/E0401.stderr
index 8daaf09..abd80d6 100644
--- a/tests/ui/error-codes/E0401.stderr
+++ b/tests/ui/error-codes/E0401.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bfnr<T, U, V: Baz<U>, W: Fn()>(y: T) {
@@ -25,6 +26,7 @@
LL | (y: T) {
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn baz<T, U,
@@ -37,11 +39,16 @@
| ---- `Self` type implicitly declared here, by this `impl`
...
LL | fn helper(sel: &Self) -> u8 {
- | ------ ^^^^
- | | |
- | | use of `Self` from outer item
- | | refer to the type directly here instead
+ | ------ ^^^^ use of `Self` from outer item
+ | |
| `Self` used in this inner function
+ |
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
+help: refer to the type directly here instead
+ |
+LL - fn helper(sel: &Self) -> u8 {
+LL + fn helper(sel: &A<T>) -> u8 {
+ |
error: aborting due to 3 previous errors
diff --git a/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr
index fb2d2f2..53408d0 100644
--- a/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr
+++ b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner enum
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | enum E<Z> { V(Z) }
diff --git a/tests/ui/generics/generic-params-nested-fn-scope-error.stderr b/tests/ui/generics/generic-params-nested-fn-scope-error.stderr
index f809740..436f9c9 100644
--- a/tests/ui/generics/generic-params-nested-fn-scope-error.stderr
+++ b/tests/ui/generics/generic-params-nested-fn-scope-error.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<U>(w: [U]) -> U {
@@ -23,6 +24,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<U>(w: [U]) -> U {
diff --git a/tests/ui/generics/invalid-type-param-default.stderr b/tests/ui/generics/invalid-type-param-default.stderr
index 3bec754..bbae5ba 100644
--- a/tests/ui/generics/invalid-type-param-default.stderr
+++ b/tests/ui/generics/invalid-type-param-default.stderr
@@ -2,7 +2,7 @@
--> $DIR/invalid-type-param-default.rs:12:12
|
LL | fn mdn<T = T::Item>(_: T) {}
- | ^^^^^^^ cannot reference `T` before it is declared
+ | ^ cannot reference `T` before it is declared
error: defaults for generic parameters are not allowed here
--> $DIR/invalid-type-param-default.rs:7:8
diff --git a/tests/ui/generics/issue-98432.stderr b/tests/ui/generics/issue-98432.stderr
index a1efee7..e261416 100644
--- a/tests/ui/generics/issue-98432.stderr
+++ b/tests/ui/generics/issue-98432.stderr
@@ -9,6 +9,7 @@
| |
| generic parameter used in this inner struct
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | struct _Obligation<T> where T:;
diff --git a/tests/ui/impl-header-lifetime-elision/assoc-type.rs b/tests/ui/impl-header-lifetime-elision/assoc-type.rs
index 14b2ea6..f03a110 100644
--- a/tests/ui/impl-header-lifetime-elision/assoc-type.rs
+++ b/tests/ui/impl-header-lifetime-elision/assoc-type.rs
@@ -9,7 +9,7 @@ trait MyTrait {
impl MyTrait for &i32 {
type Output = &i32;
- //~^ ERROR in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ //~^ ERROR missing lifetime in associated type
}
impl MyTrait for &u32 {
@@ -17,6 +17,19 @@ impl MyTrait for &u32 {
//~^ ERROR `'_` cannot be used here
}
+impl<'a> MyTrait for &f64 {
+ type Output = &f64;
+ //~^ ERROR missing lifetime in associated type
+}
+
+trait OtherTrait<'a> {
+ type Output;
+}
+impl OtherTrait<'_> for f64 {
+ type Output = &f64;
+ //~^ ERROR missing lifetime in associated type
+}
+
// This is what you have to do:
impl<'a> MyTrait for &'a f32 {
type Output = &'a f32;
diff --git a/tests/ui/impl-header-lifetime-elision/assoc-type.stderr b/tests/ui/impl-header-lifetime-elision/assoc-type.stderr
index 72c0664..201ea2d 100644
--- a/tests/ui/impl-header-lifetime-elision/assoc-type.stderr
+++ b/tests/ui/impl-header-lifetime-elision/assoc-type.stderr
@@ -1,10 +1,15 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/assoc-type.rs:11:19
|
-LL | impl MyTrait for &i32 {
- | - you could add a lifetime on the impl block, if the trait or the self type can have one
LL | type Output = &i32;
| ^ this lifetime must come from the implemented type
+ |
+ = note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+help: add a lifetime to the impl block and use it in the self type and associated type
+ |
+LL ~ impl<'a> MyTrait for &'a i32 {
+LL ~ type Output = &'a i32;
+ |
error[E0637]: `'_` cannot be used here
--> $DIR/assoc-type.rs:16:20
@@ -12,6 +17,33 @@
LL | type Output = &'_ i32;
| ^^ `'_` is a reserved lifetime name
-error: aborting due to 2 previous errors
+error: missing lifetime in associated type
+ --> $DIR/assoc-type.rs:21:19
+ |
+LL | impl<'a> MyTrait for &f64 {
+ | ---- there is a named lifetime specified on the impl block you could use
+LL | type Output = &f64;
+ | ^ this lifetime must come from the implemented type
+ |
+ = note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+help: consider using the lifetime from the impl block
+ |
+LL | type Output = &'a f64;
+ | ++
+
+error: missing lifetime in associated type
+ --> $DIR/assoc-type.rs:29:19
+ |
+LL | type Output = &f64;
+ | ^ this lifetime must come from the implemented type
+ |
+ = note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+help: add a lifetime to the impl block and use it in the trait and associated type
+ |
+LL ~ impl<'a> OtherTrait<'a> for f64 {
+LL ~ type Output = &'a f64;
+ |
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0637`.
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.rs
index 5401bc4..3d02d1b 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.rs
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.rs
@@ -7,9 +7,10 @@ impl<'a> IntoIterator for &S {
//~| NOTE unconstrained lifetime parameter
//~| HELP consider using the named lifetime here instead of an implicit lifetime
type Item = &T;
- //~^ ERROR in the trait associated type
+ //~^ ERROR missing lifetime in associated type
//~| HELP consider using the lifetime from the impl block
//~| NOTE this lifetime must come from the implemented type
+ //~| NOTE in the trait the associated type is declared without lifetime parameters
type IntoIter = std::collections::btree_map::Values<'a, i32, T>;
fn into_iter(self) -> Self::IntoIter {
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.stderr
index feac49e..3374c76 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.stderr
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-1.stderr
@@ -1,4 +1,4 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/missing-lifetime-in-assoc-type-1.rs:9:17
|
LL | impl<'a> IntoIterator for &S {
@@ -7,6 +7,8 @@
LL | type Item = &T;
| ^ this lifetime must come from the implemented type
|
+note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
help: consider using the lifetime from the impl block
|
LL | type Item = &'a T;
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.rs
index dd720f0..d24aaaf 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.rs
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.rs
@@ -3,7 +3,7 @@
impl IntoIterator for &S {
type Item = &T;
- //~^ ERROR in the trait associated type
+ //~^ ERROR missing lifetime in associated type
type IntoIter = std::collections::btree_map::Values<'a, i32, T>;
//~^ ERROR use of undeclared lifetime name `'a`
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.stderr
index 7a0246e..9d9d2bc 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.stderr
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-2.stderr
@@ -1,10 +1,16 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/missing-lifetime-in-assoc-type-2.rs:5:17
|
-LL | impl IntoIterator for &S {
- | - you could add a lifetime on the impl block, if the trait or the self type can have one
LL | type Item = &T;
| ^ this lifetime must come from the implemented type
+ |
+note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+help: add a lifetime to the impl block and use it in the self type and associated type
+ |
+LL ~ impl<'a> IntoIterator for &'a S {
+LL ~ type Item = &'a T;
+ |
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/missing-lifetime-in-assoc-type-2.rs:7:57
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.rs
index 60d1f0f..cf745ab 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.rs
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.rs
@@ -3,7 +3,7 @@
impl IntoIterator for &S {
type Item = &T;
- //~^ ERROR in the trait associated type
+ //~^ ERROR missing lifetime in associated type
type IntoIter = std::collections::btree_map::Values<i32, T>;
//~^ ERROR missing lifetime specifier
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.stderr
index 408d5bb..b5811dc 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.stderr
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-3.stderr
@@ -1,10 +1,16 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/missing-lifetime-in-assoc-type-3.rs:5:17
|
-LL | impl IntoIterator for &S {
- | - you could add a lifetime on the impl block, if the trait or the self type can have one
LL | type Item = &T;
| ^ this lifetime must come from the implemented type
+ |
+note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+help: add a lifetime to the impl block and use it in the self type and associated type
+ |
+LL ~ impl<'a> IntoIterator for &'a S {
+LL ~ type Item = &'a T;
+ |
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-in-assoc-type-3.rs:7:56
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.rs
index 0c99e88..138f6d7 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.rs
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.rs
@@ -3,7 +3,7 @@
impl IntoIterator for &S {
type Item = &T;
- //~^ ERROR in the trait associated type
+ //~^ ERROR missing lifetime in associated type
type IntoIter<'a> = std::collections::btree_map::Values<'a, i32, T>;
//~^ ERROR lifetime parameters or bounds on associated type `IntoIter` do not match the trait declaration
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.stderr
index ebe0515..a0b7ad0 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.stderr
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-4.stderr
@@ -1,16 +1,26 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/missing-lifetime-in-assoc-type-4.rs:5:17
|
-LL | impl IntoIterator for &S {
- | - you could add a lifetime on the impl block, if the trait or the self type can have one
LL | type Item = &T;
| ^ this lifetime must come from the implemented type
+ |
+note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+help: add a lifetime to the impl block and use it in the self type and associated type
+ |
+LL ~ impl<'a> IntoIterator for &'a S {
+LL ~ type Item = &'a T;
+ |
error[E0195]: lifetime parameters or bounds on associated type `IntoIter` do not match the trait declaration
--> $DIR/missing-lifetime-in-assoc-type-4.rs:7:18
|
LL | type IntoIter<'a> = std::collections::btree_map::Values<'a, i32, T>;
| ^^^^ lifetimes do not match associated type in trait
+ |
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+ |
+ = note: lifetimes in impl do not match this associated type in trait
error: aborting due to 2 previous errors
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.rs
index 17cca7c..853cc6d 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.rs
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.rs
@@ -7,9 +7,10 @@ impl<'a> IntoIterator for &'_ S {
//~| NOTE unconstrained lifetime parameter
//~| HELP consider using the named lifetime here instead of an implicit lifetime
type Item = &T;
- //~^ ERROR in the trait associated type
+ //~^ ERROR missing lifetime in associated type
//~| HELP consider using the lifetime from the impl block
//~| NOTE this lifetime must come from the implemented type
+ //~| NOTE in the trait the associated type is declared without lifetime parameters
type IntoIter = std::collections::btree_map::Values<'a, i32, T>;
fn into_iter(self) -> Self::IntoIter {
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.stderr
index cb15bcb..d58fd89 100644
--- a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.stderr
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-5.stderr
@@ -1,4 +1,4 @@
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/missing-lifetime-in-assoc-type-5.rs:9:17
|
LL | impl<'a> IntoIterator for &'_ S {
@@ -7,6 +7,8 @@
LL | type Item = &T;
| ^ this lifetime must come from the implemented type
|
+note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
help: consider using the lifetime from the impl block
|
LL | type Item = &'a T;
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.rs b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.rs
new file mode 100644
index 0000000..b4fac57
--- /dev/null
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.rs
@@ -0,0 +1,26 @@
+//~ NOTE in the trait the associated type is declared without lifetime parameters
+struct S;
+struct T;
+
+trait Trait {
+ type Item;
+ type IntoIter;
+ fn into_iter(self) -> Self::IntoIter;
+}
+
+impl<'a> Trait for &'_ S {
+ //~^ ERROR E0207
+ //~| NOTE there is a named lifetime specified on the impl block you could use
+ //~| NOTE unconstrained lifetime parameter
+ //~| HELP consider using the named lifetime here instead of an implicit lifetime
+ type Item = &T;
+ //~^ ERROR missing lifetime in associated type
+ //~| HELP consider using the lifetime from the impl block
+ //~| NOTE this lifetime must come from the implemented type
+ type IntoIter = std::collections::btree_map::Values<'a, i32, T>;
+
+ fn into_iter(self) -> Self::IntoIter {
+ todo!()
+ }
+}
+fn main() {}
diff --git a/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.stderr b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.stderr
new file mode 100644
index 0000000..6767243
--- /dev/null
+++ b/tests/ui/lifetimes/missing-lifetime-in-assoc-type-6.stderr
@@ -0,0 +1,30 @@
+error: missing lifetime in associated type
+ --> $DIR/missing-lifetime-in-assoc-type-6.rs:16:17
+ |
+LL | impl<'a> Trait for &'_ S {
+ | ---- there is a named lifetime specified on the impl block you could use
+...
+LL | type Item = &T;
+ | ^ this lifetime must come from the implemented type
+ |
+ = note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+help: consider using the lifetime from the impl block
+ |
+LL | type Item = &'a T;
+ | ++
+
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/missing-lifetime-in-assoc-type-6.rs:11:6
+ |
+LL | impl<'a> Trait for &'_ S {
+ | ^^ unconstrained lifetime parameter
+ |
+help: consider using the named lifetime here instead of an implicit lifetime
+ |
+LL - impl<'a> Trait for &'_ S {
+LL + impl<'a> Trait for &'a S {
+ |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/lifetimes/no_lending_iterators.rs b/tests/ui/lifetimes/no_lending_iterators.rs
index 88b8cda..aa2e57e 100644
--- a/tests/ui/lifetimes/no_lending_iterators.rs
+++ b/tests/ui/lifetimes/no_lending_iterators.rs
@@ -16,7 +16,7 @@ trait Bar {
impl Bar for usize {
type Item = &usize;
- //~^ ERROR in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+ //~^ ERROR missing lifetime in associated type
fn poke(&mut self, item: Self::Item) {
self += *item;
diff --git a/tests/ui/lifetimes/no_lending_iterators.stderr b/tests/ui/lifetimes/no_lending_iterators.stderr
index cadba14..ef90c28 100644
--- a/tests/ui/lifetimes/no_lending_iterators.stderr
+++ b/tests/ui/lifetimes/no_lending_iterators.stderr
@@ -10,13 +10,15 @@
LL | impl Iterator for Data {
| ^^^^
-error: in the trait associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
+error: missing lifetime in associated type
--> $DIR/no_lending_iterators.rs:18:17
|
LL | impl Bar for usize {
- | - you could add a lifetime on the impl block, if the trait or the self type can have one
+ | - you could add a lifetime on the impl block, if the trait or the self type could have one
LL | type Item = &usize;
| ^ this lifetime must come from the implemented type
+ |
+ = note: in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type
error[E0195]: lifetime parameters or bounds on associated type `Item` do not match the trait declaration
--> $DIR/no_lending_iterators.rs:27:14
diff --git a/tests/ui/macros/cfg.rs b/tests/ui/macros/cfg.rs
index 5099857..d992ec8 100644
--- a/tests/ui/macros/cfg.rs
+++ b/tests/ui/macros/cfg.rs
@@ -1,6 +1,6 @@
fn main() {
cfg!(); //~ ERROR macro requires a cfg-pattern
- cfg!(123); //~ ERROR literal in `cfg` predicate value must be a boolean
- cfg!(foo = 123); //~ ERROR literal in `cfg` predicate value must be a string
+ cfg!(123); //~ ERROR malformed `cfg` macro input
+ cfg!(foo = 123); //~ ERROR malformed `cfg` macro input
cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
}
diff --git a/tests/ui/macros/cfg.stderr b/tests/ui/macros/cfg.stderr
index ad3f9b1..a153ed9 100644
--- a/tests/ui/macros/cfg.stderr
+++ b/tests/ui/macros/cfg.stderr
@@ -4,17 +4,27 @@
LL | cfg!();
| ^^^^^^ cfg-pattern required
-error[E0565]: literal in `cfg` predicate value must be a boolean
- --> $DIR/cfg.rs:3:10
+error[E0539]: malformed `cfg` macro input
+ --> $DIR/cfg.rs:3:5
|
LL | cfg!(123);
- | ^^^
+ | ^^^^^---^
+ | | |
+ | | expected a valid identifier here
+ | help: must be of the form: `cfg(predicate)`
+ |
+ = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
-error[E0565]: literal in `cfg` predicate value must be a string
- --> $DIR/cfg.rs:4:16
+error[E0539]: malformed `cfg` macro input
+ --> $DIR/cfg.rs:4:5
|
LL | cfg!(foo = 123);
- | ^^^
+ | ^^^^^^^^^^^---^
+ | | |
+ | | expected a string literal here
+ | help: must be of the form: `cfg(predicate)`
+ |
+ = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
error: expected 1 cfg-pattern
--> $DIR/cfg.rs:5:5
@@ -24,4 +34,4 @@
error: aborting due to 4 previous errors
-For more information about this error, try `rustc --explain E0565`.
+For more information about this error, try `rustc --explain E0539`.
diff --git a/tests/ui/nll/closure-captures.stderr b/tests/ui/nll/closure-captures.stderr
index 828974c..80ac033 100644
--- a/tests/ui/nll/closure-captures.stderr
+++ b/tests/ui/nll/closure-captures.stderr
@@ -47,7 +47,9 @@
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
-...
+LL |
+LL | fn two_closures_ref_mut(mut x: i32) {
+ | ----- `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
@@ -89,6 +91,8 @@
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn`
...
+LL | fn two_closures_ref(x: i32) {
+ | - `x` declared here, outside the closure
LL | fn_ref(|| {
| ------ -- in this closure
| |
diff --git a/tests/ui/nll/issue-51191.rs b/tests/ui/nll/issue-51191.rs
index 836587d..c0b0c5e 100644
--- a/tests/ui/nll/issue-51191.rs
+++ b/tests/ui/nll/issue-51191.rs
@@ -2,16 +2,17 @@
impl Struct {
fn bar(self: &mut Self) {
- //~^ WARN function cannot return without recursing
- //~^^ HELP a `loop` may express intention better if this is on purpose
+ //~^ WARN: function cannot return without recursing
+ //~| HELP: a `loop` may express intention better if this is on purpose
+ //~| HELP: consider making the binding mutable if you need to reborrow multiple times
(&mut self).bar();
- //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
- //~^^ HELP try removing `&mut` here
+ //~^ ERROR: cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~| HELP: try removing `&mut` here
}
fn imm(self) { //~ HELP consider changing this to be mutable
(&mut self).bar();
- //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~^ ERROR: cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
}
fn mtbl(mut self) {
@@ -20,14 +21,14 @@ fn mtbl(mut self) {
fn immref(&self) {
(&mut self).bar();
- //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
- //~^^ ERROR cannot borrow data in a `&` reference as mutable [E0596]
+ //~^ ERROR: cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~| ERROR: cannot borrow data in a `&` reference as mutable [E0596]
}
fn mtblref(&mut self) {
(&mut self).bar();
- //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
- //~^^ HELP try removing `&mut` here
+ //~^ ERROR: cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~| HELP: try removing `&mut` here
}
}
diff --git a/tests/ui/nll/issue-51191.stderr b/tests/ui/nll/issue-51191.stderr
index c14056c..73f8aab 100644
--- a/tests/ui/nll/issue-51191.stderr
+++ b/tests/ui/nll/issue-51191.stderr
@@ -11,7 +11,7 @@
= note: `#[warn(unconditional_recursion)]` on by default
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:7:9
+ --> $DIR/issue-51191.rs:8:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
@@ -22,13 +22,17 @@
LL | fn bar(self: &mut Self) {
| ^^^^^^^^^
help: try removing `&mut` here
- --> $DIR/issue-51191.rs:7:9
+ --> $DIR/issue-51191.rs:8:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
+help: consider making the binding mutable if you need to reborrow multiple times
+ |
+LL | fn bar(mut self: &mut Self) {
+ | +++
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:13:9
+ --> $DIR/issue-51191.rs:14:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
@@ -39,30 +43,30 @@
| +++
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:22:9
+ --> $DIR/issue-51191.rs:23:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow data in a `&` reference as mutable
- --> $DIR/issue-51191.rs:22:9
+ --> $DIR/issue-51191.rs:23:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:28:9
+ --> $DIR/issue-51191.rs:29:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
|
note: the binding is already a mutable borrow
- --> $DIR/issue-51191.rs:27:16
+ --> $DIR/issue-51191.rs:28:16
|
LL | fn mtblref(&mut self) {
| ^^^^^^^^^
help: try removing `&mut` here
- --> $DIR/issue-51191.rs:28:9
+ --> $DIR/issue-51191.rs:29:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
diff --git a/tests/ui/parser/let-chains-assign-add-incorrect.fixed b/tests/ui/parser/let-chains-assign-add-incorrect.fixed
new file mode 100644
index 0000000..b1abce8
--- /dev/null
+++ b/tests/ui/parser/let-chains-assign-add-incorrect.fixed
@@ -0,0 +1,36 @@
+//@ edition:2024
+//@ run-rustfix
+
+#![allow(irrefutable_let_patterns)]
+
+fn test_where_left_is_not_let() {
+ let y = 2;
+ if let _ = 1 && true && y == 2 {};
+ //~^ ERROR expected expression, found `let` statement
+ //~| NOTE only supported directly in conditions of `if` and `while` expressions
+ //~| ERROR mismatched types
+ //~| NOTE expected `bool`, found integer
+ //~| NOTE you are add-assigning the right-hand side expression to the result of this let-chain
+ //~| NOTE expected because this is `bool`
+ //~| ERROR binary assignment operation `+=` cannot be used in a let chain
+ //~| NOTE cannot use `+=` in a let chain
+ //~| HELP you might have meant to compare with `==` instead of assigning with `+=`
+}
+
+fn test_where_left_is_let() {
+ let y = 2;
+ if let _ = 1 && y == 2 {};
+ //~^ ERROR expected expression, found `let` statement
+ //~| NOTE only supported directly in conditions of `if` and `while` expressions
+ //~| ERROR mismatched types
+ //~| NOTE expected `bool`, found integer
+ //~| NOTE you are add-assigning the right-hand side expression to the result of this let-chain
+ //~| ERROR binary assignment operation `+=` cannot be used in a let chain
+ //~| NOTE cannot use `+=` in a let chain
+ //~| HELP you might have meant to compare with `==` instead of assigning with `+=`
+}
+
+fn main() {
+ test_where_left_is_let();
+ test_where_left_is_not_let()
+}
diff --git a/tests/ui/parser/let-chains-assign-add-incorrect.rs b/tests/ui/parser/let-chains-assign-add-incorrect.rs
new file mode 100644
index 0000000..3b2e5e9
--- /dev/null
+++ b/tests/ui/parser/let-chains-assign-add-incorrect.rs
@@ -0,0 +1,36 @@
+//@ edition:2024
+//@ run-rustfix
+
+#![allow(irrefutable_let_patterns)]
+
+fn test_where_left_is_not_let() {
+ let y = 2;
+ if let _ = 1 && true && y += 2 {};
+ //~^ ERROR expected expression, found `let` statement
+ //~| NOTE only supported directly in conditions of `if` and `while` expressions
+ //~| ERROR mismatched types
+ //~| NOTE expected `bool`, found integer
+ //~| NOTE you are add-assigning the right-hand side expression to the result of this let-chain
+ //~| NOTE expected because this is `bool`
+ //~| ERROR binary assignment operation `+=` cannot be used in a let chain
+ //~| NOTE cannot use `+=` in a let chain
+ //~| HELP you might have meant to compare with `==` instead of assigning with `+=`
+}
+
+fn test_where_left_is_let() {
+ let y = 2;
+ if let _ = 1 && y += 2 {};
+ //~^ ERROR expected expression, found `let` statement
+ //~| NOTE only supported directly in conditions of `if` and `while` expressions
+ //~| ERROR mismatched types
+ //~| NOTE expected `bool`, found integer
+ //~| NOTE you are add-assigning the right-hand side expression to the result of this let-chain
+ //~| ERROR binary assignment operation `+=` cannot be used in a let chain
+ //~| NOTE cannot use `+=` in a let chain
+ //~| HELP you might have meant to compare with `==` instead of assigning with `+=`
+}
+
+fn main() {
+ test_where_left_is_let();
+ test_where_left_is_not_let()
+}
diff --git a/tests/ui/parser/let-chains-assign-add-incorrect.stderr b/tests/ui/parser/let-chains-assign-add-incorrect.stderr
new file mode 100644
index 0000000..dea8e6a
--- /dev/null
+++ b/tests/ui/parser/let-chains-assign-add-incorrect.stderr
@@ -0,0 +1,61 @@
+error: expected expression, found `let` statement
+ --> $DIR/let-chains-assign-add-incorrect.rs:8:8
+ |
+LL | if let _ = 1 && true && y += 2 {};
+ | ^^^^^^^^^
+ |
+ = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+ --> $DIR/let-chains-assign-add-incorrect.rs:22:8
+ |
+LL | if let _ = 1 && y += 2 {};
+ | ^^^^^^^^^
+ |
+ = note: only supported directly in conditions of `if` and `while` expressions
+
+error[E0308]: mismatched types
+ --> $DIR/let-chains-assign-add-incorrect.rs:8:29
+ |
+LL | if let _ = 1 && true && y += 2 {};
+ | ----------------- ^ expected `bool`, found integer
+ | |
+ | expected because this is `bool`
+
+error: binary assignment operation `+=` cannot be used in a let chain
+ --> $DIR/let-chains-assign-add-incorrect.rs:8:31
+ |
+LL | if let _ = 1 && true && y += 2 {};
+ | ---------------------- ^^ cannot use `+=` in a let chain
+ | |
+ | you are add-assigning the right-hand side expression to the result of this let-chain
+ |
+help: you might have meant to compare with `==` instead of assigning with `+=`
+ |
+LL - if let _ = 1 && true && y += 2 {};
+LL + if let _ = 1 && true && y == 2 {};
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/let-chains-assign-add-incorrect.rs:22:21
+ |
+LL | if let _ = 1 && y += 2 {};
+ | ^ expected `bool`, found integer
+
+error: binary assignment operation `+=` cannot be used in a let chain
+ --> $DIR/let-chains-assign-add-incorrect.rs:22:23
+ |
+LL | if let _ = 1 && y += 2 {};
+ | -------------- ^^ cannot use `+=` in a let chain
+ | |
+ | you are add-assigning the right-hand side expression to the result of this let-chain
+ |
+help: you might have meant to compare with `==` instead of assigning with `+=`
+ |
+LL - if let _ = 1 && y += 2 {};
+LL + if let _ = 1 && y == 2 {};
+ |
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/resolve/bad-type-env-capture.stderr b/tests/ui/resolve/bad-type-env-capture.stderr
index c565997..ebddd70 100644
--- a/tests/ui/resolve/bad-type-env-capture.stderr
+++ b/tests/ui/resolve/bad-type-env-capture.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<T>(b: T) { }
diff --git a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr
index bc67e9d..8827d1b 100644
--- a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr
+++ b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr
@@ -4,10 +4,11 @@
LL | fn outer<T: Tr>() { // outer function
| - type parameter from outer item
LL | const K: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -17,10 +18,11 @@
| - type parameter from outer item
LL | const C: u32 = {
LL | const I: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -29,10 +31,11 @@
LL | struct S<T: Tr>(U32<{ // outer struct
| - type parameter from outer item
LL | const _: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
error: aborting due to 3 previous errors
diff --git a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr
index 3959d11..8ff9771 100644
--- a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr
+++ b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr
@@ -4,10 +4,11 @@
LL | fn outer<T: Tr>() { // outer function
| - type parameter from outer item
LL | const K: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
help: try introducing a local generic parameter here
|
@@ -21,10 +22,11 @@
| - type parameter from outer item
LL | const C: u32 = {
LL | const I: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
help: try introducing a local generic parameter here
|
@@ -37,10 +39,11 @@
LL | struct S<T: Tr>(U32<{ // outer struct
| - type parameter from outer item
LL | const _: u32 = T::C;
- | - ^^^^ use of generic parameter from outer item
+ | - ^ use of generic parameter from outer item
| |
| generic parameter used in this inner constant item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `const` is a separate item from the item that contains it
help: try introducing a local generic parameter here
|
diff --git a/tests/ui/resolve/issue-12796.stderr b/tests/ui/resolve/issue-12796.stderr
index b5828c6..af79508 100644
--- a/tests/ui/resolve/issue-12796.stderr
+++ b/tests/ui/resolve/issue-12796.stderr
@@ -7,6 +7,8 @@
| | use of `Self` from outer item
| | can't use `Self` here
| `Self` used in this inner function
+ |
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
error: aborting due to 1 previous error
diff --git a/tests/ui/resolve/issue-3021-c.stderr b/tests/ui/resolve/issue-3021-c.stderr
index 8c554fd..d521d4f 100644
--- a/tests/ui/resolve/issue-3021-c.stderr
+++ b/tests/ui/resolve/issue-3021-c.stderr
@@ -9,6 +9,7 @@
LL | fn g(&self, x: T) -> T;
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | trait U<T> {
@@ -25,6 +26,7 @@
LL | fn g(&self, x: T) -> T;
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | trait U<T> {
diff --git a/tests/ui/resolve/issue-3214.stderr b/tests/ui/resolve/issue-3214.stderr
index ab12676..573a8ba 100644
--- a/tests/ui/resolve/issue-3214.stderr
+++ b/tests/ui/resolve/issue-3214.stderr
@@ -8,6 +8,7 @@
LL | x: T,
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | struct Foo<T> {
diff --git a/tests/ui/resolve/issue-39559.stderr b/tests/ui/resolve/issue-39559.stderr
index 0aab54f..14c7a6a 100644
--- a/tests/ui/resolve/issue-39559.stderr
+++ b/tests/ui/resolve/issue-39559.stderr
@@ -2,7 +2,7 @@
--> $DIR/issue-39559.rs:14:18
|
LL | entries: [T; D::dim()],
- | ^^^^^^ cannot perform const operation using `D`
+ | ^ cannot perform const operation using `D`
|
= note: type parameters may not be used in const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
diff --git a/tests/ui/resolve/issue-65025-extern-static-parent-generics.stderr b/tests/ui/resolve/issue-65025-extern-static-parent-generics.stderr
index 2d21ed0..6ff8c82 100644
--- a/tests/ui/resolve/issue-65025-extern-static-parent-generics.stderr
+++ b/tests/ui/resolve/issue-65025-extern-static-parent-generics.stderr
@@ -10,6 +10,7 @@
LL | | }
| |_____- generic parameter used in this inner extern block
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error: aborting due to 1 previous error
diff --git a/tests/ui/resolve/issue-65035-static-with-parent-generics.stderr b/tests/ui/resolve/issue-65035-static-with-parent-generics.stderr
index b22bfb7..d3c8095 100644
--- a/tests/ui/resolve/issue-65035-static-with-parent-generics.stderr
+++ b/tests/ui/resolve/issue-65035-static-with-parent-generics.stderr
@@ -10,6 +10,7 @@
LL | | }
| |_____- generic parameter used in this inner extern block
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -22,6 +23,7 @@
| |
| generic parameter used in this inner static item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -36,6 +38,7 @@
LL | | }
| |_____- generic parameter used in this inner extern block
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -48,6 +51,7 @@
| |
| generic parameter used in this inner static item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error[E0401]: can't use generic parameters from outer item
@@ -60,6 +64,7 @@
| |
| generic parameter used in this inner static item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error: aborting due to 5 previous errors
diff --git a/tests/ui/resolve/resolve-type-param-in-item-in-trait.stderr b/tests/ui/resolve/resolve-type-param-in-item-in-trait.stderr
index 00aa645..69f41db 100644
--- a/tests/ui/resolve/resolve-type-param-in-item-in-trait.stderr
+++ b/tests/ui/resolve/resolve-type-param-in-item-in-trait.stderr
@@ -9,6 +9,7 @@
LL | Variance(A)
| ^ use of generic parameter from outer item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | enum Foo<A, B> {
@@ -25,6 +26,7 @@
| |
| generic parameter used in this inner struct
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | struct Foo<A, B>(A);
@@ -41,6 +43,7 @@
| |
| generic parameter used in this inner struct
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | struct Foo<A, B> { a: A }
@@ -57,6 +60,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn foo<A, B>(a: A) { }
diff --git a/tests/ui/resolve/use-self-in-inner-fn.rs b/tests/ui/resolve/use-self-in-inner-fn.rs
index ed64ee8..c9260ba 100644
--- a/tests/ui/resolve/use-self-in-inner-fn.rs
+++ b/tests/ui/resolve/use-self-in-inner-fn.rs
@@ -7,9 +7,32 @@ fn peach(this: &Self) {
//~^ ERROR can't use `Self` from outer item
//~| NOTE use of `Self` from outer item
//~| NOTE `Self` used in this inner function
- //~| NOTE refer to the type directly here instead
+ //~| HELP refer to the type directly here instead
+ //~| NOTE nested items are independent from their
}
}
}
+enum MyEnum {}
+
+impl MyEnum {
+//~^ NOTE `Self` type implicitly declared here, by this `impl`
+ fn do_something(result: impl FnOnce()) {
+ result();
+ }
+
+ fn do_something_extra() {
+ fn inner() {
+ //~^ NOTE `Self` used in this inner function
+ Self::do_something(move || {});
+ //~^ ERROR can't use `Self` from outer item
+ //~| NOTE use of `Self` from outer item
+ //~| HELP refer to the type directly here instead
+ //~| NOTE nested items are independent from their
+ MyEnum::do_something(move || {});
+ }
+ inner();
+ }
+}
+
fn main() {}
diff --git a/tests/ui/resolve/use-self-in-inner-fn.stderr b/tests/ui/resolve/use-self-in-inner-fn.stderr
index 645875f..78c609b 100644
--- a/tests/ui/resolve/use-self-in-inner-fn.stderr
+++ b/tests/ui/resolve/use-self-in-inner-fn.stderr
@@ -5,12 +5,36 @@
| ---- `Self` type implicitly declared here, by this `impl`
...
LL | fn peach(this: &Self) {
- | ----- ^^^^
- | | |
- | | use of `Self` from outer item
- | | refer to the type directly here instead
+ | ----- ^^^^ use of `Self` from outer item
+ | |
| `Self` used in this inner function
+ |
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
+help: refer to the type directly here instead
+ |
+LL - fn peach(this: &Self) {
+LL + fn peach(this: &A) {
+ |
-error: aborting due to 1 previous error
+error[E0401]: can't use `Self` from outer item
+ --> $DIR/use-self-in-inner-fn.rs:27:13
+ |
+LL | impl MyEnum {
+ | ---- `Self` type implicitly declared here, by this `impl`
+...
+LL | fn inner() {
+ | ----- `Self` used in this inner function
+LL |
+LL | Self::do_something(move || {});
+ | ^^^^ use of `Self` from outer item
+ |
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
+help: refer to the type directly here instead
+ |
+LL - Self::do_something(move || {});
+LL + MyEnum::do_something(move || {});
+ |
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0401`.
diff --git a/tests/ui/simd/masked-load-store-build-fail.rs b/tests/ui/simd/masked-load-store-build-fail.rs
index c711b6d..82866af 100644
--- a/tests/ui/simd/masked-load-store-build-fail.rs
+++ b/tests/ui/simd/masked-load-store-build-fail.rs
@@ -2,7 +2,7 @@
//@ ignore-backends: gcc
#![feature(repr_simd, core_intrinsics)]
-use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
+use std::intrinsics::simd::{SimdAlign, simd_masked_load, simd_masked_store};
#[derive(Copy, Clone)]
#[repr(simd)]
@@ -13,28 +13,60 @@ fn main() {
let mut arr = [4u8, 5, 6, 7];
let default = Simd::<u8, 4>([9; 4]);
- simd_masked_load(Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]), arr.as_ptr(), default);
- //~^ ERROR expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
+ //~v ERROR expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]),
+ arr.as_ptr(),
+ default,
+ );
- simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr() as *const i8, default);
- //~^ ERROR expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
+ //~v ERROR expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([-1, 0, -1, -1]),
+ arr.as_ptr() as *const i8,
+ default,
+ );
- simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u32, 4>([9; 4]));
- //~^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
+ //~v ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([-1, 0, -1, -1]),
+ arr.as_ptr(),
+ Simd::<u32, 4>([9; 4]),
+ );
- simd_masked_load(Simd::<f32, 4>([1.0, 0.0, 1.0, 1.0]), arr.as_ptr(), default);
- //~^ ERROR expected mask element type to be an integer, found `f32`
+ //~v ERROR expected mask element type to be an integer, found `f32`
+ simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<f32, 4>([1.0, 0.0, 1.0, 1.0]),
+ arr.as_ptr(),
+ default,
+ );
- simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u32; 4]));
- //~^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
+ //~v ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd([-1i8; 4]),
+ arr.as_ptr(),
+ Simd([5u32; 4]),
+ );
- simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u8; 4]));
- //~^ ERROR expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
+ //~v ERROR expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd([-1i8; 4]),
+ arr.as_ptr(),
+ Simd([5u8; 4]),
+ );
- simd_masked_store(Simd([-1i8; 4]), arr.as_mut_ptr(), Simd([5u8; 2]));
- //~^ ERROR expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
+ //~v ERROR expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd([-1i8; 4]),
+ arr.as_mut_ptr(),
+ Simd([5u8; 2]),
+ );
- simd_masked_store(Simd([1f32; 4]), arr.as_mut_ptr(), Simd([5u8; 4]));
- //~^ ERROR expected mask element type to be an integer, found `f32`
+ //~v ERROR expected mask element type to be an integer, found `f32`
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd([1f32; 4]),
+ arr.as_mut_ptr(),
+ Simd([5u8; 4]),
+ );
}
}
diff --git a/tests/ui/simd/masked-load-store-build-fail.stderr b/tests/ui/simd/masked-load-store-build-fail.stderr
index b9158f4..f2a9ecf 100644
--- a/tests/ui/simd/masked-load-store-build-fail.stderr
+++ b/tests/ui/simd/masked-load-store-build-fail.stderr
@@ -1,50 +1,82 @@
error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
- --> $DIR/masked-load-store-build-fail.rs:16:9
+ --> $DIR/masked-load-store-build-fail.rs:17:9
|
-LL | simd_masked_load(Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]), arr.as_ptr(), default);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]),
+LL | | arr.as_ptr(),
+LL | | default,
+LL | | );
+ | |_________^
error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
- --> $DIR/masked-load-store-build-fail.rs:19:9
+ --> $DIR/masked-load-store-build-fail.rs:24:9
|
-LL | simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr() as *const i8, default);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd::<i8, 4>([-1, 0, -1, -1]),
+LL | | arr.as_ptr() as *const i8,
+LL | | default,
+LL | | );
+ | |_________^
error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
- --> $DIR/masked-load-store-build-fail.rs:22:9
- |
-LL | simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u32, 4>([9; 4]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected mask element type to be an integer, found `f32`
- --> $DIR/masked-load-store-build-fail.rs:25:9
- |
-LL | simd_masked_load(Simd::<f32, 4>([1.0, 0.0, 1.0, 1.0]), arr.as_ptr(), default);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
- --> $DIR/masked-load-store-build-fail.rs:28:9
- |
-LL | simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u32; 4]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
--> $DIR/masked-load-store-build-fail.rs:31:9
|
-LL | simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u8; 4]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd::<i8, 4>([-1, 0, -1, -1]),
+LL | | arr.as_ptr(),
+LL | | Simd::<u32, 4>([9; 4]),
+LL | | );
+ | |_________^
+
+error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected mask element type to be an integer, found `f32`
+ --> $DIR/masked-load-store-build-fail.rs:38:9
+ |
+LL | / simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd::<f32, 4>([1.0, 0.0, 1.0, 1.0]),
+LL | | arr.as_ptr(),
+LL | | default,
+LL | | );
+ | |_________^
+
+error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
+ --> $DIR/masked-load-store-build-fail.rs:45:9
+ |
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd([-1i8; 4]),
+LL | | arr.as_ptr(),
+LL | | Simd([5u32; 4]),
+LL | | );
+ | |_________^
+
+error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
+ --> $DIR/masked-load-store-build-fail.rs:52:9
+ |
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd([-1i8; 4]),
+LL | | arr.as_ptr(),
+LL | | Simd([5u8; 4]),
+LL | | );
+ | |_________^
error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
- --> $DIR/masked-load-store-build-fail.rs:34:9
+ --> $DIR/masked-load-store-build-fail.rs:59:9
|
-LL | simd_masked_store(Simd([-1i8; 4]), arr.as_mut_ptr(), Simd([5u8; 2]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd([-1i8; 4]),
+LL | | arr.as_mut_ptr(),
+LL | | Simd([5u8; 2]),
+LL | | );
+ | |_________^
error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected mask element type to be an integer, found `f32`
- --> $DIR/masked-load-store-build-fail.rs:37:9
+ --> $DIR/masked-load-store-build-fail.rs:66:9
|
-LL | simd_masked_store(Simd([1f32; 4]), arr.as_mut_ptr(), Simd([5u8; 4]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+LL | | Simd([1f32; 4]),
+LL | | arr.as_mut_ptr(),
+LL | | Simd([5u8; 4]),
+LL | | );
+ | |_________^
error: aborting due to 8 previous errors
diff --git a/tests/ui/simd/masked-load-store-check-fail.rs b/tests/ui/simd/masked-load-store-check-fail.rs
index 3ed47cd..bd6448a 100644
--- a/tests/ui/simd/masked-load-store-check-fail.rs
+++ b/tests/ui/simd/masked-load-store-check-fail.rs
@@ -1,7 +1,7 @@
//@ check-fail
#![feature(repr_simd, core_intrinsics)]
-use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
+use std::intrinsics::simd::{SimdAlign, simd_masked_load, simd_masked_store};
#[derive(Copy, Clone)]
#[repr(simd)]
@@ -12,11 +12,18 @@ fn main() {
let mut arr = [4u8, 5, 6, 7];
let default = Simd::<u8, 4>([9; 4]);
- let _x: Simd<u8, 2> =
- simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
- //~^ ERROR mismatched types
+ let _x: Simd<u8, 2> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([-1, 0, -1, -1]),
+ arr.as_ptr(),
+ Simd::<u8, 4>([9; 4]),
+ );
+ //~^^ ERROR mismatched types
- let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
- //~^ ERROR mismatched types
+ let _x: Simd<u32, 4> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<u8, 4>([1, 0, 1, 1]),
+ arr.as_ptr(),
+ default,
+ );
+ //~^^ ERROR mismatched types
}
}
diff --git a/tests/ui/simd/masked-load-store-check-fail.stderr b/tests/ui/simd/masked-load-store-check-fail.stderr
index 1c9f9d2..4e63d04 100644
--- a/tests/ui/simd/masked-load-store-check-fail.stderr
+++ b/tests/ui/simd/masked-load-store-check-fail.stderr
@@ -1,36 +1,50 @@
error[E0308]: mismatched types
- --> $DIR/masked-load-store-check-fail.rs:16:76
+ --> $DIR/masked-load-store-check-fail.rs:18:13
|
-LL | simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
- | ---------------- arguments to this function are incorrect ^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4`
+LL | let _x: Simd<u8, 2> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ | --------------------------------------------------- arguments to this function are incorrect
+...
+LL | Simd::<u8, 4>([9; 4]),
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4`
|
= note: expected struct `Simd<_, 2>`
found struct `Simd<_, 4>`
help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
- --> $DIR/masked-load-store-check-fail.rs:16:13
+ --> $DIR/masked-load-store-check-fail.rs:15:31
|
-LL | simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------^
- | |
- | this argument influences the return type of `simd_masked_load`
+LL | let _x: Simd<u8, 2> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ | _______________________________^
+LL | | Simd::<i8, 4>([-1, 0, -1, -1]),
+LL | | arr.as_ptr(),
+LL | | Simd::<u8, 4>([9; 4]),
+ | | --------------------- this argument influences the return type of `simd_masked_load`
+LL | | );
+ | |_________^
note: function defined here
--> $SRC_DIR/core/src/intrinsics/simd.rs:LL:COL
error[E0308]: mismatched types
- --> $DIR/masked-load-store-check-fail.rs:19:92
+ --> $DIR/masked-load-store-check-fail.rs:25:13
|
-LL | let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
- | ---------------- arguments to this function are incorrect ^^^^^^^ expected `Simd<u32, 4>`, found `Simd<u8, 4>`
+LL | let _x: Simd<u32, 4> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ | --------------------------------------------------- arguments to this function are incorrect
+...
+LL | default,
+ | ^^^^^^^ expected `Simd<u32, 4>`, found `Simd<u8, 4>`
|
= note: expected struct `Simd<u32, _>`
found struct `Simd<u8, _>`
help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
- --> $DIR/masked-load-store-check-fail.rs:19:32
+ --> $DIR/masked-load-store-check-fail.rs:22:32
|
-LL | let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^
- | |
- | this argument influences the return type of `simd_masked_load`
+LL | let _x: Simd<u32, 4> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ | ________________________________^
+LL | | Simd::<u8, 4>([1, 0, 1, 1]),
+LL | | arr.as_ptr(),
+LL | | default,
+ | | ------- this argument influences the return type of `simd_masked_load`
+LL | | );
+ | |_________^
note: function defined here
--> $SRC_DIR/core/src/intrinsics/simd.rs:LL:COL
diff --git a/tests/ui/simd/masked-load-store.rs b/tests/ui/simd/masked-load-store.rs
index bc4307f..f6682ad 100644
--- a/tests/ui/simd/masked-load-store.rs
+++ b/tests/ui/simd/masked-load-store.rs
@@ -6,23 +6,34 @@
mod minisimd;
use minisimd::*;
-use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
+use std::intrinsics::simd::{SimdAlign, simd_masked_load, simd_masked_store};
fn main() {
unsafe {
let a = Simd::<u8, 4>([0, 1, 2, 3]);
let b_src = [4u8, 5, 6, 7];
let b_default = Simd::<u8, 4>([9; 4]);
- let b: Simd<u8, 4> =
- simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), b_src.as_ptr(), b_default);
+ let b: Simd<u8, 4> = simd_masked_load::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([-1, 0, -1, -1]),
+ b_src.as_ptr(),
+ b_default,
+ );
assert_eq!(b.as_array(), &[4, 9, 6, 7]);
let mut output = [u8::MAX; 5];
- simd_masked_store(Simd::<i8, 4>([-1, -1, -1, 0]), output.as_mut_ptr(), a);
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([-1, -1, -1, 0]),
+ output.as_mut_ptr(),
+ a,
+ );
assert_eq!(&output, &[0, 1, 2, u8::MAX, u8::MAX]);
- simd_masked_store(Simd::<i8, 4>([0, -1, -1, 0]), output[1..].as_mut_ptr(), b);
+ simd_masked_store::<_, _, _, { SimdAlign::Element }>(
+ Simd::<i8, 4>([0, -1, -1, 0]),
+ output[1..].as_mut_ptr(),
+ b,
+ );
assert_eq!(&output, &[0, 1, 9, 6, u8::MAX]);
}
}
diff --git a/tests/ui/span/E0536.rs b/tests/ui/span/E0536.rs
deleted file mode 100644
index ae07336..0000000
--- a/tests/ui/span/E0536.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub fn main() {
- if cfg!(not()) { } //~ ERROR E0536
-}
diff --git a/tests/ui/span/E0536.stderr b/tests/ui/span/E0536.stderr
deleted file mode 100644
index 6c25f91..0000000
--- a/tests/ui/span/E0536.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0536]: expected 1 cfg-pattern
- --> $DIR/E0536.rs:2:13
- |
-LL | if cfg!(not()) { }
- | ^^^^^
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0536`.
diff --git a/tests/ui/span/E0805.rs b/tests/ui/span/E0805.rs
new file mode 100644
index 0000000..097f5cd
--- /dev/null
+++ b/tests/ui/span/E0805.rs
@@ -0,0 +1,3 @@
+pub fn main() {
+ if cfg!(not()) { } //~ ERROR E0805
+}
diff --git a/tests/ui/span/E0805.stderr b/tests/ui/span/E0805.stderr
new file mode 100644
index 0000000..58c0e31
--- /dev/null
+++ b/tests/ui/span/E0805.stderr
@@ -0,0 +1,14 @@
+error[E0805]: malformed `cfg` macro input
+ --> $DIR/E0805.rs:2:8
+ |
+LL | if cfg!(not()) { }
+ | ^^^^^^^^--^
+ | | |
+ | | expected a single argument here
+ | help: must be of the form: `cfg(predicate)`
+ |
+ = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0805`.
diff --git a/tests/ui/stack-probes/aarch64-unknown-uefi-chkstk-98254.rs b/tests/ui/stack-probes/aarch64-unknown-uefi-chkstk-98254.rs
new file mode 100644
index 0000000..36273d5
--- /dev/null
+++ b/tests/ui/stack-probes/aarch64-unknown-uefi-chkstk-98254.rs
@@ -0,0 +1,16 @@
+//! Regression test for #98254, missing `__chkstk` symbol on `aarch64-unknown-uefi`.
+//@ build-pass
+//@ only-aarch64-unknown-uefi
+//@ compile-flags: -Cpanic=abort
+//@ compile-flags: -Clinker=rust-lld
+#![no_std]
+#![no_main]
+#[panic_handler]
+fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
+
+#[export_name = "efi_main"]
+fn main() {
+ let b = [0; 1024];
+}
diff --git a/tests/ui/statics/static-generic-param-soundness.stderr b/tests/ui/statics/static-generic-param-soundness.stderr
index 72f65e2..32c2522 100644
--- a/tests/ui/statics/static-generic-param-soundness.stderr
+++ b/tests/ui/statics/static-generic-param-soundness.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner static item
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
= note: a `static` is a separate item from the item that contains it
error[E0392]: type parameter `T` is never used
diff --git a/tests/ui/type/pattern_types/assoc_const.default.stderr b/tests/ui/type/pattern_types/assoc_const.default.stderr
index 8cff0ce..00d5ac6 100644
--- a/tests/ui/type/pattern_types/assoc_const.default.stderr
+++ b/tests/ui/type/pattern_types/assoc_const.default.stderr
@@ -20,7 +20,7 @@
--> $DIR/assoc_const.rs:20:40
|
LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {}
- | ^^^^^^^^ cannot perform const operation using `T`
+ | ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
@@ -29,7 +29,7 @@
--> $DIR/assoc_const.rs:20:51
|
LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {}
- | ^^^^^^ cannot perform const operation using `T`
+ | ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
diff --git a/tests/ui/type/type-arg-out-of-scope.stderr b/tests/ui/type/type-arg-out-of-scope.stderr
index 3d8850e..56fecdb 100644
--- a/tests/ui/type/type-arg-out-of-scope.stderr
+++ b/tests/ui/type/type-arg-out-of-scope.stderr
@@ -8,6 +8,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<T>(f: Box<dyn FnMut(T) -> T>) { }
@@ -23,6 +24,7 @@
| |
| generic parameter used in this inner function
|
+ = note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
|
LL | fn bar<T>(f: Box<dyn FnMut(T) -> T>) { }
diff --git a/tests/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr b/tests/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr
index cbe4286..f82faee 100644
--- a/tests/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr
+++ b/tests/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr
@@ -4,6 +4,8 @@
LL | fn call<F>(f: F) where F : Fn() {
| - change this to accept `FnMut` instead of `Fn`
...
+LL | let mut counter = 0;
+ | ----------- `counter` declared here, outside the closure
LL | call(|| {
| ---- -- in this closure
| |
diff --git a/tests/ui/wasm/auxiliary/link-name-in-foreign-crate.rs b/tests/ui/wasm/auxiliary/link-name-in-foreign-crate.rs
new file mode 100644
index 0000000..69d5085
--- /dev/null
+++ b/tests/ui/wasm/auxiliary/link-name-in-foreign-crate.rs
@@ -0,0 +1,7 @@
+#![no_std]
+
+#[link(wasm_import_module = "test")]
+unsafe extern "C" {
+ #[link_name = "close"]
+ pub fn close(x: u32) -> u32;
+}
diff --git a/tests/ui/wasm/wasm-link-name-in-foreign-crate-respected.rs b/tests/ui/wasm/wasm-link-name-in-foreign-crate-respected.rs
new file mode 100644
index 0000000..e2ceeb8
--- /dev/null
+++ b/tests/ui/wasm/wasm-link-name-in-foreign-crate-respected.rs
@@ -0,0 +1,22 @@
+//@ only-wasm32
+//@ aux-build:link-name-in-foreign-crate.rs
+//@ compile-flags: --crate-type cdylib
+//@ build-pass
+//@ no-prefer-dynamic
+
+extern crate link_name_in_foreign_crate;
+
+// This test that the definition of a function named `close`, which collides
+// with the `close` function in libc in theory, is handled correctly in
+// cross-crate situations. The `link_name_in_foreign_crate` dependency declares
+// `close` from a non-`env` wasm import module and then this crate attempts to
+// use the symbol. This should properly ensure that the wasm module name is
+// tagged as `test` and the `close` symbol, to LLD, is mangled, to avoid
+// colliding with the `close` symbol in libc itself.
+
+#[unsafe(no_mangle)]
+pub extern "C" fn foo() {
+ unsafe {
+ link_name_in_foreign_crate::close(1);
+ }
+}