rustbuild: Implement `make dist`
This commit implements the `make dist` command in the new rustbuild build
system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount
of complexity between those two files, not all of which is likely justified, so
the Rust implementation is *much* smaller.
Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.
This commit implements the `make dist` command in the new rustbuild build
system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount
of complexity between those two files, not all of which is likely justified, so
the Rust implementation is *much* smaller.
Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.
Resolve: improve diagnostics for duplicate definitions and imports
This PR improves and regularizes the diagnostics for duplicate definitions and imports.
After this PR, the second of two duplicate definitions/imports will have the following form:
> a(n) [value|type|module|trait|extern crate] named \`*name*\` has already been [defined|imported] in this [module|block|trait|enum]
with a note referencing this first of the two duplicate definitions/imports:
> previous [definition|import] of \`*name*\` here
The error indices remain unchanged.
r? @eddyb
syntax: Always pretty print a newline after doc comments
Before this patch, code that had a doc comment as the first
line, as in:
```rust
/// Foo
struct Foo;
```
Was pretty printed into:
```rust
///Foostruct Foo;
```
This makes sure that that there is always a trailing newline
after a doc comment.
Closes#31722
Normalize return type when checking for E0269
Fixes#31597
First time dealing with normalization. Maybe `normalize_associated_type` would be better here, but it seems to imply it's only used during trans.