From 80cdaeac3de16f48db1e187b2426c2517d5aa5ea Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Mon, 6 Jan 2025 21:53:48 +0100 Subject: avoid replacing the definition of CURRENT_RUSTC_VERSION Before this commit, replace-version-placeholder hardcoded the path defining CURRENT_RUSTC_VERSION (to avoid replacing it). After a refactor moved the file defining it without changing the hardcoded path, the tool started replacing the constant itself with the version number. To avoid this from happening in the future, this changes the definition of the constant to avoid the tool from ever matching it. --- src/tools/replace-version-placeholder/src/main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/tools/replace-version-placeholder') diff --git a/src/tools/replace-version-placeholder/src/main.rs b/src/tools/replace-version-placeholder/src/main.rs index 247e4e7e932..88118cab235 100644 --- a/src/tools/replace-version-placeholder/src/main.rs +++ b/src/tools/replace-version-placeholder/src/main.rs @@ -11,12 +11,7 @@ fn main() { let version_str = version_str.trim(); walk::walk_many( &[&root_path.join("compiler"), &root_path.join("library")], - |path, _is_dir| { - walk::filter_dirs(path) - // We exempt these as they require the placeholder - // for their operation - || path.ends_with("compiler/rustc_attr/src/builtin.rs") - }, + |path, _is_dir| walk::filter_dirs(path), &mut |entry, contents| { if !contents.contains(VERSION_PLACEHOLDER) { return; -- cgit 1.4.1-3-g733a5