mirror of https://github.com/rust-lang/rls
Don't use serde_derive hack in rls-* crates
This commit is contained in:
parent
288260a3fa
commit
ccee2122cc
|
@ -1612,9 +1612,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.10"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3"
|
||||
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
|
@ -2424,18 +2424,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
|||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.106"
|
||||
version = "1.0.119"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
|
||||
checksum = "9bdd36f49e35b61d49efd8aa7fc068fd295961fd2286d0b2ee9a4c7a14e99cc3"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.106"
|
||||
version = "1.0.119"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
|
||||
checksum = "552954ce79a059ddd5fd68c271592374bd15cab2274970380c000118aeffe1cd"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -2618,9 +2618,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.18"
|
||||
version = "1.0.58"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213"
|
||||
checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
|
@ -21,7 +21,7 @@ test = false
|
|||
path = "rls/src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
rls-analysis = "0.18.0"
|
||||
rls-analysis = "0.18.1"
|
||||
rls-data = "0.19"
|
||||
# FIXME: Release rls-rustc 0.6.0 to crates.io
|
||||
rls-rustc = { version = "0.6.0", path = "rls-rustc" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "rls-data"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
edition = "2018"
|
||||
authors = ["Nick Cameron <ncameron@mozilla.com>"]
|
||||
description = "Data structures used by the RLS and Rust compiler"
|
||||
|
@ -11,8 +11,7 @@ categories = ["development-tools"]
|
|||
[dependencies]
|
||||
rls-span = "0.5.0"
|
||||
serde = "1.0"
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
derive = ["serde_derive", "rls-span/derive"]
|
||||
default = ["derive"]
|
||||
derive = ["serde/derive", "rls-span/derive"]
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#[cfg(feature = "derive")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Used to configure save-analysis.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
#[cfg_attr(feature = "derive", derive(Serialize, Deserialize))]
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
use rls_span as span;
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
pub mod config;
|
||||
mod serde_expanded;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub mod config;
|
||||
pub use config::Config;
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
|
@ -273,73 +270,3 @@ pub struct SigElement {
|
|||
pub start: usize,
|
||||
pub end: usize,
|
||||
}
|
||||
|
||||
// Following macros are copied from the `static-assertions` library:
|
||||
// https://github.com/nvzqz/static-assertions-rs/blob/9f0f8aa871390f74f2afcdba53c1e02db90b2d17/src/assert_impl.rs
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! assert_impl {
|
||||
($($xs:tt)+) => { _assert_impl!($($xs)+); };
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! _assert_impl {
|
||||
($x:ty, $($t:path),+ $(,)*) => {
|
||||
{
|
||||
fn assert_impl<'hidden, T>() where T: ?Sized $(+ $t)+ {}
|
||||
assert_impl::<$x>();
|
||||
}
|
||||
};
|
||||
($label:ident; $($xs:tt)+) => {
|
||||
#[allow(dead_code, non_snake_case)]
|
||||
fn $label() { assert_impl!($($xs)+); }
|
||||
};
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
macro_rules! assert_serde {
|
||||
($($typ:path),* $(,)*) => {
|
||||
$( assert_impl!($typ, Serialize, Deserialize<'hidden>); )*
|
||||
};
|
||||
}
|
||||
|
||||
/// Since we manually provide impls in `cfg(not(feature = "derive"))`, it's good
|
||||
/// to ensure that the types actually implement all the required traits.
|
||||
#[doc(hidden)]
|
||||
fn _assertions() {
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
assert_serde!(
|
||||
// rls-data
|
||||
Analysis,
|
||||
Id,
|
||||
GlobalCrateId,
|
||||
SpanData,
|
||||
CompilationOptions,
|
||||
CratePreludeData,
|
||||
ExternalCrateData,
|
||||
Import,
|
||||
Def,
|
||||
Impl,
|
||||
Attribute,
|
||||
Ref,
|
||||
MacroRef,
|
||||
Relation,
|
||||
Signature,
|
||||
SigElement,
|
||||
Config,
|
||||
// rls-span
|
||||
span::Column<span::ZeroIndexed>,
|
||||
span::Location<span::ZeroIndexed>,
|
||||
span::Position<span::ZeroIndexed>,
|
||||
span::Range<span::ZeroIndexed>,
|
||||
span::Row<span::ZeroIndexed>,
|
||||
span::Span<span::ZeroIndexed>,
|
||||
span::Column<span::OneIndexed>,
|
||||
span::Location<span::OneIndexed>,
|
||||
span::Position<span::OneIndexed>,
|
||||
span::Range<span::OneIndexed>,
|
||||
span::Row<span::OneIndexed>,
|
||||
span::Span<span::OneIndexed>,
|
||||
);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "rls-span"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
edition = "2018"
|
||||
authors = ["Nick Cameron <ncameron@mozilla.com>"]
|
||||
description = "Types for identifying code spans/ranges"
|
||||
|
@ -12,10 +12,9 @@ categories = ["development-tools"]
|
|||
[dependencies]
|
||||
rustc-serialize = { version = "0.3.24", optional = true }
|
||||
serde = "1.0"
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
nightly = []
|
||||
serialize-rustc = ["rustc-serialize"]
|
||||
derive = ["serde_derive"]
|
||||
derive = ["serde/derive"]
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
///! https://github.com/rust-lang/rust/blob/master/src/librustc_errors/json.rs
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::{Column, OneIndexed, Row, Span};
|
||||
|
||||
#[cfg_attr(feature = "derive", derive(Deserialize))]
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
#![cfg_attr(feature = "nightly", feature(step_trait, step_trait_ext))]
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
use std::iter::Step;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub mod compiler;
|
||||
mod serde_expanded;
|
||||
|
||||
#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct Column<I: Indexed>(pub u32, PhantomData<I>);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue