Eric Huss

Results 149 issues of Eric Huss

The [Fold pattern](https://github.com/rust-unofficial/patterns/blob/main/patterns/creational/fold.md) seemed confusing to me. The term "fold" in functional programming has a pretty clear definition (which includes a combining function), and it's not immediately clear from the...

C-enhancement
A-pattern

I think there are some types missing from special-types-and-traits.md. In particular, I *think* `Fn`, `FnMut`, and `FnOnce` are special. What is the criteria for being special? Is there anything else...

Macro matchers allow `$` as the last token of a token tree: ```rust macro_rules! foo { ($) => {}; (last$) => {}; ({$}) => {}; ([$]) => {}; (($)) =>...

A-macros

This adds the chapter on scopes. I tried to make this accurate and complete, but it is probably neither. There are some things that are intentionally not covered, such as...

In #1037 a question came up about the exact wording around the introduction of the [destructors chapter](https://github.com/rust-lang/reference/blob/0fe357f176673b4bb9a093504a8ae1dcaf4c6f8f/src/destructors.md) which says > When an initialized variable or temporary goes out of scope...

Language Cleanup
A-destructors

With const generic defaults stabilized (#90207), the reference should talk more about what the restrictions are. * What are valid expressions for the default? I assume it has to be...

From my understanding of https://github.com/rust-lang/rust/pull/89551, constant expressions can now dereference non-mutable raw pointers. I believe [this line](https://github.com/rust-lang/reference/blob/06f9e61931bcf58b91dfe6c924057e42ce273ee1/src/const_eval.md?plain=1#L42) needs updating.

Help Wanted
A-const-eval

The current page on [`#[non_exhaustive]`](https://github.com/rust-lang/reference/blob/b5c68b02984f74e99d1f1b332029e05f607e2660/src/attributes/type_system.md#the-non_exhaustive-attribute) doesn't really say much about unit structs. I think it could use some clarification. For example, the visibility of the unit struct const is lowered...

A-attributes

There are various places in the grammar that restrict expressions with various types of braces. These restrictions also apply recursively into the expressions. This should be captured somehow. Examples: if-expr.md...

A-grammar

The changes for https://github.com/rust-lang/rust/pull/85769 need to documented (probably around [here](https://github.com/rust-lang/reference/blob/master/src/const_eval.md)). See https://github.com/rust-lang/rust/pull/85769#issuecomment-854363720 for the stabilization report.

Help Wanted
A-const-eval