Re-add double underscores in derive (fixes#32292)
@durka, sanity-check, please?
<s>Don't merge this yet, I need to add a test and test it locally.</s>
ready for review
The addition of these methods in #31335 required adding impls of the trait for
the `String` and `Vec<T>` types. This unfortunately caused a regression (#32074)
in type inference for using these methods which the libs team has decided to not
push forward with. These methods were stabilized in #32020 which was intended to
get backported to beta, but the backport hasn't happened just yet. This commit
reverts both the addition and stabilization of these methods.
One proposed method of handling this, in #32076, was to move the methods to an
extra trait to avoid conflicts with type inference. After some discussion,
however, the libs team concluded that we probably want to reevaluate what we're
doing here, so discussion will continue on the tracking issue, #27809.
Stop ignoring expected note/help messages in compiletest suite.
Original issue: https://github.com/rust-lang/rust/issues/21195
Relevant PR: https://github.com/rust-lang/rust/pull/30778
Prior to this commit, if a compiletest testcase included the text
"HELP:" or "NOTE:" (note the colons), then it would indicate to the
compiletest suite that we should verify "help" and "note" expected
messages.
This commit updates this check to also check "HELP" and "NOTE" (not the
absense of colons) so that we always verify "help" and "note" expected
messages.
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.
Original issue: https://github.com/rust-lang/rust/issues/21195
Relevant PR: https://github.com/rust-lang/rust/pull/30778
Prior to this commit, if a compiletest testcase included the text
"HELP:" or "NOTE:" (note the colons), then it would indicate to the
compiletest suite that we should verify "help" and "note" expected
messages.
This commit updates this check to also check "HELP" and "NOTE" (not the
absense of colons) so that we always verify "help" and "note" expected
messages.
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.