Skip to content

Support for same-prefix uses for merge-imports assist #3749

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

Open
pszpetkowski opened this issue Mar 27, 2020 · 0 comments
Open

Support for same-prefix uses for merge-imports assist #3749

pszpetkowski opened this issue Mar 27, 2020 · 0 comments
Labels
A-assists S-actionable Someone could pick this issue up and work on it right now

Comments

@pszpetkowski
Copy link
Contributor

Follow-up from #3745 (comment)

I believe it might be a low-hanging fruit to add support for merging same-prefix uses as pointed out in linked PR:

use foo::Bar;
use foo::*;

transformed into after the assist call:

use foo::*;

There are few concerns I'd like to point out here:

  1. I've not investigated the effort which would have to be done to implement it.
  2. I'm not entirely sure if it's a responsibility of this assist
  3. There might be an edge case where separate use along with wildcard use makes something work(?)
@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Jan 25, 2021
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Jan 7, 2025
…alfJung

Detect when pthread_mutex_t is moved

What I am not sure about this PR is how to support storing the additional mutex data like its address and kind. If I understand correctly the `concurrency::sync::Mutex` struct is to be used by any mutex implementation. This possibly means that different implementation might want to store different data in the mutex. So any additional data should be implementation defined somehow. Solutions that come to mind:

- Store the additional data as `Box<dyn Any>` and the implementations can downcast their data when they fetch them.
- Have each shim implementation define a `static mut` map between `MutexID`s and the additional data.

Let me know

Fixes rust-lang#3749
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

3 participants