Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change function signature to get type name via intrinsics #18361

Merged
merged 2 commits into from Sep 3, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

change function signature to get type name via intrinsics

  • Loading branch information
toidiu
toidiu committed Sep 3, 2017
commit a3df0cf4debadab400cc05e77a082514a4ae6c25
@@ -102,6 +102,7 @@ use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
use std::cell::Cell;
use std::collections::{hash_map, HashMap, HashSet};
use std::default::Default;
use std::intrinsics;
use std::ops::Deref;
use std::option::Option;
use std::ptr;
@@ -221,7 +222,7 @@ pub struct CancellableRunnable<T: Runnable + Send> {
}

impl<T: Runnable + Send> Runnable for CancellableRunnable<T> {
fn name(&self) -> &'static str { self.inner.name() }
fn name(&self) -> &'static str { unsafe { intrinsics::type_name::<Self>() } }

This comment has been minimized.

@emilio

emilio Sep 3, 2017

Member

I believe this should be in the definition of trait Runnable, and after that all the manual implementations should go away.

This comment has been minimized.

@toidiu

toidiu Sep 3, 2017

Author

makes sense. will implement the change


fn is_cancelled(&self) -> bool {
self.cancelled.as_ref()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.