Files
rust/src
Jonathan Brouwer d9a86757c9 Rollup merge of #152293 - ia0:try_blocks_heterogeneous, r=ytmimi
Format heterogeneous try blocks

The tracking issue for `try_blocks_heterogeneous` is https://github.com/rust-lang/rust/issues/149488.

This follows the formatting of homogeneous try blocks (feature `try_blocks`) by considering `try bikeshed <type>` to be the equivalent of `try` (in particular a single "token").

An alternative would be to permit breaking between `bikeshed` and `<type>`, but given that those 2 elements are an explicitly temporary part of the syntax, it doesn't seem worth it. There also doesn't seem to be any existing precedent breaking between a keyword and a type. It also doesn't seem to be useful in practice, given that the type itself doesn't break (which is how it works for the return type of closures) and has more chances to dominate the length in case a break is necessary.

Happy to adapt anything in case this formatting is not optimal.

The test is also copied from homogeneous try blocks with 2 additional test cases to demonstrate the behavior with long types.

See [#t-lang > try blocks @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/try.20blocks/near/572387493) for context.
2026-02-10 13:00:48 +01:00
..
2026-02-06 20:19:10 +01:00
2026-01-27 12:09:39 +01:00
2026-01-21 20:03:56 -05:00
2026-01-17 10:19:26 -05:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.