-
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 #129370 - matthiaskrgr:rollup-g9117ee, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #128727 (bump conflicting_repr_hints lint to be shown in dependencies) - #129232 (Fix `thread::sleep` Duration-handling for ESP-IDF) - #129321 (Change neutral element of <fNN as iter::Sum> to neg_zero) - #129353 (llvm-wrapper: adapt for LLVM 20 API changes) - #129363 (Force `LC_ALL=C` for all run-make tests) - #129364 (safe transmute: gracefully bubble-up layout errors) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
19 changed files
with
250 additions
and
58 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
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,27 @@ | ||
#[test] | ||
fn f32_ref() { | ||
let x: f32 = -0.0; | ||
let still_x: f32 = [x].iter().sum(); | ||
assert_eq!(1. / x, 1. / still_x) | ||
} | ||
|
||
#[test] | ||
fn f32_own() { | ||
let x: f32 = -0.0; | ||
let still_x: f32 = [x].into_iter().sum(); | ||
assert_eq!(1. / x, 1. / still_x) | ||
} | ||
|
||
#[test] | ||
fn f64_ref() { | ||
let x: f64 = -0.0; | ||
let still_x: f64 = [x].iter().sum(); | ||
assert_eq!(1. / x, 1. / still_x) | ||
} | ||
|
||
#[test] | ||
fn f64_own() { | ||
let x: f64 = -0.0; | ||
let still_x: f64 = [x].into_iter().sum(); | ||
assert_eq!(1. / x, 1. / still_x) | ||
} |
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 |
---|---|---|
|
@@ -30,6 +30,7 @@ mod int_log; | |
mod ops; | ||
mod wrapping; | ||
|
||
mod float_iter_sum_identity; | ||
mod ieee754; | ||
mod nan; | ||
|
||
|
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
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
26 changes: 26 additions & 0 deletions
26
tests/ui/transmutability/malformed-program-gracefulness/unknown_dst_field.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 @@ | ||
// An unknown destination type should be gracefully handled. | ||
|
||
#![crate_type = "lib"] | ||
#![feature(transmutability)] | ||
#![allow(incomplete_features)] | ||
|
||
mod assert { | ||
use std::mem::BikeshedIntrinsicFrom; | ||
|
||
pub fn is_transmutable<Src, Dst>() | ||
where | ||
Dst: BikeshedIntrinsicFrom<Src> | ||
{} | ||
} | ||
|
||
fn should_gracefully_handle_unknown_dst_field() { | ||
#[repr(C)] struct Src; | ||
#[repr(C)] struct Dst(Missing); //~ cannot find type | ||
assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted | ||
} | ||
|
||
fn should_gracefully_handle_unknown_dst_ref_field() { | ||
#[repr(C)] struct Src(&'static Src); | ||
#[repr(C)] struct Dst(&'static Missing); //~ cannot find type | ||
assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted | ||
} |
Oops, something went wrong.