forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#74958 - Mark-Simulacrum:stable-next, r=pnkfelix
[stable] 1.45.2 release This is intended to fix the stable breakage noted in rust-lang#74954, but does *not* close that issue -- there remains investigation and likely nightly/beta fixes need to be issued as well. r? @pnkfelix
- Loading branch information
Showing
7 changed files
with
49 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// check-pass | ||
|
||
fn main() { | ||
if let Some([b'@', filename @ ..]) = Some(b"@abc123") { | ||
println!("filename {:?}", filename); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// run-pass | ||
|
||
#![feature(track_caller)] | ||
|
||
trait Tracked { | ||
#[track_caller] | ||
fn handle(&self) { | ||
let location = std::panic::Location::caller(); | ||
assert_eq!(location.file(), file!()); | ||
// we only call this via trait object, so the def site should *always* be returned | ||
assert_eq!(location.line(), line!() - 4); | ||
assert_eq!(location.column(), 5); | ||
} | ||
} | ||
|
||
impl Tracked for () {} | ||
impl Tracked for u8 {} | ||
|
||
fn main() { | ||
let tracked: &dyn Tracked = &5u8; | ||
tracked.handle(); | ||
|
||
const TRACKED: &dyn Tracked = &(); | ||
TRACKED.handle(); | ||
} |