11953: fix: `extract_module` is too eager r=Veykril a=iDawer
Refactored `extract_module`.
Searching for usages and import resolving are done lazily.
Close#11944
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
11936: Ignore `Drop` and `Destruct` bounds for now r=flodiebold a=flodiebold
- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement. (So ideally, we'd only ignore `~const Drop`, but this should be fine for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies), so until the builtin impls are supported by Chalk, we ignore them as well. Since `Destruct` is implemented for everything in non-const contexts IIUC, this should also work fine.
Fixes#11932.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement.
(So ideally, we'd only ignore `~const Drop`, but this should be fine
for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies as of 08-04-2022), so until
the builtin impls are supported by Chalk, we ignore them as well.
Since `Destruct` is implemented for everything in non-const contexts
IIUC, this should also work fine.
Fixes#11932.
11920: Consider types of const generics r=flodiebold a=HKalbasi
fix#11913
We should emit type_mismatch in const generics, probably after #7434. Currently they will lead to a misleading, time of use type error (like the added test).
Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
11930: internal: move function unsafety determination out of the ItemTree r=jonas-schievink a=jonas-schievink
Resolves some FIXMEs.
I've also renamed some FnFlags to be more explicit about what they represent (presence of keywords, not necessarily presence of semantics)
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
11925: internal: Add and use `HirFormatter::write_{str,char}` r=Veykril a=lnicola
Saves slightly over 3 KB of `text`, but comparing the total with that from two weeks ago in #11776, this is a losing battle (we're 951 KB larger).
```
text data bss dec hex filename
24693512 1542704 4424 26240640 1906680 rust-analyzer-baseline
24690216 1542112 4424 26236752 1905750 rust-analyzer-pr
```
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
11927: internal: Use bitflags for `FnFlags` r=jonas-schievink a=jonas-schievink
Previously we didn't do this because it didn't pull its weight, but now we actually do some bitops
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
11924: internal: remove `FnFlags::IS_IN_EXTERN_BLOCK` r=jonas-schievink a=jonas-schievink
This flag was determined purely based on the AST, which cannot work reliably since macros are allowed in `extern` blocks (in which case the function would not have an extern block parent in the AST).
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>