]> git.lizzy.rs Git - rust.git/commitdiff
Change Scalar to numeric cast
authorEsteban Küber <esteban@kuber.com.ar>
Mon, 15 Oct 2018 17:12:29 +0000 (10:12 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Tue, 16 Oct 2018 18:04:42 +0000 (11:04 -0700)
src/librustc/traits/error_reporting.rs

index 8288a45ad636b48b1ef4c75628fce0f31d8ebf32..fc34a71f39221c00f2bbbbe9c030002a0d275dc8 100644 (file)
@@ -424,8 +424,9 @@ fn on_unimplemented_note(
                     "_Self".to_owned(),
                     Some(format!("[{}]", self.tcx.type_of(def.did).to_string())),
                 ));
+                let tcx = self.tcx;
                 if let Some(len) = len.val.try_to_scalar().and_then(|scalar| {
-                    scalar.to_u64().ok()
+                    scalar.to_usize(tcx).ok()
                 }) {
                     flags.push((
                         "_Self".to_owned(),