Skip to content

Commit ee4f89f

Browse files
committed
span: allow ambiguous_negative_literals
This was bad timing. The lang team just stabilized (in nightly) a new deny-by-default lint, named `ambiguous_negative_literals`, which triggers an error for things like `-1.hour()`. While such things can be confusingly ambiguous in some cases, in Jiff, `-1.hour()`, `(-1).hour()` and `-(1.hour())` are all, very intentionally, precisely equivalent. For now we just `allow` the lint. If the lint stays, we'll likely want to recommend allowing it in the Jiff docs. See: rust-lang/rust#121364
1 parent 3c3b810 commit ee4f89f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ specifiers and other APIs.
575575
#![warn(missing_debug_implementations)]
576576
// Document ALL THE THINGS!
577577
#![deny(missing_docs)]
578+
// See: https://github.com/rust-lang/rust/pull/121364
579+
#![allow(unknown_lints, ambiguous_negative_literals)]
578580

579581
// It should be possible to support other pointer widths, but this library
580582
// hasn't been tested nor thought about much in contexts with pointers less

tests/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
// See: https://github.com/rust-lang/rust/pull/121364
2+
#![allow(unknown_lints, ambiguous_negative_literals)]
3+
14
mod tc39_262;

0 commit comments

Comments
 (0)