Skip to content

Wrong link to rust book in note #54555

Closed
Closed
@hellow554

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 :(

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