| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Partly address #32059.
|
|
|
|
Properly calculate best failure in macro matching
Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream.
We now try to properly use the location in the token stream.
This needs a little cleanup as the `best_failure` field is getting out of hand but it should be mostly good to go. I hope I didn't violate too many abstraction boundaries..
|
|
Fix #72742.
|
|
|
|
|
|
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already
as well.
|
|
Rollup of 6 pull requests
Successful merges:
- #106028 (docs/test: add UI test and long-form error docs for `E0461`)
- #106172 (Suggest `impl Iterator` when possible for `_` return type)
- #106173 (Deduplicate `op` methods)
- #106176 (Recover `fn` keyword as `Fn` trait in bounds)
- #106194 (rustdoc: combine common sidebar background color CSS rules)
- #106199 (Silence knock-down errors on `[type error]` bindings)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Previously, it only checked whether there was _a_ literal at the span of
the first argument, not whether the literal actually matched up. This
caused issues when a proc macro was generating a different literal with
the same span.
This requires an annoying special case for literals ending in `\n`
because otherwise `println` wouldn't give detailed diagnostics anymore
which would be bad.
|
|
Silence knock-down errors on `[type error]` bindings
Fix #56036, fix #76589.
|
|
Recover `fn` keyword as `Fn` trait in bounds
`impl fn()` -> `impl Fn()`
Fixes #82515
|
|
Suggest `impl Iterator` when possible for `_` return type
Address #106096.
|
|
Some `compare_method` tweaks
1. Make some of the comparison functions' names more regular
2. Reduce pub scope of some of the things in `compare_method`
~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~
* moved to a different PR
4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test.
5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :)
6. Rename `collect_trait_impl_trait_tys`
|
|
|
|
Emit fewer errors on invalid `#[repr(transparent)]` on `enum`
Fix #68420.
|
|
Implement allow-by-default `multiple_supertrait_upcastable` lint
The lint detects when an object-safe trait has multiple supertraits.
Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them.
r? `@nikomatsakis`
|
|
Account for `match` expr in single line
When encountering `match Some(42) { Some(x) => x, None => "" };`, output
```
error[E0308]: `match` arms have incompatible types
--> f53.rs:2:52
|
2 | let _ = match Some(42) { Some(x) => x, None => "" };
| -------------- - ^^ expected integer, found `&str`
| | |
| | this is found to be of type `{integer}`
| `match` arms have incompatible types
```
|
|
Fix `unused_must_use` warning for `Box::from_raw`
|
|
|
|
Fix #68420.
|
|
Fix #56036, fix #76589.
|
|
When encountering `match Some(42) { Some(x) => x, None => "" };`, output
```
error[E0308]: `match` arms have incompatible types
--> f53.rs:2:52
|
2 | let _ = match Some(42) { Some(x) => x, None => "" };
| -------------- - ^^ expected integer, found `&str`
| | |
| | this is found to be of type `{integer}`
| `match` arms have incompatible types
```
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #103718 (More inference-friendly API for lazy)
- #105765 (Detect likely `.` -> `..` typo in method calls)
- #105852 (Suggest rewriting a malformed hex literal if we expect a float)
- #105965 (Provide local extern function arg names)
- #106064 (Partially fix `explicit_outlives_requirements` lint in macros)
- #106179 (Fix a formatting error in Iterator::for_each docs)
- #106181 (Fix doc comment parsing description in book)
- #106187 (Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`)
- #106189 (Fix UnsafeCell Documentation Spelling Error)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Partially fix `explicit_outlives_requirements` lint in macros
Show the suggestion if and only if the bounds are from the same source context.
fixes https://github.com/rust-lang/rust/issues/106044
fixes https://github.com/rust-lang/rust/issues/106063
|
|
Provide local extern function arg names
Fixes #105896
|
|
Suggest rewriting a malformed hex literal if we expect a float
Fixes #104706
|
|
Detect likely `.` -> `..` typo in method calls
Fix #65015.
|
|
|
|
More verbose `Debug` implementation of `std::process:Command`
Mainly based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis
close https://github.com/rust-lang/rust/issues/42200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=compiler-errors
Always suggest as `MachineApplicable` in `recover_intersection_pat`
This resolves one FIXME in `recover_intersection_pat` by always applying `MachineApplicable` when suggesting, as `bindings_after_at` is now stable.
This also separates a test to apply `// run-rustfix`.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Add regression test for #99647
Closes #99647
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
r=TaKO8Ki
Remove unreasonable help message for auto trait
Fixes #105788
|
|
A number of tests under ui/const-ptr and ui/consts are currently
failing on big-endian platforms as the binary encoding of some
constants is hard-coded in the stderr test files. Fix this by
providing a normalize-stderr-test rule that strips out the
raw bytes hex dump, so the comparison can be done in an
endianness-independent manner. Note that in most cases, this
means the tests are now also independent of word size, so the
32bit and 64bit cases can be re-unified.
To keep tests that verify the details of those raw bytes dumps,
a new test case raw-bytes.rs performs the tests where the hex
dumps were stripped out a second time, but only on little-
endian platforms.
In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes
an endian-specific difference in this diagnostic output:
constructing invalid value at .<deref>[0]: encountered 0x11,
but expected a boolean
depending on which byte of D0 is not a boolean value (0 or 1).
Fixed this by choosing a value of D0 that differs from 0 or 1
in all bytes.
Fixes part of https://github.com/rust-lang/rust/issues/105383.
|
|
Rollup of 4 pull requests
Successful merges:
- #105515 (Account for macros in const generics)
- #106146 (Readme: update section on how to run `x.py`)
- #106150 (Detect when method call on LHS might be shadowed)
- #106174 (Remove unused empty CSS rules in ayu theme)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis
close https://github.com/rust-lang/rust/issues/42200
Add env variables and cwd to the shell-like debug output.
Also use the alternate syntax to display a more verbose display, while not showing internal fields and hiding fields when they have their default value.
|
|
Detect when method call on LHS might be shadowed
Address #39232.
|
|
Account for macros in const generics
Fix #104141.
|
|
Suggest `Pin::as_mut` when encountering borrow error
Fix #65409 for `Pin<&mut T>`.
|
|
|
|
|
|
|