Skip to content

Wrong link to rust book in note #54555

Closed
Closed

Description

@hellow554
fn main() {
    let a: str;
}

(Playground)

Errors:

   Compiling playground v0.0.1 (file:///playground)
error[E0277]: the size for values of type `str` cannot be known at compilation time
 --> src/main.rs:2:9
  |
2 |     let a: str;
  |         ^ doesn't have a size known at compile-time
  |
  = help: the trait `std::marker::Sized` is not implemented for `str`
  = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
  = note: all local variables must have a statically known size

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.

The note contains a wrong link

[...]/ch19-04-advanced-types.html#dynamically-sized-types-and-sized

vs

[...]/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait

As easy as this fix could be, I grepped for the error and found ~120 occurences, most of them in the tests of course.
While I want to solve this, I ask myself, if the best strategy is a simple sed or is there a better and not so error-prone approach? If one link changes in the future, all of this has to be done again. I don't think that that is a good solution :(

Activity

  1. steveklabnik commented on Sep 25, 2018

    @steveklabnik
    Contributor
  2. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    C-bugCategory: This is a bug.
    on Sep 26, 2018
  3. Havvy commented on Sep 26, 2018

    @Havvy
    Contributor

    For this specific case, just fixing it with sed is probably a good idea. For future proofing though, perhaps linkcheck could be amended to fix that? Though that's probably non-trivial.

  4. ehuss commented on Sep 27, 2018

    @ehuss
    Contributor

    I'm a little confused. This should have been fixed in #53082, unless you are referring to an older version of rustc?

  5. hellow554 commented on Sep 27, 2018

    @hellow554
    ContributorAuthor

    @ehuss thanks for the hint. It is not in stable rust, but in beta (and nightly).
    I think I haven't updated my git repo (I could swear I did...), so forget about that. In the next stable release, this should be resolved :) thanks for the reference!

  6. Havvy commented on Sep 27, 2018

    @Havvy
    Contributor

    If it's already fixed, there's no reason keeping the issue open.

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

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions