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

Link rot in error messages #57104

Closed
m-hilgendorf opened this Issue Dec 24, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@m-hilgendorf
Copy link

m-hilgendorf commented Dec 24, 2018

Happy holidays everyone, I know this isn't going to get looked at for a few days and it's probably a clone of an existing issue (couldn't find it)

I noticed today that the compiler has invalid links in its error messages. Example:

struct Foo<B: Bar> {
    bar : B
}

trait Bar {
    fn foo() -> Foo<Self>;
}

Yields the error

error[E0277]: the size for values of type `Self` cannot be known at compilation time                                                                                                                 
  --> src/lib.rs:10:5                                                                                                                                                                                
   |                                                                                                                                                                                                 
10 |     fn foo() -> Foo<Self>;                                                                                                                                                                      
   |     ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time                                                                                                                            
   |                                                                                                                                                                                                 
   = help: the trait `std::marker::Sized` is not implemented for `Self`                                                                                                                              
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>                                              
   = help: consider adding a `where Self: std::marker::Sized` bound      

I love this feature, but that link is incorrect. The correct link is:

https://doc.rust-lang.org/book/ch19-04-advanced-types.html?highlight=dynamical#dynamically-sized-types-and-the--sized--trait.

This is just an example, I'm sure there are other error messages that have the same issue. I'm not certain if it's better fixed in the compiler (who wants to rewrite error messages every time docs.rust-lang.org changes an URL?) or if this should be filed as an issue over at that repository.

@varkor varkor added the T-doc label Dec 24, 2018

@frewsxcv frewsxcv self-assigned this Jan 1, 2019

frewsxcv added a commit to frewsxcv/rust that referenced this issue Jan 1, 2019

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 1, 2019

Opened a PR for this #57249

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jan 3, 2019

Rollup merge of rust-lang#57249 - frewsxcv:frewsxcv-second-edition, r…
…=KodrAus

Fix broken links to second edition TRPL.

Fixes rust-lang#57104.

Remove `second-edition/` from TRPL hyperlinks.

kennytm added a commit to kennytm/rust that referenced this issue Jan 5, 2019

Rollup merge of rust-lang#57249 - frewsxcv:frewsxcv-second-edition, r…
…=KodrAus

Fix broken links to second edition TRPL.

Fixes rust-lang#57104.

Remove `second-edition/` from TRPL hyperlinks.

@bors bors closed this in #57249 Jan 5, 2019

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