Skip to content

[1.38] Regression: expected one of !, ., ::, ;, ?, {, }, or an operator, found is #63890

Closed
@petrochenkov

Description

@petrochenkov
Contributor

#63628 (comment)

expected one of !, ., ::, ;, ?, {, }, or an operator, found is

./reg/google-games1/1.0.10+20190627/beta-2019-08-13.txt:[INFO] [stdout] error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `is`

Minimized reproduction, run with rustdoc --test (all the whitespace is important!):

/// #
///
///     ident ident
fn f() {}

Apparently something makes this comment look like code to rustdoc, so it tries to doctest it.

Actually, stable rustdoc also gives an error for this, from what I tried locally, not sure why it passed on crater.
cc @rust-lang/rustdoc

@shepmaster explains what happens in #63628 (comment).

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Aug 25, 2019
added this to the 1.38 milestone on Aug 30, 2019
GuillaumeGomez

GuillaumeGomez commented on Aug 30, 2019

@GuillaumeGomez
Member

It's not a bug, it's markdown, litterally. Like @shepmaster wrote, it's considered as a code block.

Aloso

Aloso commented on Aug 31, 2019

@Aloso
Contributor

@GuillaumeGomez it's a code block, but it's not a doctest, it might not even be Rust syntax.

Doctests can only be written with the

```
```

syntax.

GuillaumeGomez

GuillaumeGomez commented on Sep 2, 2019

@GuillaumeGomez
Member

No:

/// # Foo
///
///     let x = 12;
///
/// indeed
///
/// ``````
/// println!("foo");
/// ``````
pub fn foo() {}

Running with rustdoc --test, I had two tests.

Mark-Simulacrum

Mark-Simulacrum commented on Sep 19, 2019

@Mark-Simulacrum
Member

Closing as won't fix / expected breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @GuillaumeGomez@Mark-Simulacrum@petrochenkov@Aloso

        Issue actions

          [1.38] Regression: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `is` · Issue #63890 · rust-lang/rust