-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Diggsey/fix-ub
Fix undefined behaviour.
- Loading branch information
Showing
3 changed files
with
95 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
[package] | ||
name = "field-offset" | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
authors = ["Diggory Blake <[email protected]>"] | ||
description = "Safe pointer-to-member implementation" | ||
repository = "https://github.com/Diggsey/rust-field-offset" | ||
readme = "README.md" | ||
license = "MIT OR Apache-2.0" | ||
|
||
[dependencies] | ||
|
||
[build-dependencies] | ||
rustc_version = "0.2.3" |
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,12 @@ | ||
extern crate rustc_version; | ||
use rustc_version::{version, Version}; | ||
|
||
fn main() { | ||
// Assert we haven't travelled back in time | ||
assert!(version().unwrap().major >= 1); | ||
|
||
// Check for a minimum version | ||
if version().unwrap() >= Version::parse("1.36.0").unwrap() { | ||
println!("cargo:rustc-cfg=fieldoffset_maybe_uninit"); | ||
} | ||
} |
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