Skip to content

Commit 0b967ff

Browse files
committed
Improve README.md
1 parent a4c7918 commit 0b967ff

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

README.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ fn as_u16(x: u64) -> u16 {
4141

4242
### With a nightly compiler
4343

44-
**We recommend enabling Rust features [`custom_inner_attributes`] and [`proc_macro_hygiene`], and compiling with the [`procmacro2_semver_exempt`] config flag, e.g.:**
45-
46-
```sh
47-
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
48-
```
44+
**We recommend enabling Rust features [`custom_inner_attributes`] and [`proc_macro_hygiene`].**
4945

5046
If you enable the [`custom_inner_attributes`] and [`proc_macro_hygiene`] features, you can use `cast_checks::enable` as an inner [attribute]. Example:
5147

@@ -59,17 +55,15 @@ mod m {
5955
}
6056
```
6157

62-
However, in our experience, this can cause panics to refer to the wrong locations.
58+
## `CAST_CHECKS_LOG`
6359

64-
To help counter the above, if you compile with the [`procmacro2_semver_exempt`] config flag, `cast_checks` will include more elaborate `expect` messages. Example:
60+
If you are concerned that some casts are not being checked, try setting `CAST_CHECKS_LOG` and passing the [`procmacro2_semver_exempt`] config flag when compiling, e.g.:
6561

66-
```text
67-
thread 'checked_truncation' panicked at 'invalid cast in `x as u8` at cast_checks/tests/basic.rs:30:13: TryFromIntError(())', cast_checks/tests/basic.rs:30:13
62+
```sh
63+
CAST_CHECKS_LOG=1 RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
6864
```
6965

70-
## `CAST_CHECKS_LOG`
71-
72-
If you are concerned that some casts are not being checked, try setting `CAST_CHECKS_LOG` when compiling. This will cause `cast_checks` to dump to standard output:
66+
This will cause `cast_checks` to dump to standard output:
7367

7468
- all rewritten locations
7569
- all modules whose contents are not visited because they are not inlined

0 commit comments

Comments
 (0)