Skip to content

Commit cec23d2

Browse files
committed
making progress
1 parent be8d815 commit cec23d2

File tree

3 files changed

+157
-181
lines changed

3 files changed

+157
-181
lines changed

src/librustc_incremental/persist/dirty_clean.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ use rustc_data_structures::fx::{FxHashSet, FxHashMap};
5858
use syntax_pos::Span;
5959
use rustc::ty::TyCtxt;
6060

61+
// FIXME: validate with
62+
// X - enum_constructors.rs
63+
// inherent_impls.rs
64+
// statics.rs
65+
// struct_constructors.rs
66+
// trait_defs.rs
67+
// trait_impls.rs
68+
// type_defs.rs
69+
//
70+
// # Waiting on stuff..
71+
// - extern_mods.rs
72+
6173
const EXCEPT: &str = "except";
6274
const LABEL: &str = "label";
6375
const CFG: &str = "cfg";
6476

6577
// Base and Extra labels to build up the labels
66-
//
67-
// FIXME(vitiral): still missing
68-
// - mod declaration
69-
// - external crate
70-
// - external trait
71-
// - foreign (external?) item
72-
// - global asm
73-
74-
/// extra DepNodes for methods (+fn)
75-
const EXTRA_ASSOCIATED: &[&str] = &[
76-
label_strs::AssociatedItems,
77-
];
7878

7979
/// For typedef, constants, and statics
8080
const BASE_CONST: &[&str] = &[
@@ -136,6 +136,11 @@ const BASE_TRAIT_DEF: &[&str] = &[
136136
label_strs::TraitImpls,
137137
];
138138

139+
/// extra DepNodes for methods (+fn)
140+
const EXTRA_ASSOCIATED: &[&str] = &[
141+
label_strs::AssociatedItems,
142+
];
143+
139144
const EXTRA_TRAIT: &[&str] = &[
140145
label_strs::TraitOfItem,
141146
];

src/test/incremental/hashes/enum_constructors.rs

Lines changed: 37 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ fn change_field_value_struct_like() -> Enum {
4545
}
4646

4747
#[cfg(not(cfail1))]
48-
#[rustc_clean(label="Hir", cfg="cfail2")]
49-
#[rustc_clean(label="Hir", cfg="cfail3")]
50-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
51-
#[rustc_clean(label="HirBody", cfg="cfail3")]
48+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
49+
#[rustc_clean(cfg="cfail3")]
5250
#[rustc_metadata_clean(cfg="cfail2")]
5351
#[rustc_metadata_clean(cfg="cfail3")]
5452
fn change_field_value_struct_like() -> Enum {
@@ -72,10 +70,8 @@ fn change_field_order_struct_like() -> Enum {
7270
}
7371

7472
#[cfg(not(cfail1))]
75-
#[rustc_clean(label="Hir", cfg="cfail2")]
76-
#[rustc_clean(label="Hir", cfg="cfail3")]
77-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
78-
#[rustc_clean(label="HirBody", cfg="cfail3")]
73+
#[rustc_clean(cfg="cfail2", except="HirBody")]
74+
#[rustc_clean(cfg="cfail3")]
7975
#[rustc_metadata_clean(cfg="cfail2")]
8076
#[rustc_metadata_clean(cfg="cfail3")]
8177
fn change_field_order_struct_like() -> Enum {
@@ -113,10 +109,8 @@ fn change_constructor_path_struct_like() {
113109
}
114110

115111
#[cfg(not(cfail1))]
116-
#[rustc_clean(label="Hir", cfg="cfail2")]
117-
#[rustc_clean(label="Hir", cfg="cfail3")]
118-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
119-
#[rustc_clean(label="HirBody", cfg="cfail3")]
112+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
113+
#[rustc_clean(cfg="cfail3")]
120114
#[rustc_metadata_clean(cfg="cfail2")]
121115
#[rustc_metadata_clean(cfg="cfail3")]
122116
fn change_constructor_path_struct_like() {
@@ -140,10 +134,8 @@ fn change_constructor_variant_struct_like() {
140134
}
141135

142136
#[cfg(not(cfail1))]
143-
#[rustc_clean(label="Hir", cfg="cfail2")]
144-
#[rustc_clean(label="Hir", cfg="cfail3")]
145-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
146-
#[rustc_clean(label="HirBody", cfg="cfail3")]
137+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
138+
#[rustc_clean(cfg="cfail3")]
147139
#[rustc_metadata_clean(cfg="cfail2")]
148140
#[rustc_metadata_clean(cfg="cfail3")]
149141
fn change_constructor_variant_struct_like() {
@@ -162,10 +154,8 @@ mod change_constructor_path_indirectly_struct_like {
162154
#[cfg(not(cfail1))]
163155
use super::Enum2 as TheEnum;
164156

165-
#[rustc_dirty(label="Hir", cfg="cfail2")]
166-
#[rustc_clean(label="Hir", cfg="cfail3")]
167-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
168-
#[rustc_clean(label="HirBody", cfg="cfail3")]
157+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
158+
#[rustc_clean(cfg="cfail3")]
169159
#[rustc_metadata_dirty(cfg="cfail2")]
170160
#[rustc_metadata_clean(cfg="cfail3")]
171161
fn function() -> TheEnum {
@@ -186,10 +176,8 @@ mod change_constructor_variant_indirectly_struct_like {
186176
#[cfg(not(cfail1))]
187177
use super::Enum2::Struct2 as Variant;
188178

189-
#[rustc_clean(label="Hir", cfg="cfail2")]
190-
#[rustc_clean(label="Hir", cfg="cfail3")]
191-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
192-
#[rustc_clean(label="HirBody", cfg="cfail3")]
179+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
180+
#[rustc_clean(cfg="cfail3")]
193181
#[rustc_metadata_clean(cfg="cfail2")]
194182
#[rustc_metadata_clean(cfg="cfail3")]
195183
fn function() -> Enum2 {
@@ -209,10 +197,8 @@ fn change_field_value_tuple_like() -> Enum {
209197
}
210198

211199
#[cfg(not(cfail1))]
212-
#[rustc_clean(label="Hir", cfg="cfail2")]
213-
#[rustc_clean(label="Hir", cfg="cfail3")]
214-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
215-
#[rustc_clean(label="HirBody", cfg="cfail3")]
200+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
201+
#[rustc_clean(cfg="cfail3")]
216202
#[rustc_metadata_clean(cfg="cfail2")]
217203
#[rustc_metadata_clean(cfg="cfail3")]
218204
fn change_field_value_tuple_like() -> Enum {
@@ -228,10 +214,8 @@ fn change_constructor_path_tuple_like() {
228214
}
229215

230216
#[cfg(not(cfail1))]
231-
#[rustc_clean(label="Hir", cfg="cfail2")]
232-
#[rustc_clean(label="Hir", cfg="cfail3")]
233-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
234-
#[rustc_clean(label="HirBody", cfg="cfail3")]
217+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
218+
#[rustc_clean(cfg="cfail3")]
235219
#[rustc_metadata_clean(cfg="cfail2")]
236220
#[rustc_metadata_clean(cfg="cfail3")]
237221
fn change_constructor_path_tuple_like() {
@@ -247,10 +231,8 @@ fn change_constructor_variant_tuple_like() {
247231
}
248232

249233
#[cfg(not(cfail1))]
250-
#[rustc_clean(label="Hir", cfg="cfail2")]
251-
#[rustc_clean(label="Hir", cfg="cfail3")]
252-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
253-
#[rustc_clean(label="HirBody", cfg="cfail3")]
234+
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
235+
#[rustc_clean(cfg="cfail3")]
254236
#[rustc_metadata_clean(cfg="cfail2")]
255237
#[rustc_metadata_clean(cfg="cfail3")]
256238
fn change_constructor_variant_tuple_like() {
@@ -265,10 +247,11 @@ mod change_constructor_path_indirectly_tuple_like {
265247
#[cfg(not(cfail1))]
266248
use super::Enum2 as TheEnum;
267249

268-
#[rustc_dirty(label="Hir", cfg="cfail2")]
269-
#[rustc_clean(label="Hir", cfg="cfail3")]
270-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
271-
#[rustc_clean(label="HirBody", cfg="cfail3")]
250+
#[rustc_clean(
251+
cfg="cfail2",
252+
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
253+
)]
254+
#[rustc_clean(cfg="cfail3")]
272255
#[rustc_metadata_dirty(cfg="cfail2")]
273256
#[rustc_metadata_clean(cfg="cfail3")]
274257
fn function() -> TheEnum {
@@ -286,10 +269,8 @@ mod change_constructor_variant_indirectly_tuple_like {
286269
#[cfg(not(cfail1))]
287270
use super::Enum2::Tuple2 as Variant;
288271

289-
#[rustc_clean(label="Hir", cfg="cfail2")]
290-
#[rustc_clean(label="Hir", cfg="cfail3")]
291-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
292-
#[rustc_clean(label="HirBody", cfg="cfail3")]
272+
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
273+
#[rustc_clean(cfg="cfail3")]
293274
#[rustc_metadata_clean(cfg="cfail2")]
294275
#[rustc_metadata_clean(cfg="cfail3")]
295276
fn function() -> Enum2 {
@@ -317,11 +298,9 @@ fn change_constructor_path_c_like() {
317298
}
318299

319300
#[cfg(not(cfail1))]
320-
#[rustc_clean(label="Hir", cfg="cfail2")]
321-
#[rustc_clean(label="Hir", cfg="cfail3")]
322-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
323-
#[rustc_clean(label="HirBody", cfg="cfail3")]
324-
#[rustc_metadata_clean(cfg="cfail2")]
301+
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
302+
#[rustc_clean(cfg="cfail3")]
303+
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
325304
#[rustc_metadata_clean(cfg="cfail3")]
326305
fn change_constructor_path_c_like() {
327306
let _ = Clike2::B;
@@ -336,10 +315,8 @@ fn change_constructor_variant_c_like() {
336315
}
337316

338317
#[cfg(not(cfail1))]
339-
#[rustc_clean(label="Hir", cfg="cfail2")]
340-
#[rustc_clean(label="Hir", cfg="cfail3")]
341-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
342-
#[rustc_clean(label="HirBody", cfg="cfail3")]
318+
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
319+
#[rustc_clean(cfg="cfail3")]
343320
#[rustc_metadata_clean(cfg="cfail2")]
344321
#[rustc_metadata_clean(cfg="cfail3")]
345322
fn change_constructor_variant_c_like() {
@@ -354,10 +331,11 @@ mod change_constructor_path_indirectly_c_like {
354331
#[cfg(not(cfail1))]
355332
use super::Clike2 as TheEnum;
356333

357-
#[rustc_dirty(label="Hir", cfg="cfail2")]
358-
#[rustc_clean(label="Hir", cfg="cfail3")]
359-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
360-
#[rustc_clean(label="HirBody", cfg="cfail3")]
334+
#[rustc_clean(
335+
cfg="cfail2",
336+
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
337+
)]
338+
#[rustc_clean(cfg="cfail3")]
361339
#[rustc_metadata_dirty(cfg="cfail2")]
362340
#[rustc_metadata_clean(cfg="cfail3")]
363341
fn function() -> TheEnum {
@@ -375,10 +353,8 @@ mod change_constructor_variant_indirectly_c_like {
375353
#[cfg(not(cfail1))]
376354
use super::Clike::B as Variant;
377355

378-
#[rustc_clean(label="Hir", cfg="cfail2")]
379-
#[rustc_clean(label="Hir", cfg="cfail3")]
380-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
381-
#[rustc_clean(label="HirBody", cfg="cfail3")]
356+
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
357+
#[rustc_clean(cfg="cfail3")]
382358
#[rustc_metadata_clean(cfg="cfail2")]
383359
#[rustc_metadata_clean(cfg="cfail3")]
384360
fn function() -> Clike {

0 commit comments

Comments
 (0)