Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong link to rust book in note #54555

Closed
hellow554 opened this issue Sep 25, 2018 · 5 comments
Closed

Wrong link to rust book in note #54555

hellow554 opened this issue Sep 25, 2018 · 5 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug.

Comments

@hellow554
Copy link
Contributor

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

@steveklabnik
Copy link
Member

steveklabnik commented Sep 25, 2018 via email

@Havvy Havvy added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. labels Sep 26, 2018
@Havvy
Copy link
Contributor

Havvy commented Sep 26, 2018

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.

@ehuss
Copy link
Contributor

ehuss commented Sep 27, 2018

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

@hellow554
Copy link
Contributor Author

@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!

@Havvy
Copy link
Contributor

Havvy commented Sep 27, 2018

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

@Havvy Havvy closed this as completed Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants