Auto merge of #89580 - estebank:trait-bounds-are-tricky, r=nagisa
Point at source of trait bound obligations in more places Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). We no longer point at associated items (`ImplObligation`), as they didn't add any user actionable information, they just added noise. Address part of #89418.
This commit is contained in:
commit
b8e5ab20ed
221 changed files with 2064 additions and 2739 deletions
|
@ -1266,22 +1266,37 @@ impl EmitterWriter {
|
||||||
}
|
}
|
||||||
self.msg_to_buffer(&mut buffer, msg, max_line_num_len, "note", None);
|
self.msg_to_buffer(&mut buffer, msg, max_line_num_len, "note", None);
|
||||||
} else {
|
} else {
|
||||||
|
let mut label_width = 0;
|
||||||
// The failure note level itself does not provide any useful diagnostic information
|
// The failure note level itself does not provide any useful diagnostic information
|
||||||
if *level != Level::FailureNote {
|
if *level != Level::FailureNote {
|
||||||
buffer.append(0, level.to_str(), Style::Level(*level));
|
buffer.append(0, level.to_str(), Style::Level(*level));
|
||||||
|
label_width += level.to_str().len();
|
||||||
}
|
}
|
||||||
// only render error codes, not lint codes
|
// only render error codes, not lint codes
|
||||||
if let Some(DiagnosticId::Error(ref code)) = *code {
|
if let Some(DiagnosticId::Error(ref code)) = *code {
|
||||||
buffer.append(0, "[", Style::Level(*level));
|
buffer.append(0, "[", Style::Level(*level));
|
||||||
buffer.append(0, &code, Style::Level(*level));
|
buffer.append(0, &code, Style::Level(*level));
|
||||||
buffer.append(0, "]", Style::Level(*level));
|
buffer.append(0, "]", Style::Level(*level));
|
||||||
|
label_width += 2 + code.len();
|
||||||
}
|
}
|
||||||
let header_style = if is_secondary { Style::HeaderMsg } else { Style::MainHeaderMsg };
|
let header_style = if is_secondary { Style::HeaderMsg } else { Style::MainHeaderMsg };
|
||||||
if *level != Level::FailureNote {
|
if *level != Level::FailureNote {
|
||||||
buffer.append(0, ": ", header_style);
|
buffer.append(0, ": ", header_style);
|
||||||
|
label_width += 2;
|
||||||
}
|
}
|
||||||
for &(ref text, _) in msg.iter() {
|
for &(ref text, _) in msg.iter() {
|
||||||
buffer.append(0, &replace_tabs(text), header_style);
|
// Account for newlines to align output to its label.
|
||||||
|
for (line, text) in replace_tabs(text).lines().enumerate() {
|
||||||
|
buffer.append(
|
||||||
|
0 + line,
|
||||||
|
&format!(
|
||||||
|
"{}{}",
|
||||||
|
if line == 0 { String::new() } else { " ".repeat(label_width) },
|
||||||
|
text
|
||||||
|
),
|
||||||
|
header_style,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2141,10 +2141,19 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
self.tcx.generics_of(owner.to_def_id()),
|
self.tcx.generics_of(owner.to_def_id()),
|
||||||
|
hir.span(hir_id),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let span = match generics {
|
||||||
|
// This is to get around the trait identity obligation, that has a `DUMMY_SP` as signal
|
||||||
|
// for other diagnostics, so we need to recover it here.
|
||||||
|
Some((_, _, node)) if span.is_dummy() => node,
|
||||||
|
_ => span,
|
||||||
|
};
|
||||||
|
|
||||||
let type_param_span = match (generics, bound_kind) {
|
let type_param_span = match (generics, bound_kind) {
|
||||||
(Some((_, ref generics)), GenericKind::Param(ref param)) => {
|
(Some((_, ref generics, _)), GenericKind::Param(ref param)) => {
|
||||||
// Account for the case where `param` corresponds to `Self`,
|
// Account for the case where `param` corresponds to `Self`,
|
||||||
// which doesn't have the expected type argument.
|
// which doesn't have the expected type argument.
|
||||||
if !(generics.has_self && param.index == 0) {
|
if !(generics.has_self && param.index == 0) {
|
||||||
|
@ -2181,7 +2190,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
};
|
};
|
||||||
let new_lt = generics
|
let new_lt = generics
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|(parent_g, g)| {
|
.and_then(|(parent_g, g, _)| {
|
||||||
let mut possible = (b'a'..=b'z').map(|c| format!("'{}", c as char));
|
let mut possible = (b'a'..=b'z').map(|c| format!("'{}", c as char));
|
||||||
let mut lts_names = g
|
let mut lts_names = g
|
||||||
.params
|
.params
|
||||||
|
@ -2203,7 +2212,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
.unwrap_or("'lt".to_string());
|
.unwrap_or("'lt".to_string());
|
||||||
let add_lt_sugg = generics
|
let add_lt_sugg = generics
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|(_, g)| g.params.first())
|
.and_then(|(_, g, _)| g.params.first())
|
||||||
.and_then(|param| param.def_id.as_local())
|
.and_then(|param| param.def_id.as_local())
|
||||||
.map(|def_id| {
|
.map(|def_id| {
|
||||||
(
|
(
|
||||||
|
|
|
@ -192,14 +192,16 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
||||||
ObligationCauseCode::MatchImpl(parent, ..) => &parent.code,
|
ObligationCauseCode::MatchImpl(parent, ..) => &parent.code,
|
||||||
_ => &cause.code,
|
_ => &cause.code,
|
||||||
};
|
};
|
||||||
if let ObligationCauseCode::ItemObligation(item_def_id) = *code {
|
if let (ObligationCauseCode::ItemObligation(item_def_id), None) =
|
||||||
|
(code, override_error_code)
|
||||||
|
{
|
||||||
// Same case of `impl Foo for dyn Bar { fn qux(&self) {} }` introducing a `'static`
|
// Same case of `impl Foo for dyn Bar { fn qux(&self) {} }` introducing a `'static`
|
||||||
// lifetime as above, but called using a fully-qualified path to the method:
|
// lifetime as above, but called using a fully-qualified path to the method:
|
||||||
// `Foo::qux(bar)`.
|
// `Foo::qux(bar)`.
|
||||||
let mut v = TraitObjectVisitor(FxHashSet::default());
|
let mut v = TraitObjectVisitor(FxHashSet::default());
|
||||||
v.visit_ty(param.param_ty);
|
v.visit_ty(param.param_ty);
|
||||||
if let Some((ident, self_ty)) =
|
if let Some((ident, self_ty)) =
|
||||||
self.get_impl_ident_and_self_ty_from_trait(item_def_id, &v.0)
|
self.get_impl_ident_and_self_ty_from_trait(*item_def_id, &v.0)
|
||||||
{
|
{
|
||||||
if self.suggest_constrain_dyn_trait_in_impl(&mut err, &v.0, ident, self_ty) {
|
if self.suggest_constrain_dyn_trait_in_impl(&mut err, &v.0, ident, self_ty) {
|
||||||
override_error_code = Some(ident);
|
override_error_code = Some(ident);
|
||||||
|
|
|
@ -1958,15 +1958,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
region, object_ty,
|
region, object_ty,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
ObligationCauseCode::ItemObligation(item_def_id) => {
|
ObligationCauseCode::ItemObligation(_item_def_id) => {
|
||||||
let item_name = tcx.def_path_str(item_def_id);
|
// We hold the `DefId` of the item introducing the obligation, but displaying it
|
||||||
let msg = format!("required by `{}`", item_name);
|
// doesn't add user usable information. It always point at an associated item.
|
||||||
let sp = tcx
|
|
||||||
.hir()
|
|
||||||
.span_if_local(item_def_id)
|
|
||||||
.unwrap_or_else(|| tcx.def_span(item_def_id));
|
|
||||||
let sp = tcx.sess.source_map().guess_head_span(sp);
|
|
||||||
err.span_note(sp, &msg);
|
|
||||||
}
|
}
|
||||||
ObligationCauseCode::BindingObligation(item_def_id, span) => {
|
ObligationCauseCode::BindingObligation(item_def_id, span) => {
|
||||||
let item_name = tcx.def_path_str(item_def_id);
|
let item_name = tcx.def_path_str(item_def_id);
|
||||||
|
|
|
@ -9,7 +9,9 @@ use rustc_middle::ty::subst::{GenericArg, Subst, SubstsRef};
|
||||||
use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable, WithConstness};
|
use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable, WithConstness};
|
||||||
|
|
||||||
use super::{Normalized, Obligation, ObligationCause, PredicateObligation, SelectionContext};
|
use super::{Normalized, Obligation, ObligationCause, PredicateObligation, SelectionContext};
|
||||||
pub use rustc_infer::traits::util::*;
|
pub use rustc_infer::traits::{self, util::*};
|
||||||
|
|
||||||
|
use std::iter;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// `TraitAliasExpander` iterator
|
// `TraitAliasExpander` iterator
|
||||||
|
@ -229,11 +231,16 @@ pub fn predicates_for_generics<'tcx>(
|
||||||
) -> impl Iterator<Item = PredicateObligation<'tcx>> {
|
) -> impl Iterator<Item = PredicateObligation<'tcx>> {
|
||||||
debug!("predicates_for_generics(generic_bounds={:?})", generic_bounds);
|
debug!("predicates_for_generics(generic_bounds={:?})", generic_bounds);
|
||||||
|
|
||||||
generic_bounds.predicates.into_iter().map(move |predicate| Obligation {
|
iter::zip(generic_bounds.predicates, generic_bounds.spans).map(move |(predicate, span)| {
|
||||||
cause: cause.clone(),
|
let cause = match cause.code {
|
||||||
recursion_depth,
|
traits::ItemObligation(def_id) if !span.is_dummy() => traits::ObligationCause::new(
|
||||||
param_env,
|
cause.span,
|
||||||
predicate,
|
cause.body_id,
|
||||||
|
traits::BindingObligation(def_id, span),
|
||||||
|
),
|
||||||
|
_ => cause.clone(),
|
||||||
|
};
|
||||||
|
Obligation { cause, recursion_depth, param_env, predicate }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -709,7 +709,12 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
|
||||||
|
|
||||||
iter::zip(iter::zip(predicates.predicates, predicates.spans), origins.into_iter().rev())
|
iter::zip(iter::zip(predicates.predicates, predicates.spans), origins.into_iter().rev())
|
||||||
.map(|((pred, span), origin_def_id)| {
|
.map(|((pred, span), origin_def_id)| {
|
||||||
let cause = self.cause(traits::BindingObligation(origin_def_id, span));
|
let code = if span.is_dummy() {
|
||||||
|
traits::MiscObligation
|
||||||
|
} else {
|
||||||
|
traits::BindingObligation(origin_def_id, span)
|
||||||
|
};
|
||||||
|
let cause = self.cause(code);
|
||||||
traits::Obligation::with_depth(cause, self.recursion_depth, self.param_env, pred)
|
traits::Obligation::with_depth(cause, self.recursion_depth, self.param_env, pred)
|
||||||
})
|
})
|
||||||
.filter(|pred| !pred.has_escaping_bound_vars())
|
.filter(|pred| !pred.has_escaping_bound_vars())
|
||||||
|
|
|
@ -210,12 +210,8 @@ fn compare_predicate_entailment<'tcx>(
|
||||||
let normalize_cause = traits::ObligationCause::misc(impl_m_span, impl_m_hir_id);
|
let normalize_cause = traits::ObligationCause::misc(impl_m_span, impl_m_hir_id);
|
||||||
let param_env =
|
let param_env =
|
||||||
ty::ParamEnv::new(tcx.intern_predicates(&hybrid_preds.predicates), Reveal::UserFacing);
|
ty::ParamEnv::new(tcx.intern_predicates(&hybrid_preds.predicates), Reveal::UserFacing);
|
||||||
let param_env = traits::normalize_param_env_or_error(
|
let param_env =
|
||||||
tcx,
|
traits::normalize_param_env_or_error(tcx, impl_m.def_id, param_env, normalize_cause);
|
||||||
impl_m.def_id,
|
|
||||||
param_env,
|
|
||||||
normalize_cause.clone(),
|
|
||||||
);
|
|
||||||
|
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
let inh = Inherited::new(infcx, impl_m.def_id.expect_local());
|
let inh = Inherited::new(infcx, impl_m.def_id.expect_local());
|
||||||
|
@ -226,12 +222,15 @@ fn compare_predicate_entailment<'tcx>(
|
||||||
let mut selcx = traits::SelectionContext::new(&infcx);
|
let mut selcx = traits::SelectionContext::new(&infcx);
|
||||||
|
|
||||||
let impl_m_own_bounds = impl_m_predicates.instantiate_own(tcx, impl_to_placeholder_substs);
|
let impl_m_own_bounds = impl_m_predicates.instantiate_own(tcx, impl_to_placeholder_substs);
|
||||||
for predicate in impl_m_own_bounds.predicates {
|
for (predicate, span) in iter::zip(impl_m_own_bounds.predicates, impl_m_own_bounds.spans) {
|
||||||
|
let normalize_cause = traits::ObligationCause::misc(span, impl_m_hir_id);
|
||||||
let traits::Normalized { value: predicate, obligations } =
|
let traits::Normalized { value: predicate, obligations } =
|
||||||
traits::normalize(&mut selcx, param_env, normalize_cause.clone(), predicate);
|
traits::normalize(&mut selcx, param_env, normalize_cause, predicate);
|
||||||
|
|
||||||
inh.register_predicates(obligations);
|
inh.register_predicates(obligations);
|
||||||
inh.register_predicate(traits::Obligation::new(cause.clone(), param_env, predicate));
|
let mut cause = cause.clone();
|
||||||
|
cause.make_mut().span = span;
|
||||||
|
inh.register_predicate(traits::Obligation::new(cause, param_env, predicate));
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now need to check that the signature of the impl method is
|
// We now need to check that the signature of the impl method is
|
||||||
|
@ -280,6 +279,12 @@ fn compare_predicate_entailment<'tcx>(
|
||||||
|
|
||||||
let sub_result = infcx.at(&cause, param_env).sup(trait_fty, impl_fty).map(
|
let sub_result = infcx.at(&cause, param_env).sup(trait_fty, impl_fty).map(
|
||||||
|InferOk { obligations, .. }| {
|
|InferOk { obligations, .. }| {
|
||||||
|
// FIXME: We'd want to keep more accurate spans than "the method signature" when
|
||||||
|
// processing the comparison between the trait and impl fn, but we sadly lose them
|
||||||
|
// and point at the whole signature when a trait bound or specific input or output
|
||||||
|
// type would be more appropriate. In other places we have a `Vec<Span>`
|
||||||
|
// corresponding to their `Vec<Predicate>`, but we don't have that here.
|
||||||
|
// Fixing this would improve the output of test `issue-83765.rs`.
|
||||||
inh.register_predicates(obligations);
|
inh.register_predicates(obligations);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1385,12 +1390,13 @@ pub fn check_type_bounds<'tcx>(
|
||||||
|
|
||||||
let impl_ty_hir_id = tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local());
|
let impl_ty_hir_id = tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local());
|
||||||
let normalize_cause = traits::ObligationCause::misc(impl_ty_span, impl_ty_hir_id);
|
let normalize_cause = traits::ObligationCause::misc(impl_ty_span, impl_ty_hir_id);
|
||||||
let mk_cause = |span| {
|
let mk_cause = |span: Span| {
|
||||||
ObligationCause::new(
|
let code = if span.is_dummy() {
|
||||||
impl_ty_span,
|
traits::MiscObligation
|
||||||
impl_ty_hir_id,
|
} else {
|
||||||
ObligationCauseCode::BindingObligation(trait_ty.def_id, span),
|
traits::BindingObligation(trait_ty.def_id, span)
|
||||||
)
|
};
|
||||||
|
ObligationCause::new(impl_ty_span, impl_ty_hir_id, code)
|
||||||
};
|
};
|
||||||
|
|
||||||
let obligations = tcx
|
let obligations = tcx
|
||||||
|
|
|
@ -586,38 +586,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Given a fully substituted set of bounds (`generic_bounds`), and the values with which each
|
|
||||||
/// type/region parameter was instantiated (`substs`), creates and registers suitable
|
|
||||||
/// trait/region obligations.
|
|
||||||
///
|
|
||||||
/// For example, if there is a function:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// fn foo<'a,T:'a>(...)
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// and a reference:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// let f = foo;
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// Then we will create a fresh region variable `'$0` and a fresh type variable `$1` for `'a`
|
|
||||||
/// and `T`. This routine will add a region obligation `$1:'$0` and register it locally.
|
|
||||||
pub fn add_obligations_for_parameters(
|
|
||||||
&self,
|
|
||||||
cause: traits::ObligationCause<'tcx>,
|
|
||||||
predicates: ty::InstantiatedPredicates<'tcx>,
|
|
||||||
) {
|
|
||||||
assert!(!predicates.has_escaping_bound_vars());
|
|
||||||
|
|
||||||
debug!("add_obligations_for_parameters(predicates={:?})", predicates);
|
|
||||||
|
|
||||||
for obligation in traits::predicates_for_generics(cause, self.param_env, predicates) {
|
|
||||||
self.register_predicate(obligation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME(arielb1): use this instead of field.ty everywhere
|
// FIXME(arielb1): use this instead of field.ty everywhere
|
||||||
// Only for fields! Returns <none> for methods>
|
// Only for fields! Returns <none> for methods>
|
||||||
// Indifferent to privacy flags
|
// Indifferent to privacy flags
|
||||||
|
@ -1522,20 +1490,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
/// Add all the obligations that are required, substituting and normalized appropriately.
|
/// Add all the obligations that are required, substituting and normalized appropriately.
|
||||||
#[tracing::instrument(level = "debug", skip(self, span, def_id, substs))]
|
#[tracing::instrument(level = "debug", skip(self, span, def_id, substs))]
|
||||||
fn add_required_obligations(&self, span: Span, def_id: DefId, substs: &SubstsRef<'tcx>) {
|
crate fn add_required_obligations(&self, span: Span, def_id: DefId, substs: &SubstsRef<'tcx>) {
|
||||||
let (bounds, spans) = self.instantiate_bounds(span, def_id, &substs);
|
let (bounds, _) = self.instantiate_bounds(span, def_id, &substs);
|
||||||
|
|
||||||
for (i, mut obligation) in traits::predicates_for_generics(
|
for obligation in traits::predicates_for_generics(
|
||||||
traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)),
|
traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)),
|
||||||
self.param_env,
|
self.param_env,
|
||||||
bounds,
|
bounds,
|
||||||
)
|
) {
|
||||||
.enumerate()
|
|
||||||
{
|
|
||||||
// This makes the error point at the bound, but we want to point at the argument
|
|
||||||
if let Some(span) = spans.get(i) {
|
|
||||||
obligation.cause.make_mut().code = traits::BindingObligation(def_id, *span);
|
|
||||||
}
|
|
||||||
self.register_predicate(obligation);
|
self.register_predicate(obligation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,10 +509,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
self.write_user_type_annotation_from_substs(hir_id, did, substs, None);
|
self.write_user_type_annotation_from_substs(hir_id, did, substs, None);
|
||||||
|
|
||||||
// Check bounds on type arguments used in the path.
|
// Check bounds on type arguments used in the path.
|
||||||
let (bounds, _) = self.instantiate_bounds(path_span, did, substs);
|
self.add_required_obligations(path_span, did, substs);
|
||||||
let cause =
|
|
||||||
traits::ObligationCause::new(path_span, self.body_id, traits::ItemObligation(did));
|
|
||||||
self.add_obligations_for_parameters(cause, bounds);
|
|
||||||
|
|
||||||
Some((variant, ty))
|
Some((variant, ty))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -120,7 +120,12 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
|
||||||
// We won't add these if we encountered an illegal sized bound, so that we can use
|
// We won't add these if we encountered an illegal sized bound, so that we can use
|
||||||
// a custom error in that case.
|
// a custom error in that case.
|
||||||
if illegal_sized_bound.is_none() {
|
if illegal_sized_bound.is_none() {
|
||||||
self.add_obligations(self.tcx.mk_fn_ptr(method_sig), all_substs, method_predicates);
|
self.add_obligations(
|
||||||
|
self.tcx.mk_fn_ptr(method_sig),
|
||||||
|
all_substs,
|
||||||
|
method_predicates,
|
||||||
|
pick.item.def_id,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the final `MethodCallee`.
|
// Create the final `MethodCallee`.
|
||||||
|
@ -471,16 +476,23 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
|
||||||
fty: Ty<'tcx>,
|
fty: Ty<'tcx>,
|
||||||
all_substs: SubstsRef<'tcx>,
|
all_substs: SubstsRef<'tcx>,
|
||||||
method_predicates: ty::InstantiatedPredicates<'tcx>,
|
method_predicates: ty::InstantiatedPredicates<'tcx>,
|
||||||
|
def_id: DefId,
|
||||||
) {
|
) {
|
||||||
debug!(
|
debug!(
|
||||||
"add_obligations: fty={:?} all_substs={:?} method_predicates={:?}",
|
"add_obligations: fty={:?} all_substs={:?} method_predicates={:?} def_id={:?}",
|
||||||
fty, all_substs, method_predicates
|
fty, all_substs, method_predicates, def_id
|
||||||
);
|
);
|
||||||
|
|
||||||
self.add_obligations_for_parameters(
|
// FIXME: could replace with the following, but we already calculated `method_predicates`,
|
||||||
traits::ObligationCause::misc(self.span, self.body_id),
|
// so we just call `predicates_for_generics` directly to avoid redoing work.
|
||||||
|
// `self.add_required_obligations(self.span, def_id, &all_substs);`
|
||||||
|
for obligation in traits::predicates_for_generics(
|
||||||
|
traits::ObligationCause::new(self.span, self.body_id, traits::ItemObligation(def_id)),
|
||||||
|
self.param_env,
|
||||||
method_predicates,
|
method_predicates,
|
||||||
);
|
) {
|
||||||
|
self.register_predicate(obligation);
|
||||||
|
}
|
||||||
|
|
||||||
// this is a projection from a trait reference, so we have to
|
// this is a projection from a trait reference, so we have to
|
||||||
// make sure that the trait reference inputs are well-formed.
|
// make sure that the trait reference inputs are well-formed.
|
||||||
|
|
|
@ -12,6 +12,7 @@ pub use self::CandidateSource::*;
|
||||||
pub use self::MethodError::*;
|
pub use self::MethodError::*;
|
||||||
|
|
||||||
use crate::check::FnCtxt;
|
use crate::check::FnCtxt;
|
||||||
|
use crate::ObligationCause;
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_errors::{Applicability, DiagnosticBuilder};
|
use rustc_errors::{Applicability, DiagnosticBuilder};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
|
@ -71,7 +72,8 @@ pub enum MethodError<'tcx> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct NoMatchData<'tcx> {
|
pub struct NoMatchData<'tcx> {
|
||||||
pub static_candidates: Vec<CandidateSource>,
|
pub static_candidates: Vec<CandidateSource>,
|
||||||
pub unsatisfied_predicates: Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>)>,
|
pub unsatisfied_predicates:
|
||||||
|
Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>, Option<ObligationCause<'tcx>>)>,
|
||||||
pub out_of_scope_traits: Vec<DefId>,
|
pub out_of_scope_traits: Vec<DefId>,
|
||||||
pub lev_candidate: Option<ty::AssocItem>,
|
pub lev_candidate: Option<ty::AssocItem>,
|
||||||
pub mode: probe::Mode,
|
pub mode: probe::Mode,
|
||||||
|
@ -80,7 +82,11 @@ pub struct NoMatchData<'tcx> {
|
||||||
impl<'tcx> NoMatchData<'tcx> {
|
impl<'tcx> NoMatchData<'tcx> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
static_candidates: Vec<CandidateSource>,
|
static_candidates: Vec<CandidateSource>,
|
||||||
unsatisfied_predicates: Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>)>,
|
unsatisfied_predicates: Vec<(
|
||||||
|
ty::Predicate<'tcx>,
|
||||||
|
Option<ty::Predicate<'tcx>>,
|
||||||
|
Option<ObligationCause<'tcx>>,
|
||||||
|
)>,
|
||||||
out_of_scope_traits: Vec<DefId>,
|
out_of_scope_traits: Vec<DefId>,
|
||||||
lev_candidate: Option<ty::AssocItem>,
|
lev_candidate: Option<ty::AssocItem>,
|
||||||
mode: probe::Mode,
|
mode: probe::Mode,
|
||||||
|
|
|
@ -78,7 +78,8 @@ struct ProbeContext<'a, 'tcx> {
|
||||||
|
|
||||||
/// Collects near misses when trait bounds for type parameters are unsatisfied and is only used
|
/// Collects near misses when trait bounds for type parameters are unsatisfied and is only used
|
||||||
/// for error reporting
|
/// for error reporting
|
||||||
unsatisfied_predicates: Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>)>,
|
unsatisfied_predicates:
|
||||||
|
Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>, Option<ObligationCause<'tcx>>)>,
|
||||||
|
|
||||||
is_suggestion: IsSuggestion,
|
is_suggestion: IsSuggestion,
|
||||||
|
|
||||||
|
@ -1351,6 +1352,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
possibly_unsatisfied_predicates: &mut Vec<(
|
possibly_unsatisfied_predicates: &mut Vec<(
|
||||||
ty::Predicate<'tcx>,
|
ty::Predicate<'tcx>,
|
||||||
Option<ty::Predicate<'tcx>>,
|
Option<ty::Predicate<'tcx>>,
|
||||||
|
Option<ObligationCause<'tcx>>,
|
||||||
)>,
|
)>,
|
||||||
unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
|
unstable_candidates: Option<&mut Vec<(Candidate<'tcx>, Symbol)>>,
|
||||||
) -> Option<PickResult<'tcx>>
|
) -> Option<PickResult<'tcx>>
|
||||||
|
@ -1497,6 +1499,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
possibly_unsatisfied_predicates: &mut Vec<(
|
possibly_unsatisfied_predicates: &mut Vec<(
|
||||||
ty::Predicate<'tcx>,
|
ty::Predicate<'tcx>,
|
||||||
Option<ty::Predicate<'tcx>>,
|
Option<ty::Predicate<'tcx>>,
|
||||||
|
Option<ObligationCause<'tcx>>,
|
||||||
)>,
|
)>,
|
||||||
) -> ProbeResult {
|
) -> ProbeResult {
|
||||||
debug!("consider_probe: self_ty={:?} probe={:?}", self_ty, probe);
|
debug!("consider_probe: self_ty={:?} probe={:?}", self_ty, probe);
|
||||||
|
@ -1508,8 +1511,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
.sup(probe.xform_self_ty, self_ty)
|
.sup(probe.xform_self_ty, self_ty)
|
||||||
{
|
{
|
||||||
Ok(InferOk { obligations, value: () }) => obligations,
|
Ok(InferOk { obligations, value: () }) => obligations,
|
||||||
Err(_) => {
|
Err(err) => {
|
||||||
debug!("--> cannot relate self-types");
|
debug!("--> cannot relate self-types {:?}", err);
|
||||||
return ProbeResult::NoMatch;
|
return ProbeResult::NoMatch;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1558,7 +1561,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
let o = self.resolve_vars_if_possible(o);
|
let o = self.resolve_vars_if_possible(o);
|
||||||
if !self.predicate_may_hold(&o) {
|
if !self.predicate_may_hold(&o) {
|
||||||
result = ProbeResult::NoMatch;
|
result = ProbeResult::NoMatch;
|
||||||
possibly_unsatisfied_predicates.push((o.predicate, None));
|
possibly_unsatisfied_predicates.push((
|
||||||
|
o.predicate,
|
||||||
|
None,
|
||||||
|
Some(o.cause),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1604,8 +1611,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
} else {
|
} else {
|
||||||
Some(predicate)
|
Some(predicate)
|
||||||
};
|
};
|
||||||
possibly_unsatisfied_predicates
|
possibly_unsatisfied_predicates.push((
|
||||||
.push((nested_predicate, p));
|
nested_predicate,
|
||||||
|
p,
|
||||||
|
Some(obligation.cause.clone()),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1613,7 +1623,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
// Some nested subobligation of this predicate
|
// Some nested subobligation of this predicate
|
||||||
// failed.
|
// failed.
|
||||||
let predicate = self.resolve_vars_if_possible(predicate);
|
let predicate = self.resolve_vars_if_possible(predicate);
|
||||||
possibly_unsatisfied_predicates.push((predicate, None));
|
possibly_unsatisfied_predicates.push((predicate, None, None));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -1632,7 +1642,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
let o = self.resolve_vars_if_possible(o);
|
let o = self.resolve_vars_if_possible(o);
|
||||||
if !self.predicate_may_hold(&o) {
|
if !self.predicate_may_hold(&o) {
|
||||||
result = ProbeResult::NoMatch;
|
result = ProbeResult::NoMatch;
|
||||||
possibly_unsatisfied_predicates.push((o.predicate, None));
|
possibly_unsatisfied_predicates.push((o.predicate, None, Some(o.cause)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,9 @@ use rustc_span::lev_distance;
|
||||||
use rustc_span::symbol::{kw, sym, Ident};
|
use rustc_span::symbol::{kw, sym, Ident};
|
||||||
use rustc_span::{source_map, FileName, MultiSpan, Span, Symbol};
|
use rustc_span::{source_map, FileName, MultiSpan, Span, Symbol};
|
||||||
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
|
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
|
||||||
use rustc_trait_selection::traits::{FulfillmentError, Obligation};
|
use rustc_trait_selection::traits::{
|
||||||
|
FulfillmentError, Obligation, ObligationCause, ObligationCauseCode,
|
||||||
|
};
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
@ -702,19 +704,32 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
if let (ty::Param(_), ty::PredicateKind::Trait(p)) =
|
if let (ty::Param(_), ty::PredicateKind::Trait(p)) =
|
||||||
(self_ty.kind(), parent_pred.kind().skip_binder())
|
(self_ty.kind(), parent_pred.kind().skip_binder())
|
||||||
{
|
{
|
||||||
if let ty::Adt(def, _) = p.trait_ref.self_ty().kind() {
|
let node = match p.trait_ref.self_ty().kind() {
|
||||||
let node = def.did.as_local().map(|def_id| {
|
ty::Param(_) => {
|
||||||
|
// Account for `fn` items like in `issue-35677.rs` to
|
||||||
|
// suggest restricting its type params.
|
||||||
|
let did = self.tcx.hir().body_owner_def_id(hir::BodyId {
|
||||||
|
hir_id: self.body_id,
|
||||||
|
});
|
||||||
|
Some(
|
||||||
|
self.tcx
|
||||||
|
.hir()
|
||||||
|
.get(self.tcx.hir().local_def_id_to_hir_id(did)),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
ty::Adt(def, _) => def.did.as_local().map(|def_id| {
|
||||||
self.tcx
|
self.tcx
|
||||||
.hir()
|
.hir()
|
||||||
.get(self.tcx.hir().local_def_id_to_hir_id(def_id))
|
.get(self.tcx.hir().local_def_id_to_hir_id(def_id))
|
||||||
});
|
}),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
if let Some(hir::Node::Item(hir::Item { kind, .. })) = node {
|
if let Some(hir::Node::Item(hir::Item { kind, .. })) = node {
|
||||||
if let Some(g) = kind.generics() {
|
if let Some(g) = kind.generics() {
|
||||||
let key = match g.where_clause.predicates {
|
let key = match g.where_clause.predicates {
|
||||||
[.., pred] => (pred.span().shrink_to_hi(), false),
|
[.., pred] => (pred.span().shrink_to_hi(), false),
|
||||||
[] => (
|
[] => (
|
||||||
g.where_clause
|
g.where_clause.span_for_predicates_or_empty_place(),
|
||||||
.span_for_predicates_or_empty_place(),
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
@ -725,7 +740,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let mut bound_span_label = |self_ty: Ty<'_>, obligation: &str, quiet: &str| {
|
let mut bound_span_label = |self_ty: Ty<'_>, obligation: &str, quiet: &str| {
|
||||||
let msg = format!(
|
let msg = format!(
|
||||||
|
@ -791,22 +805,109 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Find all the requirements that come from a local `impl` block.
|
||||||
|
let mut skip_list: FxHashSet<_> = Default::default();
|
||||||
|
let mut spanned_predicates: FxHashMap<MultiSpan, _> = Default::default();
|
||||||
|
for (data, p, parent_p) in unsatisfied_predicates
|
||||||
|
.iter()
|
||||||
|
.filter_map(|(p, parent, c)| c.as_ref().map(|c| (p, parent, c)))
|
||||||
|
.filter_map(|(p, parent, c)| match c.code {
|
||||||
|
ObligationCauseCode::ImplDerivedObligation(ref data) => {
|
||||||
|
Some((data, p, parent))
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
{
|
||||||
|
let parent_trait_ref = data.parent_trait_ref;
|
||||||
|
let parent_def_id = parent_trait_ref.def_id();
|
||||||
|
let path = parent_trait_ref.print_only_trait_path();
|
||||||
|
let tr_self_ty = parent_trait_ref.skip_binder().self_ty();
|
||||||
|
let mut candidates = vec![];
|
||||||
|
self.tcx.for_each_relevant_impl(
|
||||||
|
parent_def_id,
|
||||||
|
parent_trait_ref.self_ty().skip_binder(),
|
||||||
|
|impl_def_id| match self.tcx.hir().get_if_local(impl_def_id) {
|
||||||
|
Some(Node::Item(hir::Item {
|
||||||
|
kind: hir::ItemKind::Impl(hir::Impl { .. }),
|
||||||
|
..
|
||||||
|
})) => {
|
||||||
|
candidates.push(impl_def_id);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if let [def_id] = &candidates[..] {
|
||||||
|
match self.tcx.hir().get_if_local(*def_id) {
|
||||||
|
Some(Node::Item(hir::Item {
|
||||||
|
kind: hir::ItemKind::Impl(hir::Impl { of_trait, self_ty, .. }),
|
||||||
|
..
|
||||||
|
})) => {
|
||||||
|
if let Some(pred) = parent_p {
|
||||||
|
// Done to add the "doesn't satisfy" `span_label`.
|
||||||
|
let _ = format_pred(*pred);
|
||||||
|
}
|
||||||
|
skip_list.insert(p);
|
||||||
|
let mut spans = Vec::with_capacity(2);
|
||||||
|
if let Some(trait_ref) = of_trait {
|
||||||
|
spans.push(trait_ref.path.span);
|
||||||
|
}
|
||||||
|
spans.push(self_ty.span);
|
||||||
|
let entry = spanned_predicates.entry(spans.into());
|
||||||
|
entry
|
||||||
|
.or_insert_with(|| (path, tr_self_ty, Vec::new()))
|
||||||
|
.2
|
||||||
|
.push(p);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (span, (path, self_ty, preds)) in spanned_predicates {
|
||||||
|
err.span_note(
|
||||||
|
span,
|
||||||
|
&format!(
|
||||||
|
"the following trait bounds were not satisfied because of the \
|
||||||
|
requirements of the implementation of `{}` for `{}`:\n{}",
|
||||||
|
path,
|
||||||
|
self_ty,
|
||||||
|
preds
|
||||||
|
.into_iter()
|
||||||
|
// .map(|pred| format!("{:?}", pred))
|
||||||
|
.filter_map(|pred| format_pred(*pred))
|
||||||
|
.map(|(p, _)| format!("`{}`", p))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join("\n"),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The requirements that didn't have an `impl` span to show.
|
||||||
let mut bound_list = unsatisfied_predicates
|
let mut bound_list = unsatisfied_predicates
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(pred, parent_pred)| {
|
.filter(|(pred, _, _parent_pred)| !skip_list.contains(&pred))
|
||||||
format_pred(*pred).map(|(p, self_ty)| match parent_pred {
|
.filter_map(|(pred, parent_pred, _cause)| {
|
||||||
|
format_pred(*pred).map(|(p, self_ty)| {
|
||||||
|
collect_type_param_suggestions(self_ty, pred, &p);
|
||||||
|
match parent_pred {
|
||||||
None => format!("`{}`", &p),
|
None => format!("`{}`", &p),
|
||||||
Some(parent_pred) => match format_pred(*parent_pred) {
|
Some(parent_pred) => match format_pred(*parent_pred) {
|
||||||
None => format!("`{}`", &p),
|
None => format!("`{}`", &p),
|
||||||
Some((parent_p, _)) => {
|
Some((parent_p, _)) => {
|
||||||
collect_type_param_suggestions(self_ty, parent_pred, &p);
|
collect_type_param_suggestions(
|
||||||
|
self_ty,
|
||||||
|
parent_pred,
|
||||||
|
&p,
|
||||||
|
);
|
||||||
format!("`{}`\nwhich is required by `{}`", p, parent_p)
|
format!("`{}`\nwhich is required by `{}`", p, parent_p)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.collect::<Vec<(usize, String)>>();
|
.collect::<Vec<(usize, String)>>();
|
||||||
|
|
||||||
for ((span, empty_where), obligations) in type_params.into_iter() {
|
for ((span, empty_where), obligations) in type_params.into_iter() {
|
||||||
restrict_type_params = true;
|
restrict_type_params = true;
|
||||||
// #74886: Sort here so that the output is always the same.
|
// #74886: Sort here so that the output is always the same.
|
||||||
|
@ -836,7 +937,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
for (span, msg) in bound_spans.into_iter() {
|
for (span, msg) in bound_spans.into_iter() {
|
||||||
err.span_label(span, &msg);
|
err.span_label(span, &msg);
|
||||||
}
|
}
|
||||||
if !bound_list.is_empty() {
|
if !bound_list.is_empty() || !skip_list.is_empty() {
|
||||||
let bound_list = bound_list
|
let bound_list = bound_list
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(_, path)| path)
|
.map(|(_, path)| path)
|
||||||
|
@ -846,9 +947,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
err.set_primary_message(&format!(
|
err.set_primary_message(&format!(
|
||||||
"the {item_kind} `{item_name}` exists for {actual_prefix} `{ty_str}`, but its trait bounds were not satisfied"
|
"the {item_kind} `{item_name}` exists for {actual_prefix} `{ty_str}`, but its trait bounds were not satisfied"
|
||||||
));
|
));
|
||||||
|
if !bound_list.is_empty() {
|
||||||
err.note(&format!(
|
err.note(&format!(
|
||||||
"the following trait bounds were not satisfied:\n{bound_list}"
|
"the following trait bounds were not satisfied:\n{bound_list}"
|
||||||
));
|
));
|
||||||
|
}
|
||||||
self.suggest_derive(&mut err, &unsatisfied_predicates);
|
self.suggest_derive(&mut err, &unsatisfied_predicates);
|
||||||
|
|
||||||
unsatisfied_bounds = true;
|
unsatisfied_bounds = true;
|
||||||
|
@ -1062,18 +1165,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
err.span_note(spans, &msg);
|
err.span_note(spans, &msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
let preds: Vec<_> = errors.iter().map(|e| (e.obligation.predicate, None)).collect();
|
let preds: Vec<_> = errors
|
||||||
|
.iter()
|
||||||
|
.map(|e| (e.obligation.predicate, None, Some(e.obligation.cause.clone())))
|
||||||
|
.collect();
|
||||||
self.suggest_derive(err, &preds);
|
self.suggest_derive(err, &preds);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn suggest_derive(
|
fn suggest_derive(
|
||||||
&self,
|
&self,
|
||||||
err: &mut DiagnosticBuilder<'_>,
|
err: &mut DiagnosticBuilder<'_>,
|
||||||
unsatisfied_predicates: &Vec<(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>)>,
|
unsatisfied_predicates: &Vec<(
|
||||||
|
ty::Predicate<'tcx>,
|
||||||
|
Option<ty::Predicate<'tcx>>,
|
||||||
|
Option<ObligationCause<'tcx>>,
|
||||||
|
)>,
|
||||||
) {
|
) {
|
||||||
let mut derives = Vec::<(String, Span, String)>::new();
|
let mut derives = Vec::<(String, Span, String)>::new();
|
||||||
let mut traits = Vec::<Span>::new();
|
let mut traits = Vec::<Span>::new();
|
||||||
for (pred, _) in unsatisfied_predicates {
|
for (pred, _, _) in unsatisfied_predicates {
|
||||||
let trait_pred = match pred.kind().skip_binder() {
|
let trait_pred = match pred.kind().skip_binder() {
|
||||||
ty::PredicateKind::Trait(trait_pred) => trait_pred,
|
ty::PredicateKind::Trait(trait_pred) => trait_pred,
|
||||||
_ => continue,
|
_ => continue,
|
||||||
|
@ -1264,7 +1374,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
item_name: Ident,
|
item_name: Ident,
|
||||||
source: SelfSource<'tcx>,
|
source: SelfSource<'tcx>,
|
||||||
valid_out_of_scope_traits: Vec<DefId>,
|
valid_out_of_scope_traits: Vec<DefId>,
|
||||||
unsatisfied_predicates: &[(ty::Predicate<'tcx>, Option<ty::Predicate<'tcx>>)],
|
unsatisfied_predicates: &[(
|
||||||
|
ty::Predicate<'tcx>,
|
||||||
|
Option<ty::Predicate<'tcx>>,
|
||||||
|
Option<ObligationCause<'tcx>>,
|
||||||
|
)],
|
||||||
unsatisfied_bounds: bool,
|
unsatisfied_bounds: bool,
|
||||||
) {
|
) {
|
||||||
let mut alt_rcvr_sugg = false;
|
let mut alt_rcvr_sugg = false;
|
||||||
|
@ -1380,7 +1494,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
// this isn't perfect (that is, there are cases when
|
// this isn't perfect (that is, there are cases when
|
||||||
// implementing a trait would be legal but is rejected
|
// implementing a trait would be legal but is rejected
|
||||||
// here).
|
// here).
|
||||||
unsatisfied_predicates.iter().all(|(p, _)| {
|
unsatisfied_predicates.iter().all(|(p, _, _)| {
|
||||||
match p.kind().skip_binder() {
|
match p.kind().skip_binder() {
|
||||||
// Hide traits if they are present in predicates as they can be fixed without
|
// Hide traits if they are present in predicates as they can be fixed without
|
||||||
// having to implement them.
|
// having to implement them.
|
||||||
|
|
|
@ -1990,16 +1990,12 @@ fn predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicates<'_> {
|
||||||
// prove that the trait applies to the types that were
|
// prove that the trait applies to the types that were
|
||||||
// used, and adding the predicate into this list ensures
|
// used, and adding the predicate into this list ensures
|
||||||
// that this is done.
|
// that this is done.
|
||||||
let mut span = tcx.def_span(def_id);
|
//
|
||||||
if tcx.sess.source_map().is_local_span(span) {
|
// We use a DUMMY_SP here as a way to signal trait bounds that come
|
||||||
// `guess_head_span` reads the actual source file from
|
// from the trait itself that *shouldn't* be shown as the source of
|
||||||
// disk to try to determine the 'head' snippet of the span.
|
// an obligation and instead be skipped. Otherwise we'd use
|
||||||
// Don't do this for a span that comes from a file outside
|
// `tcx.def_span(def_id);`
|
||||||
// of our crate, since this would make our query output
|
let span = rustc_span::DUMMY_SP;
|
||||||
// (and overall crate metadata) dependent on the
|
|
||||||
// *current* state of an external file.
|
|
||||||
span = tcx.sess.source_map().guess_head_span(span);
|
|
||||||
}
|
|
||||||
result.predicates =
|
result.predicates =
|
||||||
tcx.arena.alloc_from_iter(result.predicates.iter().copied().chain(std::iter::once((
|
tcx.arena.alloc_from_iter(result.predicates.iter().copied().chain(std::iter::once((
|
||||||
ty::TraitRef::identity(tcx, def_id).without_const().to_predicate(tcx),
|
ty::TraitRef::identity(tcx, def_id).without_const().to_predicate(tcx),
|
||||||
|
|
|
@ -33,7 +33,7 @@ trait TraitVisibility { }
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub trait TraitVisibility { }
|
pub trait TraitVisibility { }
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ trait TraitUnsafety { }
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
unsafe trait TraitUnsafety { }
|
unsafe trait TraitUnsafety { }
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ trait TraitAddMethod {
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner,associated_item_def_ids,predicates_of", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub trait TraitAddMethod {
|
pub trait TraitAddMethod {
|
||||||
fn method();
|
fn method();
|
||||||
|
|
|
@ -6,11 +6,6 @@ LL | #[global_allocator]
|
||||||
LL | static A: usize = 0;
|
LL | static A: usize = 0;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
||||||
|
|
|
|
||||||
note: required by `std::alloc::GlobalAlloc::alloc`
|
|
||||||
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | unsafe fn alloc(&self, layout: Layout) -> *mut u8;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
||||||
|
@ -21,11 +16,6 @@ LL | #[global_allocator]
|
||||||
LL | static A: usize = 0;
|
LL | static A: usize = 0;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
||||||
|
|
|
|
||||||
note: required by `std::alloc::GlobalAlloc::dealloc`
|
|
||||||
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
||||||
|
@ -36,11 +26,6 @@ LL | #[global_allocator]
|
||||||
LL | static A: usize = 0;
|
LL | static A: usize = 0;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
||||||
|
|
|
|
||||||
note: required by `std::alloc::GlobalAlloc::realloc`
|
|
||||||
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
|
||||||
|
@ -51,11 +36,6 @@ LL | #[global_allocator]
|
||||||
LL | static A: usize = 0;
|
LL | static A: usize = 0;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
|
||||||
|
|
|
|
||||||
note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
|
|
||||||
--> $SRC_DIR/core/src/alloc/global.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
|
@ -3,12 +3,6 @@ error[E0277]: the trait bound `i32: Foo` is not satisfied
|
||||||
|
|
|
|
||||||
LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
|
LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
|
||||||
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
||||||
|
|
|
||||||
note: required by `Foo::ID`
|
|
||||||
--> $DIR/associated-const-array-len.rs:2:5
|
|
||||||
|
|
|
||||||
LL | const ID: usize;
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,6 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `_: A`
|
= note: cannot satisfy `_: A`
|
||||||
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
||||||
note: required by `A::C`
|
|
||||||
--> $DIR/issue-63496.rs:2:5
|
|
||||||
|
|
|
||||||
LL | const C: usize;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0283]: type annotations needed
|
error[E0283]: type annotations needed
|
||||||
--> $DIR/issue-63496.rs:4:33
|
--> $DIR/issue-63496.rs:4:33
|
||||||
|
@ -26,11 +21,6 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `_: A`
|
= note: cannot satisfy `_: A`
|
||||||
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
||||||
note: required by `A::C`
|
|
||||||
--> $DIR/issue-63496.rs:2:5
|
|
||||||
|
|
|
||||||
LL | const C: usize;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,6 @@ LL | fn return_n(&self) -> [u8; Bar::X];
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `_: Bar`
|
= note: cannot satisfy `_: Bar`
|
||||||
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
|
||||||
note: required by `Bar::X`
|
|
||||||
--> $DIR/issue-48027.rs:2:5
|
|
||||||
|
|
|
||||||
LL | const X: usize;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0038]: the trait `Bar` cannot be made into an object
|
error[E0038]: the trait `Bar` cannot be made into an object
|
||||||
--> $DIR/issue-48027.rs:6:6
|
--> $DIR/issue-48027.rs:6:6
|
||||||
|
|
|
@ -5,13 +5,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8
|
||||||
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
|
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
|
||||||
|
|
|
|
||||||
= help: the trait `Send` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
= help: the trait `Send` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
||||||
note: required by a bound in `Send`
|
|
||||||
--> $SRC_DIR/core/src/marker.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub unsafe auto trait Send {
|
|
||||||
LL | | // empty.
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Send`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
|
||||||
|
@ -24,17 +17,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
|
||||||
|
|
|
|
||||||
= help: the trait `Iterator` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
= help: the trait `Iterator` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
||||||
note: required by a bound in `Iterator`
|
|
||||||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub trait Iterator {
|
|
||||||
LL | | /// The type of the elements being iterated over.
|
|
||||||
LL | | #[stable(feature = "rust1", since = "1.0.0")]
|
|
||||||
LL | | type Item;
|
|
||||||
... |
|
|
||||||
LL | | }
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Iterator`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
|
||||||
|
@ -47,17 +29,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8
|
||||||
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
|
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
|
||||||
|
|
|
|
||||||
= help: the trait `Sync` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
= help: the trait `Sync` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
|
||||||
note: required by a bound in `Sync`
|
|
||||||
--> $SRC_DIR/core/src/marker.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub unsafe auto trait Sync {
|
|
||||||
LL | | // FIXME(estebank): once support to add notes in `rustc_on_unimplemented`
|
|
||||||
LL | | // lands in beta, and it has been extended to check whether a closure is
|
|
||||||
LL | | // anywhere in the requirement chain, extend it as such (#48534):
|
|
||||||
... |
|
|
||||||
LL | | // Empty
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Sync`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
|
||||||
|
|
|
@ -5,17 +5,6 @@ LL | type A: Iterator<Item: Debug>;
|
||||||
| ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
| ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
||||||
|
|
|
|
||||||
= help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
|
= help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
|
||||||
note: required by a bound in `Debug`
|
|
||||||
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub trait Debug {
|
|
||||||
LL | | /// Formats the value using the given formatter.
|
|
||||||
LL | | ///
|
|
||||||
LL | | /// # Examples
|
|
||||||
... |
|
|
||||||
LL | | fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Debug`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug {
|
LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug {
|
||||||
|
@ -27,17 +16,6 @@ error[E0277]: the trait bound `<<Self as Foo>::Out as Baz>::Assoc: Default` is n
|
||||||
LL | pub trait Foo { type Out: Baz<Assoc: Default>; }
|
LL | pub trait Foo { type Out: Baz<Assoc: Default>; }
|
||||||
| ^^^^^^^ the trait `Default` is not implemented for `<<Self as Foo>::Out as Baz>::Assoc`
|
| ^^^^^^^ the trait `Default` is not implemented for `<<Self as Foo>::Out as Baz>::Assoc`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Default`
|
|
||||||
--> $SRC_DIR/core/src/default.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub trait Default: Sized {
|
|
||||||
LL | | /// Returns the "default value" for a type.
|
|
||||||
LL | | ///
|
|
||||||
LL | | /// Default values are often some kind of initial value, identity value, or anything else that
|
|
||||||
... |
|
|
||||||
LL | | fn default() -> Self;
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Default`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; }
|
LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; }
|
||||||
|
|
|
@ -6,11 +6,6 @@ LL | ToInt::to_int(&g.get())
|
||||||
| |
|
| |
|
||||||
| required by a bound introduced by this call
|
| required by a bound introduced by this call
|
||||||
|
|
|
|
||||||
note: required by `ToInt::to_int`
|
|
||||||
--> $DIR/associated-types-bound-failure.rs:6:5
|
|
||||||
|
|
|
||||||
LL | fn to_int(&self) -> isize;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | where G : GetToInt, <G as GetToInt>::R: ToInt
|
LL | where G : GetToInt, <G as GetToInt>::R: ToInt
|
||||||
|
|
|
@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-for-unimpl-trait.rs:4:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
||||||
|
|
|
@ -4,11 +4,6 @@ error[E0277]: the trait bound `T: Get` is not satisfied
|
||||||
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
|
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
|
||||||
| ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
| ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-no-suitable-bound.rs:1:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
help: consider restricting type parameter `T`
|
help: consider restricting type parameter `T`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
|
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
|
||||||
|
|
|
@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-no-suitable-supertrait-2.rs:12:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
||||||
|
|
|
@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-no-suitable-supertrait.rs:12:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
|
||||||
|
@ -19,12 +14,6 @@ error[E0277]: the trait bound `(T, U): Get` is not satisfied
|
||||||
|
|
|
|
||||||
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
|
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
|
||||||
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-no-suitable-supertrait.rs:12:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied
|
||||||
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Get`
|
|
||||||
--> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:5:1
|
|
||||||
|
|
|
||||||
LL | trait Get {
|
|
||||||
| ^^^^^^^^^ required by this bound in `Get`
|
|
||||||
help: consider further restricting `Self`
|
help: consider further restricting `Self`
|
||||||
|
|
|
|
||||||
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get;
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get;
|
||||||
|
|
|
@ -5,11 +5,6 @@ LL | let x: isize = Foo::bar();
|
||||||
| ^^^^^^^^ cannot infer type
|
| ^^^^^^^^ cannot infer type
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `_: Foo`
|
= note: cannot satisfy `_: Foo`
|
||||||
note: required by `Foo::bar`
|
|
||||||
--> $DIR/associated-types-unconstrained.rs:5:5
|
|
||||||
|
|
|
||||||
LL | fn bar() -> isize;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,6 @@ note: required because of the requirements on the impl of `Visit` for `()`
|
||||||
|
|
|
|
||||||
LL | impl<'a> Visit for () where
|
LL | impl<'a> Visit for () where
|
||||||
| ^^^^^ ^^
|
| ^^^^^ ^^
|
||||||
note: required by `Visit::visit`
|
|
||||||
--> $DIR/issue-44153.rs:6:5
|
|
||||||
|
|
|
||||||
LL | fn visit() {}
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -82,11 +82,6 @@ note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for
|
||||||
|
|
|
|
||||||
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
|
||||||
| ^^^^^^^^^^^^^^ ^
|
| ^^^^^^^^^^^^^^ ^
|
||||||
note: required by a bound in `Foo::bar`
|
|
||||||
--> $DIR/substs-ppaux.rs:7:30
|
|
||||||
|
|
|
||||||
LL | fn bar<'a, T>() where T: 'a {}
|
|
||||||
| ^^ required by this bound in `Foo::bar`
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
|
@ -82,11 +82,6 @@ note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>
|
||||||
|
|
|
|
||||||
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
|
||||||
| ^^^^^^^^^^^^^^ ^
|
| ^^^^^^^^^^^^^^ ^
|
||||||
note: required by a bound in `Foo::bar`
|
|
||||||
--> $DIR/substs-ppaux.rs:7:30
|
|
||||||
|
|
|
||||||
LL | fn bar<'a, T>() where T: 'a {}
|
|
||||||
| ^^ required by this bound in `Foo::bar`
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
|
@ -42,12 +42,10 @@ async fn bar() -> Result<(), ()> {
|
||||||
foo()?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
|
foo()?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
|
||||||
//~^ NOTE the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
|
//~^ NOTE the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
|
||||||
//~| HELP the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
|
//~| HELP the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
|
||||||
//~| NOTE required by `branch`
|
|
||||||
//~| HELP consider `await`ing on the `Future`
|
//~| HELP consider `await`ing on the `Future`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,12 +65,10 @@ async fn baz() -> Result<(), ()> {
|
||||||
t?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
|
t?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
|
||||||
//~^ NOTE the `?` operator cannot be applied to type `T`
|
//~^ NOTE the `?` operator cannot be applied to type `T`
|
||||||
//~| HELP the trait `Try` is not implemented for `T`
|
//~| HELP the trait `Try` is not implemented for `T`
|
||||||
//~| NOTE required by `branch`
|
|
||||||
//~| HELP consider `await`ing on the `Future`
|
//~| HELP consider `await`ing on the `Future`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
//~| NOTE in this expansion of desugaring of operator `?`
|
||||||
//~| NOTE in this expansion of desugaring of operator `?`
|
|
||||||
|
|
||||||
|
|
||||||
let _: i32 = tuple().0; //~ ERROR no field `0`
|
let _: i32 = tuple().0; //~ ERROR no field `0`
|
||||||
|
|
|
@ -5,35 +5,25 @@ LL | foo()?;
|
||||||
| ^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
|
| ^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
|
||||||
|
|
|
|
||||||
= help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
|
= help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
|
||||||
note: required by `branch`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
help: consider `await`ing on the `Future`
|
help: consider `await`ing on the `Future`
|
||||||
|
|
|
|
||||||
LL | foo().await?;
|
LL | foo().await?;
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error[E0277]: the `?` operator can only be applied to values that implement `Try`
|
error[E0277]: the `?` operator can only be applied to values that implement `Try`
|
||||||
--> $DIR/issue-61076.rs:67:5
|
--> $DIR/issue-61076.rs:65:5
|
||||||
|
|
|
|
||||||
LL | t?;
|
LL | t?;
|
||||||
| ^^ the `?` operator cannot be applied to type `T`
|
| ^^ the `?` operator cannot be applied to type `T`
|
||||||
|
|
|
|
||||||
= help: the trait `Try` is not implemented for `T`
|
= help: the trait `Try` is not implemented for `T`
|
||||||
note: required by `branch`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
help: consider `await`ing on the `Future`
|
help: consider `await`ing on the `Future`
|
||||||
|
|
|
|
||||||
LL | t.await?;
|
LL | t.await?;
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error[E0609]: no field `0` on type `impl Future<Output = Tuple>`
|
error[E0609]: no field `0` on type `impl Future<Output = Tuple>`
|
||||||
--> $DIR/issue-61076.rs:78:26
|
--> $DIR/issue-61076.rs:74:26
|
||||||
|
|
|
|
||||||
LL | let _: i32 = tuple().0;
|
LL | let _: i32 = tuple().0;
|
||||||
| ^ field not available in `impl Future`, but it is available in its `Output`
|
| ^ field not available in `impl Future`, but it is available in its `Output`
|
||||||
|
@ -44,7 +34,7 @@ LL | let _: i32 = tuple().await.0;
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error[E0609]: no field `a` on type `impl Future<Output = Struct>`
|
error[E0609]: no field `a` on type `impl Future<Output = Struct>`
|
||||||
--> $DIR/issue-61076.rs:82:28
|
--> $DIR/issue-61076.rs:78:28
|
||||||
|
|
|
|
||||||
LL | let _: i32 = struct_().a;
|
LL | let _: i32 = struct_().a;
|
||||||
| ^ field not available in `impl Future`, but it is available in its `Output`
|
| ^ field not available in `impl Future`, but it is available in its `Output`
|
||||||
|
@ -55,7 +45,7 @@ LL | let _: i32 = struct_().await.a;
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error[E0599]: no method named `method` found for opaque type `impl Future<Output = Struct>` in the current scope
|
error[E0599]: no method named `method` found for opaque type `impl Future<Output = Struct>` in the current scope
|
||||||
--> $DIR/issue-61076.rs:86:15
|
--> $DIR/issue-61076.rs:82:15
|
||||||
|
|
|
|
||||||
LL | struct_().method();
|
LL | struct_().method();
|
||||||
| ^^^^^^ method not found in `impl Future<Output = Struct>`
|
| ^^^^^^ method not found in `impl Future<Output = Struct>`
|
||||||
|
@ -66,13 +56,13 @@ LL | struct_().await.method();
|
||||||
| ++++++
|
| ++++++
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-61076.rs:94:9
|
--> $DIR/issue-61076.rs:90:9
|
||||||
|
|
|
|
||||||
LL | Tuple(_) => {}
|
LL | Tuple(_) => {}
|
||||||
| ^^^^^^^^ expected opaque type, found struct `Tuple`
|
| ^^^^^^^^ expected opaque type, found struct `Tuple`
|
||||||
|
|
|
|
||||||
note: while checking the return type of the `async fn`
|
note: while checking the return type of the `async fn`
|
||||||
--> $DIR/issue-61076.rs:58:21
|
--> $DIR/issue-61076.rs:56:21
|
||||||
|
|
|
|
||||||
LL | async fn tuple() -> Tuple {
|
LL | async fn tuple() -> Tuple {
|
||||||
| ^^^^^ checked the `Output` of this `async fn`, expected opaque type
|
| ^^^^^ checked the `Output` of this `async fn`, expected opaque type
|
||||||
|
|
|
@ -25,11 +25,6 @@ LL | [1; ().await];
|
||||||
| ^^^^^^^^ `()` is not a future
|
| ^^^^^^^^ `()` is not a future
|
||||||
|
|
|
|
||||||
= help: the trait `Future` is not implemented for `()`
|
= help: the trait `Future` is not implemented for `()`
|
||||||
note: required by `poll`
|
|
||||||
--> $SRC_DIR/core/src/future/future.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,6 @@ LL | test()?;
|
||||||
| ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>`
|
| ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>`
|
||||||
|
|
|
|
||||||
= help: the trait `Try` is not implemented for `impl Future<Output = ()>`
|
= help: the trait `Try` is not implemented for `impl Future<Output = ()>`
|
||||||
note: required by `branch`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
||||||
--> $DIR/issue-84841.rs:9:11
|
--> $DIR/issue-84841.rs:9:11
|
||||||
|
@ -25,11 +20,6 @@ LL | | }
|
||||||
| |_- this function should return `Result` or `Option` to accept `?`
|
| |_- this function should return `Result` or `Option` to accept `?`
|
||||||
|
|
|
|
||||||
= help: the trait `FromResidual<_>` is not implemented for `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
|
||||||
note: required by `from_residual`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn from_residual(residual: R) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -34,11 +34,6 @@ LL | (|_| 2333).await;
|
||||||
| ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
|
| ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
|
||||||
|
|
|
|
||||||
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
|
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
|
||||||
note: required by `poll`
|
|
||||||
--> $SRC_DIR/core/src/future/future.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ note: required because it appears within the type `Sleep`
|
||||||
|
|
|
|
||||||
LL | struct Sleep(std::marker::PhantomPinned);
|
LL | struct Sleep(std::marker::PhantomPinned);
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
note: required by `Pin::<P>::new`
|
note: required by a bound in `Pin::<P>::new`
|
||||||
--> $SRC_DIR/core/src/pin.rs:LL:COL
|
--> $SRC_DIR/core/src/pin.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | pub const fn new(pointer: P) -> Pin<P> {
|
LL | impl<P: Deref<Target: Unpin>> Pin<P> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^ required by this bound in `Pin::<P>::new`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,6 @@ LL | | }
|
||||||
| |_____- this function should return `Result` or `Option` to accept `?`
|
| |_____- this function should return `Result` or `Option` to accept `?`
|
||||||
|
|
|
|
||||||
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}`
|
||||||
note: required by `from_residual`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn from_residual(residual: R) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
||||||
--> $DIR/try-on-option-in-async.rs:17:10
|
--> $DIR/try-on-option-in-async.rs:17:10
|
||||||
|
@ -30,11 +25,6 @@ LL | | };
|
||||||
| |_____- this function should return `Result` or `Option` to accept `?`
|
| |_____- this function should return `Result` or `Option` to accept `?`
|
||||||
|
|
|
|
||||||
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
|
||||||
note: required by `from_residual`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn from_residual(residual: R) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
|
||||||
--> $DIR/try-on-option-in-async.rs:26:6
|
--> $DIR/try-on-option-in-async.rs:26:6
|
||||||
|
@ -49,11 +39,6 @@ LL | | }
|
||||||
| |_- this function should return `Result` or `Option` to accept `?`
|
| |_- this function should return `Result` or `Option` to accept `?`
|
||||||
|
|
|
|
||||||
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
|
||||||
note: required by `from_residual`
|
|
||||||
--> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn from_residual(residual: R) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ error: unexpected token: `{
|
||||||
::core::fmt::Display::fmt)],
|
::core::fmt::Display::fmt)],
|
||||||
}));
|
}));
|
||||||
res
|
res
|
||||||
}.as_str()`
|
}.as_str()`
|
||||||
--> $DIR/key-value-expansion.rs:48:23
|
--> $DIR/key-value-expansion.rs:48:23
|
||||||
|
|
|
|
||||||
LL | doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}
|
LL | doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}
|
||||||
|
|
|
@ -64,13 +64,13 @@ LL | fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) {
|
||||||
| ^ lifetimes do not match method in trait
|
| ^ lifetimes do not match method in trait
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:49:5
|
--> $DIR/regions-bound-missing-bound-in-impl.rs:49:26
|
||||||
|
|
|
|
||||||
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
|
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
|
||||||
| ------------------------------------------------------- definition of `another_bound` from trait
|
| ------------------------------------------------------- definition of `another_bound` from trait
|
||||||
...
|
...
|
||||||
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
|
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't`
|
| ^^ impl has extra requirement `'x: 't`
|
||||||
|
|
||||||
error: aborting due to 6 previous errors
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ LL | let _ = Box::into_boxed_slice(boxed_slice);
|
||||||
| required by a bound introduced by this call
|
| required by a bound introduced by this call
|
||||||
|
|
|
|
||||||
= help: the trait `Sized` is not implemented for `[u8]`
|
= help: the trait `Sized` is not implemented for `[u8]`
|
||||||
note: required by `Box::<T, A>::into_boxed_slice`
|
note: required by a bound in `Box::<T, A>::into_boxed_slice`
|
||||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
|
LL | impl<T, A: Allocator> Box<T, A> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^ required by this bound in `Box::<T, A>::into_boxed_slice`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
||||||
--> $DIR/into-boxed-slice-fail.rs:7:13
|
--> $DIR/into-boxed-slice-fail.rs:7:13
|
||||||
|
@ -31,11 +31,11 @@ LL | let _ = Box::into_boxed_slice(boxed_trait);
|
||||||
| required by a bound introduced by this call
|
| required by a bound introduced by this call
|
||||||
|
|
|
|
||||||
= help: the trait `Sized` is not implemented for `dyn Debug`
|
= help: the trait `Sized` is not implemented for `dyn Debug`
|
||||||
note: required by `Box::<T, A>::into_boxed_slice`
|
note: required by a bound in `Box::<T, A>::into_boxed_slice`
|
||||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
|
LL | impl<T, A: Allocator> Box<T, A> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^ required by this bound in `Box::<T, A>::into_boxed_slice`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
|
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
|
||||||
--> $DIR/into-boxed-slice-fail.rs:11:13
|
--> $DIR/into-boxed-slice-fail.rs:11:13
|
||||||
|
|
|
@ -7,11 +7,11 @@ LL | let s = S {
|
||||||
= help: the following implementations were found:
|
= help: the following implementations were found:
|
||||||
<Option<T> as Foo>
|
<Option<T> as Foo>
|
||||||
<i32 as Foo>
|
<i32 as Foo>
|
||||||
note: required by `S`
|
note: required by a bound in `S`
|
||||||
--> $DIR/type_wf.rs:6:1
|
--> $DIR/type_wf.rs:6:13
|
||||||
|
|
|
|
||||||
LL | struct S<T: Foo> {
|
LL | struct S<T: Foo> {
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^ required by this bound in `S`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,11 @@ LL | let y = x.or_else(4);
|
||||||
|
|
|
|
||||||
= help: the trait `FnOnce<()>` is not implemented for `{integer}`
|
= help: the trait `FnOnce<()>` is not implemented for `{integer}`
|
||||||
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
|
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
|
||||||
|
note: required by a bound in `Option::<T>::or_else`
|
||||||
|
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||||
|
|
|
||||||
|
LL | pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::or_else`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,11 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
|
||||||
| required by a bound introduced by this call
|
| required by a bound introduced by this call
|
||||||
|
|
|
|
||||||
= help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
|
= help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
|
||||||
|
note: required by a bound in `Option::<T>::map`
|
||||||
|
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||||
|
|
|
||||||
|
LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
|
||||||
|
| ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
error: <unknown>:0:0: in function test i32 (i32, i32, i32, i32, i32): call to non-secure function would require passing arguments on stack
|
error: <unknown>:0:0: in function test i32 (i32, i32, i32, i32, i32): call to non-secure function would require passing arguments on stack
|
||||||
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack
|
error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack
|
||||||
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,6 @@ LL | impl<T: AB> C for T {}
|
||||||
LL | #[rustc_strict_coherence]
|
LL | #[rustc_strict_coherence]
|
||||||
LL | impl C for u32 {}
|
LL | impl C for u32 {}
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
note: required by a bound in `C`
|
|
||||||
--> $DIR/coherence-overlap-trait-alias.rs:11:1
|
|
||||||
|
|
|
||||||
LL | trait C {}
|
|
||||||
| ^^^^^^^ required by this bound in `C`
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/proj-outlives-region.rs:9:5
|
--> $DIR/proj-outlives-region.rs:9:23
|
||||||
|
|
|
|
||||||
LL | fn foo() where T: 'a;
|
LL | fn foo() where T: 'a;
|
||||||
| --------------------- definition of `foo` from trait
|
| --------------------- definition of `foo` from trait
|
||||||
...
|
...
|
||||||
LL | fn foo() where U: 'a { }
|
LL | fn foo() where U: 'a { }
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a`
|
| ^^ impl has extra requirement `U: 'a`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/region-extra-2.rs:9:5
|
--> $DIR/region-extra-2.rs:9:53
|
||||||
|
|
|
|
||||||
LL | fn renew<'b: 'a>(self) -> &'b mut [T];
|
LL | fn renew<'b: 'a>(self) -> &'b mut [T];
|
||||||
| -------------------------------------- definition of `renew` from trait
|
| -------------------------------------- definition of `renew` from trait
|
||||||
...
|
...
|
||||||
LL | fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
|
LL | fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
|
| ^^ impl has extra requirement `'a: 'b`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/region-extra.rs:9:5
|
--> $DIR/region-extra.rs:9:24
|
||||||
|
|
|
|
||||||
LL | fn foo();
|
LL | fn foo();
|
||||||
| --------- definition of `foo` from trait
|
| --------- definition of `foo` from trait
|
||||||
...
|
...
|
||||||
LL | fn foo() where 'a: 'b { }
|
LL | fn foo() where 'a: 'b { }
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
|
| ^^ impl has extra requirement `'a: 'b`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/region-unrelated.rs:9:5
|
--> $DIR/region-unrelated.rs:9:23
|
||||||
|
|
|
|
||||||
LL | fn foo() where T: 'a;
|
LL | fn foo() where T: 'a;
|
||||||
| --------------------- definition of `foo` from trait
|
| --------------------- definition of `foo` from trait
|
||||||
...
|
...
|
||||||
LL | fn foo() where V: 'a { }
|
LL | fn foo() where V: 'a { }
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a`
|
| ^^ impl has extra requirement `V: 'a`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/trait-bound-on-type-parameter.rs:15:5
|
--> $DIR/trait-bound-on-type-parameter.rs:15:13
|
||||||
|
|
|
|
||||||
LL | fn b<C,D>(&self, x: C) -> C;
|
LL | fn b<C,D>(&self, x: C) -> C;
|
||||||
| ---------------------------- definition of `b` from trait
|
| ---------------------------- definition of `b` from trait
|
||||||
...
|
...
|
||||||
LL | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() }
|
LL | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() }
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: Sync`
|
| ^^^^ impl has extra requirement `F: Sync`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,65 +1,65 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:27:5
|
--> $DIR/traits-misc-mismatch-1.rs:27:26
|
||||||
|
|
|
|
||||||
LL | fn test_error1_fn<T: Eq>(&self);
|
LL | fn test_error1_fn<T: Eq>(&self);
|
||||||
| -------------------------------- definition of `test_error1_fn` from trait
|
| -------------------------------- definition of `test_error1_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error1_fn<T: Ord>(&self) {}
|
LL | fn test_error1_fn<T: Ord>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Ord`
|
| ^^^ impl has extra requirement `T: Ord`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:31:5
|
--> $DIR/traits-misc-mismatch-1.rs:31:31
|
||||||
|
|
|
|
||||||
LL | fn test_error2_fn<T: Eq + Ord>(&self);
|
LL | fn test_error2_fn<T: Eq + Ord>(&self);
|
||||||
| -------------------------------------- definition of `test_error2_fn` from trait
|
| -------------------------------------- definition of `test_error2_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error2_fn<T: Eq + B>(&self) {}
|
LL | fn test_error2_fn<T: Eq + B>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
| ^ impl has extra requirement `T: B`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:35:5
|
--> $DIR/traits-misc-mismatch-1.rs:35:26
|
||||||
|
|
|
|
||||||
LL | fn test_error3_fn<T: Eq + Ord>(&self);
|
LL | fn test_error3_fn<T: Eq + Ord>(&self);
|
||||||
| -------------------------------------- definition of `test_error3_fn` from trait
|
| -------------------------------------- definition of `test_error3_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error3_fn<T: B + Eq>(&self) {}
|
LL | fn test_error3_fn<T: B + Eq>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
| ^ impl has extra requirement `T: B`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:45:5
|
--> $DIR/traits-misc-mismatch-1.rs:45:26
|
||||||
|
|
|
|
||||||
LL | fn test_error5_fn<T: A>(&self);
|
LL | fn test_error5_fn<T: A>(&self);
|
||||||
| ------------------------------- definition of `test_error5_fn` from trait
|
| ------------------------------- definition of `test_error5_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error5_fn<T: B>(&self) {}
|
LL | fn test_error5_fn<T: B>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
| ^ impl has extra requirement `T: B`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:51:5
|
--> $DIR/traits-misc-mismatch-1.rs:51:30
|
||||||
|
|
|
|
||||||
LL | fn test_error7_fn<T: A>(&self);
|
LL | fn test_error7_fn<T: A>(&self);
|
||||||
| ------------------------------- definition of `test_error7_fn` from trait
|
| ------------------------------- definition of `test_error7_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error7_fn<T: A + Eq>(&self) {}
|
LL | fn test_error7_fn<T: A + Eq>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Eq`
|
| ^^ impl has extra requirement `T: Eq`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:54:5
|
--> $DIR/traits-misc-mismatch-1.rs:54:26
|
||||||
|
|
|
|
||||||
LL | fn test_error8_fn<T: B>(&self);
|
LL | fn test_error8_fn<T: B>(&self);
|
||||||
| ------------------------------- definition of `test_error8_fn` from trait
|
| ------------------------------- definition of `test_error8_fn` from trait
|
||||||
...
|
...
|
||||||
LL | fn test_error8_fn<T: C>(&self) {}
|
LL | fn test_error8_fn<T: C>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: C`
|
| ^ impl has extra requirement `T: C`
|
||||||
|
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-1.rs:67:5
|
--> $DIR/traits-misc-mismatch-1.rs:67:18
|
||||||
|
|
|
|
||||||
LL | fn method<G:Getter<isize>>(&self);
|
LL | fn method<G:Getter<isize>>(&self);
|
||||||
| ---------------------------------- definition of `method` from trait
|
| ---------------------------------- definition of `method` from trait
|
||||||
...
|
...
|
||||||
LL | fn method<G: Getter<usize>>(&self) {}
|
LL | fn method<G: Getter<usize>>(&self) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`
|
| ^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`
|
||||||
|
|
||||||
error: aborting due to 7 previous errors
|
error: aborting due to 7 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/traits-misc-mismatch-2.rs:13:5
|
--> $DIR/traits-misc-mismatch-2.rs:13:18
|
||||||
|
|
|
|
||||||
LL | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
|
LL | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
|
||||||
| ------------------------------------------------------------------ definition of `zip` from trait
|
| ------------------------------------------------------------------ definition of `zip` from trait
|
||||||
...
|
...
|
||||||
LL | fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
|
LL | fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: Iterator<B>`
|
| ^^^^^^^^^^^ impl has extra requirement `U: Iterator<B>`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,6 @@ LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>;
|
||||||
|
|
|
|
||||||
= help: the following implementations were found:
|
= help: the following implementations were found:
|
||||||
<() as Trait<3_u8>>
|
<() as Trait<3_u8>>
|
||||||
note: required by `WhereClause`
|
|
||||||
--> $DIR/wfness.rs:8:1
|
|
||||||
|
|
|
||||||
LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the trait bound `(): Trait<1_u8>` is not satisfied
|
error[E0277]: the trait bound `(): Trait<1_u8>` is not satisfied
|
||||||
--> $DIR/wfness.rs:16:13
|
--> $DIR/wfness.rs:16:13
|
||||||
|
|
|
@ -3,12 +3,6 @@ error[E0277]: the trait bound `[Adt; _]: Foo` is not satisfied
|
||||||
|
|
|
|
||||||
LL | <[Adt; std::mem::size_of::<Self::Assoc>()] as Foo>::bar()
|
LL | <[Adt; std::mem::size_of::<Self::Assoc>()] as Foo>::bar()
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `[Adt; _]`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `[Adt; _]`
|
||||||
|
|
|
||||||
note: required by `Foo::bar`
|
|
||||||
--> $DIR/dont-evaluate-array-len-on-err-1.rs:19:5
|
|
||||||
|
|
|
||||||
LL | fn bar() {}
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,6 @@ LL | <() as Foo<N>>::test()
|
||||||
<() as Foo<101_u8>>
|
<() as Foo<101_u8>>
|
||||||
<() as Foo<102_u8>>
|
<() as Foo<102_u8>>
|
||||||
and 252 others
|
and 252 others
|
||||||
note: required by `Foo::test`
|
|
||||||
--> $DIR/exhaustive-value.rs:2:5
|
|
||||||
|
|
|
||||||
LL | fn test() {}
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -41,11 +41,6 @@ LL | IsLessOrEqual<I, 8>: True,
|
||||||
| ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
|
| ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
|
= note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
|
||||||
note: required by a bound in `True`
|
|
||||||
--> $DIR/issue-72787.rs:8:1
|
|
||||||
|
|
|
||||||
LL | pub trait True {}
|
|
||||||
| ^^^^^^^^^^^^^^ required by this bound in `True`
|
|
||||||
|
|
||||||
error[E0283]: type annotations needed
|
error[E0283]: type annotations needed
|
||||||
--> $DIR/issue-72787.rs:21:26
|
--> $DIR/issue-72787.rs:21:26
|
||||||
|
@ -54,11 +49,6 @@ LL | IsLessOrEqual<I, 8>: True,
|
||||||
| ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
|
| ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
|
= note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
|
||||||
note: required by a bound in `True`
|
|
||||||
--> $DIR/issue-72787.rs:8:1
|
|
||||||
|
|
|
||||||
LL | pub trait True {}
|
|
||||||
| ^^^^^^^^^^^^^^ required by this bound in `True`
|
|
||||||
|
|
||||||
error: aborting due to 6 previous errors
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,11 @@ LL | self.reference.size()
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
|
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
|
||||||
|
note: required by a bound in `TensorSize::size`
|
||||||
|
--> $DIR/issue-83765.rs:9:31
|
||||||
|
|
|
||||||
|
LL | fn size(&self) -> [usize; Self::DIM];
|
||||||
|
| ^^^^^^^^^ required by this bound in `TensorSize::size`
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-83765.rs:32:9
|
--> $DIR/issue-83765.rs:32:9
|
||||||
|
|
|
@ -6,13 +6,11 @@ LL | let _ = A;
|
||||||
|
|
|
|
||||||
= help: the following implementations were found:
|
= help: the following implementations were found:
|
||||||
<A<7_usize> as Bar<N>>
|
<A<7_usize> as Bar<N>>
|
||||||
note: required by `A`
|
note: required by a bound in `A`
|
||||||
--> $DIR/unused-substs-1.rs:7:1
|
--> $DIR/unused-substs-1.rs:9:11
|
||||||
|
|
|
|
||||||
LL | / struct A<const N: usize>
|
LL | A<N>: Bar<N>;
|
||||||
LL | | where
|
| ^^^^^^ required by this bound in `A`
|
||||||
LL | | A<N>: Bar<N>;
|
|
||||||
| |_________________^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,16 @@ LL | struct NotClone;
|
||||||
LL | Bar::<NotClone> { x: 1 }.clone();
|
LL | Bar::<NotClone> { x: 1 }.clone();
|
||||||
| ^^^^^ method cannot be called on `Bar<NotClone>` due to unsatisfied trait bounds
|
| ^^^^^ method cannot be called on `Bar<NotClone>` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `Clone` for `_`:
|
||||||
`NotClone: Clone`
|
`NotClone: Clone`
|
||||||
which is required by `Bar<NotClone>: Clone`
|
--> $DIR/derive-assoc-type-not-impl.rs:6:10
|
||||||
|
|
|
||||||
|
LL | #[derive(Clone)]
|
||||||
|
| ^^^^^
|
||||||
= help: items from traits can only be used if the trait is implemented and in scope
|
= help: items from traits can only be used if the trait is implemented and in scope
|
||||||
= note: the following trait defines an item `clone`, perhaps you need to implement it:
|
= note: the following trait defines an item `clone`, perhaps you need to implement it:
|
||||||
candidate #1: `Clone`
|
candidate #1: `Clone`
|
||||||
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
||||||
|
|
|
|
||||||
LL | #[derive(Clone)]
|
LL | #[derive(Clone)]
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Clone)]
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `clone`
|
|
||||||
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn clone(&self) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Clone)]
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `clone`
|
|
||||||
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn clone(&self) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct {
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `clone`
|
|
||||||
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn clone(&self) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct(
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `clone`
|
|
||||||
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn clone(&self) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct {
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Default` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Default` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::default::Default::default`
|
|
||||||
--> $SRC_DIR/core/src/default.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn default() -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct(
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Default` is not implemented for `Error`
|
| ^^^^^ the trait `Default` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::default::Default::default`
|
|
||||||
--> $SRC_DIR/core/src/default.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn default() -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Hash)]
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by a bound in `std::hash::Hash::hash`
|
|
||||||
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn hash<H: Hasher>(&self, state: &mut H);
|
|
||||||
| ^ required by this bound in `std::hash::Hash::hash`
|
|
||||||
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Hash)]
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by a bound in `std::hash::Hash::hash`
|
|
||||||
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn hash<H: Hasher>(&self, state: &mut H);
|
|
||||||
| ^ required by this bound in `std::hash::Hash::hash`
|
|
||||||
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct {
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by a bound in `std::hash::Hash::hash`
|
|
||||||
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn hash<H: Hasher>(&self, state: &mut H);
|
|
||||||
| ^ required by this bound in `std::hash::Hash::hash`
|
|
||||||
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct(
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by a bound in `std::hash::Hash::hash`
|
|
||||||
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn hash<H: Hasher>(&self, state: &mut H);
|
|
||||||
| ^ required by this bound in `std::hash::Hash::hash`
|
|
||||||
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::cmp::Ord::cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn cmp(&self, other: &Self) -> Ordering;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::cmp::Ord::cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn cmp(&self, other: &Self) -> Ordering;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct {
|
||||||
LL | x: Error
|
LL | x: Error
|
||||||
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::cmp::Ord::cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn cmp(&self, other: &Self) -> Ordering;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -7,11 +7,6 @@ LL | struct Struct(
|
||||||
LL | Error
|
LL | Error
|
||||||
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
||||||
|
|
|
|
||||||
note: required by `std::cmp::Ord::cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn cmp(&self, other: &Self) -> Ordering;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -8,11 +8,6 @@ LL | x: Error
|
||||||
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
||||||
|
|
|
|
||||||
= help: the trait `PartialOrd` is not implemented for `Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
|
||||||
note: required by `std::cmp::PartialOrd::partial_cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -8,11 +8,6 @@ LL | Error
|
||||||
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
||||||
|
|
|
|
||||||
= help: the trait `PartialOrd` is not implemented for `Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
|
||||||
note: required by `std::cmp::PartialOrd::partial_cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -8,11 +8,6 @@ LL | x: Error
|
||||||
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
||||||
|
|
|
|
||||||
= help: the trait `PartialOrd` is not implemented for `Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
|
||||||
note: required by `std::cmp::PartialOrd::partial_cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -8,11 +8,6 @@ LL | Error
|
||||||
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
||||||
|
|
|
|
||||||
= help: the trait `PartialOrd` is not implemented for `Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
|
||||||
note: required by `std::cmp::PartialOrd::partial_cmp`
|
|
||||||
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -47,11 +47,6 @@ LL | struct C {
|
||||||
LL | x: NoCloneOrEq
|
LL | x: NoCloneOrEq
|
||||||
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NoCloneOrEq`
|
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NoCloneOrEq`
|
||||||
|
|
|
|
||||||
note: required by `clone`
|
|
||||||
--> $SRC_DIR/core/src/clone.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn clone(&self) -> Self;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
|
@ -12,11 +12,6 @@ LL | Foo::<i32>::bar(&1i8);
|
||||||
<i8 as Foo<u32>>
|
<i8 as Foo<u32>>
|
||||||
<i8 as Foo<u64>>
|
<i8 as Foo<u64>>
|
||||||
<i8 as Foo<u8>>
|
<i8 as Foo<u8>>
|
||||||
note: required by `Foo::bar`
|
|
||||||
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
|
||||||
|
|
|
||||||
LL | fn bar(&self){}
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
|
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
|
||||||
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
|
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
|
||||||
|
@ -31,11 +26,6 @@ LL | Foo::<i32>::bar(&1u8);
|
||||||
<u8 as Foo<u16>>
|
<u8 as Foo<u16>>
|
||||||
<u8 as Foo<u32>>
|
<u8 as Foo<u32>>
|
||||||
<u8 as Foo<u64>>
|
<u8 as Foo<u64>>
|
||||||
note: required by `Foo::bar`
|
|
||||||
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
|
||||||
|
|
|
||||||
LL | fn bar(&self){}
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
|
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
|
||||||
--> $DIR/issue-39802-show-5-trait-impls.rs:26:21
|
--> $DIR/issue-39802-show-5-trait-impls.rs:26:21
|
||||||
|
@ -51,11 +41,6 @@ LL | Foo::<i32>::bar(&true);
|
||||||
<bool as Foo<u16>>
|
<bool as Foo<u16>>
|
||||||
<bool as Foo<u32>>
|
<bool as Foo<u32>>
|
||||||
and 2 others
|
and 2 others
|
||||||
note: required by `Foo::bar`
|
|
||||||
--> $DIR/issue-39802-show-5-trait-impls.rs:2:5
|
|
||||||
|
|
|
||||||
LL | fn bar(&self){}
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,6 @@ LL | impl<T> Foo for T where Bar<T>: Foo {}
|
||||||
| ^^^ ^
|
| ^^^ ^
|
||||||
= note: 127 redundant requirements hidden
|
= note: 127 redundant requirements hidden
|
||||||
= note: required because of the requirements on the impl of `Foo` for `Bar<T>`
|
= note: required because of the requirements on the impl of `Foo` for `Bar<T>`
|
||||||
note: required by a bound in `Foo`
|
|
||||||
--> $DIR/E0275.rs:1:1
|
|
||||||
|
|
|
||||||
LL | trait Foo {}
|
|
||||||
| ^^^^^^^^^ required by this bound in `Foo`
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/E0276.rs:6:5
|
--> $DIR/E0276.rs:6:30
|
||||||
|
|
|
|
||||||
LL | fn foo<T>(x: T);
|
LL | fn foo<T>(x: T);
|
||||||
| ---------------- definition of `foo` from trait
|
| ---------------- definition of `foo` from trait
|
||||||
...
|
...
|
||||||
LL | fn foo<T>(x: T) where T: Copy {}
|
LL | fn foo<T>(x: T) where T: Copy {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Copy`
|
| ^^^^ impl has extra requirement `T: Copy`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,6 @@ LL | let cont: u32 = Generator::create();
|
||||||
| ^^^^^^^^^^^^^^^^^ cannot infer type
|
| ^^^^^^^^^^^^^^^^^ cannot infer type
|
||||||
|
|
|
|
||||||
= note: cannot satisfy `_: Generator`
|
= note: cannot satisfy `_: Generator`
|
||||||
note: required by `Generator::create`
|
|
||||||
--> $DIR/E0283.rs:2:5
|
|
||||||
|
|
|
||||||
LL | fn create() -> u32;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0283]: type annotations needed
|
error[E0283]: type annotations needed
|
||||||
--> $DIR/E0283.rs:35:24
|
--> $DIR/E0283.rs:35:24
|
||||||
|
|
|
@ -20,6 +20,11 @@ LL | | });
|
||||||
| |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`
|
| |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`
|
||||||
|
|
|
|
||||||
= help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>`
|
= help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>`
|
||||||
|
note: required by a bound in `Option::<T>::and_then`
|
||||||
|
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||||
|
|
|
||||||
|
LL | pub fn and_then<U, F: FnOnce(T) -> Option<U>>(self, f: F) -> Option<U> {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -139,13 +139,6 @@ error[E0277]: the trait bound `<<Self as _Tr3>::A as Iterator>::Item: Copy` is n
|
||||||
LL | type A: Iterator<Item: Copy>;
|
LL | type A: Iterator<Item: Copy>;
|
||||||
| ^^^^ the trait `Copy` is not implemented for `<<Self as _Tr3>::A as Iterator>::Item`
|
| ^^^^ the trait `Copy` is not implemented for `<<Self as _Tr3>::A as Iterator>::Item`
|
||||||
|
|
|
|
||||||
note: required by a bound in `Copy`
|
|
||||||
--> $SRC_DIR/core/src/marker.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | / pub trait Copy: Clone {
|
|
||||||
LL | | // Empty.
|
|
||||||
LL | | }
|
|
||||||
| |_^ required by this bound in `Copy`
|
|
||||||
help: consider further restricting the associated type
|
help: consider further restricting the associated type
|
||||||
|
|
|
|
||||||
LL | trait _Tr3 where <<Self as _Tr3>::A as Iterator>::Item: Copy {
|
LL | trait _Tr3 where <<Self as _Tr3>::A as Iterator>::Item: Copy {
|
||||||
|
|
|
@ -5,11 +5,6 @@ LL | format!("{:X}", "3");
|
||||||
| ^^^ the trait `UpperHex` is not implemented for `str`
|
| ^^^ the trait `UpperHex` is not implemented for `str`
|
||||||
|
|
|
|
||||||
= note: required because of the requirements on the impl of `UpperHex` for `&str`
|
= note: required because of the requirements on the impl of `UpperHex` for `&str`
|
||||||
note: required by `std::fmt::UpperHex::fmt`
|
|
||||||
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
= 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` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -6,8 +6,6 @@ fn main() {
|
||||||
//~| NOTE `&str` is not an iterator
|
//~| NOTE `&str` is not an iterator
|
||||||
//~| HELP the trait `Iterator` is not implemented for `&str`
|
//~| HELP the trait `Iterator` is not implemented for `&str`
|
||||||
//~| NOTE required because of the requirements on the impl of `IntoIterator` for `&str`
|
//~| NOTE required because of the requirements on the impl of `IntoIterator` for `&str`
|
||||||
//~| NOTE required by `into_iter`
|
|
||||||
//~| NOTE in this expansion of desugaring of `for` loop
|
|
||||||
//~| NOTE in this expansion of desugaring of `for` loop
|
//~| NOTE in this expansion of desugaring of `for` loop
|
||||||
//~| NOTE in this expansion of desugaring of `for` loop
|
//~| NOTE in this expansion of desugaring of `for` loop
|
||||||
//~| NOTE in this expansion of desugaring of `for` loop
|
//~| NOTE in this expansion of desugaring of `for` loop
|
||||||
|
|
|
@ -6,11 +6,6 @@ LL | for c in "asdf" {
|
||||||
|
|
|
|
||||||
= help: the trait `Iterator` is not implemented for `&str`
|
= help: the trait `Iterator` is not implemented for `&str`
|
||||||
= note: required because of the requirements on the impl of `IntoIterator` for `&str`
|
= note: required because of the requirements on the impl of `IntoIterator` for `&str`
|
||||||
note: required by `into_iter`
|
|
||||||
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn into_iter(self) -> Self::IntoIter;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,6 @@ LL | for x in bogus {
|
||||||
|
|
|
|
||||||
= help: the trait `Iterator` is not implemented for `MyStruct`
|
= help: the trait `Iterator` is not implemented for `MyStruct`
|
||||||
= note: required because of the requirements on the impl of `IntoIterator` for `MyStruct`
|
= note: required because of the requirements on the impl of `IntoIterator` for `MyStruct`
|
||||||
note: required by `into_iter`
|
|
||||||
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn into_iter(self) -> Self::IntoIter;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,6 @@ LL | yield || for i in 0 { }
|
||||||
= help: the trait `Iterator` is not implemented for `{integer}`
|
= help: the trait `Iterator` is not implemented for `{integer}`
|
||||||
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
|
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
|
||||||
= note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
|
= note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
|
||||||
note: required by `into_iter`
|
|
||||||
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
|
||||||
|
|
|
||||||
LL | fn into_iter(self) -> Self::IntoIter;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,10 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
|
||||||
| +++++++++++++++++++
|
| +++++++++++++++++++
|
||||||
|
|
||||||
error[E0277]: the trait bound `T: Copy` is not satisfied
|
error[E0277]: the trait bound `T: Copy` is not satisfied
|
||||||
--> $DIR/impl_bounds.rs:22:5
|
--> $DIR/impl_bounds.rs:22:24
|
||||||
|
|
|
|
||||||
LL | fn d() where Self: Copy {}
|
LL | fn d() where Self: Copy {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
| ^^^^ the trait `Copy` is not implemented for `T`
|
||||||
|
|
|
|
||||||
note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
|
note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
|
||||||
--> $DIR/impl_bounds.rs:11:10
|
--> $DIR/impl_bounds.rs:11:10
|
||||||
|
|
|
@ -11,8 +11,9 @@ LL | | {
|
||||||
... |
|
... |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^ ...so that the type `T` will meet its required lifetime bounds...
|
| |_^
|
||||||
|
|
|
|
||||||
|
= note: ...so that the type `T` will meet its required lifetime bounds...
|
||||||
note: ...that is required by this bound
|
note: ...that is required by this bound
|
||||||
--> $DIR/issue-86483.rs:7:16
|
--> $DIR/issue-86483.rs:7:16
|
||||||
|
|
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ trait M {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: X<Y<i32> = i32>> M for T {}
|
impl<T: X<Y<i32> = i32>> M for T {}
|
||||||
|
//~^ NOTE the following trait bounds were not satisfied
|
||||||
|
|
||||||
struct S;
|
struct S;
|
||||||
//~^ NOTE method `f` not found for this
|
//~^ NOTE method `f` not found for this
|
||||||
|
@ -26,7 +27,6 @@ fn f(a: S) {
|
||||||
a.f();
|
a.f();
|
||||||
//~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied
|
//~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied
|
||||||
//~| NOTE method cannot be called on `S` due to unsatisfied trait bounds
|
//~| NOTE method cannot be called on `S` due to unsatisfied trait bounds
|
||||||
//~| NOTE the following trait bounds were not satisfied:
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0599]: the method `f` exists for struct `S`, but its trait bounds were not satisfied
|
error[E0599]: the method `f` exists for struct `S`, but its trait bounds were not satisfied
|
||||||
--> $DIR/method-unsatified-assoc-type-predicate.rs:26:7
|
--> $DIR/method-unsatified-assoc-type-predicate.rs:27:7
|
||||||
|
|
|
|
||||||
LL | struct S;
|
LL | struct S;
|
||||||
| ---------
|
| ---------
|
||||||
|
@ -11,9 +11,12 @@ LL | struct S;
|
||||||
LL | a.f();
|
LL | a.f();
|
||||||
| ^ method cannot be called on `S` due to unsatisfied trait bounds
|
| ^ method cannot be called on `S` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `M` for `_`:
|
||||||
`<S as X>::Y<i32> = i32`
|
`<S as X>::Y<i32> = i32`
|
||||||
which is required by `S: M`
|
--> $DIR/method-unsatified-assoc-type-predicate.rs:14:26
|
||||||
|
|
|
||||||
|
LL | impl<T: X<Y<i32> = i32>> M for T {}
|
||||||
|
| ^ ^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,14 @@ LL | pub struct Map<S, F> {
|
||||||
LL | let filter = map.filterx(|x: &_| true);
|
LL | let filter = map.filterx(|x: &_| true);
|
||||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds
|
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`:
|
||||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
|
||||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `&Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
|
||||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `&mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
--> $DIR/issue-30786.rs:106:9
|
||||||
|
|
|
||||||
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||||
|
| ^^^^^^^^^ ^
|
||||||
|
|
||||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied
|
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied
|
||||||
--> $DIR/issue-30786.rs:141:24
|
--> $DIR/issue-30786.rs:141:24
|
||||||
|
@ -30,13 +31,14 @@ LL | pub struct Filter<S, F> {
|
||||||
LL | let count = filter.countx();
|
LL | let count = filter.countx();
|
||||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds
|
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`:
|
||||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
|
||||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `&Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
|
||||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `&mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
--> $DIR/issue-30786.rs:106:9
|
||||||
|
|
|
||||||
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||||
|
| ^^^^^^^^^ ^
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,14 @@ LL | pub struct Map<S, F> {
|
||||||
LL | let filter = map.filterx(|x: &_| true);
|
LL | let filter = map.filterx(|x: &_| true);
|
||||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds
|
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`:
|
||||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
|
||||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `&Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
|
||||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream`
|
||||||
which is required by `&mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt`
|
--> $DIR/issue-30786.rs:106:9
|
||||||
|
|
|
||||||
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||||
|
| ^^^^^^^^^ ^
|
||||||
|
|
||||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied
|
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied
|
||||||
--> $DIR/issue-30786.rs:141:24
|
--> $DIR/issue-30786.rs:141:24
|
||||||
|
@ -30,13 +31,14 @@ LL | pub struct Filter<S, F> {
|
||||||
LL | let count = filter.countx();
|
LL | let count = filter.countx();
|
||||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds
|
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds
|
||||||
|
|
|
|
||||||
= note: the following trait bounds were not satisfied:
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`:
|
||||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
|
||||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `&Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
|
||||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream`
|
||||||
which is required by `&mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt`
|
--> $DIR/issue-30786.rs:106:9
|
||||||
|
|
|
||||||
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||||
|
| ^^^^^^^^^ ^
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,20 @@ error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb
|
||||||
--> $DIR/issue-62203-hrtb-ice.rs:38:19
|
--> $DIR/issue-62203-hrtb-ice.rs:38:19
|
||||||
|
|
|
|
||||||
LL | let v = Unit2.m(
|
LL | let v = Unit2.m(
|
||||||
| ^ expected struct `Unit4`, found associated type
|
| ^ expected associated type, found struct `Unit4`
|
||||||
|
|
|
|
||||||
= note: expected struct `Unit4`
|
= note: expected associated type `<_ as Ty<'_>>::V`
|
||||||
found associated type `<_ as Ty<'_>>::V`
|
found struct `Unit4`
|
||||||
= help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4`
|
= help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4` or calling a method that returns `<_ as Ty<'_>>::V`
|
||||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||||
|
note: required by a bound in `T1::m`
|
||||||
|
--> $DIR/issue-62203-hrtb-ice.rs:27:51
|
||||||
|
|
|
||||||
|
LL | fn m<'a, B: Ty<'a>, F>(&self, f: F) -> Unit1
|
||||||
|
| - required by a bound in this
|
||||||
|
LL | where
|
||||||
|
LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>,
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m`
|
||||||
|
|
||||||
error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3`
|
error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3`
|
||||||
--> $DIR/issue-62203-hrtb-ice.rs:40:9
|
--> $DIR/issue-62203-hrtb-ice.rs:40:9
|
||||||
|
@ -19,13 +27,21 @@ LL | / L {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | f : |x| { drop(x); Unit4 }
|
LL | | f : |x| { drop(x); Unit4 }
|
||||||
LL | | });
|
LL | | });
|
||||||
| |_________^ expected struct `Unit4`, found struct `Unit3`
|
| |_________^ expected struct `Unit3`, found struct `Unit4`
|
||||||
|
|
|
|
||||||
note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>`
|
note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>`
|
||||||
--> $DIR/issue-62203-hrtb-ice.rs:17:16
|
--> $DIR/issue-62203-hrtb-ice.rs:17:16
|
||||||
|
|
|
|
||||||
LL | impl<'a, A, T> T0<'a, A> for L<T>
|
LL | impl<'a, A, T> T0<'a, A> for L<T>
|
||||||
| ^^^^^^^^^ ^^^^
|
| ^^^^^^^^^ ^^^^
|
||||||
|
note: required by a bound in `T1::m`
|
||||||
|
--> $DIR/issue-62203-hrtb-ice.rs:27:12
|
||||||
|
|
|
||||||
|
LL | fn m<'a, B: Ty<'a>, F>(&self, f: F) -> Unit1
|
||||||
|
| - required by a bound in this
|
||||||
|
LL | where
|
||||||
|
LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>,
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0276]: impl has stricter requirements than trait
|
error[E0276]: impl has stricter requirements than trait
|
||||||
--> $DIR/issue-55872-1.rs:12:5
|
--> $DIR/issue-55872-1.rs:12:15
|
||||||
|
|
|
|
||||||
LL | fn foo<T>() -> Self::E;
|
LL | fn foo<T>() -> Self::E;
|
||||||
| ----------------------- definition of `foo` from trait
|
| ----------------------- definition of `foo` from trait
|
||||||
...
|
...
|
||||||
LL | fn foo<T: Default>() -> Self::E {
|
LL | fn foo<T: Default>() -> Self::E {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
|
| ^^^^^^^ impl has extra requirement `T: Default`
|
||||||
|
|
||||||
error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
|
error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
|
||||||
--> $DIR/issue-55872-1.rs:12:29
|
--> $DIR/issue-55872-1.rs:12:29
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue