Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode extension fails to include! .rs file #18886

Closed
bragov4ik opened this issue Jan 8, 2025 · 15 comments · Fixed by #18949
Closed

VSCode extension fails to include! .rs file #18886

bragov4ik opened this issue Jan 8, 2025 · 15 comments · Fixed by #18949
Assignees
Labels
C-bug Category: bug

Comments

@bragov4ik
Copy link

rust-analyzer version: rust-analyzer version: 0.3.2257-standalone (238ccb628b 2025-01-08)

rustc version: rustc 1.83.0 (90b35a623 2024-11-26)

editor or extension: VSCode (version 0.3.2257)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

.vscode/settings.json:

{
    "rust-analyzer.rustfmt.extraArgs": [
        "--config",
        "imports_granularity=Crate"
    ],
    "rust-analyzer.trace.server": "verbose",
    "rust-analyzer.server.extraEnv": {
        "RA_LOG": "debug"
    },
}

global vscode settings:

   "rust-analyzer.rustfmt.extraArgs": [
        "--config",
        "imports_granularity=Preserve"
    ],
    "rust-analyzer.files.excludeDirs": [
        "service-template/"
    ],
    "rust-analyzer.typing.autoClosingAngleBrackets.enable": true,
    "rust-analyzer.trace.extension": true,

repository link (if public, optional): https://github.com/blockscout/blockscout-rs/tree/main/stats

code snippet to reproduce:
(./stats-proto/src/lib.rs)

include!(concat!(env!("OUT_DIR"), "/blockscout.stats.v1.rs"));

Hi. So I've encountered a strange problem where in vscode I get a rust-analyzer error

failed to load file `/Users/bragov4ik/Documents/rust/blockscout-rs/stats/target/debug/build/stats-proto-890c1c1ea60f0111/out/blockscout.stats.v1.rs`rust-analyzer[macro-error](https://rust-analyzer.github.io/manual.html#macro-error)

also autocomplete, hints, and all that stuff doesn't work on the include!ed code.

but the file exists:

❯ ls /Users/bragov4ik/Documents/rust/blockscout-rs/stats/target/debug/build/stats-proto-890c1c1ea60f0111/out/blockscout.stats.v1.rs
/Users/bragov4ik/Documents/rust/blockscout-rs/stats/target/debug/build/stats-proto-890c1c1ea60f0111/out/blockscout.stats.v1.rs

cargo check/build work flawelessly,
and manual rust-analyzer diagnostics seems to work without any issues:

command output

note that /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-proto/src/lib.rs is processed
without errors

❯ ./rust-analyzer-aarch64-apple-darwin diagnostics ~/Documents/rust/blockscout-rs/stats
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/main.rs
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/lib.rs
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/m20240719_133448_add_resolution_column.rs
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/m20240416_090545_add_updated_at_column.rs
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/m20230814_105206_drop_zero_timestamp.rs
processing crate: migration, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/migration/src/m20220101_000001_init.rs
processing crate: entity, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/entity/src/lib.rs
processing crate: entity, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/entity/src/sea_orm_active_enums.rs
processing crate: entity, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/entity/src/charts.rs
processing crate: entity, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/entity/src/chart_data.rs
processing crate: entity, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/entity/src/prelude.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/main.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/swagger.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/indexing_status.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/mod.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/transactions_page.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/main_page.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/lines.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/counters.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/chart_endpoints/contracts_page.rs
processing crate: it, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/tests/it/common.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 40, col: 0 } to LineCol { line: 58, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/main.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/lib.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/update_service.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/settings.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 243, col: 0 } to LineCol { line: 352, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/server.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/serializers.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/runtime_setup.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/read_service.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/health.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/mod.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/types.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/read/mod.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/read/update_groups.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/read/merge.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 191, col: 0 } to LineCol { line: 480, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/read/layout.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/read/charts.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/json/mod.rs
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/json/update_groups.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 10, col: 0 } to LineCol { line: 56, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/json/layout.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 10, col: 0 } to LineCol { line: 50, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/json/charts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 23, col: 0 } to LineCol { line: 82, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/env/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 13, col: 0 } to LineCol { line: 54, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/env/update_groups.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 11, col: 0 } to LineCol { line: 40, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/env/layout.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 19, col: 0 } to LineCol { line: 132, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/config/env/charts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 116, col: 0 } to LineCol { line: 319, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats_server, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-server/src/blockscout_waiter.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 110, col: 0 } to LineCol { line: 291, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: build_script_build, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-proto/build.rs
processing crate: stats_proto, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats-proto/src/lib.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 9, col: 0 } to LineCol { line: 10, col: 10 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/lib.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/tests/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 4, col: 0 } to LineCol { line: 4, col: 27 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/tests/simple_test.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/tests/recorder.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/tests/mock_blockscout.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 657, col: 0 } to LineCol { line: 691, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/tests/init_db.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/utils.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 75, col: 0 } to LineCol { line: 200, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/update_groups.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/update_group.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 528, col: 0 } to LineCol { line: 571, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/range.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 311, col: 0 } to LineCol { line: 509, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/missing_date.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 236, col: 0 } to LineCol { line: 853, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/metrics.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 66, col: 0 } to LineCol { line: 67, col: 10 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/types.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 272, col: 0 } to LineCol { line: 306, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/source.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 297, col: 0 } to LineCol { line: 319, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/remote_db/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/remote_db/query/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/remote_db/query/one.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 142, col: 0 } to LineCol { line: 219, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/remote_db/query/each.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 108, col: 0 } to LineCol { line: 191, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/remote_db/query/all.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 300, col: 0 } to LineCol { line: 519, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
WeakWarning Ra("remove-unnecessary-else", WeakWarning) from LineCol { line: 156, col: 14 } to LineCol { line: 156, col: 18 }: remove unnecessary else block
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/point.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/batching/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 274, col: 0 } to LineCol { line: 548, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/batching/parameters/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/batching/parameters/mock.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/batching/parameters/cumulative.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/update/batching/parameter_traits.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/query.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 129, col: 0 } to LineCol { line: 209, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameters/create.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/local_db/parameter_traits.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/sum_point.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/resolutions/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 72, col: 0 } to LineCol { line: 169, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/resolutions/sum.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 97, col: 0 } to LineCol { line: 162, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/resolutions/last_value.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 77, col: 0 } to LineCol { line: 142, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/resolutions/average.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 137, col: 0 } to LineCol { line: 368, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/map/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/map/unwrap_or.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/map/to_string.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/map/strip_extension.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/map/parse.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/last_point.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/filter_deducible.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 80, col: 0 } to LineCol { line: 201, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/data_manipulation/delta.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/auxiliary/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_source/kinds/auxiliary/cumulative.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/data_processing.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 140, col: 0 } to LineCol { line: 432, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/traits.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/timespans/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/timespans/year.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 164, col: 0 } to LineCol { line: 361, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/timespans/week.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 184, col: 0 } to LineCol { line: 257, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/timespans/month.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 118, col: 0 } to LineCol { line: 308, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/timespans/day.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/extended.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/duration.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/types/db.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/query_dispatch.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 28, col: 0 } to LineCol { line: 29, col: 9 }: code is inactive due to #[cfg] directives: test is disabled
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 120, col: 0 } to LineCol { line: 121, col: 85 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/verified_contracts_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 66, col: 0 } to LineCol { line: 114, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/txns_success_rate.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 137, col: 0 } to LineCol { line: 201, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/txns_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 65, col: 0 } to LineCol { line: 130, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/txns_fee.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 159, col: 0 } to LineCol { line: 227, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/operational_txns_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 70, col: 0 } to LineCol { line: 97, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_verified_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 105, col: 0 } to LineCol { line: 153, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_txns_window.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 106, col: 0 } to LineCol { line: 197, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 125, col: 0 } to LineCol { line: 211, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_operational_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 113, col: 0 } to LineCol { line: 140, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_native_coin_transfers.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 135, col: 0 } to LineCol { line: 197, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_native_coin_holders.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 72, col: 0 } to LineCol { line: 120, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 167, col: 0 } to LineCol { line: 251, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_blocks.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 101, col: 0 } to LineCol { line: 435, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_block_rewards.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 90, col: 0 } to LineCol { line: 168, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/new_accounts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 176, col: 0 } to LineCol { line: 246, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/native_coin_supply.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 143, col: 0 } to LineCol { line: 191, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/native_coin_holders_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 406, col: 0 } to LineCol { line: 455, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/gas_used_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 125, col: 0 } to LineCol { line: 204, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/contracts_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 64, col: 0 } to LineCol { line: 126, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/average_txn_fee.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 164, col: 0 } to LineCol { line: 232, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/average_gas_price.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 161, col: 0 } to LineCol { line: 229, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/average_gas_limit.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 106, col: 0 } to LineCol { line: 171, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/average_block_size.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 111, col: 0 } to LineCol { line: 179, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/average_block_rewards.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 119, col: 0 } to LineCol { line: 184, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/active_recurring_accounts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 238, col: 0 } to LineCol { line: 418, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/active_accounts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 92, col: 0 } to LineCol { line: 116, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/lines/accounts_growth.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 67, col: 0 } to LineCol { line: 116, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/db_interaction/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/db_interaction/write.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/db_interaction/utils.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/db_interaction/read.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 667, col: 0 } to LineCol { line: 1359, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/mod.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 20, col: 0 } to LineCol { line: 21, col: 9 }: code is inactive due to #[cfg] directives: test is disabled
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 46, col: 0 } to LineCol { line: 47, col: 26 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/yesterday_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 71, col: 0 } to LineCol { line: 92, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/txns_stats_24h/mod.rs
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/txns_stats_24h/txns_fee_24h.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 55, col: 0 } to LineCol { line: 87, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/txns_stats_24h/new_txns_24h.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 50, col: 0 } to LineCol { line: 83, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/txns_stats_24h/average_txn_fee_24h.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 57, col: 0 } to LineCol { line: 94, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_verified_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 60, col: 0 } to LineCol { line: 71, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 108, col: 0 } to LineCol { line: 124, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_tokens.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 60, col: 0 } to LineCol { line: 70, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_operational_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 67, col: 0 } to LineCol { line: 79, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_native_coin_transfers.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 34, col: 0 } to LineCol { line: 49, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_native_coin_holders.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 34, col: 0 } to LineCol { line: 49, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 69, col: 0 } to LineCol { line: 79, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_blocks.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 101, col: 0 } to LineCol { line: 224, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_addresses.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 87, col: 0 } to LineCol { line: 103, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/total_accounts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 34, col: 0 } to LineCol { line: 44, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/pending_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 89, col: 0 } to LineCol { line: 104, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/new_verified_contracts_24h.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 62, col: 0 } to LineCol { line: 77, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/new_contracts_24h.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 65, col: 0 } to LineCol { line: 80, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/last_new_verified_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 31, col: 0 } to LineCol { line: 68, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/last_new_contracts.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 31, col: 0 } to LineCol { line: 63, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/completed_txns.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 96, col: 0 } to LineCol { line: 111, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/counters/average_block_time.rs
WeakWarning Ra("inactive-code", WeakWarning) from LineCol { line: 138, col: 0 } to LineCol { line: 232, col: 1 }: code is inactive due to #[cfg] directives: test is disabled
processing crate: stats, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/stats/src/charts/chart.rs
processing crate: env_docs_generation, module: /Users/bragov4ik/Documents/rust/blockscout-rs/stats/env-docs-generation/src/main.rs

diagnostic scan complete

I've followed some troubleshooting steps. Enabled debug log level for the extension (as seen in settings.json) and turned on LSP logs in vscode. I haven't found more details apart from the failed... message. Anyway, I commented out the line and brought it back, to get all logs related to this. Here are the logs/traces for this issue.

  • After only changing the line w/o file save (the line is already underlined in red after this)
  • After saving file (to trigger CheckOnSave, as I've seen some notice about flycheck being unimplemented and to use the checkonsave stuff)

Also the include! was parsed perfectly before, providing hints/completions and other stuff. Therefore, I'm not sure how to make a MRE for this. I can provide more debug details if needed, the issue persists for some time in the project for me.

I've also tried cargo clean, restarting vscode, reloading rust analyzer. It doesn't help.

@bragov4ik bragov4ik added the C-bug Category: bug label Jan 8, 2025
@andrewbanchich
Copy link
Contributor

i'm running into the same issue on Zed, so not specific to VSCode.

@alibektas
Copy link
Member

@andrewbanchich Do you maybe have a minimal repro? The other repo seems to be too large and has lots of external dependencies, I couldn't really compile it.

@andrewbanchich
Copy link
Contributor

Nothing I can share, sorry.

@Sigurthorb
Copy link

I don't have a minimal repo either but we are using prost_build crate in build.rs and trying to include the generated rust file from OUT_DIR

@alibektas
Copy link
Member

Bisecting shows that the responsible commit is 096e3e5

@Veykril
Copy link
Member

Veykril commented Jan 9, 2025

Ah you did the bisecting for me thanks :) Was planning on looking into this #18748, and my hunch seems to have been right then for the cause

@Veykril
Copy link
Member

Veykril commented Jan 9, 2025

I assume our deduplication logic for overlapping source roots is failing and my changes surfaced that, we probably just want to undo the changes from m #18668 for now (except for the is_virtual_workspace fetching, that will come in handy in the future)

@lnicola

This comment has been minimized.

@Veykril

This comment has been minimized.

@bragov4ik
Copy link
Author

bragov4ik commented Jan 10, 2025

I managed to reproduce the issue in a very small example:
https://github.com/bragov4ik/rust-analyzer-issue-repro-attempt

not sure if it's going to reproduce on other machines, but it works on mine 👀

failed to load file `/Users/bragov4ik/Documents/rust/rust-analyzer-repro/target/debug/build/rust-analyzer-repro-a3beedc68185c7f4/out/cool_codegen.rs`

@kanekv
Copy link

kanekv commented Jan 13, 2025

Experiencing same issue in vs code on mac os. Using tonic/prost.

@Sigurthorb
Copy link

Tried reverting the commit locally to unblock development in my local environment but there were some conflicts so I'll leave it to someone who knows the code better to post a PR for this. I built the previous commit locally using the following commands in my local rust-analyzer repo:

git checkout 096e3e55e34b493e26d06f798294a24e6ec77b75
git reset --hard HEAD~1
cargo xtask install --server

@kanekv
Copy link

kanekv commented Jan 13, 2025

Downgrading vs code extension fixes the issue

@zegonix
Copy link

zegonix commented Jan 16, 2025

i experience the same/a familiar issue with protobuf (prost). i find it a little odd though, that sometimes it works fine and on the next restart of vim the issue is back again..

is there fix in sight?

@Veykril
Copy link
Member

Veykril commented Jan 16, 2025

Ah sorry, I'll haven't gotten to rolling back the aforementioned PR I'll do that later today (in hopes it will fix the issue for most here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants