8221: Prefer adding `mod` declaration to lib.rs over file.rs in UnlinkedFile fix r=Veykril a=Veykril
When there is a `lib.rs` and `main.rs` in one crate, one usually wants the `lib.rs` file to declare the modules.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
8214: Mention the rustup version in the manual r=lnicola a=lnicola
Closes#7860
bors r+
changelog fix mention the `rustup` version in the installation instructions.
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
8201: Fix recursive macro statements expansion r=edwin0cheng a=edwin0cheng
This PR attempts to properly handle macro statement expansion by implementing the following:
1. Merge macro expanded statements to parent scope statements.
2. Add a new hir `Expr::MacroStmts` for handle tail expression infer.
PS : The scope of macro expanded statements are so strange that it took more time than I thought to understand and implement it :(
Fixes #8171
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
8191: syntax: return owned string instead of leaking string r=cynecx a=cynecx
Quick hack? to alleviate https://github.com/rust-analyzer/rust-analyzer/issues/8181#issuecomment-806019126. I haven't run any tests but this should affect performance since we are deallocating more.
r? @matklad
Co-authored-by: cynecx <me@cynecx.net>
7907: Autoderef with visibility r=cynecx a=cynecx
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7841.
I am not sure about the general approach here. Right now this simply tries to check whether the autoderef candidate is reachable from the current module. ~~However this doesn't exactly work with traits (see the `tests::macros::infer_derive_clone_in_core` test, which fails right now).~~ see comment below
Refs:
- `rustc_typeck` checking fields: 66ec64ccf3/compiler/rustc_typeck/src/check/expr.rs (L1610)
r? @flodiebold
Co-authored-by: cynecx <me@cynecx.net>
8190: Fix chalk_ir assertion r=flodiebold a=flodiebold
Fixes#8150.
I implemented a validator that catches this in the tests, but it'd need to get merged in Chalk first.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
8184: refine comment style of tests r=Veykril a=hi-rustin
Fix the comment style issues, it's in tests but maybe it's a little better to change it to this.
Co-authored-by: hi-rustin <rustin.liu@gmail.com>