about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-20 08:45:55 +0000
committerbors <bors@rust-lang.org>2018-10-20 08:45:55 +0000
commit94273f4d8e463cac45486328294bb1c2bbc10170 (patch)
treede04f7e054e20b25d6b095ea417a42e22720a6f9 /src/libsyntax
parent89be71a46234a2231b5b3839cd497188e072291f (diff)
parent53e92f4573f30e52a0ea241fb76c6f1ffaabff90 (diff)
downloadrust-94273f4d8e463cac45486328294bb1c2bbc10170.tar.gz
rust-94273f4d8e463cac45486328294bb1c2bbc10170.zip
Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakis
Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs2
-rw-r--r--src/libsyntax/source_map.rs11
2 files changed, 4 insertions, 9 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 84122688c83..a110248439e 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1930,7 +1930,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
     let incomplete_features = ["generic_associated_types"];
 
     let mut features = Features::new();
-    let mut edition_enabled_features = FxHashMap();
+    let mut edition_enabled_features = FxHashMap::default();
 
     for &edition in ALL_EDITIONS {
         if edition <= crate_edition {
diff --git a/src/libsyntax/source_map.rs b/src/libsyntax/source_map.rs
index 7ee58350621..5054f18b020 100644
--- a/src/libsyntax/source_map.rs
+++ b/src/libsyntax/source_map.rs
@@ -124,6 +124,7 @@ impl StableFilemapId {
 // SourceMap
 //
 
+#[derive(Default)]
 pub(super) struct SourceMapFiles {
     pub(super) file_maps: Vec<Lrc<SourceFile>>,
     stable_id_to_source_file: FxHashMap<StableFilemapId, Lrc<SourceFile>>
@@ -143,10 +144,7 @@ pub struct SourceMap {
 impl SourceMap {
     pub fn new(path_mapping: FilePathMapping) -> SourceMap {
         SourceMap {
-            files: Lock::new(SourceMapFiles {
-                file_maps: Vec::new(),
-                stable_id_to_source_file: FxHashMap(),
-            }),
+            files: Default::default(),
             file_loader: Box::new(RealFileLoader),
             path_mapping,
             doctest_offset: None,
@@ -166,10 +164,7 @@ impl SourceMap {
                             path_mapping: FilePathMapping)
                             -> SourceMap {
         SourceMap {
-            files: Lock::new(SourceMapFiles {
-                file_maps: Vec::new(),
-                stable_id_to_source_file: FxHashMap(),
-            }),
+            files: Default::default(),
             file_loader: file_loader,
             path_mapping,
             doctest_offset: None,