-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crates/sel4-panicking: Work with more rustc versions
Signed-off-by: Nick Spinale <[email protected]>
- Loading branch information
Showing
6 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright 2024, Colias Group, LLC | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// | ||
|
||
use core::cmp::Reverse; | ||
|
||
// Determine whether rustc includes https://github.com/rust-lang/rust/pull/121598 | ||
|
||
fn main() { | ||
let version_meta = rustc_version::version_meta().unwrap(); | ||
let semver = version_meta.semver; | ||
let commit_date = order_date(version_meta.commit_date); | ||
let key = (semver.major, semver.minor, semver.patch, commit_date); | ||
let first_with_change = (1, 78, 0, order_date(Some("2024-02-28".to_owned()))); | ||
if key < first_with_change { | ||
println!("cargo:rustc-cfg=catch_unwind_intrinsic_still_named_try"); | ||
} | ||
} | ||
|
||
// assume no build date means more recent | ||
fn order_date(date: Option<String>) -> Reverse<Option<Reverse<String>>> { | ||
Reverse(date.map(Reverse)) | ||
} |
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