Skip to content

Enhancement 284 Sealed Trait #366

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

Closed
wants to merge 2 commits into from

Conversation

eaeiv
Copy link

@eaeiv eaeiv commented Jul 14, 2022

Adds generic Sealed super trait and applies it to TensorType.

Fixes #284

@adamcrume
Copy link
Contributor

Please run cargo fmt so the tests pass. You can test locally by running ./test-all.

mod private {
pub trait Sealed {}

impl <T> Sealed for T{}
Copy link

Choose a reason for hiding this comment

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

I don't think this blanket impl makes sense, because it implements Sealed for all types, even for types defined in other crates. That makes the TensorType: private::Sealed bound useless, because it's implemented for every type already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, please fix.

@adamcrume adamcrume closed this Mar 10, 2024
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.

Should TensorType be a sealed trait or marked unsafe?
3 participants