rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.68k stars 1.5k forks source link

internal: refactor `prefer_no_std`/`prefer_prelude` bools into a struct #17252

Closed davidbarsky closed 1 week ago

davidbarsky commented 2 weeks ago

I noticed that there's a large number of functions/arguments during an unrelated change that take two booleans and realized they're probably better off being in a single struct—less error-prone, etc.

Feel free to suggest a better name than ImportPathConfig/close this entirely! I can also make these args enums; just hopefully making this a little more misuse-resistant.

Veykril commented 1 week ago

Rebased it given my PR had a bunch of conflicts touching the same parts :) The new ignore_local_imports: bool, remains now though, as its private API and shouldn't belong to that new struct (though that means its also not exposed like the other two were so that should be fine) @bors r+

bors commented 1 week ago

:pushpin: Commit dc565d4c5affd40709ca8cf1bf4ad8bbb96177f2 has been approved by Veykril

It is now in the queue for this repository.

bors commented 1 week ago

:hourglass: Testing commit dc565d4c5affd40709ca8cf1bf4ad8bbb96177f2 with merge f5f3b0c762ec716bc0f43831b818cbfa6ac2c326...

bors commented 1 week ago

:broken_heart: Test failed - checks-actions

Veykril commented 1 week ago

small rebase mishap @bors r+

bors commented 1 week ago

:pushpin: Commit 3eb607cdce78e6a01deaecfcb719fcbddbe56ab6 has been approved by Veykril

It is now in the queue for this repository.

bors commented 1 week ago

:hourglass: Testing commit 3eb607cdce78e6a01deaecfcb719fcbddbe56ab6 with merge 20cfaf5388f52e47627f61f9b212a22f0c3043cd...

bors commented 1 week ago

:broken_heart: Test failed - checks-actions

Veykril commented 1 week ago

@bors r+

bors commented 1 week ago

:pushpin: Commit 3a7dcf91c414b1ee79b8f8a82800339f2396e0d7 has been approved by Veykril

It is now in the queue for this repository.

bors commented 1 week ago

:hourglass: Testing commit 3a7dcf91c414b1ee79b8f8a82800339f2396e0d7 with merge 870ad352454bf595b4055256ad7166ca8b5a0907...

bors commented 1 week ago

:sunny: Test successful - checks-actions Approved by: Veykril Pushing 870ad352454bf595b4055256ad7166ca8b5a0907 to master...