Skip to content

Commit

Permalink
Merge branch 'master' into taplo_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
alibektas authored Nov 16, 2023
2 parents e1f8e3f + 58de0b1 commit 9996697
Show file tree
Hide file tree
Showing 39 changed files with 280 additions and 273 deletions.
264 changes: 121 additions & 143 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,34 @@ la-arena = { version = "0.3.1" }
lsp-server = { version = "0.7.4" }

# non-local crates
anyhow = "1.0.75"
bitflags = "2.4.1"
cargo_metadata = "0.18.1"
dissimilar = "1.0.7"
either = "1.9.0"
indexmap = "2.1.0"
itertools = "0.12.0"
smallvec = { version = "1.10.0", features = [
"const_new",
"union",
"const_generics",
] }
tracing = "0.1.40"
tracing-tree = "0.3.0"
tracing-subscriber = { version = "0.3.18", default-features = false, features = [
"registry",
"fmt",
"tracing-log",
] }
smol_str = "0.2.0"
nohash-hasher = "0.2.0"
text-size = "1.1.0"
serde = { version = "1.0.156", features = ["derive"] }
serde_json = "1.0.96"
text-size = "1.1.1"
rayon = "1.8.0"
serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.108"
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
# can't upgrade due to dashmap depending on 0.12.3 currently
hashbrown = { version = "0.12.3", features = [
"inline-more",
], default-features = false }
xshell = "0.2.5"
4 changes: 2 additions & 2 deletions crates/cfg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ oorandom = "11.1.3"
# We depend on both individually instead of using `features = ["derive"]` to microoptimize the
# build graph: if the feature was enabled, syn would be built early on in the graph if `smolstr`
# supports `arbitrary`. This way, we avoid feature unification.
arbitrary = "1.3.0"
derive_arbitrary = "1.3.1"
arbitrary = "1.3.2"
derive_arbitrary = "1.3.2"

# local deps
mbe.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/flycheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ rust-version.workspace = true
doctest = false

[dependencies]
cargo_metadata.workspace = true
crossbeam-channel = "0.5.8"
tracing = "0.1.37"
cargo_metadata = "0.15.4"
tracing.workspace = true
rustc-hash = "1.1.0"
serde_json.workspace = true
serde.workspace = true
Expand Down
10 changes: 5 additions & 5 deletions crates/hir-def/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ doctest = false

[dependencies]
arrayvec = "0.7.2"
bitflags = "2.1.0"
bitflags.workspace = true
cov-mark = "2.0.0-pre.1"
# We need to freeze the version of the crate, as the raw-api feature is considered unstable
dashmap = { version = "=5.4.0", features = ["raw-api"] }
drop_bomb = "0.1.5"
either = "1.7.0"
either.workspace = true
fst = { version = "0.4.7", default-features = false }
indexmap = "2.0.0"
itertools = "0.10.5"
indexmap.workspace = true
itertools.workspace = true
la-arena.workspace = true
once_cell = "1.17.0"
rustc-hash = "1.1.0"
tracing = "0.1.35"
tracing.workspace = true
smallvec.workspace = true
hashbrown.workspace = true
triomphe.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() { column!(); }
#[rustc_builtin_macro]
macro_rules! column {() => {}}
fn main() { 0 as u32; }
fn main() { 0u32; }
"#]],
);
}
Expand Down Expand Up @@ -74,7 +74,7 @@ fn main() { line!() }
#[rustc_builtin_macro]
macro_rules! line {() => {}}
fn main() { 0 as u32 }
fn main() { 0u32 }
"#]],
);
}
Expand Down
34 changes: 34 additions & 0 deletions crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,37 @@ builtin #format_args ("{}", &[0 2]);
"##]],
);
}

#[test]
fn eager_concat_line() {
check(
r#"
#[rustc_builtin_macro]
#[macro_export]
macro_rules! concat {}
#[rustc_builtin_macro]
#[macro_export]
macro_rules! line {}
fn main() {
concat!("event ", line!());
}
"#,
expect![[r##"
#[rustc_builtin_macro]
#[macro_export]
macro_rules! concat {}
#[rustc_builtin_macro]
#[macro_export]
macro_rules! line {}
fn main() {
"event 0u32";
}
"##]],
);
}
6 changes: 3 additions & 3 deletions crates/hir-expand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
tracing = "0.1.35"
either = "1.7.0"
tracing.workspace = true
either.workspace = true
rustc-hash = "1.1.0"
la-arena.workspace = true
itertools = "0.10.5"
itertools.workspace = true
hashbrown.workspace = true
smallvec.workspace = true
triomphe.workspace = true
Expand Down
27 changes: 8 additions & 19 deletions crates/hir-expand/src/builtin_fn_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn find_builtin_macro(

register_builtin! {
LAZY:
(column, Column) => column_expand,
(column, Column) => line_expand,
(file, File) => file_expand,
(line, Line) => line_expand,
(module_path, ModulePath) => module_path_expand,
Expand Down Expand Up @@ -127,11 +127,13 @@ fn line_expand(
_tt: &tt::Subtree,
) -> ExpandResult<tt::Subtree> {
// dummy implementation for type-checking purposes
let expanded = quote! {
0 as u32
};

ExpandResult::ok(expanded)
ExpandResult::ok(tt::Subtree {
delimiter: tt::Delimiter::unspecified(),
token_trees: vec![tt::TokenTree::Leaf(tt::Leaf::Literal(tt::Literal {
text: "0u32".into(),
span: tt::Span::UNSPECIFIED,
}))],
})
}

fn log_syntax_expand(
Expand Down Expand Up @@ -164,19 +166,6 @@ fn stringify_expand(
ExpandResult::ok(expanded)
}

fn column_expand(
_db: &dyn ExpandDatabase,
_id: MacroCallId,
_tt: &tt::Subtree,
) -> ExpandResult<tt::Subtree> {
// dummy implementation for type-checking purposes
let expanded = quote! {
0 as u32
};

ExpandResult::ok(expanded)
}

fn assert_expand(
_db: &dyn ExpandDatabase,
_id: MacroCallId,
Expand Down
24 changes: 11 additions & 13 deletions crates/hir-ty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
itertools = "0.10.5"
itertools.workspace = true
arrayvec = "0.7.2"
bitflags = "2.1.0"
bitflags.workspace = true
smallvec.workspace = true
ena = "0.14.0"
either = "1.7.0"
either.workspace = true
oorandom = "11.1.3"
tracing = "0.1.35"
tracing.workspace = true
rustc-hash = "1.1.0"
scoped-tls = "1.0.0"
chalk-solve = { version = "0.93.0", default-features = false }
chalk-ir = "0.93.0"
chalk-recursive = { version = "0.93.0", default-features = false }
chalk-derive = "0.93.0"
chalk-solve = { version = "0.94.0", default-features = false }
chalk-ir = "0.94.0"
chalk-recursive = { version = "0.94.0", default-features = false }
chalk-derive = "0.94.0"
la-arena.workspace = true
once_cell = "1.17.0"
triomphe.workspace = true
Expand All @@ -47,11 +47,9 @@ limit.workspace = true

[dev-dependencies]
expect-test = "1.4.0"
tracing = "0.1.35"
tracing-subscriber = { version = "0.3.16", default-features = false, features = [
"registry",
] }
tracing-tree = "0.2.1"
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-tree.workspace = true
project-model = { path = "../project-model" }

# local deps
Expand Down
6 changes: 2 additions & 4 deletions crates/hir-ty/src/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ fn infer_builtin_macros_line() {
}
"#,
expect![[r#"
!0..1 '0': i32
!0..6 '0asu32': u32
!0..4 '0u32': u32
63..87 '{ ...!(); }': ()
73..74 'x': u32
"#]],
Expand Down Expand Up @@ -723,8 +722,7 @@ fn infer_builtin_macros_column() {
}
"#,
expect![[r#"
!0..1 '0': i32
!0..6 '0asu32': u32
!0..4 '0u32': u32
65..91 '{ ...!(); }': ()
75..76 'x': u32
"#]],
Expand Down
4 changes: 2 additions & 2 deletions crates/hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ doctest = false

[dependencies]
rustc-hash = "1.1.0"
either = "1.7.0"
either.workspace = true
arrayvec = "0.7.2"
itertools = "0.10.5"
itertools.workspace = true
smallvec.workspace = true
triomphe.workspace = true
once_cell = "1.17.1"
Expand Down
4 changes: 2 additions & 2 deletions crates/ide-assists/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ doctest = false
[dependencies]
cov-mark = "2.0.0-pre.1"

itertools = "0.10.5"
either = "1.7.0"
itertools.workspace = true
either.workspace = true
smallvec.workspace = true

# local deps
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-completion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
itertools = "0.10.5"
itertools.workspace = true

once_cell = "1.17.0"
smallvec.workspace = true
Expand Down
14 changes: 7 additions & 7 deletions crates/ide-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
tracing = "0.1.35"
rayon = "1.6.1"
tracing.workspace = true
rayon.workspace = true
fst = { version = "0.4.7", default-features = false }
rustc-hash = "1.1.0"
once_cell = "1.17.0"
either = "1.7.0"
itertools = "0.10.5"
either.workspace = true
itertools.workspace = true
arrayvec = "0.7.2"
indexmap = "2.0.0"
memchr = "2.5.0"
indexmap.workspace = true
memchr = "2.6.4"
triomphe.workspace = true
nohash-hasher.workspace = true

Expand All @@ -43,7 +43,7 @@ line-index.workspace = true
[dev-dependencies]
expect-test = "1.4.0"
oorandom = "11.1.3"
xshell = "0.2.2"
xshell.workspace = true

# local deps
test-utils.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/ide-db/src/source_change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ impl SnippetEdit {
.with_position()
.map(|pos| {
let (snippet, index) = match pos {
itertools::Position::First(it) | itertools::Position::Middle(it) => it,
(itertools::Position::First, it) | (itertools::Position::Middle, it) => it,
// last/only snippet gets index 0
itertools::Position::Last((snippet, _))
| itertools::Position::Only((snippet, _)) => (snippet, 0),
(itertools::Position::Last, (snippet, _))
| (itertools::Position::Only, (snippet, _)) => (snippet, 0),
};

let range = match snippet {
Expand Down
6 changes: 3 additions & 3 deletions crates/ide-diagnostics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
either = "1.7.0"
itertools = "0.10.5"
serde_json = "1.0.86"
either.workspace = true
itertools.workspace = true
serde_json.workspace = true
once_cell = "1.17.0"

# local deps
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
itertools = "0.10.5"
itertools.workspace = true
triomphe.workspace = true
nohash-hasher.workspace = true

Expand Down
6 changes: 3 additions & 3 deletions crates/ide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ doctest = false
[dependencies]
cov-mark = "2.0.0-pre.1"
crossbeam-channel = "0.5.5"
either = "1.7.0"
itertools = "0.10.5"
tracing = "0.1.35"
either.workspace = true
itertools.workspace = true
tracing.workspace = true
oorandom = "11.1.3"
pulldown-cmark-to-cmark = "10.0.4"
pulldown-cmark = { version = "0.9.1", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions crates/load-cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ authors.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.62"
anyhow.workspace = true
crossbeam-channel = "0.5.5"
itertools = "0.10.5"
tracing = "0.1.35"
itertools.workspace = true
tracing.workspace = true

ide.workspace = true
ide-db.workspace =true
ide-db.workspace = true
proc-macro-api.workspace = true
project-model.workspace = true
tt.workspace = true
Expand Down
Loading

0 comments on commit 9996697

Please sign in to comment.