mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 22:24:14 +00:00
Fix release channel detection
See bootstrap code in rust-lang/rust for versioning details: e49122fb1c/src/bootstrap/lib.rs (L1244)
This commit is contained in:
parent
1f92641093
commit
4db87f9346
4 changed files with 6 additions and 6 deletions
|
@ -284,9 +284,9 @@ impl ReleaseChannel {
|
||||||
|
|
||||||
pub fn from_str(str: &str) -> Option<Self> {
|
pub fn from_str(str: &str) -> Option<Self> {
|
||||||
Some(match str {
|
Some(match str {
|
||||||
"stable" => ReleaseChannel::Stable,
|
"" => ReleaseChannel::Stable,
|
||||||
"beta" => ReleaseChannel::Beta,
|
|
||||||
"nightly" => ReleaseChannel::Nightly,
|
"nightly" => ReleaseChannel::Nightly,
|
||||||
|
_ if str.starts_with("beta") => ReleaseChannel::Beta,
|
||||||
_ => return None,
|
_ => return None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,7 +387,6 @@ use self::foo::impl$0
|
||||||
fn use_tree_no_unstable_items_on_stable() {
|
fn use_tree_no_unstable_items_on_stable() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- toolchain:stable
|
|
||||||
//- /lib.rs crate:main deps:std
|
//- /lib.rs crate:main deps:std
|
||||||
use std::$0
|
use std::$0
|
||||||
//- /std.rs crate:std
|
//- /std.rs crate:std
|
||||||
|
|
|
@ -779,7 +779,7 @@ fn project_json_to_crate_graph(
|
||||||
CrateOrigin::Local { repo: None, name: None }
|
CrateOrigin::Local { repo: None, name: None }
|
||||||
},
|
},
|
||||||
target_layout.clone(),
|
target_layout.clone(),
|
||||||
None,
|
channel,
|
||||||
);
|
);
|
||||||
if *is_proc_macro {
|
if *is_proc_macro {
|
||||||
if let Some(path) = proc_macro_dylib_path.clone() {
|
if let Some(path) = proc_macro_dylib_path.clone() {
|
||||||
|
|
|
@ -111,8 +111,9 @@ impl FixtureWithProjectMeta {
|
||||||
/// //- minicore: sized
|
/// //- minicore: sized
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// That will include predefined proc macros and a subset of `libcore` into the fixture, see
|
/// That will set toolchain to nightly and include predefined proc macros and a subset of
|
||||||
/// `minicore.rs` for what's available.
|
/// `libcore` into the fixture, see `minicore.rs` for what's available. Note that toolchain
|
||||||
|
/// defaults to stable.
|
||||||
pub fn parse(ra_fixture: &str) -> Self {
|
pub fn parse(ra_fixture: &str) -> Self {
|
||||||
let fixture = trim_indent(ra_fixture);
|
let fixture = trim_indent(ra_fixture);
|
||||||
let mut fixture = fixture.as_str();
|
let mut fixture = fixture.as_str();
|
||||||
|
|
Loading…
Reference in a new issue