Skip to content

Commit 717dc1c

Browse files
committed
Enable incremental-relative-spans by default.
1 parent 70c7e4d commit 717dc1c

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

Diff for: compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
770770
/// Intercept all spans entering HIR.
771771
/// Mark a span as relative to the current owning item.
772772
fn lower_span(&self, span: Span) -> Span {
773-
if self.tcx.sess.opts.incremental_relative_spans() {
773+
if self.tcx.sess.opts.incremental.is_some() {
774774
span.with_parent(Some(self.current_hir_id_owner.def_id))
775775
} else {
776776
// Do not make spans relative when not using incremental compilation.

Diff for: compiler/rustc_expand/src/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
587587
.resolver
588588
.visit_ast_fragment_with_placeholders(self.cx.current_expansion.id, &fragment);
589589

590-
if self.cx.sess.opts.incremental_relative_spans() {
590+
if self.cx.sess.opts.incremental.is_some() {
591591
for (invoc, _) in invocations.iter_mut() {
592592
let expn_id = invoc.expansion_data.id;
593593
let parent_def = self.cx.resolver.invocation_parent(expn_id);

Diff for: compiler/rustc_middle/src/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, _: LocalCrate) -> Svh {
12061206
upstream_crates.hash_stable(&mut hcx, &mut stable_hasher);
12071207
source_file_names.hash_stable(&mut hcx, &mut stable_hasher);
12081208
debugger_visualizers.hash_stable(&mut hcx, &mut stable_hasher);
1209-
if tcx.sess.opts.incremental_relative_spans() {
1209+
if tcx.sess.opts.incremental.is_some() {
12101210
let definitions = tcx.untracked().definitions.freeze();
12111211
let mut owner_spans: Vec<_> = krate
12121212
.owners

Diff for: compiler/rustc_session/src/config.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1084,12 +1084,6 @@ impl Options {
10841084
pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion {
10851085
self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy)
10861086
}
1087-
1088-
#[allow(rustc::bad_opt_access)]
1089-
pub fn incremental_relative_spans(&self) -> bool {
1090-
self.unstable_opts.incremental_relative_spans
1091-
|| (self.unstable_features.is_nightly_build() && self.incremental.is_some())
1092-
}
10931087
}
10941088

10951089
impl UnstableOptions {

Diff for: compiler/rustc_session/src/options.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1524,9 +1524,6 @@ options! {
15241524
incremental_info: bool = (false, parse_bool, [UNTRACKED],
15251525
"print high-level information about incremental reuse (or the lack thereof) \
15261526
(default: no)"),
1527-
#[rustc_lint_opt_deny_field_access("use `Session::incremental_relative_spans` instead of this field")]
1528-
incremental_relative_spans: bool = (false, parse_bool, [TRACKED],
1529-
"hash spans relative to their parent item for incr. comp. (default: no)"),
15301527
incremental_verify_ich: bool = (false, parse_bool, [UNTRACKED],
15311528
"verify incr. comp. hashes of green query instances (default: no)"),
15321529
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],

0 commit comments

Comments
 (0)