-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #93689 - matthiaskrgr:rollup-3pd1ept, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #91939 (Clarify error on casting larger integers to char) - #92300 (mips64-openwrt-linux-musl: Add Tier 3 target) - #92383 (Add new target armv7-unknown-linux-uclibceabi (softfloat)) - #92651 (Remove "up here" arrow on item-infos) - #93556 (Change struct expr pretty printing to match rustfmt style) - #93649 (Add regression tests for issue 80309) - #93657 (Update CPU idle tracking for apple hosts) - #93659 (Refactor conditional) - #93669 (Resolve lifetimes for const generic defaults) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
36 changed files
with
522 additions
and
131 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 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,41 @@ | ||
use std::iter::Peekable; | ||
use std::mem; | ||
use std::ops::Deref; | ||
|
||
pub struct Delimited<I: Iterator> { | ||
is_first: bool, | ||
iter: Peekable<I>, | ||
} | ||
|
||
pub trait IterDelimited: Iterator + Sized { | ||
fn delimited(self) -> Delimited<Self> { | ||
Delimited { is_first: true, iter: self.peekable() } | ||
} | ||
} | ||
|
||
impl<I: Iterator> IterDelimited for I {} | ||
|
||
pub struct IteratorItem<T> { | ||
value: T, | ||
pub is_first: bool, | ||
pub is_last: bool, | ||
} | ||
|
||
impl<I: Iterator> Iterator for Delimited<I> { | ||
type Item = IteratorItem<I::Item>; | ||
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
let value = self.iter.next()?; | ||
let is_first = mem::replace(&mut self.is_first, false); | ||
let is_last = self.iter.peek().is_none(); | ||
Some(IteratorItem { value, is_first, is_last }) | ||
} | ||
} | ||
|
||
impl<T> Deref for IteratorItem<T> { | ||
type Target = T; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.value | ||
} | ||
} |
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 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
23 changes: 23 additions & 0 deletions
23
compiler/rustc_target/src/spec/armv7_unknown_linux_uclibceabi.rs
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,23 @@ | ||
use crate::spec::{Target, TargetOptions}; | ||
|
||
// This target is for uclibc Linux on ARMv7 without NEON, | ||
// thumb-mode or hardfloat. | ||
|
||
pub fn target() -> Target { | ||
let base = super::linux_uclibc_base::opts(); | ||
Target { | ||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(), | ||
pointer_width: 32, | ||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), | ||
arch: "arm".to_string(), | ||
|
||
options: TargetOptions { | ||
features: "+v7,+thumb2,+soft-float,-neon".to_string(), | ||
cpu: "generic".to_string(), | ||
max_atomic_width: Some(64), | ||
mcount: "_mcount".to_string(), | ||
abi: "eabi".to_string(), | ||
..base | ||
}, | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
compiler/rustc_target/src/spec/mips64_openwrt_linux_musl.rs
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,26 @@ | ||
/// A target tuple for OpenWrt MIPS64 targets | ||
/// | ||
use crate::abi::Endian; | ||
use crate::spec::{Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let mut base = super::linux_musl_base::opts(); | ||
base.cpu = "mips64r2".to_string(); | ||
base.features = "+mips64r2".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.crt_static_default = false; | ||
|
||
Target { | ||
// LLVM doesn't recognize "muslabi64" yet. | ||
llvm_target: "mips64-unknown-linux-musl".to_string(), | ||
pointer_width: 64, | ||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(), | ||
arch: "mips64".to_string(), | ||
options: TargetOptions { | ||
abi: "abi64".to_string(), | ||
endian: Endian::Big, | ||
mcount: "_mcount".to_string(), | ||
..base | ||
}, | ||
} | ||
} |
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
Oops, something went wrong.