forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#99422 - Dylan-DPC:rollup-htjofm6, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - rust-lang#98839 (Add assertion that `transmute_copy`'s U is not larger than T) - rust-lang#98998 (Remove branch target prologues from `#[naked] fn`) - rust-lang#99198 (add missing null ptr check in alloc example) - rust-lang#99344 (rustdoc: avoid inlining items with duplicate `(type, name)`) - rust-lang#99351 (Use `typeck_results` to get accurate qpath res for arg mismatch error) - rust-lang#99378 (interpret/visitor: add missing early return) - rust-lang#99394 (Add regression test for rust-lang#95230) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
21 changed files
with
233 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// compile-flags: -C no-prepopulate-passes -Zbranch-protection=bti | ||
// assembly-output: emit-asm | ||
// needs-asm-support | ||
// only-aarch64 | ||
|
||
#![crate_type = "lib"] | ||
#![feature(naked_functions)] | ||
use std::arch::asm; | ||
|
||
// The problem at hand: Rust has adopted a fairly strict meaning for "naked functions", | ||
// meaning "no prologue whatsoever, no, really, not one instruction." | ||
// Unfortunately, aarch64's "branch target identification" works via hints at landing sites. | ||
// LLVM implements this via making sure of that, even for functions with the naked attribute. | ||
// So, we must emit an appropriate instruction instead! | ||
#[no_mangle] | ||
#[naked] | ||
pub unsafe extern "C" fn _hlt() -> ! { | ||
// CHECK-NOT: hint #34 | ||
// CHECK: hlt #0x1 | ||
asm!("hlt #1", options(noreturn)) | ||
} |
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,24 @@ | ||
// compile-flags: -C no-prepopulate-passes -Zcf-protection=full | ||
// assembly-output: emit-asm | ||
// needs-asm-support | ||
// only-x86_64 | ||
|
||
#![crate_type = "lib"] | ||
#![feature(naked_functions)] | ||
use std::arch::asm; | ||
|
||
// The problem at hand: Rust has adopted a fairly strict meaning for "naked functions", | ||
// meaning "no prologue whatsoever, no, really, not one instruction." | ||
// Unfortunately, x86's control-flow enforcement, specifically indirect branch protection, | ||
// works by using an instruction for each possible landing site, | ||
// and LLVM implements this via making sure of that. | ||
#[no_mangle] | ||
#[naked] | ||
pub unsafe extern "sysv64" fn will_halt() -> ! { | ||
// CHECK-NOT: endbr{{32|64}} | ||
// CHECK: hlt | ||
asm!("hlt", options(noreturn)) | ||
} | ||
|
||
// what about aarch64? | ||
// "branch-protection"=false |
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,20 @@ | ||
pub struct Option; | ||
impl Option { | ||
pub fn unwrap(self) {} | ||
} | ||
|
||
mod macros { | ||
use crate::Option; | ||
/// [`Option::unwrap`] | ||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} | ||
} | ||
|
||
mod structs { | ||
use crate::Option; | ||
/// [`Option::unwrap`] | ||
pub struct Print; | ||
} | ||
pub use structs::Print; |
19 changes: 19 additions & 0 deletions
19
src/test/rustdoc/issue-99221-multiple-macro-rules-w-same-name-submodule.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,19 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="macro"]' 1 | ||
|
||
mod inner { | ||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/rustdoc/issue-99221-multiple-macro-rules-w-same-name.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,17 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="macro"]' 1 | ||
|
||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/rustdoc/issue-99221-multiple-structs-w-same-name.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,14 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="struct"][@title="foo::Print struct"]' 1 | ||
|
||
pub struct Print; |
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,7 @@ | ||
// check-pass | ||
|
||
pub struct Bar | ||
where | ||
for<'a> &'a mut Self:; | ||
|
||
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
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
2 changes: 1 addition & 1 deletion
2
src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
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