| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
fix: Use correct toolchain channel when generating builtin type doc links
|
|
|
|
r=Veykril
Fix: infer type of async block with tail return expr
Fixes #17106
The `infer_async_block` method calls the `infer_block` method internally, which returns the never type without coercion when `tail_expr` is `None` and `ctx.diverges` is `Diverges::Always`.This is the reason for the bug in this issue.
https://github.com/rust-lang/rust-analyzer/blob/cfce2bb46da62950a8b70ddb0b2a12332da1b1e1/crates/hir-ty/src/infer/expr.rs#L1411-L1413
This PR solves the bug by adding a process to coerce after calling `infer_block` method.
This code passes all the tests, including tests I added for this isuue, however, I am not sure if this solution is right. I think that this solution is an ad hoc solution. So, I would appreciate to have your review.
I apologize if I'm off the mark, but `infer_async_block` method should be rewritten to share code with the process of infering type of `expr::Closure` instead of the `infer_block` method. That way it will be closer to the infer process of rustc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expand macro recursively expands both fp-like and attribute macros when intertwined
|
|
|
|
|
|
|
|
|
|
|
|
When viewing traces, it's slightly confusing when the span name doesn't
match the function name. Ensure the names are consistent.
(It might be worth moving most of these to use #[tracing::instrument]
so the name can never go stale. @davidbarsky suggested that is marginally
slower, so I've just done the simple change here.)
|
|
|
|
internal: Don't render unknown lifetimes when rendering generic args
cc https://github.com/rust-lang/rust-analyzer/issues/17098
|
|
Support hovering limits for adts
Fix #17009
1. Currently, r-a supports limiting the number of struct fields displayed when hovering. This PR extends it to support enum variants and union fields. Since the display of these three (ADTs) is similar, this PR extends 'hover_show_structFields' to 'hover_show_adtFieldsOrVariants'.
2. This PR also resolved the problem that the layout of ADT was not restricted by display limitations when hovering on the Self type.
3. Additionally, this PR changes the default value of display limitations to `10` (instead of the original `null`), which helps users discover this feature.
|
|
|
|
Implement `BeginPanic` handling in const eval
for #16935, needs some figuring out of how to write these tests correctly
|
|
|
|
|
|
|
|
|
|
|
|
Instead of using `core::fmt::format` to format panic messages, which may in turn
panic too and cause recursive panics and other messy things, redirect
`panic_fmt` to `const_panic_fmt` like CTFE, which in turn goes to
`panic_display` and does the things normally. See the tests for the full
call stack.
|
|
|
|
hovering on Self type
|
|
|
|
|