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

Misconception discussion: T is a superset of both &T and &mut T #60

Open
wodny opened this issue May 13, 2022 · 0 comments
Open

Misconception discussion: T is a superset of both &T and &mut T #60

wodny opened this issue May 13, 2022 · 0 comments

Comments

@wodny
Copy link

wodny commented May 13, 2022

While it's true and can be presented with generics, maybe a note that the following is possible would be beneficial, so nobody erroneously extrapolates the rule:

struct Foo();
trait Trait {}
impl Trait for Foo {}
impl Trait for &Foo {}
impl Trait for &mut Foo {}

Like with impl Read for TcpStream and impl Read for &TcpStream.

@wodny wodny changed the title Disussion: T is a superset of both &T and &mut T Misconception discussion: T is a superset of both &T and &mut T May 13, 2022
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

No branches or pull requests

1 participant