Skip to content

doc-tests don't work with macros 1.1 #39064

Closed
@colin-kiegel

Description

It looks like having proc-macro = true in Cargo.toml disables all doc-tests. However unit tests #[test] work fine.

Steps to reproduce

  1. cargo new foo

  2. edit Cargo.toml

# ... the usual
[lib]
proc-macro = true
  1. edit src/lib.rs
//! ```rust
//! fn main() { panic!() } /* <-- this test should fail */
//! ```

#![crate_type = "proc-macro"]
extern crate proc_macro;

#[proc_macro_derive(Foo)]
pub fn derive(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
    unimplemented!()
}
  1. cargo test
running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

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