-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #112511 - saethlin:inline-private-functions, r=<try>
Increase the precision of the exportable MIR check r? `@ghost`
- Loading branch information
Showing
17 changed files
with
195 additions
and
124 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ pub fn test() { | |
} | ||
|
||
#[no_mangle] | ||
#[inline(never)] | ||
fn some_true() -> Option<bool> { | ||
Some(true) | ||
} |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ impl Drop for SomeUniqueName { | |
} | ||
} | ||
|
||
#[inline(never)] | ||
pub fn possibly_unwinding() { | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ impl Drop for S { | |
} | ||
} | ||
|
||
#[inline(never)] | ||
fn might_unwind() { | ||
} | ||
|
||
|
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 @@ | ||
- // MIR for `outer` before Inline | ||
+ // MIR for `outer` after Inline | ||
|
||
fn outer() -> u8 { | ||
let mut _0: u8; // return place in scope 0 at $DIR/private_helper.rs:+0:19: +0:21 | ||
- | ||
- bb0: { | ||
- _0 = helper() -> bb1; // scope 0 at $DIR/private_helper.rs:+1:5: +1:13 | ||
- // mir::Constant | ||
- // + span: $DIR/private_helper.rs:7:5: 7:11 | ||
- // + literal: Const { ty: fn() -> u8 {helper}, val: Value(<ZST>) } | ||
+ scope 1 (inlined helper) { // at $DIR/private_helper.rs:7:5: 7:13 | ||
} | ||
|
||
- bb1: { | ||
+ bb0: { | ||
+ _0 = const 123_u8; // scope 1 at $DIR/private_helper.rs:11:5: 11:8 | ||
return; // scope 0 at $DIR/private_helper.rs:+2:2: +2:2 | ||
} | ||
} | ||
|
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,12 @@ | ||
// compile-flags: -Zmir-opt-level=2 -Zinline-mir | ||
|
||
#![crate_type = "lib"] | ||
|
||
// EMIT_MIR private_helper.outer.Inline.diff | ||
pub fn outer() -> u8 { | ||
helper() | ||
} | ||
|
||
fn helper() -> u8 { | ||
123 | ||
} |
Oops, something went wrong.