-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Panic on use of libraries with proc-macro examples #13726
Comments
The linked repository is 404. Is it perhaps private? What is the output you are seeing? |
Fixed! |
@rustbot label A-features2 A-crate-types |
Reproduced on master. @rustbot label +Command-check, +S-needs-mentor, -S-triage |
Here's a minimal test case: use cargo_test_support::project;
#[cargo_test]
fn issue_13726() {
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "application"
edition = "2021"
[dependencies]
library = { path = "library" }
"#,
)
.file("src/main.rs", "fn main() {}")
.file(
"library/Cargo.toml",
r#"
[package]
name = "library"
[[example]]
name = "foo"
proc-macro = true
crate-type = ["proc-macro"]
"#,
)
.file("library/src/lib.rs", "")
.file("library/examples/foo.rs", "")
.build();
p.cargo("check").run();
} |
Thanks for the minimal test case. I went ahead and edited it a bit. According to The Cargo Book, only Anyway, the updated version aligns to the original reproduction from the issue author, and they have the same bad behavior. |
Hmm… I am seeing odd behavior. Maybe we should add both |
Problem
Cargo is panicking on valid examples targets.
Minimised example is here
Discovered in the wild when using @CraftSpider 's chumsky-proc
Steps
git clone git@github.com:OliverKillane/bug-reports.git cd bug-reports/cargo-proc-macro-examples/application/ cargo check
Possible Solution(s)
No response
Notes
Similar error to #10593 but different cause.
Version
The text was updated successfully, but these errors were encountered: