Skip to content

doc: Confusing information regarding mutability for str primitive. #14948

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
Ryman opened this issue Jun 16, 2014 · 1 comment · Fixed by #16580
Closed

doc: Confusing information regarding mutability for str primitive. #14948

Ryman opened this issue Jun 16, 2014 · 1 comment · Fixed by #16580

Comments

@Ryman
Copy link
Contributor

Ryman commented Jun 16, 2014

In http://doc.rust-lang.org/std/str/primitive.str.html under the heading of Mutability it seems to say that there are ways to mutably edit a string.To quote:

Many languages have immutable strings by default, and Rust has a particular flavor on this idea. As with the rest of Rust types, strings are immutable by default. If a string is declared as mut, however, it may be mutated. This works the same way as the rest of Rust's type system in the sense that if there's a mutable reference to a string, there may only be one mutable reference to that string. With these guarantees, strings can easily transition between being mutable/immutable with the same benefits of having mutable strings in other languages.

I think this is confusing to users, is this meant to imply String, or is it discussing mutable slices (which aren't allowed anymore?). I feel like this paragraph is in need of review, or possibly removed/moved to String.

@huonw huonw changed the title rustdoc: Confusing information regarding mutability for str primitive. doc: Confusing information regarding mutability for str primitive. Jun 16, 2014
@huonw huonw added the A-docs label Jun 16, 2014
@huonw
Copy link
Member

huonw commented Jun 16, 2014

I think it is just talking about the old ~str, so yes, it needs to be removed/moved to String.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Aug 18, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 17, 2023
feature : assist delegate impl

This PR ( fixes rust-lang#14386 ) introduces a new IDE assist that generates a trait impl for a struct that delegates a field. This is a draft because the current `ide_db::path_transform::PathTransform` produces some unwanted results when it deals with extern crates, an example of which I attach as a GIF.

GIFs :
1. A general case
![14386-functional](https://github.com/rust-lang/rust-analyzer/assets/20956650/22114959-caa6-45ec-a154-b4b2f458f6b1)

2. A case where `ide_db::path_transform::PathTransform` fails to correctly resolve a property ( take `Allocator` as an example ) to its full path, thus causing an error to occur. ( Not to even mention that resolving this causes another error `use of unstable library feature 'allocator_api'` to occur
![14386-erroneous](https://github.com/rust-lang/rust-analyzer/assets/20956650/922ca715-594e-4168-a579-7c5c006f93aa)
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 13, 2025
In order to be consistent with our documentation, deprecated lints
should not be counted when displaying the total number of lints on the
[web site](https://rust-lang.github.io/rust-clippy/master/index.html).

For example, as of 2025-06-01, there are 784 non-deprecated lints which
are referred to as "over 750 lints" in the documentation, but the web
site displays "Total number: 799". When one new lint will be added,
there will be a discrepancy ("over 750 lints" vs. "Total number: 800")
if this is not fixed.

changelog: none

r? @llogiq
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 a pull request may close this issue.

2 participants