Main example for HashSet. - #15667
Merged
Merged
Conversation
Contributor
Author
|
@alexcrichton It appears I have accidentally pushed up some more documentation changes to this pull request instead of creating a new. Shall I create a new one or roll with this? |
Member
|
That's ok, I'll take a peek |
Member
There was a problem hiding this comment.
The predominant style in the rest of the documentation is to use one hash mark, why change to two?
Member
|
Thanks for all the new examples! |
Contributor
Author
|
Thanks for the pointers. |
Member
|
Looks good to me! Could you squash the commits into one with a description about what documentation was added? |
Add main example and simple examples for the methods.
Contributor
Author
|
Done. |
bors
added a commit
that referenced
this pull request
Jul 16, 2014
Example code for HashSet, similar to the [HashMap example](http://doc.rust-lang.org/std/collections/hashmap/struct.HashMap.html).
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 13, 2023
…ykril
fix: make bool_to_enum assist create enum at top-level
This pr makes the `bool_to_enum` assist create the `enum` at the next closest module block or at top-level, which fixes a few tricky cases such as with an associated `const` in a trait or module:
```rust
trait Foo {
const $0BOOL: bool;
}
impl Foo for usize {
const BOOL: bool = true;
}
fn main() {
if <usize as Foo>::BOOL {
println!("foo");
}
}
```
Which now properly produces:
```rust
#[derive(PartialEq, Eq)]
enum Bool { True, False }
trait Foo {
const BOOL: Bool;
}
impl Foo for usize {
const BOOL: Bool = Bool::True;
}
fn main() {
if <usize as Foo>::BOOL == Bool::True {
println!("foo");
}
}
```
I also think it's a bit nicer, especially for local variables, but didn't really know to do it in the first PR :)
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Sep 18, 2025
…ust-lang#15667) Fixes rust-lang/rust-clippy#14157 Fixes rust-lang/rust-clippy#15666 changelog: [`elidable_lifetime_names`]: avoid overlapping spans in suggestions r? clippy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example code for HashSet, similar to the HashMap example.