Treat nightlies for a version as complete
This commit makes cfg(version) treat the nightlies for version 1.n.0 as 1.n.0, even though that nightly version might not have all stabilizations and features of the released 1.n.0. This is done for greater convenience for people who want to test a newly stabilized feature on nightly. For users who wish to pin nightlies, this commit adds a -Z assume-incomplete-release option that they can enable if there are any issues due to this change.
This commit is contained in:
parent
14aa12fcc2
commit
d8b5745d46
5 changed files with 14 additions and 5 deletions
|
@ -856,6 +856,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
|||
"only allow the listed language features to be enabled in code (space separated)"),
|
||||
always_encode_mir: bool = (false, parse_bool, [TRACKED],
|
||||
"encode MIR of all functions into the crate metadata (default: no)"),
|
||||
assume_incomplete_release: bool = (false, parse_bool, [TRACKED],
|
||||
"make cfg(version) treat the current version as incomplete (default: no)"),
|
||||
asm_comments: bool = (false, parse_bool, [TRACKED],
|
||||
"generate comments into the assembly (may change behavior) (default: no)"),
|
||||
ast_json: bool = (false, parse_bool, [UNTRACKED],
|
||||
|
|
|
@ -138,6 +138,8 @@ pub struct ParseSess {
|
|||
pub env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>,
|
||||
/// All the type ascriptions expressions that have had a suggestion for likely path typo.
|
||||
pub type_ascription_path_suggestions: Lock<FxHashSet<Span>>,
|
||||
/// Whether cfg(version) should treat the current release as incomplete
|
||||
pub assume_incomplete_release: bool,
|
||||
}
|
||||
|
||||
impl ParseSess {
|
||||
|
@ -164,6 +166,7 @@ impl ParseSess {
|
|||
reached_eof: Lock::new(false),
|
||||
env_depinfo: Default::default(),
|
||||
type_ascription_path_suggestions: Default::default(),
|
||||
assume_incomplete_release: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1336,7 +1336,8 @@ pub fn build_session(
|
|||
None
|
||||
};
|
||||
|
||||
let parse_sess = ParseSess::with_span_handler(span_diagnostic, source_map);
|
||||
let mut parse_sess = ParseSess::with_span_handler(span_diagnostic, source_map);
|
||||
parse_sess.assume_incomplete_release = sopts.debugging_opts.assume_incomplete_release;
|
||||
let sysroot = match &sopts.maybe_sysroot {
|
||||
Some(sysroot) => sysroot.clone(),
|
||||
None => filesearch::get_or_default_sysroot(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue