Skip to content

rust-lang/rust: "file not included in module tree" in libcore, broken go to definition #9203

Closed
@lf-

Description

@lf-

When I open library/core/src/str/converts.rs in my editor, I get a "file not included in module tree" diagnostic and go to definition doesn't work. Also, go to definition on e.g. pub mod ffi in library/core/src/lib.rs does not work. This is unfortunate for working on libcore.

I am using this config from the recommended page:

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--json-output"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
      "./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt"
    ],
    "rust-analyzer.cargo.runBuildScripts": false,
    "rust-analyzer.procMacro.enable": false
}
Log

[INFO rust_analyzer] server version 09e40391b 2021-06-10 dev will start
[INFO rust_analyzer] InitializeParams: {"processId":1303302,"rootPath":"/home/jade/dev/rust","rootUri":"file:///home/jade/dev/rust","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration"
:true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]}
},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"contextSupport":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true,"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]}},"codeAction":{"dynamicRegistration":true,"isPreferredSupport"
:true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"resolveSupport":{"properties":["edit"]}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"declaration":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true},"experimental":{"snippetTextEdit":true,"resolveCodeAction":true,"serverStatusNotification":true}},"initializationOptions":{"enable":true,"terminal":{"startinsert":false},"debug":{"runtime":"termdebug"
,"vimspector":{"configuration":{"name":"launch"}}},"inlayHints":{"enable":true,"typeHintsSeparator":"‣","typeHintsWithVariable":true,"chainingHintsSeparator":"‣","refreshOnInsertMode":false,"chainingHints":true,"maxLength":25,"typeHints":true},"trace":{"server":"off"},"updates":{"prompt":true,"channel":"nightly"},"assist":{"importMergeBehavior":"full","importPrefix":"plain","importGroup":true},"callInfo":{"full":true},"cargo":{"autoreload":true,"allFeatures":false,"features":[],"runBuildScripts":false,"useRustcWrapperForBuildScripts":true,"noDefaultFeatures":false,"noSysroot":false},"checkOnSave":{"enable":true,"allTargets":true,"command":"check","extraArgs":[],"overrideCommand":["./x.py","check","--json-output"]},"completion":{"addCallArgumentSnippets":true,"addCallParenthesis":true,"postfix":{"enable":true},"autoimport":{
"enable":true}},"diagnostics":{"enable":true,"enableExperimental":true,"disabled":["incorrect-ident-case"],"remapPrefix":{},"warningsAsHint":[],"warningsAsInfo":[]},"files":{"watcher":"client","excludeDirs":[]},"hoverActions":{"enable":true,"linksInHover":true},"lens":{"enable":true,"implementations":true,"run":true,"methodReferences":false,"references":false},"linkedProjects":[],"notifications":{"cargoTomlNotFound":true},"procMacro":{"enable":false},"runnables":{"cargoExtraArgs":[]},"rustfmt":{"extraArgs":[],"overrideCommand":["./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt"]},"server":{"extraEnv":{"RA_LOG":"info,salsa::derived::slot=warn,flycheck=trace,rust_analyzer::main_loop=warn,ide_db::apply_change=warn,project_model=debug,proc_macro_api=debug,hir_expand::db=error"},"path":"/home/jade/dev/rust-analyzer/target/release/rust-analyzer"}},"trace":"off","workspaceFolders":[{"uri":"file:///home/jade/.dotfiles","name":"/home/jade"},{"uri":"file:///home/jade/dev/rust","name":"/home/jade/dev"}],"clientInfo":{"name":"coc.nvim","version":"0.0.80"}}

[INFO rust_analyzer::config] updating config from JSON: {
"enable": true,
"terminal": {
"startinsert": false
},
"debug": {
"runtime": "termdebug",
"vimspector": {
"configuration": {
"name": "launch"
}
}
},
"inlayHints": {
"enable": true,
"typeHintsSeparator
": "‣",
"typeHintsWithVariable": true,
"chainingHintsSeparator": "‣",
"refreshOnInsertMode": false,
"chainingHints": true,
"maxLength": 25,
"typeHints": true
},
"trace": {
"server": "off"
},
"updates": {
"prompt": true,
"channel": "nightly"
},
"assist": {
"importMergeBehavior": "full",
"importPrefix": "plain",
"importGroup": true
},
"callInfo": {
"full": true
},
"cargo": {
"autoreload": true,
"allFeatures": false,
"features": [],
"runBuildScripts": false,
"useRustcWrapperForBuildScripts": true,
"noDefaultFeatures": false,
"noSysroot": false
},
"checkOnSave": {
"enable"
: true,
"allTargets": true,
"command": "check",
"extraArgs": [],
"overrideCommand": [
"./x.py",
"check",
"--json-output"
]
},
"completion": {
"addCallArgumentSnippets": true,
"addCallParenthesis": true,
"postfix": {
"enable": true
},
"autoimport": {
"enable": true
}
},
"diagnostics": {
"enable": true,
"enableExperimental": true,
"disabled": [
"incorrect-ident-case"
],
"remapPrefix": {},
"warningsAsHint": [],
"warningsAsInfo": []
},
"files": {
"watcher": "client",
"excludeDirs": []
},
"hoverActions": {
"enable": true,
"linksInHover": true
},
"lens": {
"enable": true,
"implementations": true,
"
run": true,
"methodReferences": false,
"references": false
},
"linkedProjects": [],
"notifications": {
"cargoTomlNotFound": true
},
"procMacro": {
"enable": false
},
"runnables": {
"cargoExtraArgs": []
},
"rustfmt": {
"extraArgs": [],
"overrideCommand": [
"./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt"
]
},
"server": {
"extraEnv": {
"RA_LOG": "info,salsa::derived::slot=warn,flycheck=trace,rust_analyzer::main_loop=warn,ide_db::apply_change=warn,project_model=debug,proc_macro_api=debug,hir_expand::db=error"
},
"path": "/home/jade/dev/rust-analyzer/target/release/rust-analyzer"
}
}
[INFO rust_analyzer] Client 'coc.nvim' 0.0.80
[INFO rust_analyzer] discovered projects: [CargoToml(AbsPathBuf("/home/jade/dev/rust/Cargo.toml"))]
[INFO rust_analyzer::reload] will fetch workspaces
[INFO rust_analyzer::reload] Requesting workspace reload because of the following changes: /home/jade/dev/rust/library/core/src/lib.rs: Create
[INFO rust_analyzer::global_state] handled req#1 in 2.86µs
[DEBUG project_model::cargo_workspace] Discovering cargo config target by "cargo" "-Z" "unstable-options"
[INFO rust_analyzer::global_state] handled req#2 in 2.63µs
[INFO rust_analyzer::global_state] handled req#3 in 2.07µs
[INFO rust_analyzer::global_state] handled req#4 in 480ns
[Error - 5:24:33 a.m.] Request textDocument/codeLens failed.
Message: waiting for cargo metadata or cargo check
Code: -32801
[DEBUG project_model::cargo_workspace] Discovering host platform by "rustc" "-vV"
[Error - 5:24:33 a.m.] Request textDocument/codeLens failed.
Message: waiting for cargo metadata or cargo check
Code: -32801
[INFO rust_analyzer::global_state] handled req#5 in
2.13µs
[DEBUG project_model::sysroot] Discovering sysroot for /home/jade/dev/rust/Cargo.toml
[DEBUG project_model::sysroot] Discovering sysroot by "rustc" "--print" "sysroot"
[DEBUG project_model::sysroot] Checking sysroot (looking for library and src dirs): /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust
[INFO rust_analyzer::reload] did fetch workspaces [
Ok(Cargo { root: Some("rust"), n_packages: 484, n_sysroot_crates: 10, n_rustc_compiler_crates: 0, n_rustc_cfg: 42 })]
[INFO rust_analyzer::reload] will switch workspaces
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.9/examples/deny_missing_docs.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/filters.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/macros.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/test/mod.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/url-2.2.2/benches/parse_url.rs
[ERROR project_model::workspace] cyclic deps: rustc_std_workspace_core(CrateId(1193)) -> core(CrateId(190))
[DEBUG project_model::workspace] Patched std to depend on cfg-if
[INFO rust_analyzer::reload] did switch workspaces
[INFO rust_analyzer::reload] will fetch workspaces
[DEBUG project_model::cargo_workspace] Discovering cargo config target by "cargo" "-Z" "unstable-op
tions" "config" "get" "build.target"
[DEBUG project_model::cargo_workspace] Discovering host platform by "rustc" "-
vV"
[DEBUG project_model::sysroot] Discovering sysroot for /home/jade/dev/rust/Cargo.toml
[DEBUG project_model::sysroot] Discovering sysroot by "rustc" "--print" "sysroot"
[DEBUG project_model::sysroot] Checking sysroot (looking for library and src dirs): /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust
[INFO rust_analyzer::reload] did fetch workspaces [Ok(Cargo { root: Some("rust"
), n_packages: 484, n_sysroot_crates: 10, n_rustc_compiler_crates: 0, n_rustc_cfg: 42 })]
[INFO rust_analyzer::reload] will switch workspaces
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.9/examples/deny_missing_docs.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/filters.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/macros.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/test/mod.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/url-2.2.2/benches/parse_url.rs
[ERROR project_model::workspace] cyclic deps: rustc_std_workspace_core(CrateId(1193)) -> core(CrateId(190))
[DEBUG project_model::workspace] Patched std to depend on cfg-if
[INFO rust_analyzer::reload] did switch workspaces
[INFO rust_analyzer::global_state] handled req#6 in 487.479543ms
[INFO rust_analyzer::reload] will fetch workspaces
[DEBUG project_model::cargo_workspace] Discovering cargo config target by "cargo" "-Z" "unstable-options" "con
fig" "get" "build.target"
[DEBUG project_model::cargo_workspace] Discovering host platform by "rustc" "-vV"
[DEBUG project_model::sysroot] Discovering sysroot for /home/jade/dev/rust/Cargo.toml
[DEBUG project_model::sysroot] Discovering sysroot by "rustc" "--print" "sysroot"
[DEBUG project_model::sysroot] Checking sysroot (looking for library and src dirs): /home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust
[INFO rust_analyzer::reload] did fetch workspaces [Ok(Cargo
{ root: Some("rust"), n_packages: 484, n_sysroot_crates: 10, n_rustc_compiler_crates: 0, n_rustc_cfg: 42 })]
[INFO rust_analyzer::reload] will switch workspaces

[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.9/examples/deny_missing_docs.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/filters.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/tests/macros.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.22/test/mod.rs
[WARN rust_analyzer::reload] failed to load /home/jade/.cargo/registry/src/github.com-1ecc6299db9ec823/url-2.2.2/benches/parse_url.rs
[ERROR project_model::workspace] cyclic deps: rustc_std_workspace_core(CrateId(1193)) -> core(CrateId(190))
[DEBUG project_model::workspace] Patched std to depend on cfg-if
[INFO rust_analyzer::reload] did switch workspaces
[INFO flycheck] restart flycheck "./x.py" "check" "--json-output"
in "/home/jade/dev/rust"
[INFO rust_analyzer::global_state] handled req#7 in 361.658µs

cc #8915

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions