failed to parse manifest – no targets specified

As the error says:

either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present

So the direct answer is to add a [[bin]] section:

[[bin]]
name = "test"
path = "src/test.rs"

However, it’s far more usual to just place the file in the expected location: src/main.rs. You could also place it in src/bin/test.rs if you plan on having multiple binaries.

If it’s actually for testing your code, then unit tests go in the same file as the code they are testing and integration tests go in tests/foo.rs.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)