Rename grammar rule TypeParamBounds to just Bounds#2258
Conversation
|
Sounds reasonable to me. Can you also update the sentence in |
02a79dd to
cbe9a8a
Compare
|
I've gone ahead and removed the mention entirely: -Type paths are used within type definitions, trait bounds, type parameter bounds, and qualified paths.
+Type paths are used within type definitions, trait bounds, and qualified paths.That's because it was redundant anyway. Bound (formerly TypeParamBound) is defined as Lifetime | TraitBound | UseBound but TraitBound is already listed in that sentence and obviously Lifetime and UseBound don't contain TypePaths. |
|
Edit: Dropped again since I forgot about URL stability and since I can't be bothered to add redirects (if you even can; I only know about the JS-driven URL fragment redirects); the Book and the rustc book both reference |
cbe9a8a to
d6f4cc4
Compare
Update books ## rust-lang/reference 9 commits in 581920f9109f141b88b860b3e1e8359e3896a150..ad35aca481751a06afeb23820a672b0f3b11a476 2026-05-14 17:00:42 UTC to 2026-05-04 18:27:13 UTC - ci: declare contents:read on CI workflow (rust-lang/reference#2271) - Fix the grammar of generic arguments (rust-lang/reference#2247) - Rename grammar rule `TypeParamBounds` to just `Bounds` (rust-lang/reference#2258) - Update `used` to use the attribute template (rust-lang/reference#1905) - Place HRTB binders before fn qualifiers (rust-lang/reference#2260) - Glossary: add new entry documenting zero-sized types (rust-lang/reference#2203) - Fix test failure on macOS with link_section (rust-lang/reference#2246) - Make definition of fragment specifier `path` more precise (rust-lang/reference#2248) - gitignore linkcheck (rust-lang/reference#2252)
Rollup merge of #156723 - rustbot:docs-update, r=ehuss Update books ## rust-lang/reference 9 commits in 581920f9109f141b88b860b3e1e8359e3896a150..ad35aca481751a06afeb23820a672b0f3b11a476 2026-05-14 17:00:42 UTC to 2026-05-04 18:27:13 UTC - ci: declare contents:read on CI workflow (rust-lang/reference#2271) - Fix the grammar of generic arguments (rust-lang/reference#2247) - Rename grammar rule `TypeParamBounds` to just `Bounds` (rust-lang/reference#2258) - Update `used` to use the attribute template (rust-lang/reference#1905) - Place HRTB binders before fn qualifiers (rust-lang/reference#2260) - Glossary: add new entry documenting zero-sized types (rust-lang/reference#2203) - Fix test failure on macOS with link_section (rust-lang/reference#2246) - Make definition of fragment specifier `path` more precise (rust-lang/reference#2248) - gitignore linkcheck (rust-lang/reference#2252)
I take issue with the name of grammar rule TypeParamBounds. Bounds aren't inherently tied to type parameters, they can perfectly exist without them. This name stems from an ancient time when where-clauses didn't exist yet and bounds could only be put on type parameters. Today, that is no longer true.
Consider the following program which contains bounds that aren't associated with type parameters in any way:
Bounds can be placed on any type. I'd also be fine with renaming it to TypeBounds, just anything but TypeParamBounds :)