Files
rust/library/core/src
bors d9d89fd53d Auto merge of #119807 - Emilgardis:track_caller_from_impl_into, r=Nilstrieb
Add `#[track_caller]` to the "From implies Into" impl

This pr implements what was mentioned in https://github.com/rust-lang/rust/issues/77474#issuecomment-1074480790

This follows from my URLO https://users.rust-lang.org/t/104497

```rust
#![allow(warnings)]
fn main() {
    // Gives a good location
    let _: Result<(), Loc> = dbg!(Err::<(), _>(()).map_err(|e| e.into()));

    // still doesn't work, gives location of `FnOnce::call_once()`
    let _: Result<(), Loc> = dbg!(Err::<(), _>(()).map_err(Into::into));
}

#[derive(Debug)]
pub struct Loc {
    pub l: &'static std::panic::Location<'static>,
}

impl From<()> for Loc {
    #[track_caller]
    fn from(_: ()) -> Self {
        Loc {
            l: std::panic::Location::caller(),
        }
    }
}
```
2024-01-21 14:17:25 +00:00
..
2023-10-13 14:54:33 +02:00
2023-12-14 19:05:03 -05:00
2023-12-12 07:03:37 +00:00
2024-01-09 14:15:45 +01:00
2023-12-22 11:14:11 +01:00
2023-12-22 11:01:42 +01:00
2023-12-10 10:56:22 +08:00
2023-12-22 11:14:11 +01:00
2023-09-06 09:47:22 -07:00
2024-01-20 18:27:55 +00:00
2023-11-15 21:45:48 -05:00
2024-01-04 15:48:22 -08:00
2024-01-11 13:33:27 +01:00
2024-01-07 08:57:23 -08:00
2023-11-05 19:45:17 +01:00
2023-12-22 11:14:11 +01:00