diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs index 793fe9cfd5e2e..9078b1f889cde 100644 --- a/compiler/rustc_ast_lowering/src/index.rs +++ b/compiler/rustc_ast_lowering/src/index.rs @@ -55,7 +55,7 @@ pub(super) fn index_hir<'hir>( OwnerNode::TraitItem(item) => collector.visit_trait_item(item), OwnerNode::ImplItem(item) => collector.visit_impl_item(item), OwnerNode::ForeignItem(item) => collector.visit_foreign_item(item), - OwnerNode::AssocOpaqueTy(..) => unreachable!(), + OwnerNode::Synthetic => unreachable!(), }; for (local_id, node) in collector.nodes.iter_enumerated() { diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index a27d016e0ba51..36c2723b66ded 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -2,7 +2,7 @@ #![allow(rustc::untranslatable_diagnostic)] use core::ops::ControlFlow; -use hir::ExprKind; +use hir::{ExprKind, Param}; use rustc_errors::{Applicability, Diag}; use rustc_hir as hir; use rustc_hir::intravisit::Visitor; @@ -725,25 +725,26 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { _ => local_decl.source_info.span, }; - let def_id = self.body.source.def_id(); - let hir_id = if let Some(local_def_id) = def_id.as_local() - && let Some(body_id) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id) - { - let body = self.infcx.tcx.hir().body(body_id); - BindingFinder { span: pat_span }.visit_body(body).break_value() - } else { - None - }; - // With ref-binding patterns, the mutability suggestion has to apply to // the binding, not the reference (which would be a type error): // // `let &b = a;` -> `let &(mut b) = a;` - if let Some(hir_id) = hir_id + // or + // `fn foo(&x: &i32)` -> `fn foo(&(mut x): &i32)` + let def_id = self.body.source.def_id(); + if let Some(local_def_id) = def_id.as_local() + && let Some(body_id) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id) + && let body = self.infcx.tcx.hir().body(body_id) + && let Some(hir_id) = (BindingFinder { span: pat_span }).visit_body(body).break_value() + && let node = self.infcx.tcx.hir_node(hir_id) && let hir::Node::Local(hir::Local { pat: hir::Pat { kind: hir::PatKind::Ref(_, _), .. }, .. - }) = self.infcx.tcx.hir_node(hir_id) + }) + | hir::Node::Param(Param { + pat: hir::Pat { kind: hir::PatKind::Ref(_, _), .. }, + .. + }) = node && let Ok(name) = self.infcx.tcx.sess.source_map().span_to_snippet(local_decl.source_info.span) { @@ -1310,6 +1311,16 @@ impl<'tcx> Visitor<'tcx> for BindingFinder { hir::intravisit::walk_stmt(self, s) } } + + fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) -> Self::Result { + if let hir::Pat { kind: hir::PatKind::Ref(_, _), span, .. } = param.pat + && *span == self.span + { + ControlFlow::Break(param.hir_id) + } else { + ControlFlow::Continue(()) + } + } } pub fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option) -> bool { diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs index 7b7cdae0ed61a..df564f705bc73 100644 --- a/compiler/rustc_codegen_ssa/src/mono_item.rs +++ b/compiler/rustc_codegen_ssa/src/mono_item.rs @@ -2,6 +2,7 @@ use crate::base; use crate::common; use crate::traits::*; use rustc_hir as hir; +use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::mir::mono::MonoItem; use rustc_middle::mir::mono::{Linkage, Visibility}; use rustc_middle::ty; @@ -40,23 +41,34 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { .iter() .map(|(op, op_sp)| match *op { hir::InlineAsmOperand::Const { ref anon_const } => { - let const_value = cx - .tcx() - .const_eval_poly(anon_const.def_id.to_def_id()) - .unwrap_or_else(|_| { - span_bug!(*op_sp, "asm const cannot be resolved") - }); - let ty = cx - .tcx() - .typeck_body(anon_const.body) - .node_type(anon_const.hir_id); - let string = common::asm_const_to_str( - cx.tcx(), - *op_sp, - const_value, - cx.layout_of(ty), - ); - GlobalAsmOperandRef::Const { string } + match cx.tcx().const_eval_poly(anon_const.def_id.to_def_id()) { + Ok(const_value) => { + let ty = cx + .tcx() + .typeck_body(anon_const.body) + .node_type(anon_const.hir_id); + let string = common::asm_const_to_str( + cx.tcx(), + *op_sp, + const_value, + cx.layout_of(ty), + ); + GlobalAsmOperandRef::Const { string } + } + Err(ErrorHandled::Reported { .. }) => { + // An error has already been reported and + // compilation is guaranteed to fail if execution + // hits this path. So an empty string instead of + // a stringified constant value will suffice. + GlobalAsmOperandRef::Const { string: String::new() } + } + Err(ErrorHandled::TooGeneric(_)) => { + span_bug!( + *op_sp, + "asm const cannot be resolved; too generic" + ) + } + } } hir::InlineAsmOperand::SymFn { ref anon_const } => { let ty = cx diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 17bb59aae8f17..2f04f053bac3e 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -111,6 +111,8 @@ fn intern_as_new_static<'tcx>( feed.generics_of(tcx.generics_of(static_id).clone()); feed.def_ident_span(tcx.def_ident_span(static_id)); feed.explicit_predicates_of(tcx.explicit_predicates_of(static_id)); + + feed.feed_hir() } /// How a constant value should be interned. diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index e5a29f3a8462e..d4d7833cb218a 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -150,16 +150,6 @@ pub enum AttributeDuplicates { FutureWarnPreceding, } -/// A convenience macro to deal with `$($expr)?`. -macro_rules! or_default { - ($default:expr,) => { - $default - }; - ($default:expr, $next:expr) => { - $next - }; -} - /// A convenience macro for constructing attribute templates. /// E.g., `template!(Word, List: "description")` means that the attribute /// supports forms `#[attr]` and `#[attr(description)]`. @@ -181,10 +171,10 @@ macro_rules! template { } macro_rules! ungated { - ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)? $(,)?) => { + ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr $(,)?) => { BuiltinAttribute { name: sym::$attr, - only_local: or_default!(false, $($only_local)?), + encode_cross_crate: $encode_cross_crate, type_: $typ, template: $tpl, gate: Ungated, @@ -194,20 +184,20 @@ macro_rules! ungated { } macro_rules! gated { - ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $gate:ident, $msg:expr $(,)?) => { + ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $gate:ident, $msg:expr $(,)?) => { BuiltinAttribute { name: sym::$attr, - only_local: or_default!(false, $($only_local)?), + encode_cross_crate: $encode_cross_crate, type_: $typ, template: $tpl, duplicates: $duplicates, gate: Gated(Stability::Unstable, sym::$gate, $msg, cfg_fn!($gate)), } }; - ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => { + ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => { BuiltinAttribute { name: sym::$attr, - only_local: or_default!(false, $($only_local)?), + encode_cross_crate: $encode_cross_crate, type_: $typ, template: $tpl, duplicates: $duplicates, @@ -217,13 +207,13 @@ macro_rules! gated { } macro_rules! rustc_attr { - (TEST, $attr:ident, $typ:expr, $tpl:expr, $duplicate:expr $(, @only_local: $only_local:expr)? $(,)?) => { + (TEST, $attr:ident, $typ:expr, $tpl:expr, $duplicate:expr, $encode_cross_crate:expr $(,)?) => { rustc_attr!( $attr, $typ, $tpl, $duplicate, - $(@only_local: $only_local,)? + $encode_cross_crate, concat!( "the `#[", stringify!($attr), @@ -232,10 +222,10 @@ macro_rules! rustc_attr { ), ) }; - ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => { + ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => { BuiltinAttribute { name: sym::$attr, - only_local: or_default!(false, $($only_local)?), + encode_cross_crate: $encode_cross_crate, type_: $typ, template: $tpl, duplicates: $duplicates, @@ -253,12 +243,19 @@ macro_rules! experimental { const IMPL_DETAIL: &str = "internal implementation detail"; const INTERNAL_UNSTABLE: &str = "this is an internal attribute that will never be stable"; +#[derive(PartialEq)] +pub enum EncodeCrossCrate { + Yes, + No, +} + pub struct BuiltinAttribute { pub name: Symbol, - /// Whether this attribute is only used in the local crate. + /// Whether this attribute is encode cross crate. /// - /// If so, it is not encoded in the crate metadata. - pub only_local: bool, + /// If so, it is encoded in the crate metadata. + /// Otherwise, it can only be used in the local crate. + pub encode_cross_crate: EncodeCrossCrate, pub type_: AttributeType, pub template: AttributeTemplate, pub duplicates: AttributeDuplicates, @@ -273,65 +270,71 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // ========================================================================== // Conditional compilation: - ungated!(cfg, Normal, template!(List: "predicate"), DuplicatesOk), - ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ..."), DuplicatesOk), + ungated!(cfg, Normal, template!(List: "predicate"), DuplicatesOk, EncodeCrossCrate::Yes), + ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ..."), DuplicatesOk, EncodeCrossCrate::Yes), // Testing: ungated!( ignore, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing, - @only_local: true, + EncodeCrossCrate::No, ), ungated!( should_panic, Normal, template!(Word, List: r#"expected = "reason""#, NameValueStr: "reason"), FutureWarnFollowing, - @only_local: true, + EncodeCrossCrate::No, ), // FIXME(Centril): This can be used on stable but shouldn't. ungated!( reexport_test_harness_main, CrateLevel, template!(NameValueStr: "name"), ErrorFollowing, - @only_local: true, + EncodeCrossCrate::No, ), // Macros: - ungated!(automatically_derived, Normal, template!(Word), WarnFollowing), + ungated!(automatically_derived, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), ungated!( macro_use, Normal, template!(Word, List: "name1, name2, ..."), WarnFollowingWordOnly, - @only_local: true, + EncodeCrossCrate::No, ), - ungated!(macro_escape, Normal, template!(Word), WarnFollowing, @only_local: true), // Deprecated synonym for `macro_use`. - ungated!(macro_export, Normal, template!(Word, List: "local_inner_macros"), WarnFollowing), - ungated!(proc_macro, Normal, template!(Word), ErrorFollowing, @only_local: true), + ungated!(macro_escape, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), // Deprecated synonym for `macro_use`. + ungated!( + macro_export, Normal, template!(Word, List: "local_inner_macros"), + WarnFollowing, EncodeCrossCrate::Yes + ), + ungated!(proc_macro, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No), ungated!( proc_macro_derive, Normal, template!(List: "TraitName, /*opt*/ attributes(name1, name2, ...)"), - ErrorFollowing, @only_local: true, + ErrorFollowing, EncodeCrossCrate::No, ), - ungated!(proc_macro_attribute, Normal, template!(Word), ErrorFollowing, @only_local: true), + ungated!(proc_macro_attribute, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No), // Lints: ungated!( warn, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), - DuplicatesOk, @only_local: true, + DuplicatesOk, EncodeCrossCrate::No, ), ungated!( allow, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), - DuplicatesOk, @only_local: true, + DuplicatesOk, EncodeCrossCrate::No, ), gated!( expect, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk, - @only_local: true, lint_reasons, experimental!(expect) + EncodeCrossCrate::No, lint_reasons, experimental!(expect) ), ungated!( forbid, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), - DuplicatesOk, @only_local: true, + DuplicatesOk, EncodeCrossCrate::No ), ungated!( deny, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), - DuplicatesOk, @only_local: true, + DuplicatesOk, EncodeCrossCrate::No + ), + ungated!( + must_use, Normal, template!(Word, NameValueStr: "reason"), + FutureWarnFollowing, EncodeCrossCrate::Yes ), - ungated!(must_use, Normal, template!(Word, NameValueStr: "reason"), FutureWarnFollowing), gated!( must_not_suspend, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing, - experimental!(must_not_suspend) + EncodeCrossCrate::Yes, experimental!(must_not_suspend) ), ungated!( deprecated, Normal, @@ -340,22 +343,22 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ List: r#"/*opt*/ since = "version", /*opt*/ note = "reason""#, NameValueStr: "reason" ), - ErrorFollowing + ErrorFollowing, EncodeCrossCrate::Yes ), // Crate properties: ungated!( crate_name, CrateLevel, template!(NameValueStr: "name"), FutureWarnFollowing, - @only_local: true, + EncodeCrossCrate::No, ), ungated!( crate_type, CrateLevel, template!(NameValueStr: "bin|lib|..."), DuplicatesOk, - @only_local: true, + EncodeCrossCrate::No, ), // crate_id is deprecated ungated!( crate_id, CrateLevel, template!(NameValueStr: "ignored"), FutureWarnFollowing, - @only_local: true, + EncodeCrossCrate::No, ), // ABI, linking, symbols, and FFI @@ -363,81 +366,88 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ link, Normal, template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated""#), DuplicatesOk, - @only_local: true, + EncodeCrossCrate::No, + ), + ungated!( + link_name, Normal, template!(NameValueStr: "name"), + FutureWarnPreceding, EncodeCrossCrate::Yes ), - ungated!(link_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding), - ungated!(no_link, Normal, template!(Word), WarnFollowing, @only_local: true), - ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, @only_local: true), - ungated!(export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, @only_local: true), - ungated!(link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, @only_local: true), - ungated!(no_mangle, Normal, template!(Word), WarnFollowing, @only_local: true), - ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, @only_local: true), - ungated!(link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding), + ungated!(no_link, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, EncodeCrossCrate::No), + ungated!(export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No), + ungated!(link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No), + ungated!(no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, EncodeCrossCrate::No), + ungated!(link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding, EncodeCrossCrate::Yes), // Limits: ungated!( recursion_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing, - @only_local: true + EncodeCrossCrate::No ), ungated!( type_length_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing, - @only_local: true + EncodeCrossCrate::No ), gated!( move_size_limit, CrateLevel, template!(NameValueStr: "N"), ErrorFollowing, - @only_local: true, large_assignments, experimental!(move_size_limit) + EncodeCrossCrate::No, large_assignments, experimental!(move_size_limit) ), // Entry point: - gated!(unix_sigpipe, Normal, template!(NameValueStr: "inherit|sig_ign|sig_dfl"), ErrorFollowing, experimental!(unix_sigpipe)), - ungated!(start, Normal, template!(Word), WarnFollowing, @only_local: true), - ungated!(no_start, CrateLevel, template!(Word), WarnFollowing, @only_local: true), - ungated!(no_main, CrateLevel, template!(Word), WarnFollowing, @only_local: true), + gated!( + unix_sigpipe, Normal, template!(NameValueStr: "inherit|sig_ign|sig_dfl"), ErrorFollowing, + EncodeCrossCrate::Yes, experimental!(unix_sigpipe) + ), + ungated!(start, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(no_start, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(no_main, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::No), // Modules, prelude, and resolution: - ungated!(path, Normal, template!(NameValueStr: "file"), FutureWarnFollowing, @only_local: true), - ungated!(no_std, CrateLevel, template!(Word), WarnFollowing, @only_local: true), - ungated!(no_implicit_prelude, Normal, template!(Word), WarnFollowing, @only_local: true), - ungated!(non_exhaustive, Normal, template!(Word), WarnFollowing), + ungated!(path, Normal, template!(NameValueStr: "file"), FutureWarnFollowing, EncodeCrossCrate::No), + ungated!(no_std, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(no_implicit_prelude, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(non_exhaustive, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), // Runtime ungated!( windows_subsystem, CrateLevel, template!(NameValueStr: "windows|console"), FutureWarnFollowing, - @only_local: true + EncodeCrossCrate::No ), - ungated!(panic_handler, Normal, template!(Word), WarnFollowing), // RFC 2070 + ungated!(panic_handler, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), // RFC 2070 // Code generation: - ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing, @only_local: true), - ungated!(cold, Normal, template!(Word), WarnFollowing, @only_local: true), - ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing), + ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing, EncodeCrossCrate::No), + ungated!(cold, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), + ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), ungated!( target_feature, Normal, template!(List: r#"enable = "name""#), - DuplicatesOk, @only_local: true, + DuplicatesOk, EncodeCrossCrate::No, ), - ungated!(track_caller, Normal, template!(Word), WarnFollowing), - ungated!(instruction_set, Normal, template!(List: "set"), ErrorPreceding, @only_local: true), + ungated!(track_caller, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), + ungated!(instruction_set, Normal, template!(List: "set"), ErrorPreceding, EncodeCrossCrate::No), gated!( no_sanitize, Normal, template!(List: "address, kcfi, memory, thread"), DuplicatesOk, - @only_local: true, experimental!(no_sanitize) + EncodeCrossCrate::No, experimental!(no_sanitize) ), gated!( coverage, Normal, template!(Word, List: "on|off"), - WarnFollowing, @only_local: true, + WarnFollowing, EncodeCrossCrate::No, coverage_attribute, experimental!(coverage) ), ungated!( - doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk + doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk, + EncodeCrossCrate::Yes ), // Debugging ungated!( debugger_visualizer, Normal, template!(List: r#"natvis_file = "...", gdb_script_file = "...""#), - DuplicatesOk, @only_local: true + DuplicatesOk, EncodeCrossCrate::No ), // ========================================================================== @@ -446,54 +456,55 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Linking: gated!( - naked, Normal, template!(Word), WarnFollowing, @only_local: true, + naked, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, naked_functions, experimental!(naked) ), // Testing: gated!( - test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks, + test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, + EncodeCrossCrate::Yes, custom_test_frameworks, "custom test frameworks are an unstable feature", ), // RFC #1268 gated!( - marker, Normal, template!(Word), WarnFollowing, @only_local: true, + marker, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, marker_trait_attr, experimental!(marker) ), gated!( - thread_local, Normal, template!(Word), WarnFollowing, @only_local: true, + thread_local, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, "`#[thread_local]` is an experimental feature, and does not currently handle destructors", ), gated!( no_core, CrateLevel, template!(Word), WarnFollowing, - @only_local: true, experimental!(no_core) + EncodeCrossCrate::No, experimental!(no_core) ), // RFC 2412 gated!( optimize, Normal, template!(List: "size|speed"), ErrorPreceding, - @only_local: true, optimize_attribute, experimental!(optimize) + EncodeCrossCrate::No, optimize_attribute, experimental!(optimize) ), gated!( ffi_pure, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(ffi_pure) + EncodeCrossCrate::No, experimental!(ffi_pure) ), gated!( ffi_const, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(ffi_const) + EncodeCrossCrate::No, experimental!(ffi_const) ), gated!( register_tool, CrateLevel, template!(List: "tool1, tool2, ..."), DuplicatesOk, - @only_local: true, experimental!(register_tool), + EncodeCrossCrate::No, experimental!(register_tool), ), gated!( cmse_nonsecure_entry, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(cmse_nonsecure_entry) + EncodeCrossCrate::No, experimental!(cmse_nonsecure_entry) ), // RFC 2632 gated!( - const_trait, Normal, template!(Word), WarnFollowing, const_trait_impl, + const_trait, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes, const_trait_impl, "`const_trait` is a temporary placeholder for marking a trait that is suitable for `const` \ `impls` and all default bodies as `const`, which may be removed or renamed in the \ future." @@ -501,25 +512,25 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // lang-team MCP 147 gated!( deprecated_safe, Normal, template!(List: r#"since = "version", note = "...""#), ErrorFollowing, - experimental!(deprecated_safe), + EncodeCrossCrate::Yes, experimental!(deprecated_safe), ), // `#[collapse_debuginfo]` gated!( collapse_debuginfo, Normal, template!(Word, List: "no|external|yes"), ErrorFollowing, - @only_local: true, experimental!(collapse_debuginfo) + EncodeCrossCrate::No, experimental!(collapse_debuginfo) ), // RFC 2397 gated!( do_not_recommend, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(do_not_recommend) + EncodeCrossCrate::No, experimental!(do_not_recommend) ), // `#[cfi_encoding = ""]` gated!( cfi_encoding, Normal, template!(NameValueStr: "encoding"), ErrorPreceding, - experimental!(cfi_encoding) + EncodeCrossCrate::Yes, experimental!(cfi_encoding) ), // ========================================================================== @@ -528,43 +539,48 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ ungated!( feature, CrateLevel, - template!(List: "name1, name2, ..."), DuplicatesOk, @only_local: true, + template!(List: "name1, name2, ..."), DuplicatesOk, EncodeCrossCrate::No, ), // DuplicatesOk since it has its own validation ungated!( stable, Normal, - template!(List: r#"feature = "name", since = "version""#), DuplicatesOk, @only_local: true, + template!(List: r#"feature = "name", since = "version""#), DuplicatesOk, EncodeCrossCrate::No, ), ungated!( unstable, Normal, template!(List: r#"feature = "name", reason = "...", issue = "N""#), DuplicatesOk, + EncodeCrossCrate::Yes + ), + ungated!( + rustc_const_unstable, Normal, template!(List: r#"feature = "name""#), + DuplicatesOk, EncodeCrossCrate::Yes ), - ungated!(rustc_const_unstable, Normal, template!(List: r#"feature = "name""#), DuplicatesOk), ungated!( rustc_const_stable, Normal, - template!(List: r#"feature = "name""#), DuplicatesOk, @only_local: true, + template!(List: r#"feature = "name""#), DuplicatesOk, EncodeCrossCrate::No, ), ungated!( rustc_default_body_unstable, Normal, template!(List: r#"feature = "name", reason = "...", issue = "N""#), - DuplicatesOk, @only_local: true + DuplicatesOk, EncodeCrossCrate::No ), gated!( - allow_internal_unstable, Normal, template!(Word, List: "feat1, feat2, ..."), DuplicatesOk, + allow_internal_unstable, Normal, template!(Word, List: "feat1, feat2, ..."), + DuplicatesOk, EncodeCrossCrate::Yes, "allow_internal_unstable side-steps feature gating and stability checks", ), gated!( rustc_allow_const_fn_unstable, Normal, - template!(Word, List: "feat1, feat2, ..."), DuplicatesOk, @only_local: true, + template!(Word, List: "feat1, feat2, ..."), DuplicatesOk, EncodeCrossCrate::No, "rustc_allow_const_fn_unstable side-steps feature gating and stability checks" ), gated!( allow_internal_unsafe, Normal, template!(Word), WarnFollowing, - @only_local: true, "allow_internal_unsafe side-steps the unsafe_code lint", + EncodeCrossCrate::No, "allow_internal_unsafe side-steps the unsafe_code lint", ), rustc_attr!( rustc_allowed_through_unstable_modules, Normal, template!(Word), - WarnFollowing, @only_local: true, + WarnFollowing, EncodeCrossCrate::No, "rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \ through unstable paths" ), @@ -573,16 +589,16 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Internal attributes: Type system related: // ========================================================================== - gated!(fundamental, Normal, template!(Word), WarnFollowing, experimental!(fundamental)), + gated!(fundamental, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes, experimental!(fundamental)), gated!( may_dangle, Normal, template!(Word), WarnFollowing, - @only_local: true, dropck_eyepatch, + EncodeCrossCrate::No, dropck_eyepatch, "`may_dangle` has unstable semantics and may be removed in the future", ), rustc_attr!( rustc_never_type_mode, Normal, template!(NameValueStr: "fallback_to_unit|fallback_to_niko|fallback_to_never|no_fallback"), ErrorFollowing, - @only_local: true, + EncodeCrossCrate::No, "`rustc_never_type_fallback` is used to experiment with never type fallback and work on \ never type stabilization, and will never be stable" ), @@ -593,49 +609,49 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ rustc_attr!( rustc_allocator, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL + EncodeCrossCrate::No, IMPL_DETAIL ), rustc_attr!( rustc_nounwind, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL + EncodeCrossCrate::No, IMPL_DETAIL ), rustc_attr!( rustc_reallocator, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL + EncodeCrossCrate::No, IMPL_DETAIL ), rustc_attr!( rustc_deallocator, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL + EncodeCrossCrate::No, IMPL_DETAIL ), rustc_attr!( rustc_allocator_zeroed, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL + EncodeCrossCrate::No, IMPL_DETAIL ), gated!( default_lib_allocator, Normal, template!(Word), WarnFollowing, - @only_local: true, allocator_internals, experimental!(default_lib_allocator), + EncodeCrossCrate::No, allocator_internals, experimental!(default_lib_allocator), ), gated!( needs_allocator, Normal, template!(Word), WarnFollowing, - @only_local: true, allocator_internals, experimental!(needs_allocator), + EncodeCrossCrate::No, allocator_internals, experimental!(needs_allocator), ), gated!( panic_runtime, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(panic_runtime) + EncodeCrossCrate::No, experimental!(panic_runtime) ), gated!( needs_panic_runtime, Normal, template!(Word), WarnFollowing, - @only_local: true, experimental!(needs_panic_runtime) + EncodeCrossCrate::No, experimental!(needs_panic_runtime) ), gated!( compiler_builtins, Normal, template!(Word), WarnFollowing, - @only_local: true, + EncodeCrossCrate::No, "the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \ which contains compiler-rt intrinsics and will never be stable", ), gated!( profiler_runtime, Normal, template!(Word), WarnFollowing, - @only_local: true, + EncodeCrossCrate::No, "the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \ which contains the profiler runtime and will never be stable", ), @@ -645,11 +661,13 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // ========================================================================== gated!( - linkage, Normal, template!(NameValueStr: "external|internal|..."), ErrorPreceding, @only_local: true, + linkage, Normal, template!(NameValueStr: "external|internal|..."), + ErrorPreceding, EncodeCrossCrate::No, "the `linkage` attribute is experimental and not portable across platforms", ), rustc_attr!( - rustc_std_internal_symbol, Normal, template!(Word), WarnFollowing, @only_local: true, INTERNAL_UNSTABLE + rustc_std_internal_symbol, Normal, template!(Word), WarnFollowing, + EncodeCrossCrate::No, INTERNAL_UNSTABLE ), // ========================================================================== @@ -659,16 +677,16 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ rustc_attr!( rustc_builtin_macro, Normal, template!(Word, List: "name, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing, - IMPL_DETAIL, + EncodeCrossCrate::Yes, IMPL_DETAIL ), rustc_attr!( rustc_proc_macro_decls, Normal, template!(Word), WarnFollowing, - @only_local: true, INTERNAL_UNSTABLE + EncodeCrossCrate::No, INTERNAL_UNSTABLE ), rustc_attr!( rustc_macro_transparency, Normal, template!(NameValueStr: "transparent|semitransparent|opaque"), ErrorFollowing, - "used internally for testing macro hygiene", + EncodeCrossCrate::Yes, "used internally for testing macro hygiene", ), // ========================================================================== @@ -681,36 +699,50 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ List: r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#, NameValueStr: "message" ), - ErrorFollowing, + ErrorFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), rustc_attr!( rustc_confusables, Normal, template!(List: r#""name1", "name2", ..."#), - ErrorFollowing, + ErrorFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE, ), // Enumerates "identity-like" conversion methods to suggest on type mismatch. rustc_attr!( - rustc_conversion_suggestion, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE + rustc_conversion_suggestion, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), // Prevents field reads in the marked trait or method to be considered // during dead code analysis. rustc_attr!( - rustc_trivial_field_reads, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE + rustc_trivial_field_reads, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), // Used by the `rustc::potential_query_instability` lint to warn methods which // might not be stable during incremental compilation. - rustc_attr!(rustc_lint_query_instability, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE), + rustc_attr!( + rustc_lint_query_instability, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE + ), // Used by the `rustc::diagnostic_outside_of_impl` lints to assist in changes to diagnostic // APIs. Any function with this attribute will be checked by that lint. - rustc_attr!(rustc_lint_diagnostics, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE), + rustc_attr!( + rustc_lint_diagnostics, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE + ), // Used by the `rustc::bad_opt_access` lint to identify `DebuggingOptions` and `CodegenOptions` // types (as well as any others in future). - rustc_attr!(rustc_lint_opt_ty, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE), + rustc_attr!( + rustc_lint_opt_ty, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE + ), // Used by the `rustc::bad_opt_access` lint on fields // types (as well as any others in future). - rustc_attr!(rustc_lint_opt_deny_field_access, Normal, template!(List: "message"), WarnFollowing, INTERNAL_UNSTABLE), + rustc_attr!( + rustc_lint_opt_deny_field_access, Normal, template!(List: "message"), + WarnFollowing, EncodeCrossCrate::Yes, INTERNAL_UNSTABLE + ), // ========================================================================== // Internal attributes, Const related: @@ -718,18 +750,20 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ rustc_attr!( rustc_promotable, Normal, template!(Word), WarnFollowing, - @only_local: true, IMPL_DETAIL), + EncodeCrossCrate::No, IMPL_DETAIL), rustc_attr!( rustc_legacy_const_generics, Normal, template!(List: "N"), ErrorFollowing, - INTERNAL_UNSTABLE + EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), // Do not const-check this function's body. It will always get replaced during CTFE. rustc_attr!( - rustc_do_not_const_check, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE + rustc_do_not_const_check, Normal, template!(Word), WarnFollowing, + EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), // Ensure the argument to this function is &&str during const-check. rustc_attr!( - rustc_const_panic_str, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE + rustc_const_panic_str, Normal, template!(Word), WarnFollowing, + EncodeCrossCrate::Yes, INTERNAL_UNSTABLE ), // ========================================================================== @@ -738,16 +772,19 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ rustc_attr!( rustc_layout_scalar_valid_range_start, Normal, template!(List: "value"), ErrorFollowing, + EncodeCrossCrate::Yes, "the `#[rustc_layout_scalar_valid_range_start]` attribute is just used to enable \ niche optimizations in libcore and libstd and will never be stable", ), rustc_attr!( rustc_layout_scalar_valid_range_end, Normal, template!(List: "value"), ErrorFollowing, + EncodeCrossCrate::Yes, "the `#[rustc_layout_scalar_valid_range_end]` attribute is just used to enable \ niche optimizations in libcore and libstd and will never be stable", ), rustc_attr!( rustc_nonnull_optimization_guaranteed, Normal, template!(Word), WarnFollowing, + EncodeCrossCrate::Yes, "the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \ niche optimizations in libcore and libstd and will never be stable", ), @@ -756,27 +793,29 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Internal attributes, Misc: // ========================================================================== gated!( - lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, @only_local: true, lang_items, + lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, EncodeCrossCrate::No, lang_items, "language items are subject to change", ), rustc_attr!( rustc_pass_by_value, Normal, template!(Word), ErrorFollowing, + EncodeCrossCrate::Yes, "#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference." ), rustc_attr!( rustc_never_returns_null_ptr, Normal, template!(Word), ErrorFollowing, + EncodeCrossCrate::Yes, "#[rustc_never_returns_null_ptr] is used to mark functions returning non-null pointers." ), rustc_attr!( - rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, @only_local: true, + rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, EncodeCrossCrate::No, "#![rustc_coherence_is_core] allows inherent methods on builtin types, only intended to be used in `core`." ), rustc_attr!( - rustc_coinductive, AttributeType::Normal, template!(Word), WarnFollowing, @only_local: true, + rustc_coinductive, AttributeType::Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, "#![rustc_coinductive] changes a trait to be coinductive, allowing cycles in the trait solver." ), rustc_attr!( - rustc_allow_incoherent_impl, AttributeType::Normal, template!(Word), ErrorFollowing, @only_local: true, + rustc_allow_incoherent_impl, AttributeType::Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No, "#[rustc_allow_incoherent_impl] has to be added to all impl items of an incoherent inherent impl." ), rustc_attr!( @@ -784,16 +823,17 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ AttributeType::Normal, template!(List: "implement_via_object = (true|false)"), ErrorFollowing, - @only_local: true, + EncodeCrossCrate::No, "#[rustc_deny_explicit_impl] enforces that a trait can have no user-provided impls" ), rustc_attr!( - rustc_has_incoherent_inherent_impls, AttributeType::Normal, template!(Word), ErrorFollowing, + rustc_has_incoherent_inherent_impls, AttributeType::Normal, template!(Word), + ErrorFollowing, EncodeCrossCrate::Yes, "#[rustc_has_incoherent_inherent_impls] allows the addition of incoherent inherent impls for \ the given type by annotating all impl items with #[rustc_allow_incoherent_impl]." ), rustc_attr!( - rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing, @only_local: true, + rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::No, "#[rustc_box] allows creating boxes \ and it is only intended to be used in `alloc`." ), @@ -801,7 +841,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ BuiltinAttribute { name: sym::rustc_diagnostic_item, // FIXME: This can be `true` once we always use `tcx.is_diagnostic_item`. - only_local: false, + encode_cross_crate: EncodeCrossCrate::Yes, type_: Normal, template: template!(NameValueStr: "name"), duplicates: ErrorFollowing, @@ -815,74 +855,74 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ gated!( // Used in resolve: prelude_import, Normal, template!(Word), WarnFollowing, - @only_local: true, "`#[prelude_import]` is for use by rustc only", + EncodeCrossCrate::No, "`#[prelude_import]` is for use by rustc only", ), gated!( - rustc_paren_sugar, Normal, template!(Word), WarnFollowing, @only_local: true, + rustc_paren_sugar, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, unboxed_closures, "unboxed_closures are still evolving", ), rustc_attr!( - rustc_inherit_overflow_checks, Normal, template!(Word), WarnFollowing, @only_local: true, + rustc_inherit_overflow_checks, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, "the `#[rustc_inherit_overflow_checks]` attribute is just used to control \ overflow checking behavior of several libcore functions that are inlined \ across crates and will never be stable", ), rustc_attr!( rustc_reservation_impl, Normal, - template!(NameValueStr: "reservation message"), ErrorFollowing, + template!(NameValueStr: "reservation message"), ErrorFollowing, EncodeCrossCrate::Yes, "the `#[rustc_reservation_impl]` attribute is internally used \ for reserving for `for From for T` impl" ), rustc_attr!( rustc_test_marker, Normal, template!(NameValueStr: "name"), WarnFollowing, - @only_local: true, "the `#[rustc_test_marker]` attribute is used internally to track tests", + EncodeCrossCrate::No, "the `#[rustc_test_marker]` attribute is used internally to track tests", ), rustc_attr!( rustc_unsafe_specialization_marker, Normal, template!(Word), - WarnFollowing, @only_local: true, + WarnFollowing, EncodeCrossCrate::No, "the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations" ), rustc_attr!( rustc_specialization_trait, Normal, template!(Word), - WarnFollowing, @only_local: true, + WarnFollowing, EncodeCrossCrate::No, "the `#[rustc_specialization_trait]` attribute is used to check specializations" ), rustc_attr!( - rustc_main, Normal, template!(Word), WarnFollowing, @only_local: true, + rustc_main, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, "the `#[rustc_main]` attribute is used internally to specify test entry point function", ), rustc_attr!( rustc_skip_array_during_method_dispatch, Normal, template!(Word), - WarnFollowing, @only_local: true, + WarnFollowing, EncodeCrossCrate::No, "the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \ from method dispatch when the receiver is an array, for compatibility in editions < 2021." ), rustc_attr!( rustc_must_implement_one_of, Normal, template!(List: "function1, function2, ..."), - ErrorFollowing, @only_local: true, + ErrorFollowing, EncodeCrossCrate::No, "the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \ definition of a trait, it's currently in experimental form and should be changed before \ being exposed outside of the std" ), rustc_attr!( rustc_doc_primitive, Normal, template!(NameValueStr: "primitive name"), ErrorFollowing, - r#"`rustc_doc_primitive` is a rustc internal attribute"#, + EncodeCrossCrate::Yes, r#"`rustc_doc_primitive` is a rustc internal attribute"#, ), rustc_attr!( rustc_safe_intrinsic, Normal, template!(Word), WarnFollowing, - @only_local: true, + EncodeCrossCrate::No, "the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe" ), rustc_attr!( - rustc_intrinsic, Normal, template!(Word), ErrorFollowing, + rustc_intrinsic, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, "the `#[rustc_intrinsic]` attribute is used to declare intrinsics with function bodies", ), rustc_attr!( - rustc_no_mir_inline, Normal, template!(Word), WarnFollowing, + rustc_no_mir_inline, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes, "#[rustc_no_mir_inline] prevents the MIR inliner from inlining a function while not affecting codegen" ), rustc_attr!( - rustc_intrinsic_must_be_overridden, Normal, template!(Word), ErrorFollowing, + rustc_intrinsic_must_be_overridden, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, "the `#[rustc_intrinsic_must_be_overridden]` attribute is used to declare intrinsics without real bodies", ), @@ -890,109 +930,135 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Internal attributes, Testing: // ========================================================================== - rustc_attr!(TEST, rustc_effective_visibility, Normal, template!(Word), WarnFollowing), + rustc_attr!(TEST, rustc_effective_visibility, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes), rustc_attr!( TEST, rustc_outlives, Normal, template!(Word), - WarnFollowing, @only_local: true + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_capture_analysis, Normal, template!(Word), - WarnFollowing, @only_local: true + WarnFollowing, EncodeCrossCrate::No + ), + rustc_attr!( + TEST, rustc_insignificant_dtor, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes + ), + rustc_attr!( + TEST, rustc_strict_coherence, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes + ), + rustc_attr!( + TEST, rustc_variance, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), - rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word), WarnFollowing), - rustc_attr!(TEST, rustc_strict_coherence, Normal, template!(Word), WarnFollowing), - rustc_attr!(TEST, rustc_variance, Normal, template!(Word), WarnFollowing, @only_local: true), rustc_attr!( TEST, rustc_variance_of_opaques, Normal, template!(Word), - WarnFollowing, @only_local: true + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_hidden_type_of_opaques, Normal, template!(Word), - WarnFollowing, @only_local: true), - rustc_attr!(TEST, rustc_layout, Normal, template!(List: "field1, field2, ..."), WarnFollowing), + WarnFollowing, EncodeCrossCrate::No + ), + rustc_attr!( + TEST, rustc_layout, Normal, template!(List: "field1, field2, ..."), + WarnFollowing, EncodeCrossCrate::Yes + ), rustc_attr!( TEST, rustc_abi, Normal, template!(List: "field1, field2, ..."), - WarnFollowing, @only_local: true + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_regions, Normal, template!(Word), - WarnFollowing, @only_local: true + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_error, Normal, - template!(Word, List: "delayed_bug_from_inside_query"), WarnFollowingWordOnly + template!(Word, List: "delayed_bug_from_inside_query"), + WarnFollowingWordOnly, EncodeCrossCrate::Yes + ), + rustc_attr!( + TEST, rustc_dump_user_args, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_dump_user_args, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing, + EncodeCrossCrate::Yes ), - rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing), rustc_attr!( - TEST, rustc_if_this_changed, Normal, template!(Word, List: "DepNode"), - DuplicatesOk, @only_local: true + TEST, rustc_if_this_changed, Normal, template!(Word, List: "DepNode"), DuplicatesOk, + EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_then_this_would_need, Normal, template!(List: "DepNode"), - DuplicatesOk, @only_local: true + TEST, rustc_then_this_would_need, Normal, template!(List: "DepNode"), DuplicatesOk, + EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_clean, Normal, template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#), - DuplicatesOk, @only_local: true + DuplicatesOk, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_partition_reused, Normal, - template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk, @only_local: true + template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_partition_codegened, Normal, - template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk, @only_local: true + template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk, EncodeCrossCrate::No ), rustc_attr!( TEST, rustc_expected_cgu_reuse, Normal, template!(List: r#"cfg = "...", module = "...", kind = "...""#), DuplicatesOk, - @only_local: true + EncodeCrossCrate::No + ), + rustc_attr!( + TEST, rustc_symbol_name, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_symbol_name, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_polymorphize_error, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes ), - rustc_attr!(TEST, rustc_polymorphize_error, Normal, template!(Word), WarnFollowing), rustc_attr!( - TEST, rustc_def_path, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_def_path, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No + ), + rustc_attr!( + TEST, rustc_mir, Normal, template!(List: "arg1, arg2, ..."), + DuplicatesOk, EncodeCrossCrate::Yes ), - rustc_attr!(TEST, rustc_mir, Normal, template!(List: "arg1, arg2, ..."), DuplicatesOk), gated!( custom_mir, Normal, template!(List: r#"dialect = "...", phase = "...""#), - ErrorFollowing, @only_local: true, + ErrorFollowing, EncodeCrossCrate::No, "the `#[custom_mir]` attribute is just used for the Rust test suite", ), rustc_attr!( - TEST, rustc_dump_program_clauses, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_dump_program_clauses, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_dump_env_program_clauses, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_dump_env_program_clauses, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_object_lifetime_default, Normal, template!(Word), WarnFollowing, - @only_local: true + TEST, rustc_object_lifetime_default, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No ), - rustc_attr!(TEST, rustc_dump_vtable, Normal, template!(Word), WarnFollowing), rustc_attr!( - TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/), DuplicatesOk, - @only_local: true + TEST, rustc_dump_vtable, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::Yes + ), + rustc_attr!( + TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/), + DuplicatesOk, EncodeCrossCrate::No ), gated!( - omit_gdb_pretty_printer_section, Normal, template!(Word), WarnFollowing, - @only_local: true, + omit_gdb_pretty_printer_section, Normal, template!(Word), + WarnFollowing, EncodeCrossCrate::No, "the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite", ), rustc_attr!( TEST, pattern_complexity, CrateLevel, template!(NameValueStr: "N"), - ErrorFollowing, @only_local: true, + ErrorFollowing, EncodeCrossCrate::No, ), ]; @@ -1004,10 +1070,14 @@ pub fn is_builtin_attr_name(name: Symbol) -> bool { BUILTIN_ATTRIBUTE_MAP.get(&name).is_some() } -/// Whether this builtin attribute is only used in the local crate. -/// If so, it is not encoded in the crate metadata. -pub fn is_builtin_only_local(name: Symbol) -> bool { - BUILTIN_ATTRIBUTE_MAP.get(&name).is_some_and(|attr| attr.only_local) +/// Whether this builtin attribute is encoded cross crate. +/// This means it can be used cross crate. +pub fn encode_cross_crate(name: Symbol) -> bool { + if let Some(attr) = BUILTIN_ATTRIBUTE_MAP.get(&name) { + if attr.encode_cross_crate == EncodeCrossCrate::Yes { true } else { false } + } else { + true + } } pub fn is_valid_for_get_attr(name: Symbol) -> bool { diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs index cbc0ce8c97468..cb28bb4e8e4ff 100644 --- a/compiler/rustc_feature/src/lib.rs +++ b/compiler/rustc_feature/src/lib.rs @@ -124,7 +124,7 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option { pub in_trait: bool, } -#[derive(Copy, Clone, Debug, HashStable_Generic)] -pub struct AssocOpaqueTy { - // Add some data if necessary -} - /// From whence the opaque type came. #[derive(Copy, Clone, PartialEq, Eq, Debug, HashStable_Generic)] pub enum OpaqueTyOrigin { @@ -3367,7 +3362,7 @@ pub enum OwnerNode<'hir> { TraitItem(&'hir TraitItem<'hir>), ImplItem(&'hir ImplItem<'hir>), Crate(&'hir Mod<'hir>), - AssocOpaqueTy(&'hir AssocOpaqueTy), + Synthetic, } impl<'hir> OwnerNode<'hir> { @@ -3377,7 +3372,7 @@ impl<'hir> OwnerNode<'hir> { | OwnerNode::ForeignItem(ForeignItem { ident, .. }) | OwnerNode::ImplItem(ImplItem { ident, .. }) | OwnerNode::TraitItem(TraitItem { ident, .. }) => Some(*ident), - OwnerNode::Crate(..) | OwnerNode::AssocOpaqueTy(..) => None, + OwnerNode::Crate(..) | OwnerNode::Synthetic => None, } } @@ -3390,7 +3385,7 @@ impl<'hir> OwnerNode<'hir> { | OwnerNode::ImplItem(ImplItem { span, .. }) | OwnerNode::TraitItem(TraitItem { span, .. }) => span, OwnerNode::Crate(Mod { spans: ModSpans { inner_span, .. }, .. }) => inner_span, - OwnerNode::AssocOpaqueTy(..) => unreachable!(), + OwnerNode::Synthetic => unreachable!(), } } @@ -3449,7 +3444,7 @@ impl<'hir> OwnerNode<'hir> { | OwnerNode::ImplItem(ImplItem { owner_id, .. }) | OwnerNode::ForeignItem(ForeignItem { owner_id, .. }) => *owner_id, OwnerNode::Crate(..) => crate::CRATE_HIR_ID.owner, - OwnerNode::AssocOpaqueTy(..) => unreachable!(), + OwnerNode::Synthetic => unreachable!(), } } @@ -3493,7 +3488,7 @@ impl<'hir> Into> for OwnerNode<'hir> { OwnerNode::ImplItem(n) => Node::ImplItem(n), OwnerNode::TraitItem(n) => Node::TraitItem(n), OwnerNode::Crate(n) => Node::Crate(n), - OwnerNode::AssocOpaqueTy(n) => Node::AssocOpaqueTy(n), + OwnerNode::Synthetic => Node::Synthetic, } } } @@ -3531,7 +3526,8 @@ pub enum Node<'hir> { WhereBoundPredicate(&'hir WhereBoundPredicate<'hir>), // FIXME: Merge into `Node::Infer`. ArrayLenInfer(&'hir InferArg), - AssocOpaqueTy(&'hir AssocOpaqueTy), + // Created by query feeding + Synthetic, // Span by reference to minimize `Node`'s size #[allow(rustc::pass_by_value)] Err(&'hir Span), @@ -3582,7 +3578,7 @@ impl<'hir> Node<'hir> { | Node::Infer(..) | Node::WhereBoundPredicate(..) | Node::ArrayLenInfer(..) - | Node::AssocOpaqueTy(..) + | Node::Synthetic | Node::Err(..) => None, } } @@ -3695,7 +3691,7 @@ impl<'hir> Node<'hir> { Node::TraitItem(i) => Some(OwnerNode::TraitItem(i)), Node::ImplItem(i) => Some(OwnerNode::ImplItem(i)), Node::Crate(i) => Some(OwnerNode::Crate(i)), - Node::AssocOpaqueTy(i) => Some(OwnerNode::AssocOpaqueTy(i)), + Node::Synthetic => Some(OwnerNode::Synthetic), _ => None, } } diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 41b03f0b66e4f..b5377e40bfdd9 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -196,7 +196,7 @@ fn check_well_formed(tcx: TyCtxt<'_>, def_id: hir::OwnerId) -> Result<(), ErrorG hir::OwnerNode::TraitItem(item) => check_trait_item(tcx, item), hir::OwnerNode::ImplItem(item) => check_impl_item(tcx, item), hir::OwnerNode::ForeignItem(item) => check_foreign_item(tcx, item), - hir::OwnerNode::AssocOpaqueTy(..) => unreachable!(), + hir::OwnerNode::Synthetic => unreachable!(), }; if let Some(generics) = node.generics() { diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index d1da2fa0fdc26..86b075a84a703 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -262,7 +262,7 @@ fn resolve_bound_vars(tcx: TyCtxt<'_>, local_def_id: hir::OwnerId) -> ResolveBou visitor.visit_impl_item(item) } hir::OwnerNode::Crate(_) => {} - hir::OwnerNode::AssocOpaqueTy(..) => unreachable!(), + hir::OwnerNode::Synthetic => unreachable!(), } let mut rl = ResolveBoundVars::default(); diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index e070db9423df1..34c245839478f 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -121,7 +121,7 @@ impl<'a> State<'a> { self.print_bounds(":", pred.bounds); } Node::ArrayLenInfer(_) => self.word("_"), - Node::AssocOpaqueTy(..) => unreachable!(), + Node::Synthetic => unreachable!(), Node::Err(_) => self.word("/*ERROR*/"), } } diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 5d2a95593cd25..331b3b97c3496 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -2553,7 +2553,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { hir::OwnerNode::ImplItem(i) => visitor.visit_impl_item(i), hir::OwnerNode::TraitItem(i) => visitor.visit_trait_item(i), hir::OwnerNode::Crate(_) => bug!("OwnerNode::Crate doesn't not have generics"), - hir::OwnerNode::AssocOpaqueTy(..) => unreachable!(), + hir::OwnerNode::Synthetic => unreachable!(), } let ast_generics = self.tcx.hir().get_generics(lifetime_scope).unwrap(); diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 21af6a182a9df..26fc3f20b2cb5 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -191,7 +191,7 @@ fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLe levels.add_id(hir::CRATE_HIR_ID); levels.visit_mod(mod_, mod_.spans.inner_span, hir::CRATE_HIR_ID) } - hir::OwnerNode::AssocOpaqueTy(..) => unreachable!(), + hir::OwnerNode::Synthetic => unreachable!(), }, } diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 0a9659745dbf4..8dfd6f14ccee3 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -817,8 +817,8 @@ struct AnalyzeAttrState { #[inline] fn analyze_attr(attr: &Attribute, state: &mut AnalyzeAttrState) -> bool { let mut should_encode = false; - if rustc_feature::is_builtin_only_local(attr.name_or_empty()) { - // Attributes marked local-only don't need to be encoded for downstream crates. + if !rustc_feature::encode_cross_crate(attr.name_or_empty()) { + // Attributes not marked encode-cross-crate don't need to be encoded for downstream crates. } else if attr.doc_str().is_some() { // We keep all doc comments reachable to rustdoc because they might be "imported" into // downstream crates if they use `#[doc(inline)]` to copy an item's documentation into diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index ed05ffef205e6..e8e80a8de50ee 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -914,7 +914,7 @@ impl<'hir> Map<'hir> { Node::Crate(item) => item.spans.inner_span, Node::WhereBoundPredicate(pred) => pred.span, Node::ArrayLenInfer(inf) => inf.span, - Node::AssocOpaqueTy(..) => unreachable!(), + Node::Synthetic => unreachable!(), Node::Err(span) => *span, } } @@ -1179,7 +1179,7 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { Node::Crate(..) => String::from("(root_crate)"), Node::WhereBoundPredicate(_) => node_str("where bound predicate"), Node::ArrayLenInfer(_) => node_str("array len infer"), - Node::AssocOpaqueTy(..) => unreachable!(), + Node::Synthetic => unreachable!(), Node::Err(_) => node_str("error"), } } diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 10a4da4042903..5de2e2fb1e7f2 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -596,6 +596,27 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> { pub fn feed_owner_id(&self) -> TyCtxtFeed<'tcx, hir::OwnerId> { TyCtxtFeed { tcx: self.tcx, key: hir::OwnerId { def_id: self.key } } } + + // Fills in all the important parts needed by HIR queries + pub fn feed_hir(&self) { + self.local_def_id_to_hir_id(HirId::make_owner(self.def_id())); + + let node = hir::OwnerNode::Synthetic; + let bodies = Default::default(); + let attrs = hir::AttributeMap::EMPTY; + + let (opt_hash_including_bodies, _) = self.tcx.hash_owner_nodes(node, &bodies, &attrs.map); + let node = node.into(); + self.opt_hir_owner_nodes(Some(self.tcx.arena.alloc(hir::OwnerNodes { + opt_hash_including_bodies, + nodes: IndexVec::from_elem_n( + hir::ParentedNode { parent: hir::ItemLocalId::INVALID, node }, + 1, + ), + bodies, + }))); + self.feed_owner_id().hir_attrs(attrs); + } } /// The central data structure of the compiler. It stores references diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 8565f90957f23..6632d980bff05 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1752,9 +1752,8 @@ impl<'tcx> TyCtxt<'tcx> { let filter_fn = move |a: &&ast::Attribute| a.has_name(attr); if let Some(did) = did.as_local() { self.hir().attrs(self.local_def_id_to_hir_id(did)).iter().filter(filter_fn) - } else if cfg!(debug_assertions) && rustc_feature::is_builtin_only_local(attr) { - bug!("tried to access the `only_local` attribute `{}` from an extern crate", attr); } else { + debug_assert!(rustc_feature::encode_cross_crate(attr)); self.item_attrs(did).iter().filter(filter_fn) } } @@ -1786,12 +1785,7 @@ impl<'tcx> TyCtxt<'tcx> { /// Determines whether an item is annotated with an attribute. pub fn has_attr(self, did: impl Into, attr: Symbol) -> bool { - let did: DefId = did.into(); - if cfg!(debug_assertions) && !did.is_local() && rustc_feature::is_builtin_only_local(attr) { - bug!("tried to access the `only_local` attribute `{}` from an extern crate", attr); - } else { - self.get_attrs(did, attr).next().is_some() - } + self.get_attrs(did, attr).next().is_some() } /// Returns `true` if this is an `auto trait`. diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e27a5f937990e..136145dd1826d 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -943,7 +943,10 @@ impl<'a> Parser<'a> { // Stitch the list of outer attributes onto the return value. // A little bit ugly, but the best way given the current code // structure - let res = self.parse_expr_dot_or_call_with_(e0, lo); + let res = ensure_sufficient_stack( + // this expr demonstrates the recursion it guards against + || self.parse_expr_dot_or_call_with_(e0, lo), + ); if attrs.is_empty() { res } else { diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index 79aab47fbe717..2bb4b09e337cb 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -907,25 +907,47 @@ impl<'a> Parser<'a> { let byte_pos = self.to_span_index(end); let start = InnerOffset(byte_pos.0 + 1); let field = self.argument(start); - // We can only parse `foo.bar` field access, any deeper nesting, - // or another type of expression, like method calls, are not supported + // We can only parse simple `foo.bar` field access or `foo.0` tuple index access, any + // deeper nesting, or another type of expression, like method calls, are not supported if !self.consume('}') { return; } if let ArgumentNamed(_) = arg.position { - if let ArgumentNamed(_) = field.position { - self.errors.insert( - 0, - ParseError { - description: "field access isn't supported".to_string(), - note: None, - label: "not supported".to_string(), - span: InnerSpan::new(arg.position_span.start, field.position_span.end), - secondary_label: None, - suggestion: Suggestion::UsePositional, - }, - ); - } + match field.position { + ArgumentNamed(_) => { + self.errors.insert( + 0, + ParseError { + description: "field access isn't supported".to_string(), + note: None, + label: "not supported".to_string(), + span: InnerSpan::new( + arg.position_span.start, + field.position_span.end, + ), + secondary_label: None, + suggestion: Suggestion::UsePositional, + }, + ); + } + ArgumentIs(_) => { + self.errors.insert( + 0, + ParseError { + description: "tuple index access isn't supported".to_string(), + note: None, + label: "not supported".to_string(), + span: InnerSpan::new( + arg.position_span.start, + field.position_span.end, + ), + secondary_label: None, + suggestion: Suggestion::UsePositional, + }, + ); + } + _ => {} + }; } } } diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs index 6eb03bc0f5fbc..b7135de08ba84 100644 --- a/compiler/rustc_passes/src/reachable.rs +++ b/compiler/rustc_passes/src/reachable.rs @@ -247,7 +247,7 @@ impl<'tcx> ReachableContext<'tcx> { | Node::Field(_) | Node::Ty(_) | Node::Crate(_) - | Node::AssocOpaqueTy(..) => {} + | Node::Synthetic => {} _ => { bug!( "found unexpected node kind in worklist: {} ({:?})", diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 837c069b5997d..c661be3587e92 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -4665,6 +4665,13 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> { } fn lint_unused_qualifications(&mut self, path: &[Segment], ns: Namespace, finalize: Finalize) { + // Don't lint on global paths because the user explicitly wrote out the full path. + if let Some(seg) = path.first() + && seg.ident.name == kw::PathRoot + { + return; + } + if path.iter().any(|seg| seg.ident.span.from_expansion()) { return; } diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs index 50a8eb869b992..ba75424ec0c6d 100644 --- a/compiler/rustc_ty_utils/src/assoc.rs +++ b/compiler/rustc_ty_utils/src/assoc.rs @@ -1,11 +1,10 @@ use rustc_data_structures::fx::FxIndexSet; +use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId}; use rustc_hir::intravisit::{self, Visitor}; -use rustc_hir::{self as hir, HirId}; -use rustc_index::IndexVec; use rustc_middle::query::Providers; -use rustc_middle::ty::{self, ImplTraitInTraitData, TyCtxt, TyCtxtFeed}; +use rustc_middle::ty::{self, ImplTraitInTraitData, TyCtxt}; use rustc_span::symbol::kw; pub(crate) fn provide(providers: &mut Providers) { @@ -238,28 +237,6 @@ fn associated_types_for_impl_traits_in_associated_fn( } } -fn feed_hir(feed: &TyCtxtFeed<'_, LocalDefId>) { - feed.local_def_id_to_hir_id(HirId::make_owner(feed.def_id())); - - let node = hir::OwnerNode::AssocOpaqueTy(&hir::AssocOpaqueTy {}); - let bodies = Default::default(); - let attrs = hir::AttributeMap::EMPTY; - - let (opt_hash_including_bodies, _) = feed.tcx.hash_owner_nodes(node, &bodies, &attrs.map); - feed.opt_hir_owner_nodes(Some(feed.tcx.arena.alloc(hir::OwnerNodes { - opt_hash_including_bodies, - nodes: IndexVec::from_elem_n( - hir::ParentedNode { - parent: hir::ItemLocalId::INVALID, - node: hir::Node::AssocOpaqueTy(&hir::AssocOpaqueTy {}), - }, - 1, - ), - bodies, - }))); - feed.feed_owner_id().hir_attrs(attrs); -} - /// Given an `opaque_ty_def_id` corresponding to an `impl Trait` in an associated /// function from a trait, synthesize an associated type for that `impl Trait` /// that inherits properties that we infer from the method and the opaque type. @@ -281,7 +258,7 @@ fn associated_type_for_impl_trait_in_trait( let local_def_id = trait_assoc_ty.def_id(); let def_id = local_def_id.to_def_id(); - feed_hir(&trait_assoc_ty); + trait_assoc_ty.feed_hir(); // Copy span of the opaque. trait_assoc_ty.def_ident_span(Some(span)); @@ -335,7 +312,7 @@ fn associated_type_for_impl_trait_in_impl( let local_def_id = impl_assoc_ty.def_id(); let def_id = local_def_id.to_def_id(); - feed_hir(&impl_assoc_ty); + impl_assoc_ty.feed_hir(); // Copy span of the opaque. impl_assoc_ty.def_ident_span(Some(span)); diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index e247b9ed83df5..d1dc6720271f3 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1337,7 +1337,7 @@ impl SizedTypeProperties for T {} /// type B = Wrapper; /// /// // Not necessarily identical even though `u8` and `i8` have the same layout! -/// // assert!(mem::offset_of!(A, 1), mem::offset_of!(B, 1)); +/// // assert_eq!(mem::offset_of!(A, 1), mem::offset_of!(B, 1)); /// /// #[repr(transparent)] /// struct U8(u8); @@ -1345,12 +1345,12 @@ impl SizedTypeProperties for T {} /// type C = Wrapper; /// /// // Not necessarily identical even though `u8` and `U8` have the same layout! -/// // assert!(mem::offset_of!(A, 1), mem::offset_of!(C, 1)); +/// // assert_eq!(mem::offset_of!(A, 1), mem::offset_of!(C, 1)); /// /// struct Empty(core::marker::PhantomData); /// /// // Not necessarily identical even though `PhantomData` always has the same layout! -/// // assert!(mem::offset_of!(Empty, 0), mem::offset_of!(Empty, 0)); +/// // assert_eq!(mem::offset_of!(Empty, 0), mem::offset_of!(Empty, 0)); /// ``` /// /// [explicit `repr` attribute]: https://doc.rust-lang.org/reference/type-layout.html#representations diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index a512599f723b7..6ff47dbffbcba 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -36,6 +36,7 @@ impl HeadersCache { #[derive(Default)] pub struct EarlyProps { pub aux: Vec, + pub aux_bin: Vec, pub aux_crate: Vec<(String, String)>, pub revisions: Vec, } @@ -59,6 +60,12 @@ impl EarlyProps { config.push_name_value_directive(ln, directives::AUX_BUILD, &mut props.aux, |r| { r.trim().to_string() }); + config.push_name_value_directive( + ln, + directives::AUX_BIN, + &mut props.aux_bin, + |r| r.trim().to_string(), + ); config.push_name_value_directive( ln, directives::AUX_CRATE, @@ -95,6 +102,8 @@ pub struct TestProps { // directory as the test, but for backwards compatibility reasons // we also check the auxiliary directory) pub aux_builds: Vec, + // Auxiliary crates that should be compiled as `#![crate_type = "bin"]`. + pub aux_bins: Vec, // Similar to `aux_builds`, but a list of NAME=somelib.rs of dependencies // to build and pass with the `--extern` flag. pub aux_crates: Vec<(String, String)>, @@ -217,6 +226,7 @@ mod directives { pub const PRETTY_EXPANDED: &'static str = "pretty-expanded"; pub const PRETTY_MODE: &'static str = "pretty-mode"; pub const PRETTY_COMPARE_ONLY: &'static str = "pretty-compare-only"; + pub const AUX_BIN: &'static str = "aux-bin"; pub const AUX_BUILD: &'static str = "aux-build"; pub const AUX_CRATE: &'static str = "aux-crate"; pub const EXEC_ENV: &'static str = "exec-env"; @@ -252,6 +262,7 @@ impl TestProps { run_flags: None, pp_exact: None, aux_builds: vec![], + aux_bins: vec![], aux_crates: vec![], revisions: vec![], rustc_env: vec![("RUSTC_ICE".to_string(), "0".to_string())], @@ -417,6 +428,9 @@ impl TestProps { config.push_name_value_directive(ln, AUX_BUILD, &mut self.aux_builds, |r| { r.trim().to_string() }); + config.push_name_value_directive(ln, AUX_BIN, &mut self.aux_bins, |r| { + r.trim().to_string() + }); config.push_name_value_directive( ln, AUX_CRATE, @@ -683,6 +697,7 @@ pub fn line_directive<'line>( const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ // tidy-alphabetical-start "assembly-output", + "aux-bin", "aux-build", "aux-crate", "build-aux-docs", diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 83c595ce2416e..67db33abf65ff 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -82,21 +82,21 @@ fn disable_error_reporting R, R>(f: F) -> R { } /// The platform-specific library name -pub fn get_lib_name(lib: &str, dylib: bool) -> String { - // In some casess (e.g. MUSL), we build a static - // library, rather than a dynamic library. - // In this case, the only path we can pass - // with '--extern-meta' is the '.lib' file - if !dylib { - return format!("lib{}.rlib", lib); - } - - if cfg!(windows) { - format!("{}.dll", lib) - } else if cfg!(target_os = "macos") { - format!("lib{}.dylib", lib) - } else { - format!("lib{}.so", lib) +fn get_lib_name(lib: &str, aux_type: AuxType) -> Option { + match aux_type { + AuxType::Bin => None, + // In some cases (e.g. MUSL), we build a static + // library, rather than a dynamic library. + // In this case, the only path we can pass + // with '--extern-meta' is the '.rlib' file + AuxType::Lib => Some(format!("lib{}.rlib", lib)), + AuxType::Dylib => Some(if cfg!(windows) { + format!("{}.dll", lib) + } else if cfg!(target_os = "macos") { + format!("lib{}.dylib", lib) + } else { + format!("lib{}.so", lib) + }), } } @@ -2098,19 +2098,36 @@ impl<'test> TestCx<'test> { create_dir_all(&aux_dir).unwrap(); } + if !self.props.aux_bins.is_empty() { + let aux_bin_dir = self.aux_bin_output_dir_name(); + let _ = fs::remove_dir_all(&aux_bin_dir); + create_dir_all(&aux_bin_dir).unwrap(); + } + aux_dir } fn build_all_auxiliary(&self, of: &TestPaths, aux_dir: &Path, rustc: &mut Command) { for rel_ab in &self.props.aux_builds { - self.build_auxiliary(of, rel_ab, &aux_dir); + self.build_auxiliary(of, rel_ab, &aux_dir, false /* is_bin */); + } + + for rel_ab in &self.props.aux_bins { + self.build_auxiliary(of, rel_ab, &aux_dir, true /* is_bin */); } for (aux_name, aux_path) in &self.props.aux_crates { - let is_dylib = self.build_auxiliary(of, &aux_path, &aux_dir); + let aux_type = self.build_auxiliary(of, &aux_path, &aux_dir, false /* is_bin */); let lib_name = - get_lib_name(&aux_path.trim_end_matches(".rs").replace('-', "_"), is_dylib); - rustc.arg("--extern").arg(format!("{}={}/{}", aux_name, aux_dir.display(), lib_name)); + get_lib_name(&aux_path.trim_end_matches(".rs").replace('-', "_"), aux_type); + if let Some(lib_name) = lib_name { + rustc.arg("--extern").arg(format!( + "{}={}/{}", + aux_name, + aux_dir.display(), + lib_name + )); + } } } @@ -2129,12 +2146,23 @@ impl<'test> TestCx<'test> { } /// Builds an aux dependency. - /// - /// Returns whether or not it is a dylib. - fn build_auxiliary(&self, of: &TestPaths, source_path: &str, aux_dir: &Path) -> bool { + fn build_auxiliary( + &self, + of: &TestPaths, + source_path: &str, + aux_dir: &Path, + is_bin: bool, + ) -> AuxType { let aux_testpaths = self.compute_aux_test_paths(of, source_path); let aux_props = self.props.from_aux_file(&aux_testpaths.file, self.revision, self.config); - let aux_output = TargetLocation::ThisDirectory(aux_dir.to_path_buf()); + let mut aux_dir = aux_dir.to_path_buf(); + if is_bin { + // On unix, the binary of `auxiliary/foo.rs` will be named + // `auxiliary/foo` which clashes with the _dir_ `auxiliary/foo`, so + // put bins in a `bin` subfolder. + aux_dir.push("bin"); + } + let aux_output = TargetLocation::ThisDirectory(aux_dir.clone()); let aux_cx = TestCx { config: self.config, props: &aux_props, @@ -2152,15 +2180,17 @@ impl<'test> TestCx<'test> { LinkToAux::No, Vec::new(), ); - aux_cx.build_all_auxiliary(of, aux_dir, &mut aux_rustc); + aux_cx.build_all_auxiliary(of, &aux_dir, &mut aux_rustc); for key in &aux_props.unset_rustc_env { aux_rustc.env_remove(key); } aux_rustc.envs(aux_props.rustc_env.clone()); - let (dylib, crate_type) = if aux_props.no_prefer_dynamic { - (true, None) + let (aux_type, crate_type) = if is_bin { + (AuxType::Bin, Some("bin")) + } else if aux_props.no_prefer_dynamic { + (AuxType::Dylib, None) } else if self.config.target.contains("emscripten") || (self.config.target.contains("musl") && !aux_props.force_host @@ -2185,9 +2215,9 @@ impl<'test> TestCx<'test> { // Coverage tests want static linking by default so that coverage // mappings in auxiliary libraries can be merged into the final // executable. - (false, Some("lib")) + (AuxType::Lib, Some("lib")) } else { - (true, Some("dylib")) + (AuxType::Dylib, Some("dylib")) }; if let Some(crate_type) = crate_type { @@ -2211,7 +2241,7 @@ impl<'test> TestCx<'test> { &auxres, ); } - dylib + aux_type } fn read2_abbreviated(&self, child: Child) -> (Output, Truncated) { @@ -2677,6 +2707,12 @@ impl<'test> TestCx<'test> { .with_extra_extension(self.config.mode.aux_dir_disambiguator()) } + /// Gets the directory where auxiliary binaries are written. + /// E.g., `/.../testname.revision.mode/auxiliary/bin`. + fn aux_bin_output_dir_name(&self) -> PathBuf { + self.aux_output_dir_name().join("bin") + } + /// Generates a unique name for the test, such as `testname.revision.mode`. fn output_testname_unique(&self) -> PathBuf { output_testname_unique(self.config, self.testpaths, self.safe_revision()) @@ -4826,3 +4862,9 @@ enum LinkToAux { Yes, No, } + +enum AuxType { + Bin, + Lib, + Dylib, +} diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 03e4ecca9d6fd..5b4ef4e93dded 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -3463,7 +3463,6 @@ "ui/pattern/issue-106552.rs", "ui/pattern/issue-106862.rs", "ui/pattern/issue-110508.rs", -"ui/pattern/issue-114896.rs", "ui/pattern/issue-115599.rs", "ui/pattern/issue-11577.rs", "ui/pattern/issue-117626.rs", diff --git a/tests/ui/asm/fail-const-eval-issue-121099.rs b/tests/ui/asm/fail-const-eval-issue-121099.rs new file mode 100644 index 0000000000000..bed6fc9b39f9d --- /dev/null +++ b/tests/ui/asm/fail-const-eval-issue-121099.rs @@ -0,0 +1,11 @@ +//@ build-fail +//@ needs-asm-support +#![feature(asm_const)] + +use std::arch::global_asm; + +fn main() {} + +global_asm!("/* {} */", const 1 << 500); //~ ERROR evaluation of constant value failed [E0080] + +global_asm!("/* {} */", const 1 / 0); //~ ERROR evaluation of constant value failed [E0080] diff --git a/tests/ui/asm/fail-const-eval-issue-121099.stderr b/tests/ui/asm/fail-const-eval-issue-121099.stderr new file mode 100644 index 0000000000000..51d283218d227 --- /dev/null +++ b/tests/ui/asm/fail-const-eval-issue-121099.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/fail-const-eval-issue-121099.rs:9:31 + | +LL | global_asm!("/* {} */", const 1 << 500); + | ^^^^^^^^ attempt to shift left by `500_i32`, which would overflow + +error[E0080]: evaluation of constant value failed + --> $DIR/fail-const-eval-issue-121099.rs:11:31 + | +LL | global_asm!("/* {} */", const 1 / 0); + | ^^^^^ attempt to divide `1_i32` by zero + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/cast/unsized-union-ice.rs b/tests/ui/cast/unsized-union-ice.rs new file mode 100644 index 0000000000000..11aefe57f1dfb --- /dev/null +++ b/tests/ui/cast/unsized-union-ice.rs @@ -0,0 +1,14 @@ +// Regression test for https://github.com/rust-lang/rust/issues/122581 +// This used to ICE, because the union was unsized and the pointer casting code +// assumed that non-struct ADTs must be sized. + +union Union { + val: std::mem::ManuallyDrop<[u8]>, + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time +} + +fn cast(ptr: *const ()) -> *const Union { + ptr as _ +} + +fn main() {} diff --git a/tests/ui/cast/unsized-union-ice.stderr b/tests/ui/cast/unsized-union-ice.stderr new file mode 100644 index 0000000000000..05f8645782979 --- /dev/null +++ b/tests/ui/cast/unsized-union-ice.stderr @@ -0,0 +1,23 @@ +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/unsized-union-ice.rs:6:10 + | +LL | val: std::mem::ManuallyDrop<[u8]>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `ManuallyDrop<[u8]>`, the trait `Sized` is not implemented for `[u8]`, which is required by `ManuallyDrop<[u8]>: Sized` +note: required because it appears within the type `ManuallyDrop<[u8]>` + --> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL + = note: no field of a union may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | val: &std::mem::ManuallyDrop<[u8]>, + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | val: Box>, + | ++++ + + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs b/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs new file mode 100644 index 0000000000000..09411eb121ceb --- /dev/null +++ b/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs @@ -0,0 +1,3 @@ +fn main() { + println!("it works"); +} diff --git a/tests/ui/compiletest-self-test/test-aux-bin.rs b/tests/ui/compiletest-self-test/test-aux-bin.rs new file mode 100644 index 0000000000000..9e01e3ffabff1 --- /dev/null +++ b/tests/ui/compiletest-self-test/test-aux-bin.rs @@ -0,0 +1,9 @@ +//@ ignore-cross-compile because we run the compiled code +//@ aux-bin: print-it-works.rs +//@ run-pass + +fn main() { + let stdout = + std::process::Command::new("auxiliary/bin/print-it-works").output().unwrap().stdout; + assert_eq!(stdout, b"it works\n"); +} diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed b/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed new file mode 100644 index 0000000000000..bd4db9480674c --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed @@ -0,0 +1,10 @@ +// Checks that there is a suggestion for simple tuple index access expression (used where an +// identifier is expected in a format arg) to use positional arg instead. +// Issue: . +//@ run-rustfix + +fn main() { + let x = (1,); + println!("{0}", x.0); + //~^ ERROR invalid format string +} diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.rs b/tests/ui/fmt/format-args-non-identifier-diagnostics.rs new file mode 100644 index 0000000000000..aab705341f71d --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.rs @@ -0,0 +1,10 @@ +// Checks that there is a suggestion for simple tuple index access expression (used where an +// identifier is expected in a format arg) to use positional arg instead. +// Issue: . +//@ run-rustfix + +fn main() { + let x = (1,); + println!("{x.0}"); + //~^ ERROR invalid format string +} diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr new file mode 100644 index 0000000000000..08abba2854ecc --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr @@ -0,0 +1,13 @@ +error: invalid format string: tuple index access isn't supported + --> $DIR/format-args-non-identifier-diagnostics.rs:8:16 + | +LL | println!("{x.0}"); + | ^^^ not supported in format string + | +help: consider using a positional formatting argument instead + | +LL | println!("{0}", x.0); + | ~ +++++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed index 6fe6ba2792fe6..2070bbcef5269 100644 --- a/tests/ui/lint/lint-qualification.fixed +++ b/tests/ui/lint/lint-qualification.fixed @@ -16,7 +16,6 @@ fn main() { let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 let _ = String::new(); //~ ERROR: unnecessary qualification - let _ = std::env::current_dir(); //~ ERROR: unnecessary qualification let _: Vec = Vec::::new(); //~^ ERROR: unnecessary qualification @@ -27,7 +26,7 @@ fn main() { let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 - let _ = ::default(); // issue #121999 + let _ = ::default(); // issue #121999 (modified) //~^ ERROR: unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { diff --git a/tests/ui/lint/lint-qualification.rs b/tests/ui/lint/lint-qualification.rs index 19d339b006c9a..41b7e17c6ed45 100644 --- a/tests/ui/lint/lint-qualification.rs +++ b/tests/ui/lint/lint-qualification.rs @@ -16,7 +16,6 @@ fn main() { let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 let _ = std::string::String::new(); //~ ERROR: unnecessary qualification - let _ = ::std::env::current_dir(); //~ ERROR: unnecessary qualification let _: std::vec::Vec = std::vec::Vec::::new(); //~^ ERROR: unnecessary qualification @@ -27,7 +26,7 @@ fn main() { let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 - let _ = ::default(); // issue #121999 + let _ = ::default(); // issue #121999 (modified) //~^ ERROR: unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { diff --git a/tests/ui/lint/lint-qualification.stderr b/tests/ui/lint/lint-qualification.stderr index 9e5c9b2df13f1..cefa54a12ae10 100644 --- a/tests/ui/lint/lint-qualification.stderr +++ b/tests/ui/lint/lint-qualification.stderr @@ -40,19 +40,7 @@ LL + let _ = String::new(); | error: unnecessary qualification - --> $DIR/lint-qualification.rs:19:13 - | -LL | let _ = ::std::env::current_dir(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -help: remove the unnecessary path segments - | -LL - let _ = ::std::env::current_dir(); -LL + let _ = std::env::current_dir(); - | - -error: unnecessary qualification - --> $DIR/lint-qualification.rs:21:12 + --> $DIR/lint-qualification.rs:20:12 | LL | let _: std::vec::Vec = std::vec::Vec::::new(); | ^^^^^^^^^^^^^^^^^^^^^ @@ -64,7 +52,7 @@ LL + let _: Vec = std::vec::Vec::::new(); | error: unnecessary qualification - --> $DIR/lint-qualification.rs:21:36 + --> $DIR/lint-qualification.rs:20:36 | LL | let _: std::vec::Vec = std::vec::Vec::::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -76,7 +64,7 @@ LL + let _: std::vec::Vec = Vec::::new(); | error: unused import: `std::fmt` - --> $DIR/lint-qualification.rs:25:9 + --> $DIR/lint-qualification.rs:24:9 | LL | use std::fmt; | ^^^^^^^^ @@ -88,16 +76,16 @@ LL | #![deny(unused_imports)] | ^^^^^^^^^^^^^^ error: unnecessary qualification - --> $DIR/lint-qualification.rs:30:13 + --> $DIR/lint-qualification.rs:29:13 | -LL | let _ = ::default(); // issue #121999 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | let _ = ::default(); // issue #121999 (modified) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: remove the unnecessary path segments | -LL - let _ = ::default(); // issue #121999 -LL + let _ = ::default(); // issue #121999 +LL - let _ = ::default(); // issue #121999 (modified) +LL + let _ = ::default(); // issue #121999 (modified) | -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors diff --git a/tests/ui/lint/unused-qualifications-global-paths.rs b/tests/ui/lint/unused-qualifications-global-paths.rs new file mode 100644 index 0000000000000..8265c8a169434 --- /dev/null +++ b/tests/ui/lint/unused-qualifications-global-paths.rs @@ -0,0 +1,12 @@ +// Checks that `unused_qualifications` don't fire on explicit global paths. +// Issue: . + +//@ check-pass + +#![deny(unused_qualifications)] + +pub fn bar() -> u64 { + ::std::default::Default::default() +} + +fn main() {} diff --git a/tests/ui/parser/survive-peano-lesson-queue.rs b/tests/ui/parser/survive-peano-lesson-queue.rs new file mode 100644 index 0000000000000..3608728594ed1 --- /dev/null +++ b/tests/ui/parser/survive-peano-lesson-queue.rs @@ -0,0 +1,4907 @@ +//@ build-pass +// ignore-tidy-filelength +// ignore-tidy-linelength +// some very lightly modified generated code from issue rust-lang/rust#122715 +// the main differences are to strip the dependency on bumpalo so it can be tested separately +// the original purpose of this code was to implement a binomial queue, however it is extracted from Gallina +// which means that it uses an incredibly naive Peano representation of the natural numbers. +// this is fairly standard "someone did something very silly and we should try to gracefully handle it" + +#![allow(dead_code)] +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +#![allow(non_snake_case)] +#![allow(unused_variables)] + +use std::marker::PhantomData; + +fn __nat_succ(x: u64) -> u64 { + x.checked_add(1).unwrap() +} + +macro_rules! __nat_elim { + ($zcase:expr, $pred:ident, $scase:expr, $val:expr) => { + { let v = $val; + if v == 0 { $zcase } else { let $pred = v - 1; $scase } } + } +} + +macro_rules! __andb { ($b1:expr, $b2:expr) => { $b1 && $b2 } } +macro_rules! __orb { ($b1:expr, $b2:expr) => { $b1 || $b2 } } + +fn __pos_onebit(x: u64) -> u64 { + x.checked_mul(2).unwrap() + 1 +} + +fn __pos_zerobit(x: u64) -> u64 { + x.checked_mul(2).unwrap() +} + +macro_rules! __pos_elim { + ($p:ident, $onebcase:expr, $p2:ident, $zerobcase:expr, $onecase:expr, $val:expr) => { + { + let n = $val; + if n == 1 { + $onecase + } else if (n & 1) == 0 { + let $p2 = n >> 1; + $zerobcase + } else { + let $p = n >> 1; + $onebcase + } + } + } +} + +fn __Z_frompos(z: u64) -> i64 { + use std::convert::TryFrom; + + i64::try_from(z).unwrap() +} + +fn __Z_fromneg(z : u64) -> i64 { + use std::convert::TryFrom; + + i64::try_from(z).unwrap().checked_neg().unwrap() +} + +macro_rules! __Z_elim { + ($zero_case:expr, $p:ident, $pos_case:expr, $p2:ident, $neg_case:expr, $val:expr) => { + { + let n = $val; + if n == 0 { + $zero_case + } else if n < 0 { + let $p2 = n.unsigned_abs(); + $neg_case + } else { + let $p = n as u64; + $pos_case + } + } + } +} + +fn __N_frompos(z: u64) -> u64 { + z +} + +macro_rules! __N_elim { + ($zero_case:expr, $p:ident, $pos_case:expr, $val:expr) => { + { let $p = $val; if $p == 0 { $zero_case } else { $pos_case } } + } +} + +type __pair = (A, B); + +macro_rules! __pair_elim { + ($fst:ident, $snd:ident, $body:expr, $p:expr) => { + { let ($fst, $snd) = $p; $body } + } +} + +fn __mk_pair(a: A, b: B) -> __pair { (a, b) } + +fn hint_app(f: &dyn Fn(TArg) -> TRet) -> &dyn Fn(TArg) -> TRet { + f +} + +#[derive(Debug, Clone)] +pub enum Coq_Init_Datatypes_list<'a, A> { + nil(PhantomData<&'a A>), + cons(PhantomData<&'a A>, A, &'a Coq_Init_Datatypes_list<'a, A>) +} + +type CertiCoq_Benchmarks_lib_Binom_key<'a> = u64; + +#[derive(Debug, Clone)] +pub enum CertiCoq_Benchmarks_lib_Binom_tree<'a> { + Node(PhantomData<&'a ()>, CertiCoq_Benchmarks_lib_Binom_key<'a>, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>), + Leaf(PhantomData<&'a ()>) +} + +type CertiCoq_Benchmarks_lib_Binom_priqueue<'a> = &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>; + +struct Program { +} + +impl<'a> Program { +fn new() -> Self { + Program { + } +} + +fn alloc(&'a self, t: T) -> &'a T { + let _alloc = Box::new(t); + Box::leak(_alloc) +} + +fn closure(&'a self, f: impl Fn(TArg) -> TRet + 'a) -> &'a dyn Fn(TArg) -> TRet { + let _alloc = Box::new(f); + Box::leak(_alloc) +} + +fn Coq_Init_Nat_leb(&'a self, n: u64, m: u64) -> bool { + __nat_elim!( + { + true + }, + n2, { + __nat_elim!( + { + false + }, + m2, { + self.Coq_Init_Nat_leb( + n2, + m2) + }, + m) + }, + n) +} +fn Coq_Init_Nat_leb__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(u64) -> bool { + self.closure(move |n| { + self.closure(move |m| { + self.Coq_Init_Nat_leb( + n, + m) + }) + }) +} + +fn Coq_Init_Nat_ltb(&'a self, n: u64, m: u64) -> bool { + self.Coq_Init_Nat_leb( + __nat_succ( + n), + m) +} +fn Coq_Init_Nat_ltb__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(u64) -> bool { + self.closure(move |n| { + self.closure(move |m| { + self.Coq_Init_Nat_ltb( + n, + m) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_smash(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, u: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a CertiCoq_Benchmarks_lib_Binom_tree<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match u { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, y, u1, t2) => { + match t2 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t3, t4) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match self.Coq_Init_Nat_ltb( + y, + x) { + true => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + y, + u1, + t1)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))) + }, + false => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + y, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + u1)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_smash__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a CertiCoq_Benchmarks_lib_Binom_tree<'a> { + self.closure(move |t| { + self.closure(move |u| { + self.CertiCoq_Benchmarks_lib_Binom_smash( + t, + u) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_carry(&'a self, q: &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t0, t1) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + t, + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + } + }, + &Coq_Init_Datatypes_list::cons(_, u, q2) => { + match u { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t0, t1) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t2, t3) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_carry( + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + t, + u)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + u, + q2)) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + t, + q2)) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_carry__curried(&'a self) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>> { + self.closure(move |q| { + self.closure(move |t| { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + t) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_insert(&'a self, x: CertiCoq_Benchmarks_lib_Binom_key<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) +} +fn CertiCoq_Benchmarks_lib_Binom_insert__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |x| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_insert( + x, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_insert_list(&'a self, l: &'a Coq_Init_Datatypes_list<'a, u64>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match l { + &Coq_Init_Datatypes_list::nil(_) => { + q + }, + &Coq_Init_Datatypes_list::cons(_, x, l2) => { + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + l2, + self.CertiCoq_Benchmarks_lib_Binom_insert( + x, + q)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_insert_list__curried(&'a self) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, u64>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |l| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + l, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_make_list(&'a self, n: u64, l: &'a Coq_Init_Datatypes_list<'a, u64>) -> &'a Coq_Init_Datatypes_list<'a, u64> { + __nat_elim!( + { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + 0, + l)) + }, + n0, { + __nat_elim!( + { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + __nat_succ( + 0), + l)) + }, + n2, { + self.CertiCoq_Benchmarks_lib_Binom_make_list( + n2, + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + __nat_succ( + __nat_succ( + n2)), + l))) + }, + n0) + }, + n) +} +fn CertiCoq_Benchmarks_lib_Binom_make_list__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, u64>) -> &'a Coq_Init_Datatypes_list<'a, u64> { + self.closure(move |n| { + self.closure(move |l| { + self.CertiCoq_Benchmarks_lib_Binom_make_list( + n, + l) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_empty(&'a self) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) +} + +fn CertiCoq_Benchmarks_lib_Binom_join(&'a self, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, c: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match p { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + c) + }, + &Coq_Init_Datatypes_list::cons(_, p1, p2) => { + match p1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t, t0) => { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + p, + c) + }, + &Coq_Init_Datatypes_list::cons(_, q1, q2) => { + match q1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + c, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + p1, + q1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match c { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + c, + p1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + p1, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + p, + c) + }, + &Coq_Init_Datatypes_list::cons(_, q1, q2) => { + match q1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t, t0) => { + match c { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + c, + q1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + q1, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + c, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + } + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_join__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |p| { + self.closure(move |q| { + self.closure(move |c| { + self.CertiCoq_Benchmarks_lib_Binom_join( + p, + q, + c) + }) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_merge(&'a self, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.CertiCoq_Benchmarks_lib_Binom_join( + p, + q, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))) +} +fn CertiCoq_Benchmarks_lib_Binom_merge__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |p| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_merge( + p, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_find_max_(&'a self, current: CertiCoq_Benchmarks_lib_Binom_key<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + current + }, + &Coq_Init_Datatypes_list::cons(_, t, q2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t0, t1) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + match self.Coq_Init_Nat_ltb( + current, + x) { + true => { + x + }, + false => { + current + }, + }, + q2) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + current, + q2) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_find_max___curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + self.closure(move |current| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + current, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_find_max(&'a self, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + None + }, + &Coq_Init_Datatypes_list::cons(_, t, q2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t0, t1) => { + Some( + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + x, + q2)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max( + q2) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_find_max__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option> { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_find_max( + q) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_unzip(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, cont: &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t2) => { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t2, + self.closure(move |q| { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))), + hint_app(cont)(q))) + })) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + hint_app(cont)(self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_unzip__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a dyn Fn(&'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |t| { + self.closure(move |cont| { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t, + cont) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_heap_delete_max(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t1, + self.closure(move |u| { + u + })) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_heap_delete_max__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |t| { + self.CertiCoq_Benchmarks_lib_Binom_heap_delete_max( + t) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_delete_max_aux(&'a self, m: CertiCoq_Benchmarks_lib_Binom_key<'a>, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> __pair, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>> { + match p { + &Coq_Init_Datatypes_list::nil(_) => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + &Coq_Init_Datatypes_list::cons(_, t, p2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match self.Coq_Init_Nat_ltb( + x, + m) { + true => { + __pair_elim!( + k, j, { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))), + k)), + j) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p2)) + }, + false => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + p2)), + self.CertiCoq_Benchmarks_lib_Binom_heap_delete_max( + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))))) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + __pair_elim!( + k, j, { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + k)), + j) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p2)) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_delete_max_aux__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> __pair, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>> { + self.closure(move |m| { + self.closure(move |p| { + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_delete_max(&'a self, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<__pair, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>>> { + match self.CertiCoq_Benchmarks_lib_Binom_find_max( + q) { + Some(m) => { + __pair_elim!( + q2, p, { + Some( + __mk_pair( + m, + self.CertiCoq_Benchmarks_lib_Binom_join( + q2, + p, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + q)) + }, + None => { + None + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_delete_max__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<__pair, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>>> { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_delete_max( + q) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_main(&'a self) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + let a = + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + self.CertiCoq_Benchmarks_lib_Binom_make_list( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))), + self.CertiCoq_Benchmarks_lib_Binom_empty()); + let b = + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + self.CertiCoq_Benchmarks_lib_Binom_make_list( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + 0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))), + self.CertiCoq_Benchmarks_lib_Binom_empty()); + let c = + self.CertiCoq_Benchmarks_lib_Binom_merge( + a, + b); + match self.CertiCoq_Benchmarks_lib_Binom_delete_max( + c) { + Some(p) => { + __pair_elim!( + p0, k, { + p0 + }, + p) + }, + None => { + 0 + }, + } +} + +fn CertiCoq_Benchmarks_tests_binom(&'a self) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + self.CertiCoq_Benchmarks_lib_Binom_main() +} +} +fn main() { + println!("{:?}", Program::new().CertiCoq_Benchmarks_tests_binom()) +} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed b/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed new file mode 100644 index 0000000000000..086a119eb7764 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed @@ -0,0 +1,10 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn main() { + fn x(a: &char) { + let &(mut b) = a; + b.make_ascii_uppercase(); +//~^ cannot borrow `b` as mutable, as it is not declared as mutable + } +} diff --git a/tests/ui/pattern/issue-114896.rs b/tests/ui/pattern/patkind-ref-binding-issue-114896.rs similarity index 81% rename from tests/ui/pattern/issue-114896.rs rename to tests/ui/pattern/patkind-ref-binding-issue-114896.rs index cde37f658d6ae..b4d6b72c01f2a 100644 --- a/tests/ui/pattern/issue-114896.rs +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.rs @@ -1,3 +1,6 @@ +//@ run-rustfix +#![allow(dead_code)] + fn main() { fn x(a: &char) { let &b = a; diff --git a/tests/ui/pattern/issue-114896.stderr b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr similarity index 87% rename from tests/ui/pattern/issue-114896.stderr rename to tests/ui/pattern/patkind-ref-binding-issue-114896.stderr index 285c9109e1b88..68538255eddf0 100644 --- a/tests/ui/pattern/issue-114896.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable - --> $DIR/issue-114896.rs:4:9 + --> $DIR/patkind-ref-binding-issue-114896.rs:7:9 | LL | let &b = a; | -- help: consider changing this to be mutable: `&(mut b)` diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed b/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed new file mode 100644 index 0000000000000..6144f06216986 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn mutate(_y: &mut i32) {} + +fn foo(&(mut x): &i32) { + mutate(&mut x); + //~^ ERROR cannot borrow `x` as mutable +} + +fn main() {} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.rs b/tests/ui/pattern/patkind-ref-binding-issue-122415.rs new file mode 100644 index 0000000000000..b9f6416027a37 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.rs @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn mutate(_y: &mut i32) {} + +fn foo(&x: &i32) { + mutate(&mut x); + //~^ ERROR cannot borrow `x` as mutable +} + +fn main() {} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr new file mode 100644 index 0000000000000..39283133ac7c8 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/patkind-ref-binding-issue-122415.rs:7:12 + | +LL | fn foo(&x: &i32) { + | -- help: consider changing this to be mutable: `&(mut x)` +LL | mutate(&mut x); + | ^^^^^^ cannot borrow as mutable + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0596`.