if let ty::TyRawPtr(_) = base_ty.sty {
this.add(Qualif::NOT_CONST);
if this.mode != Mode::Fn {
- span_err!(this.tcx.sess, this.span, E0396,
- "raw pointers cannot be dereferenced in {}s",
- this.mode);
+ struct_span_err!(this.tcx.sess,
+ this.span, E0396,
+ "raw pointers cannot be dereferenced in {}s",
+ this.mode)
+ .span_label(this.span,
+ &format!("dereference of raw pointer in constant"))
+ .emit();
}
}
}
if let Literal::Item { def_id, substs } = constant.literal {
// Don't peek inside generic (associated) constants.
- if !substs.types.is_empty() {
+ if substs.types().next().is_some() {
self.add_type(constant.ty);
} else {
let qualif = qualify_const_item_cached(self.tcx,
self.add(Qualif::NOT_CONST);
if self.mode != Mode::Fn {
- span_err!(self.tcx.sess, self.span, E0395,
- "raw pointers cannot be compared in {}s",
- self.mode);
+ struct_span_err!(
+ self.tcx.sess, self.span, E0395,
+ "raw pointers cannot be compared in {}s",
+ self.mode)
+ .span_label(
+ self.span,
+ &format!("comparing raw pointers in static"))
+ .emit();
}
}
}
if let Err(err) = fulfillment_cx.select_all_or_error(&infcx) {
infcx.report_fulfillment_errors(&err);
}
-
- if let Err(errors) = fulfillment_cx.select_rfc1592_obligations(&infcx) {
- infcx.report_fulfillment_errors_as_warnings(&errors, id);
- }
});
}
}