Skip to content

Commit ef76c63

Browse files
committed
Remove ParseSess::assume_incomplete_release.
- This field is just a copy of `sess.unstable_opts.assume_incomplete_release`. - This field has a single use. - `sess` is also available at that use point So this commit removes the field and gets the value directly from `sess`.
1 parent 52b6e2c commit ef76c63

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub fn eval_config_entry(sess: &Session, cfg_entry: &CfgEntry) -> EvalConfigResu
294294
};
295295
};
296296
// See https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454 for details
297-
let min_version_ok = if sess.psess.assume_incomplete_release {
297+
let min_version_ok = if sess.opts.unstable_opts.assume_incomplete_release {
298298
RustcVersion::current_overridable() > *min_version
299299
} else {
300300
RustcVersion::current_overridable() >= *min_version

compiler/rustc_session/src/parse.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ pub struct ParseSess {
264264
pub ambiguous_block_expr_parse: Lock<FxIndexMap<Span, Span>>,
265265
pub gated_spans: GatedSpans,
266266
pub symbol_gallery: SymbolGallery,
267-
/// Whether cfg(version) should treat the current release as incomplete
268-
pub assume_incomplete_release: bool,
269267
/// Spans passed to `proc_macro::quote_span`. Each span has a numerical
270268
/// identifier represented by its position in the vector.
271269
proc_macro_quoted_spans: AppendOnlyVec<Span>,
@@ -299,7 +297,6 @@ impl ParseSess {
299297
ambiguous_block_expr_parse: Lock::new(Default::default()),
300298
gated_spans: GatedSpans::default(),
301299
symbol_gallery: SymbolGallery::default(),
302-
assume_incomplete_release: false,
303300
proc_macro_quoted_spans: Default::default(),
304301
attr_id_generator: AttrIdGenerator::new(),
305302
}

compiler/rustc_session/src/session.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,7 @@ pub fn build_session(
10451045
None
10461046
};
10471047

1048-
let mut psess = ParseSess::with_dcx(dcx, source_map);
1049-
psess.assume_incomplete_release = sopts.unstable_opts.assume_incomplete_release;
1048+
let psess = ParseSess::with_dcx(dcx, source_map);
10501049

10511050
let host_triple = config::host_tuple();
10521051
let target_triple = sopts.target_triple.tuple();

0 commit comments

Comments
 (0)