-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Minimal implementation of implicit deref patterns for Strings #98914
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
lol. lmao. nice |
This comment has been minimized.
This comment has been minimized.
@fee1-dead, do you know if there's a compiler-team sponsor for this feature? |
i think @nikomatsakis originally was sponsoring the attached issue, at least from the lang perspective, though possibly from the compiler side too |
ah, nvm, it was @cramertj from the lang side according to the issue |
whats the exchange rate on "compiler-contributor member" to "compiler-team member". does 3 contributors interested count as a compiler team member sponsor? ;-) |
A compiler-contributor member can certainly take this too as long as they feel competent in the areas being modified. I'm mostly looking for someone who has the necessary context. |
This comment has been minimized.
This comment has been minimized.
bee390b
to
f9771d1
Compare
This comment has been minimized.
This comment has been minimized.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
e3d3529
to
808ad13
Compare
This comment has been minimized.
This comment has been minimized.
&paths::SLICE_INTO, | ||
&paths::VEC_DEQUE_ITER, | ||
]; | ||
const ACCEPTABLE_METHODS: [&[&str]; 4] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't push formatting changes to Clippy.
I wonder why this is happening recently in every other PR 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why this is happening recently in every other PR thinking
vscode/rust-analyzer has format on save which might not respect clippy's config.
50ea367
to
e662969
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still many Clippy formatting changes in this PR:
- src/tools/clippy/clippy_lints/src/strings.rs
- src/tools/clippy/clippy_lints/src/redundant_clone.rs
- src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs
- src/tools/clippy/clippy_lints/src/methods/string_extend_chars.rs
- src/tools/clippy/clippy_lints/src/methods/search_is_some.rs
- src/tools/clippy/clippy_lints/src/methods/manual_str_repeat.rs
- src/tools/clippy/clippy_lints/src/methods/inefficient_to_string.rs
- src/tools/clippy/clippy_lints/src/matches/match_str_case_mismatch.rs
- src/tools/clippy/clippy_lints/src/manual_retain.rs
yeah I was doing it incrementally |
5aeeda2
to
1e6f6a8
Compare
so I reformatted it using clippy's rustfmt config which reverted everything back to normal. The only change it did was to reorder match arms in manual_retain.rs |
26be4ab
to
bc51f87
Compare
@rustbot ready changed to |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e07425d): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
Note for weekly triage: |
… r=compiler-errors Minimal implementation of implicit deref patterns for Strings cc `@compiler-errors` `@BoxyUwU` rust-lang/lang-team#88 rust-lang#87121 ~~I forgot to add a feature gate, will do so in a minute~~ Done
@fee1-dead . My expectation was that this PR will convert match String::new() {
"o" => (),
_ => (),
} But this doesn't: match &String::new() {
"o" => (),
_ => (),
} I think that deref patterns should convert enum Value {
Nil,
Cons(Rc<Value>, Rc<Value>)
} Then we want this: let v: Value = ...
match &v {
Cons(a, Cons(b, Cons(c, d))) => ...
...
} You see? At every step we convert |
If we have enum Value {
Foo, Bar(Option<String>, Vec<i32>),
} And I want to get the I get why it might feel confusing, but in reality we are enabling more use cases instead of limiting more. In your case, you can just add |
It feels like under match ergonomics you shouldn't need to do that, at least once the implementation is more evolved. |
… r=compiler-errors Minimal implementation of implicit deref patterns for Strings cc `@compiler-errors` `@BoxyUwU` rust-lang/lang-team#88 rust-lang#87121 ~~I forgot to add a feature gate, will do so in a minute~~ Done
FYI, this doesn't appear to be working with |
cc @compiler-errors @BoxyUwU rust-lang/lang-team#88 #87121
I forgot to add a feature gate, will do so in a minuteDone