Auto merge of #99451 - Dylan-DPC:rollup-ceghu18, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #97183 (wf-check generators)
 - #98320 (Mention first and last macro in backtrace)
 - #99335 (Use split_once in FromStr docs)
 - #99347 (Use `LocalDefId` in `OpaqueTypeKey`)
 - #99392 (Fix debuginfo tests.)
 - #99404 (Use span_bug for unexpected field projection type)
 - #99410 (Update invalid atomic ordering lint)
 - #99434 (Fix `Skip::next` for non-fused inner iterators)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-07-19 08:32:32 +00:00
commit 4603ac31b0
114 changed files with 395 additions and 513 deletions

View File

@ -1,7 +1,7 @@
//! The entry point of the NLL borrow checker.
use rustc_data_structures::vec_map::VecMap;
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::LocalDefId;
use rustc_index::vec::IndexVec;
use rustc_infer::infer::InferCtxt;
use rustc_middle::mir::{create_dump_file, dump_enabled, dump_mir, PassWhere};
@ -44,7 +44,7 @@ pub type PoloniusOutput = Output<RustcFacts>;
/// closure requirements to propagate, and any generated errors.
pub(crate) struct NllOutput<'tcx> {
pub regioncx: RegionInferenceContext<'tcx>,
pub opaque_type_values: VecMap<DefId, OpaqueHiddenType<'tcx>>,
pub opaque_type_values: VecMap<LocalDefId, OpaqueHiddenType<'tcx>>,
pub polonius_input: Option<Box<AllFacts>>,
pub polonius_output: Option<Rc<PoloniusOutput>>,
pub opt_closure_req: Option<ClosureRegionRequirements<'tcx>>,
@ -373,7 +373,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(
body: &Body<'tcx>,
regioncx: &RegionInferenceContext<'tcx>,
closure_region_requirements: &Option<ClosureRegionRequirements<'_>>,
opaque_type_values: &VecMap<DefId, OpaqueHiddenType<'tcx>>,
opaque_type_values: &VecMap<LocalDefId, OpaqueHiddenType<'tcx>>,
errors: &mut crate::error::BorrowckErrors<'tcx>,
) {
let tcx = infcx.tcx;

View File

@ -1,6 +1,6 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::vec_map::VecMap;
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::OpaqueTyOrigin;
use rustc_infer::infer::error_reporting::unexpected_hidden_region_diagnostic;
use rustc_infer::infer::InferCtxt;
@ -63,8 +63,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
&self,
infcx: &InferCtxt<'_, 'tcx>,
opaque_ty_decls: VecMap<OpaqueTypeKey<'tcx>, (OpaqueHiddenType<'tcx>, OpaqueTyOrigin)>,
) -> VecMap<DefId, OpaqueHiddenType<'tcx>> {
let mut result: VecMap<DefId, OpaqueHiddenType<'tcx>> = VecMap::new();
) -> VecMap<LocalDefId, OpaqueHiddenType<'tcx>> {
let mut result: VecMap<LocalDefId, OpaqueHiddenType<'tcx>> = VecMap::new();
for (opaque_type_key, (concrete_type, origin)) in opaque_ty_decls {
let substs = opaque_type_key.substs;
debug!(?concrete_type, ?substs);
@ -235,7 +235,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// lifetimes with 'static and remapping only those used in the
// `impl Trait` return type, resulting in the parameters
// shifting.
let id_substs = InternalSubsts::identity_for_item(self.tcx, def_id);
let id_substs = InternalSubsts::identity_for_item(self.tcx, def_id.to_def_id());
debug!(?id_substs);
let map: FxHashMap<GenericArg<'tcx>, GenericArg<'tcx>> =
substs.iter().enumerate().map(|(index, subst)| (subst, id_substs[index])).collect();
@ -268,7 +268,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// This logic duplicates most of `check_opaque_meets_bounds`.
// FIXME(oli-obk): Also do region checks here and then consider removing `check_opaque_meets_bounds` entirely.
let param_env = self.tcx.param_env(def_id);
let body_id = self.tcx.local_def_id_to_hir_id(def_id.as_local().unwrap());
let body_id = self.tcx.local_def_id_to_hir_id(def_id);
self.tcx.infer_ctxt().enter(move |infcx| {
// Require the hidden type to be well-formed with only the generics of the opaque type.
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
@ -296,7 +296,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
infcx
.report_mismatched_types(
&ObligationCause::misc(instantiated_ty.span, body_id),
self.tcx.mk_opaque(def_id, id_substs),
self.tcx.mk_opaque(def_id.to_def_id(), id_substs),
definition_ty,
err,
)
@ -423,7 +423,7 @@ fn check_opaque_type_parameter_valid(
struct ReverseMapper<'tcx> {
tcx: TyCtxt<'tcx>,
opaque_type_def_id: DefId,
opaque_type_def_id: LocalDefId,
map: FxHashMap<GenericArg<'tcx>, GenericArg<'tcx>>,
map_missing_regions_to_empty: bool,
@ -437,7 +437,7 @@ struct ReverseMapper<'tcx> {
impl<'tcx> ReverseMapper<'tcx> {
fn new(
tcx: TyCtxt<'tcx>,
opaque_type_def_id: DefId,
opaque_type_def_id: LocalDefId,
map: FxHashMap<GenericArg<'tcx>, GenericArg<'tcx>>,
hidden_ty: Ty<'tcx>,
span: Span,

View File

@ -247,11 +247,6 @@ lint-atomic-ordering-invalid = `{$method}`'s failure ordering may not be `Releas
.label = invalid failure ordering
.help = consider using `Acquire` or `Relaxed` failure ordering instead
lint-atomic-ordering-invalid-fail-success = `{$method}`'s success ordering must be at least as strong as its failure ordering
.fail-label = `{$fail_ordering}` failure ordering
.success-label = `{$success_ordering}` success ordering
.suggestion = consider using `{$success_suggestion}` success ordering instead
lint-unused-op = unused {$op} that must be used
.label = the {$op} produces a value
.suggestion = use `let _ = ...` to ignore the resulting value

View File

@ -399,11 +399,11 @@ pub trait Emitter {
) {
// Check for spans in macros, before `fix_multispans_in_extern_macros`
// has a chance to replace them.
let has_macro_spans = iter::once(&*span)
let has_macro_spans: Vec<_> = iter::once(&*span)
.chain(children.iter().map(|child| &child.span))
.flat_map(|span| span.primary_spans())
.flat_map(|sp| sp.macro_backtrace())
.find_map(|expn_data| {
.filter_map(|expn_data| {
match expn_data.kind {
ExpnKind::Root => None,
@ -413,7 +413,8 @@ pub trait Emitter {
ExpnKind::Macro(macro_kind, name) => Some((macro_kind, name)),
}
});
})
.collect();
if !backtrace {
self.fix_multispans_in_extern_macros(source_map, span, children);
@ -422,11 +423,22 @@ pub trait Emitter {
self.render_multispans_macro_backtrace(span, children, backtrace);
if !backtrace {
if let Some((macro_kind, name)) = has_macro_spans {
let descr = macro_kind.descr();
if let Some((macro_kind, name)) = has_macro_spans.first() {
// Mark the actual macro this originates from
let and_then = if let Some((macro_kind, last_name)) = has_macro_spans.last()
&& last_name != name
{
let descr = macro_kind.descr();
format!(
" which comes from the expansion of the {descr} `{last_name}`",
)
} else {
"".to_string()
};
let descr = macro_kind.descr();
let msg = format!(
"this {level} originates in the {descr} `{name}` \
"this {level} originates in the {descr} `{name}`{and_then} \
(in Nightly builds, run with -Z macro-backtrace for more info)",
);

View File

@ -6,6 +6,7 @@
#![feature(drain_filter)]
#![feature(backtrace)]
#![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)]
#![feature(never_type)]
#![feature(adt_const_params)]

View File

@ -153,7 +153,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
.opaque_type_storage
.take_opaque_types()
.into_iter()
.map(|(k, v)| (self.tcx.mk_opaque(k.def_id, k.substs), v.hidden_type.ty))
.map(|(k, v)| (self.tcx.mk_opaque(k.def_id.to_def_id(), k.substs), v.hidden_type.ty))
.collect()
}

View File

@ -938,7 +938,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
#[instrument(skip(self), level = "debug")]
pub fn member_constraint(
&self,
opaque_type_def_id: DefId,
opaque_type_def_id: LocalDefId,
definition_span: Span,
hidden_ty: Ty<'tcx>,
region: ty::Region<'tcx>,

View File

@ -51,7 +51,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
return InferOk { value: ty, obligations: vec![] };
}
let mut obligations = vec![];
let replace_opaque_type = |def_id| self.opaque_type_origin(def_id, span).is_some();
let replace_opaque_type = |def_id: DefId| {
def_id
.as_local()
.map_or(false, |def_id| self.opaque_type_origin(def_id, span).is_some())
};
let value = ty.fold_with(&mut ty::fold::BottomUpFolder {
tcx: self.tcx,
lt_op: |lt| lt,
@ -96,6 +100,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
let (a, b) = if a_is_expected { (a, b) } else { (b, a) };
let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() {
ty::Opaque(def_id, substs) if def_id.is_local() => {
let def_id = def_id.expect_local();
let origin = if self.defining_use_anchor.is_some() {
// Check that this is `impl Trait` type is
// declared by `parent_def_id` -- i.e., one whose
@ -141,7 +146,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
// no one encounters it in practice.
// It does occur however in `fn fut() -> impl Future<Output = i32> { async { 42 } }`,
// where it is of no concern, so we only check for TAITs.
if let Some(OpaqueTyOrigin::TyAlias) = self.opaque_type_origin(did2, cause.span)
if let Some(OpaqueTyOrigin::TyAlias) =
did2.as_local().and_then(|did2| self.opaque_type_origin(did2, cause.span))
{
self.tcx
.sess
@ -399,8 +405,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
#[instrument(skip(self), level = "trace")]
pub fn opaque_type_origin(&self, opaque_def_id: DefId, span: Span) -> Option<OpaqueTyOrigin> {
let def_id = opaque_def_id.as_local()?;
pub fn opaque_type_origin(&self, def_id: LocalDefId, span: Span) -> Option<OpaqueTyOrigin> {
let opaque_hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
let parent_def_id = self.defining_use_anchor?;
let item_kind = &self.tcx.hir().expect_item(def_id).kind;
@ -409,7 +414,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
span_bug!(
span,
"weird opaque type: {:#?}, {:#?}",
opaque_def_id,
def_id,
item_kind
)
};
@ -428,12 +433,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
#[instrument(skip(self), level = "trace")]
fn opaque_ty_origin_unchecked(&self, opaque_def_id: DefId, span: Span) -> OpaqueTyOrigin {
let def_id = opaque_def_id.as_local().unwrap();
fn opaque_ty_origin_unchecked(&self, def_id: LocalDefId, span: Span) -> OpaqueTyOrigin {
let origin = match self.tcx.hir().expect_item(def_id).kind {
hir::ItemKind::OpaqueTy(hir::OpaqueTy { origin, .. }) => origin,
ref itemkind => {
span_bug!(span, "weird opaque type: {:?}, {:#?}", opaque_def_id, itemkind)
span_bug!(span, "weird opaque type: {:?}, {:#?}", def_id, itemkind)
}
};
trace!(?origin);
@ -557,7 +561,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
obligations = self.at(&cause, param_env).eq(prev, hidden_ty)?.obligations;
}
let item_bounds = tcx.bound_explicit_item_bounds(def_id);
let item_bounds = tcx.bound_explicit_item_bounds(def_id.to_def_id());
for predicate in item_bounds.transpose_iter().map(|e| e.map_bound(|(p, _)| *p)) {
debug!(?predicate);
@ -579,7 +583,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
// Replace all other mentions of the same opaque type with the hidden type,
// as the bounds must hold on the hidden type after all.
ty::Opaque(def_id2, substs2) if def_id == def_id2 && substs == substs2 => {
ty::Opaque(def_id2, substs2)
if def_id.to_def_id() == def_id2 && substs == substs2 =>
{
hidden_ty
}
_ => ty,

View File

@ -12,7 +12,7 @@ use rustc_data_structures::intern::Interned;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::undo_log::UndoLogs;
use rustc_data_structures::unify as ut;
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::LocalDefId;
use rustc_index::vec::IndexVec;
use rustc_middle::infer::unify_key::{RegionVidKey, UnifiedRegion};
use rustc_middle::ty::ReStatic;
@ -533,7 +533,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
pub fn member_constraint(
&mut self,
opaque_type_def_id: DefId,
opaque_type_def_id: LocalDefId,
definition_span: Span,
hidden_ty: Ty<'tcx>,
member_region: ty::Region<'tcx>,

View File

@ -1434,10 +1434,6 @@ declare_lint! {
/// - Passing `Ordering::Release` or `Ordering::AcqRel` as the failure
/// ordering for any of `AtomicType::compare_exchange`,
/// `AtomicType::compare_exchange_weak`, or `AtomicType::fetch_update`.
///
/// - Passing in a pair of orderings to `AtomicType::compare_exchange`,
/// `AtomicType::compare_exchange_weak`, or `AtomicType::fetch_update`
/// where the failure ordering is stronger than the success ordering.
INVALID_ATOMIC_ORDERING,
Deny,
"usage of invalid atomic ordering in atomic operations and memory fences"
@ -1544,9 +1540,9 @@ impl InvalidAtomicOrdering {
let Some((method, args)) = Self::inherent_atomic_method_call(cx, expr, &[sym::fetch_update, sym::compare_exchange, sym::compare_exchange_weak])
else {return };
let (success_order_arg, fail_order_arg) = match method {
sym::fetch_update => (&args[1], &args[2]),
sym::compare_exchange | sym::compare_exchange_weak => (&args[3], &args[4]),
let fail_order_arg = match method {
sym::fetch_update => &args[2],
sym::compare_exchange | sym::compare_exchange_weak => &args[4],
_ => return,
};
@ -1568,37 +1564,6 @@ impl InvalidAtomicOrdering {
InvalidAtomicOrderingDiag { method, fail_order_arg_span: fail_order_arg.span },
);
}
let Some(success_ordering) = Self::match_ordering(cx, success_order_arg) else { return };
if matches!(
(success_ordering, fail_ordering),
(sym::Relaxed | sym::Release, sym::Acquire)
| (sym::Relaxed | sym::Release | sym::Acquire | sym::AcqRel, sym::SeqCst)
) {
let success_suggestion =
if success_ordering == sym::Release && fail_ordering == sym::Acquire {
sym::AcqRel
} else {
fail_ordering
};
cx.struct_span_lint(INVALID_ATOMIC_ORDERING, success_order_arg.span, |diag| {
diag.build(fluent::lint::atomic_ordering_invalid_fail_success)
.set_arg("method", method)
.set_arg("fail_ordering", fail_ordering)
.set_arg("success_ordering", success_ordering)
.set_arg("success_suggestion", success_suggestion)
.span_label(fail_order_arg.span, fluent::lint::fail_label)
.span_label(success_order_arg.span, fluent::lint::success_label)
.span_suggestion_short(
success_order_arg.span,
fluent::lint::suggestion,
format!("std::sync::atomic::Ordering::{success_suggestion}"),
Applicability::MaybeIncorrect,
)
.emit();
});
}
}
}

View File

@ -4,7 +4,7 @@ pub mod unify_key;
use crate::ty::Region;
use crate::ty::Ty;
use rustc_data_structures::sync::Lrc;
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::LocalDefId;
use rustc_span::Span;
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
@ -16,7 +16,7 @@ use rustc_span::Span;
#[derive(Debug, Clone, HashStable, TypeFoldable, TypeVisitable, Lift)]
pub struct MemberConstraint<'tcx> {
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
pub opaque_type_def_id: DefId,
pub opaque_type_def_id: LocalDefId,
/// The span where the hidden type was instantiated.
pub definition_span: Span,

View File

@ -235,7 +235,7 @@ pub struct BorrowCheckResult<'tcx> {
/// All the opaque types that are restricted to concrete types
/// by this function. Unlike the value in `TypeckResults`, this has
/// unerased regions.
pub concrete_opaque_types: VecMap<DefId, OpaqueHiddenType<'tcx>>,
pub concrete_opaque_types: VecMap<LocalDefId, OpaqueHiddenType<'tcx>>,
pub closure_requirements: Option<ClosureRegionRequirements<'tcx>>,
pub used_mut_upvars: SmallVec<[Field; 8]>,
pub tainted_by_errors: Option<ErrorGuaranteed>,

View File

@ -182,7 +182,11 @@ impl<'tcx> CapturedPlace<'tcx> {
.unwrap();
}
ty => {
bug!("Unexpected type {:?} for `Field` projection", ty)
span_bug!(
self.get_capture_kind_span(tcx),
"Unexpected type {:?} for `Field` projection",
ty
)
}
},

View File

@ -542,7 +542,7 @@ pub struct TypeckResults<'tcx> {
/// even if they are only set in dead code (which doesn't show up in MIR).
/// For type-alias-impl-trait, this map is only used to prevent query cycles,
/// so the hidden types are all `None`.
pub concrete_opaque_types: VecMap<DefId, Option<Ty<'tcx>>>,
pub concrete_opaque_types: VecMap<LocalDefId, Option<Ty<'tcx>>>,
/// Tracks the minimum captures required for a closure;
/// see `MinCaptureInformationMap` for more details.

View File

@ -1108,8 +1108,7 @@ impl<'tcx> InstantiatedPredicates<'tcx> {
#[derive(Copy, Clone, Debug, PartialEq, Eq, HashStable, TyEncodable, TyDecodable, Lift)]
#[derive(TypeFoldable, TypeVisitable)]
pub struct OpaqueTypeKey<'tcx> {
// FIXME(oli-obk): make this a LocalDefId
pub def_id: DefId,
pub def_id: LocalDefId,
pub substs: SubstsRef<'tcx>,
}

View File

@ -1707,13 +1707,6 @@ impl<'tcx> Ty<'tcx> {
}
}
pub fn expect_opaque_type(self) -> ty::OpaqueTypeKey<'tcx> {
match *self.kind() {
Opaque(def_id, substs) => ty::OpaqueTypeKey { def_id, substs },
_ => bug!("`expect_opaque_type` called on non-opaque type: {}", self),
}
}
pub fn simd_size_and_type(self, tcx: TyCtxt<'tcx>) -> (u64, Ty<'tcx>) {
match self.kind() {
Adt(def, substs) => {

View File

@ -295,6 +295,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
/// This is called much less often than `needs_process_obligation`, so we
/// never inline it.
#[inline(never)]
#[instrument(level = "debug", skip(self, pending_obligation))]
fn process_obligation(
&mut self,
pending_obligation: &mut PendingPredicateObligation<'tcx>,
@ -303,7 +304,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
let obligation = &mut pending_obligation.obligation;
debug!(?obligation, "process_obligation pre-resolve");
debug!(?obligation, "pre-resolve");
if obligation.predicate.has_infer_types_or_consts() {
obligation.predicate =
@ -312,8 +313,6 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
let obligation = &pending_obligation.obligation;
debug!(?obligation, ?obligation.cause, "process_obligation");
let infcx = self.selcx.infcx();
if obligation.predicate.has_projections() {

View File

@ -559,7 +559,7 @@ impl<'tcx> WfPredicates<'tcx> {
}
}
ty::Generator(..) => {
ty::Generator(did, substs, ..) => {
// Walk ALL the types in the generator: this will
// include the upvar types as well as the yield
// type. Note that this is mildly distinct from
@ -567,6 +567,8 @@ impl<'tcx> WfPredicates<'tcx> {
// about the signature of the closure. We don't
// have the problem of implied bounds here since
// generators don't take arguments.
let obligations = self.nominal_obligations(did, substs);
self.out.extend(obligations);
}
ty::Closure(did, substs) => {
@ -618,11 +620,9 @@ impl<'tcx> WfPredicates<'tcx> {
}
ty::Opaque(did, substs) => {
// all of the requirements on type parameters
// should've been checked by the instantiation
// of whatever returned this exact `impl Trait`.
// for named opaque `impl Trait` types we still need to check them
// All of the requirements on type parameters
// have already been checked for `impl Trait` in
// return position. We do need to check type-alias-impl-trait though.
if ty::is_impl_trait_defn(self.tcx, did).is_none() {
let obligations = self.nominal_obligations(did, substs);
self.out.extend(obligations);
@ -684,6 +684,7 @@ impl<'tcx> WfPredicates<'tcx> {
}
}
#[instrument(level = "debug", skip(self))]
fn nominal_obligations(
&mut self,
def_id: DefId,
@ -698,6 +699,7 @@ impl<'tcx> WfPredicates<'tcx> {
}
let predicates = predicates.instantiate(self.tcx, substs);
trace!("{:#?}", predicates);
debug_assert_eq!(predicates.predicates.len(), origins.len());
iter::zip(iter::zip(predicates.predicates, predicates.spans), origins.into_iter().rev())

View File

@ -1513,7 +1513,7 @@ pub fn check_type_bounds<'tcx>(
value.hidden_type.span,
tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local()),
),
tcx.mk_opaque(key.def_id, key.substs),
tcx.mk_opaque(key.def_id.to_def_id(), key.substs),
value.hidden_type.ty,
TypeError::Mismatch,
)

View File

@ -763,12 +763,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// src/test/ui/impl-trait/hidden-type-is-opaque-2.rs for examples that hit this path.
if formal_ret.has_infer_types() {
for ty in ret_ty.walk() {
if let ty::subst::GenericArgKind::Type(ty) = ty.unpack() {
if let ty::Opaque(def_id, _) = *ty.kind() {
if self.infcx.opaque_type_origin(def_id, DUMMY_SP).is_some() {
return None;
}
}
if let ty::subst::GenericArgKind::Type(ty) = ty.unpack()
&& let ty::Opaque(def_id, _) = *ty.kind()
&& let Some(def_id) = def_id.as_local()
&& self.infcx.opaque_type_origin(def_id, DUMMY_SP).is_some() {
return None;
}
}
}

View File

@ -4,6 +4,7 @@
use crate::check::FnCtxt;
use hir::def_id::LocalDefId;
use rustc_data_structures::stable_map::FxHashMap;
use rustc_errors::ErrorGuaranteed;
use rustc_hir as hir;
@ -509,13 +510,13 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
hir::OpaqueTyOrigin::FnReturn(_) | hir::OpaqueTyOrigin::AsyncFn(_) => {
let ty = self.resolve(decl.hidden_type.ty, &decl.hidden_type.span);
struct RecursionChecker {
def_id: DefId,
def_id: LocalDefId,
}
impl<'tcx> ty::TypeVisitor<'tcx> for RecursionChecker {
type BreakTy = ();
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if let ty::Opaque(def_id, _) = *t.kind() {
if def_id == self.def_id {
if def_id == self.def_id.to_def_id() {
return ControlFlow::Break(());
}
}

View File

@ -342,7 +342,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
let concrete_ty = tcx
.mir_borrowck(owner)
.concrete_opaque_types
.get(&def_id.to_def_id())
.get(&def_id)
.copied()
.map(|concrete| concrete.ty)
.unwrap_or_else(|| {
@ -353,7 +353,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
// the `concrete_opaque_types` table.
tcx.ty_error()
} else {
table.concrete_opaque_types.get(&def_id.to_def_id()).copied().unwrap_or_else(|| {
table.concrete_opaque_types.get(&def_id).copied().unwrap_or_else(|| {
// We failed to resolve the opaque type or it
// resolves to itself. We interpret this as the
// no values of the hidden type ever being constructed,
@ -526,7 +526,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
tcx: TyCtxt<'tcx>,
/// def_id of the opaque type whose defining uses are being checked
def_id: DefId,
def_id: LocalDefId,
/// as we walk the defining uses, we are checking that all of them
/// define the same hidden type. This variable is set to `Some`
@ -602,7 +602,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
fn visit_item(&mut self, it: &'tcx Item<'tcx>) {
trace!(?it.def_id);
// The opaque type itself or its children are not within its reveal scope.
if it.def_id.to_def_id() != self.def_id {
if it.def_id != self.def_id {
self.check(it.def_id);
intravisit::walk_item(self, it);
}
@ -610,7 +610,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
fn visit_impl_item(&mut self, it: &'tcx ImplItem<'tcx>) {
trace!(?it.def_id);
// The opaque type itself or its children are not within its reveal scope.
if it.def_id.to_def_id() != self.def_id {
if it.def_id != self.def_id {
self.check(it.def_id);
intravisit::walk_impl_item(self, it);
}
@ -624,7 +624,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
let scope = tcx.hir().get_defining_scope(hir_id);
let mut locator = ConstraintLocator { def_id: def_id.to_def_id(), tcx, found: None };
let mut locator = ConstraintLocator { def_id: def_id, tcx, found: None };
debug!(?scope);

View File

@ -33,7 +33,7 @@ where
#[inline]
fn next(&mut self) -> Option<I::Item> {
if unlikely(self.n > 0) {
self.iter.nth(crate::mem::take(&mut self.n) - 1);
self.iter.nth(crate::mem::take(&mut self.n) - 1)?;
}
self.iter.next()
}

View File

@ -519,12 +519,14 @@ unsafe impl const SliceIndex<str> for ops::RangeToInclusive<usize> {
/// type Err = ParseIntError;
///
/// fn from_str(s: &str) -> Result<Self, Self::Err> {
/// let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' )
/// .split(',')
/// .collect();
/// let (x, y) = s
/// .strip_prefix('(')
/// .and_then(|s| s.strip_suffix(')'))
/// .and_then(|s| s.split_once(','))
/// .unwrap();
///
/// let x_fromstr = coords[0].parse::<i32>()?;
/// let y_fromstr = coords[1].parse::<i32>()?;
/// let x_fromstr = x.parse::<i32>()?;
/// let y_fromstr = y.parse::<i32>()?;
///
/// Ok(Point { x: x_fromstr, y: y_fromstr })
/// }

View File

@ -1,5 +1,7 @@
use core::iter::*;
use super::Unfuse;
#[test]
fn test_iterator_skip() {
let xs = [0, 1, 2, 3, 5, 13, 15, 16, 17, 19, 20, 30];
@ -190,3 +192,12 @@ fn test_skip_nth_back() {
it.by_ref().skip(2).nth_back(10);
assert_eq!(it.next_back(), Some(&1));
}
#[test]
fn test_skip_non_fused() {
let non_fused = Unfuse::new(0..10);
// `Skip` would previously exhaust the iterator in this `next` call and then erroneously try to
// advance it further. `Unfuse` tests that this doesn't happen by panicking in that scenario.
let _ = non_fused.skip(20).next();
}

View File

@ -14,7 +14,7 @@
// gdbr-command:print I
// gdb-check:$2 = -1
// gdbg-command:print 'basic_types_globals::C'
// gdbr-command:print C
// gdbr-command:print/d C
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97
// gdbg-command:print/d 'basic_types_globals::I8'

View File

@ -13,7 +13,7 @@
// gdbr-command:print I
// gdb-check:$2 = -1
// gdbg-command:print 'basic_types_globals::C'
// gdbr-command:print C
// gdbr-command:print/d C
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97
// gdbg-command:print/d 'basic_types_globals::I8'

View File

@ -9,7 +9,7 @@ LL | println!("{}", false && { i = 5; true });
LL | println!("{}", i);
| ^ `i` used here but it is possibly-uninitialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | let x: isize;
LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | let x: isize;
LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -9,7 +9,7 @@ LL | println!("{}", false || { i = 5; true });
LL | println!("{}", i);
| ^ `i` used here but it is possibly-uninitialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -9,7 +9,7 @@ LL | while cond {
LL | println!("{}", v);
| ^ `v` used here but it is possibly-uninitialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | loop { x = break; }
LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0381]: used binding `x` isn't initialized
--> $DIR/issue-24267-flow-exit.rs:18:20
@ -18,7 +18,7 @@ LL | for _ in 0..10 { x = continue; }
LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors

View File

@ -5,7 +5,7 @@ LL | static settings_dir: String = format!("");
| ^^^^^^^^^^^
|
= help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: cannot call non-const fn `format` in statics
--> $DIR/issue-64453.rs:4:31

View File

@ -10,7 +10,7 @@ LL | panic!()
| the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:12:5
| inside `f::<[closure@$DIR/issue-81899.rs:4:31: 4:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: any use of this value will cause an error
--> $DIR/issue-81899.rs:4:23

View File

@ -10,7 +10,7 @@ LL | panic!()
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:11:5
| inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: any use of this value will cause an error
--> $DIR/issue-88434-minimal-example.rs:3:21

View File

@ -10,7 +10,7 @@ LL | panic!()
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:11:5
| inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: any use of this value will cause an error
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:23

View File

@ -12,7 +12,7 @@ LL | let a = $c;
LL | sss!();
| ------ in this macro invocation
|
= note: this error originates in the macro `aaa` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `aaa` which comes from the expansion of the macro `sss` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -82,7 +82,7 @@ LL | println!("{}", arr[3]);
LL | c();
| - mutable borrow later used here
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0502]: cannot borrow `arr` as immutable because it is also borrowed as mutable
--> $DIR/arrays.rs:73:24

View File

@ -26,7 +26,7 @@ LL |
LL | c();
| - mutable borrow later used here
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
--> $DIR/box.rs:55:5

View File

@ -9,7 +9,7 @@ LL | println!("{}", foo.x);
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
@ -25,5 +25,5 @@ LL | println!("{}", foo.x);
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -14,7 +14,7 @@ LL |
LL | c();
| - mutable borrow later used here
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error: requires at least a format string argument
LL | format!();
| ^^^^^^^^^
|
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `,`, found `1`
--> $DIR/bad-format-args.rs:3:16

View File

@ -14,7 +14,7 @@ note: this function takes ownership of the receiver `self`, which moves `some_ve
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -26,7 +26,7 @@ LL | println!("{}", FOO);
|
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error; 2 warnings emitted
@ -60,5 +60,5 @@ LL | #![warn(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | const Z: () = std::panic!("cheese");
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic.rs:6:15
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:9:16
@ -12,7 +12,7 @@ error[E0080]: evaluation of constant value failed
LL | const Z2: () = std::panic!();
| ^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic.rs:9:16
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:12:15
@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
LL | const Y: () = std::unreachable!();
| ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:12:15
|
= note: this error originates in the macro `$crate::panic::unreachable_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:15:15
@ -36,7 +36,7 @@ error[E0080]: evaluation of constant value failed
LL | const W: () = std::panic!(MSG);
| ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:18:15
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:21:16
@ -44,7 +44,7 @@ error[E0080]: evaluation of constant value failed
LL | const W2: () = std::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:21:16
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:24:20
@ -52,7 +52,7 @@ error[E0080]: evaluation of constant value failed
LL | const Z_CORE: () = core::panic!("cheese");
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic.rs:24:20
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:27:21
@ -60,7 +60,7 @@ error[E0080]: evaluation of constant value failed
LL | const Z2_CORE: () = core::panic!();
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic.rs:27:21
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:30:20
@ -68,7 +68,7 @@ error[E0080]: evaluation of constant value failed
LL | const Y_CORE: () = core::unreachable!();
| ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:30:20
|
= note: this error originates in the macro `$crate::panic::unreachable_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:33:20
@ -84,7 +84,7 @@ error[E0080]: evaluation of constant value failed
LL | const W_CORE: () = core::panic!(MSG);
| ^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:36:20
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic.rs:39:21
@ -92,7 +92,7 @@ error[E0080]: evaluation of constant value failed
LL | const W2_CORE: () = core::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:39:21
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 12 previous errors

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | const A: () = std::panic!("blåhaj");
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'blåhaj', $DIR/const_panic_2021.rs:6:15
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:9:15
@ -12,7 +12,7 @@ error[E0080]: evaluation of constant value failed
LL | const B: () = std::panic!();
| ^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:9:15
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:12:15
@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
LL | const C: () = std::unreachable!();
| ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:12:15
|
= note: this error originates in the macro `$crate::panic::unreachable_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:15:15
@ -36,7 +36,7 @@ error[E0080]: evaluation of constant value failed
LL | const E: () = std::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic_2021.rs:18:15
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:21:20
@ -44,7 +44,7 @@ error[E0080]: evaluation of constant value failed
LL | const A_CORE: () = core::panic!("shark");
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'shark', $DIR/const_panic_2021.rs:21:20
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:24:20
@ -52,7 +52,7 @@ error[E0080]: evaluation of constant value failed
LL | const B_CORE: () = core::panic!();
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:24:20
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:27:20
@ -60,7 +60,7 @@ error[E0080]: evaluation of constant value failed
LL | const C_CORE: () = core::unreachable!();
| ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:27:20
|
= note: this error originates in the macro `$crate::panic::unreachable_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_2021.rs:30:20
@ -76,7 +76,7 @@ error[E0080]: evaluation of constant value failed
LL | const E_CORE: () = core::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic_2021.rs:33:20
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 10 previous errors

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | const Z: () = panic!("cheese");
| ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_bin.rs:8:15
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_libcore_bin.rs:11:15
@ -12,7 +12,7 @@ error[E0080]: evaluation of constant value failed
LL | const Y: () = unreachable!();
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_bin.rs:11:15
|
= note: this error originates in the macro `$crate::panic::unreachable_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/const_panic_libcore_bin.rs:14:15

View File

@ -5,7 +5,7 @@ LL | panic!("{:?}", 0);
| ^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: cannot call non-const formatting macro in constant functions
--> $DIR/format.rs:11:22
@ -14,7 +14,7 @@ LL | println!("{:?}", 0);
| ^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `Arguments::<'a>::new_v1` is not yet stable as a const fn
--> $DIR/format.rs:11:5
@ -23,7 +23,7 @@ LL | println!("{:?}", 0);
| ^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: cannot call non-const fn `_print` in constant functions
--> $DIR/format.rs:11:5
@ -52,7 +52,7 @@ LL | panic!("{:?}", 0);
|
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: erroneous constant used
--> $DIR/format.rs:11:14
@ -71,7 +71,7 @@ LL | println!("{:?}", 0);
|
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors
@ -97,7 +97,7 @@ LL | panic!("{:?}", 0);
= note: `#[deny(const_err)]` on by default
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
error: erroneous constant used
@ -120,5 +120,5 @@ LL | println!("{:?}", 0);
= note: `#[deny(const_err)]` on by default
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -35,7 +35,7 @@ LL | println!("{} {}", X, Y);
|
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/issue-43197.rs:16:26
@ -51,7 +51,7 @@ LL | println!("{} {}", X, Y);
|
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors; 4 warnings emitted
@ -100,7 +100,7 @@ LL | #![warn(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
warning: erroneous constant used
@ -116,5 +116,5 @@ LL | #![warn(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -36,5 +36,5 @@ LL | #![allow(const_err)]
| ^^^^^^^^^
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,7 +4,7 @@ error: argument to `panic!()` in a const context must have type `&str`
LL | panic!(123);
| ^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | const VOID: ! = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:10:21
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: erroneous constant used
--> $DIR/panic-assoc-never-type.rs:15:13

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | const VOID: ! = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:5:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -10,7 +10,7 @@ LL | panic!()
LL | const _: () = foo();
| ----- inside `_` at $DIR/unwind-abort.rs:7:15
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -25,7 +25,7 @@ LL | called_in_const.call_once(arg)
LL | const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA;
| ------------------ inside `f32::MASKED_NAN1` at $DIR/const-float-bits-reject-conv.rs:27:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/num/f32.rs:LL:COL
@ -54,7 +54,7 @@ LL | called_in_const.call_once(arg)
LL | const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555;
| ------------------ inside `f32::MASKED_NAN2` at $DIR/const-float-bits-reject-conv.rs:28:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: any use of this value will cause an error
--> $DIR/const-float-bits-reject-conv.rs:30:34
@ -132,7 +132,7 @@ LL | called_in_const.call_once(arg)
LL | const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA;
| ------------------ inside `f64::MASKED_NAN1` at $DIR/const-float-bits-reject-conv.rs:54:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/num/f64.rs:LL:COL
@ -161,7 +161,7 @@ LL | called_in_const.call_once(arg)
LL | const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555;
| ------------------ inside `f64::MASKED_NAN2` at $DIR/const-float-bits-reject-conv.rs:55:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: any use of this value will cause an error
--> $DIR/const-float-bits-reject-conv.rs:57:34

View File

@ -4,7 +4,7 @@ error[E0080]: could not evaluate static initializer
LL | static S : u64 = { { panic!("foo"); 0 } };
| ^^^^^^^^^^^^^ the evaluated program panicked at 'foo', $DIR/issue-32829.rs:1:22
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error: argument to `panic!()` in a const context must have type `&str`
LL | let _ = [0i32; panic!(2f32)];
| ^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation of constant value failed
--> $DIR/issue-66693-panic-in-array-len.rs:10:21
@ -12,7 +12,7 @@ error[E0080]: evaluation of constant value failed
LL | let _ = [false; panic!()];
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-66693-panic-in-array-len.rs:10:21
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error: argument to `panic!()` in a const context must have type `&str`
LL | const _: () = panic!(1);
| ^^^^^^^^^
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:7:19
@ -12,7 +12,7 @@ error: argument to `panic!()` in a const context must have type `&str`
LL | static _FOO: () = panic!(true);
| ^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:11:5
@ -20,7 +20,7 @@ error: argument to `panic!()` in a const context must have type `&str`
LL | panic!(&1);
| ^^^^^^^^^^
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: erroneous constant used
--> $DIR/issue-66693.rs:11:12

View File

@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
LL | struct Bug([u8; panic!("panic")]);
| ^^^^^^^^^^^^^^^ the evaluated program panicked at 'panic', $DIR/issue-76064.rs:1:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error: 1 positional argument in format string, but no arguments were given
LL | myprintln!("{}");
| ^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `concat` which comes from the expansion of the macro `myprintln` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -27,7 +27,7 @@ LL | | });
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `foo` which comes from the expansion of the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `if let` pattern
--> $DIR/if-let.rs:26:8

View File

@ -308,7 +308,7 @@ note: associated function defined here
|
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
| ^^^^^^^^^^
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/ifmt-bad-arg.rs:81:35
@ -326,7 +326,7 @@ note: associated function defined here
|
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
| ^^^^^^^^^^
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 36 previous errors

View File

@ -20,7 +20,7 @@ note: required by a bound in `ArgumentV1::<'a>::new_upper_hex`
|
LL | arg_new!(new_upper_hex, UpperHex);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ArgumentV1::<'a>::new_upper_hex`
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `arg_new` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -27,7 +27,7 @@ LL | | });
|
= note: this pattern will always match, so the loop will never exit
= help: consider instead using a `loop { ... }` with a `let` inside it
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the macro `foo` which comes from the expansion of the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `while let` pattern
--> $DIR/while-let-2.rs:27:11

View File

@ -11,7 +11,7 @@ LL | println!("{}", x);
LL | Pin::new(&mut b).resume(());
| ------ first borrow later used here
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -1,4 +1,3 @@
// check-pass
// edition:2018
#![feature(generic_associated_types)]
@ -34,6 +33,7 @@ where
fn search<'c>(&'c self, _client: &'c ()) -> Self::Future<'c, Self, Criteria> {
async move { todo!() }
//~^ ERROR: the size for values of type `A` cannot be known at compilation time
}
}

View File

@ -0,0 +1,27 @@
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/issue-88287.rs:35:9
|
LL | type SearchFutureTy<'f, A, B: 'f>
| - this type parameter needs to be `std::marker::Sized`
...
LL | async move { todo!() }
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `<T as SearchableResourceExt<Criteria>>`
--> $DIR/issue-88287.rs:25:6
|
LL | impl<T, Criteria> SearchableResourceExt<Criteria> for T
| ^ required by this bound in `<T as SearchableResourceExt<Criteria>>`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - A: SearchableResource<B> + ?Sized + 'f,
LL + A: SearchableResource<B> + 'f,
|
help: consider relaxing the implicit `Sized` restriction
|
LL | T: SearchableResource<Criteria> + ?Sized,
| ++++++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -40,7 +40,7 @@ LL | bar!(internal_unstable::unstable());
| ----------------------------------- in this macro invocation
|
= help: add `#![feature(function)]` to the crate attributes to enable
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `foo` which comes from the expansion of the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 5 previous errors

View File

@ -4,7 +4,7 @@ error[E0282]: type annotations needed
LL | panic!(std::default::Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `M` declared on the function `begin_panic`
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider specifying the generic argument
--> $SRC_DIR/std/src/panic.rs:LL:COL
|

View File

@ -9,7 +9,7 @@ LL | let mut s_copy = s;
LL | println!("{}", s);
| ^ value borrowed here after move
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -13,7 +13,7 @@ LL | println!("{:?}", heap);
LL | };
| - ... and the mutable borrow might be used here, when that temporary is dropped and runs the destructor for type `(Option<PeekMut<'_, i32>>, ())`
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0282]: type annotations needed
LL | println!("{}", 23u64.test(xs.iter().sum()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `new_display`
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider specifying the generic argument
|
LL | println!("{}", 23u64.test(xs.iter().sum())::<T>);

View File

@ -0,0 +1,22 @@
// edition:2018
// check-pass
trait Trait<Input> {
type Output;
}
async fn walk<F>(filter: F)
where
for<'a> F: Trait<&'a u32> + 'a,
for<'a> <F as Trait<&'a u32>>::Output: 'a,
{
}
async fn walk2<F: 'static>(filter: F)
where
for<'a> F: Trait<&'a u32> + 'a,
for<'a> <F as Trait<&'a u32>>::Output: 'a,
{
}
fn main() {}

View File

@ -18,7 +18,7 @@ LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
= note: `#[deny(const_err)]` on by default
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
@ -33,5 +33,5 @@ LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
= note: `#[deny(const_err)]` on by default
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -9,11 +9,17 @@ fn main() {
// Allowed ordering combos
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Relaxed);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::SeqCst);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Relaxed);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::SeqCst);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering::Relaxed);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::SeqCst);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Relaxed);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::SeqCst);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Relaxed);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Acquire);
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::SeqCst);
@ -41,22 +47,4 @@ fn main() {
//~^ ERROR `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Release);
//~^ ERROR `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`
// Release success order forbids failure order of Acquire or SeqCst
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::Acquire);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::SeqCst);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
// Relaxed success order also forbids failure order of Acquire or SeqCst
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::SeqCst);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Acquire);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
// Acquire/AcqRel forbids failure order of SeqCst
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::SeqCst);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::SeqCst);
//~^ ERROR `compare_exchange_weak`'s success ordering must be at least as strong as
}

View File

@ -1,5 +1,5 @@
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:22:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:28:67
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Relaxed, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -8,7 +8,7 @@ LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Relaxed, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:24:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:30:67
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -16,7 +16,7 @@ LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:26:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:32:67
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -24,7 +24,7 @@ LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:28:66
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:34:66
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -32,7 +32,7 @@ LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:30:66
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:36:66
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::SeqCst, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -40,7 +40,7 @@ LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::SeqCst, Ordering::
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:34:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:40:67
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -48,7 +48,7 @@ LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:36:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:42:67
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -56,7 +56,7 @@ LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:38:67
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:44:67
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -64,7 +64,7 @@ LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering:
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:40:66
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:46:66
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -72,66 +72,12 @@ LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:42:66
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:48:66
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:46:48
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Release` success ordering
| help: consider using `AcqRel` success ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:48:48
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Release` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:52:48
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:54:48
|
LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `Acquire` success ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:58:48
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Acquire` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange_weak`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:60:48
|
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `AcqRel` success ordering
| help: consider using `SeqCst` success ordering instead
error: aborting due to 16 previous errors
error: aborting due to 10 previous errors

View File

@ -7,11 +7,17 @@ fn main() {
// Allowed ordering combos
let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Relaxed);
let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::SeqCst);
let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Relaxed);
let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::SeqCst);
let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Relaxed);
let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::SeqCst);
let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Relaxed);
let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::SeqCst);
let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Relaxed);
let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Acquire);
let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::SeqCst);
@ -39,22 +45,4 @@ fn main() {
//~^ ERROR `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`
let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Release);
//~^ ERROR `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`
// Release success order forbids failure order of Acquire or SeqCst
let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Acquire);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::SeqCst);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
// Relaxed success order also forbids failure order of Acquire or SeqCst
let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::SeqCst);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Acquire);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
// Acquire/AcqRel forbids failure order of SeqCst
let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::SeqCst);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::SeqCst);
//~^ ERROR `compare_exchange`'s success ordering must be at least as strong as
}

View File

@ -1,5 +1,5 @@
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:20:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:26:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -8,7 +8,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::AcqRel);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:22:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:28:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -16,7 +16,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::AcqRel);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:24:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:30:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -24,7 +24,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::AcqRel);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:26:56
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:32:56
|
LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -32,7 +32,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::AcqRel);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:28:56
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:34:56
|
LL | let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -40,7 +40,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::AcqRel);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:32:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:38:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -48,7 +48,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Release);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:34:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:40:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -56,7 +56,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Release);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:36:57
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:42:57
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -64,7 +64,7 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Release);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:38:56
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:44:56
|
LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -72,66 +72,12 @@ LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Release);
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:40:56
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:46:56
|
LL | let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Release);
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:44:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Release` success ordering
| help: consider using `AcqRel` success ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:46:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Release` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:50:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:52:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `Acquire` success ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:56:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Acquire` success ordering
| help: consider using `SeqCst` success ordering instead
error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:58:38
|
LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `AcqRel` success ordering
| help: consider using `SeqCst` success ordering instead
error: aborting due to 16 previous errors
error: aborting due to 10 previous errors

View File

@ -7,11 +7,17 @@ fn main() {
// Allowed ordering combos
let _ = x.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Acquire, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Relaxed, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Relaxed, Ordering::SeqCst, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Acquire, Ordering::Relaxed, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Acquire, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Acquire, Ordering::SeqCst, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Release, Ordering::Relaxed, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::AcqRel, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Release, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::Release, Ordering::SeqCst, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::AcqRel, Ordering::Relaxed, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::AcqRel, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::AcqRel, Ordering::SeqCst, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::SeqCst, Ordering::Relaxed, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::SeqCst, Ordering::Acquire, |old| Some(old + 1));
let _ = x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |old| Some(old + 1));
@ -40,21 +46,4 @@ fn main() {
let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s failure ordering may not be `Release` or `AcqRel`
// Release success order forbids failure order of Acquire or SeqCst
let _ = x.fetch_update(Ordering::Release, Ordering::Acquire, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
let _ = x.fetch_update(Ordering::Release, Ordering::SeqCst, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
// Relaxed success order also forbids failure order of Acquire or SeqCst
let _ = x.fetch_update(Ordering::Relaxed, Ordering::SeqCst, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
let _ = x.fetch_update(Ordering::Relaxed, Ordering::Acquire, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
// Acquire/AcqRel forbids failure order of SeqCst
let _ = x.fetch_update(Ordering::Acquire, Ordering::SeqCst, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
let _ = x.fetch_update(Ordering::AcqRel, Ordering::SeqCst, |old| Some(old + 1));
//~^ ERROR `fetch_update`'s success ordering must be at least as strong as
}

View File

@ -1,5 +1,5 @@
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:20:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:26:47
|
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -8,7 +8,7 @@ LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:22:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:28:47
|
LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -16,7 +16,7 @@ LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:24:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:30:47
|
LL | let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -24,7 +24,7 @@ LL | let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:26:46
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:32:46
|
LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -32,7 +32,7 @@ LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(o
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:28:46
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:34:46
|
LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
@ -40,7 +40,7 @@ LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(o
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:32:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:38:47
|
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -48,7 +48,7 @@ LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:34:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:40:47
|
LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -56,7 +56,7 @@ LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:36:47
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:42:47
|
LL | let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -64,7 +64,7 @@ LL | let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:38:46
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:44:46
|
LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
@ -72,66 +72,12 @@ LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:40:46
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:46:46
|
LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
= help: consider using `Acquire` or `Relaxed` failure ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:44:28
|
LL | let _ = x.fetch_update(Ordering::Release, Ordering::Acquire, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Release` success ordering
| help: consider using `AcqRel` success ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:46:28
|
LL | let _ = x.fetch_update(Ordering::Release, Ordering::SeqCst, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Release` success ordering
| help: consider using `SeqCst` success ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:50:28
|
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::SeqCst, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `SeqCst` success ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:52:28
|
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Acquire, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ ----------------- `Acquire` failure ordering
| |
| `Relaxed` success ordering
| help: consider using `Acquire` success ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:56:28
|
LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::SeqCst, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `Acquire` success ordering
| help: consider using `SeqCst` success ordering instead
error: `fetch_update`'s success ordering must be at least as strong as its failure ordering
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:58:28
|
LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::SeqCst, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ ---------------- `SeqCst` failure ordering
| |
| `AcqRel` success ordering
| help: consider using `SeqCst` success ordering instead
error: aborting due to 16 previous errors
error: aborting due to 10 previous errors

View File

@ -29,7 +29,7 @@ LL | println!("{}", y);
LL | while true { while true { while true { x = y; x.clone(); } } }
| - value moved here, in previous iteration of loop
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error; 3 warnings emitted

View File

@ -9,7 +9,7 @@ LL |
LL | println!("{}", *x);
| ^^ value borrowed here after move
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -8,7 +8,7 @@ LL | send(ch, message);
LL | println!("{}", message);
| ^^^^^^^ value borrowed here after move
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | let x: i32;
LL | println!("{:?}", x);
| ^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -18,7 +18,7 @@ LL | () => { syntax error };
LL | ping!();
| ------- in this macro invocation
|
= note: this error originates in the macro `pong` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `pong` which comes from the expansion of the macro `ping` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
--> $DIR/main.rs:10:20
@ -29,7 +29,7 @@ LL | () => { syntax error };
LL | deep!();
| ------- in this macro invocation
|
= note: this error originates in the macro `pong` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `pong` which comes from the expansion of the macro `deep` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -4,7 +4,7 @@ error: requires at least a format string argument
LL | format!();
| ^^^^^^^^^
|
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected expression, found keyword `struct`
--> $DIR/format-parse-errors.rs:5:13

View File

@ -7,7 +7,7 @@ LL | () => (fake)
LL | 1 + call_nested_expr!();
| ------------------- in this macro invocation
|
= note: this error originates in the macro `nested_expr` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `nested_expr` which comes from the expansion of the macro `call_nested_expr` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `fake` in this scope
--> $DIR/macro-backtrace-nested.rs:5:12
@ -18,7 +18,7 @@ LL | () => (fake)
LL | call_nested_expr_sum!();
| ----------------------- in this macro invocation
|
= note: this error originates in the macro `nested_expr` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `nested_expr` which comes from the expansion of the macro `call_nested_expr_sum` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors

View File

@ -7,7 +7,7 @@ LL | ($fmt:expr) => (myprint!(concat!($fmt, "\n")));
LL | myprintln!("{}");
| ---------------- in this macro invocation
|
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `concat` which comes from the expansion of the macro `myprintln` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -9,7 +9,7 @@ note: the constant `baz` is defined here
|
LL | thread_local!(static baz: f64 = 0.0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -24,7 +24,7 @@ LL | macro_rules! m { () => {} }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_gen_inner_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-legacy.rs:139:42
@ -52,7 +52,7 @@ LL | macro_rules! m { () => {} }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-legacy.rs:148:9
@ -136,7 +136,7 @@ LL | macro_rules! m { () => { Wrong } }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_gen_inner_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-legacy.rs:218:42
@ -164,7 +164,7 @@ LL | macro_rules! m { () => { Wrong } }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-legacy.rs:232:9
@ -220,7 +220,7 @@ LL | macro_rules! m { () => {} }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors

View File

@ -24,7 +24,7 @@ LL | macro m() {}
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_gen_inner_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-modern.rs:147:33
@ -52,7 +52,7 @@ LL | macro m() {}
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-modern.rs:156:13
@ -136,7 +136,7 @@ LL | macro m() { Wrong }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_gen_inner_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `m` is ambiguous
--> $DIR/restricted-shadowing-modern.rs:233:33
@ -164,7 +164,7 @@ LL | macro m() { Wrong }
...
LL | include!();
| ---------- in this macro invocation
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `gen_invoc` which comes from the expansion of the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 6 previous errors

View File

@ -6,7 +6,7 @@ LL | unreachable!("x is {x} and y is {y}", y = 0);
|
= note: did you intend to capture a variable `x` from the surrounding scope?
= note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
= note: this error originates in the macro `$crate::concat` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::concat` which comes from the expansion of the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -11,7 +11,7 @@ LL | });
LL | println!("{}", x);
| ^ value borrowed here after move
|
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -6,7 +6,7 @@ LL | println!("{:?} {:?}", Foo, Bar);
|
= help: the trait `Debug` is not implemented for `Foo`
= note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo`
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Foo` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
@ -19,7 +19,7 @@ LL | println!("{:?} {:?}", Foo, Bar);
| ^^^ `Bar` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= help: the trait `Debug` is not implemented for `Bar`
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `Foo` doesn't implement `std::fmt::Display`
--> $DIR/no-debug.rs:11:23
@ -29,7 +29,7 @@ LL | println!("{} {}", Foo, Bar);
|
= help: the trait `std::fmt::Display` is not implemented for `Foo`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `Bar` doesn't implement `std::fmt::Display`
--> $DIR/no-debug.rs:11:28
@ -39,7 +39,7 @@ LL | println!("{} {}", Foo, Bar);
|
= help: the trait `std::fmt::Display` is not implemented for `Bar`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 4 previous errors

View File

@ -24,7 +24,7 @@ LL | static x: u32 = 0;
...
LL | pub_x!();
| -------- in this macro invocation
= note: this error originates in the macro `priv_x` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `priv_x` which comes from the expansion of the macro `pub_x` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors

View File

@ -26,7 +26,7 @@ error[E0412]: cannot find type `ItemUse` in crate `$crate`
LL | pass_dollar_crate!();
| ^^^^^^^^^^^^^^^^^^^^ not found in `$crate`
|
= note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `proc_macro_rules` which comes from the expansion of the macro `pass_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 4 previous errors

View File

@ -7,7 +7,7 @@ LL | three!($a, $b);
LL | one!("hello", "world");
| ---------------------- in this macro invocation
|
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `two` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
error: second final: "world"
--> $DIR/parent-source-spans.rs:16:16
@ -18,7 +18,7 @@ LL | three!($a, $b);
LL | one!("hello", "world");
| ---------------------- in this macro invocation
|
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `two` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
error: first parent: "hello"
--> $DIR/parent-source-spans.rs:10:5
@ -150,7 +150,7 @@ LL | one!("hello", "world");
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| -- similarly named tuple variant `Ok` defined here
|
= note: this error originates in the macro `parent_source_spans` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `ok` in this scope
--> $DIR/parent-source-spans.rs:29:5
@ -166,7 +166,7 @@ LL | two!("yay", "rust");
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| -- similarly named tuple variant `Ok` defined here
|
= note: this error originates in the macro `parent_source_spans` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `ok` in this scope
--> $DIR/parent-source-spans.rs:29:5
@ -182,7 +182,7 @@ LL | three!("hip", "hop");
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| -- similarly named tuple variant `Ok` defined here
|
= note: this error originates in the macro `parent_source_spans` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `three` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 21 previous errors

View File

@ -7,7 +7,7 @@ LL | Value = (stringify!($tokens + hidden_ident), 1).1
LL | other!(50);
| ---------- in this macro invocation
|
= note: this error originates in the macro `inner` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `inner` which comes from the expansion of the macro `other` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `hidden_ident` in this scope
--> $DIR/weird-hygiene.rs:34:13

View File

@ -6,7 +6,7 @@ LL | let _: NotDebug = dbg!(NotDebug);
|
= help: the trait `Debug` is not implemented for `NotDebug`
= note: add `#[derive(Debug)]` to `NotDebug` or manually `impl Debug for NotDebug`
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NotDebug` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]

Some files were not shown because too many files have changed in this diff Show More