Open
Description
When you have a trait implementation for a type inside a module (i.e. not crate root), for some types the Run Doctest lens at the top of doctests for trait methods fails to run any test.
It seems that affected types are primitive types (str, u32, char...) and types with non-alphanumerical characters in them (&T
, (T, T)
, [T; N]
...).
Curiously enough, the issue only seems to encounter within modules; when the trait implementation is moved to the crate root, Run Doctest does its job just fine regardless of the type used (as far as I could tell).
Example:
mod hi {
pub trait Trait {
fn foo();
}
impl Trait for char {
/// ```rust
/// assert_eq!(1 + 1, 2);
/// ```
fn foo() {}
}
}
The issue seems to be that the type name is, for some reason, dropped from the path passed to --package
.