Change:
Found via rust-icci: https://travis- The commit history of the regex crate contains on changeset that only adds a comment which in turn leads to the body of a function being moved. This results in the update of the source location pointed to by a potential overflow panic message. This message is not updated properly in incremental mode: I have not found out yet why the change is not detected. HIR fingerprinting has special treatment of operations that can trigger overflows: There must be some kind of mismatch between when HIR fingerprinting thinks that an operation can panic and when we actually emit panic messages. This is another span-related papercut cc
Full IR files for reference:

Discussion:
f: F) { let prev_owner = self.current_dep_node_owner; let prev_signature_dep_index = self.current_signature_dep_index; <del> let prev_full_dep_index = self.current_signature_dep_index; </del> <ins> let prev_full_dep_index = self.current_full_dep_index; </ins> let prev_in_body = self.currently_in_body; let def_path_hash = self.definitions.def_path_hash(dep_node_owner);

pub fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, item_attrs: &[ast::Attribute], <ins> is_const: bool, </ins> f: F) { let prev_overflow_checks = self.overflow_checks_enabled; <del> if attr::contains_name(item_attrs, "rustc_inherit_overflow_checks") { </del> <ins> if is_const || attr::contains_name(item_attrs, "rustc_inherit_overflow_checks") { </ins> self.overflow_checks_enabled = true; } let prev_hash_node_ids = self.node_id_hashing_mode;

span } = *self; <del> hcx.hash_hir_item_like(attrs, |hcx| { </del> <ins> let is_const = match *node { hir::TraitItemKind::Const(..) | hir::TraitItemKind::Type(..) => true, hir::TraitItemKind::Method(hir::MethodSig { constness, .. }, _) => { constness == hir::Constness::Const } }; hcx.hash_hir_item_like(attrs, is_const, |hcx| { </ins> name.hash_stable(hcx, hasher); attrs.hash_stable(hcx, hasher); generics.hash_stable(hcx, hasher);

span } = *self; <del> hcx.hash_hir_item_like(attrs, |hcx| { </del> <ins> let is_const = match *node { hir::ImplItemKind::Const(..) | hir::ImplItemKind::Type(..) => true, hir::ImplItemKind::Method(hir::MethodSig { constness, .. }, _) => { constness == hir::Constness::Const } }; hcx.hash_hir_item_like(attrs, is_const, |hcx| { </ins> name.hash_stable(hcx, hasher); vis.hash_stable(hcx, hasher); defaultness.hash_stable(hcx, hasher);

fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'gcx>, hasher: &mut StableHasher<W>) { <del> let hash_spans = match self.node { </del> <ins> let (is_const, hash_spans) = match self.node { </ins> hir::ItemStatic(..)      | <del> hir::ItemConst(..)       | hir::ItemFn(..)          => { hcx.hash_spans() </del> <ins> hir::ItemConst(..)       => { (true, hcx.hash_spans()) } hir::ItemFn(_, _, constness, ..) => { (constness == hir::Constness::Const, hcx.hash_spans()) </ins> } hir::ItemUse(..)         | hir::ItemExternCrate(..) |

hir::ItemEnum(..)        | hir::ItemStruct(..)      | hir::ItemUnion(..)       => { <del> false </del> <ins> (false, false) </ins> } };

span } = *self; <del> hcx.hash_hir_item_like(attrs, |hcx| { </del> <ins> hcx.hash_hir_item_like(attrs, is_const, |hcx| { </ins> hcx.while_hashing_spans(hash_spans, |hcx| { name.hash_stable(hcx, hasher); attrs.hash_stable(hcx, hasher);

// Change value between simple literals --------------------------------------- <del> #[cfg(cfail1)] const CONST_CHANGE_VALUE_1: i16 = 1; #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail3")] <del> const CONST_CHANGE_VALUE_1: i16 = 2; </del> <ins> const CONST_CHANGE_VALUE_1: i16 = { #[cfg(cfail1)] { 1 } #[cfg(not(cfail1))] { 2 } }; </ins> <del> // Change value between expressions ------------------------------------------- #[cfg(cfail1)] const CONST_CHANGE_VALUE_2: i16 = 1 + 1; #[cfg(not(cfail1))] </del> <ins> // Change value between expressions ------------------------------------------- </ins> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> const CONST_CHANGE_VALUE_2: i16 = 1 + 2; </del> <ins> const CONST_CHANGE_VALUE_2: i16 = { #[cfg(cfail1)] { 1 + 1 } </ins> <del> #[cfg(cfail1)] const CONST_CHANGE_VALUE_3: i16 = 2 + 3; </del> <ins> #[cfg(not(cfail1))] { 1 + 2 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> const CONST_CHANGE_VALUE_3: i16 = 2 * 3; </del> <ins> const CONST_CHANGE_VALUE_3: i16 = { #[cfg(cfail1)] { 2 + 3 } </ins> <del> #[cfg(cfail1)] const CONST_CHANGE_VALUE_4: i16 = 1 + 2 * 3; </del> <ins> #[cfg(not(cfail1))] { 2 * 3 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> const CONST_CHANGE_VALUE_4: i16 = 1 + 2 * 4; </del> <ins> const CONST_CHANGE_VALUE_4: i16 = { #[cfg(cfail1)] { 1 + 2 * 3 } #[cfg(not(cfail1))] { 1 + 2 * 4 } }; </ins> // Change type indirectly -----------------------------------------------------

// Change value between simple literals --------------------------------------- <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_1: i16 = 1; #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_1: i16 = 2; </del> <ins> static STATIC_CHANGE_VALUE_1: i16 = { #[cfg(cfail1)] { 1 } #[cfg(not(cfail1))] { 2 } }; </ins> <del> // Change value between expressions ------------------------------------------- #[cfg(cfail1)] static STATIC_CHANGE_VALUE_2: i16 = 1 + 1; #[cfg(not(cfail1))] </del> <ins> // Change value between expressions ------------------------------------------- </ins> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_2: i16 = 1 + 2; </del> <ins> static STATIC_CHANGE_VALUE_2: i16 = { #[cfg(cfail1)] { 1 + 1 } </ins> <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_3: i16 = 2 + 3; </del> <ins> #[cfg(not(cfail1))] { 1 + 2 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_3: i16 = 2 * 3; </del> <ins> static STATIC_CHANGE_VALUE_3: i16 = { #[cfg(cfail1)] { 2 + 3 } </ins> <del> #[cfg(cfail1)] static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 3; </del> <ins> #[cfg(not(cfail1))] { 2 * 3 } }; </ins> <del> #[cfg(not(cfail1))] </del> #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] <del> static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 4; </del> <ins> static STATIC_CHANGE_VALUE_4: i16 = { #[cfg(cfail1)] { 1 + 2 * 3 } #[cfg(not(cfail1))] { 1 + 2 * 4 } }; </ins> // Change type indirectly -----------------------------------------------------

<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // This test makes sure that just changing a definition's location in the // source file also changes its incr. comp. hash, if debuginfo is enabled. // revisions:rpass1 rpass2 // compile-flags: -C overflow-checks=on #![feature(rustc_attrs)] #[cfg(rpass1)] pub fn main() { let _ = 0u8 + 1; } #[cfg(rpass2)] #[rustc_clean(label="Hir", cfg="rpass2")] #[rustc_dirty(label="HirBody", cfg="rpass2")] pub fn main() { let _ = 0u8 + 1; } </ins>