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

Document impl Clone for Rc with Rc specific information #11993

Closed
jakerr opened this issue Feb 2, 2014 · 3 comments
Closed

Document impl Clone for Rc with Rc specific information #11993

jakerr opened this issue Feb 2, 2014 · 3 comments

Comments

@jakerr
Copy link
Contributor

jakerr commented Feb 2, 2014

The current doc for Rc has:

  • impl Clone for Rc
    • fn clone(&self) -> Rc
      • Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.

As the above doesn't make sense for Rc it should have a specific comment.

@huonw
Copy link
Member

huonw commented Feb 2, 2014

cc #11991

@aturon aturon added the A-docs label Jun 3, 2014
@steveklabnik
Copy link
Member

This doesn't say it on the Rc<T> page, but if you click through to the trait page, does say it there: http://doc.rust-lang.org/std/clone/trait.Clone.html#tymethod.clone

@steveklabnik
Copy link
Member

This will be fixed by #19112

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 28, 2023
[`question_mark`]: also trigger on `return` statements

This fixes the false negative mentioned in rust-lang#11993: the lint only used to check for `return` expressions, and not a statement containing a `return` expression (doesn't close the issue tho since there's still a useful suggestion that we could make, which is to suggest `.ok_or()?`/`.ok_or_else()?` for `else { return Err(..) }`)

changelog: [`question_mark`]: also trigger on `return` statements
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

4 participants