-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add unchecked downcast methods #90851
Conversation
ibraheemdev
commented
Nov 13, 2021
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This seems plausible, but it looks like there are some failures in the PR build. |
@rustbot label -S-waiting-on-author +S-waiting-on-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two tiny things to fix (sorry, should have caught them the first time), then r=me.
library/alloc/src/boxed.rs
Outdated
@@ -1501,21 +1499,48 @@ impl<A: Allocator> Box<dyn Any, A> { | |||
/// print_if_string(Box::new(my_string)); | |||
/// print_if_string(Box::new(0i8)); | |||
/// ``` | |||
#[inline] | |||
#[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one was an over-aggressive copy-paste.
#[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")] | |
#[stable(feature = "rust1", since = "1.0.0")] |
https://doc.rust-lang.org/1.0.0/std/boxed/struct.Box.html#method.downcast)
library/alloc/src/boxed.rs
Outdated
@@ -1533,21 +1558,48 @@ impl<A: Allocator> Box<dyn Any + Send, A> { | |||
/// print_if_string(Box::new(my_string)); | |||
/// print_if_string(Box::new(0i8)); | |||
/// ``` | |||
#[inline] | |||
#[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
#[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")] | |
#[stable(feature = "rust1", since = "1.0.0")] |
Thanks for making the PR! @bors r+ |
📌 Commit 4ec5cdc has been approved by |
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#90538 (Document how recursion is handled for `ty::Ty`) - rust-lang#90851 (Add unchecked downcast methods) - rust-lang#91209 (Implement ``@snapshot`` check for htmldocck) - rust-lang#91385 (Suggest the `pat_param` specifier before `|` on 2021 edition ) - rust-lang#91478 (Remove incorrect newline from float cast suggestion) - rust-lang#91481 (Use let_else in some more places in rustc_lint) - rust-lang#91488 (Fix ICE when `yield`ing in function returning `impl Trait`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup