mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 02:29:44 +00:00
fix: Fix format_args lowering for >=1.87
This commit is contained in:
parent
55c8cdeafb
commit
e7ce86ddea
7 changed files with 128 additions and 53 deletions
|
|
@ -303,6 +303,19 @@ pub struct CrateWorkspaceData {
|
|||
pub toolchain: Option<Version>,
|
||||
}
|
||||
|
||||
impl CrateWorkspaceData {
|
||||
pub fn is_atleast_187(&self) -> bool {
|
||||
const VERSION_187: Version = Version {
|
||||
major: 1,
|
||||
minor: 87,
|
||||
patch: 0,
|
||||
pre: Prerelease::EMPTY,
|
||||
build: BuildMetadata::EMPTY,
|
||||
};
|
||||
self.toolchain.as_ref().map_or(false, |v| *v >= VERSION_187)
|
||||
}
|
||||
}
|
||||
|
||||
fn toolchain_channel(db: &dyn RootQueryDb, krate: Crate) -> Option<ReleaseChannel> {
|
||||
krate.workspace_data(db).toolchain.as_ref().and_then(|v| ReleaseChannel::from_str(&v.pre))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue