| Age | Commit message (Collapse) | Author | Lines |
|
r=compiler-errors
Suggest `mut self: &mut Self` for `?Sized` impls
Closes #106325
Closes #93078
The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start.
``@rustbot`` label +A-diagnostics
|
|
|
|
|
|
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #101936 (Migrating rustc_infer to session diagnostics (part 3))
- #104081 (PhantomData layout guarantees)
- #104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3])
- #105128 (Add O(1) `Vec -> VecDeque` conversion guarantee)
- #105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.)
- #105859 (Point out span where we could introduce higher-ranked lifetime)
- #106509 (Detect closures assigned to binding in block)
- #106553 (docs: make `HashSet::retain` doctest more clear)
- #106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`)
- #106564 (Change to immutable borrow when cloning element of RepeatN)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Detect closures assigned to binding in block
Fix #58497.
|
|
Point out span where we could introduce higher-ranked lifetime
Somewhat addresses #105422, but not really. We don't have that much useful information here since we're still in resolution :^(
Maybe this suggestion isn't worth it. If the reviewer has an idea how we can get a more succinct binder information for a structured suggestion, it would be appreciated.
|
|
Fix process-panic-after-fork.rs to pass on newer versions of Android.
The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.
|
|
Add regression test for #86106
Closes #86106
r? `@nikic`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Perform SimplifyLocals before ConstProp.
MIR before `ConstProp` may have a lot of dead writes, this makes `ConstProp` do unnecessary work.
r? `@ghost`
|
|
Detect bindings assigned blocks without tail expressions
Fix #44173.
|
|
Delay until user annotations are registered.
See the added test.
|
|
|
|
Projection types in user annotations may contain inference variables.
This makes the normalization depend on the unification with the actual
type and thus requires a separate TypeOp to track the obligations.
Otherwise simply calling `TypeChecker::normalize` would ICE with
"unexpected ambiguity"
|
|
|
|
|
|
We delay projection normalization to further stages in order to
register user type annotations before normalization in HIR typeck.
There are two consumers of astconv: ItemCtxt and FnCtxt.
The former already expects unnormalized types from astconv, see its
AstConv trait impl.
The latter needs `RawTy` for a cleaner interface.
Unfortunately astconv still needs the normalization machinery in
order to resolve enum variants that have projections in the self type,
e.g. `<<T as Trait>::Assoc>::StructVariant {}`.
This is why `AstConv::normalize_ty_2` is necessary.
|
|
Add help diag. for `const = Enum` missing braces around `Enum`
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.
Fixes #105927
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Rollup of 4 pull requests
Successful merges:
- #106525 (Report WF error for chalk *and* new solver)
- #106533 (Use smaller spans for missing lifetime/generic args)
- #106543 (rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`)
- #106554 (Fix a typo in the explanation of E0588)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=GuillaumeGomez
rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`
This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged.
Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
|
|
TaKO8Ki:use-smaller-span-for-missing-lifetime/generic-args, r=compiler-errors
Use smaller spans for missing lifetime/generic args
We can remove ident from suggestions.
|
|
Report WF error for chalk *and* new solver
addressing this nit https://github.com/rust-lang/rust/pull/106385#discussion_r1062571070
No test yet because new solver is currently unusable, lol
r? `@lcnr`
|
|
rustdoc: Strip imports of items which are `#[doc(hidden)]`
Closes #106379
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #106287 (Add some docs to `bug`, `span_bug` and `delay_span_bug`)
- #106341 (refactor: clean up `errors.rs` and `error_codes_check.rs`)
- #106453 (Improve include macro documentation)
- #106466 (Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links)
- #106528 (Tiny formatting fix)
- #106534 (rustdoc-gui: Use new block syntax for define-function in goml scripts)
- #106542 (Add default and latest stable edition to --edition in rustc (attempt 2))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Fix #37914.
|
|
|
|
rustdoc-gui: Use new block syntax for define-function in goml scripts
r? `@notriddle`
|
|
Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links
Fixes #103517
While generating the location for modules source HTML to be saved at, a `..` path component appeared to be translated to `/up/`.
Additionally, while generating the navigation sidebar, `..` path components were ignored. This means that (as in the issue above), a *real* directory structure of:
```
sys/
unix/
mod.rs <-- contains #![path = "../unix/mod.rs]
cmath.rs
```
was rendered as:
```
sys/
unix/
mod.rs
unix/
cmath.rs <-- links to sys/unix/unix/cmath.rs.html, 404
```
While the *files* were stored as
```
sys/
unix/
mod.rs.html
up/
unix/
cmath.rs.html
```
|
|
This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433,
before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars
were merged.
Now that they are merged, the source sidebar is being pushed
off-screen anyway, so giving it zero width doesn't do much.
|
|
Closes #106379
|
|
Correct detection of elided lifetimes in impl-trait.
Fixes https://github.com/rust-lang/rust/issues/106338
r? `@compiler-errors`
cc `@pnkfelix`
|
|
|
|
|
|
cleanup: handle -Zmutable-noalias like -Zbox-noalias
r? `@bjorn3`
cc `@RalfJung` this will conflict with #106180
|
|
fix rustdoc ui test
|
|
Suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs
fix for #105227.
The problem: The suggestion of adding an explicit `'_` lifetime bound is **incorrect** when the function's return type contains a value which could be borrowed from more than one lifetimes of the function's inputs. Instead, a named lifetime parameter can be introduced in such a case.
The solution: Checking the number of elided lifetimes in the function signature. If more than one lifetimes found in the function inputs when the suggestion of adding explicit `'_` lifetime, change it to using named lifetime parameter `'a` instead.
|
|
Rollup of 5 pull requests
Successful merges:
- #106400 (Point at expressions where inference refines an unexpected type)
- #106491 (Fix error-index redirect to work with the back button.)
- #106494 (Add regression test for #58355)
- #106499 (fix [type error] for error E0029 and E0277)
- #106502 (rustdoc: remove legacy user-select CSS)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
fix [type error] for error E0029 and E0277
check explicitly for the type references error
if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix #105946
|
|
Add regression test for #58355
Closes #58355
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Point at expressions where inference refines an unexpected type
Fix #106355. Fix #14007. (!)
```
error[E0308]: mismatched types
--> src/test/ui/type/type-check/point-at-inference.rs:12:9
|
9 | foo.push(i);
| - this is of type `&{integer}`, which makes `foo` to be inferred as `Vec<&{integer}>`
...
12 | bar(foo);
| --- ^^^ expected `i32`, found `&{integer}`
| |
| arguments to this function are incorrect
|
= note: expected struct `Vec<i32>`
found struct `Vec<&{integer}>`
note: function defined here
--> src/test/ui/type/type-check/point-at-inference.rs:2:4
|
2 | fn bar(_: Vec<i32>) {}
| ^^^ -----------
help: consider dereferencing the borrow
|
9 | foo.push(*i);
| +
```
|
|
Add vendor to Fuchsia's target triple
Historically, Rust's Fuchsia targets have been labeled x86_64-fuchsia and aarch64-fuchsia. However, they should technically contain vendor information. This CL changes Fuchsia's target triples to include the "unknown" vendor since Clang now does normalization and handles all triple spellings.
This was previously attempted in #90510, which was closed due to inactivity.
|
|
check explicitly for the type references error
if ty.references_error() is true change the error to be err.delay_as_bug()
and prevent the error E0029 and E0277 from emitting out
this fix #105946
|
|
more than one lifetimes of the function's inputs
|
|
|