Auto merge of #133287 - matthiaskrgr:rollup-ab9j3pu, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #130236 (unstable feature usage metrics) - #131544 (Make asm label blocks safe context) - #131586 (Support s390x z13 vector ABI) - #132489 (Fix closure arg extraction in `extract_callable_info`, generalize it to async closures) - #133078 (tests: ui/inline-consts: add issue number to a test, rename other tests) - #133283 (Don't exclude relnotes from `needs-triage` label) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
75703c1a78
40 changed files with 1287 additions and 170 deletions
|
@ -3685,6 +3685,8 @@ version = "0.0.0"
|
|||
dependencies = [
|
||||
"rustc_data_structures",
|
||||
"rustc_span",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -209,6 +209,24 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_single_vector_element<C>(self, cx: &C, expected_size: Size) -> bool
|
||||
where
|
||||
Ty: TyAbiInterface<'a, C>,
|
||||
C: HasDataLayout,
|
||||
{
|
||||
match self.backend_repr {
|
||||
BackendRepr::Vector { .. } => self.size == expected_size,
|
||||
BackendRepr::Memory { .. } => {
|
||||
if self.fields.count() == 1 && self.fields.offset(0).bytes() == 0 {
|
||||
self.field(cx, 0).is_single_vector_element(cx, expected_size)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_adt<C>(self) -> bool
|
||||
where
|
||||
Ty: TyAbiInterface<'a, C>,
|
||||
|
|
|
@ -23,3 +23,5 @@ driver_impl_rlink_rustc_version_mismatch = .rlink file was produced by rustc ver
|
|||
driver_impl_rlink_unable_to_read = failed to read rlink file: `{$err}`
|
||||
|
||||
driver_impl_rlink_wrong_file_type = The input does not look like a .rlink file
|
||||
|
||||
driver_impl_unstable_feature_usage = cannot dump feature usage metrics: {$error}
|
||||
|
|
|
@ -51,6 +51,7 @@ use rustc_interface::{Linker, Queries, interface, passes};
|
|||
use rustc_lint::unerased_lint_store;
|
||||
use rustc_metadata::creader::MetadataLoader;
|
||||
use rustc_metadata::locator;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_parse::{new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal};
|
||||
use rustc_session::config::{
|
||||
CG_OPTIONS, ErrorOutputType, Input, OutFileName, OutputType, UnstableOptions, Z_OPTIONS,
|
||||
|
@ -103,7 +104,7 @@ mod signal_handler {
|
|||
|
||||
use crate::session_diagnostics::{
|
||||
RLinkEmptyVersionNumber, RLinkEncodingVersionMismatch, RLinkRustcVersionMismatch,
|
||||
RLinkWrongFileType, RlinkCorruptFile, RlinkNotAFile, RlinkUnableToRead,
|
||||
RLinkWrongFileType, RlinkCorruptFile, RlinkNotAFile, RlinkUnableToRead, UnstableFeatureUsage,
|
||||
};
|
||||
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -431,6 +432,10 @@ fn run_compiler(
|
|||
// Make sure name resolution and macro expansion is run.
|
||||
queries.global_ctxt()?.enter(|tcx| tcx.resolver_for_lowering());
|
||||
|
||||
if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir {
|
||||
queries.global_ctxt()?.enter(|tcxt| dump_feature_usage_metrics(tcxt, metrics_dir));
|
||||
}
|
||||
|
||||
if callbacks.after_expansion(compiler, queries) == Compilation::Stop {
|
||||
return early_exit();
|
||||
}
|
||||
|
@ -475,6 +480,23 @@ fn run_compiler(
|
|||
})
|
||||
}
|
||||
|
||||
fn dump_feature_usage_metrics(tcxt: TyCtxt<'_>, metrics_dir: &PathBuf) {
|
||||
let output_filenames = tcxt.output_filenames(());
|
||||
let mut metrics_file_name = std::ffi::OsString::from("unstable_feature_usage_metrics-");
|
||||
let mut metrics_path = output_filenames.with_directory_and_extension(metrics_dir, "json");
|
||||
let metrics_file_stem =
|
||||
metrics_path.file_name().expect("there should be a valid default output filename");
|
||||
metrics_file_name.push(metrics_file_stem);
|
||||
metrics_path.pop();
|
||||
metrics_path.push(metrics_file_name);
|
||||
if let Err(error) = tcxt.features().dump_feature_usage_metrics(metrics_path) {
|
||||
// FIXME(yaahc): once metrics can be enabled by default we will want "failure to emit
|
||||
// default metrics" to only produce a warning when metrics are enabled by default and emit
|
||||
// an error only when the user manually enables metrics
|
||||
tcxt.dcx().emit_err(UnstableFeatureUsage { error });
|
||||
}
|
||||
}
|
||||
|
||||
// Extract output directory and file from matches.
|
||||
fn make_output(matches: &getopts::Matches) -> (Option<PathBuf>, Option<OutFileName>) {
|
||||
let odir = matches.opt_str("out-dir").map(|o| PathBuf::from(&o));
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::error::Error;
|
||||
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
@ -93,3 +95,9 @@ pub(crate) struct IceFlags {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(driver_impl_ice_exclude_cargo_defaults)]
|
||||
pub(crate) struct IceExcludeCargoDefaults;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(driver_impl_unstable_feature_usage)]
|
||||
pub(crate) struct UnstableFeatureUsage {
|
||||
pub error: Box<dyn Error>,
|
||||
}
|
||||
|
|
|
@ -7,4 +7,6 @@ edition = "2021"
|
|||
# tidy-alphabetical-start
|
||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
serde = { version = "1.0.125", features = [ "derive" ] }
|
||||
serde_json = "1.0.59"
|
||||
# tidy-alphabetical-end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
//! List of the unstable feature gates.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_span::Span;
|
||||
use rustc_span::symbol::{Symbol, sym};
|
||||
|
@ -651,6 +653,54 @@ declare_features! (
|
|||
// -------------------------------------------------------------------------
|
||||
);
|
||||
|
||||
impl Features {
|
||||
pub fn dump_feature_usage_metrics(
|
||||
&self,
|
||||
metrics_path: PathBuf,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
#[derive(serde::Serialize)]
|
||||
struct LibFeature {
|
||||
symbol: String,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct LangFeature {
|
||||
symbol: String,
|
||||
since: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct FeatureUsage {
|
||||
lib_features: Vec<LibFeature>,
|
||||
lang_features: Vec<LangFeature>,
|
||||
}
|
||||
|
||||
let metrics_file = std::fs::File::create(metrics_path)?;
|
||||
let metrics_file = std::io::BufWriter::new(metrics_file);
|
||||
|
||||
let lib_features = self
|
||||
.enabled_lib_features
|
||||
.iter()
|
||||
.map(|EnabledLibFeature { gate_name, .. }| LibFeature { symbol: gate_name.to_string() })
|
||||
.collect();
|
||||
|
||||
let lang_features = self
|
||||
.enabled_lang_features
|
||||
.iter()
|
||||
.map(|EnabledLangFeature { gate_name, stable_since, .. }| LangFeature {
|
||||
symbol: gate_name.to_string(),
|
||||
since: stable_since.map(|since| since.to_string()),
|
||||
})
|
||||
.collect();
|
||||
|
||||
let feature_usage = FeatureUsage { lib_features, lang_features };
|
||||
|
||||
serde_json::to_writer(metrics_file, &feature_usage)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Some features are not allowed to be used together at the same time, if
|
||||
/// the two are present, produce an error.
|
||||
///
|
||||
|
|
|
@ -31,6 +31,7 @@ use rustc_span::symbol::{Ident, kw, sym};
|
|||
use rustc_span::{
|
||||
DUMMY_SP, ErrorGuaranteed, ExpnKind, FileName, MacroKind, Span, Symbol, edit_distance,
|
||||
};
|
||||
use rustc_trait_selection::error_reporting::traits::DefIdOrName;
|
||||
use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedNote;
|
||||
use rustc_trait_selection::infer::InferCtxtExt;
|
||||
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
|
||||
|
@ -45,50 +46,6 @@ use crate::errors::{self, CandidateTraitNote, NoAssociatedItem};
|
|||
use crate::{Expectation, FnCtxt};
|
||||
|
||||
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
fn is_fn_ty(&self, ty: Ty<'tcx>, span: Span) -> bool {
|
||||
let tcx = self.tcx;
|
||||
match ty.kind() {
|
||||
// Not all of these (e.g., unsafe fns) implement `FnOnce`,
|
||||
// so we look for these beforehand.
|
||||
// FIXME(async_closures): These don't impl `FnOnce` by default.
|
||||
ty::Closure(..) | ty::FnDef(..) | ty::FnPtr(..) => true,
|
||||
// If it's not a simple function, look for things which implement `FnOnce`.
|
||||
_ => {
|
||||
let Some(fn_once) = tcx.lang_items().fn_once_trait() else {
|
||||
return false;
|
||||
};
|
||||
|
||||
// This conditional prevents us from asking to call errors and unresolved types.
|
||||
// It might seem that we can use `predicate_must_hold_modulo_regions`,
|
||||
// but since a Dummy binder is used to fill in the FnOnce trait's arguments,
|
||||
// type resolution always gives a "maybe" here.
|
||||
if self.autoderef(span, ty).silence_errors().any(|(ty, _)| {
|
||||
info!("check deref {:?} error", ty);
|
||||
matches!(ty.kind(), ty::Error(_) | ty::Infer(_))
|
||||
}) {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.autoderef(span, ty).silence_errors().any(|(ty, _)| {
|
||||
info!("check deref {:?} impl FnOnce", ty);
|
||||
self.probe(|_| {
|
||||
let trait_ref =
|
||||
ty::TraitRef::new(tcx, fn_once, [ty, self.next_ty_var(span)]);
|
||||
let poly_trait_ref = ty::Binder::dummy(trait_ref);
|
||||
let obligation = Obligation::misc(
|
||||
tcx,
|
||||
span,
|
||||
self.body_id,
|
||||
self.param_env,
|
||||
poly_trait_ref,
|
||||
);
|
||||
self.predicate_may_hold(&obligation)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_slice_ty(&self, ty: Ty<'tcx>, span: Span) -> bool {
|
||||
self.autoderef(span, ty)
|
||||
.silence_errors()
|
||||
|
@ -2367,12 +2324,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
let is_accessible = field.vis.is_accessible_from(scope, tcx);
|
||||
|
||||
if is_accessible {
|
||||
if self.is_fn_ty(field_ty, span) {
|
||||
if let Some((what, _, _)) = self.extract_callable_info(field_ty) {
|
||||
let what = match what {
|
||||
DefIdOrName::DefId(def_id) => self.tcx.def_descr(def_id),
|
||||
DefIdOrName::Name(what) => what,
|
||||
};
|
||||
let expr_span = expr.span.to(item_name.span);
|
||||
err.multipart_suggestion(
|
||||
format!(
|
||||
"to call the function stored in `{item_name}`, \
|
||||
surround the field access with parentheses",
|
||||
"to call the {what} stored in `{item_name}`, \
|
||||
surround the field access with parentheses",
|
||||
),
|
||||
vec![
|
||||
(expr_span.shrink_to_lo(), '('.to_string()),
|
||||
|
|
|
@ -537,8 +537,45 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> {
|
|||
self.requires_unsafe(expr.span, DerefOfRawPointer);
|
||||
}
|
||||
}
|
||||
ExprKind::InlineAsm { .. } => {
|
||||
ExprKind::InlineAsm(box InlineAsmExpr {
|
||||
asm_macro: _,
|
||||
ref operands,
|
||||
template: _,
|
||||
options: _,
|
||||
line_spans: _,
|
||||
}) => {
|
||||
self.requires_unsafe(expr.span, UseOfInlineAssembly);
|
||||
|
||||
// For inline asm, do not use `walk_expr`, since we want to handle the label block
|
||||
// specially.
|
||||
for op in &**operands {
|
||||
use rustc_middle::thir::InlineAsmOperand::*;
|
||||
match op {
|
||||
In { expr, reg: _ }
|
||||
| Out { expr: Some(expr), reg: _, late: _ }
|
||||
| InOut { expr, reg: _, late: _ } => self.visit_expr(&self.thir()[*expr]),
|
||||
SplitInOut { in_expr, out_expr, reg: _, late: _ } => {
|
||||
self.visit_expr(&self.thir()[*in_expr]);
|
||||
if let Some(out_expr) = out_expr {
|
||||
self.visit_expr(&self.thir()[*out_expr]);
|
||||
}
|
||||
}
|
||||
Out { expr: None, reg: _, late: _ }
|
||||
| Const { value: _, span: _ }
|
||||
| SymFn { value: _, span: _ }
|
||||
| SymStatic { def_id: _ } => {}
|
||||
Label { block } => {
|
||||
// Label blocks are safe context.
|
||||
// `asm!()` is forced to be wrapped inside unsafe. If there's no special
|
||||
// treatment, the label blocks would also always be unsafe with no way
|
||||
// of opting out.
|
||||
self.in_safety_context(SafetyContext::Safe, |this| {
|
||||
visit::walk_block(this, &this.thir()[*block])
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
ExprKind::Adt(box AdtExpr {
|
||||
adt_def,
|
||||
|
|
|
@ -1069,7 +1069,7 @@ impl OutputFilenames {
|
|||
self.with_directory_and_extension(&self.out_directory, extension)
|
||||
}
|
||||
|
||||
fn with_directory_and_extension(&self, directory: &PathBuf, extension: &str) -> PathBuf {
|
||||
pub fn with_directory_and_extension(&self, directory: &PathBuf, extension: &str) -> PathBuf {
|
||||
let mut path = directory.join(&self.filestem);
|
||||
path.set_extension(extension);
|
||||
path
|
||||
|
|
|
@ -1887,7 +1887,7 @@ options! {
|
|||
meta_stats: bool = (false, parse_bool, [UNTRACKED],
|
||||
"gather metadata statistics (default: no)"),
|
||||
metrics_dir: Option<PathBuf> = (None, parse_opt_pathbuf, [UNTRACKED],
|
||||
"stores metrics about the errors being emitted by rustc to disk"),
|
||||
"the directory metrics emitted by rustc are dumped into (implicitly enables default set of metrics)"),
|
||||
mir_emit_retag: bool = (false, parse_bool, [TRACKED],
|
||||
"emit Retagging MIR statements, interpreted e.g., by miri; implies -Zmir-opt-level=0 \
|
||||
(default: no)"),
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
// FIXME: The assumes we're using the non-vector ABI, i.e., compiling
|
||||
// for a pre-z13 machine or using -mno-vx.
|
||||
// Reference: ELF Application Binary Interface s390x Supplement
|
||||
// https://github.com/IBM/s390x-abi
|
||||
|
||||
use crate::abi::call::{ArgAbi, FnAbi, Reg};
|
||||
use crate::abi::{HasDataLayout, TyAbiInterface};
|
||||
use crate::abi::call::{ArgAbi, FnAbi, Reg, RegKind};
|
||||
use crate::abi::{BackendRepr, HasDataLayout, TyAbiInterface};
|
||||
use crate::spec::HasTargetSpec;
|
||||
|
||||
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
|
||||
if !ret.layout.is_aggregate() && ret.layout.size.bits() <= 64 {
|
||||
let size = ret.layout.size;
|
||||
if size.bits() <= 128 && matches!(ret.layout.backend_repr, BackendRepr::Vector { .. }) {
|
||||
return;
|
||||
}
|
||||
if !ret.layout.is_aggregate() && size.bits() <= 64 {
|
||||
ret.extend_integer_width_to(64);
|
||||
} else {
|
||||
ret.make_indirect();
|
||||
|
@ -32,19 +36,25 @@ where
|
|||
}
|
||||
return;
|
||||
}
|
||||
if !arg.layout.is_aggregate() && arg.layout.size.bits() <= 64 {
|
||||
|
||||
let size = arg.layout.size;
|
||||
if size.bits() <= 128 && arg.layout.is_single_vector_element(cx, size) {
|
||||
arg.cast_to(Reg { kind: RegKind::Vector, size });
|
||||
return;
|
||||
}
|
||||
if !arg.layout.is_aggregate() && size.bits() <= 64 {
|
||||
arg.extend_integer_width_to(64);
|
||||
return;
|
||||
}
|
||||
|
||||
if arg.layout.is_single_fp_element(cx) {
|
||||
match arg.layout.size.bytes() {
|
||||
match size.bytes() {
|
||||
4 => arg.cast_to(Reg::f32()),
|
||||
8 => arg.cast_to(Reg::f64()),
|
||||
_ => arg.make_indirect(),
|
||||
}
|
||||
} else {
|
||||
match arg.layout.size.bytes() {
|
||||
match size.bytes() {
|
||||
1 => arg.cast_to(Reg::i8()),
|
||||
2 => arg.cast_to(Reg::i16()),
|
||||
4 => arg.cast_to(Reg::i32()),
|
||||
|
|
|
@ -6,9 +6,6 @@ pub(crate) fn target() -> Target {
|
|||
base.endian = Endian::Big;
|
||||
// z10 is the oldest CPU supported by LLVM
|
||||
base.cpu = "z10".into();
|
||||
// FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector
|
||||
// ABI. Pass the -vector feature string to LLVM to respect this assumption.
|
||||
base.features = "-vector".into();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.min_global_align = Some(16);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
|
|
|
@ -6,9 +6,6 @@ pub(crate) fn target() -> Target {
|
|||
base.endian = Endian::Big;
|
||||
// z10 is the oldest CPU supported by LLVM
|
||||
base.cpu = "z10".into();
|
||||
// FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector
|
||||
// ABI. Pass the -vector feature string to LLVM to respect this assumption.
|
||||
base.features = "-vector".into();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.min_global_align = Some(16);
|
||||
base.static_position_independent_executables = true;
|
||||
|
|
|
@ -1075,93 +1075,110 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
) -> Option<(DefIdOrName, Ty<'tcx>, Vec<Ty<'tcx>>)> {
|
||||
// Autoderef is useful here because sometimes we box callables, etc.
|
||||
let Some((def_id_or_name, output, inputs)) =
|
||||
(self.autoderef_steps)(found).into_iter().find_map(|(found, _)| {
|
||||
match *found.kind() {
|
||||
ty::FnPtr(sig_tys, _) => Some((
|
||||
DefIdOrName::Name("function pointer"),
|
||||
sig_tys.output(),
|
||||
sig_tys.inputs(),
|
||||
)),
|
||||
ty::FnDef(def_id, _) => {
|
||||
let fn_sig = found.fn_sig(self.tcx);
|
||||
Some((DefIdOrName::DefId(def_id), fn_sig.output(), fn_sig.inputs()))
|
||||
}
|
||||
ty::Closure(def_id, args) => {
|
||||
let fn_sig = args.as_closure().sig();
|
||||
Some((
|
||||
DefIdOrName::DefId(def_id),
|
||||
fn_sig.output(),
|
||||
fn_sig.inputs().map_bound(|inputs| &inputs[1..]),
|
||||
))
|
||||
}
|
||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => {
|
||||
self.tcx
|
||||
.item_super_predicates(def_id)
|
||||
.instantiate(self.tcx, args)
|
||||
.iter()
|
||||
.find_map(|pred| {
|
||||
if let ty::ClauseKind::Projection(proj) = pred.kind().skip_binder()
|
||||
&& self.tcx.is_lang_item(proj.projection_term.def_id,LangItem::FnOnceOutput)
|
||||
// args tuple will always be args[1]
|
||||
&& let ty::Tuple(args) = proj.projection_term.args.type_at(1).kind()
|
||||
{
|
||||
Some((
|
||||
DefIdOrName::DefId(def_id),
|
||||
pred.kind().rebind(proj.term.expect_type()),
|
||||
pred.kind().rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
ty::Dynamic(data, _, ty::Dyn) => {
|
||||
data.iter().find_map(|pred| {
|
||||
if let ty::ExistentialPredicate::Projection(proj) = pred.skip_binder()
|
||||
(self.autoderef_steps)(found).into_iter().find_map(|(found, _)| match *found.kind() {
|
||||
ty::FnPtr(sig_tys, _) => Some((
|
||||
DefIdOrName::Name("function pointer"),
|
||||
sig_tys.output(),
|
||||
sig_tys.inputs(),
|
||||
)),
|
||||
ty::FnDef(def_id, _) => {
|
||||
let fn_sig = found.fn_sig(self.tcx);
|
||||
Some((DefIdOrName::DefId(def_id), fn_sig.output(), fn_sig.inputs()))
|
||||
}
|
||||
ty::Closure(def_id, args) => {
|
||||
let fn_sig = args.as_closure().sig();
|
||||
Some((
|
||||
DefIdOrName::DefId(def_id),
|
||||
fn_sig.output(),
|
||||
fn_sig.inputs().map_bound(|inputs| inputs[0].tuple_fields().as_slice()),
|
||||
))
|
||||
}
|
||||
ty::CoroutineClosure(def_id, args) => {
|
||||
let sig_parts = args.as_coroutine_closure().coroutine_closure_sig();
|
||||
Some((
|
||||
DefIdOrName::DefId(def_id),
|
||||
sig_parts.map_bound(|sig| {
|
||||
sig.to_coroutine(
|
||||
self.tcx,
|
||||
args.as_coroutine_closure().parent_args(),
|
||||
// Just use infer vars here, since we don't really care
|
||||
// what these types are, just that we're returning a coroutine.
|
||||
self.next_ty_var(DUMMY_SP),
|
||||
self.tcx.coroutine_for_closure(def_id),
|
||||
self.next_ty_var(DUMMY_SP),
|
||||
)
|
||||
}),
|
||||
sig_parts.map_bound(|sig| sig.tupled_inputs_ty.tuple_fields().as_slice()),
|
||||
))
|
||||
}
|
||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => self
|
||||
.tcx
|
||||
.item_super_predicates(def_id)
|
||||
.instantiate(self.tcx, args)
|
||||
.iter()
|
||||
.find_map(|pred| {
|
||||
if let ty::ClauseKind::Projection(proj) = pred.kind().skip_binder()
|
||||
&& self
|
||||
.tcx
|
||||
.is_lang_item(proj.projection_term.def_id, LangItem::FnOnceOutput)
|
||||
// args tuple will always be args[1]
|
||||
&& let ty::Tuple(args) = proj.projection_term.args.type_at(1).kind()
|
||||
{
|
||||
Some((
|
||||
DefIdOrName::DefId(def_id),
|
||||
pred.kind().rebind(proj.term.expect_type()),
|
||||
pred.kind().rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}),
|
||||
ty::Dynamic(data, _, ty::Dyn) => data.iter().find_map(|pred| {
|
||||
if let ty::ExistentialPredicate::Projection(proj) = pred.skip_binder()
|
||||
&& self.tcx.is_lang_item(proj.def_id, LangItem::FnOnceOutput)
|
||||
// for existential projection, args are shifted over by 1
|
||||
&& let ty::Tuple(args) = proj.args.type_at(0).kind()
|
||||
{
|
||||
Some((
|
||||
DefIdOrName::Name("trait object"),
|
||||
pred.rebind(proj.term.expect_type()),
|
||||
pred.rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
{
|
||||
Some((
|
||||
DefIdOrName::Name("trait object"),
|
||||
pred.rebind(proj.term.expect_type()),
|
||||
pred.rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
ty::Param(param) => {
|
||||
let generics = self.tcx.generics_of(body_id);
|
||||
let name = if generics.count() > param.index as usize
|
||||
&& let def = generics.param_at(param.index as usize, self.tcx)
|
||||
&& matches!(def.kind, ty::GenericParamDefKind::Type { .. })
|
||||
&& def.name == param.name
|
||||
}),
|
||||
ty::Param(param) => {
|
||||
let generics = self.tcx.generics_of(body_id);
|
||||
let name = if generics.count() > param.index as usize
|
||||
&& let def = generics.param_at(param.index as usize, self.tcx)
|
||||
&& matches!(def.kind, ty::GenericParamDefKind::Type { .. })
|
||||
&& def.name == param.name
|
||||
{
|
||||
DefIdOrName::DefId(def.def_id)
|
||||
} else {
|
||||
DefIdOrName::Name("type parameter")
|
||||
};
|
||||
param_env.caller_bounds().iter().find_map(|pred| {
|
||||
if let ty::ClauseKind::Projection(proj) = pred.kind().skip_binder()
|
||||
&& self
|
||||
.tcx
|
||||
.is_lang_item(proj.projection_term.def_id, LangItem::FnOnceOutput)
|
||||
&& proj.projection_term.self_ty() == found
|
||||
// args tuple will always be args[1]
|
||||
&& let ty::Tuple(args) = proj.projection_term.args.type_at(1).kind()
|
||||
{
|
||||
DefIdOrName::DefId(def.def_id)
|
||||
Some((
|
||||
name,
|
||||
pred.kind().rebind(proj.term.expect_type()),
|
||||
pred.kind().rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
DefIdOrName::Name("type parameter")
|
||||
};
|
||||
param_env.caller_bounds().iter().find_map(|pred| {
|
||||
if let ty::ClauseKind::Projection(proj) = pred.kind().skip_binder()
|
||||
&& self.tcx.is_lang_item(proj.projection_term.def_id, LangItem::FnOnceOutput)
|
||||
&& proj.projection_term.self_ty() == found
|
||||
// args tuple will always be args[1]
|
||||
&& let ty::Tuple(args) = proj.projection_term.args.type_at(1).kind()
|
||||
{
|
||||
Some((
|
||||
name,
|
||||
pred.kind().rebind(proj.term.expect_type()),
|
||||
pred.kind().rebind(args.as_slice()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
_ => None,
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
else {
|
||||
return None;
|
||||
|
|
|
@ -21,7 +21,9 @@ unsafe {
|
|||
}
|
||||
```
|
||||
|
||||
The block must have unit type or diverge.
|
||||
The block must have unit type or diverge. The block starts a new safety context,
|
||||
so despite outer `unsafe`, you need extra unsafe to perform unsafe operations
|
||||
within `label <block>`.
|
||||
|
||||
When `label <block>` is used together with `noreturn` option, it means that the
|
||||
assembly will not fallthrough. It's allowed to jump to a label within the
|
||||
|
|
322
tests/assembly/s390x-vector-abi.rs
Normal file
322
tests/assembly/s390x-vector-abi.rs
Normal file
|
@ -0,0 +1,322 @@
|
|||
//@ revisions: z10 z10_vector z13 z13_no_vector
|
||||
// ignore-tidy-linelength
|
||||
//@ assembly-output: emit-asm
|
||||
//@ compile-flags: -O -Z merge-functions=disabled
|
||||
//@[z10] compile-flags: --target s390x-unknown-linux-gnu --cfg no_vector
|
||||
//@[z10] needs-llvm-components: systemz
|
||||
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector
|
||||
//@[z10_vector] needs-llvm-components: systemz
|
||||
//@[z13] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13
|
||||
//@[z13] needs-llvm-components: systemz
|
||||
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector --cfg no_vector
|
||||
//@[z13_no_vector] needs-llvm-components: systemz
|
||||
|
||||
#![feature(no_core, lang_items, repr_simd, s390x_target_feature)]
|
||||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Cases where vector feature is disabled are rejected.
|
||||
// See tests/ui/simd-abi-checks-s390x.rs for test for them.
|
||||
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
#[lang = "freeze"]
|
||||
pub trait Freeze {}
|
||||
|
||||
impl<T: Copy, const N: usize> Copy for [T; N] {}
|
||||
|
||||
#[lang = "phantom_data"]
|
||||
pub struct PhantomData<T: ?Sized>;
|
||||
impl<T: ?Sized> Copy for PhantomData<T> {}
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct i8x8([i8; 8]);
|
||||
#[repr(simd)]
|
||||
pub struct i8x16([i8; 16]);
|
||||
#[repr(simd)]
|
||||
pub struct i8x32([i8; 32]);
|
||||
#[repr(C)]
|
||||
pub struct Wrapper<T>(T);
|
||||
#[repr(C, align(16))]
|
||||
pub struct WrapperAlign16<T>(T);
|
||||
#[repr(C)]
|
||||
pub struct WrapperWithZst<T>(T, PhantomData<()>);
|
||||
#[repr(transparent)]
|
||||
pub struct TransparentWrapper<T>(T);
|
||||
|
||||
impl Copy for i8 {}
|
||||
impl Copy for i64 {}
|
||||
impl Copy for i8x8 {}
|
||||
impl Copy for i8x16 {}
|
||||
impl Copy for i8x32 {}
|
||||
impl<T: Copy> Copy for Wrapper<T> {}
|
||||
impl<T: Copy> Copy for WrapperAlign16<T> {}
|
||||
impl<T: Copy> Copy for WrapperWithZst<T> {}
|
||||
impl<T: Copy> Copy for TransparentWrapper<T> {}
|
||||
|
||||
// CHECK-LABEL: vector_ret_small:
|
||||
// CHECK: vlrepg %v24, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_ret:
|
||||
// CHECK: vl %v24, 0(%r2), 3
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_ret_large:
|
||||
// z10: vl %v0, 16(%r3), 4
|
||||
// z10-NEXT: vl %v1, 0(%r3), 4
|
||||
// z10-NEXT: vst %v0, 16(%r2), 4
|
||||
// z10-NEXT: vst %v1, 0(%r2), 4
|
||||
// z10-NEXT: br %r14
|
||||
// z13: vl %v0, 0(%r3), 4
|
||||
// z13-NEXT: vl %v1, 16(%r3), 4
|
||||
// z13-NEXT: vst %v1, 16(%r2), 4
|
||||
// z13-NEXT: vst %v0, 0(%r2), 4
|
||||
// z13-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 {
|
||||
*x
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_wrapper_ret_small:
|
||||
// CHECK: mvc 0(8,%r2), 0(%r3)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_ret_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_ret:
|
||||
// CHECK: mvc 0(16,%r2), 0(%r3)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_ret(x: &Wrapper<i8x16>) -> Wrapper<i8x16> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_ret_large:
|
||||
// z10: vl %v0, 16(%r3), 4
|
||||
// z10-NEXT: vl %v1, 0(%r3), 4
|
||||
// z10-NEXT: vst %v0, 16(%r2), 4
|
||||
// z10-NEXT: vst %v1, 0(%r2), 4
|
||||
// z10-NEXT: br %r14
|
||||
// z13: vl %v0, 16(%r3), 4
|
||||
// z13-NEXT: vst %v0, 16(%r2), 4
|
||||
// z13-NEXT: vl %v0, 0(%r3), 4
|
||||
// z13-NEXT: vst %v0, 0(%r2), 4
|
||||
// z13-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_ret_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> {
|
||||
*x
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_wrapper_padding_ret:
|
||||
// CHECK: mvc 0(16,%r2), 0(%r3)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_padding_ret(x: &WrapperAlign16<i8x8>) -> WrapperAlign16<i8x8> {
|
||||
*x
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_ret_small:
|
||||
// CHECK: mvc 0(8,%r2), 0(%r3)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_ret_small(
|
||||
x: &WrapperWithZst<i8x8>,
|
||||
) -> WrapperWithZst<i8x8> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_ret:
|
||||
// CHECK: mvc 0(16,%r2), 0(%r3)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_ret(
|
||||
x: &WrapperWithZst<i8x16>,
|
||||
) -> WrapperWithZst<i8x16> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_ret_large:
|
||||
// z10: vl %v0, 16(%r3), 4
|
||||
// z10-NEXT: vl %v1, 0(%r3), 4
|
||||
// z10-NEXT: vst %v0, 16(%r2), 4
|
||||
// z10-NEXT: vst %v1, 0(%r2), 4
|
||||
// z10-NEXT: br %r14
|
||||
// z13: vl %v0, 16(%r3), 4
|
||||
// z13-NEXT: vst %v0, 16(%r2), 4
|
||||
// z13-NEXT: vl %v0, 0(%r3), 4
|
||||
// z13-NEXT: vst %v0, 0(%r2), 4
|
||||
// z13-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_ret_large(
|
||||
x: &WrapperWithZst<i8x32>,
|
||||
) -> WrapperWithZst<i8x32> {
|
||||
*x
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_transparent_wrapper_ret_small:
|
||||
// CHECK: vlrepg %v24, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_ret_small(
|
||||
x: &TransparentWrapper<i8x8>,
|
||||
) -> TransparentWrapper<i8x8> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_transparent_wrapper_ret:
|
||||
// CHECK: vl %v24, 0(%r2), 3
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_ret(
|
||||
x: &TransparentWrapper<i8x16>,
|
||||
) -> TransparentWrapper<i8x16> {
|
||||
*x
|
||||
}
|
||||
// CHECK-LABEL: vector_transparent_wrapper_ret_large:
|
||||
// z10: vl %v0, 16(%r3), 4
|
||||
// z10-NEXT: vl %v1, 0(%r3), 4
|
||||
// z10-NEXT: vst %v0, 16(%r2), 4
|
||||
// z10-NEXT: vst %v1, 0(%r2), 4
|
||||
// z10-NEXT: br %r14
|
||||
// z13: vl %v0, 0(%r3), 4
|
||||
// z13-NEXT: vl %v1, 16(%r3), 4
|
||||
// z13-NEXT: vst %v1, 16(%r2), 4
|
||||
// z13-NEXT: vst %v0, 0(%r2), 4
|
||||
// z13-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_ret_large(
|
||||
x: &TransparentWrapper<i8x32>,
|
||||
) -> TransparentWrapper<i8x32> {
|
||||
*x
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_arg_small:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_arg_small(x: i8x8) -> i64 {
|
||||
unsafe { *(&x as *const i8x8 as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_arg:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_arg(x: i8x16) -> i64 {
|
||||
unsafe { *(&x as *const i8x16 as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_arg_large:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_arg_large(x: i8x32) -> i64 {
|
||||
unsafe { *(&x as *const i8x32 as *const i64) }
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_wrapper_arg_small:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
|
||||
unsafe { *(&x as *const Wrapper<i8x8> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_arg:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
|
||||
unsafe { *(&x as *const Wrapper<i8x16> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_arg_large:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_arg_large(x: Wrapper<i8x32>) -> i64 {
|
||||
unsafe { *(&x as *const Wrapper<i8x32> as *const i64) }
|
||||
}
|
||||
|
||||
// https://github.com/rust-lang/rust/pull/131586#discussion_r1837071121
|
||||
// CHECK-LABEL: vector_wrapper_padding_arg:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_padding_arg(x: WrapperAlign16<i8x8>) -> i64 {
|
||||
unsafe { *(&x as *const WrapperAlign16<i8x8> as *const i64) }
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_arg_small:
|
||||
// CHECK: .cfi_startproc
|
||||
// CHECK-NOT: vlgvg
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_arg_small(x: WrapperWithZst<i8x8>) -> i64 {
|
||||
unsafe { *(&x as *const WrapperWithZst<i8x8> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_arg:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_arg(x: WrapperWithZst<i8x16>) -> i64 {
|
||||
unsafe { *(&x as *const WrapperWithZst<i8x16> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_wrapper_with_zst_arg_large:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_wrapper_with_zst_arg_large(x: WrapperWithZst<i8x32>) -> i64 {
|
||||
unsafe { *(&x as *const WrapperWithZst<i8x32> as *const i64) }
|
||||
}
|
||||
|
||||
// CHECK-LABEL: vector_transparent_wrapper_arg_small:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x8> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_transparent_wrapper_arg:
|
||||
// CHECK: vlgvg %r2, %v24, 0
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x16> as *const i64) }
|
||||
}
|
||||
// CHECK-LABEL: vector_transparent_wrapper_arg_large:
|
||||
// CHECK: lg %r2, 0(%r2)
|
||||
// CHECK-NEXT: br %r14
|
||||
#[cfg_attr(no_vector, target_feature(enable = "vector"))]
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper<i8x32>) -> i64 {
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x32> as *const i64) }
|
||||
}
|
9
tests/run-make/unstable-feature-usage-metrics/lib.rs
Normal file
9
tests/run-make/unstable-feature-usage-metrics/lib.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#![feature(ascii_char)] // random lib feature
|
||||
#![feature(box_patterns)] // random lang feature
|
||||
|
||||
// picked arbitrary unstable features, just need a random lib and lang feature, ideally ones that
|
||||
// won't be stabilized any time soon so we don't have to update this test
|
||||
|
||||
fn main() {
|
||||
println!("foobar");
|
||||
}
|
87
tests/run-make/unstable-feature-usage-metrics/rmake.rs
Normal file
87
tests/run-make/unstable-feature-usage-metrics/rmake.rs
Normal file
|
@ -0,0 +1,87 @@
|
|||
//! This test checks if unstable feature usage metric dump files `unstable-feature-usage*.json` work
|
||||
//! as expected.
|
||||
//!
|
||||
//! - Basic sanity checks on a default ICE dump.
|
||||
//!
|
||||
//! See <https://github.com/rust-lang/rust/issues/129485>.
|
||||
//!
|
||||
//! # Test history
|
||||
//!
|
||||
//! - forked from dump-ice-to-disk test, which has flakeyness issues on i686-mingw, I'm assuming
|
||||
//! those will be present in this test as well on the same platform
|
||||
|
||||
//@ ignore-windows
|
||||
//FIXME(#128911): still flakey on i686-mingw.
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use run_make_support::rfs::create_dir_all;
|
||||
use run_make_support::{
|
||||
cwd, filename_contains, has_extension, rfs, run_in_tmpdir, rustc, serde_json,
|
||||
shallow_find_files,
|
||||
};
|
||||
|
||||
fn find_feature_usage_metrics<P: AsRef<Path>>(dir: P) -> Vec<PathBuf> {
|
||||
shallow_find_files(dir, |path| {
|
||||
if filename_contains(path, "unstable_feature_usage") && has_extension(path, "json") {
|
||||
true
|
||||
} else {
|
||||
dbg!(path);
|
||||
false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test_metrics_dump();
|
||||
test_metrics_errors();
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn test_metrics_dump() {
|
||||
run_in_tmpdir(|| {
|
||||
let metrics_dir = cwd().join("metrics");
|
||||
create_dir_all(&metrics_dir);
|
||||
rustc()
|
||||
.input("lib.rs")
|
||||
.env("RUST_BACKTRACE", "short")
|
||||
.arg(format!("-Zmetrics-dir={}", metrics_dir.display()))
|
||||
.run();
|
||||
let mut metrics = find_feature_usage_metrics(&metrics_dir);
|
||||
let json_path =
|
||||
metrics.pop().expect("there should be one metrics file in the output directory");
|
||||
|
||||
// After the `pop` above, there should be no files left.
|
||||
assert!(
|
||||
metrics.is_empty(),
|
||||
"there should be no more than one metrics file in the output directory"
|
||||
);
|
||||
|
||||
let message = rfs::read_to_string(json_path);
|
||||
let parsed: serde_json::Value =
|
||||
serde_json::from_str(&message).expect("metrics should be dumped as json");
|
||||
let expected = serde_json::json!(
|
||||
{
|
||||
"lib_features":[{"symbol":"ascii_char"}],
|
||||
"lang_features":[{"symbol":"box_patterns","since":null}]
|
||||
}
|
||||
);
|
||||
|
||||
assert_eq!(expected, parsed);
|
||||
});
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn test_metrics_errors() {
|
||||
run_in_tmpdir(|| {
|
||||
rustc()
|
||||
.input("lib.rs")
|
||||
.env("RUST_BACKTRACE", "short")
|
||||
.arg("-Zmetrics-dir=invaliddirectorythatdefinitelydoesntexist")
|
||||
.run_fail()
|
||||
.assert_stderr_contains(
|
||||
"error: cannot dump feature usage metrics: No such file or directory",
|
||||
)
|
||||
.assert_stdout_not_contains("internal compiler error");
|
||||
});
|
||||
}
|
23
tests/ui/asm/x86_64/goto-block-safe.rs
Normal file
23
tests/ui/asm/x86_64/goto-block-safe.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
//@ only-x86_64
|
||||
//@ needs-asm-support
|
||||
|
||||
#![deny(unreachable_code)]
|
||||
#![feature(asm_goto)]
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
fn goto_fallthough() {
|
||||
unsafe {
|
||||
asm!(
|
||||
"/* {} */",
|
||||
label {
|
||||
core::hint::unreachable_unchecked();
|
||||
//~^ ERROR [E0133]
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
goto_fallthough();
|
||||
}
|
14
tests/ui/asm/x86_64/goto-block-safe.stderr
Normal file
14
tests/ui/asm/x86_64/goto-block-safe.stderr
Normal file
|
@ -0,0 +1,14 @@
|
|||
error[E0133]: call to unsafe function `unreachable_unchecked` is unsafe and requires unsafe function or block
|
||||
--> $DIR/goto-block-safe.rs:14:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ items do not inherit unsafety from separate enclosing items
|
||||
...
|
||||
LL | core::hint::unreachable_unchecked();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
||||
|
|
||||
= note: consult the function's documentation for information on how to avoid undefined behavior
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0133`.
|
7
tests/ui/closures/correct-args-on-call-suggestion.rs
Normal file
7
tests/ui/closures/correct-args-on-call-suggestion.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Ensure we give the right args when we suggest calling a closure.
|
||||
|
||||
fn main() {
|
||||
let x = |a: i32, b: i32| a + b;
|
||||
let y: i32 = x;
|
||||
//~^ ERROR mismatched types
|
||||
}
|
20
tests/ui/closures/correct-args-on-call-suggestion.stderr
Normal file
20
tests/ui/closures/correct-args-on-call-suggestion.stderr
Normal file
|
@ -0,0 +1,20 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/correct-args-on-call-suggestion.rs:5:18
|
||||
|
|
||||
LL | let x = |a: i32, b: i32| a + b;
|
||||
| ---------------- the found closure
|
||||
LL | let y: i32 = x;
|
||||
| --- ^ expected `i32`, found closure
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found closure `{closure@$DIR/correct-args-on-call-suggestion.rs:4:13: 4:29}`
|
||||
help: use parentheses to call this closure
|
||||
|
|
||||
LL | let y: i32 = x(/* i32 */, /* i32 */);
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -7,7 +7,7 @@ LL | struct Obj<F> where F: FnMut() -> u32 {
|
|||
LL | o.closure();
|
||||
| ^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `closure`, surround the field access with parentheses
|
||||
help: to call the closure stored in `closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (o.closure)();
|
||||
| + +
|
||||
|
|
|
@ -7,7 +7,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
|
|||
LL | o_closure.closure();
|
||||
| ^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `closure`, surround the field access with parentheses
|
||||
help: to call the closure stored in `closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (o_closure.closure)();
|
||||
| + +
|
||||
|
@ -46,7 +46,7 @@ LL | struct BoxedObj {
|
|||
LL | boxed_fn.boxed_closure();
|
||||
| ^^^^^^^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
||||
help: to call the trait object stored in `boxed_closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (boxed_fn.boxed_closure)();
|
||||
| + +
|
||||
|
@ -60,7 +60,7 @@ LL | struct BoxedObj {
|
|||
LL | boxed_closure.boxed_closure();
|
||||
| ^^^^^^^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
||||
help: to call the trait object stored in `boxed_closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (boxed_closure.boxed_closure)();
|
||||
| + +
|
||||
|
@ -99,7 +99,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
|
|||
LL | check_expression().closure();
|
||||
| ^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `closure`, surround the field access with parentheses
|
||||
help: to call the trait object stored in `closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (check_expression().closure)();
|
||||
| + +
|
||||
|
@ -113,7 +113,7 @@ LL | struct FuncContainer {
|
|||
LL | (*self.container).f1(1);
|
||||
| ^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `f1`, surround the field access with parentheses
|
||||
help: to call the function pointer stored in `f1`, surround the field access with parentheses
|
||||
|
|
||||
LL | ((*self.container).f1)(1);
|
||||
| + +
|
||||
|
@ -127,7 +127,7 @@ LL | struct FuncContainer {
|
|||
LL | (*self.container).f2(1);
|
||||
| ^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `f2`, surround the field access with parentheses
|
||||
help: to call the function pointer stored in `f2`, surround the field access with parentheses
|
||||
|
|
||||
LL | ((*self.container).f2)(1);
|
||||
| + +
|
||||
|
@ -141,7 +141,7 @@ LL | struct FuncContainer {
|
|||
LL | (*self.container).f3(1);
|
||||
| ^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `f3`, surround the field access with parentheses
|
||||
help: to call the function pointer stored in `f3`, surround the field access with parentheses
|
||||
|
|
||||
LL | ((*self.container).f3)(1);
|
||||
| + +
|
||||
|
|
|
@ -7,7 +7,7 @@ LL | struct Example {
|
|||
LL | demo.example(1);
|
||||
| ^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `example`, surround the field access with parentheses
|
||||
help: to call the trait object stored in `example`, surround the field access with parentheses
|
||||
|
|
||||
LL | (demo.example)(1);
|
||||
| + +
|
||||
|
|
|
@ -4,7 +4,7 @@ error[E0599]: no method named `closure` found for reference `&Obj<{closure@$DIR/
|
|||
LL | p.closure();
|
||||
| ^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `closure`, surround the field access with parentheses
|
||||
help: to call the closure stored in `closure`, surround the field access with parentheses
|
||||
|
|
||||
LL | (p.closure)();
|
||||
| + +
|
||||
|
@ -19,7 +19,7 @@ error[E0599]: no method named `fn_ptr` found for reference `&&Obj<{closure@$DIR/
|
|||
LL | q.fn_ptr();
|
||||
| ^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `fn_ptr`, surround the field access with parentheses
|
||||
help: to call the function pointer stored in `fn_ptr`, surround the field access with parentheses
|
||||
|
|
||||
LL | (q.fn_ptr)();
|
||||
| + +
|
||||
|
@ -30,7 +30,7 @@ error[E0599]: no method named `c_fn_ptr` found for reference `&D` in the current
|
|||
LL | s.c_fn_ptr();
|
||||
| ^^^^^^^^ field, not a method
|
||||
|
|
||||
help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses
|
||||
help: to call the function pointer stored in `c_fn_ptr`, surround the field access with parentheses
|
||||
|
|
||||
LL | (s.c_fn_ptr)();
|
||||
| + +
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0767]: use of unreachable label `'a`
|
||||
--> $DIR/cross_const_control_flow.rs:9:25
|
||||
--> $DIR/cross-const-control-flow-125846.rs:9:25
|
||||
|
|
||||
LL | 'a: { const { break 'a } }
|
||||
| -- ^^ unreachable label `'a`
|
||||
|
@ -9,7 +9,7 @@ LL | 'a: { const { break 'a } }
|
|||
= note: labels are unreachable through functions, closures, async blocks and modules
|
||||
|
||||
error[E0767]: use of unreachable label `'a`
|
||||
--> $DIR/cross_const_control_flow.rs:22:28
|
||||
--> $DIR/cross-const-control-flow-125846.rs:22:28
|
||||
|
|
||||
LL | 'a: { const { continue 'a } }
|
||||
| -- ^^ unreachable label `'a`
|
||||
|
@ -19,7 +19,7 @@ LL | 'a: { const { continue 'a } }
|
|||
= note: labels are unreachable through functions, closures, async blocks and modules
|
||||
|
||||
error[E0435]: attempt to use a non-constant value in a constant
|
||||
--> $DIR/cross_const_control_flow.rs:41:14
|
||||
--> $DIR/cross-const-control-flow-125846.rs:41:14
|
||||
|
|
||||
LL | const { &x };
|
||||
| ^ non-constant value
|
||||
|
@ -30,7 +30,7 @@ LL | const x: /* Type */ = 1;
|
|||
| ~~~~~ ++++++++++++
|
||||
|
||||
error[E0728]: `await` is only allowed inside `async` functions and blocks
|
||||
--> $DIR/cross_const_control_flow.rs:35:22
|
||||
--> $DIR/cross-const-control-flow-125846.rs:35:22
|
||||
|
|
||||
LL | const { async {}.await }
|
||||
| -----------^^^^^--
|
||||
|
@ -39,31 +39,31 @@ LL | const { async {}.await }
|
|||
| this is not `async`
|
||||
|
||||
error[E0268]: `break` outside of a loop or labeled block
|
||||
--> $DIR/cross_const_control_flow.rs:9:19
|
||||
--> $DIR/cross-const-control-flow-125846.rs:9:19
|
||||
|
|
||||
LL | 'a: { const { break 'a } }
|
||||
| ^^^^^^^^ cannot `break` outside of a loop or labeled block
|
||||
|
||||
error[E0268]: `break` outside of a loop or labeled block
|
||||
--> $DIR/cross_const_control_flow.rs:16:17
|
||||
--> $DIR/cross-const-control-flow-125846.rs:16:17
|
||||
|
|
||||
LL | const { break }
|
||||
| ^^^^^ cannot `break` outside of a loop or labeled block
|
||||
|
||||
error[E0268]: `continue` outside of a loop
|
||||
--> $DIR/cross_const_control_flow.rs:22:19
|
||||
--> $DIR/cross-const-control-flow-125846.rs:22:19
|
||||
|
|
||||
LL | 'a: { const { continue 'a } }
|
||||
| ^^^^^^^^^^^ cannot `continue` outside of a loop
|
||||
|
||||
error[E0268]: `continue` outside of a loop
|
||||
--> $DIR/cross_const_control_flow.rs:29:17
|
||||
--> $DIR/cross-const-control-flow-125846.rs:29:17
|
||||
|
|
||||
LL | const { continue }
|
||||
| ^^^^^^^^ cannot `continue` outside of a loop
|
||||
|
||||
error[E0572]: return statement outside of function body
|
||||
--> $DIR/cross_const_control_flow.rs:4:13
|
||||
--> $DIR/cross-const-control-flow-125846.rs:4:13
|
||||
|
|
||||
LL | / fn foo() {
|
||||
LL | | const { return }
|
|
@ -1,5 +1,5 @@
|
|||
error[E0435]: attempt to use a non-constant value in a constant
|
||||
--> $DIR/referencing_local_variables.rs:2:13
|
||||
--> $DIR/referencing-local-variables.rs:2:13
|
||||
|
|
||||
LL | const fn test_me<T>(a: usize) -> usize {
|
||||
| - this would need to be a `const`
|
|
@ -1,5 +1,5 @@
|
|||
error[E0381]: used binding `x` isn't initialized
|
||||
--> $DIR/uninit_local.rs:4:15
|
||||
--> $DIR/uninit-local.rs:4:15
|
||||
|
|
||||
LL | let x: bool;
|
||||
| - binding declared here but left uninitialized
|
174
tests/ui/simd-abi-checks-s390x.rs
Normal file
174
tests/ui/simd-abi-checks-s390x.rs
Normal file
|
@ -0,0 +1,174 @@
|
|||
//@ revisions: z10 z13_no_vector z13_soft_float
|
||||
//@ build-fail
|
||||
//@[z10] compile-flags: --target s390x-unknown-linux-gnu
|
||||
//@[z10] needs-llvm-components: systemz
|
||||
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector
|
||||
//@[z13_no_vector] needs-llvm-components: systemz
|
||||
// FIXME: +soft-float itself doesn't set -vector
|
||||
//@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float
|
||||
//@[z13_soft_float] needs-llvm-components: systemz
|
||||
|
||||
#![feature(no_core, lang_items, repr_simd, s390x_target_feature)]
|
||||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
#![allow(non_camel_case_types, improper_ctypes_definitions)]
|
||||
#![deny(abi_unsupported_vector_types)]
|
||||
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
#[lang = "freeze"]
|
||||
pub trait Freeze {}
|
||||
|
||||
impl<T: Copy, const N: usize> Copy for [T; N] {}
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct i8x8([i8; 8]);
|
||||
#[repr(simd)]
|
||||
pub struct i8x16([i8; 16]);
|
||||
#[repr(simd)]
|
||||
pub struct i8x32([i8; 32]);
|
||||
#[repr(C)]
|
||||
pub struct Wrapper<T>(T);
|
||||
#[repr(transparent)]
|
||||
pub struct TransparentWrapper<T>(T);
|
||||
|
||||
impl Copy for i8 {}
|
||||
impl Copy for i64 {}
|
||||
impl Copy for i8x8 {}
|
||||
impl Copy for i8x16 {}
|
||||
impl Copy for i8x32 {}
|
||||
impl<T: Copy> Copy for Wrapper<T> {}
|
||||
impl<T: Copy> Copy for TransparentWrapper<T> {}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[target_feature(enable = "vector")]
|
||||
unsafe extern "C" fn vector_ret_target_feature_small(x: &i8x8) -> i8x8 {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
#[target_feature(enable = "vector")]
|
||||
unsafe extern "C" fn vector_target_feature_ret(x: &i8x16) -> i8x16 {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
#[target_feature(enable = "vector")]
|
||||
unsafe extern "C" fn vector_ret_target_feature_large(x: &i8x32) -> i8x32 {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_ret_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_ret(x: &Wrapper<i8x16>) -> Wrapper<i8x16> {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_ret_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_ret_small(
|
||||
x: &TransparentWrapper<i8x8>,
|
||||
) -> TransparentWrapper<i8x8> {
|
||||
//~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^^^ WARN this was previously accepted
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_ret(
|
||||
x: &TransparentWrapper<i8x16>,
|
||||
) -> TransparentWrapper<i8x16> {
|
||||
//~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^^^ WARN this was previously accepted
|
||||
*x
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_ret_large(
|
||||
x: &TransparentWrapper<i8x32>,
|
||||
) -> TransparentWrapper<i8x32> {
|
||||
// Ok
|
||||
*x
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_arg_small(x: i8x8) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const i8x8 as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_arg(x: i8x16) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const i8x16 as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_arg_large(x: i8x32) -> i64 {
|
||||
// Ok
|
||||
unsafe { *(&x as *const i8x32 as *const i64) }
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const Wrapper<i8x8> as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const Wrapper<i8x16> as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_wrapper_arg_large(x: Wrapper<i8x32>) -> i64 {
|
||||
// Ok
|
||||
unsafe { *(&x as *const Wrapper<i8x32> as *const i64) }
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x8> as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
|
||||
//~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
//~^^ WARN this was previously accepted
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x16> as *const i64) }
|
||||
}
|
||||
#[no_mangle]
|
||||
extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper<i8x32>) -> i64 {
|
||||
// Ok
|
||||
unsafe { *(&x as *const TransparentWrapper<i8x32> as *const i64) }
|
||||
}
|
111
tests/ui/simd-abi-checks-s390x.z10.stderr
Normal file
111
tests/ui/simd-abi-checks-s390x.z10.stderr
Normal file
|
@ -0,0 +1,111 @@
|
|||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:46:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
note: the lint level is defined here
|
||||
--> $DIR/simd-abi-checks-s390x.rs:15:9
|
||||
|
|
||||
LL | #![deny(abi_unsupported_vector_types)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:52:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:99:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
|
||||
LL | | x: &TransparentWrapper<i8x8>,
|
||||
LL | | ) -> TransparentWrapper<i8x8> {
|
||||
| |_____________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:107:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret(
|
||||
LL | | x: &TransparentWrapper<i8x16>,
|
||||
LL | | ) -> TransparentWrapper<i8x16> {
|
||||
| |______________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:123:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:129:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:141:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:147:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:159:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:165:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
111
tests/ui/simd-abi-checks-s390x.z13_no_vector.stderr
Normal file
111
tests/ui/simd-abi-checks-s390x.z13_no_vector.stderr
Normal file
|
@ -0,0 +1,111 @@
|
|||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:46:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
note: the lint level is defined here
|
||||
--> $DIR/simd-abi-checks-s390x.rs:15:9
|
||||
|
|
||||
LL | #![deny(abi_unsupported_vector_types)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:52:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:99:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
|
||||
LL | | x: &TransparentWrapper<i8x8>,
|
||||
LL | | ) -> TransparentWrapper<i8x8> {
|
||||
| |_____________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:107:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret(
|
||||
LL | | x: &TransparentWrapper<i8x16>,
|
||||
LL | | ) -> TransparentWrapper<i8x16> {
|
||||
| |______________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:123:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:129:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:141:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:147:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:159:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:165:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
111
tests/ui/simd-abi-checks-s390x.z13_soft_float.stderr
Normal file
111
tests/ui/simd-abi-checks-s390x.z13_soft_float.stderr
Normal file
|
@ -0,0 +1,111 @@
|
|||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:46:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
note: the lint level is defined here
|
||||
--> $DIR/simd-abi-checks-s390x.rs:15:9
|
||||
|
|
||||
LL | #![deny(abi_unsupported_vector_types)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:52:1
|
||||
|
|
||||
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:99:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
|
||||
LL | | x: &TransparentWrapper<i8x8>,
|
||||
LL | | ) -> TransparentWrapper<i8x8> {
|
||||
| |_____________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:107:1
|
||||
|
|
||||
LL | / extern "C" fn vector_transparent_wrapper_ret(
|
||||
LL | | x: &TransparentWrapper<i8x16>,
|
||||
LL | | ) -> TransparentWrapper<i8x16> {
|
||||
| |______________________________^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:123:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:129:1
|
||||
|
|
||||
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:141:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:147:1
|
||||
|
|
||||
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:159:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled
|
||||
--> $DIR/simd-abi-checks-s390x.rs:165:1
|
||||
|
|
||||
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
||||
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
|
@ -31,6 +31,10 @@ note: required by a bound in `bar`
|
|||
|
|
||||
LL | fn bar(f: impl Future<Output=()>) {}
|
||||
| ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
|
||||
help: use parentheses to call this closure
|
||||
|
|
||||
LL | bar(async_closure());
|
||||
| ++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
@ -451,7 +451,6 @@ new_issue = true
|
|||
exclude_labels = [
|
||||
"C-tracking-issue",
|
||||
"A-diagnostics",
|
||||
"relnotes-tracking-issue",
|
||||
]
|
||||
|
||||
[autolabel."WG-trait-system-refactor"]
|
||||
|
|
Loading…
Add table
Reference in a new issue