Overflow,
};
-use crate::errors::{Applicability, DiagnosticBuilder};
use crate::hir;
use crate::hir::Node;
use crate::hir::def_id::DefId;
use crate::infer::{self, InferCtxt};
use crate::infer::type_variable::TypeVariableOrigin;
-use std::fmt;
-use syntax::ast;
use crate::session::DiagnosticMessageId;
use crate::ty::{self, AdtKind, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable};
use crate::ty::GenericParamDefKind;
use crate::ty::SubtypePredicate;
use crate::util::nodemap::{FxHashMap, FxHashSet};
+use errors::{Applicability, DiagnosticBuilder};
+use std::fmt;
+use syntax::ast;
use syntax_pos::{DUMMY_SP, Span, ExpnInfo, ExpnFormat};
impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}
- /// Get the parent trait chain start
+ /// Gets the parent trait chain start
fn get_parent_trait_ref(&self, code: &ObligationCauseCode<'tcx>) -> Option<String> {
match code {
&ObligationCauseCode::BuiltinDerivedObligation(ref data) => {
).collect::<Vec<_>>())
}
Node::StructCtor(ref variant_data) => {
- (self.tcx.sess.source_map().def_span(self.tcx.hir().span(variant_data.id())),
+ (self.tcx.sess.source_map().def_span(
+ self.tcx.hir().span_by_hir_id(variant_data.hir_id())),
vec![ArgKind::empty(); variant_data.fields().len()])
}
_ => panic!("non-FnLike node found: {:?}", node),
}
}
- /// Returns whether the trait predicate may apply for *some* assignment
+ /// Returns `true` if the trait predicate may apply for *some* assignment
/// to the type parameters.
fn predicate_can_apply(&self,
param_env: ty::ParamEnv<'tcx>,