more descriptive assertion failure for overflow

This commit is contained in:
Niko Matsakis 2018-10-09 18:00:27 -04:00 committed by GitHub
parent e42c68913e
commit a45d482a97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ where
} }
let old_revision = self.shared_state.revision.fetch_add(1, Ordering::SeqCst); let old_revision = self.shared_state.revision.fetch_add(1, Ordering::SeqCst);
assert!(old_revision != usize::max_value()); assert!(old_revision != usize::max_value(), "revision overflow");
let result = Revision { let result = Revision {
generation: 1 + old_revision as u64, generation: 1 + old_revision as u64,
}; };