Files
rust/tests/ui/type
Esteban Küber ca2139d326 Point at return type when it is the source of the type expectation
When calling an fn that returns a return type as a returned expression, point at the return type to explain that it affects the expected type.

```
error[E0308]: mismatched types
    --> f56.rs:5:15
     |
   3 | fn main() {
     |          - the call expression's return type is influenced by this return type
   4 |     let a = 0;
   5 |     ptr::read(&a)
     |     --------- ^^ expected `*const ()`, found `&{integer}`
     |     |
     |     arguments to this function are incorrect
     |
     = note: expected raw pointer `*const ()`
                  found reference `&{integer}`
note: function defined here
    --> library/core/src/ptr/mod.rs:1681:21
     |
1681 | pub const unsafe fn read<T>(src: *const T) -> T {
     |                     ^^^^
```
2026-03-18 23:42:20 +00:00
..
2025-07-10 18:47:20 +05:00
2025-10-11 20:50:21 +00:00
2025-11-03 16:24:36 +00:00
2025-10-11 20:50:21 +00:00
2025-12-07 10:37:45 +09:00