-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #133369 - Zalathar:profiler-builtins-no-core, r=jieyouxu
Allow injecting a profiler runtime into `#![no_core]` crates An alternative to #133300, allowing `-Cinstrument-coverage` to be used with `-Zbuild-std`. The incompatibility between `profiler_builtins` and `#![no_core]` crates appears to have been caused by profiler_builtins depending on core, and therefore conflicting with core (or minicore). But that's a false dependency, because the profiler doesn't contain any actual Rust code. So we can just mark the profiler itself as `#![no_core]`, and remove the incompatibility error. --- For context, the error was originally added by #79958.
- Loading branch information
Showing
9 changed files
with
47 additions
and
24 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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#![no_std] | ||
// tidy-alphabetical-start | ||
#![allow(internal_features)] | ||
#![feature(no_core)] | ||
#![feature(profiler_runtime)] | ||
#![feature(staged_api)] | ||
// tidy-alphabetical-end | ||
|
||
// Other attributes: | ||
#![no_core] | ||
#![profiler_runtime] | ||
#![unstable( | ||
feature = "profiler_runtime_lib", | ||
reason = "internal implementation detail of rustc right now", | ||
issue = "none" | ||
)] | ||
#![allow(unused_features)] | ||
#![allow(internal_features)] | ||
#![feature(staged_api)] |
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,9 @@ | ||
Function name: no_core::main | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 01, 00, 0d] | ||
Number of files: 1 | ||
- file 0 => global file 1 | ||
Number of expressions: 0 | ||
Number of file 0 mappings: 1 | ||
- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 13) | ||
Highest counter ID seen: c0 | ||
|
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,13 @@ | ||
LL| |#![feature(no_core)] | ||
LL| |#![no_core] | ||
LL| |//@ edition: 2021 | ||
LL| | | ||
LL| |// Test that coverage instrumentation works for `#![no_core]` crates. | ||
LL| | | ||
LL| |// For this test, we pull in std anyway, to avoid having to set up our own | ||
LL| |// no-core or no-std environment. What's important is that the compiler allows | ||
LL| |// coverage for a crate with the `#![no_core]` annotation. | ||
LL| |extern crate std; | ||
LL| | | ||
LL| 1|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,12 @@ | ||
#![feature(no_core)] | ||
#![no_core] | ||
//@ edition: 2021 | ||
|
||
// Test that coverage instrumentation works for `#![no_core]` crates. | ||
|
||
// For this test, we pull in std anyway, to avoid having to set up our own | ||
// no-core or no-std environment. What's important is that the compiler allows | ||
// coverage for a crate with the `#![no_core]` annotation. | ||
extern crate std; | ||
|
||
fn main() {} |