]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/cast.rs
review comments
[rust.git] / src / librustc_typeck / check / cast.rs
index 9cbde276ae97ce1d933423d5b5413eb4d1310c80..ded655c1ae32af5918b47c3367e704280996661b 100644 (file)
@@ -341,10 +341,7 @@ fn report_cast_to_unsized_type(&self, fcx: &FnCtxt<'a, 'tcx>) {
                                          tstr);
         match self.expr_ty.kind {
             ty::Ref(_, _, mt) => {
-                let mtstr = match mt {
-                    hir::MutMutable => "mut ",
-                    hir::MutImmutable => "",
-                };
+                let mtstr = mt.prefix_str();
                 if self.cast_ty.is_trait() {
                     match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) {
                         Ok(s) => {