Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9ee16e1
Require const stability attributes on intrinsics to be able to use th…
oli-obk Dec 20, 2019
032d810
Add a big notice about const intrinsics
oli-obk Dec 20, 2019
89986a3
add partialeq and eq to cursor
Luro02 Dec 11, 2019
4ce2384
Improve JS code a bit by avoid erasing all event handlers
GuillaumeGomez Dec 22, 2019
b677013
Improve code readability
GuillaumeGomez Dec 22, 2019
71ff18f
Fix invalid results showing back
GuillaumeGomez Dec 22, 2019
056dff5
Fix ICE in mir interpretation
oli-obk Dec 23, 2019
c205f6a
Remove mem::uninitalized from tests
Mark-Simulacrum Dec 22, 2019
5b8df34
Update src/librustc_mir/interpret/place.rs
oli-obk Dec 23, 2019
45acee3
Move `{hir::lowering -> hir}::is_range_literal`.
Centril Dec 22, 2019
a5991c5
Add the full issue reference to equality constraints in `where` clauses
varkor Dec 22, 2019
b7bfdbe
Improve invalid assignment error
varkor Dec 22, 2019
5fa02ec
Add note about destructuring assignments
varkor Dec 22, 2019
5ab4735
Recognise nested tuples/arrays/structs
varkor Dec 22, 2019
35979a9
Add span information to `ExprKind::Assign`
varkor Dec 22, 2019
9a60224
Add new folder for destructuring assignment tests
varkor Dec 22, 2019
dd7f493
is_range_literal: fix fallout
Centril Dec 22, 2019
4bb8346
is_range_literal: leave FIXME
Centril Dec 22, 2019
9e50813
Fix reformatting rebase issues
varkor Dec 23, 2019
a08df28
Document that calling Drop, even after it panics, is UB
Mark-Simulacrum Dec 23, 2019
63d2822
Fix typo
oli-obk Dec 23, 2019
260514d
Rollup merge of #67233 - Luro02:cursor_traits, r=sfackler
Centril Dec 23, 2019
1de2705
Rollup merge of #67466 - oli-obk:const_intrinsic, r=Centril
Centril Dec 23, 2019
67c0f4e
Rollup merge of #67507 - Mark-Simulacrum:purge-uninit, r=Centril
Centril Dec 23, 2019
6f38a15
Rollup merge of #67527 - GuillaumeGomez:results-show-too-much, r=kinn…
Centril Dec 23, 2019
3a07f3b
Rollup merge of #67536 - Centril:move-is_range_literal, r=Mark-Simula…
Centril Dec 23, 2019
4164761
Rollup merge of #67538 - varkor:lhs-assign-diagnostics, r=Centril
Centril Dec 23, 2019
7eb025f
Rollup merge of #67546 - oli-obk:slice_pattern_ice, r=varkor
Centril Dec 23, 2019
68a9a2d
Rollup merge of #67559 - Mark-Simulacrum:drop-doc, r=RalfJung
Centril Dec 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add partialeq and eq to cursor
  • Loading branch information
Luro02 committed Dec 22, 2019
commit 89986a39a8236a3e4bfbb74b4d3a0a03667e8b56
14 changes: 13 additions & 1 deletion src/libstd/io/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use core::convert::TryInto;
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct Cursor<T> {
inner: T,
pos: u64,
Expand Down Expand Up @@ -902,4 +902,16 @@ mod tests {
c.set_position(<usize>::max_value() as u64 + 1);
assert!(c.write_all(&[1, 2, 3]).is_err());
}

#[test]
fn test_partial_eq() {
assert_eq!(Cursor::new(Vec::<u8>::new()), Cursor::new(Vec::<u8>::new()));
}

#[test]
fn test_eq() {
struct AssertEq<T: Eq>(pub T);

let _: AssertEq<Cursor<Vec<u8>>> = AssertEq(Cursor::new(Vec::new()));
}
}