Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove core dependency of profiler_builtins #101009

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2723,8 +2723,6 @@ name = "profiler_builtins"
version = "0.0.0"
dependencies = [
"cc",
"compiler_builtins",
"core",
]

[[package]]
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::errors::{
ConflictingGlobalAlloc, CrateNotPanicRuntime, GlobalAllocRequired, NoMultipleGlobalAlloc,
NoPanicStrategy, NoTransitiveNeedsDep, NotProfilerRuntime, ProfilerBuiltinsNeedsCore,
NoPanicStrategy, NoTransitiveNeedsDep, NotProfilerRuntime,
};
use crate::locator::{CrateError, CrateLocator, CratePaths};
use crate::rmeta::{CrateDep, CrateMetadata, CrateNumMap, CrateRoot, MetadataBlob};
Expand Down Expand Up @@ -759,7 +759,7 @@ impl<'a> CrateLoader<'a> {
self.inject_dependency_if(cnum, "a panic runtime", &|data| data.needs_panic_runtime());
}

fn inject_profiler_runtime(&mut self, krate: &ast::Crate) {
fn inject_profiler_runtime(&mut self) {
if self.sess.opts.unstable_opts.no_profiler_runtime
|| !(self.sess.instrument_coverage()
|| self.sess.opts.unstable_opts.profile
Expand All @@ -771,9 +771,6 @@ impl<'a> CrateLoader<'a> {
info!("loading profiler");

let name = Symbol::intern(&self.sess.opts.unstable_opts.profiler_runtime);
if name == sym::profiler_builtins && self.sess.contains_name(&krate.attrs, sym::no_core) {
self.sess.emit_err(ProfilerBuiltinsNeedsCore);
}

let Some(cnum) = self.resolve_crate(name, DUMMY_SP, CrateDepKind::Implicit) else { return; };
let data = self.cstore.get_crate_data(cnum);
Expand Down Expand Up @@ -927,7 +924,7 @@ impl<'a> CrateLoader<'a> {
}

pub fn postprocess(&mut self, krate: &ast::Crate) {
self.inject_profiler_runtime(krate);
self.inject_profiler_runtime();
self.inject_allocator_crate(krate);
self.inject_panic_runtime(krate);

Expand Down
4 changes: 0 additions & 4 deletions library/profiler_builtins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ test = false
bench = false
doc = false

[dependencies]
core = { path = "../core" }
compiler_builtins = { version = "0.1.0", features = ['rustc-dep-of-std'] }

[build-dependencies]
cc = "1.0.69"
6 changes: 2 additions & 4 deletions library/profiler_builtins/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#![no_std]
#![feature(profiler_runtime)]
#![feature(no_core, profiler_runtime, staged_api)]
#![no_core]
#![profiler_runtime]
#![unstable(
feature = "profiler_runtime_lib",
reason = "internal implementation detail of rustc right now",
issue = "none"
)]
#![allow(unused_features)]
#![feature(staged_api)]