From a52b13f43fb44d27692bfdd693857d351076d3a6 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Thu, 17 Oct 2024 18:49:43 +0000 Subject: [PATCH 1/2] Adjust `inner_attribute_example` line numbers I'm not certain, but https://github.com/dtolnay/proc-macro2/pull/472 may be what required them to change. --- cast_checks/tests/inner_attribute_example.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cast_checks/tests/inner_attribute_example.rs b/cast_checks/tests/inner_attribute_example.rs index ef143e4..feaefa0 100644 --- a/cast_checks/tests/inner_attribute_example.rs +++ b/cast_checks/tests/inner_attribute_example.rs @@ -13,8 +13,8 @@ fn build() { command.env("CAST_CHECKS_LOG", "1"); command.assert().success().stdout( "\ -cast_checks rewriting `x as u16` at src/lib.rs:0:0 -cast_checks not descending into `mod c;` at src/lib.rs:0:0 +cast_checks rewriting `x as u16` at src/lib.rs:3:0 +cast_checks not descending into `mod c;` at src/lib.rs:3:0 ", ); }); @@ -26,7 +26,7 @@ fn test() { command.assert().failure().stdout(predicates::str::contains( "\ thread 'checked_truncation' panicked at src/lib.rs:3:1: -invalid cast in `x as u16` at src/lib.rs:0:0: TryFromIntError(()) +invalid cast in `x as u16` at src/lib.rs:3:0: TryFromIntError(()) ", )); }); From 2d0731117094a50c06ac43e430f99c4c078c110c Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Thu, 17 Oct 2024 18:53:00 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcfbd72..0fc78f6 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ This will cause `cast_checks` to dump to standard output: Example: ```text -cast_checks rewriting `x as u16` at src/lib.rs:0:0 -cast_checks not descending into `mod c ;` at src/lib.rs:0:0 +cast_checks rewriting `x as u16` at src/lib.rs:3:0 +cast_checks not descending into `mod c ;` at src/lib.rs:3:0 ``` Note that `CAST_CHECKS_LOG` requires `--cfg procmacro2_semver_exempt` to be passed to rustc.