Skip to content

Commit 55e5c9d

Browse files
committed
Auto merge of rust-lang#115656 - cjgillot:default-relative-spans, r=davidtwco
Enable incremental-relative-spans by default. This was enabled on nightly in rust-lang#84762. It has been a while, without obvious bugs. It's time to enable it by default for incremental runs.
2 parents 5d62ab8 + 717dc1c commit 55e5c9d

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

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.

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);

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

compiler/rustc_session/src/config.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1103,12 +1103,6 @@ impl Options {
11031103
pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion {
11041104
self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy)
11051105
}
1106-
1107-
#[allow(rustc::bad_opt_access)]
1108-
pub fn incremental_relative_spans(&self) -> bool {
1109-
self.unstable_opts.incremental_relative_spans
1110-
|| (self.unstable_features.is_nightly_build() && self.incremental.is_some())
1111-
}
11121106
}
11131107

11141108
impl UnstableOptions {

compiler/rustc_session/src/options.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,6 @@ options! {
15411541
incremental_info: bool = (false, parse_bool, [UNTRACKED],
15421542
"print high-level information about incremental reuse (or the lack thereof) \
15431543
(default: no)"),
1544-
#[rustc_lint_opt_deny_field_access("use `Session::incremental_relative_spans` instead of this field")]
1545-
incremental_relative_spans: bool = (false, parse_bool, [TRACKED],
1546-
"hash spans relative to their parent item for incr. comp. (default: no)"),
15471544
incremental_verify_ich: bool = (false, parse_bool, [UNTRACKED],
15481545
"verify incr. comp. hashes of green query instances (default: no)"),
15491546
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],

0 commit comments

Comments
 (0)