Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace manual implementations of Runnable::name with automatic type name #18354
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
@highfive assign me |
|
Hey @toidiu! Thanks for your interest in working on this issue. It's now assigned to you! |
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
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.