Why is rustdoc so slow? I feel like it wasn't that slow 'before'. (I don't have a cutoff, but I built docs for projects like these before, and it did not take half an hour lmao)

Sure it was 800 crates (Most of which are crates I don't build, so I assume they are crates for other platforms) but 25 minutes ?? And most of it seemingly single-threaded? On a 12-core processor!

This is on rustdoc 1.91.0

#rustdoc #rustlang #rust

@imperio I’ve been struggling with the new search UI on docs.rs. My brain keeps hunting for a text box to type in, so I end up clicking the global search bar instead of the crate icon every time.

It's especially confusing seeing the old vs new UI on different crates. Is there a reason we moved away from the persistent bar? I'd be happy to file an issue/PR to improve the icon's visibility!

#rustdoc #rust

@hcsch @CyReVolt I'd add `Self::method` is a type address, while `self.method()` is a instance address.

#Rustdoc documents types, not instances.

Edit: TIL how to reference another method in #Rustdoc. It was not intuitive!

https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html

I thought I could do this:
[`self.calc_new_offset(min_offset)`]

However, that is not turned into a link.

I had a look at the std lib docs to find an example; https://doc.rust-lang.org/src/core/bool.rs.html#72

So this is what I gotta do:
Use [`calc_new_offset`] in my description, and then later, declare what it is supposed to be:
[`calc_new_offset`]: Directory::calc_new_offset

Linking to items by name - The rustdoc book

Fixed yet another reexport bug in rustdoc:

mod raw {
pub struct Foo;
}

pub use raw::Foo;
pub use raw::*;

In this code, Foo was imported twice and the second one overwrote the first, making docs and attributes nonsensical.

Fixed in https://github.com/rust-lang/rust/pull/143590.

#rust #rustdoc

Fix weird rustdoc output when single and glob reexport conflict on a name by GuillaumeGomez · Pull Request #143590 · rust-lang/rust

Fixes #143107. The problem was that the second reexport would overwrite the first, leading to having unexpected results. To fix it, I now group items by their original DefId and their name and keep...

GitHub

[Перевод] Rust 1.88.0: Цепочки let, naked-функции, булевы литералы в cfg и очистка кеша cargo

Команда Rust рада сообщить о новой версии языка — 1.88.0. Rust — это язык программирования, позволяющий каждому создавать надёжное и эффективное программное обеспечение. Если у вас есть предыдущая версия Rust, установленная через rustup , то для обновления до версии 1.88.0 вам достаточно выполнить команду: $ rustup update stable Если у вас ещё не установлен rustup , вы можете установить его с соответствующей страницы нашего веб-сайта, а также посмотреть подробные примечания к выпуску на GitHub. Если вы хотите помочь нам протестировать будущие выпуски, вы можете использовать канал beta ( rustup default beta ) или nightly ( rustup default nightly ). Пожалуйста, сообщайте обо всех встреченных вами ошибках.

https://habr.com/ru/articles/922762/

#clippy #cargo #rustc #rustdoc #rustfmt #rustfix #release #stable #языки_программирования #стабильная_версия #выпуск_версий #системное_программирование #новости_технологий #перевод

Rust 1.88.0: Цепочки let, naked-функции, булевы литералы в cfg и очистка кеша cargo

Команда Rust рада сообщить о новой версии языка — 1.88.0. Rust — это язык программирования, позволяющий каждому создавать надёжное и эффективное программное обеспечение. Если у вас есть предыдущая...

Хабр

[Перевод] Rust 1.87.0: 10 лет Rust, анонимные каналы, безопасный вызов встроенных интринсиков

Rust 1.87.0 и 10 лет Rust! Команда Rust празднует 10-летие Rust в Утрехте, Нидерланды, и рада сообщить о новой версии языка — 1.87.0! Сегодняшний день релиза выпал на 10-летний юбилей выхода Rust 1.0 ! Спасибо мириадам участников, кто работал или работает над Rust. Выпьем за ещё многие десятилетия впереди! 🎉 Как обычно, новая версия включает в себя все изменения, которые были внесены в бета-версию за последние шесть недель согласно последовательному и регулярному циклу выпуска. Мы следуем ему начиная с Rust 1.0. Если у вас есть предыдущая версия Rust, установленная через rustup , то для обновления до версии 1.87.0 вам достаточно выполнить команду:

https://habr.com/ru/articles/910204/

#clippy #cargo #rustc #rustdoc #rustfmt #rustfix #release #stable #языки_программирования #стабильная_версия #выпуск_версий #системное_программирование #новости_технологий #перевод

Rust 1.87.0: 10 лет Rust, анонимные каналы, безопасный вызов встроенных интринсиков

Rust 1.87.0 и 10 лет Rust! Команда Rust празднует 10-летие Rust в Утрехте, Нидерланды, и рада сообщить о новой версии языка — 1.87.0! Сегодняшний день релиза выпал на 10-летний юбилей выхода Rust 1.0...

Хабр

Most annoying thing about #rustdoc: when you look up the impl of a standard #RustLang trait on a particular concrete type, and it just repeats the documentation from the trait itself.

1. I wanted to know how the trait's functionality is interpreted for _this type_. E.g. don't just tell me `Add` implements the addition operator – tell me what addition _means_ for this particular type. Or if the trait docs say "you can do X or Y", I want to know which option this type chose, and maybe why.

2. Trait docs often include advice to the trait implementor, and in this context, that advice is going to the wrong person. E.g. the docs for PartialEq::ne() say it's a mistake to override the default implementation without a really good reason. This is useful advice if I'm implementing PartialEq on my own type. But when I look up the impl of PartialEq on someone else's type, _I_ don't need to be told what the crate author ought not to have done!

In fact rustdoc doesn't even tell me _whether_ the crate author _did_ override ne() (without providing a replacement doc comment), or whether they left the default in place. So it's not just nagging the wrong person – it's nagging the wrong person about a thing that very likely didn't even happen!

In principle, crate authors could fix #1 by being less lazy, and writing custom docs for their impls. But fixing #2 is really hard. If I want to delete that nagging comment about PartialEq::ne(), I have to do it by overriding the default implementation – exactly what the comment tells me not to do!

[Перевод] Rust 1.86.0: преобразование в родительский трейт, поддержка изменяемой индексации для HashMap и срезов

Команда Rust рада сообщить о новой версии языка — 1.86.0. Rust — это язык программирования, позволяющий каждому создавать надёжное и эффективное программное обеспечение. Если у вас есть предыдущая версия Rust, установленная через rustup , то для обновления до версии 1.86.0 вам достаточно выполнить команду: $ rustup update stable Если у вас ещё не установлен rustup , вы можете установить его с соответствующей страницы нашего веб-сайта, а также посмотреть подробные примечания к выпуску на GitHub. Если вы хотите помочь нам протестировать будущие выпуски, вы можете использовать канал beta ( rustup default beta ) или nightly ( rustup default nightly ). Пожалуйста, сообщайте обо всех встреченных вами ошибках.

https://habr.com/ru/articles/898008/

#clippy #cargo #rustc #rustdoc #rustfmt #rustfix #release #stable #языки_программирования #стабильная_версия #выпуск_версий #системное_программирование #новости_технологий #перевод

Rust 1.86.0: преобразование в родительский трейт, поддержка изменяемой индексации для HashMap и срезов

Команда Rust рада сообщить о новой версии языка — 1.86.0. Rust — это язык программирования, позволяющий каждому создавать надёжное и эффективное программное обеспечение. Если у вас есть предыдущая...

Хабр

With #rustup, we can view the #Rust #documentation  in our browser   which is very helpful.

The docs are located at "${HOME}/.rustup/toolchains/"${ToolChain}/share/doc/rust/html/"

If your browser can't access that location (for instance due to confinement rules), you can spin up a quick http server

  🌐 python3 -m http.server --directory "${HOME}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/" 9005

Or, you could spin up an NGINX server block, if you're so inclined.

Here's mine running in #Firefox  on #KUbuntu   (#ubuntu  )

#rustlang #rustdoc