about summary refs log tree commit diff
path: root/src/librustc_mir/transform
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-20 07:09:35 -0700
committerGitHub <noreply@github.com>2016-08-20 07:09:35 -0700
commit69612f0039b87e1a31c3cc4c063c19d3536812a9 (patch)
tree9216a70ef07468925a912d69cdeb3fa16452bd81 /src/librustc_mir/transform
parent7c843c466313a99485286637d6c8a0ad7c2ec6c0 (diff)
parentdae1406b822c1357f701047951e747dbca2b1446 (diff)
downloadrust-69612f0039b87e1a31c3cc4c063c19d3536812a9.tar.gz
rust-69612f0039b87e1a31c3cc4c063c19d3536812a9.zip
Rollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturner
updated E0396 to new error format

Updated E0396 to new error format.
Part of #35233
Fixes #35779

Thanks again for letting me help!

r? @jonathandturner
Diffstat (limited to 'src/librustc_mir/transform')
-rw-r--r--src/librustc_mir/transform/qualify_consts.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs
index 0857ae79763..bcdc0d2ea3f 100644
--- a/src/librustc_mir/transform/qualify_consts.rs
+++ b/src/librustc_mir/transform/qualify_consts.rs
@@ -493,9 +493,13 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
                             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();
                                 }
                             }
                         }