mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Auto merge of #146125 - GuillaumeGomez:rollup-ld81n7e, r=GuillaumeGomez
Rollup of 14 pull requests Successful merges: - rust-lang/rust#144066 (stabilize c-style varargs for sysv64, win64, efiapi, aapcs) - rust-lang/rust#145783 (add span to struct pattern rest (..)) - rust-lang/rust#146034 (Update target spec metadata of Arm64EC Windows and Trusty targets) - rust-lang/rust#146064 (Add compiler error when trying to use concat metavar expr in repetitions) - rust-lang/rust#146070 (rustdoc-search: skip loading unneeded fnData) - rust-lang/rust#146088 (constify impl Try for ControlFlow) - rust-lang/rust#146089 (fix a constness ordering bug in rustfmt) - rust-lang/rust#146091 (fix rustdoc `render_call_locations` panicking because of default span `DUMMY_SP` pointing at non local-source file) - rust-lang/rust#146094 (Make `Parser::parse_for_head` public for rustfmt usage) - rust-lang/rust#146102 (Remove dead code stemming from an old effects desugaring) - rust-lang/rust#146115 (Add maintainer for VxWorks) - rust-lang/rust#146116 (Adjust issue-118306.rs test after LLVM change) - rust-lang/rust#146117 (Fix search index generation) - rust-lang/rust#146118 (improve process::abort rendering in Miri backtraces) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd};
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_macros::{Decodable, Encodable};
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_span::Symbol;
|
||||
|
||||
use crate::AbiFromStrErr;
|
||||
|
||||
@@ -226,6 +228,13 @@ impl StableOrd for ExternAbi {
|
||||
#[cfg(feature = "nightly")]
|
||||
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
pub enum CVariadicStatus {
|
||||
NotSupported,
|
||||
Stable,
|
||||
Unstable { feature: Symbol },
|
||||
}
|
||||
|
||||
impl ExternAbi {
|
||||
/// An ABI "like Rust"
|
||||
///
|
||||
@@ -238,23 +247,33 @@ pub fn is_rustic_abi(self) -> bool {
|
||||
matches!(self, Rust | RustCall | RustCold)
|
||||
}
|
||||
|
||||
pub fn supports_varargs(self) -> bool {
|
||||
/// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
|
||||
/// of such functions via `extern` blocks; there's a separate check during AST construction
|
||||
/// guarding *definitions* of variadic functions.
|
||||
#[cfg(feature = "nightly")]
|
||||
pub fn supports_c_variadic(self) -> CVariadicStatus {
|
||||
// * C and Cdecl obviously support varargs.
|
||||
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
|
||||
// * EfiApi is based on Win64 or C, so it also supports it.
|
||||
// * System automatically falls back to C when used with variadics, therefore supports it.
|
||||
//
|
||||
// * Stdcall does not, because it would be impossible for the callee to clean
|
||||
// up the arguments. (callee doesn't know how many arguments are there)
|
||||
// * Same for Fastcall, Vectorcall and Thiscall.
|
||||
// * Other calling conventions are related to hardware or the compiler itself.
|
||||
//
|
||||
// All of the supported ones must have a test in `tests/codegen/cffi/c-variadic-ffi.rs`.
|
||||
match self {
|
||||
Self::C { .. }
|
||||
| Self::Cdecl { .. }
|
||||
| Self::Aapcs { .. }
|
||||
| Self::Win64 { .. }
|
||||
| Self::SysV64 { .. }
|
||||
| Self::EfiApi => true,
|
||||
_ => false,
|
||||
| Self::EfiApi => CVariadicStatus::Stable,
|
||||
Self::System { .. } => {
|
||||
CVariadicStatus::Unstable { feature: rustc_span::sym::extern_system_varargs }
|
||||
}
|
||||
_ => CVariadicStatus::NotSupported,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
|
||||
pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
|
||||
pub use canon_abi::{ArmCall, CanonAbi, InterruptKind, X86Call};
|
||||
#[cfg(feature = "nightly")]
|
||||
pub use extern_abi::CVariadicStatus;
|
||||
pub use extern_abi::{ExternAbi, all_names};
|
||||
#[cfg(feature = "nightly")]
|
||||
pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};
|
||||
|
||||
@@ -937,7 +937,7 @@ pub enum PatKind {
|
||||
#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Walkable)]
|
||||
pub enum PatFieldsRest {
|
||||
/// `module::StructName { field, ..}`
|
||||
Rest,
|
||||
Rest(Span),
|
||||
/// `module::StructName { field, syntax error }`
|
||||
Recovered(ErrorGuaranteed),
|
||||
/// `module::StructName { field }`
|
||||
@@ -4051,8 +4051,8 @@ mod size_asserts {
|
||||
static_assert_size!(Local, 96);
|
||||
static_assert_size!(MetaItemLit, 40);
|
||||
static_assert_size!(Param, 40);
|
||||
static_assert_size!(Pat, 72);
|
||||
static_assert_size!(PatKind, 48);
|
||||
static_assert_size!(Pat, 80);
|
||||
static_assert_size!(PatKind, 56);
|
||||
static_assert_size!(Path, 24);
|
||||
static_assert_size!(PathSegment, 24);
|
||||
static_assert_size!(Stmt, 32);
|
||||
|
||||
@@ -1434,10 +1434,10 @@ fn destructure_assign_mut(
|
||||
self.dcx().emit_err(FunctionalRecordUpdateDestructuringAssignment {
|
||||
span: e.span,
|
||||
});
|
||||
true
|
||||
Some(self.lower_span(e.span))
|
||||
}
|
||||
StructRest::Rest(_) => true,
|
||||
StructRest::None => false,
|
||||
StructRest::Rest(span) => Some(self.lower_span(*span)),
|
||||
StructRest::None => None,
|
||||
};
|
||||
let struct_pat = hir::PatKind::Struct(qpath, field_pats, fields_omitted);
|
||||
return self.pat_without_dbm(lhs.span, struct_pat);
|
||||
|
||||
@@ -2028,7 +2028,7 @@ fn lower_generic_param_kind(
|
||||
|
||||
(
|
||||
hir::ParamName::Plain(self.lower_ident(param.ident)),
|
||||
hir::GenericParamKind::Const { ty, default, synthetic: false },
|
||||
hir::GenericParamKind::Const { ty, default },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -2508,7 +2508,7 @@ fn pat_lang_item_variant(
|
||||
fields: &'hir [hir::PatField<'hir>],
|
||||
) -> &'hir hir::Pat<'hir> {
|
||||
let qpath = hir::QPath::LangItem(lang_item, self.lower_span(span));
|
||||
self.pat(span, hir::PatKind::Struct(qpath, fields, false))
|
||||
self.pat(span, hir::PatKind::Struct(qpath, fields, None))
|
||||
}
|
||||
|
||||
fn pat_ident(&mut self, span: Span, ident: Ident) -> (&'hir hir::Pat<'hir>, HirId) {
|
||||
|
||||
@@ -106,10 +106,11 @@ fn lower_pat_mut(&mut self, mut pattern: &Pat) -> hir::Pat<'hir> {
|
||||
break hir::PatKind::Struct(
|
||||
qpath,
|
||||
fs,
|
||||
matches!(
|
||||
etc,
|
||||
ast::PatFieldsRest::Rest | ast::PatFieldsRest::Recovered(_)
|
||||
),
|
||||
match etc {
|
||||
ast::PatFieldsRest::Rest(sp) => Some(self.lower_span(*sp)),
|
||||
ast::PatFieldsRest::Recovered(_) => Some(Span::default()),
|
||||
_ => None,
|
||||
},
|
||||
);
|
||||
}
|
||||
PatKind::Tuple(pats) => {
|
||||
|
||||
@@ -57,7 +57,7 @@ ast_passes_auto_super_lifetime = auto traits cannot have super traits or lifetim
|
||||
.label = {ast_passes_auto_super_lifetime}
|
||||
.suggestion = remove the super traits or lifetime bounds
|
||||
|
||||
ast_passes_bad_c_variadic = only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
|
||||
ast_passes_bad_c_variadic = defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
|
||||
ast_passes_body_in_extern = incorrect `{$kind}` inside `extern` block
|
||||
.cannot_have = cannot have a body
|
||||
|
||||
@@ -1769,7 +1769,7 @@ fn print_pat(&mut self, pat: &ast::Pat) {
|
||||
},
|
||||
|f| f.pat.span,
|
||||
);
|
||||
if let ast::PatFieldsRest::Rest | ast::PatFieldsRest::Recovered(_) = etc {
|
||||
if let ast::PatFieldsRest::Rest(_) | ast::PatFieldsRest::Recovered(_) = etc {
|
||||
if !fields.is_empty() {
|
||||
self.word_space(",");
|
||||
}
|
||||
|
||||
@@ -556,7 +556,12 @@ fn metavar_expr_concat<'tx>(
|
||||
};
|
||||
match &named_matches[*curr_idx] {
|
||||
// FIXME(c410-f3r) Nested repetitions are unimplemented
|
||||
MatchedSeq(_) => unimplemented!(),
|
||||
MatchedSeq(_) => {
|
||||
return Err(dcx.struct_span_err(
|
||||
ident.span,
|
||||
"nested repetitions with `${concat(...)}` metavariable expressions are not yet supported",
|
||||
));
|
||||
}
|
||||
MatchedSingle(pnr) => extract_symbol_from_pnr(dcx, pnr, ident.span)?,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +203,9 @@ macro_rules! declare_features {
|
||||
(accepted, expr_fragment_specifier_2024, "1.83.0", Some(123742)),
|
||||
/// Allows arbitrary expressions in key-value attributes at parse time.
|
||||
(accepted, extended_key_value_attributes, "1.54.0", Some(78835)),
|
||||
/// Allows using `aapcs`, `efiapi`, `sysv64` and `win64` as calling conventions
|
||||
/// for functions with varargs.
|
||||
(accepted, extended_varargs_abi_support, "CURRENT_RUSTC_VERSION", Some(100189)),
|
||||
/// Allows resolving absolute paths as paths from other crates.
|
||||
(accepted, extern_absolute_paths, "1.30.0", Some(44660)),
|
||||
/// Allows `extern crate foo as bar;`. This puts `bar` into extern prelude.
|
||||
|
||||
@@ -492,9 +492,6 @@ pub fn internal(&self, feature: Symbol) -> bool {
|
||||
(incomplete, explicit_tail_calls, "1.72.0", Some(112788)),
|
||||
/// Allows using `#[export_stable]` which indicates that an item is exportable.
|
||||
(incomplete, export_stable, "1.88.0", Some(139939)),
|
||||
/// Allows using `aapcs`, `efiapi`, `sysv64` and `win64` as calling conventions
|
||||
/// for functions with varargs.
|
||||
(unstable, extended_varargs_abi_support, "1.65.0", Some(100189)),
|
||||
/// Allows using `system` as a calling convention with varargs.
|
||||
(unstable, extern_system_varargs, "1.86.0", Some(136946)),
|
||||
/// Allows defining `extern type`s.
|
||||
|
||||
@@ -784,7 +784,6 @@ pub enum GenericParamKind<'hir> {
|
||||
ty: &'hir Ty<'hir>,
|
||||
/// Optional default value for the const generic param
|
||||
default: Option<&'hir ConstArg<'hir>>,
|
||||
synthetic: bool,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1884,8 +1883,8 @@ pub enum PatKind<'hir> {
|
||||
Binding(BindingMode, HirId, Ident, Option<&'hir Pat<'hir>>),
|
||||
|
||||
/// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`).
|
||||
/// The `bool` is `true` in the presence of a `..`.
|
||||
Struct(QPath<'hir>, &'hir [PatField<'hir>], bool),
|
||||
/// The `Option` contains the span of a possible `..`.
|
||||
Struct(QPath<'hir>, &'hir [PatField<'hir>], Option<Span>),
|
||||
|
||||
/// A tuple struct/variant pattern `Variant(x, y, .., z)`.
|
||||
/// If the `..` pattern fragment is present, then `DotDotPos` denotes its position.
|
||||
@@ -4979,8 +4978,8 @@ mod size_asserts {
|
||||
static_assert_size!(ItemKind<'_>, 64);
|
||||
static_assert_size!(LetStmt<'_>, 72);
|
||||
static_assert_size!(Param<'_>, 32);
|
||||
static_assert_size!(Pat<'_>, 72);
|
||||
static_assert_size!(PatKind<'_>, 48);
|
||||
static_assert_size!(Pat<'_>, 80);
|
||||
static_assert_size!(PatKind<'_>, 56);
|
||||
static_assert_size!(Path<'_>, 40);
|
||||
static_assert_size!(PathSegment<'_>, 48);
|
||||
static_assert_size!(QPath<'_>, 24);
|
||||
|
||||
@@ -1085,7 +1085,7 @@ pub fn walk_generic_param<'v, V: Visitor<'v>>(
|
||||
GenericParamKind::Type { ref default, .. } => {
|
||||
visit_opt!(visitor, visit_ty_unambig, default)
|
||||
}
|
||||
GenericParamKind::Const { ref ty, ref default, synthetic: _ } => {
|
||||
GenericParamKind::Const { ref ty, ref default } => {
|
||||
try_visit!(visitor.visit_ty_unambig(ty));
|
||||
if let Some(default) = default {
|
||||
try_visit!(visitor.visit_const_param_default(*hir_id, default));
|
||||
|
||||
@@ -978,7 +978,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
|
||||
tcx.ensure_ok().fn_sig(def_id);
|
||||
let item = tcx.hir_foreign_item(item);
|
||||
let hir::ForeignItemKind::Fn(sig, ..) = item.kind else { bug!() };
|
||||
require_c_abi_if_c_variadic(tcx, sig.decl, abi, item.span);
|
||||
check_c_variadic_abi(tcx, sig.decl, abi, item.span);
|
||||
}
|
||||
DefKind::Static { .. } => {
|
||||
tcx.ensure_ok().codegen_fn_attrs(def_id);
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
use self::compare_impl_item::collect_return_position_impl_trait_in_trait_tys;
|
||||
use self::region::region_scope_tree;
|
||||
use crate::{errors, require_c_abi_if_c_variadic};
|
||||
use crate::{check_c_variadic_abi, errors};
|
||||
|
||||
/// Adds query implementations to the [Providers] vtable, see [`rustc_middle::query`]
|
||||
pub(super) fn provide(providers: &mut Providers) {
|
||||
|
||||
@@ -305,7 +305,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
|
||||
|
||||
ty::GenericParamDefKind::Type { has_default: default.is_some(), synthetic }
|
||||
}
|
||||
GenericParamKind::Const { ty: _, default, synthetic } => {
|
||||
GenericParamKind::Const { ty: _, default } => {
|
||||
if default.is_some() {
|
||||
match param_default_policy.expect("no policy for generic param default") {
|
||||
ParamDefaultPolicy::Allowed => {}
|
||||
@@ -316,7 +316,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
|
||||
}
|
||||
}
|
||||
|
||||
ty::GenericParamDefKind::Const { has_default: default.is_some(), synthetic }
|
||||
ty::GenericParamDefKind::Const { has_default: default.is_some() }
|
||||
}
|
||||
};
|
||||
Some(ty::GenericParamDef {
|
||||
@@ -523,7 +523,7 @@ impl<'v> Visitor<'v> for AnonConstInParamTyDetector {
|
||||
type Result = ControlFlow<()>;
|
||||
|
||||
fn visit_generic_param(&mut self, p: &'v hir::GenericParam<'v>) -> Self::Result {
|
||||
if let GenericParamKind::Const { ty, default: _, synthetic: _ } = p.kind {
|
||||
if let GenericParamKind::Const { ty, default: _ } = p.kind {
|
||||
let prev = self.in_param_ty;
|
||||
self.in_param_ty = true;
|
||||
let res = self.visit_ty_unambig(ty);
|
||||
|
||||
@@ -419,14 +419,7 @@ pub(crate) fn check_generic_arg_count(
|
||||
.filter(|param| matches!(param.kind, ty::GenericParamDefKind::Type { synthetic: true, .. }))
|
||||
.count();
|
||||
let named_type_param_count = param_counts.types - has_self as usize - synth_type_param_count;
|
||||
let synth_const_param_count = gen_params
|
||||
.own_params
|
||||
.iter()
|
||||
.filter(|param| {
|
||||
matches!(param.kind, ty::GenericParamDefKind::Const { synthetic: true, .. })
|
||||
})
|
||||
.count();
|
||||
let named_const_param_count = param_counts.consts - synth_const_param_count;
|
||||
let named_const_param_count = param_counts.consts;
|
||||
let infer_lifetimes =
|
||||
(gen_pos != GenericArgPosition::Type || seg.infer_args) && !gen_args.has_lifetime_params();
|
||||
|
||||
|
||||
@@ -52,11 +52,11 @@
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::check::check_abi;
|
||||
use crate::check_c_variadic_abi;
|
||||
use crate::errors::{AmbiguousLifetimeBound, BadReturnTypeNotation};
|
||||
use crate::hir_ty_lowering::errors::{GenericsArgsErrExtend, prohibit_assoc_item_constraint};
|
||||
use crate::hir_ty_lowering::generics::{check_generic_arg_count, lower_generic_args};
|
||||
use crate::middle::resolve_bound_vars as rbv;
|
||||
use crate::require_c_abi_if_c_variadic;
|
||||
|
||||
/// A path segment that is semantically allowed to have generic arguments.
|
||||
#[derive(Debug)]
|
||||
@@ -2412,7 +2412,7 @@ pub fn lower_ty(&self, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
|
||||
Ty::new_tup_from_iter(tcx, fields.iter().map(|t| self.lower_ty(t)))
|
||||
}
|
||||
hir::TyKind::FnPtr(bf) => {
|
||||
require_c_abi_if_c_variadic(tcx, bf.decl, bf.abi, hir_ty.span);
|
||||
check_c_variadic_abi(tcx, bf.decl, bf.abi, hir_ty.span);
|
||||
|
||||
Ty::new_fn_ptr(
|
||||
tcx,
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
mod variance;
|
||||
|
||||
pub use errors::NoVariantNamed;
|
||||
use rustc_abi::ExternAbi;
|
||||
use rustc_abi::{CVariadicStatus, ExternAbi};
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::lints::DelayedLint;
|
||||
use rustc_hir::{self as hir};
|
||||
@@ -99,7 +99,6 @@
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::{self, Const, Ty, TyCtxt};
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{ErrorGuaranteed, Span};
|
||||
use rustc_trait_selection::traits;
|
||||
|
||||
@@ -108,46 +107,34 @@
|
||||
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
fn require_c_abi_if_c_variadic(
|
||||
tcx: TyCtxt<'_>,
|
||||
decl: &hir::FnDecl<'_>,
|
||||
abi: ExternAbi,
|
||||
span: Span,
|
||||
) {
|
||||
// ABIs which can stably use varargs
|
||||
if !decl.c_variadic || matches!(abi, ExternAbi::C { .. } | ExternAbi::Cdecl { .. }) {
|
||||
fn check_c_variadic_abi(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: ExternAbi, span: Span) {
|
||||
if !decl.c_variadic {
|
||||
// Not even a variadic function.
|
||||
return;
|
||||
}
|
||||
|
||||
// ABIs with feature-gated stability
|
||||
let extended_abi_support = tcx.features().extended_varargs_abi_support();
|
||||
let extern_system_varargs = tcx.features().extern_system_varargs();
|
||||
|
||||
// If the feature gate has been enabled, we can stop here
|
||||
if extern_system_varargs && let ExternAbi::System { .. } = abi {
|
||||
return;
|
||||
};
|
||||
if extended_abi_support && abi.supports_varargs() {
|
||||
return;
|
||||
};
|
||||
|
||||
// Looks like we need to pick an error to emit.
|
||||
// Is there any feature which we could have enabled to make this work?
|
||||
let unstable_explain =
|
||||
format!("C-variadic functions with the {abi} calling convention are unstable");
|
||||
match abi {
|
||||
ExternAbi::System { .. } => {
|
||||
feature_err(&tcx.sess, sym::extern_system_varargs, span, unstable_explain)
|
||||
match abi.supports_c_variadic() {
|
||||
CVariadicStatus::Stable => {}
|
||||
CVariadicStatus::NotSupported => {
|
||||
tcx.dcx()
|
||||
.create_err(errors::VariadicFunctionCompatibleConvention {
|
||||
span,
|
||||
convention: &format!("{abi}"),
|
||||
})
|
||||
.emit();
|
||||
}
|
||||
abi if abi.supports_varargs() => {
|
||||
feature_err(&tcx.sess, sym::extended_varargs_abi_support, span, unstable_explain)
|
||||
CVariadicStatus::Unstable { feature } => {
|
||||
if !tcx.features().enabled(feature) {
|
||||
feature_err(
|
||||
&tcx.sess,
|
||||
feature,
|
||||
span,
|
||||
format!("C-variadic functions with the {abi} calling convention are unstable"),
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
_ => tcx.dcx().create_err(errors::VariadicFunctionCompatibleConvention {
|
||||
span,
|
||||
convention: &format!("{abi}"),
|
||||
}),
|
||||
}
|
||||
.emit();
|
||||
}
|
||||
|
||||
/// Adds query implementations to the [Providers] vtable, see [`rustc_middle::query`]
|
||||
|
||||
@@ -1958,12 +1958,12 @@ fn print_pat(&mut self, pat: &hir::Pat<'_>) {
|
||||
self.print_qpath(qpath, true);
|
||||
self.nbsp();
|
||||
self.word("{");
|
||||
let empty = fields.is_empty() && !etc;
|
||||
let empty = fields.is_empty() && etc.is_none();
|
||||
if !empty {
|
||||
self.space();
|
||||
}
|
||||
self.commasep_cmnt(Consistent, fields, |s, f| s.print_patfield(f), |f| f.pat.span);
|
||||
if etc {
|
||||
if etc.is_some() {
|
||||
if !fields.is_empty() {
|
||||
self.word_space(",");
|
||||
}
|
||||
@@ -2379,7 +2379,7 @@ fn print_generic_param(&mut self, param: &GenericParam<'_>) {
|
||||
self.print_type(default);
|
||||
}
|
||||
}
|
||||
GenericParamKind::Const { ty, ref default, synthetic: _ } => {
|
||||
GenericParamKind::Const { ty, ref default } => {
|
||||
self.word_space(":");
|
||||
self.print_type(ty);
|
||||
if let Some(default) = default {
|
||||
|
||||
@@ -605,7 +605,15 @@ fn check_pat_inner(
|
||||
},
|
||||
PatKind::Struct(_, fields, has_rest_pat) => match opt_path_res.unwrap() {
|
||||
Ok(ResolvedPat { ty, kind: ResolvedPatKind::Struct { variant } }) => self
|
||||
.check_pat_struct(pat, fields, has_rest_pat, ty, variant, expected, pat_info),
|
||||
.check_pat_struct(
|
||||
pat,
|
||||
fields,
|
||||
has_rest_pat.is_some(),
|
||||
ty,
|
||||
variant,
|
||||
expected,
|
||||
pat_info,
|
||||
),
|
||||
Err(guar) => {
|
||||
let ty_err = Ty::new_error(self.tcx, guar);
|
||||
for field in fields {
|
||||
@@ -2428,7 +2436,7 @@ fn error_unmentioned_fields(
|
||||
let len = unmentioned_fields.len();
|
||||
let (prefix, postfix, sp) = match fields {
|
||||
[] => match &pat.kind {
|
||||
PatKind::Struct(path, [], false) => {
|
||||
PatKind::Struct(path, [], None) => {
|
||||
(" { ", " }", path.span().shrink_to_hi().until(pat.span.shrink_to_hi()))
|
||||
}
|
||||
_ => return err,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
pub enum GenericParamDefKind {
|
||||
Lifetime,
|
||||
Type { has_default: bool, synthetic: bool },
|
||||
Const { has_default: bool, synthetic: bool },
|
||||
Const { has_default: bool },
|
||||
}
|
||||
|
||||
impl GenericParamDefKind {
|
||||
|
||||
@@ -2910,7 +2910,8 @@ fn error_on_extra_if(&mut self, cond: &Box<Expr>) -> PResult<'a, ()> {
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
|
||||
// Public to use it for custom `for` expressions in rustfmt forks like https://github.com/tucant/rustfmt
|
||||
pub fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
|
||||
let begin_paren = if self.token == token::OpenParen {
|
||||
// Record whether we are about to parse `for (`.
|
||||
// This is used below for recovery in case of `for ( $stuff ) $block`
|
||||
|
||||
@@ -1516,7 +1516,7 @@ fn parse_pat_fields(&mut self) -> PResult<'a, (ThinVec<PatField>, PatFieldsRest)
|
||||
|| self.check_noexpect(&token::DotDotDot)
|
||||
|| self.check_keyword(exp!(Underscore))
|
||||
{
|
||||
etc = PatFieldsRest::Rest;
|
||||
etc = PatFieldsRest::Rest(self.token.span);
|
||||
let mut etc_sp = self.token.span;
|
||||
if first_etc_and_maybe_comma_span.is_none() {
|
||||
if let Some(comma_tok) =
|
||||
|
||||
@@ -1583,7 +1583,7 @@ fn check_unused_vars_in_pat(
|
||||
});
|
||||
|
||||
let can_remove = match pat.kind {
|
||||
hir::PatKind::Struct(_, fields, true) => {
|
||||
hir::PatKind::Struct(_, fields, Some(_)) => {
|
||||
// if all fields are shorthand, remove the struct field, otherwise, mark with _ as prefix
|
||||
fields.iter().all(|f| f.is_shorthand)
|
||||
}
|
||||
|
||||
@@ -656,13 +656,13 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::GenericParamDefKind {
|
||||
|
||||
fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T {
|
||||
use crate::ty::GenericParamDefKind;
|
||||
match self {
|
||||
match *self {
|
||||
ty::GenericParamDefKind::Lifetime => GenericParamDefKind::Lifetime,
|
||||
ty::GenericParamDefKind::Type { has_default, synthetic } => {
|
||||
GenericParamDefKind::Type { has_default: *has_default, synthetic: *synthetic }
|
||||
GenericParamDefKind::Type { has_default, synthetic }
|
||||
}
|
||||
ty::GenericParamDefKind::Const { has_default, synthetic: _ } => {
|
||||
GenericParamDefKind::Const { has_default: *has_default }
|
||||
ty::GenericParamDefKind::Const { has_default } => {
|
||||
GenericParamDefKind::Const { has_default }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3922,7 +3922,7 @@ fn resolve_pattern_inner(
|
||||
|
||||
fn record_patterns_with_skipped_bindings(&mut self, pat: &Pat, rest: &ast::PatFieldsRest) {
|
||||
match rest {
|
||||
ast::PatFieldsRest::Rest | ast::PatFieldsRest::Recovered(_) => {
|
||||
ast::PatFieldsRest::Rest(_) | ast::PatFieldsRest::Recovered(_) => {
|
||||
// Record that the pattern doesn't introduce all the bindings it could.
|
||||
if let Some(partial_res) = self.r.partial_res_map.get(&pat.id)
|
||||
&& let Some(res) = partial_res.full_res()
|
||||
|
||||
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
|
||||
description: Some("ARM64 Trusty".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
|
||||
|
||||
@@ -20,9 +20,9 @@ pub(crate) fn target() -> Target {
|
||||
llvm_target: "arm64ec-pc-windows-msvc".into(),
|
||||
metadata: TargetMetadata {
|
||||
description: Some("Arm64EC Windows MSVC".into()),
|
||||
tier: Some(3),
|
||||
tier: Some(2),
|
||||
host_tools: Some(false),
|
||||
std: None, // ?
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 64,
|
||||
data_layout:
|
||||
|
||||
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
|
||||
description: Some("Armv7-A Trusty".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
description: Some("x86_64 Trusty".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 64,
|
||||
data_layout:
|
||||
|
||||
@@ -99,7 +99,8 @@ pub enum ControlFlow<B, C = ()> {
|
||||
}
|
||||
|
||||
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
|
||||
impl<B, C> ops::Try for ControlFlow<B, C> {
|
||||
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
|
||||
impl<B, C> const ops::Try for ControlFlow<B, C> {
|
||||
type Output = C;
|
||||
type Residual = ControlFlow<B, convert::Infallible>;
|
||||
|
||||
@@ -118,9 +119,10 @@ fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
|
||||
}
|
||||
|
||||
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
|
||||
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
|
||||
// Note: manually specifying the residual type instead of using the default to work around
|
||||
// https://github.com/rust-lang/rust/issues/99940
|
||||
impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
|
||||
impl<B, C> const ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
|
||||
#[inline]
|
||||
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
|
||||
match residual {
|
||||
|
||||
@@ -290,7 +290,6 @@
|
||||
#![feature(doc_masked)]
|
||||
#![feature(doc_notable_trait)]
|
||||
#![feature(dropck_eyepatch)]
|
||||
#![feature(extended_varargs_abi_support)]
|
||||
#![feature(f16)]
|
||||
#![feature(f128)]
|
||||
#![feature(ffi_const)]
|
||||
|
||||
@@ -819,7 +819,7 @@ fn panic_with_hook(
|
||||
rtprintpanic!("aborting due to panic at {location}:\n{payload}\n");
|
||||
}
|
||||
}
|
||||
crate::sys::abort_internal();
|
||||
crate::process::abort();
|
||||
}
|
||||
|
||||
match *HOOK.read().unwrap_or_else(PoisonError::into_inner) {
|
||||
@@ -853,7 +853,7 @@ fn panic_with_hook(
|
||||
// through a nounwind function (e.g. extern "C") then we cannot continue
|
||||
// unwinding and have to abort immediately.
|
||||
rtprintpanic!("thread caused non-unwinding panic. aborting.\n");
|
||||
crate::sys::abort_internal();
|
||||
crate::process::abort();
|
||||
}
|
||||
|
||||
rust_panic(payload)
|
||||
|
||||
@@ -2495,6 +2495,7 @@ pub fn exit(code: i32) -> ! {
|
||||
#[stable(feature = "process_abort", since = "1.17.0")]
|
||||
#[cold]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "process_abort")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
pub fn abort() -> ! {
|
||||
crate::sys::abort_internal();
|
||||
}
|
||||
|
||||
@@ -364,6 +364,7 @@ pub fn cvt_nz(error: libc::c_int) -> crate::io::Result<()> {
|
||||
// multithreaded C program. It is much less severe for Rust, because Rust
|
||||
// stdlib doesn't use libc stdio buffering. In a typical Rust program, which
|
||||
// does not use C stdio, even a buggy libc::abort() is, in fact, safe.
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
pub fn abort_internal() -> ! {
|
||||
unsafe { libc::abort() }
|
||||
}
|
||||
|
||||
@@ -356,6 +356,7 @@ pub fn abort_internal() -> ! {
|
||||
}
|
||||
|
||||
#[cfg(miri)]
|
||||
#[track_caller] // even without panics, this helps for Miri backtraces
|
||||
pub fn abort_internal() -> ! {
|
||||
crate::intrinsics::abort();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ Target triplets available:
|
||||
## Target maintainers
|
||||
|
||||
[@biabbas](https://github.com/biabbas)
|
||||
[@hax0kartik](https://github.com/hax0kartik)
|
||||
|
||||
## Requirements
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# `extended_varargs_abi_support`
|
||||
|
||||
The tracking issue for this feature is: [#100189]
|
||||
|
||||
[#100189]: https://github.com/rust-lang/rust/issues/100189
|
||||
|
||||
------------------------
|
||||
|
||||
This feature adds the possibility of using `sysv64`, `win64` or `efiapi` calling
|
||||
conventions on functions with varargs.
|
||||
@@ -557,7 +557,7 @@ fn clean_generic_param_def(
|
||||
},
|
||||
)
|
||||
}
|
||||
ty::GenericParamDefKind::Const { has_default, synthetic } => (
|
||||
ty::GenericParamDefKind::Const { has_default } => (
|
||||
def.name,
|
||||
GenericParamDefKind::Const {
|
||||
ty: Box::new(clean_middle_ty(
|
||||
@@ -580,7 +580,6 @@ fn clean_generic_param_def(
|
||||
} else {
|
||||
None
|
||||
},
|
||||
synthetic,
|
||||
},
|
||||
),
|
||||
};
|
||||
@@ -636,14 +635,13 @@ fn clean_generic_param<'tcx>(
|
||||
},
|
||||
)
|
||||
}
|
||||
hir::GenericParamKind::Const { ty, default, synthetic } => (
|
||||
hir::GenericParamKind::Const { ty, default } => (
|
||||
param.name.ident().name,
|
||||
GenericParamDefKind::Const {
|
||||
ty: Box::new(clean_ty(ty, cx)),
|
||||
default: default.map(|ct| {
|
||||
Box::new(lower_const_arg_for_rustdoc(cx.tcx, ct, FeedConstTy::No).to_string())
|
||||
}),
|
||||
synthetic,
|
||||
},
|
||||
),
|
||||
};
|
||||
|
||||
@@ -1396,7 +1396,7 @@ pub(crate) enum GenericParamDefKind {
|
||||
Lifetime { outlives: ThinVec<Lifetime> },
|
||||
Type { bounds: ThinVec<GenericBound>, default: Option<Box<Type>>, synthetic: bool },
|
||||
// Option<Box<String>> makes this type smaller than `Option<String>` would.
|
||||
Const { ty: Box<Type>, default: Option<Box<String>>, synthetic: bool },
|
||||
Const { ty: Box<Type>, default: Option<Box<String>> },
|
||||
}
|
||||
|
||||
impl GenericParamDefKind {
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
use crate::clean;
|
||||
|
||||
macro_rules! item_type {
|
||||
($($variant:ident = $number:literal,)+) => {
|
||||
|
||||
/// Item type. Corresponds to `clean::ItemEnum` variants.
|
||||
///
|
||||
/// The search index uses item types encoded as smaller numbers which equal to
|
||||
@@ -29,6 +32,44 @@
|
||||
#[derive(Copy, PartialEq, Eq, Hash, Clone, Debug, PartialOrd, Ord)]
|
||||
#[repr(u8)]
|
||||
pub(crate) enum ItemType {
|
||||
$($variant = $number,)+
|
||||
}
|
||||
|
||||
impl Serialize for ItemType {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
(*self as u8).serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for ItemType {
|
||||
fn deserialize<D>(deserializer: D) -> Result<ItemType, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
struct ItemTypeVisitor;
|
||||
impl<'de> de::Visitor<'de> for ItemTypeVisitor {
|
||||
type Value = ItemType;
|
||||
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(formatter, "an integer between 0 and 27")
|
||||
}
|
||||
fn visit_u64<E: de::Error>(self, v: u64) -> Result<ItemType, E> {
|
||||
Ok(match v {
|
||||
$($number => ItemType::$variant,)+
|
||||
_ => return Err(E::missing_field("unknown number for `ItemType` enum")),
|
||||
})
|
||||
}
|
||||
}
|
||||
deserializer.deserialize_any(ItemTypeVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
item_type! {
|
||||
Keyword = 0,
|
||||
Primitive = 1,
|
||||
Module = 2,
|
||||
@@ -60,61 +101,6 @@ pub(crate) enum ItemType {
|
||||
Attribute = 27,
|
||||
}
|
||||
|
||||
impl Serialize for ItemType {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
(*self as u8).serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for ItemType {
|
||||
fn deserialize<D>(deserializer: D) -> Result<ItemType, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
struct ItemTypeVisitor;
|
||||
impl<'de> de::Visitor<'de> for ItemTypeVisitor {
|
||||
type Value = ItemType;
|
||||
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(formatter, "an integer between 0 and 25")
|
||||
}
|
||||
fn visit_u64<E: de::Error>(self, v: u64) -> Result<ItemType, E> {
|
||||
Ok(match v {
|
||||
0 => ItemType::Keyword,
|
||||
1 => ItemType::Primitive,
|
||||
2 => ItemType::Module,
|
||||
3 => ItemType::ExternCrate,
|
||||
4 => ItemType::Import,
|
||||
5 => ItemType::Struct,
|
||||
6 => ItemType::Enum,
|
||||
7 => ItemType::Function,
|
||||
8 => ItemType::TypeAlias,
|
||||
9 => ItemType::Static,
|
||||
10 => ItemType::Trait,
|
||||
11 => ItemType::Impl,
|
||||
12 => ItemType::TyMethod,
|
||||
13 => ItemType::Method,
|
||||
14 => ItemType::StructField,
|
||||
15 => ItemType::Variant,
|
||||
16 => ItemType::Macro,
|
||||
17 => ItemType::AssocType,
|
||||
18 => ItemType::Constant,
|
||||
19 => ItemType::AssocConst,
|
||||
20 => ItemType::Union,
|
||||
21 => ItemType::ForeignType,
|
||||
23 => ItemType::ProcAttribute,
|
||||
24 => ItemType::ProcDerive,
|
||||
25 => ItemType::TraitAlias,
|
||||
_ => return Err(E::missing_field("unknown number")),
|
||||
})
|
||||
}
|
||||
}
|
||||
deserializer.deserialize_any(ItemTypeVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a clean::Item> for ItemType {
|
||||
fn from(item: &'a clean::Item) -> ItemType {
|
||||
let kind = match &item.kind {
|
||||
|
||||
@@ -2812,24 +2812,46 @@ fn render_call_locations<W: fmt::Write>(
|
||||
let needs_expansion = line_max - line_min > NUM_VISIBLE_LINES;
|
||||
let locations_encoded = serde_json::to_string(&line_ranges).unwrap();
|
||||
|
||||
// Look for the example file in the source map if it exists, otherwise return a dummy span
|
||||
let file_span = (|| {
|
||||
let source_map = tcx.sess.source_map();
|
||||
let crate_src = tcx.sess.local_crate_source_file()?.into_local_path()?;
|
||||
let source_map = tcx.sess.source_map();
|
||||
let files = source_map.files();
|
||||
let local = tcx.sess.local_crate_source_file().unwrap();
|
||||
|
||||
let get_file_start_pos = || {
|
||||
let crate_src = local.clone().into_local_path()?;
|
||||
let abs_crate_src = crate_src.canonicalize().ok()?;
|
||||
let crate_root = abs_crate_src.parent()?.parent()?;
|
||||
let rel_path = path.strip_prefix(crate_root).ok()?;
|
||||
let files = source_map.files();
|
||||
let file = files.iter().find(|file| match &file.name {
|
||||
FileName::Real(RealFileName::LocalPath(other_path)) => rel_path == other_path,
|
||||
_ => false,
|
||||
})?;
|
||||
Some(rustc_span::Span::with_root_ctxt(
|
||||
file.start_pos + BytePos(byte_min),
|
||||
file.start_pos + BytePos(byte_max),
|
||||
))
|
||||
})()
|
||||
.unwrap_or(DUMMY_SP);
|
||||
files
|
||||
.iter()
|
||||
.find(|file| match &file.name {
|
||||
FileName::Real(RealFileName::LocalPath(other_path)) => rel_path == other_path,
|
||||
_ => false,
|
||||
})
|
||||
.map(|file| file.start_pos)
|
||||
};
|
||||
|
||||
// Look for the example file in the source map if it exists, otherwise
|
||||
// return a span to the local crate's source file
|
||||
let Some(file_span) = get_file_start_pos()
|
||||
.or_else(|| {
|
||||
files
|
||||
.iter()
|
||||
.find(|file| match &file.name {
|
||||
FileName::Real(file_name) => file_name == &local,
|
||||
_ => false,
|
||||
})
|
||||
.map(|file| file.start_pos)
|
||||
})
|
||||
.map(|start_pos| {
|
||||
rustc_span::Span::with_root_ctxt(
|
||||
start_pos + BytePos(byte_min),
|
||||
start_pos + BytePos(byte_max),
|
||||
)
|
||||
})
|
||||
else {
|
||||
// if the fallback span can't be built, don't render the code for this example
|
||||
return false;
|
||||
};
|
||||
|
||||
let mut decoration_info = FxIndexMap::default();
|
||||
decoration_info.insert("highlight focus", vec![byte_ranges.remove(0)]);
|
||||
|
||||
+1
-1
@@ -289,7 +289,7 @@ declare namespace rustdoc {
|
||||
exactModulePath: string,
|
||||
entry: EntryData?,
|
||||
path: PathData?,
|
||||
type: FunctionData?,
|
||||
functionData: FunctionData?,
|
||||
deprecated: boolean,
|
||||
parent: { path: PathData, name: string}?,
|
||||
}
|
||||
|
||||
@@ -1802,14 +1802,15 @@ class DocSearch {
|
||||
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {boolean} loadFunctionData
|
||||
* @returns {Promise<rustdoc.Row?>}
|
||||
*/
|
||||
async getRow(id) {
|
||||
const [name_, entry, path, type] = await Promise.all([
|
||||
async getRow(id, loadFunctionData) {
|
||||
const [name_, entry, path, functionData] = await Promise.all([
|
||||
this.getName(id),
|
||||
this.getEntryData(id),
|
||||
this.getPathData(id),
|
||||
this.getFunctionData(id),
|
||||
loadFunctionData ? this.getFunctionData(id) : null,
|
||||
]);
|
||||
if (!entry && !path) {
|
||||
return null;
|
||||
@@ -1853,7 +1854,7 @@ class DocSearch {
|
||||
`${exactModulePathData.exactModulePath}::${exactModuleName}`),
|
||||
entry,
|
||||
path,
|
||||
type,
|
||||
functionData,
|
||||
deprecated: entry ? entry.deprecated : false,
|
||||
parent: parentName !== null && parentPath !== null ?
|
||||
{ name: parentName, path: parentPath } :
|
||||
@@ -2563,11 +2564,11 @@ class DocSearch {
|
||||
name: item.parent.name,
|
||||
ty: item.parent.path.ty,
|
||||
} : undefined,
|
||||
type: item.type && item.type.functionSignature ?
|
||||
item.type.functionSignature :
|
||||
type: item.functionData && item.functionData.functionSignature ?
|
||||
item.functionData.functionSignature :
|
||||
undefined,
|
||||
paramNames: item.type && item.type.paramNames ?
|
||||
item.type.paramNames :
|
||||
paramNames: item.functionData && item.functionData.paramNames ?
|
||||
item.functionData.paramNames :
|
||||
undefined,
|
||||
dist: result.dist,
|
||||
path_dist: result.path_dist,
|
||||
@@ -2642,7 +2643,7 @@ class DocSearch {
|
||||
/**
|
||||
* @type {rustdoc.Row?}
|
||||
*/
|
||||
const item = await this.getRow(result.id);
|
||||
const item = await this.getRow(result.id, typeInfo !== null);
|
||||
if (!item) {
|
||||
continue;
|
||||
}
|
||||
@@ -3749,7 +3750,7 @@ class DocSearch {
|
||||
is_alias: true,
|
||||
elems: [], // only used in type-based queries
|
||||
returned: [], // only used in type-based queries
|
||||
original: await this.getRow(alias),
|
||||
original: await this.getRow(alias, false),
|
||||
};
|
||||
};
|
||||
/**
|
||||
@@ -3804,7 +3805,7 @@ class DocSearch {
|
||||
* @returns {Promise<rustdoc.PlainResultObject?>}
|
||||
*/
|
||||
const handleNameSearch = async id => {
|
||||
const row = await this.getRow(id);
|
||||
const row = await this.getRow(id, false);
|
||||
if (!row || !row.entry) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ fn from_clean(kind: &clean::GenericParamDefKind, renderer: &JsonRenderer<'_>) ->
|
||||
default: default.into_json(renderer),
|
||||
is_synthetic: *synthetic,
|
||||
},
|
||||
Const { ty, default, synthetic: _ } => GenericParamDefKind::Const {
|
||||
Const { ty, default } => GenericParamDefKind::Const {
|
||||
type_: ty.into_json(renderer),
|
||||
default: default.as_ref().map(|x| x.as_ref().clone()),
|
||||
},
|
||||
|
||||
@@ -53,7 +53,7 @@ fn array_rec(pats: &[Pat<'_>]) -> bool {
|
||||
| PatKind::Never
|
||||
| PatKind::Or(_)
|
||||
| PatKind::Err(_) => false,
|
||||
PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
|
||||
PatKind::Struct(_, a, etc) => etc.is_none() && a.iter().all(|x| unary_pattern(x.pat)),
|
||||
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => etc.as_opt_usize().is_none() && array_rec(a),
|
||||
PatKind::Ref(x, _) | PatKind::Box(x) | PatKind::Deref(x) | PatKind::Guard(x, _) => unary_pattern(x),
|
||||
PatKind::Expr(_) => true,
|
||||
|
||||
@@ -287,7 +287,7 @@ fn replace_in_pattern(
|
||||
}
|
||||
return or_pat;
|
||||
},
|
||||
PatKind::Struct(path, fields, has_dot_dot) => {
|
||||
PatKind::Struct(path, fields, dot_dot) => {
|
||||
let fields = fields
|
||||
.iter()
|
||||
.map(|fld| {
|
||||
@@ -311,7 +311,7 @@ fn replace_in_pattern(
|
||||
.collect::<Vec<_>>();
|
||||
let fields_string = fields.join(", ");
|
||||
|
||||
let dot_dot_str = if has_dot_dot { " .." } else { "" };
|
||||
let dot_dot_str = if dot_dot.is_some() { " .." } else { "" };
|
||||
let (sn_pth, _) = snippet_with_context(cx, path.span(), span.ctxt(), "", app);
|
||||
return format!("{sn_pth} {{ {fields_string}{dot_dot_str} }}");
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
pub(crate) fn check(cx: &LateContext<'_>, pat: &Pat<'_>) {
|
||||
if !pat.span.from_expansion()
|
||||
&& let PatKind::Struct(QPath::Resolved(_, path), fields, true) = pat.kind
|
||||
&& let PatKind::Struct(QPath::Resolved(_, path), fields, Some(_)) = pat.kind
|
||||
&& let Some(def_id) = path.res.opt_def_id()
|
||||
&& let ty = cx.tcx.type_of(def_id).instantiate_identity()
|
||||
&& let ty::Adt(def, _) = ty.kind()
|
||||
|
||||
@@ -754,7 +754,8 @@ macro_rules! kind {
|
||||
self.ident(name);
|
||||
sub.if_some(|p| self.pat(p));
|
||||
},
|
||||
PatKind::Struct(ref qpath, fields, ignore) => {
|
||||
PatKind::Struct(ref qpath, fields, etc) => {
|
||||
let ignore = etc.is_some();
|
||||
bind!(self, qpath, fields);
|
||||
kind!("Struct(ref {qpath}, {fields}, {ignore})");
|
||||
self.qpath(qpath, pat);
|
||||
|
||||
@@ -2011,7 +2011,7 @@ pub fn is_expr_identity_of_pat(cx: &LateContext<'_>, pat: &Pat<'_>, expr: &Expr<
|
||||
false
|
||||
}
|
||||
},
|
||||
(PatKind::Struct(pat_ident, field_pats, false), ExprKind::Struct(ident, fields, hir::StructTailExpr::None))
|
||||
(PatKind::Struct(pat_ident, field_pats, None), ExprKind::Struct(ident, fields, hir::StructTailExpr::None))
|
||||
if field_pats.len() == fields.len() =>
|
||||
{
|
||||
// check ident
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: aborted
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
#![feature(allocator_api)]
|
||||
|
||||
use std::alloc::*;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
memory allocation of 4 bytes failed
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/alloc.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
|
||||
= note: inside `std::alloc::rust_oom` at RUSTLIB/std/src/alloc.rs:LL:CC
|
||||
= note: inside `std::alloc::_::__rg_oom` at RUSTLIB/std/src/alloc.rs:LL:CC
|
||||
= note: inside `std::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
|
||||
@@ -16,7 +14,7 @@ note: inside `main`
|
||||
--> tests/fail/alloc/alloc_error_handler.rs:LL:CC
|
||||
|
|
||||
LL | handle_alloc_error(Layout::for_value(&0));
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -9,13 +9,12 @@ panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -33,7 +32,7 @@ note: inside `main`
|
||||
--> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { nounwind() }
|
||||
| ^
|
||||
| ^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
+4
-5
@@ -9,13 +9,12 @@ panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -33,7 +32,7 @@ note: inside `main`
|
||||
--> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { nounwind() }
|
||||
| ^
|
||||
| ^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ error: Undefined Behavior: unwinding past a stack frame that does not allow unwi
|
||||
--> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { nounwind() }
|
||||
| ^ Undefined Behavior occurred here
|
||||
| ^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@revisions: extern_block definition both
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
//@[definition,both]error-in-other-file: aborted execution
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
|
||||
|
||||
@@ -9,13 +9,12 @@ panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -27,7 +26,7 @@ note: inside `main`
|
||||
--> tests/fail/panic/abort_unwind.rs:LL:CC
|
||||
|
|
||||
LL | std::panic::abort_unwind(|| panic!("PANIC!!!"));
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
//@error-in-other-file: aborted execution
|
||||
|
||||
@@ -12,13 +12,12 @@ thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
|
||||
panic in a destructor during cleanup
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@compile-flags: -C panic=abort
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -4,14 +4,12 @@ panicking from libstd
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/rt.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
|
||||
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
|
||||
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
||||
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
@@ -23,7 +21,7 @@ note: inside `main`
|
||||
--> tests/fail/panic/panic_abort1.rs:LL:CC
|
||||
|
|
||||
LL | std::panic!("panicking from libstd");
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@compile-flags: -C panic=abort
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -4,14 +4,12 @@ thread 'main' ($TID) panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/rt.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
|
||||
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
|
||||
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
||||
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
@@ -23,7 +21,7 @@ note: inside `main`
|
||||
--> tests/fail/panic/panic_abort2.rs:LL:CC
|
||||
|
|
||||
LL | std::panic!("{}-panicking from libstd", 42);
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@compile-flags: -C panic=abort
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -4,14 +4,12 @@ panicking from libcore
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/rt.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
|
||||
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
|
||||
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
||||
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
@@ -23,7 +21,7 @@ note: inside `main`
|
||||
--> tests/fail/panic/panic_abort3.rs:LL:CC
|
||||
|
|
||||
LL | core::panic!("panicking from libcore");
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@compile-flags: -C panic=abort
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -4,14 +4,12 @@ thread 'main' ($TID) panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/rt.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
|
||||
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
|
||||
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
||||
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
@@ -23,7 +21,7 @@ note: inside `main`
|
||||
--> tests/fail/panic/panic_abort4.rs:LL:CC
|
||||
|
|
||||
LL | core::panic!("{}-panicking from libcore", 42);
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//! This is a regression test for <https://github.com/rust-lang/miri/issues/4188>: The precondition
|
||||
//! check in `ptr::swap_nonoverlapping` was incorrectly disabled in Miri.
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
//@error-in-other-file: aborted execution
|
||||
|
||||
@@ -7,13 +7,12 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -22,7 +21,7 @@ note: inside `main`
|
||||
--> tests/fail/ptr_swap_nonoverlapping.rs:LL:CC
|
||||
|
|
||||
LL | std::ptr::swap_nonoverlapping(ptr, ptr, 1);
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@compile-flags: -Zmir-opt-level=3 -Zinline-mir-hint-threshold=1000
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
//@error-in-other-file: aborted execution
|
||||
|
||||
@@ -11,13 +11,12 @@ panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -36,12 +35,12 @@ note: inside `panic_abort`
|
||||
--> tests/fail/terminate-terminator.rs:LL:CC
|
||||
|
|
||||
LL | has_cleanup();
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^
|
||||
note: inside `main`
|
||||
--> tests/fail/terminate-terminator.rs:LL:CC
|
||||
|
|
||||
LL | panic_abort();
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
//@error-in-other-file: aborted execution
|
||||
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
extern "C" fn panic_abort() {
|
||||
|
||||
@@ -9,13 +9,12 @@ panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
--> RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ abnormal termination occurred here
|
||||
LL | crate::process::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
@@ -33,7 +32,7 @@ note: inside `main`
|
||||
--> tests/fail/unwind-action-terminate.rs:LL:CC
|
||||
|
|
||||
LL | panic_abort();
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
||||
@@ -1175,8 +1175,8 @@ pub(crate) fn format_trait(
|
||||
let mut result = String::with_capacity(128);
|
||||
let header = format!(
|
||||
"{}{}{}{}trait ",
|
||||
format_constness(constness),
|
||||
format_visibility(context, &item.vis),
|
||||
format_constness(constness),
|
||||
format_safety(safety),
|
||||
format_auto(is_auto),
|
||||
);
|
||||
|
||||
@@ -303,7 +303,7 @@ fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteR
|
||||
qself,
|
||||
path,
|
||||
fields,
|
||||
rest == ast::PatFieldsRest::Rest,
|
||||
matches!(rest, ast::PatFieldsRest::Rest(_)),
|
||||
self.span,
|
||||
context,
|
||||
shape,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
//@[arm32] needs-llvm-components: arm
|
||||
#![crate_type = "lib"]
|
||||
#![feature(no_core)]
|
||||
#![feature(extended_varargs_abi_support, extern_system_varargs)]
|
||||
#![feature(extern_system_varargs)]
|
||||
#![no_core]
|
||||
|
||||
extern crate minicore;
|
||||
|
||||
@@ -11,7 +11,7 @@ pub fn branchy(input: u64) -> u64 {
|
||||
// CHECK-LABEL: @branchy(
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: [[_2:%.*]] = and i64 [[INPUT:%.*]], 3
|
||||
// CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds{{( nuw)?}} [4 x i64], ptr @switch.table.branchy, i64 0, i64 [[_2]]
|
||||
// CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds{{( nuw)?}} {{\[4 x i64\]|i64}}, ptr @switch.table.branchy{{(, i64 0)?}}, i64 [[_2]]
|
||||
// CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i64, ptr [[SWITCH_GEP]]
|
||||
// CHECK-NEXT: ret i64 [[SWITCH_LOAD]]
|
||||
match input % 4 {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
//@ known-bug: #140479
|
||||
macro_rules! a { ( $( { $ [ $b:c ] } )) => ( $(${ concat(d, $b)} ))}
|
||||
fn e() {
|
||||
a!({})
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Check that the line number column has the correct layout.
|
||||
go-to: "file://" + |DOC_PATH| + "/scrape_ice/struct.ObscurelyNamedType1.html"
|
||||
wait-for: ".scraped-example-title"
|
||||
assert-attribute: (".scraped-example-title a", {"href": "../src/bar/bar.rs.html#2"})
|
||||
click: ".scraped-example-title a"
|
||||
wait-for-property: ("h1", {"innerText": "bar/\nbar.rs"})
|
||||
@@ -71,7 +71,7 @@ assert: "//*[@class='dir-entry' and @open]/*[normalize-space()='sub_mod']"
|
||||
// Only "another_folder" should be "open" in "lib2".
|
||||
assert: "//*[@class='dir-entry' and not(@open)]/*[normalize-space()='another_mod']"
|
||||
// All other trees should be collapsed.
|
||||
assert-count: ("//*[@id='src-sidebar']/details[not(normalize-space()='lib2') and not(@open)]", 12)
|
||||
assert-count: ("//*[@id='src-sidebar']/details[not(normalize-space()='lib2') and not(@open)]", 13)
|
||||
|
||||
// We now switch to mobile mode.
|
||||
set-window-size: (600, 600)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "scrape_ice"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "scrape_ice"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[[example]]
|
||||
name = "bar"
|
||||
path = "examples/bar.rs"
|
||||
doc-scrape-examples = true
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
let mut bar = scrape_ice::ObscurelyNamedType1::new();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//@ run-flags:-Zrustdoc-scrape-examples
|
||||
//@ compile-flags: --html-after-content empty.html
|
||||
pub struct ObscurelyNamedType1;
|
||||
|
||||
impl ObscurelyNamedType1 {
|
||||
pub fn new() -> Self {
|
||||
ObscurelyNamedType1
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,6 @@
|
||||
// We have to use this flag to force ABI computation of an invalid ABI
|
||||
//@ compile-flags: -Clink-dead-code
|
||||
|
||||
#![feature(extended_varargs_abi_support)]
|
||||
|
||||
// sometimes fn ptrs with varargs make layout and ABI computation ICE
|
||||
// as found in https://github.com/rust-lang/rust/issues/142107
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0570]: "aapcs" is not a supported ABI for the current target
|
||||
--> $DIR/unsupported-varargs-fnptr.rs:14:20
|
||||
--> $DIR/unsupported-varargs-fnptr.rs:12:20
|
||||
|
|
||||
LL | fn aapcs(f: extern "aapcs" fn(usize, ...)) {
|
||||
| ^^^^^^^
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//@ only-x86_64
|
||||
|
||||
fn efiapi(f: extern "efiapi" fn(usize, ...)) {
|
||||
//~^ ERROR: unstable
|
||||
f(22, 44);
|
||||
}
|
||||
fn sysv(f: extern "sysv64" fn(usize, ...)) {
|
||||
//~^ ERROR: unstable
|
||||
f(22, 44);
|
||||
}
|
||||
fn win(f: extern "win64" fn(usize, ...)) {
|
||||
//~^ ERROR: unstable
|
||||
f(22, 44);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -1,33 +0,0 @@
|
||||
error[E0658]: C-variadic functions with the "efiapi" calling convention are unstable
|
||||
--> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
|
||||
|
|
||||
LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
|
||||
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: C-variadic functions with the "sysv64" calling convention are unstable
|
||||
--> $DIR/feature-gate-extended_varargs_abi_support.rs:7:12
|
||||
|
|
||||
LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
|
||||
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: C-variadic functions with the "win64" calling convention are unstable
|
||||
--> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
|
||||
|
|
||||
LL | fn win(f: extern "win64" fn(usize, ...)) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
|
||||
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
@@ -13,6 +13,6 @@ fn ordering4 < 'a , 'b > ( a : , self , self , self ,
|
||||
//~| ERROR unexpected `self` parameter in function
|
||||
//~| ERROR unexpected `self` parameter in function
|
||||
//~| ERROR `...` must be the last argument of a C-variadic function
|
||||
//~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
|
||||
//~| ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
//~| ERROR cannot find type `F` in this scope
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ error: `...` must be the last argument of a C-variadic function
|
||||
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
|
||||
| ^^^
|
||||
|
||||
error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
|
||||
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
--> $DIR/issue-86053-1.rs:11:12
|
||||
|
|
||||
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(extended_varargs_abi_support)]
|
||||
//@ run-pass
|
||||
//@ only-arm
|
||||
//@ ignore-thumb (this test uses arm assembly)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(extended_varargs_abi_support)]
|
||||
//@ run-pass
|
||||
//@ only-x86_64
|
||||
|
||||
|
||||
@@ -71,6 +71,6 @@ extern "cmse-nonsecure-entry" fn wrapped_trait_object(
|
||||
}
|
||||
|
||||
extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
|
||||
//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
|
||||
//~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
//~| ERROR requires `va_list` lang_item
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
|
||||
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
--> $DIR/generics.rs:73:53
|
||||
|
|
||||
LL | extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
|
||||
|
||||
@@ -2,3 +2,9 @@
|
||||
|
||||
pub unsafe extern "C" fn test(_: i32, ap: ...) { }
|
||||
//~^ ERROR C-variadic functions are unstable
|
||||
|
||||
trait Trait {
|
||||
unsafe extern "C" fn trait_test(_: i32, ap: ...) { }
|
||||
//~^ ERROR C-variadic functions are unstable
|
||||
//~| ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
||||
--> $DIR/feature-gate-c_variadic.rs:7:45
|
||||
|
|
||||
LL | unsafe extern "C" fn trait_test(_: i32, ap: ...) { }
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0658]: C-variadic functions are unstable
|
||||
--> $DIR/feature-gate-c_variadic.rs:3:1
|
||||
|
|
||||
@@ -8,6 +14,16 @@ LL | pub unsafe extern "C" fn test(_: i32, ap: ...) { }
|
||||
= help: add `#![feature(c_variadic)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0658]: C-variadic functions are unstable
|
||||
--> $DIR/feature-gate-c_variadic.rs:7:5
|
||||
|
|
||||
LL | unsafe extern "C" fn trait_test(_: i32, ap: ...) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #44930 <https://github.com/rust-lang/rust/issues/44930> for more information
|
||||
= help: add `#![feature(c_variadic)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// issue: <https://github.com/rust-lang/rust/issues/140479>
|
||||
// Ensure a proper compiler error, instead of an ICE occurs.
|
||||
// FIXME(macro_metavar_expr_concat): this error message could be improved
|
||||
#![feature(macro_metavar_expr_concat)]
|
||||
|
||||
macro_rules! InRepetition {
|
||||
(
|
||||
$(
|
||||
$($arg:ident),+
|
||||
)+
|
||||
) => {
|
||||
$(
|
||||
$(
|
||||
${concat(_, $arg)} //~ ERROR nested repetitions with `${concat(...)}` metavariable expressions are not yet supported
|
||||
)*
|
||||
)*
|
||||
};
|
||||
}
|
||||
InRepetition!(other);
|
||||
|
||||
fn main() {}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user