Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Auto merge of #1738 - jhpratt:update-step-trait, r=Xanewok
Browse files Browse the repository at this point in the history
Update `Step` trait implementation

Closes rust-lang/rust#85824

This replaces the `unsafe impl Step` with `impl Step` and `unsafe impl TrustedStep`. This is the only location of the `Step` trait in this repository.
  • Loading branch information
bors committed May 30, 2021
2 parents 097d890 + 30660c7 commit 12a5fd2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rls-span/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(feature = "nightly", feature(step_trait, step_trait_ext))]
#![cfg_attr(feature = "nightly", feature(step_trait, trusted_step))]

use std::marker::PhantomData;
use std::path::PathBuf;
Expand Down Expand Up @@ -81,7 +81,7 @@ impl Column<ZeroIndexed> {
#[cfg(feature = "nightly")]
macro_rules! impl_step {
($target: ty) => {
unsafe impl Step for $target {
impl Step for $target {
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
Step::steps_between(&start.0, &end.0)
}
Expand All @@ -92,6 +92,7 @@ macro_rules! impl_step {
Step::backward_checked(arg.0, count).map(|x| Self(x, PhantomData))
}
}
unsafe impl TrustedStep for $target {}
};
}

Expand Down

0 comments on commit 12a5fd2

Please sign in to comment.