| Age | Commit message (Collapse) | Author | Lines |
|
consistent handling of missing sysroot spans
Due to https://github.com/rust-lang/rust/issues/53081, sysroot spans (pointing to code in libcore/libstd/...) fails to print on some x86 runners. This consolidates the ignore directives for that and references the relevant issue.
I also did that for the generated derive-error-span tests -- but there the script and the tests were not entirely in sync any more since https://github.com/rust-lang/rust/pull/64151. Cc @estebank @varkor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ohadravid:fix-incorrect-diagnostics-with-an-associated-type, r=estebank
Fix incorrect diagnostics for expected type in E0271 with an associated type
With code like the following code:
```rust
#[derive(Debug)]
struct Data {}
fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
for item in iterator {
println!("{:?}", item)
}
}
fn main() {
let v = vec![Data {}];
do_stuff(v.into_iter());
}
```
the diagnostic (in nightly & stable) wrongly complains about the expected type:
```
error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data`
--> src/main.rs:15:5
|
5 | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
| -------- --------------- required by this bound in `do_stuff`
...
15 | do_stuff(v.into_iter());
| ^^^^^^^^ expected struct `Data`, found &Data
|
= note: expected type `Data`
found type `&Data`
```
This PR fixes this issue by flipping the expected/actual values where appropriate, so it looks like this:
```
error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data`
--> main.rs:15:5
|
5 | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
| -------- --------------- required by this bound in `do_stuff`
...
15 | do_stuff(v.into_iter());
| ^^^^^^^^ expected &Data, found struct `Data`
|
= note: expected type `&Data`
found type `Data`
```
This improves the output of a lot of existing tests (check out `associated-types-binding-to-type-defined-in-supertrait`!).
The only change which I wasn't too sure about is in the test `associated-types-overridden-binding-2`, but I think it's an improvement and the underlying problem is with handling of `trait_alias`.
Fix #57226, fix #64760, fix #58092.
|
|
Make ItemContext available for better diagnositcs
Fix #62570
|
|
|
|
|
|
|
|
|
|
Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
r? @Centril
|
|
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
|
|
|
|
|
|
- Compatible with Emscripten 1.38.46-upstream or later upstream.
- Refactors the Emscripten target spec to share code with other wasm
targets.
- Replaces the old incorrect wasm32 C call ABI with the correct one,
preserving the old one as wasm32_bindgen_compat for wasm-bindgen
compatibility.
- Updates the varargs ABI used by Emscripten and deletes the old one.
- Removes the obsolete wasm32-experimental-emscripten target.
- Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
|
|
r=cramertj
don't assume we can *always* find a return type hint in async fn
In particular, we sometimes cannot if there is an earlier error.
Fixes #65159
r? @cramertj, who reviewed the original PR
|
|
Reducing spurious unused lifetime warnings.
Fixes #61115, fixes #64493.
|
|
|
|
Print lifetimes with backticks
Fixes #65287
r? @varkor
|
|
In particular, we sometimes cannot if there is an earlier error.
|
|
|
|
|
|
This reverts commit 37026837a3f23486d3cf1009d9136927168ddb33.
|
|
Suggest to add `move` keyword for generator capture
Closes #64382
r? @estebank
|
|
|
|
Make `into` schedule drop for the destination
closes #47949
|
|
|
|
|
|
Fix most remaining Polonius test differences
This fixes most of the Polonius test differences and also avoids overflow in issue-38591.rs.
r? @nikomatsakis
|
|
r=cramertj
extract expected return type for async fn generators
Fixes #60424
cc @Centril, I know you've been eager to see this fixed.
r? @cramertj
|
|
|
|
|
|
|
|
This fixes some test differences and also avoids overflow in
issue-38591.rs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that https://github.com/rust-lang/rust/pull/64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing https://github.com/rust-lang/rust/issues/64252.~ -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
|
|
Silence unreachable code lint from await desugaring
Fixes #61798.
This PR silences the unreachable code lint when it originates from within an await desugaring.
|
|
|
|
This commit improves obligation errors for async/await:
```
note: future does not implement `std::marker::Send` because this value is used across an
await
--> $DIR/issue-64130-non-send-future-diags.rs:15:5
|
LL | let g = x.lock().unwrap();
| - has type `std::sync::MutexGuard<'_, u32>`
LL | baz().await;
| ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
| - `g` is later dropped here
```
Signed-off-by: David Wood <david@davidtw.co>
|
|
This commit silences the unreachable code lint when it originates from
within a await desugaring.
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
|