Merge pull request #82 from dkushner/bugfix/nightly-type-id

Fix ambiguous calls to `type_id()` preventing compilation on 1.35-nightly.
This commit is contained in:
Jonathan Turner
2019-04-21 11:01:21 -10:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ impl Any {
#[inline] #[inline]
pub fn is<T: Any>(&self) -> bool { pub fn is<T: Any>(&self) -> bool {
let t = TypeId::of::<T>(); let t = TypeId::of::<T>();
let boxed = self.type_id(); let boxed = <Any as Any>::type_id(self);
t == boxed t == boxed
} }

View File

@@ -622,7 +622,7 @@ impl Engine {
} }
fn nice_type_name(&self, b: Box<Any>) -> String { fn nice_type_name(&self, b: Box<Any>) -> String {
let tid = (&*b).type_id(); let tid = <Any as Any>::type_id(&*b);
if let Some(name) = self.type_names.get(&tid) { if let Some(name) = self.type_names.get(&tid) {
name.to_string() name.to_string()
} else { } else {