Skip to content

Can't find crate for test error #10716

Closed
Closed
@caemor

Description

@caemor

It seems to be a new error or I always manually compiled with the specific target but rust analyzer outputs that it can't find crate for test with the target set to a the target seen below (and maybe to others as well?). For each bin, lib.rs or main.rs it outputs the exact same message once.

Reduced example:
Create new rust project with cargo new SomeName and then modify the following files:
.cargo/config.toml:

[build]
target = "thumbv7em-none-eabihf"

main.rs:

#![no_std]
fn main() {}

Rust Analyzer: v0.2.801

Copied Error Message:

{
	"resource": "/tmp/rustanalyzertest/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "E0463",
		"target": {
			"$mid": 1,
			"external": "https://doc.rust-lang.org/error-index.html#E0463",
			"path": "/error-index.html",
			"scheme": "https",
			"authority": "doc.rust-lang.org",
			"fragment": "E0463"
		}
	},
	"severity": 8,
	"message": "can't find crate for `test`\ncan't find crate",
	"source": "rustc",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions