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

Commit 4630487

Browse files
committed
Auto merge of #1323 - Xanewok:purge-unstable-features, r=Xanewok
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.
2 parents 7ec1905 + 2978231 commit 4630487

File tree

9 files changed

+13
-23
lines changed

9 files changed

+13
-23
lines changed

rls-analysis/src/analysis.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {Id, Span, SymbolQuery};
1919
/// such as definitions, their mapping between spans, hierarchy and so on,
2020
/// organized in a per-crate fashion.
2121
#[derive(Debug)]
22-
crate struct Analysis {
22+
pub(crate) struct Analysis {
2323
/// Contains lowered data with global inter-crate `Id`s per each crate.
2424
pub per_crate: HashMap<CrateId, PerCrateAnalysis>,
2525

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

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

3838
pub doc_url_base: String,
3939
pub src_url_base: String,
@@ -156,7 +156,7 @@ impl PerCrateAnalysis {
156156

157157
// Returns true if there is a def in this crate with the same crate-local id
158158
// and span as `def`.
159-
crate fn has_congruent_def(&self, local_id: u32, span: &Span) -> bool {
159+
pub(crate) fn has_congruent_def(&self, local_id: u32, span: &Span) -> bool {
160160
let id = Id::from_crate_and_local(self.global_crate_num, local_id);
161161
match self.defs.get(&id) {
162162
Some(existing) => span == &existing.span,

rls-analysis/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
#![feature(type_ascription)]
10-
#![feature(crate_visibility_modifier)]
11-
129
#[macro_use]
1310
extern crate derive_new;
1411
#[macro_use]
@@ -400,7 +397,7 @@ impl<L: AnalysisLoader> AnalysisHost<L> {
400397
.unwrap_or_else(Vec::new)
401398
.into_iter()
402399
})
403-
.collect(): Vec<Span>
400+
.collect::<Vec<Span>>()
404401
}))
405402
});
406403

rls-rustc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target/
22
**/*.rs.bk
3+
Cargo.lock

rls-rustc/Cargo.lock

Lines changed: 0 additions & 4 deletions
This file was deleted.

rls-rustc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(rustc_private)]
2-
#![feature(box_syntax)]
32

43
extern crate env_logger;
54
extern crate getopts;

rls-vfs/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(type_ascription)]
2-
31
extern crate rls_span as span;
42
#[macro_use]
53
extern crate log;

rls-vfs/src/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn test_user_data(with_len: bool) {
216216
assert_eq!(
217217
vfs.with_user_data(&Path::new("foo"), |u| {
218218
assert_eq!(*u.unwrap().1, 43);
219-
Err(Error::BadLocation): Result<(), Error>
219+
Result::Err::<(), Error>(Error::BadLocation)
220220
}),
221221
Err(Error::BadLocation)
222222
);
@@ -237,7 +237,9 @@ fn test_user_data(with_len: bool) {
237237
// Compute (clear) and read data.
238238
vfs.set_user_data(&Path::new("foo"), Some(42)).unwrap();
239239
assert_eq!(
240-
vfs.with_user_data(&Path::new("foo"), |_| Err(Error::NoUserDataForFile): Result<(), Error>),
240+
vfs.with_user_data(&Path::new("foo"), |_| Result::Err::<(), Error>(
241+
Error::NoUserDataForFile
242+
)),
241243
Err(Error::NoUserDataForFile)
242244
);
243245
vfs.with_user_data(&Path::new("foo"), |u| {

rls/src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,9 @@ impl Config {
223223
let seq = serde::de::value::MapDeserializer::new(map.iter().filter_map(|(k, v)| {
224224
use heck::SnakeCase;
225225
let snake_case = k.to_snake_case();
226-
let (_, ref mut vec) = dups
227-
.raw_entry_mut()
228-
.from_key(&snake_case)
229-
.or_insert(snake_case.clone(), vec![]);
226+
let vec = dups.entry(snake_case.clone()).or_default();
230227
vec.push(k.to_string());
228+
231229
if vec.len() == 1 {
232230
Some((snake_case, JsonValue(v.to_owned().clone())))
233231
} else {

rls/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
//! functionality such as 'goto definition', symbol search, reformatting, and
66
//! code completion, and enables renaming and refactorings.
77
8-
#![feature(rustc_private, integer_atomics, drain_filter, hash_raw_entry)]
9-
#![allow(unknown_lints)]
8+
#![feature(rustc_private, drain_filter)]
109
#![warn(clippy::all, rust_2018_idioms)]
1110
#![allow(clippy::cyclomatic_complexity, clippy::too_many_arguments)]
1211

0 commit comments

Comments
 (0)