Replaced wrong test with the correct mcve
Closes#89008.
The old test was wrong and the compiler was [correctly raising an error](https://github.com/rust-lang/rust/issues/89008#issuecomment-1285128060). The bug in the issue was resolved at some point but due to the wrong test the issue was never closed.
This pr replaces that test with the correct MCVE (made by ``@jackh726).``
The error raised by the bug changed between when the bug was posted (2021-09-08) and when the MCVE [was posted](https://github.com/rust-lang/rust/issues/89008#issuecomment-950110735) (2021-10-23).
I ran them both through `nightly-2021-09-08` and they produce identical error messages. They also produce identical but different from before error messages when ran through `nightly-2021-10-23`.
<details>
<summary>Error message with <code>nightly-2021-09-08</code></summary>
The code with the original bug report:
```
error[E0277]: the size for values of type `Repr` cannot be known at compilation time
--> src/main.rs:23:43
|
23 | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test-234234` due to previous error
```
MVCE:
```
error[E0277]: the size for values of type `Repr` cannot be known at compilation time
--> src/main.rs:30:43
|
30 | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test-234234` due to previous error
```
</details>
<details>
<summary>Error message with <code>nightly-2021-10-23</code></summary>
The code with the original bug report:
```
error[E0271]: type mismatch resolving `<impl futures::Future as futures::Future>::Output == impl futures::Stream`
--> src/main.rs:23:43
|
19 | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ------------------------ the expected opaque type
...
23 | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found struct `futures::stream::Empty`
|
= note: expected opaque type `impl futures::Stream`
found struct `futures::stream::Empty<_>`
error: could not find defining uses
--> src/main.rs:19:33
|
19 | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0271`.
error: could not compile `test-234234` due to 2 previous errors
```
MCVE:
```
error[E0271]: type mismatch resolving `<impl Future as Future>::Output == impl Stream`
--> src/main.rs:30:43
|
28 | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ------------------------ the expected opaque type
29 | type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>;
30 | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found struct `Empty`
|
= note: expected opaque type `impl Stream`
found struct `Empty<_>`
error: could not find defining uses
--> src/main.rs:28:33
|
28 | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0271`.
error: could not compile `test-234234` due to 2 previous errors
```
</details>
make `order_dependent_trait_objects` show up in future-breakage reports
tried to change it to a hard error in #102474 but breaking the more than 1000 dependents of `traitobject` doesn't feel great 😅
This lint has existed since more than 3 years now and the way this is currently implemented is buggy and will break with #102472. imo we should upgrade it to also report for dependencies and maybe also backport this to beta. Then after maybe 2-3 stable versions I would like to finally convert this lint to a hard error.
Change process spawning to inherit the parent's signal mask by default
Previously, the signal mask was always reset when a child process is
started. This breaks tools like `nohup` which expect `SIGHUP` to be
blocked for all transitive processes.
With this change, the default behavior changes to inherit the signal mask.
This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.
Remove more attributes from metadata
A lot of the attributes that are currently stored in the metadata aren't used at all. The biggest metadata usage comes from the doc attributes currently but they are needed by rustdoc so we only removed the ones that cannot be used in downstream crates (doc comments on private items).
r? `@ghost`
Rollup of 6 pull requests
Successful merges:
- #102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`)
- #102922 (Filtering spans when emitting json)
- #103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use)
- #103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names)
- #103260 (Fixup a few tests needing asm support)
- #103321 (rustdoc: improve appearance of source page navigation bar)
Failed merges:
- #103209 (Diagnostic derives: allow specifying multiple alternative suggestions)
r? `@ghost`
`@rustbot` modify labels: rollup
translation: doc comments with derives, subdiagnostic-less enum variants, more derive use
- Adds support for `doc` attributes in the diagnostic derives so that documentation comments don't result in the derive failing.
- Adds support for enum variants in the subdiagnostic derive to not actually correspond to an addition to a diagnostic.
- Made use of the derive in more places in the `rustc_ast_lowering`, `rustc_ast_passes`, `rustc_lint`, `rustc_session`, `rustc_infer` - taking advantage of recent additions like eager subdiagnostics, multispan suggestions, etc.
cc #100717
Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`
Given `impl Trait`, if one of its supertraits has a `#[must_use]`, then trigger the lint. This means that, for example, `-> impl ExactSizeIterator` also triggers the `must_use` on `trait Iterator`, which fixes#102183.
This might need `@rust-lang/lang` sign-off, since it changes the behavior of the lint, so cc'ing them.
move hir typeck into separate crate
second part https://github.com/rust-lang/compiler-team/issues/529
I avoided pretty much anything that wasn't just a simple move + path adjustment. Left fixmes for methods which are at an odd place
r? `@compiler-errors`
Mark `std::os::wasi::io::AsFd` etc. as stable.
io_safety was stabilized in Rust 1.63, so mark the io_safety exports in `std::os::wasi::io` as stable.
Fixes#103306.
Previously, the signal mask is always reset when a child process is
started. This breaks tools like `nohup` which expect `SIGHUP` to be
blocked.
With this change, the default behavior changes to inherit the signal mask.
This also changes the signal disposition for `SIGPIPE` to only be
changed if the `#[unix_sigpipe]` attribute isn't set.
Rollup of 9 pull requests
Successful merges:
- #103221 (Fix `SelfVisitor::is_self_ty` ICE)
- #103230 (Clarify startup)
- #103281 (Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output)
- #103288 (Fixed docs typo in `library/std/src/time.rs`)
- #103296 (+/- shortcut now only expand/collapse, not both)
- #103297 (fix typo)
- #103313 (Don't label `src/test` tests as `A-testsuite`)
- #103315 (interpret: remove an incorrect assertion)
- #103319 (Improve "`~const` is not allowed here" message)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
interpret: remove an incorrect assertion
This fixes an ICE in Miri, [reported](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/SwitchInt.20with.20no.20targets.3F) by `@saethlin.` The faulty assertion was introduced by 432535da2b, when a previously correct assertion checking that the `otherwise` target exists got replaced by this assertion checking that at least one more target beyond `otherwise` exists.
Sadly we don't have a small reproducer so I don't think we can easily add a testcase.
Fixed docs typo in `library/std/src/time.rs`
* Changed comment from `Previous rust versions panicked when self was earlier than the current time.` to `Previous rust versions panicked when the current time was earlier than self.`
* Resolves#103282.
Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output
This is essentially a documentation-only change (although it does touch code in an irrelevant way).
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO
In https://github.com/rust-lang/rust/pull/100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options.
So this PR just disables it for LTO builds in general.
Fix the bug of next_point in source_map
There is a bug in `next_point`, the new span won't move to next position when be called in the first time.
For this reason, our current code is working like this:
1. When we really want to move to the next position, we called two times of `next_point`
2. Some code which use `next_point` actually done the same thing with `shrink_to_hi`
This fix make sure when `next_point` is called, span will move with the width at least 1, and also work correctly in the scenario of multiple bytes.
Ref: https://github.com/rust-lang/rust/pull/103140#discussion_r997710998
r? `@davidtwco`