| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Remove `ignore-compare-mode-nll` annotations from tests
Since #95565 these do nothing as compare-mode-nll has been removed.
r? `@jackh726`
|
|
Add regresion test for #67498
Closes #67498
r? `@compiler-errors`
|
|
r=compiler-errors
Suggest using `iter()` or `into_iter()` for `Vec`
We cannot do that for `&Vec` because `#[rustc_on_unimplemented]` is limited (it does not clean generic instantiation for references, only for ADTs).
`@rustbot` label +A-diagnostics
|
|
Suggest escaping `box` as identifier
Fixes #97810.
|
|
Don't suggest adding `let` in certain `if` conditions
Avoid being too eager to suggest `let` in an `if` condition with an `=`, namely when the LHS of the `=` isn't even valid as a pattern (to a first degree approximation).
This heustic I came up with kinda sucks. Let me know if it needs to be refined.
|
|
Fix indices and remove some unwraps in arg mismatch algorithm
This is a more conservative fix than #97542, addressing some indices which were used incorectly and unwraps which are bound to panic (e.g. when the provided and expected arg counts differ). Beta nominating this as it's quite easy to cause ICEs -- I wrote a fuzzer and found hundreds of examples of ICEs.
cc `@jackh726` as author of #92364, and `@estebank` as reviewer of that PR.
fixes #97484
r? `@jackh726` this should be _much_ easier to review than the other PR :sweat_smile:
|
|
|
|
Add regression test for anonymous lifetimes
Fixes #84634.
Seems like this issue was already solved. I added a regression test just in case so we can close it with peace in mind.
r? `@notriddle`
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #97276 (Stabilize `const_intrinsic_copy`)
- #97763 (Allow ptr_from_addr_cast to fail)
- #97846 (Specify DWARF alignment in bits, not bytes.)
- #97848 (Impl Traits lowering minor refactors)
- #97865 (remove `BorrowckMode`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Specify DWARF alignment in bits, not bytes.
In DWARF, alignment of types is specified in bits, as is made clear by the
parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte
alignment. This commit fixes that.
This was noticed in upstream LLVM when I tried to check in a test consisting of
LLVM IR generated from `rustc` and it triggered assertions [1].
[1]: https://reviews.llvm.org/D126835
|
|
|
|
We cannot do that for `&Vec` because `#[rustc_on_unimplemented]` is limited (it does not clean generic instantiation for references, only for ADTs).
|
|
|
|
Make `Encodable` and `Encoder` infallible.
A follow-up to #93066.
r? `@ghost`
|
|
fixes #97698
|
|
|
|
|
|
Recover missing comma after match arm
If we're missing a comma after a match arm expression, try parsing another pattern and a following `=>`. If we find both of those, then recover by suggesting to insert a `,`.
Fixes #80112
|
|
Recover `import` instead of `use` in item
When we definitely don't have a macro invocation (i.e. when we don't have `import ::`), then it's more productive to parse `import` as if it was incorrectly mistaken for `use`.
Not sure if this needs to be a verbose suggestion, but it renders strangely when it's not verbose:
```
error: expected item, found `import`
--> /home/michael/test.rs:1:1
|
1 | import std::{io::{self, Write}, rc::Rc};
| ^^^^^^ help: items are imported using the `use` keyword: `use`
```
Happy to change it to `span_suggestion` instead of `span_suggestion_verbose` though.
Fixes #97788
|
|
r=RalfJung,JakobDegen
Preserve unused pointer to address casts
Fixes #97421.
cc `@RalfJung`
|
|
Remove unwrap from get_vtable
This avoids ICE on issue #97381 I think the bug is a bit deeper though, it compiles fine when `v` is `&v` which makes me think `Deref` is causing some issue with borrowck but it's fine I guess since this thing crashes since `nightly-2020-09-17` 😅
|
|
|
|
|
|
|
|
This avoids the name clash with `rustc_serialize::Encoder` (a trait),
and allows lots qualifiers to be removed and imports to be simplified
(e.g. fewer `as` imports).
|
|
This simplifies things, but requires making `CacheEncoder` non-generic.
|
|
Use more targeted suggestion when confusing i8 with std::i8
r? `@compiler-errors`
|
|
Add regresion test for #95307
Closes #95307
r? `@compiler-errors`
|
|
|
|
There are two impls of the `Encoder` trait: `opaque::Encoder` and
`opaque::FileEncoder`. The former encodes into memory and is infallible, the
latter writes to file and is fallible.
Currently, standard `Result`/`?`/`unwrap` error handling is used, but this is a
bit verbose and has non-trivial cost, which is annoying given how rare failures
are (especially in the infallible `opaque::Encoder` case).
This commit changes how `Encoder` fallibility is handled. All the `emit_*`
methods are now infallible. `opaque::Encoder` requires no great changes for
this. `opaque::FileEncoder` now implements a delayed error handling strategy.
If a failure occurs, it records this via the `res` field, and all subsequent
encoding operations are skipped if `res` indicates an error has occurred. Once
encoding is complete, the new `finish` method is called, which returns a
`Result`. In other words, there is now a single `Result`-producing method
instead of many of them.
This has very little effect on how any file errors are reported if
`opaque::FileEncoder` has any failures.
Much of this commit is boring mechanical changes, removing `Result` return
values and `?` or `unwrap` from expressions. The more interesting parts are as
follows.
- serialize.rs: The `Encoder` trait gains an `Ok` associated type. The
`into_inner` method is changed into `finish`, which returns
`Result<Vec<u8>, !>`.
- opaque.rs: The `FileEncoder` adopts the delayed error handling
strategy. Its `Ok` type is a `usize`, returning the number of bytes
written, replacing previous uses of `FileEncoder::position`.
- Various methods that take an encoder now consume it, rather than being
passed a mutable reference, e.g. `serialize_query_result_cache`.
|
|
|
|
In DWARF, alignment of types is specified in bits, as is made clear by the
parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte
alignment. This commit fixes that.
This was noticed in upstream LLVM when I tried to check in a test consisting of
LLVM IR generated from `rustc` and it triggered assertions [1].
[1]: https://reviews.llvm.org/D126835
|
|
|
|
The output of IR formatting changed slightly in upstream rev
a0bc67e555f404d0e7ddb2e78cb891d96eaf913d
(https://reviews.llvm.org/D123096). I'm not actually sure what any of
that means, as I don't even know what hexagon is in this context, but
this change allows the test to pass on both old and new LLVMs.
r? @nikic
|
|
|
|
Add more information for rustdoc-gui tests
It was missing `--no-sandbox` in the `--help` message and the README was a bit outdated.
cc `@jsha` (I recall you asking some questions about passing arguments to the rustdoc gui tester so here it).
r? `@notriddle`
|
|
Fix precise field capture of univariant enums
When constructing a MIR from a THIR field expression, introduce an
additional downcast projection before accessing a field of an enum.
When rebasing a place builder on top of a captured place, account for
the fact that a single HIR enum field projection corresponds to two MIR
projection elements: a downcast element and a field element.
Fixes #95271.
Fixes #96299.
Fixes #96512.
Fixes #97378.
r? ``@nikomatsakis`` ``@arora-aman``
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #97058 (Various refactors to the incr comp workproduct handling)
- #97301 (Allow unstable items to be re-exported unstably without requiring the feature be enabled)
- #97738 (Fix ICEs from zsts within unsized types with non-zero offsets)
- #97771 (Remove SIGIO reference on Haiku)
- #97808 (Add some unstable target features for the wasm target codegen)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Fix ICEs from zsts within unsized types with non-zero offsets
- Fixes #97732
- Fixes ICEs while compiling `alloc` with `-Z randomize-layout`
r? ``@eddyb``
|
|
Allow unstable items to be re-exported unstably without requiring the feature be enabled
Closes #94972
The diagnostic may need some work still, and I haven't added a test yet
|