rust/crates
bors 87e2c310f9 Auto merge of #15667 - rmehri01:bool_to_enum_top_level, r=Veykril
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 :)
2023-09-29 10:20:11 +00:00
..
base-db minor: hover_simple refactor 2023-09-24 22:47:29 +02:00
cfg Fix cfg completions not working 2023-09-08 10:49:15 +02:00
flycheck refactor: remove boxing 2023-09-20 23:02:52 +09:00
hir Add unused_variables native diagnostic 2023-09-24 21:29:15 +03:30
hir-def Allocate ast ids for parameters 2023-09-28 13:16:11 +02:00
hir-expand Allocate ast ids for parameters 2023-09-28 13:16:11 +02:00
hir-ty Fix unused_variables in tests 2023-09-24 23:45:36 +03:30
ide Auto merge of #15659 - HKalbasi:unused-var, r=HKalbasi 2023-09-25 06:38:14 +00:00
ide-assists Auto merge of #15667 - rmehri01:bool_to_enum_top_level, r=Veykril 2023-09-29 10:20:11 +00:00
ide-completion split detail function 2023-09-23 19:43:19 -03:00
ide-db minor: hover_simple refactor 2023-09-24 22:47:29 +02:00
ide-diagnostics Fix unused_variables in tests 2023-09-24 23:45:36 +03:30
ide-ssr Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
intern refactor: fix clippy lints 2023-09-15 16:43:21 +09:00
limit
load-cargo Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-from-ra 2023-07-17 16:49:15 +03:00
mbe Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
parser Auto merge of #15615 - shogo-nakano-desu:refactor/fix-clippy-lints, r=Veykril 2023-09-22 06:46:29 +00:00
paths Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-from-ra 2023-07-17 16:49:15 +03:00
proc-macro-api Upgrade Object and related deps 2023-08-14 23:05:45 +08:00
proc-macro-srv Upgrade Object and related deps 2023-08-14 23:05:45 +08:00
proc-macro-srv-cli
proc-macro-test proc-macro-test: Pass target to cargo invocation 2023-08-02 17:57:13 -07:00
profile Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
project-model Auto merge of #15560 - davidbarsky:davidbarsky/use-sysroot-rustc-to-determine-cfgs, r=Veykril 2023-09-08 18:14:25 +00:00
rust-analyzer scip: Allow customizing cargo config. 2023-09-28 17:22:19 +02:00
rustc-dependencies Switch to in-tree rustc dependencies with a cfg flag 2023-09-15 18:10:11 +03:30
sourcegen Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-from-ra 2023-07-17 16:49:15 +03:00
stdx Various small fixes 2023-09-22 10:13:51 +02:00
syntax Simplify 2023-09-26 12:25:59 +02:00
test-utils Fix unused_variables in tests 2023-09-24 23:45:36 +03:30
text-edit
toolchain
tt Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-ra 2023-08-07 12:03:15 +03:00
vfs Ensure resolved hint's file exists 2023-09-02 18:28:36 +03:00
vfs-notify Update notify to 6.1.1 2023-09-04 18:00:12 +02:00