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 #1323 - Xanewok:purge-unstable-features, r=Xanewok
Browse files Browse the repository at this point in the history
Remove unnecessary #![feature]s

Simple chore, removing `crate_visibility_modifier` since it didn't make the cut to Rust 2018.

@nrc IIRC someone wanted to use rls-analysis in a stable setting (although the file format continues to be very unstable) so maybe it might be a good idea to release new versions of those packages from this monorepo.
  • Loading branch information
bors committed Feb 24, 2019
2 parents 7ec1905 + 2978231 commit 4630487
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 23 deletions.
8 changes: 4 additions & 4 deletions rls-analysis/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use {Id, Span, SymbolQuery};
/// such as definitions, their mapping between spans, hierarchy and so on,
/// organized in a per-crate fashion.
#[derive(Debug)]
crate struct Analysis {
pub(crate) struct Analysis {
/// Contains lowered data with global inter-crate `Id`s per each crate.
pub per_crate: HashMap<CrateId, PerCrateAnalysis>,

Expand All @@ -30,10 +30,10 @@ crate struct Analysis {
//
// In the future we should handle imports, in particular aliasing ones, more
// explicitly and then this can be removed.
crate aliased_imports: HashSet<Id>,
pub(crate) aliased_imports: HashSet<Id>,

// Maps a crate names to the crate ids for all crates with that name.
crate crate_names: HashMap<String, Vec<CrateId>>,
pub(crate) crate_names: HashMap<String, Vec<CrateId>>,

pub doc_url_base: String,
pub src_url_base: String,
Expand Down Expand Up @@ -156,7 +156,7 @@ impl PerCrateAnalysis {

// Returns true if there is a def in this crate with the same crate-local id
// and span as `def`.
crate fn has_congruent_def(&self, local_id: u32, span: &Span) -> bool {
pub(crate) fn has_congruent_def(&self, local_id: u32, span: &Span) -> bool {
let id = Id::from_crate_and_local(self.global_crate_num, local_id);
match self.defs.get(&id) {
Some(existing) => span == &existing.span,
Expand Down
5 changes: 1 addition & 4 deletions rls-analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(type_ascription)]
#![feature(crate_visibility_modifier)]

#[macro_use]
extern crate derive_new;
#[macro_use]
Expand Down Expand Up @@ -400,7 +397,7 @@ impl<L: AnalysisLoader> AnalysisHost<L> {
.unwrap_or_else(Vec::new)
.into_iter()
})
.collect(): Vec<Span>
.collect::<Vec<Span>>()
}))
});

Expand Down
1 change: 1 addition & 0 deletions rls-rustc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target/
**/*.rs.bk
Cargo.lock
4 changes: 0 additions & 4 deletions rls-rustc/Cargo.lock

This file was deleted.

1 change: 0 additions & 1 deletion rls-rustc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(rustc_private)]
#![feature(box_syntax)]

extern crate env_logger;
extern crate getopts;
Expand Down
2 changes: 0 additions & 2 deletions rls-vfs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_ascription)]

extern crate rls_span as span;
#[macro_use]
extern crate log;
Expand Down
6 changes: 4 additions & 2 deletions rls-vfs/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ fn test_user_data(with_len: bool) {
assert_eq!(
vfs.with_user_data(&Path::new("foo"), |u| {
assert_eq!(*u.unwrap().1, 43);
Err(Error::BadLocation): Result<(), Error>
Result::Err::<(), Error>(Error::BadLocation)
}),
Err(Error::BadLocation)
);
Expand All @@ -237,7 +237,9 @@ fn test_user_data(with_len: bool) {
// Compute (clear) and read data.
vfs.set_user_data(&Path::new("foo"), Some(42)).unwrap();
assert_eq!(
vfs.with_user_data(&Path::new("foo"), |_| Err(Error::NoUserDataForFile): Result<(), Error>),
vfs.with_user_data(&Path::new("foo"), |_| Result::Err::<(), Error>(
Error::NoUserDataForFile
)),
Err(Error::NoUserDataForFile)
);
vfs.with_user_data(&Path::new("foo"), |u| {
Expand Down
6 changes: 2 additions & 4 deletions rls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,9 @@ impl Config {
let seq = serde::de::value::MapDeserializer::new(map.iter().filter_map(|(k, v)| {
use heck::SnakeCase;
let snake_case = k.to_snake_case();
let (_, ref mut vec) = dups
.raw_entry_mut()
.from_key(&snake_case)
.or_insert(snake_case.clone(), vec![]);
let vec = dups.entry(snake_case.clone()).or_default();
vec.push(k.to_string());

if vec.len() == 1 {
Some((snake_case, JsonValue(v.to_owned().clone())))
} else {
Expand Down
3 changes: 1 addition & 2 deletions rls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
//! functionality such as 'goto definition', symbol search, reformatting, and
//! code completion, and enables renaming and refactorings.

#![feature(rustc_private, integer_atomics, drain_filter, hash_raw_entry)]
#![allow(unknown_lints)]
#![feature(rustc_private, drain_filter)]
#![warn(clippy::all, rust_2018_idioms)]
#![allow(clippy::cyclomatic_complexity, clippy::too_many_arguments)]

Expand Down

0 comments on commit 4630487

Please sign in to comment.