| author | bors <bors@rust-lang.org> 2026-01-12 16:43:20 UTC |
| committer | bors <bors@rust-lang.org> 2026-01-12 16:43:20 UTC |
| log | aefa10405d7b67b3780027484cb02c85d3a3bf36 |
| tree | 6e2d101397ca5f9eabe717bb052a58eafa215b01 |
| parent | 137716908d561bfcf0341701ec13a28326926c82 |
| parent | db4c095147b97c28de43dd562f6611add006df89 |
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#150861 (Folding/`ReErased` cleanups)
- rust-lang/rust#150869 (Emit error instead of delayed bug when meeting mismatch type for const tuple)
- rust-lang/rust#150920 (Use a hook to decouple `rustc_mir_transform` from `rustc_mir_build`)
- rust-lang/rust#150941 (rustc_parse_format: improve diagnostics for unsupported python numeric grouping)
- rust-lang/rust#150972 (Rename EII attributes slightly (being consistent in naming things foreign items, not extern items))
- rust-lang/rust#150980 (Use updated indexes to build reverse map for delegation generics)
- rust-lang/rust#150986 (std: Fix size returned by UEFI tcp4 read operations)
- rust-lang/rust#150996 (Remove `S-waiting-on-bors` after a PR is merged)
r? @ghost74 files changed, 350 insertions(+), 299 deletions(-)
Cargo.lock-1| ... | ... | @@ -4360,7 +4360,6 @@ dependencies = [ |
| 4360 | 4360 | "rustc_infer", |
| 4361 | 4361 | "rustc_macros", |
| 4362 | 4362 | "rustc_middle", |
| 4363 | "rustc_mir_build", | |
| 4364 | 4363 | "rustc_mir_dataflow", |
| 4365 | 4364 | "rustc_session", |
| 4366 | 4365 | "rustc_span", |
compiler/rustc_ast/src/ast.rs+9-7| ... | ... | @@ -2109,16 +2109,18 @@ pub struct MacroDef { |
| 2109 | 2109 | /// `true` if macro was defined with `macro_rules`. |
| 2110 | 2110 | pub macro_rules: bool, |
| 2111 | 2111 | |
| 2112 | /// If this is a macro used for externally implementable items, | |
| 2113 | /// it refers to an extern item which is its "target". This requires | |
| 2114 | /// name resolution so can't just be an attribute, so we store it in this field. | |
| 2115 | pub eii_extern_target: Option<EiiExternTarget>, | |
| 2112 | /// Corresponds to `#[eii_declaration(...)]`. | |
| 2113 | /// `#[eii_declaration(...)]` is a built-in attribute macro, not a built-in attribute, | |
| 2114 | /// because we require some name resolution to occur in the parameters of this attribute. | |
| 2115 | /// Name resolution isn't possible in attributes otherwise, so we encode it in the AST. | |
| 2116 | /// During ast lowering, we turn it back into an attribute again | |
| 2117 | pub eii_declaration: Option<EiiDecl>, | |
| 2116 | 2118 | } |
| 2117 | 2119 | |
| 2118 | 2120 | #[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] |
| 2119 | pub struct EiiExternTarget { | |
| 2121 | pub struct EiiDecl { | |
| 2120 | 2122 | /// path to the extern item we're targeting |
| 2121 | pub extern_item_path: Path, | |
| 2123 | pub foreign_item: Path, | |
| 2122 | 2124 | pub impl_unsafe: bool, |
| 2123 | 2125 | } |
| 2124 | 2126 | |
| ... | ... | @@ -3824,7 +3826,7 @@ pub struct EiiImpl { |
| 3824 | 3826 | /// |
| 3825 | 3827 | /// This field is that shortcut: we prefill the extern target to skip a name resolution step, |
| 3826 | 3828 | /// making sure it never fails. It'd be awful UX if we fail name resolution in code invisible to the user. |
| 3827 | pub known_eii_macro_resolution: Option<EiiExternTarget>, | |
| 3829 | pub known_eii_macro_resolution: Option<EiiDecl>, | |
| 3828 | 3830 | pub impl_safety: Safety, |
| 3829 | 3831 | pub span: Span, |
| 3830 | 3832 | pub inner_span: Span, |
compiler/rustc_ast/src/visit.rs+1-1| ... | ... | @@ -489,7 +489,7 @@ macro_rules! common_visitor_and_walkers { |
| 489 | 489 | WhereEqPredicate, |
| 490 | 490 | WhereRegionPredicate, |
| 491 | 491 | YieldKind, |
| 492 | EiiExternTarget, | |
| 492 | EiiDecl, | |
| 493 | 493 | EiiImpl, |
| 494 | 494 | ); |
| 495 | 495 |
compiler/rustc_ast_lowering/src/item.rs+16-19| ... | ... | @@ -2,7 +2,7 @@ use rustc_abi::ExternAbi; |
| 2 | 2 | use rustc_ast::visit::AssocCtxt; |
| 3 | 3 | use rustc_ast::*; |
| 4 | 4 | use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err}; |
| 5 | use rustc_hir::attrs::{AttributeKind, EiiDecl, EiiImplResolution}; | |
| 5 | use rustc_hir::attrs::{AttributeKind, EiiImplResolution}; | |
| 6 | 6 | use rustc_hir::def::{DefKind, PerNS, Res}; |
| 7 | 7 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; |
| 8 | 8 | use rustc_hir::{ |
| ... | ... | @@ -134,16 +134,16 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | fn lower_eii_extern_target( | |
| 137 | fn lower_eii_decl( | |
| 138 | 138 | &mut self, |
| 139 | 139 | id: NodeId, |
| 140 | eii_name: Ident, | |
| 141 | EiiExternTarget { extern_item_path, impl_unsafe }: &EiiExternTarget, | |
| 142 | ) -> Option<EiiDecl> { | |
| 143 | self.lower_path_simple_eii(id, extern_item_path).map(|did| EiiDecl { | |
| 144 | eii_extern_target: did, | |
| 140 | name: Ident, | |
| 141 | EiiDecl { foreign_item, impl_unsafe }: &EiiDecl, | |
| 142 | ) -> Option<hir::attrs::EiiDecl> { | |
| 143 | self.lower_path_simple_eii(id, foreign_item).map(|did| hir::attrs::EiiDecl { | |
| 144 | foreign_item: did, | |
| 145 | 145 | impl_unsafe: *impl_unsafe, |
| 146 | name: eii_name, | |
| 146 | name, | |
| 147 | 147 | }) |
| 148 | 148 | } |
| 149 | 149 | |
| ... | ... | @@ -160,7 +160,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 160 | 160 | }: &EiiImpl, |
| 161 | 161 | ) -> hir::attrs::EiiImpl { |
| 162 | 162 | let resolution = if let Some(target) = known_eii_macro_resolution |
| 163 | && let Some(decl) = self.lower_eii_extern_target( | |
| 163 | && let Some(decl) = self.lower_eii_decl( | |
| 164 | 164 | *node_id, |
| 165 | 165 | // the expect is ok here since we always generate this path in the eii macro. |
| 166 | 166 | eii_macro_path.segments.last().expect("at least one segment").ident, |
| ... | ... | @@ -196,9 +196,9 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 196 | 196 | eii_impls.iter().map(|i| self.lower_eii_impl(i)).collect(), |
| 197 | 197 | ))] |
| 198 | 198 | } |
| 199 | ItemKind::MacroDef(name, MacroDef { eii_extern_target: Some(target), .. }) => self | |
| 200 | .lower_eii_extern_target(id, *name, target) | |
| 201 | .map(|decl| vec![hir::Attribute::Parsed(AttributeKind::EiiExternTarget(decl))]) | |
| 199 | ItemKind::MacroDef(name, MacroDef { eii_declaration: Some(target), .. }) => self | |
| 200 | .lower_eii_decl(id, *name, target) | |
| 201 | .map(|decl| vec![hir::Attribute::Parsed(AttributeKind::EiiDeclaration(decl))]) | |
| 202 | 202 | .unwrap_or_default(), |
| 203 | 203 | |
| 204 | 204 | ItemKind::ExternCrate(..) |
| ... | ... | @@ -242,10 +242,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 242 | 242 | vis_span, |
| 243 | 243 | span: self.lower_span(i.span), |
| 244 | 244 | has_delayed_lints: !self.delayed_lints.is_empty(), |
| 245 | eii: find_attr!( | |
| 246 | attrs, | |
| 247 | AttributeKind::EiiImpls(..) | AttributeKind::EiiExternTarget(..) | |
| 248 | ), | |
| 245 | eii: find_attr!(attrs, AttributeKind::EiiImpls(..) | AttributeKind::EiiDeclaration(..)), | |
| 249 | 246 | }; |
| 250 | 247 | self.arena.alloc(item) |
| 251 | 248 | } |
| ... | ... | @@ -539,7 +536,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 539 | 536 | ); |
| 540 | 537 | hir::ItemKind::TraitAlias(constness, ident, generics, bounds) |
| 541 | 538 | } |
| 542 | ItemKind::MacroDef(ident, MacroDef { body, macro_rules, eii_extern_target: _ }) => { | |
| 539 | ItemKind::MacroDef(ident, MacroDef { body, macro_rules, eii_declaration: _ }) => { | |
| 543 | 540 | let ident = self.lower_ident(*ident); |
| 544 | 541 | let body = Box::new(self.lower_delim_args(body)); |
| 545 | 542 | let def_id = self.local_def_id(id); |
| ... | ... | @@ -553,7 +550,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 553 | 550 | let macro_def = self.arena.alloc(ast::MacroDef { |
| 554 | 551 | body, |
| 555 | 552 | macro_rules: *macro_rules, |
| 556 | eii_extern_target: None, | |
| 553 | eii_declaration: None, | |
| 557 | 554 | }); |
| 558 | 555 | hir::ItemKind::Macro(ident, macro_def, macro_kinds) |
| 559 | 556 | } |
| ... | ... | @@ -693,7 +690,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 693 | 690 | has_delayed_lints: !this.delayed_lints.is_empty(), |
| 694 | 691 | eii: find_attr!( |
| 695 | 692 | attrs, |
| 696 | AttributeKind::EiiImpls(..) | AttributeKind::EiiExternTarget(..) | |
| 693 | AttributeKind::EiiImpls(..) | AttributeKind::EiiDeclaration(..) | |
| 697 | 694 | ), |
| 698 | 695 | }; |
| 699 | 696 | hir::OwnerNode::Item(this.arena.alloc(item)) |
compiler/rustc_ast_pretty/src/pprust/state.rs+4-4| ... | ... | @@ -865,10 +865,10 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere |
| 865 | 865 | sp: Span, |
| 866 | 866 | print_visibility: impl FnOnce(&mut Self), |
| 867 | 867 | ) { |
| 868 | if let Some(eii_extern_target) = &macro_def.eii_extern_target { | |
| 869 | self.word("#[eii_extern_target("); | |
| 870 | self.print_path(&eii_extern_target.extern_item_path, false, 0); | |
| 871 | if eii_extern_target.impl_unsafe { | |
| 868 | if let Some(eii_decl) = &macro_def.eii_declaration { | |
| 869 | self.word("#[eii_declaration("); | |
| 870 | self.print_path(&eii_decl.foreign_item, false, 0); | |
| 871 | if eii_decl.impl_unsafe { | |
| 872 | 872 | self.word(","); |
| 873 | 873 | self.space(); |
| 874 | 874 | self.word("unsafe"); |
compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs+4-4| ... | ... | @@ -709,11 +709,11 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcPassIndirectlyInNonRusticAbisPa |
| 709 | 709 | const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPassIndirectlyInNonRusticAbis; |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | pub(crate) struct EiiExternItemParser; | |
| 712 | pub(crate) struct EiiForeignItemParser; | |
| 713 | 713 | |
| 714 | impl<S: Stage> NoArgsAttributeParser<S> for EiiExternItemParser { | |
| 715 | const PATH: &[Symbol] = &[sym::rustc_eii_extern_item]; | |
| 714 | impl<S: Stage> NoArgsAttributeParser<S> for EiiForeignItemParser { | |
| 715 | const PATH: &[Symbol] = &[sym::rustc_eii_foreign_item]; | |
| 716 | 716 | const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error; |
| 717 | 717 | const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]); |
| 718 | const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::EiiExternItem; | |
| 718 | const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::EiiForeignItem; | |
| 719 | 719 | } |
compiler/rustc_attr_parsing/src/context.rs+2-2| ... | ... | @@ -21,7 +21,7 @@ use crate::attributes::allow_unstable::{ |
| 21 | 21 | use crate::attributes::body::CoroutineParser; |
| 22 | 22 | use crate::attributes::cfi_encoding::CfiEncodingParser; |
| 23 | 23 | use crate::attributes::codegen_attrs::{ |
| 24 | ColdParser, CoverageParser, EiiExternItemParser, ExportNameParser, ForceTargetFeatureParser, | |
| 24 | ColdParser, CoverageParser, EiiForeignItemParser, ExportNameParser, ForceTargetFeatureParser, | |
| 25 | 25 | NakedParser, NoMangleParser, ObjcClassParser, ObjcSelectorParser, OptimizeParser, |
| 26 | 26 | RustcPassIndirectlyInNonRusticAbisParser, SanitizeParser, TargetFeatureParser, |
| 27 | 27 | ThreadLocalParser, TrackCallerParser, UsedParser, |
| ... | ... | @@ -243,7 +243,7 @@ attribute_parsers!( |
| 243 | 243 | Single<WithoutArgs<CoroutineParser>>, |
| 244 | 244 | Single<WithoutArgs<DenyExplicitImplParser>>, |
| 245 | 245 | Single<WithoutArgs<DoNotImplementViaObjectParser>>, |
| 246 | Single<WithoutArgs<EiiExternItemParser>>, | |
| 246 | Single<WithoutArgs<EiiForeignItemParser>>, | |
| 247 | 247 | Single<WithoutArgs<ExportStableParser>>, |
| 248 | 248 | Single<WithoutArgs<FfiConstParser>>, |
| 249 | 249 | Single<WithoutArgs<FfiPureParser>>, |
compiler/rustc_builtin_macros/messages.ftl+3-3| ... | ... | @@ -151,9 +151,9 @@ builtin_macros_derive_path_args_value = traits in `#[derive(...)]` don't accept |
| 151 | 151 | |
| 152 | 152 | builtin_macros_duplicate_macro_attribute = duplicated attribute |
| 153 | 153 | |
| 154 | builtin_macros_eii_extern_target_expected_list = `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 155 | builtin_macros_eii_extern_target_expected_macro = `#[eii_extern_target(...)]` is only valid on macros | |
| 156 | builtin_macros_eii_extern_target_expected_unsafe = expected this argument to be "unsafe" | |
| 154 | builtin_macros_eii_declaration_expected_list = `#[eii_declaration(...)]` expects a list of one or two elements | |
| 155 | builtin_macros_eii_declaration_expected_macro = `#[eii_declaration(...)]` is only valid on macros | |
| 156 | builtin_macros_eii_declaration_expected_unsafe = expected this argument to be "unsafe" | |
| 157 | 157 | .note = the second argument is optional |
| 158 | 158 | |
| 159 | 159 | builtin_macros_eii_only_once = `#[{$name}]` can only be specified once |
compiler/rustc_builtin_macros/src/eii.rs+12-12| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::token::{Delimiter, TokenKind}; |
| 2 | 2 | use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; |
| 3 | 3 | use rustc_ast::{ |
| 4 | Attribute, DUMMY_NODE_ID, EiiExternTarget, EiiImpl, ItemKind, MetaItem, Path, Stmt, StmtKind, | |
| 4 | Attribute, DUMMY_NODE_ID, EiiDecl, EiiImpl, ItemKind, MetaItem, Path, Stmt, StmtKind, | |
| 5 | 5 | Visibility, ast, |
| 6 | 6 | }; |
| 7 | 7 | use rustc_ast_pretty::pprust::path_to_string; |
| ... | ... | @@ -30,7 +30,7 @@ use crate::errors::{ |
| 30 | 30 | /// } |
| 31 | 31 | /// |
| 32 | 32 | /// #[rustc_builtin_macro(eii_shared_macro)] |
| 33 | /// #[eii_extern_target(panic_handler)] | |
| 33 | /// #[eii_declaration(panic_handler)] | |
| 34 | 34 | /// macro panic_handler() {} |
| 35 | 35 | /// ``` |
| 36 | 36 | pub(crate) fn eii( |
| ... | ... | @@ -210,8 +210,8 @@ fn generate_default_impl( |
| 210 | 210 | }, |
| 211 | 211 | span: eii_attr_span, |
| 212 | 212 | is_default: true, |
| 213 | known_eii_macro_resolution: Some(ast::EiiExternTarget { | |
| 214 | extern_item_path: ecx.path( | |
| 213 | known_eii_macro_resolution: Some(ast::EiiDecl { | |
| 214 | foreign_item: ecx.path( | |
| 215 | 215 | foreign_item_name.span, |
| 216 | 216 | // prefix super to escape the `dflt` module generated below |
| 217 | 217 | vec![Ident::from_str_and_span("super", foreign_item_name.span), foreign_item_name], |
| ... | ... | @@ -295,9 +295,9 @@ fn generate_foreign_item( |
| 295 | 295 | let mut foreign_item_attrs = ThinVec::new(); |
| 296 | 296 | foreign_item_attrs.extend_from_slice(attrs_from_decl); |
| 297 | 297 | |
| 298 | // Add the rustc_eii_extern_item on the foreign item. Usually, foreign items are mangled. | |
| 298 | // Add the rustc_eii_foreign_item on the foreign item. Usually, foreign items are mangled. | |
| 299 | 299 | // This attribute makes sure that we later know that this foreign item's symbol should not be. |
| 300 | foreign_item_attrs.push(ecx.attr_word(sym::rustc_eii_extern_item, eii_attr_span)); | |
| 300 | foreign_item_attrs.push(ecx.attr_word(sym::rustc_eii_foreign_item, eii_attr_span)); | |
| 301 | 301 | |
| 302 | 302 | let abi = match func.sig.header.ext { |
| 303 | 303 | // extern "X" fn => extern "X" {} |
| ... | ... | @@ -349,7 +349,7 @@ fn generate_foreign_item( |
| 349 | 349 | /// // This attribute tells the compiler that |
| 350 | 350 | /// #[builtin_macro(eii_shared_macro)] |
| 351 | 351 | /// // the metadata to link this macro to the generated foreign item. |
| 352 | /// #[eii_extern_target(<related_reign_item>)] | |
| 352 | /// #[eii_declaration(<related_foreign_item>)] | |
| 353 | 353 | /// macro macro_name { () => {} } |
| 354 | 354 | /// ``` |
| 355 | 355 | fn generate_attribute_macro_to_implement( |
| ... | ... | @@ -401,9 +401,9 @@ fn generate_attribute_macro_to_implement( |
| 401 | 401 | ]), |
| 402 | 402 | }), |
| 403 | 403 | macro_rules: false, |
| 404 | // #[eii_extern_target(foreign_item_ident)] | |
| 405 | eii_extern_target: Some(ast::EiiExternTarget { | |
| 406 | extern_item_path: ast::Path::from_ident(foreign_item_name), | |
| 404 | // #[eii_declaration(foreign_item_ident)] | |
| 405 | eii_declaration: Some(ast::EiiDecl { | |
| 406 | foreign_item: ast::Path::from_ident(foreign_item_name), | |
| 407 | 407 | impl_unsafe, |
| 408 | 408 | }), |
| 409 | 409 | }, |
| ... | ... | @@ -412,7 +412,7 @@ fn generate_attribute_macro_to_implement( |
| 412 | 412 | }) |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | pub(crate) fn eii_extern_target( | |
| 415 | pub(crate) fn eii_declaration( | |
| 416 | 416 | ecx: &mut ExtCtxt<'_>, |
| 417 | 417 | span: Span, |
| 418 | 418 | meta_item: &ast::MetaItem, |
| ... | ... | @@ -461,7 +461,7 @@ pub(crate) fn eii_extern_target( |
| 461 | 461 | false |
| 462 | 462 | }; |
| 463 | 463 | |
| 464 | d.eii_extern_target = Some(EiiExternTarget { extern_item_path, impl_unsafe }); | |
| 464 | d.eii_declaration = Some(EiiDecl { foreign_item: extern_item_path, impl_unsafe }); | |
| 465 | 465 | |
| 466 | 466 | // Return the original item and the new methods. |
| 467 | 467 | vec![item] |
compiler/rustc_builtin_macros/src/errors.rs+3-3| ... | ... | @@ -1010,21 +1010,21 @@ pub(crate) struct CfgSelectUnreachable { |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | #[derive(Diagnostic)] |
| 1013 | #[diag(builtin_macros_eii_extern_target_expected_macro)] | |
| 1013 | #[diag(builtin_macros_eii_declaration_expected_macro)] | |
| 1014 | 1014 | pub(crate) struct EiiExternTargetExpectedMacro { |
| 1015 | 1015 | #[primary_span] |
| 1016 | 1016 | pub span: Span, |
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | #[derive(Diagnostic)] |
| 1020 | #[diag(builtin_macros_eii_extern_target_expected_list)] | |
| 1020 | #[diag(builtin_macros_eii_declaration_expected_list)] | |
| 1021 | 1021 | pub(crate) struct EiiExternTargetExpectedList { |
| 1022 | 1022 | #[primary_span] |
| 1023 | 1023 | pub span: Span, |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | #[derive(Diagnostic)] |
| 1027 | #[diag(builtin_macros_eii_extern_target_expected_unsafe)] | |
| 1027 | #[diag(builtin_macros_eii_declaration_expected_unsafe)] | |
| 1028 | 1028 | pub(crate) struct EiiExternTargetExpectedUnsafe { |
| 1029 | 1029 | #[primary_span] |
| 1030 | 1030 | #[note] |
compiler/rustc_builtin_macros/src/lib.rs+1-1| ... | ... | @@ -119,7 +119,7 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) { |
| 119 | 119 | derive: derive::Expander { is_const: false }, |
| 120 | 120 | derive_const: derive::Expander { is_const: true }, |
| 121 | 121 | eii: eii::eii, |
| 122 | eii_extern_target: eii::eii_extern_target, | |
| 122 | eii_declaration: eii::eii_declaration, | |
| 123 | 123 | eii_shared_macro: eii::eii_shared_macro, |
| 124 | 124 | global_allocator: global_allocator::expand, |
| 125 | 125 | test: test::expand_test, |
compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs-1| ... | ... | @@ -1520,7 +1520,6 @@ pub(crate) fn apply_vcall_visibility_metadata<'ll, 'tcx>( |
| 1520 | 1520 | // Unwrap potential addrspacecast |
| 1521 | 1521 | let vtable = find_vtable_behind_cast(vtable); |
| 1522 | 1522 | let trait_ref_self = trait_ref.with_self_ty(cx.tcx, ty); |
| 1523 | let trait_ref_self = cx.tcx.erase_and_anonymize_regions(trait_ref_self); | |
| 1524 | 1523 | let trait_def_id = trait_ref_self.def_id; |
| 1525 | 1524 | let trait_vis = cx.tcx.visibility(trait_def_id); |
| 1526 | 1525 |
compiler/rustc_codegen_ssa/src/codegen_attrs.rs+6-6| ... | ... | @@ -282,16 +282,16 @@ fn process_builtin_attrs( |
| 282 | 282 | AttributeKind::ObjcSelector { methname, .. } => { |
| 283 | 283 | codegen_fn_attrs.objc_selector = Some(*methname); |
| 284 | 284 | } |
| 285 | AttributeKind::EiiExternItem => { | |
| 285 | AttributeKind::EiiForeignItem => { | |
| 286 | 286 | codegen_fn_attrs.flags |= CodegenFnAttrFlags::EXTERNALLY_IMPLEMENTABLE_ITEM; |
| 287 | 287 | } |
| 288 | 288 | AttributeKind::EiiImpls(impls) => { |
| 289 | 289 | for i in impls { |
| 290 | let extern_item = match i.resolution { | |
| 290 | let foreign_item = match i.resolution { | |
| 291 | 291 | EiiImplResolution::Macro(def_id) => { |
| 292 | 292 | let Some(extern_item) = find_attr!( |
| 293 | 293 | tcx.get_all_attrs(def_id), |
| 294 | AttributeKind::EiiExternTarget(target) => target.eii_extern_target | |
| 294 | AttributeKind::EiiDeclaration(target) => target.foreign_item | |
| 295 | 295 | ) else { |
| 296 | 296 | tcx.dcx().span_delayed_bug( |
| 297 | 297 | i.span, |
| ... | ... | @@ -301,7 +301,7 @@ fn process_builtin_attrs( |
| 301 | 301 | }; |
| 302 | 302 | extern_item |
| 303 | 303 | } |
| 304 | EiiImplResolution::Known(decl) => decl.eii_extern_target, | |
| 304 | EiiImplResolution::Known(decl) => decl.foreign_item, | |
| 305 | 305 | EiiImplResolution::Error(_eg) => continue, |
| 306 | 306 | }; |
| 307 | 307 | |
| ... | ... | @@ -316,13 +316,13 @@ fn process_builtin_attrs( |
| 316 | 316 | // iterate over all implementations *in the current crate* |
| 317 | 317 | // (this is ok since we generate codegen fn attrs in the local crate) |
| 318 | 318 | // if any of them is *not default* then don't emit the alias. |
| 319 | && tcx.externally_implementable_items(LOCAL_CRATE).get(&extern_item).expect("at least one").1.iter().any(|(_, imp)| !imp.is_default) | |
| 319 | && tcx.externally_implementable_items(LOCAL_CRATE).get(&foreign_item).expect("at least one").1.iter().any(|(_, imp)| !imp.is_default) | |
| 320 | 320 | { |
| 321 | 321 | continue; |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | codegen_fn_attrs.foreign_item_symbol_aliases.push(( |
| 325 | extern_item, | |
| 325 | foreign_item, | |
| 326 | 326 | if i.is_default { Linkage::LinkOnceAny } else { Linkage::External }, |
| 327 | 327 | Visibility::Default, |
| 328 | 328 | )); |
compiler/rustc_const_eval/src/interpret/intrinsics.rs+3-8| ... | ... | @@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt; |
| 13 | 13 | use rustc_middle::mir::interpret::{CTFE_ALLOC_SALT, read_target_uint, write_target_uint}; |
| 14 | 14 | use rustc_middle::mir::{self, BinOp, ConstValue, NonDivergingIntrinsic}; |
| 15 | 15 | use rustc_middle::ty::layout::TyAndLayout; |
| 16 | use rustc_middle::ty::{FloatTy, PolyExistentialPredicate, Ty, TyCtxt, TypeFoldable}; | |
| 16 | use rustc_middle::ty::{FloatTy, PolyExistentialPredicate, Ty, TyCtxt}; | |
| 17 | 17 | use rustc_middle::{bug, span_bug, ty}; |
| 18 | 18 | use rustc_span::{Symbol, sym}; |
| 19 | 19 | use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt}; |
| ... | ... | @@ -243,13 +243,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 243 | 243 | ocx.register_obligations(preds.iter().map(|pred: PolyExistentialPredicate<'_>| { |
| 244 | 244 | let pred = pred.with_self_ty(tcx, tp_ty); |
| 245 | 245 | // Lifetimes can only be 'static because of the bound on T |
| 246 | let pred = pred.fold_with(&mut ty::BottomUpFolder { | |
| 247 | tcx, | |
| 248 | ty_op: |ty| ty, | |
| 249 | lt_op: |lt| { | |
| 250 | if lt == tcx.lifetimes.re_erased { tcx.lifetimes.re_static } else { lt } | |
| 251 | }, | |
| 252 | ct_op: |ct| ct, | |
| 246 | let pred = ty::fold_regions(tcx, pred, |r, _| { | |
| 247 | if r == tcx.lifetimes.re_erased { tcx.lifetimes.re_static } else { r } | |
| 253 | 248 | }); |
| 254 | 249 | Obligation::new(tcx, ObligationCause::dummy(), param_env, pred) |
| 255 | 250 | })); |
compiler/rustc_feature/src/builtin_attrs.rs+1-1| ... | ... | @@ -962,7 +962,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ |
| 962 | 962 | EncodeCrossCrate::No, "allow_internal_unsafe side-steps the unsafe_code lint", |
| 963 | 963 | ), |
| 964 | 964 | gated!( |
| 965 | rustc_eii_extern_item, Normal, template!(Word), | |
| 965 | rustc_eii_foreign_item, Normal, template!(Word), | |
| 966 | 966 | ErrorFollowing, EncodeCrossCrate::Yes, eii_internals, |
| 967 | 967 | "used internally to mark types with a `transparent` representation when it is guaranteed by the documentation", |
| 968 | 968 | ), |
compiler/rustc_hir/src/attrs/data_structures.rs+3-3| ... | ... | @@ -43,7 +43,7 @@ pub struct EiiImpl { |
| 43 | 43 | |
| 44 | 44 | #[derive(Copy, Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] |
| 45 | 45 | pub struct EiiDecl { |
| 46 | pub eii_extern_target: DefId, | |
| 46 | pub foreign_item: DefId, | |
| 47 | 47 | /// whether or not it is unsafe to implement this EII |
| 48 | 48 | pub impl_unsafe: bool, |
| 49 | 49 | pub name: Ident, |
| ... | ... | @@ -744,10 +744,10 @@ pub enum AttributeKind { |
| 744 | 744 | Dummy, |
| 745 | 745 | |
| 746 | 746 | /// Implementation detail of `#[eii]` |
| 747 | EiiExternItem, | |
| 747 | EiiDeclaration(EiiDecl), | |
| 748 | 748 | |
| 749 | 749 | /// Implementation detail of `#[eii]` |
| 750 | EiiExternTarget(EiiDecl), | |
| 750 | EiiForeignItem, | |
| 751 | 751 | |
| 752 | 752 | /// Implementation detail of `#[eii]` |
| 753 | 753 | EiiImpls(ThinVec<EiiImpl>), |
compiler/rustc_hir/src/attrs/encode_cross_crate.rs+2-2| ... | ... | @@ -47,8 +47,8 @@ impl AttributeKind { |
| 47 | 47 | Doc(_) => Yes, |
| 48 | 48 | DocComment { .. } => Yes, |
| 49 | 49 | Dummy => No, |
| 50 | EiiExternItem => No, | |
| 51 | EiiExternTarget(_) => Yes, | |
| 50 | EiiDeclaration(_) => Yes, | |
| 51 | EiiForeignItem => No, | |
| 52 | 52 | EiiImpls(..) => No, |
| 53 | 53 | ExportName { .. } => Yes, |
| 54 | 54 | ExportStable => No, |
compiler/rustc_hir_analysis/src/check/check.rs+6-11| ... | ... | @@ -508,23 +508,18 @@ fn sanity_check_found_hidden_type<'tcx>( |
| 508 | 508 | return Ok(()); |
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | let strip_vars = |ty: Ty<'tcx>| { | |
| 512 | ty.fold_with(&mut BottomUpFolder { | |
| 513 | tcx, | |
| 514 | ty_op: |t| t, | |
| 515 | ct_op: |c| c, | |
| 516 | lt_op: |l| match l.kind() { | |
| 517 | RegionKind::ReVar(_) => tcx.lifetimes.re_erased, | |
| 518 | _ => l, | |
| 519 | }, | |
| 511 | let erase_re_vars = |ty: Ty<'tcx>| { | |
| 512 | fold_regions(tcx, ty, |r, _| match r.kind() { | |
| 513 | RegionKind::ReVar(_) => tcx.lifetimes.re_erased, | |
| 514 | _ => r, | |
| 520 | 515 | }) |
| 521 | 516 | }; |
| 522 | 517 | // Closures frequently end up containing erased lifetimes in their final representation. |
| 523 | 518 | // These correspond to lifetime variables that never got resolved, so we patch this up here. |
| 524 | ty.ty = strip_vars(ty.ty); | |
| 519 | ty.ty = erase_re_vars(ty.ty); | |
| 525 | 520 | // Get the hidden type. |
| 526 | 521 | let hidden_ty = tcx.type_of(key.def_id).instantiate(tcx, key.args); |
| 527 | let hidden_ty = strip_vars(hidden_ty); | |
| 522 | let hidden_ty = erase_re_vars(hidden_ty); | |
| 528 | 523 | |
| 529 | 524 | // If the hidden types differ, emit a type mismatch diagnostic. |
| 530 | 525 | if hidden_ty == ty.ty { |
compiler/rustc_hir_analysis/src/check/wfcheck.rs+2-2| ... | ... | @@ -1205,7 +1205,7 @@ fn check_eiis(tcx: TyCtxt<'_>, def_id: LocalDefId) { |
| 1205 | 1205 | EiiImplResolution::Macro(def_id) => { |
| 1206 | 1206 | // we expect this macro to have the `EiiMacroFor` attribute, that points to a function |
| 1207 | 1207 | // signature that we'd like to compare the function we're currently checking with |
| 1208 | if let Some(foreign_item) = find_attr!(tcx.get_all_attrs(*def_id), AttributeKind::EiiExternTarget(EiiDecl {eii_extern_target: t, ..}) => *t) | |
| 1208 | if let Some(foreign_item) = find_attr!(tcx.get_all_attrs(*def_id), AttributeKind::EiiDeclaration(EiiDecl {foreign_item: t, ..}) => *t) | |
| 1209 | 1209 | { |
| 1210 | 1210 | (foreign_item, tcx.item_name(*def_id)) |
| 1211 | 1211 | } else { |
| ... | ... | @@ -1213,7 +1213,7 @@ fn check_eiis(tcx: TyCtxt<'_>, def_id: LocalDefId) { |
| 1213 | 1213 | continue; |
| 1214 | 1214 | } |
| 1215 | 1215 | } |
| 1216 | EiiImplResolution::Known(decl) => (decl.eii_extern_target, decl.name.name), | |
| 1216 | EiiImplResolution::Known(decl) => (decl.foreign_item, decl.name.name), | |
| 1217 | 1217 | EiiImplResolution::Error(_eg) => continue, |
| 1218 | 1218 | }; |
| 1219 | 1219 |
compiler/rustc_hir_analysis/src/delegation.rs+3-3| ... | ... | @@ -135,9 +135,6 @@ fn build_generics<'tcx>( |
| 135 | 135 | // } |
| 136 | 136 | own_params.sort_by_key(|key| key.kind.is_ty_or_const()); |
| 137 | 137 | |
| 138 | let param_def_id_to_index = | |
| 139 | own_params.iter().map(|param| (param.def_id, param.index)).collect(); | |
| 140 | ||
| 141 | 138 | let (parent_count, has_self) = if let Some(def_id) = parent { |
| 142 | 139 | let parent_generics = tcx.generics_of(def_id); |
| 143 | 140 | let parent_kind = tcx.def_kind(def_id); |
| ... | ... | @@ -162,6 +159,9 @@ fn build_generics<'tcx>( |
| 162 | 159 | } |
| 163 | 160 | } |
| 164 | 161 | |
| 162 | let param_def_id_to_index = | |
| 163 | own_params.iter().map(|param| (param.def_id, param.index)).collect(); | |
| 164 | ||
| 165 | 165 | ty::Generics { |
| 166 | 166 | parent, |
| 167 | 167 | parent_count, |
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+3-2| ... | ... | @@ -2533,11 +2533,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 2533 | 2533 | let tcx = self.tcx(); |
| 2534 | 2534 | |
| 2535 | 2535 | let FeedConstTy::WithTy(ty) = feed else { |
| 2536 | return Const::new_error_with_message(tcx, span, "unsupported const tuple"); | |
| 2536 | return Const::new_error_with_message(tcx, span, "const tuple lack type information"); | |
| 2537 | 2537 | }; |
| 2538 | 2538 | |
| 2539 | 2539 | let ty::Tuple(tys) = ty.kind() else { |
| 2540 | return Const::new_error_with_message(tcx, span, "const tuple must have a tuple type"); | |
| 2540 | let e = tcx.dcx().span_err(span, format!("expected `{}`, found const tuple", ty)); | |
| 2541 | return Const::new_error(tcx, e); | |
| 2541 | 2542 | }; |
| 2542 | 2543 | |
| 2543 | 2544 | let exprs = exprs |
compiler/rustc_metadata/src/eii.rs+5-5| ... | ... | @@ -31,9 +31,9 @@ pub(crate) fn collect<'tcx>(tcx: TyCtxt<'tcx>, LocalCrate: LocalCrate) -> EiiMap |
| 31 | 31 | let decl = match i.resolution { |
| 32 | 32 | EiiImplResolution::Macro(macro_defid) => { |
| 33 | 33 | // find the decl for this one if it wasn't in yet (maybe it's from the local crate? not very useful but not illegal) |
| 34 | let Some(decl) = find_attr!(tcx.get_all_attrs(macro_defid), AttributeKind::EiiExternTarget(d) => *d) | |
| 34 | let Some(decl) = find_attr!(tcx.get_all_attrs(macro_defid), AttributeKind::EiiDeclaration(d) => *d) | |
| 35 | 35 | else { |
| 36 | // skip if it doesn't have eii_extern_target (if we resolved to another macro that's not an EII) | |
| 36 | // skip if it doesn't have eii_declaration (if we resolved to another macro that's not an EII) | |
| 37 | 37 | tcx.dcx() |
| 38 | 38 | .span_delayed_bug(i.span, "resolved to something that's not an EII"); |
| 39 | 39 | continue; |
| ... | ... | @@ -45,7 +45,7 @@ pub(crate) fn collect<'tcx>(tcx: TyCtxt<'tcx>, LocalCrate: LocalCrate) -> EiiMap |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | // FIXME(eii) remove extern target from encoded decl |
| 48 | eiis.entry(decl.eii_extern_target) | |
| 48 | eiis.entry(decl.foreign_item) | |
| 49 | 49 | .or_insert_with(|| (decl, Default::default())) |
| 50 | 50 | .1 |
| 51 | 51 | .insert(id.into(), *i); |
| ... | ... | @@ -53,9 +53,9 @@ pub(crate) fn collect<'tcx>(tcx: TyCtxt<'tcx>, LocalCrate: LocalCrate) -> EiiMap |
| 53 | 53 | |
| 54 | 54 | // if we find a new declaration, add it to the list without a known implementation |
| 55 | 55 | if let Some(decl) = |
| 56 | find_attr!(tcx.get_all_attrs(id), AttributeKind::EiiExternTarget(d) => *d) | |
| 56 | find_attr!(tcx.get_all_attrs(id), AttributeKind::EiiDeclaration(d) => *d) | |
| 57 | 57 | { |
| 58 | eiis.entry(decl.eii_extern_target).or_insert((decl, Default::default())); | |
| 58 | eiis.entry(decl.foreign_item).or_insert((decl, Default::default())); | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 |
compiler/rustc_metadata/src/rmeta/decoder.rs+1-1| ... | ... | @@ -1536,7 +1536,7 @@ impl<'a> CrateMetadataRef<'a> { |
| 1536 | 1536 | .get((self, tcx), id) |
| 1537 | 1537 | .unwrap() |
| 1538 | 1538 | .decode((self, tcx)); |
| 1539 | ast::MacroDef { macro_rules, body: Box::new(body), eii_extern_target: None } | |
| 1539 | ast::MacroDef { macro_rules, body: Box::new(body), eii_declaration: None } | |
| 1540 | 1540 | } |
| 1541 | 1541 | _ => bug!(), |
| 1542 | 1542 | } |
compiler/rustc_middle/src/hooks/mod.rs+5| ... | ... | @@ -102,6 +102,11 @@ declare_hooks! { |
| 102 | 102 | /// Ensure the given scalar is valid for the given type. |
| 103 | 103 | /// This checks non-recursive runtime validity. |
| 104 | 104 | hook validate_scalar_in_layout(scalar: crate::ty::ScalarInt, ty: Ty<'tcx>) -> bool; |
| 105 | ||
| 106 | /// **Do not call this directly; call the `mir_built` query instead.** | |
| 107 | /// | |
| 108 | /// Creates the MIR for a given `DefId`, including unreachable code. | |
| 109 | hook build_mir_inner_impl(def: LocalDefId) -> mir::Body<'tcx>; | |
| 105 | 110 | } |
| 106 | 111 | |
| 107 | 112 | #[cold] |
compiler/rustc_mir_build/src/builder/mod.rs+5-3| ... | ... | @@ -64,9 +64,11 @@ pub(crate) fn closure_saved_names_of_captured_variables<'tcx>( |
| 64 | 64 | .collect() |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | /// Create the MIR for a given `DefId`, including unreachable code. Do not call | |
| 68 | /// this directly; instead use the cached version via `mir_built`. | |
| 69 | pub fn build_mir<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> Body<'tcx> { | |
| 67 | /// Create the MIR for a given `DefId`, including unreachable code. | |
| 68 | /// | |
| 69 | /// This is the implementation of hook `build_mir_inner_impl`, which should only | |
| 70 | /// be called by the query `mir_built`. | |
| 71 | pub(crate) fn build_mir_inner_impl<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> Body<'tcx> { | |
| 70 | 72 | tcx.ensure_done().thir_abstract_const(def); |
| 71 | 73 | if let Err(e) = tcx.ensure_ok().check_match(def) { |
| 72 | 74 | return construct_error(tcx, def, e); |
compiler/rustc_mir_build/src/lib.rs+2-1| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | // The `builder` module used to be named `build`, but that was causing GitHub's |
| 13 | 13 | // "Go to file" feature to silently ignore all files in the module, probably |
| 14 | 14 | // because it assumes that "build" is a build-output directory. See #134365. |
| 15 | pub mod builder; | |
| 15 | mod builder; | |
| 16 | 16 | mod check_tail_calls; |
| 17 | 17 | mod check_unsafety; |
| 18 | 18 | mod errors; |
| ... | ... | @@ -30,4 +30,5 @@ pub fn provide(providers: &mut Providers) { |
| 30 | 30 | providers.check_unsafety = check_unsafety::check_unsafety; |
| 31 | 31 | providers.check_tail_calls = check_tail_calls::check_tail_calls; |
| 32 | 32 | providers.thir_body = thir::cx::thir_body; |
| 33 | providers.hooks.build_mir_inner_impl = builder::build_mir_inner_impl; | |
| 33 | 34 | } |
compiler/rustc_mir_transform/Cargo.toml-1| ... | ... | @@ -20,7 +20,6 @@ rustc_index = { path = "../rustc_index" } |
| 20 | 20 | rustc_infer = { path = "../rustc_infer" } |
| 21 | 21 | rustc_macros = { path = "../rustc_macros" } |
| 22 | 22 | rustc_middle = { path = "../rustc_middle" } |
| 23 | rustc_mir_build = { path = "../rustc_mir_build" } | |
| 24 | 23 | rustc_mir_dataflow = { path = "../rustc_mir_dataflow" } |
| 25 | 24 | rustc_session = { path = "../rustc_session" } |
| 26 | 25 | rustc_span = { path = "../rustc_span" } |
compiler/rustc_mir_transform/src/lib.rs+4-2| ... | ... | @@ -30,7 +30,6 @@ use rustc_middle::mir::{ |
| 30 | 30 | use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; |
| 31 | 31 | use rustc_middle::util::Providers; |
| 32 | 32 | use rustc_middle::{bug, query, span_bug}; |
| 33 | use rustc_mir_build::builder::build_mir; | |
| 34 | 33 | use rustc_span::source_map::Spanned; |
| 35 | 34 | use rustc_span::{DUMMY_SP, sym}; |
| 36 | 35 | use tracing::debug; |
| ... | ... | @@ -378,8 +377,11 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: LocalDefId) -> ConstQualifs { |
| 378 | 377 | validator.qualifs_in_return_place() |
| 379 | 378 | } |
| 380 | 379 | |
| 380 | /// Implementation of the `mir_built` query. | |
| 381 | 381 | fn mir_built(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal<Body<'_>> { |
| 382 | let mut body = build_mir(tcx, def); | |
| 382 | // Delegate to the main MIR building code in the `rustc_mir_build` crate. | |
| 383 | // This is the one place that is allowed to call `build_mir_inner_impl`. | |
| 384 | let mut body = tcx.build_mir_inner_impl(def); | |
| 383 | 385 | |
| 384 | 386 | // Identifying trivial consts based on their mir_built is easy, but a little wasteful. |
| 385 | 387 | // Trying to push this logic earlier in the compiler and never even produce the Body would |
compiler/rustc_next_trait_solver/src/delegate.rs+1-1| ... | ... | @@ -86,8 +86,8 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized { |
| 86 | 86 | |
| 87 | 87 | fn is_transmutable( |
| 88 | 88 | &self, |
| 89 | dst: <Self::Interner as Interner>::Ty, | |
| 90 | 89 | src: <Self::Interner as Interner>::Ty, |
| 90 | dst: <Self::Interner as Interner>::Ty, | |
| 91 | 91 | assume: <Self::Interner as Interner>::Const, |
| 92 | 92 | ) -> Result<Certainty, NoSolution>; |
| 93 | 93 | } |
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs+1-1| ... | ... | @@ -1170,8 +1170,8 @@ where |
| 1170 | 1170 | |
| 1171 | 1171 | pub(super) fn is_transmutable( |
| 1172 | 1172 | &mut self, |
| 1173 | dst: I::Ty, | |
| 1174 | 1173 | src: I::Ty, |
| 1174 | dst: I::Ty, | |
| 1175 | 1175 | assume: I::Const, |
| 1176 | 1176 | ) -> Result<Certainty, NoSolution> { |
| 1177 | 1177 | self.delegate.is_transmutable(dst, src, assume) |
compiler/rustc_parse/src/parser/item.rs+2-2| ... | ... | @@ -2283,7 +2283,7 @@ impl<'a> Parser<'a> { |
| 2283 | 2283 | self.psess.gated_spans.gate(sym::decl_macro, lo.to(self.prev_token.span)); |
| 2284 | 2284 | Ok(ItemKind::MacroDef( |
| 2285 | 2285 | ident, |
| 2286 | ast::MacroDef { body, macro_rules: false, eii_extern_target: None }, | |
| 2286 | ast::MacroDef { body, macro_rules: false, eii_declaration: None }, | |
| 2287 | 2287 | )) |
| 2288 | 2288 | } |
| 2289 | 2289 | |
| ... | ... | @@ -2333,7 +2333,7 @@ impl<'a> Parser<'a> { |
| 2333 | 2333 | |
| 2334 | 2334 | Ok(ItemKind::MacroDef( |
| 2335 | 2335 | ident, |
| 2336 | ast::MacroDef { body, macro_rules: true, eii_extern_target: None }, | |
| 2336 | ast::MacroDef { body, macro_rules: true, eii_declaration: None }, | |
| 2337 | 2337 | )) |
| 2338 | 2338 | } |
| 2339 | 2339 |
compiler/rustc_parse_format/src/lib.rs+22| ... | ... | @@ -461,6 +461,7 @@ impl<'input> Parser<'input> { |
| 461 | 461 | ('?', '}') => self.missing_colon_before_debug_formatter(), |
| 462 | 462 | ('?', _) => self.suggest_format_debug(), |
| 463 | 463 | ('<' | '^' | '>', _) => self.suggest_format_align(c), |
| 464 | (',', _) => self.suggest_unsupported_python_numeric_grouping(), | |
| 464 | 465 | _ => self.suggest_positional_arg_instead_of_captured_arg(arg), |
| 465 | 466 | } |
| 466 | 467 | } |
| ... | ... | @@ -934,6 +935,27 @@ impl<'input> Parser<'input> { |
| 934 | 935 | } |
| 935 | 936 | } |
| 936 | 937 | } |
| 938 | ||
| 939 | fn suggest_unsupported_python_numeric_grouping(&mut self) { | |
| 940 | if let Some((range, _)) = self.consume_pos(',') { | |
| 941 | self.errors.insert( | |
| 942 | 0, | |
| 943 | ParseError { | |
| 944 | description: | |
| 945 | "python's numeric grouping `,` is not supported in rust format strings" | |
| 946 | .to_owned(), | |
| 947 | note: Some(format!("to print `{{`, you can escape it using `{{{{`",)), | |
| 948 | label: "expected `}`".to_owned(), | |
| 949 | span: range, | |
| 950 | secondary_label: self | |
| 951 | .last_open_brace | |
| 952 | .clone() | |
| 953 | .map(|sp| ("because of this opening brace".to_owned(), sp)), | |
| 954 | suggestion: Suggestion::None, | |
| 955 | }, | |
| 956 | ); | |
| 957 | } | |
| 958 | } | |
| 937 | 959 | } |
| 938 | 960 | |
| 939 | 961 | // Assert a reasonable size for `Piece` |
compiler/rustc_passes/src/check_attr.rs+3-3| ... | ... | @@ -224,8 +224,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 224 | 224 | self.check_rustc_must_implement_one_of(*attr_span, fn_names, hir_id,target) |
| 225 | 225 | }, |
| 226 | 226 | Attribute::Parsed( |
| 227 | AttributeKind::EiiExternTarget { .. } | |
| 228 | | AttributeKind::EiiExternItem | |
| 227 | AttributeKind::EiiDeclaration { .. } | |
| 228 | | AttributeKind::EiiForeignItem | |
| 229 | 229 | | AttributeKind::BodyStability { .. } |
| 230 | 230 | | AttributeKind::ConstStabilityIndirect |
| 231 | 231 | | AttributeKind::MacroTransparency(_) |
| ... | ... | @@ -553,7 +553,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | if let EiiImplResolution::Macro(eii_macro) = resolution |
| 556 | && find_attr!(self.tcx.get_all_attrs(*eii_macro), AttributeKind::EiiExternTarget(EiiDecl { impl_unsafe, .. }) if *impl_unsafe) | |
| 556 | && find_attr!(self.tcx.get_all_attrs(*eii_macro), AttributeKind::EiiDeclaration(EiiDecl { impl_unsafe, .. }) if *impl_unsafe) | |
| 557 | 557 | && !impl_marked_unsafe |
| 558 | 558 | { |
| 559 | 559 | self.dcx().emit_err(errors::EiiImplRequiresUnsafe { |
compiler/rustc_resolve/src/late.rs+3-3| ... | ... | @@ -1079,7 +1079,7 @@ impl<'ast, 'ra, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'ra, 'tc |
| 1079 | 1079 | self.smart_resolve_path( |
| 1080 | 1080 | *node_id, |
| 1081 | 1081 | &None, |
| 1082 | &target.extern_item_path, | |
| 1082 | &target.foreign_item, | |
| 1083 | 1083 | PathSource::Expr(None), |
| 1084 | 1084 | ); |
| 1085 | 1085 | } else { |
| ... | ... | @@ -2931,8 +2931,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 2931 | 2931 | self.parent_scope.macro_rules = self.r.macro_rules_scopes[&def_id]; |
| 2932 | 2932 | } |
| 2933 | 2933 | |
| 2934 | if let Some(EiiExternTarget { extern_item_path, impl_unsafe: _ }) = | |
| 2935 | &macro_def.eii_extern_target | |
| 2934 | if let Some(EiiDecl { foreign_item: extern_item_path, impl_unsafe: _ }) = | |
| 2935 | &macro_def.eii_declaration | |
| 2936 | 2936 | { |
| 2937 | 2937 | self.smart_resolve_path( |
| 2938 | 2938 | item.id, |
compiler/rustc_span/src/symbol.rs+2-2| ... | ... | @@ -935,7 +935,7 @@ symbols! { |
| 935 | 935 | eh_catch_typeinfo, |
| 936 | 936 | eh_personality, |
| 937 | 937 | eii, |
| 938 | eii_extern_target, | |
| 938 | eii_declaration, | |
| 939 | 939 | eii_impl, |
| 940 | 940 | eii_internals, |
| 941 | 941 | eii_shared_macro, |
| ... | ... | @@ -1951,7 +1951,7 @@ symbols! { |
| 1951 | 1951 | rustc_dump_user_args, |
| 1952 | 1952 | rustc_dump_vtable, |
| 1953 | 1953 | rustc_effective_visibility, |
| 1954 | rustc_eii_extern_item, | |
| 1954 | rustc_eii_foreign_item, | |
| 1955 | 1955 | rustc_evaluate_where_clauses, |
| 1956 | 1956 | rustc_expected_cgu_reuse, |
| 1957 | 1957 | rustc_force_inline, |
compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs+1-6| ... | ... | @@ -2781,11 +2781,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2781 | 2781 | self.tcx.instantiate_bound_regions_with_erased(trait_pred), |
| 2782 | 2782 | ); |
| 2783 | 2783 | |
| 2784 | let src_and_dst = rustc_transmute::Types { | |
| 2785 | dst: trait_pred.trait_ref.args.type_at(0), | |
| 2786 | src: trait_pred.trait_ref.args.type_at(1), | |
| 2787 | }; | |
| 2788 | ||
| 2789 | 2784 | let ocx = ObligationCtxt::new(self); |
| 2790 | 2785 | let Ok(assume) = ocx.structurally_normalize_const( |
| 2791 | 2786 | &obligation.cause, |
| ... | ... | @@ -2812,7 +2807,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2812 | 2807 | let err_msg = format!("`{src}` cannot be safely transmuted into `{dst}`"); |
| 2813 | 2808 | |
| 2814 | 2809 | match rustc_transmute::TransmuteTypeEnv::new(self.infcx.tcx) |
| 2815 | .is_transmutable(src_and_dst, assume) | |
| 2810 | .is_transmutable(src, dst, assume) | |
| 2816 | 2811 | { |
| 2817 | 2812 | Answer::No(reason) => { |
| 2818 | 2813 | let safe_transmute_explanation = match reason { |
compiler/rustc_trait_selection/src/solve/delegate.rs+2-4| ... | ... | @@ -294,8 +294,8 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< |
| 294 | 294 | // register candidates. We probably need to register >1 since we may have an OR of ANDs. |
| 295 | 295 | fn is_transmutable( |
| 296 | 296 | &self, |
| 297 | dst: Ty<'tcx>, | |
| 298 | 297 | src: Ty<'tcx>, |
| 298 | dst: Ty<'tcx>, | |
| 299 | 299 | assume: ty::Const<'tcx>, |
| 300 | 300 | ) -> Result<Certainty, NoSolution> { |
| 301 | 301 | // Erase regions because we compute layouts in `rustc_transmute`, |
| ... | ... | @@ -307,9 +307,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< |
| 307 | 307 | }; |
| 308 | 308 | |
| 309 | 309 | // FIXME(transmutability): This really should be returning nested goals for `Answer::If*` |
| 310 | match rustc_transmute::TransmuteTypeEnv::new(self.0.tcx) | |
| 311 | .is_transmutable(rustc_transmute::Types { src, dst }, assume) | |
| 312 | { | |
| 310 | match rustc_transmute::TransmuteTypeEnv::new(self.0.tcx).is_transmutable(src, dst, assume) { | |
| 313 | 311 | rustc_transmute::Answer::Yes => Ok(Certainty::Yes), |
| 314 | 312 | rustc_transmute::Answer::No(_) | rustc_transmute::Answer::If(_) => Err(NoSolution), |
| 315 | 313 | } |
compiler/rustc_trait_selection/src/traits/select/confirmation.rs+1-2| ... | ... | @@ -365,8 +365,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 365 | 365 | |
| 366 | 366 | debug!(?src, ?dst); |
| 367 | 367 | let mut transmute_env = rustc_transmute::TransmuteTypeEnv::new(self.infcx.tcx); |
| 368 | let maybe_transmutable = | |
| 369 | transmute_env.is_transmutable(rustc_transmute::Types { dst, src }, assume); | |
| 368 | let maybe_transmutable = transmute_env.is_transmutable(src, dst, assume); | |
| 370 | 369 | |
| 371 | 370 | let fully_flattened = match maybe_transmutable { |
| 372 | 371 | Answer::No(_) => Err(SelectionError::Unimplemented)?, |
compiler/rustc_transmute/src/lib.rs+4-14| ... | ... | @@ -93,15 +93,6 @@ mod rustc { |
| 93 | 93 | |
| 94 | 94 | use super::*; |
| 95 | 95 | |
| 96 | /// The source and destination types of a transmutation. | |
| 97 | #[derive(Debug, Clone, Copy)] | |
| 98 | pub struct Types<'tcx> { | |
| 99 | /// The source type. | |
| 100 | pub src: Ty<'tcx>, | |
| 101 | /// The destination type. | |
| 102 | pub dst: Ty<'tcx>, | |
| 103 | } | |
| 104 | ||
| 105 | 96 | pub struct TransmuteTypeEnv<'tcx> { |
| 106 | 97 | tcx: TyCtxt<'tcx>, |
| 107 | 98 | } |
| ... | ... | @@ -113,13 +104,12 @@ mod rustc { |
| 113 | 104 | |
| 114 | 105 | pub fn is_transmutable( |
| 115 | 106 | &mut self, |
| 116 | types: Types<'tcx>, | |
| 107 | src: Ty<'tcx>, | |
| 108 | dst: Ty<'tcx>, | |
| 117 | 109 | assume: crate::Assume, |
| 118 | 110 | ) -> crate::Answer<Region<'tcx>, Ty<'tcx>> { |
| 119 | crate::maybe_transmutable::MaybeTransmutableQuery::new( | |
| 120 | types.src, types.dst, assume, self.tcx, | |
| 121 | ) | |
| 122 | .answer() | |
| 111 | crate::maybe_transmutable::MaybeTransmutableQuery::new(src, dst, assume, self.tcx) | |
| 112 | .answer() | |
| 123 | 113 | } |
| 124 | 114 | } |
| 125 | 115 |
compiler/rustc_ty_utils/src/instance.rs-2| ... | ... | @@ -222,8 +222,6 @@ fn resolve_associated_item<'tcx>( |
| 222 | 222 | return Err(guar); |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | let args = tcx.erase_and_anonymize_regions(args); | |
| 226 | ||
| 227 | 225 | // We check that the impl item is compatible with the trait item |
| 228 | 226 | // because otherwise we may ICE in const eval due to type mismatches, |
| 229 | 227 | // signature incompatibilities, etc. |
compiler/rustc_type_ir/src/flags.rs+2-2| ... | ... | @@ -74,7 +74,7 @@ bitflags::bitflags! { |
| 74 | 74 | /// Does this have `Projection`? |
| 75 | 75 | const HAS_TY_PROJECTION = 1 << 10; |
| 76 | 76 | /// Does this have `Free` aliases? |
| 77 | const HAS_TY_FREE_ALIAS = 1 << 11; | |
| 77 | const HAS_TY_FREE_ALIAS = 1 << 11; | |
| 78 | 78 | /// Does this have `Opaque`? |
| 79 | 79 | const HAS_TY_OPAQUE = 1 << 12; |
| 80 | 80 | /// Does this have `Inherent`? |
| ... | ... | @@ -135,7 +135,7 @@ bitflags::bitflags! { |
| 135 | 135 | const HAS_TY_CORO = 1 << 24; |
| 136 | 136 | |
| 137 | 137 | /// Does this have have a `Bound(BoundVarIndexKind::Canonical, _)`? |
| 138 | const HAS_CANONICAL_BOUND = 1 << 25; | |
| 138 | const HAS_CANONICAL_BOUND = 1 << 25; | |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 |
library/core/src/macros/mod.rs+1-1| ... | ... | @@ -1912,7 +1912,7 @@ pub(crate) mod builtin { |
| 1912 | 1912 | /// Impl detail of EII |
| 1913 | 1913 | #[unstable(feature = "eii_internals", issue = "none")] |
| 1914 | 1914 | #[rustc_builtin_macro] |
| 1915 | pub macro eii_extern_target($item:item) { | |
| 1915 | pub macro eii_declaration($item:item) { | |
| 1916 | 1916 | /* compiler built-in */ |
| 1917 | 1917 | } |
| 1918 | 1918 | } |
library/core/src/prelude/v1.rs+1-1| ... | ... | @@ -122,4 +122,4 @@ pub use crate::macros::builtin::define_opaque; |
| 122 | 122 | pub use crate::macros::builtin::{eii, unsafe_eii}; |
| 123 | 123 | |
| 124 | 124 | #[unstable(feature = "eii_internals", issue = "none")] |
| 125 | pub use crate::macros::builtin::eii_extern_target; | |
| 125 | pub use crate::macros::builtin::eii_declaration; |
library/std/src/prelude/v1.rs+1-1| ... | ... | @@ -114,7 +114,7 @@ pub use core::prelude::v1::define_opaque; |
| 114 | 114 | pub use core::prelude::v1::{eii, unsafe_eii}; |
| 115 | 115 | |
| 116 | 116 | #[unstable(feature = "eii_internals", issue = "none")] |
| 117 | pub use core::prelude::v1::eii_extern_target; | |
| 117 | pub use core::prelude::v1::eii_declaration; | |
| 118 | 118 | |
| 119 | 119 | // The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated |
| 120 | 120 | // rather than glob imported because we want docs to show these re-exports as |
library/std/src/sys/net/connection/uefi/tcp4.rs+5-4| ... | ... | @@ -248,7 +248,7 @@ impl Tcp4 { |
| 248 | 248 | fragment_table: [fragment], |
| 249 | 249 | }; |
| 250 | 250 | |
| 251 | self.read_inner((&raw mut rx_data).cast(), timeout).map(|_| data_len as usize) | |
| 251 | self.read_inner((&raw mut rx_data).cast(), timeout) | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | pub(crate) fn read_vectored( |
| ... | ... | @@ -288,14 +288,14 @@ impl Tcp4 { |
| 288 | 288 | ); |
| 289 | 289 | }; |
| 290 | 290 | |
| 291 | self.read_inner(rx_data.as_mut_ptr(), timeout).map(|_| data_length as usize) | |
| 291 | self.read_inner(rx_data.as_mut_ptr(), timeout) | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | pub(crate) fn read_inner( |
| 295 | 295 | &self, |
| 296 | 296 | rx_data: *mut tcp4::ReceiveData, |
| 297 | 297 | timeout: Option<Duration>, |
| 298 | ) -> io::Result<()> { | |
| 298 | ) -> io::Result<usize> { | |
| 299 | 299 | let evt = unsafe { self.create_evt() }?; |
| 300 | 300 | let completion_token = |
| 301 | 301 | tcp4::CompletionToken { event: evt.as_ptr(), status: Status::SUCCESS }; |
| ... | ... | @@ -313,7 +313,8 @@ impl Tcp4 { |
| 313 | 313 | if completion_token.status.is_error() { |
| 314 | 314 | Err(io::Error::from_raw_os_error(completion_token.status.as_usize())) |
| 315 | 315 | } else { |
| 316 | Ok(()) | |
| 316 | let data_length = unsafe { (*rx_data).data_length }; | |
| 317 | Ok(data_length as usize) | |
| 317 | 318 | } |
| 318 | 319 | } |
| 319 | 320 |
rust-bors.toml+2-1| ... | ... | @@ -55,7 +55,8 @@ try_failed = [ |
| 55 | 55 | "-S-waiting-on-crater" |
| 56 | 56 | ] |
| 57 | 57 | auto_build_succeeded = [ |
| 58 | "+merged-by-bors" | |
| 58 | "+merged-by-bors", | |
| 59 | "-S-waiting-on-bors" | |
| 59 | 60 | ] |
| 60 | 61 | auto_build_failed = [ |
| 61 | 62 | "+S-waiting-on-review", |
src/tools/clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs+3-21| ... | ... | @@ -12,7 +12,7 @@ use rustc_errors::{Applicability, Diag}; |
| 12 | 12 | use rustc_hir::intravisit::{Visitor, walk_expr}; |
| 13 | 13 | use rustc_hir::{Arm, Expr, ExprKind, MatchSource}; |
| 14 | 14 | use rustc_lint::{LateContext, LintContext}; |
| 15 | use rustc_middle::ty::{GenericArgKind, Region, RegionKind, Ty, TyCtxt, TypeVisitable, TypeVisitor}; | |
| 15 | use rustc_middle::ty::{GenericArgKind, RegionKind, Ty, TypeVisitableExt}; | |
| 16 | 16 | use rustc_span::Span; |
| 17 | 17 | |
| 18 | 18 | use super::SIGNIFICANT_DROP_IN_SCRUTINEE; |
| ... | ... | @@ -303,13 +303,13 @@ impl<'a, 'tcx> SigDropHelper<'a, 'tcx> { |
| 303 | 303 | |
| 304 | 304 | if self.sig_drop_holder != SigDropHolder::None { |
| 305 | 305 | let parent_ty = self.cx.typeck_results().expr_ty(parent_expr); |
| 306 | if !ty_has_erased_regions(parent_ty) && !parent_expr.is_syntactic_place_expr() { | |
| 306 | if !parent_ty.has_erased_regions() && !parent_expr.is_syntactic_place_expr() { | |
| 307 | 307 | self.replace_current_sig_drop(parent_expr.span, parent_ty.is_unit(), 0); |
| 308 | 308 | self.sig_drop_holder = SigDropHolder::Moved; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | let (peel_ref_ty, peel_ref_times) = ty_peel_refs(parent_ty); |
| 312 | if !ty_has_erased_regions(peel_ref_ty) && is_copy(self.cx, peel_ref_ty) { | |
| 312 | if !peel_ref_ty.has_erased_regions() && is_copy(self.cx, peel_ref_ty) { | |
| 313 | 313 | self.replace_current_sig_drop(parent_expr.span, peel_ref_ty.is_unit(), peel_ref_times); |
| 314 | 314 | self.sig_drop_holder = SigDropHolder::Moved; |
| 315 | 315 | } |
| ... | ... | @@ -399,24 +399,6 @@ fn ty_peel_refs(mut ty: Ty<'_>) -> (Ty<'_>, usize) { |
| 399 | 399 | (ty, n) |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | fn ty_has_erased_regions(ty: Ty<'_>) -> bool { | |
| 403 | struct V; | |
| 404 | ||
| 405 | impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for V { | |
| 406 | type Result = ControlFlow<()>; | |
| 407 | ||
| 408 | fn visit_region(&mut self, region: Region<'tcx>) -> Self::Result { | |
| 409 | if region.is_erased() { | |
| 410 | ControlFlow::Break(()) | |
| 411 | } else { | |
| 412 | ControlFlow::Continue(()) | |
| 413 | } | |
| 414 | } | |
| 415 | } | |
| 416 | ||
| 417 | ty.visit_with(&mut V).is_break() | |
| 418 | } | |
| 419 | ||
| 420 | 402 | impl<'tcx> Visitor<'tcx> for SigDropHelper<'_, 'tcx> { |
| 421 | 403 | fn visit_expr(&mut self, ex: &'tcx Expr<'_>) { |
| 422 | 404 | // We've emitted a lint on some neighborhood expression. That lint will suggest to move out the |
src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs+1-1| ... | ... | @@ -232,8 +232,8 @@ impl<'db> SolverDelegate for SolverContext<'db> { |
| 232 | 232 | |
| 233 | 233 | fn is_transmutable( |
| 234 | 234 | &self, |
| 235 | _dst: Ty<'db>, | |
| 236 | 235 | _src: Ty<'db>, |
| 236 | _dst: Ty<'db>, | |
| 237 | 237 | _assume: <Self::Interner as rustc_type_ir::Interner>::Const, |
| 238 | 238 | ) -> Result<Certainty, NoSolution> { |
| 239 | 239 | // It's better to return some value while not fully implement |
tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.rs deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | #![feature(min_generic_const_args, adt_const_params, unsized_const_params)] | |
| 2 | #![expect(incomplete_features)] | |
| 3 | ||
| 4 | trait Trait { | |
| 5 | #[type_const] | |
| 6 | const ASSOC: usize; | |
| 7 | } | |
| 8 | ||
| 9 | fn takes_tuple<const A: (u32, u32)>() {} | |
| 10 | fn takes_nested_tuple<const A: (u32, (u32, u32))>() {} | |
| 11 | ||
| 12 | fn generic_caller<T: Trait, const N: u32, const N2: u32>() { | |
| 13 | takes_tuple::<{ (N, N + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 14 | takes_tuple::<{ (N, T::ASSOC + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 15 | ||
| 16 | takes_nested_tuple::<{ (N, (N, N + 1)) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 17 | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); //~ ERROR generic parameters may not be used in const operations | |
| 18 | } | |
| 19 | ||
| 20 | fn main() {} |
tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.stderr deleted-26| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | error: complex const arguments must be placed inside of a `const` block | |
| 2 | --> $DIR/adt_expr_arg_tuple_expr_complex.rs:13:25 | |
| 3 | | | |
| 4 | LL | takes_tuple::<{ (N, N + 1) }>(); | |
| 5 | | ^^^^^ | |
| 6 | ||
| 7 | error: complex const arguments must be placed inside of a `const` block | |
| 8 | --> $DIR/adt_expr_arg_tuple_expr_complex.rs:14:25 | |
| 9 | | | |
| 10 | LL | takes_tuple::<{ (N, T::ASSOC + 1) }>(); | |
| 11 | | ^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: complex const arguments must be placed inside of a `const` block | |
| 14 | --> $DIR/adt_expr_arg_tuple_expr_complex.rs:16:36 | |
| 15 | | | |
| 16 | LL | takes_nested_tuple::<{ (N, (N, N + 1)) }>(); | |
| 17 | | ^^^^^ | |
| 18 | ||
| 19 | error: generic parameters may not be used in const operations | |
| 20 | --> $DIR/adt_expr_arg_tuple_expr_complex.rs:17:44 | |
| 21 | | | |
| 22 | LL | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); | |
| 23 | | ^ | |
| 24 | ||
| 25 | error: aborting due to 4 previous errors | |
| 26 |
tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_simple.rs deleted-22| ... | ... | @@ -1,22 +0,0 @@ |
| 1 | //@ check-pass | |
| 2 | ||
| 3 | #![feature(min_generic_const_args, adt_const_params, unsized_const_params)] | |
| 4 | #![expect(incomplete_features)] | |
| 5 | ||
| 6 | trait Trait { | |
| 7 | #[type_const] | |
| 8 | const ASSOC: u32; | |
| 9 | } | |
| 10 | ||
| 11 | fn takes_tuple<const A: (u32, u32)>() {} | |
| 12 | fn takes_nested_tuple<const A: (u32, (u32, u32))>() {} | |
| 13 | ||
| 14 | fn generic_caller<T: Trait, const N: u32, const N2: u32>() { | |
| 15 | takes_tuple::<{ (N, N2) }>(); | |
| 16 | takes_tuple::<{ (N, T::ASSOC) }>(); | |
| 17 | ||
| 18 | takes_nested_tuple::<{ (N, (N, N2)) }>(); | |
| 19 | takes_nested_tuple::<{ (N, (N, T::ASSOC)) }>(); | |
| 20 | } | |
| 21 | ||
| 22 | fn main() {} |
tests/ui/const-generics/mgca/tuple_expr_arg_complex.rs created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | #![feature(min_generic_const_args, adt_const_params, unsized_const_params)] | |
| 2 | #![expect(incomplete_features)] | |
| 3 | ||
| 4 | trait Trait { | |
| 5 | #[type_const] | |
| 6 | const ASSOC: usize; | |
| 7 | } | |
| 8 | ||
| 9 | fn takes_tuple<const A: (u32, u32)>() {} | |
| 10 | fn takes_nested_tuple<const A: (u32, (u32, u32))>() {} | |
| 11 | ||
| 12 | fn generic_caller<T: Trait, const N: u32, const N2: u32>() { | |
| 13 | takes_tuple::<{ (N, N + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 14 | takes_tuple::<{ (N, T::ASSOC + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 15 | ||
| 16 | takes_nested_tuple::<{ (N, (N, N + 1)) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block | |
| 17 | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); //~ ERROR generic parameters may not be used in const operations | |
| 18 | } | |
| 19 | ||
| 20 | fn main() {} |
tests/ui/const-generics/mgca/tuple_expr_arg_complex.stderr created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | error: complex const arguments must be placed inside of a `const` block | |
| 2 | --> $DIR/tuple_expr_arg_complex.rs:13:25 | |
| 3 | | | |
| 4 | LL | takes_tuple::<{ (N, N + 1) }>(); | |
| 5 | | ^^^^^ | |
| 6 | ||
| 7 | error: complex const arguments must be placed inside of a `const` block | |
| 8 | --> $DIR/tuple_expr_arg_complex.rs:14:25 | |
| 9 | | | |
| 10 | LL | takes_tuple::<{ (N, T::ASSOC + 1) }>(); | |
| 11 | | ^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: complex const arguments must be placed inside of a `const` block | |
| 14 | --> $DIR/tuple_expr_arg_complex.rs:16:36 | |
| 15 | | | |
| 16 | LL | takes_nested_tuple::<{ (N, (N, N + 1)) }>(); | |
| 17 | | ^^^^^ | |
| 18 | ||
| 19 | error: generic parameters may not be used in const operations | |
| 20 | --> $DIR/tuple_expr_arg_complex.rs:17:44 | |
| 21 | | | |
| 22 | LL | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); | |
| 23 | | ^ | |
| 24 | ||
| 25 | error: aborting due to 4 previous errors | |
| 26 |
tests/ui/const-generics/mgca/tuple_expr_arg_mismatch_type.rs created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | #![feature(min_generic_const_args)] | |
| 2 | #![expect(incomplete_features)] | |
| 3 | ||
| 4 | pub fn takes_nested_tuple<const N: u32>() { | |
| 5 | takes_nested_tuple::<{ () }> //~ ERROR expected `u32`, found const tuple | |
| 6 | } | |
| 7 | ||
| 8 | fn main() {} |
tests/ui/const-generics/mgca/tuple_expr_arg_mismatch_type.stderr created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | error: expected `u32`, found const tuple | |
| 2 | --> $DIR/tuple_expr_arg_mismatch_type.rs:5:28 | |
| 3 | | | |
| 4 | LL | takes_nested_tuple::<{ () }> | |
| 5 | | ^^ | |
| 6 | ||
| 7 | error: aborting due to 1 previous error | |
| 8 |
tests/ui/const-generics/mgca/tuple_expr_arg_simple.rs created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | //@ check-pass | |
| 2 | ||
| 3 | #![feature(min_generic_const_args, adt_const_params, unsized_const_params)] | |
| 4 | #![expect(incomplete_features)] | |
| 5 | ||
| 6 | trait Trait { | |
| 7 | #[type_const] | |
| 8 | const ASSOC: u32; | |
| 9 | } | |
| 10 | ||
| 11 | fn takes_tuple<const A: (u32, u32)>() {} | |
| 12 | fn takes_nested_tuple<const A: (u32, (u32, u32))>() {} | |
| 13 | ||
| 14 | fn generic_caller<T: Trait, const N: u32, const N2: u32>() { | |
| 15 | takes_tuple::<{ (N, N2) }>(); | |
| 16 | takes_tuple::<{ (N, T::ASSOC) }>(); | |
| 17 | ||
| 18 | takes_nested_tuple::<{ (N, (N, N2)) }>(); | |
| 19 | takes_nested_tuple::<{ (N, (N, T::ASSOC)) }>(); | |
| 20 | } | |
| 21 | ||
| 22 | fn main() {} |
tests/ui/delegation/ice-issue-150673.rs created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | #![feature(fn_delegation)] | |
| 2 | #![allow(incomplete_features)] | |
| 3 | ||
| 4 | mod to_reuse { | |
| 5 | pub fn foo<T>() -> T { | |
| 6 | unimplemented!() | |
| 7 | } | |
| 8 | } | |
| 9 | ||
| 10 | struct S<T>(T); | |
| 11 | ||
| 12 | trait Trait { | |
| 13 | reuse to_reuse::foo; | |
| 14 | } | |
| 15 | ||
| 16 | impl Trait for S { | |
| 17 | //~^ ERROR: missing generics for struct `S` | |
| 18 | reuse Trait::foo; | |
| 19 | } | |
| 20 | ||
| 21 | fn main() {} |
tests/ui/delegation/ice-issue-150673.stderr created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | error[E0107]: missing generics for struct `S` | |
| 2 | --> $DIR/ice-issue-150673.rs:16:16 | |
| 3 | | | |
| 4 | LL | impl Trait for S { | |
| 5 | | ^ expected 1 generic argument | |
| 6 | | | |
| 7 | note: struct defined here, with 1 generic parameter: `T` | |
| 8 | --> $DIR/ice-issue-150673.rs:10:8 | |
| 9 | | | |
| 10 | LL | struct S<T>(T); | |
| 11 | | ^ - | |
| 12 | help: add missing generic argument | |
| 13 | | | |
| 14 | LL | impl Trait for S<T> { | |
| 15 | | +++ | |
| 16 | ||
| 17 | error: aborting due to 1 previous error | |
| 18 | ||
| 19 | For more information about this error, try `rustc --explain E0107`. |
tests/ui/eii/errors.rs+9-9| ... | ... | @@ -5,19 +5,19 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar)] //~ ERROR `#[eii_extern_target(...)]` is only valid on macros | |
| 8 | #[eii_declaration(bar)] //~ ERROR `#[eii_declaration(...)]` is only valid on macros | |
| 9 | 9 | fn hello() { |
| 10 | #[eii_extern_target(bar)] //~ ERROR `#[eii_extern_target(...)]` is only valid on macros | |
| 10 | #[eii_declaration(bar)] //~ ERROR `#[eii_declaration(...)]` is only valid on macros | |
| 11 | 11 | let x = 3 + 3; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | #[eii_extern_target] //~ ERROR `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 15 | #[eii_extern_target()] //~ ERROR `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 16 | #[eii_extern_target(bar, hello)] //~ ERROR expected this argument to be "unsafe" | |
| 17 | #[eii_extern_target(bar, "unsafe", hello)] //~ ERROR `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 18 | #[eii_extern_target(bar, hello, "unsafe")] //~ ERROR `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 19 | #[eii_extern_target = "unsafe"] //~ ERROR `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 20 | #[eii_extern_target(bar)] | |
| 14 | #[eii_declaration] //~ ERROR `#[eii_declaration(...)]` expects a list of one or two elements | |
| 15 | #[eii_declaration()] //~ ERROR `#[eii_declaration(...)]` expects a list of one or two elements | |
| 16 | #[eii_declaration(bar, hello)] //~ ERROR expected this argument to be "unsafe" | |
| 17 | #[eii_declaration(bar, "unsafe", hello)] //~ ERROR `#[eii_declaration(...)]` expects a list of one or two elements | |
| 18 | #[eii_declaration(bar, hello, "unsafe")] //~ ERROR `#[eii_declaration(...)]` expects a list of one or two elements | |
| 19 | #[eii_declaration = "unsafe"] //~ ERROR `#[eii_declaration(...)]` expects a list of one or two elements | |
| 20 | #[eii_declaration(bar)] | |
| 21 | 21 | #[rustc_builtin_macro(eii_shared_macro)] |
| 22 | 22 | macro foo() {} |
| 23 | 23 |
tests/ui/eii/errors.stderr+27-27| ... | ... | @@ -1,56 +1,56 @@ |
| 1 | error: `#[eii_extern_target(...)]` is only valid on macros | |
| 1 | error: `#[eii_declaration(...)]` is only valid on macros | |
| 2 | 2 | --> $DIR/errors.rs:8:1 |
| 3 | 3 | | |
| 4 | LL | #[eii_extern_target(bar)] | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 4 | LL | #[eii_declaration(bar)] | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^ | |
| 6 | 6 | |
| 7 | error: `#[eii_extern_target(...)]` is only valid on macros | |
| 7 | error: `#[eii_declaration(...)]` is only valid on macros | |
| 8 | 8 | --> $DIR/errors.rs:10:5 |
| 9 | 9 | | |
| 10 | LL | #[eii_extern_target(bar)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 10 | LL | #[eii_declaration(bar)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^^ | |
| 12 | 12 | |
| 13 | error: `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 13 | error: `#[eii_declaration(...)]` expects a list of one or two elements | |
| 14 | 14 | --> $DIR/errors.rs:14:1 |
| 15 | 15 | | |
| 16 | LL | #[eii_extern_target] | |
| 17 | | ^^^^^^^^^^^^^^^^^^^^ | |
| 16 | LL | #[eii_declaration] | |
| 17 | | ^^^^^^^^^^^^^^^^^^ | |
| 18 | 18 | |
| 19 | error: `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 19 | error: `#[eii_declaration(...)]` expects a list of one or two elements | |
| 20 | 20 | --> $DIR/errors.rs:15:1 |
| 21 | 21 | | |
| 22 | LL | #[eii_extern_target()] | |
| 23 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 22 | LL | #[eii_declaration()] | |
| 23 | | ^^^^^^^^^^^^^^^^^^^^ | |
| 24 | 24 | |
| 25 | 25 | error: expected this argument to be "unsafe" |
| 26 | --> $DIR/errors.rs:16:26 | |
| 26 | --> $DIR/errors.rs:16:24 | |
| 27 | 27 | | |
| 28 | LL | #[eii_extern_target(bar, hello)] | |
| 29 | | ^^^^^ | |
| 28 | LL | #[eii_declaration(bar, hello)] | |
| 29 | | ^^^^^ | |
| 30 | 30 | | |
| 31 | 31 | note: the second argument is optional |
| 32 | --> $DIR/errors.rs:16:26 | |
| 32 | --> $DIR/errors.rs:16:24 | |
| 33 | 33 | | |
| 34 | LL | #[eii_extern_target(bar, hello)] | |
| 35 | | ^^^^^ | |
| 34 | LL | #[eii_declaration(bar, hello)] | |
| 35 | | ^^^^^ | |
| 36 | 36 | |
| 37 | error: `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 37 | error: `#[eii_declaration(...)]` expects a list of one or two elements | |
| 38 | 38 | --> $DIR/errors.rs:17:1 |
| 39 | 39 | | |
| 40 | LL | #[eii_extern_target(bar, "unsafe", hello)] | |
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 40 | LL | #[eii_declaration(bar, "unsafe", hello)] | |
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 42 | 42 | |
| 43 | error: `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 43 | error: `#[eii_declaration(...)]` expects a list of one or two elements | |
| 44 | 44 | --> $DIR/errors.rs:18:1 |
| 45 | 45 | | |
| 46 | LL | #[eii_extern_target(bar, hello, "unsafe")] | |
| 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 46 | LL | #[eii_declaration(bar, hello, "unsafe")] | |
| 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 48 | 48 | |
| 49 | error: `#[eii_extern_target(...)]` expects a list of one or two elements | |
| 49 | error: `#[eii_declaration(...)]` expects a list of one or two elements | |
| 50 | 50 | --> $DIR/errors.rs:19:1 |
| 51 | 51 | | |
| 52 | LL | #[eii_extern_target = "unsafe"] | |
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 52 | LL | #[eii_declaration = "unsafe"] | |
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 54 | 54 | |
| 55 | 55 | error: `#[foo]` is only valid on functions |
| 56 | 56 | --> $DIR/errors.rs:28:1 |
tests/ui/eii/type_checking/auxiliary/cross_crate_eii_declaration.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar)] | |
| 8 | #[eii_declaration(bar)] | |
| 9 | 9 | #[rustc_builtin_macro(eii_shared_macro)] |
| 10 | 10 | pub macro foo() {} |
| 11 | 11 |
tests/ui/eii/type_checking/subtype_1.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | #![feature(rustc_attrs)] |
| 7 | 7 | #![feature(eii_internals)] |
| 8 | 8 | |
| 9 | #[eii_extern_target(bar)] | |
| 9 | #[eii_declaration(bar)] | |
| 10 | 10 | #[rustc_builtin_macro(eii_shared_macro)] |
| 11 | 11 | macro foo() {} |
| 12 | 12 |
tests/ui/eii/type_checking/subtype_2.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | #![feature(rustc_attrs)] |
| 7 | 7 | #![feature(eii_internals)] |
| 8 | 8 | |
| 9 | #[eii_extern_target(bar)] | |
| 9 | #[eii_declaration(bar)] | |
| 10 | 10 | #[rustc_builtin_macro(eii_shared_macro)] |
| 11 | 11 | macro foo() {} |
| 12 | 12 |
tests/ui/eii/type_checking/subtype_3.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | #![feature(rustc_attrs)] |
| 8 | 8 | #![feature(eii_internals)] |
| 9 | 9 | |
| 10 | #[eii_extern_target(bar)] | |
| 10 | #[eii_declaration(bar)] | |
| 11 | 11 | #[rustc_builtin_macro(eii_shared_macro)] |
| 12 | 12 | macro foo() {} |
| 13 | 13 |
tests/ui/eii/type_checking/subtype_4.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | #![feature(rustc_attrs)] |
| 8 | 8 | #![feature(eii_internals)] |
| 9 | 9 | |
| 10 | #[eii_extern_target(bar)] | |
| 10 | #[eii_declaration(bar)] | |
| 11 | 11 | #[rustc_builtin_macro(eii_shared_macro)] |
| 12 | 12 | macro foo() {} |
| 13 | 13 |
tests/ui/eii/type_checking/wrong_ret_ty.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar)] | |
| 8 | #[eii_declaration(bar)] | |
| 9 | 9 | #[rustc_builtin_macro(eii_shared_macro)] |
| 10 | 10 | macro foo() {} |
| 11 | 11 |
tests/ui/eii/type_checking/wrong_ty.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar)] | |
| 8 | #[eii_declaration(bar)] | |
| 9 | 9 | #[rustc_builtin_macro(eii_shared_macro)] |
| 10 | 10 | macro foo() {} |
| 11 | 11 |
tests/ui/eii/type_checking/wrong_ty_2.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar)] | |
| 8 | #[eii_declaration(bar)] | |
| 9 | 9 | #[rustc_builtin_macro(eii_shared_macro)] |
| 10 | 10 | macro foo() {} |
| 11 | 11 |
tests/ui/eii/unsafe_impl_err.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(rustc_attrs)] |
| 6 | 6 | #![feature(eii_internals)] |
| 7 | 7 | |
| 8 | #[eii_extern_target(bar, "unsafe")] | |
| 8 | #[eii_declaration(bar, "unsafe")] | |
| 9 | 9 | #[rustc_builtin_macro(eii_shared_macro)] |
| 10 | 10 | macro foo() {} |
| 11 | 11 |
tests/ui/eii/unsafe_impl_ok.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | #![feature(rustc_attrs)] |
| 8 | 8 | #![feature(eii_internals)] |
| 9 | 9 | |
| 10 | #[eii_extern_target(bar, "unsafe")] | |
| 10 | #[eii_declaration(bar, "unsafe")] | |
| 11 | 11 | #[rustc_builtin_macro(eii_shared_macro)] |
| 12 | 12 | macro foo() {} |
| 13 | 13 |
tests/ui/feature-gates/feature-gate-eii-internals.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | #![feature(decl_macro)] |
| 3 | 3 | #![feature(rustc_attrs)] |
| 4 | 4 | |
| 5 | #[eii_extern_target(bar)] //~ ERROR use of unstable library feature `eii_internals` | |
| 5 | #[eii_declaration(bar)] //~ ERROR use of unstable library feature `eii_internals` | |
| 6 | 6 | #[rustc_builtin_macro(eii_macro)] |
| 7 | 7 | macro foo() {} //~ ERROR: cannot find a built-in macro with name `foo` |
| 8 | 8 |
tests/ui/feature-gates/feature-gate-eii-internals.stderr+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | error[E0658]: use of unstable library feature `eii_internals` |
| 2 | 2 | --> $DIR/feature-gate-eii-internals.rs:5:3 |
| 3 | 3 | | |
| 4 | LL | #[eii_extern_target(bar)] | |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 4 | LL | #[eii_declaration(bar)] | |
| 5 | | ^^^^^^^^^^^^^^^ | |
| 6 | 6 | | |
| 7 | 7 | = help: add `#![feature(eii_internals)]` to the crate attributes to enable |
| 8 | 8 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
tests/ui/fmt/format-string-error-2.rs+2| ... | ... | @@ -86,4 +86,6 @@ raw { \n |
| 86 | 86 | |
| 87 | 87 | println!("{x?}, world!",); |
| 88 | 88 | //~^ ERROR invalid format string: expected `}`, found `?` |
| 89 | println!("{x,}, world!",); | |
| 90 | //~^ ERROR invalid format string: python's numeric grouping `,` is not supported in rust format strings | |
| 89 | 91 | } |
tests/ui/fmt/format-string-error-2.stderr+11-1| ... | ... | @@ -188,5 +188,15 @@ LL | println!("{x?}, world!",); |
| 188 | 188 | | |
| 189 | 189 | = note: to print `{`, you can escape it using `{{` |
| 190 | 190 | |
| 191 | error: aborting due to 19 previous errors | |
| 191 | error: invalid format string: python's numeric grouping `,` is not supported in rust format strings | |
| 192 | --> $DIR/format-string-error-2.rs:89:17 | |
| 193 | | | |
| 194 | LL | println!("{x,}, world!",); | |
| 195 | | - ^ expected `}` in format string | |
| 196 | | | | |
| 197 | | because of this opening brace | |
| 198 | | | |
| 199 | = note: to print `{`, you can escape it using `{{` | |
| 200 | ||
| 201 | error: aborting due to 20 previous errors | |
| 192 | 202 |