Skip to content

make Pod derive from Any #205

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

Merged
merged 1 commit into from
Apr 22, 2025
Merged

make Pod derive from Any #205

merged 1 commit into from
Apr 22, 2025

Conversation

dgulotta
Copy link
Collaborator

This commit makes Pod inherit Any, which removes the need for the as_any and into_any functions.

It requires the trait_upcasting feature, which was considered experimental in the nightly-2025-01-20 toolchain, but has since been stabilized: rust-lang/rust#65991

Copy link
Collaborator

@ax0 ax0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! cargo test --release seems to be failing. Could you replace all instances of into_any() in the tests as well?

Comment on lines 296 to 298
let p = (*p as &dyn Any).downcast_ref::<SignedPod>()
.expect("type SignedPod");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let p = (*p as &dyn Any).downcast_ref::<SignedPod>()
.expect("type SignedPod");
let p = (*p as &dyn Any)
.downcast_ref::<SignedPod>()
.expect("type SignedPod");

cf. cargo fmt --check.

Copy link
Collaborator

@ed255 ed255 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM!

@ed255 ed255 merged commit 58d3c6a into 0xPARC:main Apr 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants