| author | bors <bors@rust-lang.org> 2025-12-13 10:11:41 UTC |
| committer | bors <bors@rust-lang.org> 2025-12-13 10:11:41 UTC |
| log | eb171a227f9e5de5d376b6edb56b174bc8235fb3 |
| tree | ec18d0e33aa5efed7861c819706a33608c46c594 |
| parent | ce63e5d9ea20f15a70c6fdc4d4de7aee352fd965 |
| parent | 15e49699cab6d00fe626bff14c32e90860b99d21 |
Run main rust-analyzer tests in rust-lang/rust CI
Part of rust-lang/rust#147370.
MCP: https://github.com/rust-lang/compiler-team/issues/923
This PR prepares `rust-analyzer` crates with `in-rust-tree` cargo featues where needed, and and updates bootstrap to run the main `rust-analyzer` tests in rust-lang/rust CI, not just the `proc-macro-srv` crate tests.
This supersedes the earlier attempt at https://github.com/rust-lang/rust/pull/136779. I was honestly expecting more failures in this PR, but looking back at the previous attempt, that makes sense because we no longer run `i686-mingw` (32-bit windows-gnu) which had a _bunch_ of these failures. In the earlier attempt I also disabled the `i686-mingw`-related failures for `i686-msvc` since I didn't feel like digging into 32-bit msvc at the time. Try results from this PR shows that it's most likely limited to 32-bit windows-gnu specifically.
### `rust-analyzer` test remarks
- I actually had to _remove_ the `CARGO_WORKSPACE_DIR` `expect-test`-hack in order for `expect-test` to be able to find the test expectation HTML files (for `syntax_highlighting` tests in `ide`). When I added the hack, ironically, it made `expect-test` unable to find the expectation files. I think this was because previously the path was of the `proc-macro-srv` crate specifically, now we point to the root r-a workspace?
- The `cfg`-related differences on `aarch64-apple-darwin` might've been fixed? I can't tell, but we don't seem to be observing the differences now.
- I'm not sure why `config::{generate_config_documentation, generate_package_json_config}` no longer fails. Perhaps they were fixed to no longer try to write to source directory?
### Review remarks
- Commit 1 updates r-a crates that are involved in tests needing artifacts from `rustc_private` compiler crates to use the `in-rust-tree` cargo feature. I briefly tried to use a plain `--cfg=in_rust_tree`, but quickly realized it was very hacky, and needed invasive bootstrap changes. The cargo feature approach seems most "natural"/well-supported to both bootstrap and cargo.
- Commit 2 updates bootstrap to not only run the `proc-macro-srv` tests, but the whole r-a tests.
- Commit 3 restricts r-a main tests to non-32-bit targets we test in CI, since (1) r-a repo does not run tests against 32-bit platforms, and (2) there are some target pointer width sensitive hash differences causing tests to fail. Notably, this means that we also no longer run r-a `proc-macro-srv` tests against 32-bit targets, but we don't expect that crate to be have target pointer width differences. Discussed this in [#t-compiler/rust-analyzer > 32-bit tests?](https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/32-bit.20tests.3F/with/563145736).
---
// try-job: aarch64-gnu
// try-job: aarch64-apple
// try-job: x86_64-mingw-1
// try-job: i686-msvc-1
// try-job: x86_64-msvc-1
// try-job: aarch64-msvc-131 files changed, 179 insertions(+), 18 deletions(-)
src/bootstrap/src/core/build_steps/test.rs+53-15| ... | ... | @@ -465,35 +465,73 @@ impl Step for RustAnalyzer { |
| 465 | 465 | |
| 466 | 466 | /// Runs `cargo test` for rust-analyzer |
| 467 | 467 | fn run(self, builder: &Builder<'_>) { |
| 468 | let host = self.compilers.target(); | |
| 468 | let build_compiler = self.compilers.build_compiler(); | |
| 469 | let target = self.compilers.target(); | |
| 470 | ||
| 471 | // NOTE: rust-analyzer repo currently (as of 2025-12-11) does not run tests against 32-bit | |
| 472 | // targets, so we also don't run them in rust-lang/rust CI (because that will just mean that | |
| 473 | // subtree syncs will keep getting 32-bit-specific failures that are not observed in | |
| 474 | // rust-analyzer repo CI). | |
| 475 | // | |
| 476 | // Some 32-bit specific failures include e.g. target pointer width specific hashes. | |
| 477 | ||
| 478 | // FIXME: eventually, we should probably reduce the amount of target tuple substring | |
| 479 | // matching in bootstrap. | |
| 480 | if target.starts_with("i686") { | |
| 481 | return; | |
| 482 | } | |
| 469 | 483 | |
| 470 | let workspace_path = "src/tools/rust-analyzer"; | |
| 471 | // until the whole RA test suite runs on `i686`, we only run | |
| 472 | // `proc-macro-srv` tests | |
| 473 | let crate_path = "src/tools/rust-analyzer/crates/proc-macro-srv"; | |
| 474 | 484 | let mut cargo = tool::prepare_tool_cargo( |
| 475 | 485 | builder, |
| 476 | self.compilers.build_compiler(), | |
| 486 | build_compiler, | |
| 477 | 487 | Mode::ToolRustcPrivate, |
| 478 | host, | |
| 488 | target, | |
| 479 | 489 | Kind::Test, |
| 480 | crate_path, | |
| 490 | "src/tools/rust-analyzer", | |
| 481 | 491 | SourceType::InTree, |
| 482 | 492 | &["in-rust-tree".to_owned()], |
| 483 | 493 | ); |
| 484 | 494 | cargo.allow_features(tool::RustAnalyzer::ALLOW_FEATURES); |
| 485 | 495 | |
| 486 | let dir = builder.src.join(workspace_path); | |
| 487 | // needed by rust-analyzer to find its own text fixtures, cf. | |
| 488 | // https://github.com/rust-analyzer/expect-test/issues/33 | |
| 489 | cargo.env("CARGO_WORKSPACE_DIR", &dir); | |
| 496 | // N.B. it turns out _setting_ `CARGO_WORKSPACE_DIR` actually somehow breaks `expect-test`, | |
| 497 | // even though previously we actually needed to set that hack to allow `expect-test` to | |
| 498 | // correctly discover the r-a workspace instead of the outer r-l/r workspace. | |
| 490 | 499 | |
| 491 | // RA's test suite tries to write to the source directory, that can't | |
| 492 | // work in Rust CI | |
| 500 | // FIXME: RA's test suite tries to write to the source directory, that can't work in Rust CI | |
| 501 | // without properly wiring up the writable test dir. | |
| 493 | 502 | cargo.env("SKIP_SLOW_TESTS", "1"); |
| 494 | 503 | |
| 504 | // NOTE: we need to skip `src/tools/rust-analyzer/xtask` as they seem to exercise rustup / | |
| 505 | // stable rustfmt. | |
| 506 | // | |
| 507 | // NOTE: you can only skip a specific workspace package via `--exclude=...` if you *also* | |
| 508 | // specify `--workspace`. | |
| 509 | cargo.arg("--workspace"); | |
| 510 | cargo.arg("--exclude=xtask"); | |
| 511 | ||
| 512 | let mut skip_tests = vec![]; | |
| 513 | ||
| 514 | // NOTE: the following test skips is a bit cheeky in that it assumes there are no | |
| 515 | // identically named tests across different r-a packages, where we want to run the | |
| 516 | // identically named test in one package but not another. If we want to support that use | |
| 517 | // case, we'd have to run the r-a tests in two batches (with one excluding the package that | |
| 518 | // we *don't* want to run the test for, and the other batch including). | |
| 519 | ||
| 520 | // Across all platforms. | |
| 521 | skip_tests.extend_from_slice(&[ | |
| 522 | // FIXME: this test wants to find a `rustc`. We need to provide it with a path to staged | |
| 523 | // in-tree `rustc`, but setting `RUSTC` env var requires some reworking of bootstrap. | |
| 524 | "tests::smoke_test_real_sysroot_cargo", | |
| 525 | // NOTE: part of `smol-str` test suite; this tries to access a stable rustfmt from the | |
| 526 | // environment, which is not something we want to do. | |
| 527 | "check_code_formatting", | |
| 528 | ]); | |
| 529 | ||
| 530 | let skip_tests = skip_tests.iter().map(|name| format!("--skip={name}")).collect::<Vec<_>>(); | |
| 531 | let skip_tests = skip_tests.iter().map(|s| s.as_str()).collect::<Vec<_>>(); | |
| 532 | ||
| 495 | 533 | cargo.add_rustc_lib_path(builder); |
| 496 | run_cargo_test(cargo, &[], &[], "rust-analyzer", host, builder); | |
| 534 | run_cargo_test(cargo, skip_tests.as_slice(), &[], "rust-analyzer", target, builder); | |
| 497 | 535 | } |
| 498 | 536 | |
| 499 | 537 | fn metadata(&self) -> Option<StepMetadata> { |
src/tools/rust-analyzer/crates/base-db/Cargo.toml+4| ... | ... | @@ -31,5 +31,9 @@ vfs.workspace = true |
| 31 | 31 | span.workspace = true |
| 32 | 32 | intern.workspace = true |
| 33 | 33 | |
| 34 | [features] | |
| 35 | default = [] | |
| 36 | in-rust-tree = [] | |
| 37 | ||
| 34 | 38 | [lints] |
| 35 | 39 | workspace = true |
src/tools/rust-analyzer/crates/base-db/src/lib.rs+5| ... | ... | @@ -1,5 +1,10 @@ |
| 1 | 1 | //! base_db defines basic database traits. The concrete DB is defined by ide. |
| 2 | 2 | |
| 3 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 4 | ||
| 5 | #[cfg(feature = "in-rust-tree")] | |
| 6 | extern crate rustc_driver as _; | |
| 7 | ||
| 3 | 8 | pub use salsa; |
| 4 | 9 | pub use salsa_macros; |
| 5 | 10 |
src/tools/rust-analyzer/crates/cfg/Cargo.toml+4| ... | ... | @@ -33,5 +33,9 @@ syntax.workspace = true |
| 33 | 33 | # tt is needed for testing |
| 34 | 34 | cfg = { path = ".", default-features = false, features = ["tt"] } |
| 35 | 35 | |
| 36 | [features] | |
| 37 | default = [] | |
| 38 | in-rust-tree = [] | |
| 39 | ||
| 36 | 40 | [lints] |
| 37 | 41 | workspace = true |
src/tools/rust-analyzer/crates/cfg/src/lib.rs+5| ... | ... | @@ -1,5 +1,10 @@ |
| 1 | 1 | //! cfg defines conditional compiling options, `cfg` attribute parser and evaluator |
| 2 | 2 | |
| 3 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 4 | ||
| 5 | #[cfg(feature = "in-rust-tree")] | |
| 6 | extern crate rustc_driver as _; | |
| 7 | ||
| 3 | 8 | mod cfg_expr; |
| 4 | 9 | mod dnf; |
| 5 | 10 | #[cfg(test)] |
src/tools/rust-analyzer/crates/ide-completion/Cargo.toml+4| ... | ... | @@ -37,5 +37,9 @@ expect-test = "1.5.1" |
| 37 | 37 | test-utils.workspace = true |
| 38 | 38 | test-fixture.workspace = true |
| 39 | 39 | |
| 40 | [features] | |
| 41 | default = [] | |
| 42 | in-rust-tree = [] | |
| 43 | ||
| 40 | 44 | [lints] |
| 41 | 45 | workspace = true |
src/tools/rust-analyzer/crates/ide-completion/src/lib.rs+5| ... | ... | @@ -3,6 +3,11 @@ |
| 3 | 3 | // It's useful to refer to code that is private in doc comments. |
| 4 | 4 | #![allow(rustdoc::private_intra_doc_links)] |
| 5 | 5 | |
| 6 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 7 | ||
| 8 | #[cfg(feature = "in-rust-tree")] | |
| 9 | extern crate rustc_driver as _; | |
| 10 | ||
| 6 | 11 | mod completions; |
| 7 | 12 | mod config; |
| 8 | 13 | mod context; |
src/tools/rust-analyzer/crates/ide-db/Cargo.toml+4| ... | ... | @@ -52,5 +52,9 @@ line-index.workspace = true |
| 52 | 52 | [dev-dependencies] |
| 53 | 53 | expect-test = "1.5.1" |
| 54 | 54 | |
| 55 | [features] | |
| 56 | default = [] | |
| 57 | in-rust-tree = [] | |
| 58 | ||
| 55 | 59 | [lints] |
| 56 | 60 | workspace = true |
src/tools/rust-analyzer/crates/ide-db/src/lib.rs+5| ... | ... | @@ -2,6 +2,11 @@ |
| 2 | 2 | //! |
| 3 | 3 | //! It is mainly a `HirDatabase` for semantic analysis, plus a `SymbolsDatabase`, for fuzzy search. |
| 4 | 4 | |
| 5 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 6 | ||
| 7 | #[cfg(feature = "in-rust-tree")] | |
| 8 | extern crate rustc_driver as _; | |
| 9 | ||
| 5 | 10 | extern crate self as ide_db; |
| 6 | 11 | |
| 7 | 12 | mod apply_change; |
src/tools/rust-analyzer/crates/ide-diagnostics/Cargo.toml+4| ... | ... | @@ -34,5 +34,9 @@ expect-test = "1.5.1" |
| 34 | 34 | test-utils.workspace = true |
| 35 | 35 | test-fixture.workspace = true |
| 36 | 36 | |
| 37 | [features] | |
| 38 | default = [] | |
| 39 | in-rust-tree = [] | |
| 40 | ||
| 37 | 41 | [lints] |
| 38 | 42 | workspace = true |
src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs+5| ... | ... | @@ -23,6 +23,11 @@ |
| 23 | 23 | //! There are also a couple of ad-hoc diagnostics implemented directly here, we |
| 24 | 24 | //! don't yet have a great pattern for how to do them properly. |
| 25 | 25 | |
| 26 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 27 | ||
| 28 | #[cfg(feature = "in-rust-tree")] | |
| 29 | extern crate rustc_driver as _; | |
| 30 | ||
| 26 | 31 | mod handlers { |
| 27 | 32 | pub(crate) mod await_outside_of_async; |
| 28 | 33 | pub(crate) mod bad_rtn; |
src/tools/rust-analyzer/crates/ide-ssr/Cargo.toml+4| ... | ... | @@ -30,5 +30,9 @@ triomphe.workspace = true |
| 30 | 30 | test-utils.workspace = true |
| 31 | 31 | test-fixture.workspace = true |
| 32 | 32 | |
| 33 | [features] | |
| 34 | default = [] | |
| 35 | in-rust-tree = [] | |
| 36 | ||
| 33 | 37 | [lints] |
| 34 | 38 | workspace = true |
src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs+5| ... | ... | @@ -63,6 +63,11 @@ |
| 63 | 63 | // // foo($a, $b) ==>> ($a).foo($b) |
| 64 | 64 | // ``` |
| 65 | 65 | |
| 66 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 67 | ||
| 68 | #[cfg(feature = "in-rust-tree")] | |
| 69 | extern crate rustc_driver as _; | |
| 70 | ||
| 66 | 71 | mod fragments; |
| 67 | 72 | mod from_comment; |
| 68 | 73 | mod matching; |
src/tools/rust-analyzer/crates/load-cargo/src/lib.rs+6| ... | ... | @@ -2,6 +2,12 @@ |
| 2 | 2 | //! for incorporating changes. |
| 3 | 3 | // Note, don't remove any public api from this. This API is consumed by external tools |
| 4 | 4 | // to run rust-analyzer as a library. |
| 5 | ||
| 6 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 7 | ||
| 8 | #[cfg(feature = "in-rust-tree")] | |
| 9 | extern crate rustc_driver as _; | |
| 10 | ||
| 5 | 11 | use std::{any::Any, collections::hash_map::Entry, mem, path::Path, sync}; |
| 6 | 12 | |
| 7 | 13 | use crossbeam_channel::{Receiver, unbounded}; |
src/tools/rust-analyzer/crates/parser/src/lib.rs+2| ... | ... | @@ -25,6 +25,8 @@ |
| 25 | 25 | extern crate ra_ap_rustc_lexer as rustc_lexer; |
| 26 | 26 | #[cfg(feature = "in-rust-tree")] |
| 27 | 27 | extern crate rustc_lexer; |
| 28 | #[cfg(feature = "in-rust-tree")] | |
| 29 | extern crate rustc_driver as _; | |
| 28 | 30 | |
| 29 | 31 | mod event; |
| 30 | 32 | mod frontmatter; |
src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml+2| ... | ... | @@ -34,6 +34,8 @@ semver.workspace = true |
| 34 | 34 | |
| 35 | 35 | [features] |
| 36 | 36 | sysroot-abi = ["proc-macro-srv", "proc-macro-srv/sysroot-abi"] |
| 37 | default = [] | |
| 38 | in-rust-tree = [] | |
| 37 | 39 | |
| 38 | 40 | [lints] |
| 39 | 41 | workspace = true |
src/tools/rust-analyzer/crates/proc-macro-api/src/lib.rs+5| ... | ... | @@ -12,6 +12,11 @@ |
| 12 | 12 | )] |
| 13 | 13 | #![allow(internal_features)] |
| 14 | 14 | |
| 15 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 16 | ||
| 17 | #[cfg(feature = "in-rust-tree")] | |
| 18 | extern crate rustc_driver as _; | |
| 19 | ||
| 15 | 20 | mod codec; |
| 16 | 21 | mod framing; |
| 17 | 22 | pub mod legacy_protocol; |
src/tools/rust-analyzer/crates/project-model/Cargo.toml+4| ... | ... | @@ -39,5 +39,9 @@ toolchain.workspace = true |
| 39 | 39 | [dev-dependencies] |
| 40 | 40 | expect-test = "1.5.1" |
| 41 | 41 | |
| 42 | [features] | |
| 43 | default = [] | |
| 44 | in-rust-tree = [] | |
| 45 | ||
| 42 | 46 | [lints] |
| 43 | 47 | workspace = true |
src/tools/rust-analyzer/crates/project-model/src/lib.rs+5| ... | ... | @@ -18,6 +18,11 @@ |
| 18 | 18 | // It's useful to refer to code that is private in doc comments. |
| 19 | 19 | #![allow(rustdoc::private_intra_doc_links)] |
| 20 | 20 | |
| 21 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 22 | ||
| 23 | #[cfg(feature = "in-rust-tree")] | |
| 24 | extern crate rustc_driver as _; | |
| 25 | ||
| 21 | 26 | pub mod project_json; |
| 22 | 27 | pub mod toolchain_info { |
| 23 | 28 | pub mod rustc_cfg; |
src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml+7-3| ... | ... | @@ -98,12 +98,16 @@ syntax-bridge.workspace = true |
| 98 | 98 | jemalloc = ["jemallocator", "profile/jemalloc"] |
| 99 | 99 | force-always-assert = ["stdx/force-always-assert"] |
| 100 | 100 | in-rust-tree = [ |
| 101 | "syntax/in-rust-tree", | |
| 102 | "parser/in-rust-tree", | |
| 103 | "hir/in-rust-tree", | |
| 101 | "cfg/in-rust-tree", | |
| 104 | 102 | "hir-def/in-rust-tree", |
| 105 | 103 | "hir-ty/in-rust-tree", |
| 104 | "hir/in-rust-tree", | |
| 105 | "ide-ssr/in-rust-tree", | |
| 106 | "ide/in-rust-tree", | |
| 106 | 107 | "load-cargo/in-rust-tree", |
| 108 | "parser/in-rust-tree", | |
| 109 | "proc-macro-api/in-rust-tree", | |
| 110 | "syntax/in-rust-tree", | |
| 107 | 111 | ] |
| 108 | 112 | dhat = ["dep:dhat"] |
| 109 | 113 |
src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs+5| ... | ... | @@ -9,6 +9,11 @@ |
| 9 | 9 | //! The `cli` submodule implements some batch-processing analysis, primarily as |
| 10 | 10 | //! a debugging aid. |
| 11 | 11 | |
| 12 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 13 | ||
| 14 | #[cfg(feature = "in-rust-tree")] | |
| 15 | extern crate rustc_driver as _; | |
| 16 | ||
| 12 | 17 | extern crate ra_ap_rustc_type_ir as rustc_type_ir; |
| 13 | 18 | |
| 14 | 19 | /// Any toolchain less than this version will likely not work with rust-analyzer built from this revision. |
src/tools/rust-analyzer/crates/rust-analyzer/tests/slow-tests/main.rs+4| ... | ... | @@ -9,6 +9,10 @@ |
| 9 | 9 | //! be sure without a real client anyway. |
| 10 | 10 | |
| 11 | 11 | #![allow(clippy::disallowed_types)] |
| 12 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 13 | ||
| 14 | #[cfg(feature = "in-rust-tree")] | |
| 15 | extern crate rustc_driver as _; | |
| 12 | 16 | |
| 13 | 17 | mod cli; |
| 14 | 18 | mod ratoml; |
src/tools/rust-analyzer/crates/span/Cargo.toml+1| ... | ... | @@ -27,6 +27,7 @@ syntax.workspace = true |
| 27 | 27 | |
| 28 | 28 | [features] |
| 29 | 29 | default = ["salsa"] |
| 30 | in-rust-tree = [] | |
| 30 | 31 | |
| 31 | 32 | [lints] |
| 32 | 33 | workspace = true |
src/tools/rust-analyzer/crates/span/src/lib.rs+6| ... | ... | @@ -1,4 +1,10 @@ |
| 1 | 1 | //! File and span related types. |
| 2 | ||
| 3 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 4 | ||
| 5 | #[cfg(feature = "in-rust-tree")] | |
| 6 | extern crate rustc_driver as _; | |
| 7 | ||
| 2 | 8 | use std::fmt::{self, Write}; |
| 3 | 9 | |
| 4 | 10 | mod ast_id; |
src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs+5| ... | ... | @@ -1,5 +1,10 @@ |
| 1 | 1 | //! Conversions between [`SyntaxNode`] and [`tt::TokenTree`]. |
| 2 | 2 | |
| 3 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 4 | ||
| 5 | #[cfg(feature = "in-rust-tree")] | |
| 6 | extern crate rustc_driver as _; | |
| 7 | ||
| 3 | 8 | use std::{collections::VecDeque, fmt, hash::Hash}; |
| 4 | 9 | |
| 5 | 10 | use intern::Symbol; |
src/tools/rust-analyzer/crates/syntax/Cargo.toml+1| ... | ... | @@ -33,6 +33,7 @@ rustc_apfloat = "0.2.3" |
| 33 | 33 | test-utils.workspace = true |
| 34 | 34 | |
| 35 | 35 | [features] |
| 36 | default = [] | |
| 36 | 37 | in-rust-tree = [] |
| 37 | 38 | |
| 38 | 39 | [lints] |
src/tools/rust-analyzer/crates/syntax/src/lib.rs+5| ... | ... | @@ -19,6 +19,11 @@ |
| 19 | 19 | //! [RFC]: <https://github.com/rust-lang/rfcs/pull/2256> |
| 20 | 20 | //! [Swift]: <https://github.com/apple/swift/blob/13d593df6f359d0cb2fc81cfaac273297c539455/lib/Syntax/README.md> |
| 21 | 21 | |
| 22 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 23 | ||
| 24 | #[cfg(feature = "in-rust-tree")] | |
| 25 | extern crate rustc_driver as _; | |
| 26 | ||
| 22 | 27 | mod parsing; |
| 23 | 28 | mod ptr; |
| 24 | 29 | mod syntax_error; |
src/tools/rust-analyzer/crates/test-fixture/Cargo.toml+4| ... | ... | @@ -21,5 +21,9 @@ intern.workspace = true |
| 21 | 21 | triomphe.workspace = true |
| 22 | 22 | paths.workspace = true |
| 23 | 23 | |
| 24 | [features] | |
| 25 | default = [] | |
| 26 | in-rust-tree = [] | |
| 27 | ||
| 24 | 28 | [lints] |
| 25 | 29 | workspace = true |
src/tools/rust-analyzer/crates/test-fixture/src/lib.rs+6| ... | ... | @@ -1,4 +1,10 @@ |
| 1 | 1 | //! A set of high-level utility fixture methods to use in tests. |
| 2 | ||
| 3 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] | |
| 4 | ||
| 5 | #[cfg(feature = "in-rust-tree")] | |
| 6 | extern crate rustc_driver as _; | |
| 7 | ||
| 2 | 8 | use std::{any::TypeId, mem, str::FromStr, sync}; |
| 3 | 9 | |
| 4 | 10 | use base_db::target::TargetData; |
src/tools/rust-analyzer/crates/tt/Cargo.toml+1| ... | ... | @@ -21,6 +21,7 @@ intern.workspace = true |
| 21 | 21 | ra-ap-rustc_lexer.workspace = true |
| 22 | 22 | |
| 23 | 23 | [features] |
| 24 | default = [] | |
| 24 | 25 | in-rust-tree = [] |
| 25 | 26 | |
| 26 | 27 | [lints] |
src/tools/rust-analyzer/crates/tt/src/lib.rs+3| ... | ... | @@ -5,6 +5,9 @@ |
| 5 | 5 | |
| 6 | 6 | #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] |
| 7 | 7 | |
| 8 | #[cfg(feature = "in-rust-tree")] | |
| 9 | extern crate rustc_driver as _; | |
| 10 | ||
| 8 | 11 | #[cfg(not(feature = "in-rust-tree"))] |
| 9 | 12 | extern crate ra_ap_rustc_lexer as rustc_lexer; |
| 10 | 13 | #[cfg(feature = "in-rust-tree")] |