Add back -Zno-profiler-runtime
This was removed by #85284 in favor of -Zprofiler-runtime=<name>. However the suggested -Zprofiler-runtime=None doesn't work because "None" is treated as a crate name.
This commit is contained in:
parent
71ff9b41e9
commit
1247f9b829
4 changed files with 12 additions and 11 deletions
|
@ -777,19 +777,17 @@ impl<'a> CrateLoader<'a> {
|
|||
}
|
||||
|
||||
fn inject_profiler_runtime(&mut self, krate: &ast::Crate) {
|
||||
let profiler_runtime = &self.sess.opts.debugging_opts.profiler_runtime;
|
||||
|
||||
if !(profiler_runtime.is_some()
|
||||
&& (self.sess.instrument_coverage()
|
||||
if self.sess.opts.debugging_opts.no_profiler_runtime
|
||||
|| !(self.sess.instrument_coverage()
|
||||
|| self.sess.opts.debugging_opts.profile
|
||||
|| self.sess.opts.cg.profile_generate.enabled()))
|
||||
|| self.sess.opts.cg.profile_generate.enabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
info!("loading profiler");
|
||||
|
||||
let name = Symbol::intern(profiler_runtime.as_ref().unwrap());
|
||||
let name = Symbol::intern(&self.sess.opts.debugging_opts.profiler_runtime);
|
||||
if name == sym::profiler_builtins && self.sess.contains_name(&krate.attrs, sym::no_core) {
|
||||
self.sess.err(
|
||||
"`profiler_builtins` crate (required by compiler options) \
|
||||
|
|
|
@ -1103,8 +1103,8 @@ impl CrateError {
|
|||
if sess.is_nightly_build() {
|
||||
err.help("consider building the standard library from source with `cargo build -Zbuild-std`");
|
||||
}
|
||||
} else if Some(crate_name)
|
||||
== sess.opts.debugging_opts.profiler_runtime.as_deref().map(Symbol::intern)
|
||||
} else if crate_name
|
||||
== Symbol::intern(&sess.opts.debugging_opts.profiler_runtime)
|
||||
{
|
||||
err.note(&"the compiler may have been built without the profiler runtime");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue