mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Change Scalar to numeric cast
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user