Skip to content

Commit 35ba700

Browse files
committed
rustc_span: derivative -> derive-where
1 parent fd16a0e commit 35ba700

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Cargo.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -4738,7 +4738,7 @@ dependencies = [
47384738
name = "rustc_span"
47394739
version = "0.0.0"
47404740
dependencies = [
4741-
"derivative",
4741+
"derive-where",
47424742
"indexmap",
47434743
"itoa",
47444744
"md-5",

compiler/rustc_span/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
derivative = "2.2.0"
8+
derive-where = "1.2.7"
99
indexmap = { version = "2.0.0" }
1010
itoa = "1.0"
1111
md5 = { package = "md-5", version = "0.10.0" }

compiler/rustc_span/src/lib.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// this crate without this line making `rustc_span` available.
3939
extern crate self as rustc_span;
4040

41+
use derive_where::derive_where;
4142
use rustc_data_structures::{outline, AtomicRef};
4243
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
4344
use rustc_serialize::opaque::{FileEncoder, MemDecoder};
@@ -467,18 +468,18 @@ impl FileName {
467468
/// `SpanData` is public because `Span` uses a thread-local interner and can't be
468469
/// sent to other threads, but some pieces of performance infra run in a separate thread.
469470
/// Using `Span` is generally preferred.
470-
#[derive(Clone, Copy, Hash, PartialEq, Eq, derivative::Derivative)]
471-
#[derivative(PartialOrd, Ord)]
471+
#[derive(Clone, Copy, Hash, PartialEq, Eq)]
472+
#[derive_where(PartialOrd, Ord)]
472473
pub struct SpanData {
473474
pub lo: BytePos,
474475
pub hi: BytePos,
475476
/// Information about where the macro came from, if this piece of
476477
/// code was created by a macro expansion.
477-
#[derivative(PartialOrd = "ignore", Ord = "ignore")]
478+
#[derive_where(skip)]
478479
// `SyntaxContext` does not implement `Ord`.
479480
// The other fields are enough to determine in-file order.
480481
pub ctxt: SyntaxContext,
481-
#[derivative(PartialOrd = "ignore", Ord = "ignore")]
482+
#[derive_where(skip)]
482483
// `LocalDefId` does not implement `Ord`.
483484
// The other fields are enough to determine in-file order.
484485
pub parent: Option<LocalDefId>,

0 commit comments

Comments
 (0)