Skip to content

Commit afe8415

Browse files
committed
External spans: fixed unit tests and addressed review.
1 parent 634cd2c commit afe8415

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/librustc_data_structures/stable_hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl StableHasherResult for [u8; 20] {
8181
impl StableHasherResult for u128 {
8282
fn finish(mut hasher: StableHasher<Self>) -> Self {
8383
let hash_bytes: &[u8] = hasher.finalize();
84-
assert!(hash_bytes.len() >= mem::size_of::<u64>() * 2);
84+
assert!(hash_bytes.len() >= mem::size_of::<u128>());
8585

8686
unsafe {
8787
::std::ptr::read_unaligned(hash_bytes.as_ptr() as *const u128)

src/libsyntax/codemap.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ impl FilePathMapping {
618618
#[cfg(test)]
619619
mod tests {
620620
use super::*;
621+
use std::borrow::Cow;
621622
use std::rc::Rc;
622623

623624
#[test]
@@ -627,12 +628,12 @@ mod tests {
627628
"first line.\nsecond line".to_string());
628629
fm.next_line(BytePos(0));
629630
// Test we can get lines with partial line info.
630-
assert_eq!(fm.get_line(0), Some("first line."));
631+
assert_eq!(fm.get_line(0), Some(Cow::from("first line.")));
631632
// TESTING BROKEN BEHAVIOR: line break declared before actual line break.
632633
fm.next_line(BytePos(10));
633-
assert_eq!(fm.get_line(1), Some("."));
634+
assert_eq!(fm.get_line(1), Some(Cow::from(".")));
634635
fm.next_line(BytePos(12));
635-
assert_eq!(fm.get_line(2), Some("second line"));
636+
assert_eq!(fm.get_line(2), Some(Cow::from("second line")));
636637
}
637638

638639
#[test]

0 commit comments

Comments
 (0)