1
Fork 0

rustc_span: derivative -> derive-where

This commit is contained in:
Pavel Grigorenko 2024-06-27 01:39:48 +03:00
parent fd16a0efeb
commit 35ba700d5e
3 changed files with 7 additions and 6 deletions

View file

@ -4738,7 +4738,7 @@ dependencies = [
name = "rustc_span" name = "rustc_span"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"derivative", "derive-where",
"indexmap", "indexmap",
"itoa", "itoa",
"md-5", "md-5",

View file

@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
# tidy-alphabetical-start # tidy-alphabetical-start
derivative = "2.2.0" derive-where = "1.2.7"
indexmap = { version = "2.0.0" } indexmap = { version = "2.0.0" }
itoa = "1.0" itoa = "1.0"
md5 = { package = "md-5", version = "0.10.0" } md5 = { package = "md-5", version = "0.10.0" }

View file

@ -38,6 +38,7 @@
// this crate without this line making `rustc_span` available. // this crate without this line making `rustc_span` available.
extern crate self as rustc_span; extern crate self as rustc_span;
use derive_where::derive_where;
use rustc_data_structures::{outline, AtomicRef}; use rustc_data_structures::{outline, AtomicRef};
use rustc_macros::{Decodable, Encodable, HashStable_Generic}; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::opaque::{FileEncoder, MemDecoder}; use rustc_serialize::opaque::{FileEncoder, MemDecoder};
@ -467,18 +468,18 @@ impl FileName {
/// `SpanData` is public because `Span` uses a thread-local interner and can't be /// `SpanData` is public because `Span` uses a thread-local interner and can't be
/// sent to other threads, but some pieces of performance infra run in a separate thread. /// sent to other threads, but some pieces of performance infra run in a separate thread.
/// Using `Span` is generally preferred. /// Using `Span` is generally preferred.
#[derive(Clone, Copy, Hash, PartialEq, Eq, derivative::Derivative)] #[derive(Clone, Copy, Hash, PartialEq, Eq)]
#[derivative(PartialOrd, Ord)] #[derive_where(PartialOrd, Ord)]
pub struct SpanData { pub struct SpanData {
pub lo: BytePos, pub lo: BytePos,
pub hi: BytePos, pub hi: BytePos,
/// Information about where the macro came from, if this piece of /// Information about where the macro came from, if this piece of
/// code was created by a macro expansion. /// code was created by a macro expansion.
#[derivative(PartialOrd = "ignore", Ord = "ignore")] #[derive_where(skip)]
// `SyntaxContext` does not implement `Ord`. // `SyntaxContext` does not implement `Ord`.
// The other fields are enough to determine in-file order. // The other fields are enough to determine in-file order.
pub ctxt: SyntaxContext, pub ctxt: SyntaxContext,
#[derivative(PartialOrd = "ignore", Ord = "ignore")] #[derive_where(skip)]
// `LocalDefId` does not implement `Ord`. // `LocalDefId` does not implement `Ord`.
// The other fields are enough to determine in-file order. // The other fields are enough to determine in-file order.
pub parent: Option<LocalDefId>, pub parent: Option<LocalDefId>,