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

Replace manual implementations of Runnable::name with automatic type name #18354

Closed
jdm opened this issue Sep 2, 2017 · 3 comments
Closed

Replace manual implementations of Runnable::name with automatic type name #18354

jdm opened this issue Sep 2, 2017 · 3 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Sep 2, 2017

We have a Runnable trait with a name method. This method is used to improve profiling output so we can tell at runtime which concrete runnable is being executed, so we have to duplicate the name of the type every time we create a new type that implements Runnable. We can remove all of that if we use this code for Runnable::name instead: https://gist.github.com/2210a8674dd7813cec8c7148a3a0b719

Code: components/script/script_thread.rs, and every implementation of Runnable that overrides the name method.

No need to run any tests for this change; if it builds, that's good enough for a PR.

@highfive
Copy link

@highfive highfive commented Sep 2, 2017

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@toidiu
Copy link

@toidiu toidiu commented Sep 2, 2017

@highfive assign me

@highfive
Copy link

@highfive highfive commented Sep 2, 2017

Hey @toidiu! Thanks for your interest in working on this issue. It's now assigned to you!

@highfive highfive added the C-assigned label Sep 2, 2017
bors-servo added a commit that referenced this issue Sep 3, 2017
change function signature to get type name via intrinsics

<!-- Please describe your changes on the following line: -->
change function signature to get type name via intrinsics

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18354 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because stated in the PR that it was not required

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18361)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.