Skip to content

Tc/precise capturing #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 679 commits into from
Dec 11, 2024
Merged

Conversation

cameraMeasurementTech
Copy link
Owner

No description provided.

cameraMeasurementTech and others added 30 commits October 11, 2023 10:04
Adjust reference for return-position `impl Trait` in trait and `async fn` in trait
…tures

Doc: Add the RISC-V stabilized target features
some asm block flags also mean there can be no fences
Guarantee that raw pointer conversions preserve slice element count
These appear in nearly identical locations in source code and have subtly different semantics, so cross link them.
Reference wildcard patterns from underscore expr
Lone `self` in a method body resolves to the self parameter
type-layout.md: Warn about repr(align)/repr(packed) and field order
`async fn` in traits, and return-position `impl Trait` in traits, were stabilized by <rust-lang/rust#115822>. The object-safety error E0038 points to the Reference, so the Reference should mention this new criterion.
Document object unsafety of async-fn-in-trait
Co-authored-by: Amanieu d'Antras <[email protected]>
Switching most of the code to a library to support rustbook upstream.
This was not intended to be interpreted as rust code.
This makes a few changes to CI to handle mdbook-spec:

- Adds a new job for mdbook-spec itself.
- Removes caching, can set this up later.
- Moves `mdbook test` to a separate job. It can be useful to see in the
  CI results to see which jobs are passing or failing.
- Verifies the book builds with mdbook-spec.
- Fix a small oversight that `style-checks` should use `--locked`.
- Add a summary job to make it easier to work with merge queue and
  branch protections.
Migrate mdbook-spec to this repo.
This is just a first pass to specifying how each thing introduces
a name, and where it is introduced. This is missing `use` and `Self`.
(And a few things I don't feel like need elaboration, like loop labels,
but those can be added if desired.)
Since "namespace" has a specific meaning in Rust, I feel like it would
be good not to overload it too much with the sense of a scope container
like a C++ namespace.
This attempts to update the `use` chapter to explain the kinds of paths
and syntax it supports in more detail. This is not an exhaustive
explanation of resolution, and there are several things it does not
cover.
This was changed in rust-lang/rust#56414
to favor in-scope items.
We've merged PR #1040, so we can remove the TODO and update the link
to point to the specific section.

We replace some commas with semicolons where that's the right thing to
do grammatically.

Where we have "an X is... they are...", we replace that with "an X
is... Xs are..." for reasons of avoiding a mismatch between the
plurality of the pronoun and its referent.

We replace "implementing type" and "defining type" with "type being
implemented" and "type being defined", since there is in general a
difference (e.g. "the driving force" vs "the force being driven"), and
these seem more like the latter than the former.

There's a place where we had said, "glob imports are allowed to import
conflicting names into the same *namespaces*" (emphasis added).  It
makes sense what this is trying to say by using the plural there.  But
it just reads better to use the singular, and if it's true for the
singular, it's clearly also true to the plural, so we make that
change.
We had mentioned and demonstrated that a name is allowed to be
redundantly imported by multiple glob imports, but we hadn't said
that it is allowed to then be *used*.

Given the example that directly proceeds this, it seems important to
make a note of that, so let's do that, and let's extend the example to
demonstrate this.
The claim here was that:

> Glob imports are allowed to import conflicting names in the same
> namespace as long as the name is not used *or shadowed*.

It's true that the name being used will cause an error.  But it's not
true that the name being shadowed will cause one, so let's remove
that part.
It's a bit more common throughout the Reference, including even within
this PR, to say "For example:" rather than just "Example:", and it's
more grammatically regular, so let's fix up the ones that went the
other way in this branch.
This is causing weird issues where the width of blockquotes gets smaller
on wider screens. I don't particularly want to try to fix it, and I'm
personally fine with the default mdbook styling. I think we can revisit
this later to see if it can be made better.
Add details on how names are introduced.
Fix std-links for generics with commas.
The Reference didn't include any description of capturing or capturing
behavior for `impl Trait` opaque types.  Let's describe briefly what
capturing is and what the currently-stable automatic capturing rules
are.  Then let's describe the syntax and behavior of RFC 3617 precise
capturing.
@cameraMeasurementTech cameraMeasurementTech merged commit 6929bb9 into Gankra-patch-1 Dec 11, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant