Skip to content

Commit

Permalink
Change Scalar to numeric cast
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 16, 2018
1 parent 5beeb53 commit def0f54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc/traits/error_reporting.rs
Expand Up @@ -424,8 +424,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
"_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(),
Expand Down

0 comments on commit def0f54

Please sign in to comment.