Rebase conflicts
This commit is contained in:
parent
b2df88bae1
commit
c1a7dbc0e3
1 changed files with 7 additions and 7 deletions
|
@ -885,6 +885,12 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
err: &mut Diagnostic,
|
err: &mut Diagnostic,
|
||||||
trait_pred: ty::PolyTraitPredicate<'tcx>,
|
trait_pred: ty::PolyTraitPredicate<'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
// It doesn't make sense to make this suggestion outside of typeck...
|
||||||
|
// (also autoderef will ICE...)
|
||||||
|
if self.typeck_results.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if let ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)) = obligation.predicate.kind().skip_binder()
|
if let ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)) = obligation.predicate.kind().skip_binder()
|
||||||
&& Some(trait_pred.def_id()) == self.tcx.lang_items().sized_trait()
|
&& Some(trait_pred.def_id()) == self.tcx.lang_items().sized_trait()
|
||||||
{
|
{
|
||||||
|
@ -1104,13 +1110,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
found: Ty<'tcx>,
|
found: Ty<'tcx>,
|
||||||
) -> Option<(DefIdOrName, Ty<'tcx>, Vec<Ty<'tcx>>)> {
|
) -> Option<(DefIdOrName, Ty<'tcx>, Vec<Ty<'tcx>>)> {
|
||||||
// Autoderef is useful here because sometimes we box callables, etc.
|
// Autoderef is useful here because sometimes we box callables, etc.
|
||||||
let Some((def_id_or_name, output, inputs)) = Autoderef::new(
|
let Some((def_id_or_name, output, inputs)) = (self.autoderef_steps)(found).into_iter().find_map(|(found, _)| {
|
||||||
self,
|
|
||||||
param_env,
|
|
||||||
hir_id,
|
|
||||||
DUMMY_SP,
|
|
||||||
found,
|
|
||||||
).silence_errors().find_map(|(found, _)| {
|
|
||||||
match *found.kind() {
|
match *found.kind() {
|
||||||
ty::FnPtr(fn_sig) =>
|
ty::FnPtr(fn_sig) =>
|
||||||
Some((DefIdOrName::Name("function pointer"), fn_sig.output(), fn_sig.inputs())),
|
Some((DefIdOrName::Name("function pointer"), fn_sig.output(), fn_sig.inputs())),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue