profile
viewpoint
Guillaume Gomez GuillaumeGomez @huawei Paris https://blog.guillaume-gomez.fr Opensource lover. Rustdoc team leader, member of the Rust dev-tools, documentation and docs.rs teams, GNOME foundation member.

gtk-rs/gtk4-rs 1292

Rust bindings of GTK 4

georust/geos 85

Rust bindings for GEOS

gtk-rs/gtk-test 30

Testing GTK UI

gtk-rs/sourceview 21

sourceview binding for Rust

gtk-rs/examples4 15

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!

gtk-rs/gdk4 9

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!

gtk-rs/pangocairo 9

DEPRECATED, use https://github.com/gtk-rs/gtk-rs-core repository instead!

gtk-rs/webkit2gtk-webextension-rs 8

[UNMAINTAINED] WebKit2GTK+ Web Extensions bindings and wrappers for Rust

gtk-rs/atk 7

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!

gtk-rs/gsk4 7

DEPRECATED, use https://github.com/gtk-rs/gtk4-rs repository instead!

delete branch GuillaumeGomez/rust

delete branch : rm-unneeded-buffer-creations

delete time in 7 hours

delete branch GuillaumeGomez/rust

delete branch : rollup-toh0gpo

delete time in 7 hours

pull request commentrust-lang/rust

Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour

Improved documentation and fixed the one I missed.

GuillaumeGomez

comment created time in 8 hours

push eventGuillaumeGomez/rust

Guillaume Gomez

commit sha 44b13658857441fa8879e43f5e28f15a221f2b8e

Add chapter for re-exports in the rustdoc book

view details

push time in 8 hours

Pull request review commentrust-lang/rust

Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour

+# Re-exports++Let's start by explaining what are re-exports. To do so, we will use an example where we are+writing a library (named `lib`) with some types dispatched in sub-modules:++```rust+pub mod sub_module1 {+    pub struct Foo;+}+pub mod sub_module2 {+    pub struct AnotherFoo;+}+```++Users can import them like this:++```rust,ignore (inline)+use lib::sub_module1::Foo;+use lib::sub_module2::AnotherFoo;+```++But what if you want the types to be available directly at the crate root or if we don't want the+modules to be visible for users? That's where re-exports come in:++```rust,ignore (inline)+// `sub_module1` and `sub_module2` are not visible outside.+mod sub_module1 {+    pub struct Foo;+}+mod sub_module2 {+    pub struct AnotherFoo;+}+// We re-export both types:+pub use crate::sub_module1::Foo;+pub use crate::sub_module2::AnotherFoo;+```++And now users will be able to do:++```rust,ignore (inline)+use lib::{Foo, AnotherFoo};+```++And since both `sub_module1` and `sub_module2` are private, users won't be able to import them.++Now what's interesting is that the generated documentation for this crate will show both `Foo` and+`AnotherFoo` directly at the crate root, meaning they have been inlined. There are a few rules to+know whether or not a re-exported item will be inlined.++## Inlining rules++If a public item comes from a private module, it will be inlined:++```rust,ignore (inline)+mod private_module {+    pub struct Public;+}+pub mod public_mod {+    // `Public` will inlined here since `private_module` is private.+    pub use super::private_module::Public;+}+// `Public` will not be inlined here since `public_mod` is public.+pub use self::public_mod::Public;+```++Likewise, if an item inherits `#[doc(hidden)]` from any of its ancestors, it will be inlined:++```rust,ignore (inline)+#[doc(hidden)]+pub mod public_mod {+    pub struct Public;+}+// `Public` be inlined since its parent (`public_mod`) has `#[doc(hidden)]`.+pub use self::public_mod::Public;+```++If an item has `#[doc(hidden)]`, it won't be inlined (nor visible in the generated documentation):++```rust,ignore (inline)+// This struct won't be visible.+#[doc(hidden)]+pub struct Hidden;++// This re-export won't be visible.+pub use self::Hidden as InlinedHidden;+```++The same applies on re-exports themselves: if you have multiple re-exports and some of them have+`#[doc(hidden)]`, then these ones (and only these) own't appear in the documentation:++```rust,ignore (inline)+mod private_mod {+    /// First+    pub struct InPrivate;+}++/// Second+#[doc(hidden)]+pub use self::private_mod::InPrivate as Hidden;+/// Third+pub use self::Hidden as Visible;+```++In this case, `InPrivate` will be inlined as `Visible`. However, its documentation will be+`First Third` and not `First Second Third` because the re-export with `Second` as documentation has+`#[doc(hidden)]`, therefore, all its attributes are ignored.++## Inlining with `#[doc(inline)]`++You can use the `#[doc(inline)]` attribute if you want to force an item to be inlined:++```rust,ignore (inline)+pub mod public_mod {+    pub struct Public;+}+#[doc(inline)]+pub use self::public_mod::Public;+```++With this code, even though `public_mod::Public` is public and present in the documentation, the+`Public` type will be present both at the crate root and in the `public_mod` module.++## Preventing inlining with `#[doc(no_inline)]`++On the opposite of the `#[doc(inline)]` attribute, if you want to prevent an item from being+inlined, you can use `#[doc(no_inline)]`:++```rust,ignore (inline)+mod private_mod {+    pub struct Public;+}+#[doc(no_inline)]+pub use self::private_mod::Public;+```++In the generated documentation, you will see a re-export at the crate root and not the type+directly.++## Attributes

I actually think it's important to talk about "attribute inheritance". I think it can be simplified a lot though.

GuillaumeGomez

comment created time in 8 hours

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour

 Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere. One special case: In Rust 2018 and later, if you `pub use` one of your dependencies, `rustdoc` will not eagerly inline it as a module unless you add `#[doc(inline)]`. +If you want to know more about inlining rules, take a look at the+[`re-exports` chapter](./re-exports.md).+ ### `hidden`  <span id="dochidden"></span>  Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless the `strip-hidden` pass is removed. +For name-based imports (such as `use module::Item as ModuleItem`), hiding an item acts the same as+making it private. For glob-based imports (such as `use module::*`), hidden items are not inlined.

Arf, missed that one.

GuillaumeGomez

comment created time in 8 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Rollup of 6 pull requests

@bors r+ rollup=never p=7

GuillaumeGomez

comment created time in 12 hours

create barnchGuillaumeGomez/rust

branch : rollup-toh0gpo

created branch time in 12 hours

PR opened rust-lang/rust

Rollup of 6 pull requests

Successful merges:

  • #112243 (Remove unneeded Buffer allocations when &mut fmt::Write can be used directly)
  • #112263 (Remove ExtendElement, ExtendWith, extend_with)
  • #112291 (Disable RustAnalyzer check by default, run Rustfmt check before)
  • #112299 (Don't double-print status messages in GHA)
  • #112311 (Ignore fluent message reordering in git blame)
  • #112315 (fix spelling error)

Failed merges:

  • #112251 (rustdoc: convert if let Some() that always matches to variable)

r? @ghost @rustbot modify labels: rollup <!-- homu-ignore:start --> Create a similar rollup <!-- homu-ignore:end -->

+39 -57

0 comment

11 changed files

pr created time in 12 hours

push eventGuillaumeGomez/rust

Luca Scherzer

commit sha e30c52d428a2e4347244fd382f956ab04c100d6c

fix spelling error

view details

Guillaume Gomez

commit sha 7c363c22a26e947071e0c7288ae418f056b995eb

Rollup merge of #112315 - lucascherzer:master, r=Nilstrieb fix spelling error "rexport" is not valid spelling: https://www.merriam-webster.com/dictionary/re-export

view details

push time in 12 hours

push eventGuillaumeGomez/rust

Grisha Vartanyan

commit sha dd2bd03d0a9c3950d19ecc8e907c5b150e27e0ce

Remove ExtendWith and ExtendElement

view details

Guillaume Gomez

commit sha 200d03acad67cc76c9d103ce0c0b36f2e1880384

Rollup merge of #112263 - GrishaVar:remove-extend-element, r=scottmcm Remove ExtendElement, ExtendWith, extend_with Related to #104624, broken up into two commits. The first removes wrapper trait ExtendWith and its only implementer struct ExtendElement. The second may have perf issues so may be reverted/removed if no alternate fix is found; it should be profiled. r? `@scottmcm`

view details

push time in 12 hours

push eventGuillaumeGomez/rust

clubby789

commit sha 679f29aa73704c5e5bb9acdd7671fc85571e7393

Ignore fluent message reordering in `git blame`

view details

Guillaume Gomez

commit sha 714ab6dc37f0c399f2ee6a7fa55bea3560689483

Rollup merge of #112311 - clubby789:blame-ignore-fluent-reorder, r=Nilstrieb Ignore fluent message reordering in `git blame` This commit reordered most of our Fluent message files. Since `git blame` can be useful in tracking mistakes made while adapting to translatable diagnostics, ignore this commit in `blame`. r? `@jyn514`

view details

push time in 12 hours

push eventGuillaumeGomez/rust

jyn

commit sha af4e6c19377eca3f862bd2d7483c30831e998886

Don't double-print status messages in GHA Before: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ``` After: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ```

view details

Guillaume Gomez

commit sha 154949dacdf4d34c967c3aeddcf0cdc27878ad59

Rollup merge of #112299 - jyn514:gha-progress, r=oli-obk Don't double-print status messages in GHA Before: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ``` After: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ``` r? `@oli-obk`

view details

push time in 12 hours

push eventGuillaumeGomez/rust

Matthew Esposito

commit sha 1835d0333be220fc23d8b290298838dff5549cad

Make RustAnalyzer check off by default

view details

Matthew Esposito

commit sha 7ed7e208abd9f807b96226eb47545f81bc4c9156

Run Rustfmt before RustAnalyzer

view details

Guillaume Gomez

commit sha 0258a16cdc917e379898c8b0e5765e5cf209994e

Rollup merge of #112291 - sigaloid:master, r=clubby789 Disable RustAnalyzer check by default, run Rustfmt check before Fixes #112287.

view details

push time in 12 hours

push eventGuillaumeGomez/rust

Guillaume Gomez

commit sha 5c77a0d7a7543addab9ca5c4c32c330fb8620e83

Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly

view details

Guillaume Gomez

commit sha 48c46f275b6431966edf243965b027aaf0f4e09d

Move write! arguments directly into the string

view details

Guillaume Gomez

commit sha aabffef06d80ab2ff877e794f4d237148af1dc11

Rollup merge of #112243 - GuillaumeGomez:rm-unneeded-buffer-creations, r=notriddle Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly With the recent changes, `wrap_item` can now directly take `&mut Write`, which makes some `Buffer` creations unneeded. r? `@notriddle`

view details

push time in 12 hours

push eventGuillaumeGomez/gtk3-rs

Mițca Dumitru

commit sha 79bf90fa98697403d9d94b17ee68c5f594ba1f0a

examples: Adapt to glib-build-tools breaking change

view details

Guillaume Gomez

commit sha f4ce86179858b010e84559f21fe940b97ea7984a

Update gir submodules

view details

Guillaume Gomez

commit sha c91adc2f2252927f06fcf0d0a8af47647d349fb9

regen

view details

Guillaume Gomez

commit sha d647534cc334cdc0ac424f190ef9c2af104a04c9

Update to last glib version

view details

Guillaume Gomez

commit sha fa742f5ba4ca6bf815144df0b970282c7e841de5

Add new manual types

view details

Guillaume Gomez

commit sha 65276d637415f1efa621254e3fad98e53ba450bc

Merge pull request #799 from GuillaumeGomez/regen Regenerate with latest gir

view details

Sebastian Dröge

commit sha 13ac53e32939eef2353c29ef5cb3c1577af9d8da

Merge pull request #798 from RealKC/build-tools-patch examples: Adapt to glib-build-tools breaking change

view details

Sebastian Dröge

commit sha e4f8b1bcd305e0c55e113adfb207e9b3400a0958

Update gir

view details

Sebastian Dröge

commit sha a92cab63f3c6d52fb6e4e0c28e171af1270b0078

Update gir-files

view details

Sebastian Dröge

commit sha f2cea73783d24fa2dbf91614afdfc4c8952ae559

Regenerate with latest gir / gir-files

view details

Sebastian Dröge

commit sha f7f09f636fcf61ab8cdb217c9efc14323fbe5840

Use `Object::new()` without parameters or the builders

view details

Sebastian Dröge

commit sha bfb71c6a9414b6f14ec43d6e4c7f2b28d4cca05a

gtk: Allow `clippy::new_without_default` for the builders

view details

Sebastian Dröge

commit sha dc793bde79cd30989e3f870205601d939e66ff3f

ci: Only run clippy on stable with fatal errors

view details

Sebastian Dröge

commit sha 6f27d77327e5cf4fedb801f1874e1190e4c9cd47

Merge pull request #802 from sdroege/update-gir Update gir

view details

Ignacio Casal Quinteiro

commit sha 5d8b8952709b7596e40677ebe25253af3a01d314

Add ToggleButton subclass

view details

Ignacio Casal Quinteiro

commit sha 83457761c615b2e127a641b5fdc79c9db818ae77

Add subclass implementation for MenuButton This way it will be possible to subclass a MenuButton

view details

Guillaume Gomez

commit sha 4d40ac29e48d2eab589f84c1228b8b277a592ec9

Merge pull request #804 from nacho/nacho/toggle_button Allow subclassing ToggleButton and MenuButton

view details

Guillaume Gomez

commit sha e9db20abf2b3764beea60a7cffe9c80cee46af55

Update wayland-client version to 0.30

view details

Guillaume Gomez

commit sha 662327351f91d04583d973a4ecde5a46606847ce

Make gdk::Device, gdk::Monitor and gdk::Seat non-final types

view details

Guillaume Gomez

commit sha 08c7dc752d1d890be49fd5200266e1668a80c4d5

Update gir submodules

view details

push time in 12 hours

pull request commentrust-lang/rust

Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly

I moved the arguments directly into the string in the lines I updated. Thanks for the suggestion!

GuillaumeGomez

comment created time in 13 hours

push eventGuillaumeGomez/rust

Guillaume Gomez

commit sha 48c46f275b6431966edf243965b027aaf0f4e09d

Move write! arguments directly into the string

view details

push time in 13 hours

Pull request review commentrust-lang/rust

Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly

 fn item_proc_macro(     it: &clean::Item,     m: &clean::ProcMacro, ) {-    let mut buffer = Buffer::new();-    wrap_item(&mut buffer, |buffer| {+    wrap_item(w, |buffer| {         let name = it.name.expect("proc-macros always have names");         match m.kind {             MacroKind::Bang => {-                write!(buffer, "{}!() {{ /* proc-macro */ }}", name);+                write!(buffer, "{}!() {{ /* proc-macro */ }}", name).unwrap();             }             MacroKind::Attr => {-                write!(buffer, "#[{}]", name);+                write!(buffer, "#[{}]", name).unwrap();             }             MacroKind::Derive => {-                write!(buffer, "#[derive({})]", name);+                write!(buffer, "#[derive({})]", name).unwrap();                 if !m.helpers.is_empty() {-                    buffer.push_str("\n{\n");-                    buffer.push_str("    // Attributes available to this derive:\n");+                    buffer.write_str("\n{\n    // Attributes available to this derive:\n").unwrap();                     for attr in &m.helpers {-                        writeln!(buffer, "    #[{}]", attr);+                        writeln!(buffer, "    #[{}]", attr).unwrap();

:+1:

GuillaumeGomez

comment created time in 13 hours

PullRequestReviewEvent

PR opened rust-lang/rust-clippy

Move `borrow_as_ptr` lint in the `suspicious` category

Fixes https://github.com/rust-lang/rust-clippy/issues/10872.

This lint should warn by default as it actually allows to uncover potentially problematic reference to pointer conversions. To do so, I moved it into the suspicious category. I also used this opportunity to extend its tests.

+114 -76

0 comment

17 changed files

pr created time in 13 hours

create barnchGuillaumeGomez/rust-clippy

branch : move-borrow-as-ptr-in-suspicious

created branch time in 13 hours

issue commentrust-lang/rust

Beta rustc warns on missing documentation for an extern crate even though the docstring is not used by rustdoc

Thanks for opening the issue! We have a few items where the documentation is ignored. I think for the current case, the best would be to not warn as a first step. Then we should maybe discuss whether or not we want to display documentation for these items and also how. It was suggested some time ago to create pages to list such items (by grouping them). To be discussed.

elinorbgr

comment created time in 14 hours

delete branch GuillaumeGomez/geos

delete branch : update

delete time in 15 hours

push eventgeorust/geos

Guillaume Gomez

commit sha 310f6f8735f6014d13afaa05a97a05cc2344d825

Update crate version to 8.3.0

view details

Guillaume Gomez

commit sha 907fdfbba2ccd9af5a245996b5cc44fe3af273d7

Merge pull request #135 from GuillaumeGomez/update Update crate version to 8.3.0

view details

push time in 15 hours

PR merged georust/geos

Update crate version to 8.3.0
+1 -1

0 comment

1 changed file

GuillaumeGomez

pr closed time in 15 hours

PR opened georust/geos

Update crate version to 8.3.0
+1 -1

0 comment

1 changed file

pr created time in 15 hours

create barnchGuillaumeGomez/geos

branch : update

created branch time in 15 hours

more