forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#116175 - matthiaskrgr:rollup-cwteiwy, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#116099 (Add regression test for issue rust-lang#79865) - rust-lang#116131 (Rename `cold_path` to `outline`) - rust-lang#116151 (Fix typo in rustdoc unstable features doc) - rust-lang#116153 (Update books) - rust-lang#116162 (Gate and validate `#[rustc_safe_intrinsic]`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
26 changed files
with
135 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
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
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
Submodule rustc-dev-guide
updated
13 files
+3 −1 | src/SUMMARY.md | |
+4 −0 | src/appendix/glossary.md | |
+14 −19 | src/building/optimized-build.md | |
+4 −45 | src/const-eval.md | |
+10 −0 | src/early-late-bound-summary.md | |
+ − | src/img/coverage-graphviz-01.png | |
+ − | src/img/coverage-spanview-01.png | |
+24 −109 | src/llvm-coverage-instrumentation.md | |
+71 −1 | src/mir/index.md | |
+2 −2 | src/serialization.md | |
+55 −0 | src/tests/compiletest.md | |
+120 −0 | src/turbofishing-and-early-late-bound.md | |
+0 −0 | src/what-does-early-late-bound-mean.md |
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,38 @@ | ||
// run-pass | ||
// only-x86_64 | ||
// compile-flags: -C opt-level=3 | ||
|
||
// Regression test for issue #79865. | ||
// The assertion will fail when compiled with Rust 1.56..=1.59 | ||
// due to a LLVM miscompilation. | ||
|
||
use std::arch::x86_64::*; | ||
|
||
fn main() { | ||
if is_x86_feature_detected!("avx") { | ||
let res: [f64; 4] = unsafe { std::mem::transmute::<_, _>(first()) }; | ||
assert_eq!(res, [22.0, 44.0, 66.0, 88.0]); | ||
} | ||
} | ||
|
||
#[target_feature(enable = "avx")] | ||
unsafe fn first() -> __m256d { | ||
second() | ||
} | ||
|
||
unsafe fn second() -> __m256d { | ||
let v0 = _mm256_setr_pd(1.0, 2.0, 3.0, 4.0); | ||
let v1 = _mm256_setr_pd(10.0, 20.0, 30.0, 40.0); | ||
|
||
// needs to be called twice to hit the miscompilation | ||
let (add, _) = add_sub(v0, v1); | ||
let (add, _) = add_sub(add, add); | ||
add | ||
} | ||
|
||
#[inline(never)] // needed to hit the miscompilation | ||
unsafe fn add_sub(v1: __m256d, v0: __m256d) -> (__m256d, __m256d) { | ||
let add = _mm256_add_pd(v0, v1); | ||
let sub = _mm256_sub_pd(v0, v1); | ||
(add, sub) | ||
} |
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,4 +1,4 @@ | ||
#![feature(intrinsics)] | ||
#![feature(intrinsics, rustc_attrs)] | ||
|
||
extern "rust-intrinsic" { | ||
#[rustc_safe_intrinsic] | ||
|
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,6 @@ | ||
#[rustc_safe_intrinsic] | ||
//~^ ERROR the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe | ||
//~| ERROR attribute should be applied to intrinsic functions | ||
fn safe() {} | ||
|
||
fn main() {} |
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,20 @@ | ||
error[E0658]: the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe | ||
--> $DIR/feature-gate-safe-intrinsic.rs:1:1 | ||
| | ||
LL | #[rustc_safe_intrinsic] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable | ||
|
||
error: attribute should be applied to intrinsic functions | ||
--> $DIR/feature-gate-safe-intrinsic.rs:1:1 | ||
| | ||
LL | #[rustc_safe_intrinsic] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | fn safe() {} | ||
| ------------ not an intrinsic function | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
// Issue #2303 | ||
|
||
#![feature(intrinsics)] | ||
#![feature(intrinsics, rustc_attrs)] | ||
|
||
use std::mem; | ||
|
||
|