提交 63a81b0c 编写于 作者: B bors

Auto merge of #114585 - matthiaskrgr:rollup-h26pvus, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #113568 (Fix spurious test failure with `panic=abort`)
 - #114196 (Bubble up nested goals from equation in `predicates_for_object_candidate`)
 - #114485 (Add trait decls to SMIR)
 - #114495 (Set max_atomic_width for AVR to 16)
 - #114496 (Set max_atomic_width for sparc-unknown-linux-gnu to 32)
 - #114510 (llvm-wrapper: adapt for LLVM API changes)
 - #114562 (stabilize abi_thiscall)
 - #114570 ([miri][typo] Fix a typo in a vector_block comment.)
 - #114573 (CI: do not hide error logs in a group)

r? `@ghost`
`@rustbot` modify labels: rollup
......@@ -53,6 +53,8 @@
/// Allows the sysV64 ABI to be specified on all platforms
/// instead of just the platforms on which it is the C ABI.
(accepted, abi_sysv64, "1.24.0", Some(36167), None),
/// Allows using the `thiscall` ABI.
(accepted, abi_thiscall, "1.19.0", None, None),
/// Allows using ADX intrinsics from `core::arch::{x86, x86_64}`.
(accepted, adx_target_feature, "1.61.0", Some(44839), None),
/// Allows explicit discriminants on non-unit enum variants.
......
......@@ -156,8 +156,6 @@ pub fn set(&self, features: &mut Features, span: Span) {
// -------------------------------------------------------------------------
// no-tracking-issue-start
/// Allows using the `thiscall` ABI.
(active, abi_thiscall, "1.19.0", None, None),
/// Allows using the `unadjusted` ABI; perma-unstable.
(active, abi_unadjusted, "1.16.0", None, None),
/// Allows using the `vectorcall` ABI.
......
......@@ -1120,9 +1120,15 @@ struct LLVMRustThinLTOData {
// Not 100% sure what these are, but they impact what's internalized and
// what's inlined across modules, I believe.
#if LLVM_VERSION_GE(17, 0)
DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
#else
StringMap<FunctionImporter::ImportMapTy> ImportLists;
StringMap<FunctionImporter::ExportSetTy> ExportLists;
StringMap<GVSummaryMapTy> ModuleToDefinedGVSummaries;
#endif
StringMap<std::map<GlobalValue::GUID, GlobalValue::LinkageTypes>> ResolvedODR;
LLVMRustThinLTOData() : Index(/* HaveGVs = */ false) {}
......
......@@ -68,6 +68,10 @@ pub fn item_def_id(&self, item: &stable_mir::CrateItem) -> DefId {
self.def_ids[item.0]
}
pub fn trait_def_id(&self, trait_def: &stable_mir::ty::TraitDef) -> DefId {
self.def_ids[trait_def.0]
}
pub fn crate_item(&mut self, did: DefId) -> stable_mir::CrateItem {
stable_mir::CrateItem(self.create_def_id(did))
}
......
......@@ -41,6 +41,21 @@ fn all_local_items(&mut self) -> stable_mir::CrateItems {
fn entry_fn(&mut self) -> Option<stable_mir::CrateItem> {
Some(self.crate_item(self.tcx.entry_fn(())?.0))
}
fn all_trait_decls(&mut self) -> stable_mir::TraitDecls {
self.tcx
.traits(LOCAL_CRATE)
.iter()
.map(|trait_def_id| self.trait_def(*trait_def_id))
.collect()
}
fn trait_decl(&mut self, trait_def: &stable_mir::ty::TraitDef) -> stable_mir::ty::TraitDecl {
let def_id = self.trait_def_id(trait_def);
let trait_def = self.tcx.trait_def(def_id);
trait_def.stable(self)
}
fn mir_body(&mut self, item: &stable_mir::CrateItem) -> stable_mir::mir::Body {
let def_id = self.item_def_id(item);
let mir = self.tcx.optimized_mir(def_id);
......@@ -515,7 +530,7 @@ fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
}
}
impl<'tcx> Stable<'tcx> for rustc_middle::ty::UserTypeAnnotationIndex {
impl<'tcx> Stable<'tcx> for ty::UserTypeAnnotationIndex {
type T = usize;
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
self.as_usize()
......@@ -826,7 +841,7 @@ impl<'tcx> Stable<'tcx> for ty::FnSig<'tcx> {
type T = stable_mir::ty::FnSig;
fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
use rustc_target::spec::abi;
use stable_mir::ty::{Abi, FnSig, Unsafety};
use stable_mir::ty::{Abi, FnSig};
FnSig {
inputs_and_output: self
......@@ -835,10 +850,7 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
.map(|ty| tables.intern_ty(ty))
.collect(),
c_variadic: self.c_variadic,
unsafety: match self.unsafety {
hir::Unsafety::Normal => Unsafety::Normal,
hir::Unsafety::Unsafe => Unsafety::Unsafe,
},
unsafety: self.unsafety.stable(tables),
abi: match self.abi {
abi::Abi::Rust => Abi::Rust,
abi::Abi::C { unwind } => Abi::C { unwind },
......@@ -1048,7 +1060,7 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
}
}
impl<'tcx> Stable<'tcx> for rustc_middle::ty::ParamTy {
impl<'tcx> Stable<'tcx> for ty::ParamTy {
type T = stable_mir::ty::ParamTy;
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
use stable_mir::ty::ParamTy;
......@@ -1056,7 +1068,7 @@ fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
}
}
impl<'tcx> Stable<'tcx> for rustc_middle::ty::BoundTy {
impl<'tcx> Stable<'tcx> for ty::BoundTy {
type T = stable_mir::ty::BoundTy;
fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
use stable_mir::ty::BoundTy;
......@@ -1094,3 +1106,42 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
}
}
}
impl<'tcx> Stable<'tcx> for ty::trait_def::TraitSpecializationKind {
type T = stable_mir::ty::TraitSpecializationKind;
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
use stable_mir::ty::TraitSpecializationKind;
match self {
ty::trait_def::TraitSpecializationKind::None => TraitSpecializationKind::None,
ty::trait_def::TraitSpecializationKind::Marker => TraitSpecializationKind::Marker,
ty::trait_def::TraitSpecializationKind::AlwaysApplicable => {
TraitSpecializationKind::AlwaysApplicable
}
}
}
}
impl<'tcx> Stable<'tcx> for ty::TraitDef {
type T = stable_mir::ty::TraitDecl;
fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
use stable_mir::ty::TraitDecl;
TraitDecl {
def_id: rustc_internal::trait_def(self.def_id),
unsafety: self.unsafety.stable(tables),
paren_sugar: self.paren_sugar,
has_auto_impl: self.has_auto_impl,
is_marker: self.is_marker,
is_coinductive: self.is_coinductive,
skip_array_during_method_dispatch: self.skip_array_during_method_dispatch,
specialization_kind: self.specialization_kind.stable(tables),
must_implement_one_of: self
.must_implement_one_of
.as_ref()
.map(|idents| idents.iter().map(|ident| opaque(ident)).collect()),
implement_via_object: self.implement_via_object,
deny_explicit_impl: self.deny_explicit_impl,
}
}
}
......@@ -15,7 +15,7 @@
use crate::rustc_smir::Tables;
use self::ty::{Ty, TyKind};
use self::ty::{TraitDecl, TraitDef, Ty, TyKind};
pub mod mir;
pub mod ty;
......@@ -32,6 +32,9 @@
/// A list of crate items.
pub type CrateItems = Vec<CrateItem>;
/// A list of crate items.
pub type TraitDecls = Vec<TraitDef>;
/// Holds information about a crate.
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Crate {
......@@ -84,6 +87,8 @@ pub trait Context {
/// Retrieve all items of the local crate that have a MIR associated with them.
fn all_local_items(&mut self) -> CrateItems;
fn mir_body(&mut self, item: &CrateItem) -> mir::Body;
fn all_trait_decls(&mut self) -> TraitDecls;
fn trait_decl(&mut self, trait_def: &TraitDef) -> TraitDecl;
/// Get information about the local crate.
fn local_crate(&self) -> Crate;
/// Retrieve a list of all external crates.
......
use super::{mir::Mutability, with, DefId};
use super::{mir::Mutability, mir::Safety, with, DefId};
use crate::rustc_internal::Opaque;
#[derive(Copy, Clone, Debug)]
......@@ -11,6 +11,7 @@ pub fn kind(&self) -> TyKind {
}
pub(crate) type Const = Opaque;
type Ident = Opaque;
pub(crate) type Region = Opaque;
type Span = Opaque;
......@@ -104,6 +105,12 @@ pub enum Movability {
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct TraitDef(pub(crate) DefId);
impl TraitDef {
pub fn trait_decl(&self) -> TraitDecl {
with(|cx| cx.trait_decl(self))
}
}
#[derive(Clone, Debug)]
pub struct GenericArgs(pub Vec<GenericArgKind>);
......@@ -140,16 +147,10 @@ pub struct AliasTy {
pub struct FnSig {
pub inputs_and_output: Vec<Ty>,
pub c_variadic: bool,
pub unsafety: Unsafety,
pub unsafety: Safety,
pub abi: Abi,
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum Unsafety {
Unsafe,
Normal,
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum Abi {
Rust,
......@@ -264,3 +265,23 @@ pub struct Allocation {
pub align: Align,
pub mutability: Mutability,
}
pub enum TraitSpecializationKind {
None,
Marker,
AlwaysApplicable,
}
pub struct TraitDecl {
pub def_id: TraitDef,
pub unsafety: Safety,
pub paren_sugar: bool,
pub has_auto_impl: bool,
pub is_marker: bool,
pub is_coinductive: bool,
pub skip_array_during_method_dispatch: bool,
pub specialization_kind: TraitSpecializationKind,
pub must_implement_one_of: Option<Vec<Ident>>,
pub implement_via_object: bool,
pub deny_explicit_impl: bool,
}
......@@ -150,7 +150,8 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
// Stable
"Rust" | "C" | "C-unwind" | "cdecl" | "cdecl-unwind" | "stdcall" | "stdcall-unwind"
| "fastcall" | "fastcall-unwind" | "aapcs" | "aapcs-unwind" | "win64" | "win64-unwind"
| "sysv64" | "sysv64-unwind" | "system" | "system-unwind" | "efiapi" => Ok(()),
| "sysv64" | "sysv64-unwind" | "system" | "system-unwind" | "efiapi" | "thiscall"
| "thiscall-unwind" => Ok(()),
"rust-intrinsic" => Err(AbiDisabled::Unstable {
feature: sym::intrinsics,
explain: "intrinsics are subject to change",
......@@ -167,14 +168,6 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
feature: sym::abi_vectorcall,
explain: "vectorcall-unwind ABI is experimental and subject to change",
}),
"thiscall" => Err(AbiDisabled::Unstable {
feature: sym::abi_thiscall,
explain: "thiscall is experimental and subject to change",
}),
"thiscall-unwind" => Err(AbiDisabled::Unstable {
feature: sym::abi_thiscall,
explain: "thiscall-unwind ABI is experimental and subject to change",
}),
"rust-call" => Err(AbiDisabled::Unstable {
feature: sym::unboxed_closures,
explain: "rust-call ABI is subject to change",
......
......@@ -23,7 +23,7 @@ pub fn target(target_cpu: &'static str, mmcu: &'static str) -> Target {
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-lgcc"],
),
max_atomic_width: Some(0),
max_atomic_width: Some(16),
atomic_cas: false,
relocation_model: RelocModel::Static,
..TargetOptions::default()
......
......@@ -5,7 +5,7 @@ pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.endian = Endian::Big;
base.cpu = "v9".into();
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(32);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mv8plus"]);
Target {
......
......@@ -152,16 +152,12 @@ fn consider_object_bound_candidate(
let ty::Dynamic(bounds, _, _) = *goal.predicate.self_ty().kind() else {
bug!("expected object type in `consider_object_bound_candidate`");
};
ecx.add_goals(
structural_traits::predicates_for_object_candidate(
&ecx,
goal.param_env,
goal.predicate.trait_ref(tcx),
bounds,
)
.into_iter()
.map(|pred| goal.with(tcx, pred)),
);
ecx.add_goals(structural_traits::predicates_for_object_candidate(
&ecx,
goal.param_env,
goal.predicate.trait_ref(tcx),
bounds,
));
ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
})
}
......
......@@ -3,6 +3,7 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::{def_id::DefId, Movability, Mutability};
use rustc_infer::traits::query::NoSolution;
use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::{
self, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt,
};
......@@ -345,7 +346,7 @@ pub(in crate::solve) fn predicates_for_object_candidate<'tcx>(
param_env: ty::ParamEnv<'tcx>,
trait_ref: ty::TraitRef<'tcx>,
object_bound: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
) -> Vec<ty::Clause<'tcx>> {
) -> Vec<Goal<'tcx, ty::Predicate<'tcx>>> {
let tcx = ecx.tcx();
let mut requirements = vec![];
requirements.extend(
......@@ -376,17 +377,22 @@ pub(in crate::solve) fn predicates_for_object_candidate<'tcx>(
}
}
requirements.fold_with(&mut ReplaceProjectionWith {
ecx,
param_env,
mapping: replace_projection_with,
})
let mut folder =
ReplaceProjectionWith { ecx, param_env, mapping: replace_projection_with, nested: vec![] };
let folded_requirements = requirements.fold_with(&mut folder);
folder
.nested
.into_iter()
.chain(folded_requirements.into_iter().map(|clause| Goal::new(tcx, param_env, clause)))
.collect()
}
struct ReplaceProjectionWith<'a, 'tcx> {
ecx: &'a EvalCtxt<'a, 'tcx>,
param_env: ty::ParamEnv<'tcx>,
mapping: FxHashMap<DefId, ty::PolyProjectionPredicate<'tcx>>,
nested: Vec<Goal<'tcx, ty::Predicate<'tcx>>>,
}
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceProjectionWith<'_, 'tcx> {
......@@ -402,13 +408,12 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
// but the where clauses we instantiated are not. We can solve this by instantiating
// the binder at the usage site.
let proj = self.ecx.instantiate_binder_with_infer(*replacement);
// FIXME: Technically this folder could be fallible?
let nested = self
.ecx
.eq_and_get_goals(self.param_env, alias_ty, proj.projection_ty)
.expect("expected to be able to unify goal projection with dyn's projection");
// FIXME: Technically we could register these too..
assert!(nested.is_empty(), "did not expect unification to have any nested goals");
// FIXME: Technically this equate could be fallible...
self.nested.extend(
self.ecx
.eq_and_get_goals(self.param_env, alias_ty, proj.projection_ty)
.expect("expected to be able to unify goal projection with dyn's projection"),
);
proj.term.ty().unwrap()
} else {
ty.super_fold_with(self)
......
......@@ -19,7 +19,7 @@
#![feature(panic_unwind)]
#![feature(staged_api)]
#![feature(std_internals)]
#![feature(abi_thiscall)]
#![cfg_attr(bootstrap, feature(abi_thiscall))]
#![feature(rustc_attrs)]
#![panic_runtime]
#![feature(panic_runtime)]
......
......@@ -154,13 +154,25 @@ fi
# check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure
# Pipelines it happened that the certificates were marked as expired.
datecheck() {
echo "::group::Clock drift check"
# If an error has happened, we do not want to start a new group, because that will collapse
# a previous group that might have contained the error log.
exit_code=$?
if [ $exit_code -eq 0 ]
then
echo "::group::Clock drift check"
fi
echo -n " local time: "
date
echo -n " network time: "
curl -fs --head http://ci-caches.rust-lang.org | grep ^Date: \
| sed 's/Date: //g' || true
echo "::endgroup::"
if [ $exit_code -eq 0 ]
then
echo "::endgroup::"
fi
}
datecheck
trap datecheck EXIT
......
# `abi_thiscall`
The tracking issue for this feature is: [#42202]
[#42202]: https://github.com/rust-lang/rust/issues/42202
------------------------
The MSVC ABI on x86 Windows uses the `thiscall` calling convention for C++
instance methods by default; it is identical to the usual (C) calling
convention on x86 Windows except that the first parameter of the method,
the `this` pointer, is passed in the ECX register.
......@@ -9,7 +9,7 @@
/// A vector clock index, this is associated with a thread id
/// but in some cases one vector index may be shared with
/// multiple thread ids if it safe to do so.
/// multiple thread ids if it's safe to do so.
#[derive(Clone, Copy, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
pub struct VectorIdx(u32);
......
......@@ -928,22 +928,6 @@ pub fn device_function() {
ret;
}
```
"##,
},
Lint {
label: "abi_thiscall",
description: r##"# `abi_thiscall`
The tracking issue for this feature is: [#42202]
[#42202]: https://github.com/rust-lang/rust/issues/42202
------------------------
The MSVC ABI on x86 Windows uses the `thiscall` calling convention for C++
instance methods by default; it is identical to the usual (C) calling
convention on x86 Windows except that the first parameter of the method,
the `this` pointer, is passed in the ECX register.
"##,
},
Lint {
......
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind, abi_thiscall)]
#![feature(no_core, lang_items, c_unwind)]
#[lang="sized"]
trait Sized { }
......
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:26:1
--> $DIR/unsupported.rs:25:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:28:1
--> $DIR/unsupported.rs:27:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:30:1
--> $DIR/unsupported.rs:29:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"aapcs"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:32:1
--> $DIR/unsupported.rs:31:1
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:36:1
--> $DIR/unsupported.rs:35:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:38:1
--> $DIR/unsupported.rs:37:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:40:1
--> $DIR/unsupported.rs:39:1
|
LL | extern "x86-interrupt" fn x86() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"thiscall"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:43:1
--> $DIR/unsupported.rs:42:1
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of calling convention not supported on this target
--> $DIR/unsupported.rs:47:1
--> $DIR/unsupported.rs:46:1
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:26:1
--> $DIR/unsupported.rs:25:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:28:1
--> $DIR/unsupported.rs:27:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:30:1
--> $DIR/unsupported.rs:29:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:36:1
--> $DIR/unsupported.rs:35:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:38:1
--> $DIR/unsupported.rs:37:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:40:1
--> $DIR/unsupported.rs:39:1
|
LL | extern "x86-interrupt" fn x86() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"thiscall"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:43:1
--> $DIR/unsupported.rs:42:1
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of calling convention not supported on this target
--> $DIR/unsupported.rs:47:1
--> $DIR/unsupported.rs:46:1
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:26:1
--> $DIR/unsupported.rs:25:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:28:1
--> $DIR/unsupported.rs:27:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:30:1
--> $DIR/unsupported.rs:29:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"aapcs"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:32:1
--> $DIR/unsupported.rs:31:1
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:36:1
--> $DIR/unsupported.rs:35:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:38:1
--> $DIR/unsupported.rs:37:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -15,7 +15,6 @@
abi_ptx,
abi_msp430_interrupt,
abi_avr_interrupt,
abi_thiscall,
abi_amdgpu_kernel,
wasm_abi,
abi_x86_interrupt
......
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:26:1
--> $DIR/unsupported.rs:25:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:28:1
--> $DIR/unsupported.rs:27:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:30:1
--> $DIR/unsupported.rs:29:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"aapcs"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:32:1
--> $DIR/unsupported.rs:31:1
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:36:1
--> $DIR/unsupported.rs:35:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:38:1
--> $DIR/unsupported.rs:37:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"thiscall"` is not a supported ABI for the current target
--> $DIR/unsupported.rs:43:1
--> $DIR/unsupported.rs:42:1
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of calling convention not supported on this target
--> $DIR/unsupported.rs:47:1
--> $DIR/unsupported.rs:46:1
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
// run-pass
// only-x86
#![feature(abi_thiscall)]
trait A {
extern "thiscall" fn test1(i: i32);
}
......
// gate-test-abi_thiscall
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
#![no_core]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }
// Test that the "thiscall" ABI is feature-gated, and cannot be used when
// the `abi_thiscall` feature gate is not used.
extern "thiscall-unwind" fn fu() {} //~ ERROR thiscall-unwind ABI is experimental
extern "thiscall" fn f() {} //~ ERROR thiscall is experimental
trait T {
extern "thiscall" fn m(); //~ ERROR thiscall is experimental
extern "thiscall-unwind" fn mu(); //~ ERROR thiscall-unwind ABI is experimental
extern "thiscall" fn dm() {} //~ ERROR thiscall is experimental
extern "thiscall-unwind" fn dmu() {} //~ ERROR thiscall-unwind ABI is experimental
}
struct S;
impl T for S {
extern "thiscall" fn m() {} //~ ERROR thiscall is experimental
extern "thiscall-unwind" fn mu() {} //~ ERROR thiscall-unwind ABI is experimental
}
impl S {
extern "thiscall" fn im() {} //~ ERROR thiscall is experimental
extern "thiscall-unwind" fn imu() {} //~ ERROR thiscall-unwind ABI is experimental
}
type TA = extern "thiscall" fn(); //~ ERROR thiscall is experimental
type TAU = extern "thiscall-unwind" fn(); //~ ERROR thiscall-unwind ABI is experimental
extern "thiscall" {} //~ ERROR thiscall is experimental
extern "thiscall-unwind" {} //~ ERROR thiscall-unwind ABI is experimental
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:12:8
|
LL | extern "thiscall-unwind" fn fu() {}
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:13:8
|
LL | extern "thiscall" fn f() {}
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:16:12
|
LL | extern "thiscall" fn m();
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:17:12
|
LL | extern "thiscall-unwind" fn mu();
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:19:12
|
LL | extern "thiscall" fn dm() {}
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:20:12
|
LL | extern "thiscall-unwind" fn dmu() {}
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:25:12
|
LL | extern "thiscall" fn m() {}
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:26:12
|
LL | extern "thiscall-unwind" fn mu() {}
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:30:12
|
LL | extern "thiscall" fn im() {}
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:31:12
|
LL | extern "thiscall-unwind" fn imu() {}
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:34:18
|
LL | type TA = extern "thiscall" fn();
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:35:19
|
LL | type TAU = extern "thiscall-unwind" fn();
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:37:8
|
LL | extern "thiscall" {}
| ^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error[E0658]: thiscall-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-thiscall.rs:38:8
|
LL | extern "thiscall-unwind" {}
| ^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0658`.
// run-pass
// aux-build:weak-lang-items.rs
// ignore-emscripten no threads support
// pretty-expanded FIXME #23616
extern crate weak_lang_items as other;
use std::thread;
fn main() {
let _ = thread::spawn(move|| {
other::foo()
});
// The goal of the test is just to make sure other::foo() is referenced at link time. Since
// the function panics, to prevent it from running we gate it behind an always-false `if` that
// is not going to be optimized away.
if std::hint::black_box(false) {
other::foo();
}
}
// compile-flags: -Ztrait-solver=next
// ignore-test
trait Trait {
type Gat<'lt>;
}
impl Trait for u8 {
type Gat<'lt> = u8;
}
fn test<T: Trait, F: FnOnce(<T as Trait>::Gat<'_>) -> S + ?Sized, S>() {}
fn main() {
// Proving `dyn FnOnce: FnOnce` requires making sure that all of the supertraits
// of the trait and associated type bounds hold. We check this in
// `predicates_for_object_candidate`, and eagerly replace projections using equality
// which may generalize a type and emit a nested AliasRelate goal. Make sure that
// we don't ICE in that case, and bubble that goal up to the caller.
test::<u8, dyn FnOnce(<u8 as Trait>::Gat<'_>) + 'static, _>();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册