Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the target list to Rust 1.48.0 #12

Merged
merged 2 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- Updated the builtin target list to Rust 1.48.0

## [0.5.0] - 2020-10-20
### Changed
- Updated the builtin target list to Rust 1.47.0
Expand Down
14 changes: 12 additions & 2 deletions src/targets/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use super::*;

pub(crate) const RUSTC_VERSION: &str = "1.47.0";
pub(crate) const RUSTC_VERSION: &str = "1.48.0";

pub const ALL_BUILTINS: &[TargetInfo<'static>] = &[
TargetInfo {
Expand Down Expand Up @@ -474,7 +474,7 @@ pub const ALL_BUILTINS: &[TargetInfo<'static>] = &[
endian: Endian::little,
},
TargetInfo {
triple: "avr-unknown-unknown",
triple: "avr-unknown-gnu-atmega328",
os: Some(Os::unknown),
arch: Arch::avr,
env: None,
Expand Down Expand Up @@ -973,6 +973,16 @@ pub const ALL_BUILTINS: &[TargetInfo<'static>] = &[
pointer_width: 64,
endian: Endian::little,
},
TargetInfo {
triple: "riscv32gc-unknown-linux-gnu",
os: Some(Os::linux),
arch: Arch::riscv32,
env: Some(Env::gnu),
vendor: Some(Vendor::unknown),
family: Some(Family::unix),
pointer_width: 32,
endian: Endian::little,
},
TargetInfo {
triple: "riscv32i-unknown-none-elf",
os: None,
Expand Down
2 changes: 1 addition & 1 deletion src/targets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn get_builtin_target_by_triple(triple: &str) -> Option<&'static TargetInfo<
/// versions.
///
/// ```
/// assert_eq!("1.47.0", cfg_expr::targets::rustc_version());
/// assert_eq!("1.48.0", cfg_expr::targets::rustc_version());
/// ```
pub fn rustc_version() -> &'static str {
builtins::RUSTC_VERSION
Expand Down
22 changes: 21 additions & 1 deletion tests/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,27 @@ impl Target {
Self {
builtin: get_builtin_target_by_triple(s).unwrap(),
#[cfg(feature = "targets")]
lexicon: s.parse().unwrap(),
lexicon: {
// Hack to workaround the addition in 1.48.0 of this weird, non-conformant
// target triple, until https://github.com/bytecodealliance/target-lexicon/issues/63 is
// resolved in a satisfactory manner, not really concerned about
// the presence of this triple in most normal cases
use target_lexicon as tl;
if s == "avr-unknown-gnu-atmega328" {
tl::Triple {
architecture: tl::Architecture::Avr,
vendor: tl::Vendor::Unknown,
operating_system: tl::OperatingSystem::Unknown,
environment: tl::Environment::Unknown,
binary_format: tl::BinaryFormat::Unknown,
}
} else {
match s.parse() {
Ok(l) => l,
Err(e) => panic!("failed to parse '{}': {:?}", s, e),
}
}
},
}
}
}
Expand Down