File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: cbcc7bba30920489d4c772f174bfb9715842f163
2
+ refs/heads/master: d53bfad8e7b6f199436d8838f75eb90713dffd1d
Original file line number Diff line number Diff line change @@ -76,11 +76,16 @@ fn def_id_of_def(def d) -> def_id {
76
76
fail;
77
77
}
78
78
79
+ // The set of meta_items that define the compilation environment of the crate,
80
+ // used to drive conditional compilation
81
+ type crate_cfg = vec[ @meta_item ] ;
82
+
79
83
type crate = spanned[ crate_ ] ;
80
84
81
85
type crate_ = rec ( vec[ @crate_directive] directives ,
82
86
_mod module ,
83
- vec[ attribute] attrs ) ;
87
+ vec[ attribute] attrs ,
88
+ crate_cfg config) ;
84
89
85
90
tag crate_directive_ {
86
91
cdir_expr( @expr) ;
Original file line number Diff line number Diff line change @@ -131,7 +131,8 @@ fn noop_fold_crate(&crate_ c, ast_fold fld) -> crate_ {
131
131
auto fold_attribute = bind fold_attribute_ ( _, fold_meta_item) ;
132
132
133
133
ret rec ( directives=map ( fld. fold_crate_directive , c. directives ) ,
134
- module=c. module , attrs=map ( fold_attribute, c. attrs ) ) ;
134
+ module=c. module , attrs=map ( fold_attribute, c. attrs ) ,
135
+ config=map ( fold_meta_item, c. config ) ) ;
135
136
}
136
137
137
138
fn noop_fold_crate_directive ( & crate_directive_ cd, ast_fold fld)
Original file line number Diff line number Diff line change @@ -2318,7 +2318,8 @@ fn parse_crate_from_source_file(&parser p) -> @ast::crate {
2318
2318
let vec[ @ast:: crate_directive] cdirs = [ ] ;
2319
2319
ret @spanned ( lo, p. get_lo_pos ( ) , rec ( directives=cdirs,
2320
2320
module=m,
2321
- attrs=crate_attrs. _0 ) ) ;
2321
+ attrs=crate_attrs. _0 ,
2322
+ config=[ ] ) ) ;
2322
2323
}
2323
2324
2324
2325
fn parse_str ( & parser p) -> ast:: ident {
@@ -2450,7 +2451,8 @@ fn parse_crate_from_crate_file(&parser p) -> @ast::crate {
2450
2451
expect ( p, token:: EOF ) ;
2451
2452
ret @spanned ( lo, hi, rec ( directives=cdirs,
2452
2453
module=m,
2453
- attrs=crate_attrs) ) ;
2454
+ attrs=crate_attrs,
2455
+ config=[ ] ) ) ;
2454
2456
}
2455
2457
//
2456
2458
// Local Variables:
You can’t perform that action at this time.
0 commit comments