Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ptr range iterable #91000

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
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
Err(0) is no longer going to be okay following PR 89916
  • Loading branch information
dtolnay committed Nov 18, 2021
commit 4cb61510e1bdbf289e939eb3d75b2e876b133b4b
4 changes: 2 additions & 2 deletions library/core/tests/iter/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 643,12 @@ fn test_ptr_range_reversed() {
assert_eq!(range.clone().next(), None);
assert_eq!(range.clone().nth(0), None);
assert_eq!(range.clone().nth(1), None);
assert_eq!(range.clone().advance_by(0), Ok(())); // Err(0) would be equally fine
assert_eq!(range.clone().advance_by(0), Ok(()));
assert_eq!(range.clone().advance_by(1), Err(0));
assert_eq!(range.clone().next_back(), None);
assert_eq!(range.clone().nth_back(0), None);
assert_eq!(range.clone().nth_back(1), None);
assert_eq!(range.clone().advance_back_by(0), Ok(())); // Err(0) would be equally fine
assert_eq!(range.clone().advance_back_by(0), Ok(()));
assert_eq!(range.clone().advance_back_by(1), Err(0));

let start = 2222 as *const ();
Expand Down