Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if is_local {
- let parent_id = tcx.hir().get_parent_node(self_ty.hir_id);
- if let hir::Node::Item(_) = tcx.hir().get_by_def_id(parent_id.owner) {
- let blanket_msg = "for local traits use the blanket implementation";
- let blanket_sugg = vec![
- (self_ty.span.shrink_to_lo(), "impl <T: ".to_owned()),
- //(self_ty.span.shrink_to_lo(), "> for T".to_owned()),
- ];
- tcx.struct_span_lint_hir(
- BARE_TRAIT_OBJECTS,
- self_ty.hir_id,
- self_ty.span,
- |lint| {
- lint.build(blanket_msg)
- .multipart_suggestion_verbose(
- "use blanket impl",
- blanket_sugg,
- Applicability::Unspecified,
- )
- .emit();
- },
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement