Stream: rustdoc

Topic: how does ```ignore work


view this post on Zulip Poliorcetics (Dec 28 2020 at 19:08):

    /// ```ignore (internal compiler representation so lifetime syntax is invalid)
    /// <T as Foo<'0>>::Item: '1
    /// ```

This produces an error, should it ?

view this post on Zulip Poliorcetics (Dec 28 2020 at 19:08):

The error is = note: error from rustc: lifetimes cannot start with a number

view this post on Zulip Joshua Nelson (Dec 28 2020 at 19:09):

https://github.com/rust-lang/rust/issues/30032

view this post on Zulip Joshua Nelson (Dec 28 2020 at 19:10):

I would just use text instead

view this post on Zulip GuillaumeGomez (Dec 31 2020 at 15:03):

But in any case, it is strange that the compiler is still testing it. I don't think we should do that... I'll send a fix for it then.

view this post on Zulip Joshua Nelson (Dec 31 2020 at 15:03):

@GuillaumeGomez that's because we use the compiler for syntax highlighting

view this post on Zulip GuillaumeGomez (Dec 31 2020 at 15:03):

Oh damn

view this post on Zulip Joshua Nelson (Dec 31 2020 at 15:03):

I don't think it will be an easy fix - maybe you could ignore the errors? but it still wouldn't be highlighted as Rust

view this post on Zulip GuillaumeGomez (Dec 31 2020 at 15:03):

no it wouldn't, but we can at least improve the error message

view this post on Zulip GuillaumeGomez (Dec 31 2020 at 15:04):

saying something like: "it needs to be a valid rust code to get syntax highlighting. Consider using the text attribute instead"

view this post on Zulip Joshua Nelson (Dec 31 2020 at 15:04):

I think you mean text attribute, but yeah that seems a lot better

view this post on Zulip GuillaumeGomez (Dec 31 2020 at 15:09):

indeed haha


Last updated: Oct 11 2021 at 22:34 UTC