about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBasile Desloges <basile.desloges@gmail.com>2017-10-04 18:02:36 +0200
committerBasile Desloges <basile.desloges@gmail.com>2017-10-06 17:44:50 +0200
commit456e12ec38f669b26b08414527ee1dc35091da33 (patch)
treea5fc5497fd9eed1f1985e07a833ba0096a08fc38
parent7bdf177c8fe045508eff5fe767f00be3f1fca92d (diff)
downloadrust-456e12ec38f669b26b08414527ee1dc35091da33.tar.gz
rust-456e12ec38f669b26b08414527ee1dc35091da33.zip
mir-borrowck: Panic when trying to print a field access on a non-box type that is neither Adt nor tuple
-rw-r--r--src/librustc_mir/borrow_check.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_mir/borrow_check.rs b/src/librustc_mir/borrow_check.rs
index f4bf280cd25..18bb78ef50f 100644
--- a/src/librustc_mir/borrow_check.rs
+++ b/src/librustc_mir/borrow_check.rs
@@ -1178,8 +1178,10 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
                     format!("{}", field_index)
                 },
                 _ => {
-                    debug!("End-user description not implemented for field of type {:?}", ty.sty);
-                    format!("<ty>{}", field_index)
+                    // Might need a revision when the fields in trait RFC is implemented
+                    // (https://github.com/rust-lang/rfcs/pull/1546)
+                    bug!("Field access unsupported for non-box types that are neither Adt (struct, \
+                         enum, union) nor tuples");
                 }
             }
         }