| Age | Commit message (Collapse) | Author | Lines |
|
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions
Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review.
Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions.
r? `@estebank`
|
|
r=wesleywiser
layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)`
Use the `<T as Pointee>::Metadata` associated type to calculate the layout of a pointee's metadata, instead of hard-coding rules about certain types.
Maybe this approach is overkill -- we could instead hard-code this approach as a fallback, with the matching on `Slice`/`Dynamic`/etc. happening first
Fixes this issue here https://github.com/rust-lang/rust/pull/104338#issuecomment-1312595844 .. But is also useful with transmutes, for example, given the UI test I added below.
|
|
Rollup of 8 pull requests
Successful merges:
- #104748 (Ensure `lld` is supported with `download-ci-llvm`)
- #105541 (Simplify some iterator combinators)
- #106045 (default OOM handler: use non-unwinding panic, to match std handler)
- #106157 (Don't trim path for `unsafe_op_in_unsafe_fn` lints)
- #106353 (Reduce spans for `unsafe impl` errors)
- #106381 (Jsondoclint: Add `--verbose` and `--json-output` options)
- #106411 (rustdoc: remove legacy font-feature-settings CSS)
- #106414 (Add cuviper to the review rotation for libs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Reduce spans for `unsafe impl` errors
Because huge spans aren't great for IDEs.
Prior art: https://github.com/rust-lang/rust/pull/103749
|
|
LeSeulArtichaut:106126-thir-unsafeck-good-path-bug-2, r=compiler-errors
Don't trim path for `unsafe_op_in_unsafe_fn` lints
Fixes #106126, alternative to #106127.
r? `@ghost` for now.
|
|
|
|
|
|
|
|
PlayStation Vita support
Just the compiler definitions for no-std projects and std support using newlib
Earlier PR: https://github.com/rust-lang/rust/pull/105606
|
|
Previously it was not clear why this errored or if it was even supported, as there was no
diagnostic that suggested wrapping it in braces.
Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
|
|
Grammar : Missing "is" in format specifier diagnostic
|
|
r=Nilstrieb
Test the borrowck behavior of if-let guards
Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`.
This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419.
cc `@pnkfelix` are there any other tests that you would want to see?
cc tracking issue #51114
|
|
|
|
HIR debug output is currently very verbose, especially when used with
the alternate (`#`) flag. This commit reduces the amount of noisy
newlines by forcing a few small key types to stay on one line, which
makes the output easier to read and scroll by.
```
$ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l
582
$ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l
932
```
|
|
Also update tests
|
|
|
|
Merge multiple mutable borrows of immutable binding errors
Fix #53466.
|
|
|
|
|
|
|
|
Fix #53466.
|
|
|
|
refactor: merge error code `E0465` into `E0464`
`E0465` is an undocumented and untested error code that is functionally identical to `E0464`. This PR merges `E0465` into `E0464`, thus documenting and testing another error code (#61137).
r? `@GuillaumeGomez` (not sure if you want to review this but it's relevant to my other PRs that you have reviewed)
|
|
Suppress errors due to TypeError not coercing with inference variables
Fixes #75331
Fixes #68507
Fixes #82323
cc `@estebank`
|
|
Use verbose suggestions for mutability errors
|
|
|
|
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint"
This is a clean revert of #105484.
I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe.
FYI `@nbdd0121` `@compiler-errors`
|
|
|
|
see #106182
|
|
|
|
|
|
The test was minified from the published `msf-ice:0.2.1` crate which failed in a crater run.
A faulty compiler was triggering a `higher-ranked lifetime error`:
> could not prove `[async block@...]: Send`
|
|
r=compiler-errors
Allow trait method paths to satisfy const Fn bounds
r? `@oli-obk`
|
|
Rollup of 9 pull requests
Successful merges:
- #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params)
- #105899 (`./x doc library --open` opens `std`)
- #106190 (Account for multiple multiline spans with empty padding)
- #106202 (Trim more paths in obligation types)
- #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing)
- #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`)
- #106259 (Update Clippy)
- #106260 (Fix index out of bounds issues in rustdoc)
- #106263 (Formatter should not try to format non-Rust files)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
docs/test: add docs and a UI test for `E0514` and `E0519`
No UI test on `E0514`, it would need to compile with a different `rustc` version.
r? `@GuillaumeGomez`
|
|
Trim more paths in obligation types
|
|
Account for multiple multiline spans with empty padding
Instead of
```
LL | fn oom(
| __^
| | _|
| ||
LL | || ) {
| ||_-
LL | | }
| |__^
```
emit
```
LL | // fn oom(
LL | || ) {
| ||_-
LL | | }
| |__^
```
|
|
r=estebank
Provide a better error and a suggestion for `Fn` traits with lifetime params
Given `Fn`-family traits with lifetime params in trait bounds like `fn f(_: impl Fn<'a>(&'a str) -> bool)`, we currently produce many unhelpful errors.
This PR allows these situations to suggest simply using Higher-Rank Trait Bounds like `for<'a> Fn(&'a str) -> bool`.
Fixes https://github.com/rust-lang/rust/issues/103490.
|
|
Instead of
```
LL | fn oom(
| __^
| | _|
| ||
LL | || ) {
| ||_-
LL | | }
| |__^
```
emit
```
LL | // fn oom(
LL | || ) {
| ||_-
LL | | }
| |__^
```
|
|
Rollup of 9 pull requests
Successful merges:
- #106208 (Make trait/impl `where` clause mismatch on region error a bit more actionable)
- #106216 (Powershell: Use `WaitForExit` instead of `-Wait`)
- #106217 (rustdoc: remove unnecessary `.tooltip::after { text-align: center }`)
- #106218 (Migrate css var scraped examples)
- #106221 (Rename `Rptr` to `Ref` in AST and HIR)
- #106223 (On unsized locals with explicit types suggest `&`)
- #106225 (Remove CraftSpider from review rotation)
- #106229 (update Miri)
- #106242 (Detect diff markers in the parser)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Detect diff markers in the parser
Partly address #32059.
|
|
On unsized locals with explicit types suggest `&`
Fix #72742.
|
|
r=compiler-errors
Rename `Rptr` to `Ref` in AST and HIR
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
|
|
Make trait/impl `where` clause mismatch on region error a bit more actionable
Improve `where` clause suggestions for GATs/methods that have incompatible region predicates in their `where` clauses.
Also addresses this diagnostic that went away https://github.com/rust-lang/rust/pull/106129#discussion_r1056875772
|
|
Nilstrieb:no-more-being-clueless-whether-it-really-is-a-literal, r=compiler-errors
Improve heuristics whether `format_args` string is a source literal
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.
Fixes #106191
|
|
This reverts commit b656e2413022de1863b9ea8db87454477b816042.
|
|
Give the correct track-caller location with MIR inlining.
Fixes https://github.com/rust-lang/rust/issues/105538
|
|
Currently, given `Fn`-family traits with lifetime params like
`Fn<'a>(&'a str) -> bool`, many unhelpful errors show up. These are a
bit confusing.
This commit allows these situations to suggest simply using
higher-ranked trait bounds like `for<'a> Fn(&'a str) -> bool`.
|
|
|
|
|