Skip to content

Commit 2ae928b

Browse files
Donough Liubogon-right
Donough Liu
authored and
bogon-right
committed
Remove depdencies of profiler_builtins
1 parent a2cdcb3 commit 2ae928b

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

Cargo.lock

-2
Original file line numberDiff line numberDiff line change
@@ -2723,8 +2723,6 @@ name = "profiler_builtins"
27232723
version = "0.0.0"
27242724
dependencies = [
27252725
"cc",
2726-
"compiler_builtins",
2727-
"core",
27282726
]
27292727

27302728
[[package]]

compiler/rustc_metadata/src/creader.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::errors::{
44
ConflictingGlobalAlloc, CrateNotPanicRuntime, GlobalAllocRequired, NoMultipleGlobalAlloc,
5-
NoPanicStrategy, NoTransitiveNeedsDep, NotProfilerRuntime, ProfilerBuiltinsNeedsCore,
5+
NoPanicStrategy, NoTransitiveNeedsDep, NotProfilerRuntime,
66
};
77
use crate::locator::{CrateError, CrateLocator, CratePaths};
88
use crate::rmeta::{CrateDep, CrateMetadata, CrateNumMap, CrateRoot, MetadataBlob};
@@ -759,7 +759,7 @@ impl<'a> CrateLoader<'a> {
759759
self.inject_dependency_if(cnum, "a panic runtime", &|data| data.needs_panic_runtime());
760760
}
761761

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

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

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

929926
pub fn postprocess(&mut self, krate: &ast::Crate) {
930-
self.inject_profiler_runtime(krate);
927+
self.inject_profiler_runtime();
931928
self.inject_allocator_crate(krate);
932929
self.inject_panic_runtime(krate);
933930

library/profiler_builtins/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@ test = false
88
bench = false
99
doc = false
1010

11-
[dependencies]
12-
core = { path = "../core" }
13-
compiler_builtins = { version = "0.1.0", features = ['rustc-dep-of-std'] }
14-
1511
[build-dependencies]
1612
cc = "1.0.69"

library/profiler_builtins/src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#![no_std]
2-
#![feature(profiler_runtime)]
1+
#![feature(no_core, profiler_runtime, staged_api)]
2+
#![no_core]
33
#![profiler_runtime]
44
#![unstable(
55
feature = "profiler_runtime_lib",
66
reason = "internal implementation detail of rustc right now",
77
issue = "none"
88
)]
9-
#![allow(unused_features)]
10-
#![feature(staged_api)]

0 commit comments

Comments
 (0)