Skip to content

Why are doc comments parsed as raw string? #771

Closed
@magurotuna

Description

@magurotuna

Hi. I have a question.

https://github.com/dtolnay/syn/blob/master/src/attr.rs#L119-L150
The above code tells me that doc comments like /// foobar are transformed into #[doc = r"foobar"].

However, The Rust Reference says:

/// Foo turns into #[doc="Foo"] and /** Bar */ turns into #[doc="Bar"].

Why does this crate parse doc comments as raw string, unlike the rust compiler?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions