mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-11 20:58:54 +00:00
Migrate to edition 2021
This commit is contained in:
parent
6aeeb4ef33
commit
1294bfce86
56 changed files with 48 additions and 71 deletions
|
@ -3,7 +3,7 @@ name = "base_db"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "cfg"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "flycheck"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "hir"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "hir_def"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
//! A higher level attributes based on TokenTree, with also some shortcuts.
|
||||
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt,
|
||||
hash::Hash,
|
||||
ops,
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{fmt, hash::Hash, ops, sync::Arc};
|
||||
|
||||
use base_db::CrateId;
|
||||
use cfg::{CfgExpr, CfgOptions};
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "hir_expand"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "hir_ty"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "ide"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
mod intra_doc_links;
|
||||
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
|
||||
use either::Either;
|
||||
use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag};
|
||||
use pulldown_cmark_to_cmark::{cmark_with_options, Options as CmarkOptions};
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use std::convert::TryFrom;
|
||||
|
||||
use ide_assists::utils::extract_trivial_expression;
|
||||
use ide_db::helpers::node_ext::expr_as_name_ref;
|
||||
use itertools::Itertools;
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "ide_assists"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "ide_completion"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "ide_db"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "ide_diagnostics"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.0.0"
|
|||
description = "Structural search and replace of Rust code"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.0.0"
|
|||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
authors = ["rust-analyzer developers"]
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
tracking = []
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "mbe"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "parser"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "paths"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
//! relative paths.
|
||||
use std::{
|
||||
borrow::Borrow,
|
||||
convert::{TryFrom, TryInto},
|
||||
ffi::OsStr,
|
||||
ops,
|
||||
path::{Component, Path, PathBuf},
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "proc_macro_api"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "proc_macro_srv"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "proc_macro_test"
|
||||
version = "0.0.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "proc_macro_test_impl"
|
||||
version = "0.0.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "profile"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "project_model"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//! See [`CargoWorkspace`].
|
||||
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use std::iter;
|
||||
use std::path::PathBuf;
|
||||
use std::{ops, process::Command};
|
||||
|
|
|
@ -28,7 +28,6 @@ mod build_scripts;
|
|||
mod tests;
|
||||
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fs::{self, read_dir, ReadDir},
|
||||
io,
|
||||
process::Command,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! See [`ManifestPath`].
|
||||
use std::{convert::TryFrom, ops, path::Path};
|
||||
use std::{ops, path::Path};
|
||||
|
||||
use paths::{AbsPath, AbsPathBuf};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
//! but we can't process `.rlib` and need source code instead. The source code
|
||||
//! is typically installed with `rustup component add rust-src` command.
|
||||
|
||||
use std::{convert::TryFrom, env, fs, iter, ops, path::PathBuf, process::Command};
|
||||
use std::{env, fs, iter, ops, path::PathBuf, process::Command};
|
||||
|
||||
use anyhow::{format_err, Result};
|
||||
use la_arena::{Arena, Idx};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//! metadata` or `rust-project.json`) into representation stored in the salsa
|
||||
//! database -- `CrateGraph`.
|
||||
|
||||
use std::{collections::VecDeque, convert::TryFrom, fmt, fs, process::Command};
|
||||
use std::{collections::VecDeque, fmt, fs, process::Command};
|
||||
|
||||
use anyhow::{format_err, Context, Result};
|
||||
use base_db::{
|
||||
|
|
|
@ -7,7 +7,7 @@ description = "A language server for the Rust programming language"
|
|||
documentation = "https://rust-analyzer.github.io/manual.html"
|
||||
license = "MIT OR Apache-2.0"
|
||||
autobins = false
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
mod logger;
|
||||
mod rustc_wrapper;
|
||||
|
||||
use std::{convert::TryFrom, env, fs, path::Path, process};
|
||||
use std::{env, fs, path::Path, process};
|
||||
|
||||
use lsp_server::Connection;
|
||||
use project_model::ProjectManifest;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
//! Conversion lsp_types types to rust-analyzer specific ones.
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use ide::{Annotation, AnnotationKind, AssistKind, LineCol, LineColUtf16};
|
||||
use ide_db::base_db::{FileId, FilePosition, FileRange};
|
||||
use syntax::{TextRange, TextSize};
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
//! `ide` crate.
|
||||
|
||||
use std::{
|
||||
convert::TryFrom,
|
||||
io::Write as _,
|
||||
process::{self, Stdio},
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//! in release mode in VS Code. There's however "Rust Analyzer: Copy Run Command Line"
|
||||
//! which you can use to paste the command in terminal and add `--release` manually.
|
||||
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
use ide::{Change, CompletionConfig, FilePosition, TextSize};
|
||||
use ide_db::helpers::{
|
||||
|
|
|
@ -350,7 +350,7 @@ fn test_format_document_2018() {
|
|||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
//- /src/lib.rs
|
||||
mod bar;
|
||||
|
@ -799,7 +799,7 @@ fn resolve_proc_macro() {
|
|||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
[dependencies]
|
||||
bar = {path = "../bar"}
|
||||
|
||||
|
@ -818,7 +818,7 @@ fn main() {
|
|||
[package]
|
||||
name = "bar"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "sourcegen"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "stdx"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.0.0"
|
|||
description = "Comment and whitespace preserving parser for the Rust language"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
name = "syntax-fuzz"
|
||||
version = "0.0.1"
|
||||
publish = false
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
//! There are many AstNodes, but only a few tokens, so we hand-write them here.
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
convert::{TryFrom, TryInto},
|
||||
};
|
||||
use std::borrow::Cow;
|
||||
|
||||
use rustc_lexer::unescape::{unescape_literal, Mode};
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
mod block;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use rowan::Direction;
|
||||
use rustc_lexer::unescape::{
|
||||
self, unescape_byte, unescape_byte_literal, unescape_char, unescape_literal, Mode,
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "test_utils"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -12,7 +12,6 @@ mod assert_linear;
|
|||
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
convert::{TryFrom, TryInto},
|
||||
env, fs,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "text_edit"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "toolchain"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "tt"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "vfs-notify"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//!
|
||||
//! Hopefully, one day a reliable file watching/walking crate appears on
|
||||
//! crates.io, and we can reduce this to trivial glue code.
|
||||
use std::{convert::TryFrom, fs};
|
||||
use std::fs;
|
||||
|
||||
use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
|
||||
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "vfs"
|
|||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -267,7 +267,6 @@ mod windows_paths {
|
|||
#[cfg(test)]
|
||||
fn vfs(str: &str) -> super::VfsPath {
|
||||
use super::{AbsPathBuf, VfsPath};
|
||||
use std::convert::TryFrom;
|
||||
VfsPath::from(AbsPathBuf::try_from(str).unwrap())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,4 @@ license = "MIT OR Apache-2.0"
|
|||
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||
documentation = "https://docs.rs/la-arena"
|
||||
categories = ["data-structures", "memory-management", "rust-patterns"]
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
name = "xtask"
|
||||
version = "0.1.0"
|
||||
publish = false
|
||||
|
|
|
@ -8,7 +8,7 @@ use xshell::{cmd, pushd};
|
|||
use crate::flags;
|
||||
|
||||
// Latest stable, feel free to send a PR if this lags behind.
|
||||
const REQUIRED_RUST_VERSION: u32 = 55;
|
||||
const REQUIRED_RUST_VERSION: u32 = 56;
|
||||
|
||||
impl flags::Install {
|
||||
pub(crate) fn run(self) -> Result<()> {
|
||||
|
|
Loading…
Reference in a new issue