Skip to content

fix grammar errors #374

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 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rust-2024/cargo-inherited-default-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Just beware that if you build multiple workspace members at the same time, the f

When using `cargo fix --edition`, Cargo will automatically update your `Cargo.toml` file to remove `default-features = false` in this situation.

If you would prefer to update your `Cargo.toml` manually, check for any warnings when running a build and remove the corresponding entries.
If you prefer to update your `Cargo.toml` manually, check for any warnings when running a build and remove the corresponding entries.
Previous editions should display something like:

```text
Expand Down
2 changes: 1 addition & 1 deletion src/rust-2024/cargo-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ which will imply [`resolver.incompatible-rust-version = "fallback"`].
The resolver is a global setting for a [workspace], and the setting is ignored in dependencies.
The setting is only honored for the top-level package of the workspace.
If you are using a [virtual workspace], you will still need to explicitly set the [`resolver` field]
in the `[workspace]` definition if you want to opt-in to the new resolver.
in the `[workspace]` definition if you want to opt in to the new resolver.

For more details on how Rust-version aware dependency resolution works, see [the Cargo book](../../cargo/reference/resolver.html#rust-version).

Expand Down
2 changes: 1 addition & 1 deletion src/rust-2024/cargo-table-key-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Notice that the underscores were changed to dashes for `dev_dependencies` and `d

When using `cargo fix --edition`, Cargo will automatically update your `Cargo.toml` file to use the preferred table and key names.

If you would prefer to update your `Cargo.toml` manually, be sure to go through the list above and make sure only the new forms are used.
If you prefer to update your `Cargo.toml` manually, be sure to go through the list above and make sure only the new forms are used.
2 changes: 1 addition & 1 deletion src/rust-2024/newly-unsafe-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Over time it has become evident that certain functions in the standard library s

### `std::env::{set_var, remove_var}`

It can be unsound to call [`std::env::set_var`] or [`std::env::remove_var`] in a multi-threaded program due to safety limitations of the way the process environment is handled on some platforms. The standard library originally defined these as safe functions, but it was later determined that was not correct.
It can be unsound to call [`std::env::set_var`] or [`std::env::remove_var`] in a multithreaded program due to safety limitations of the way the process environment is handled on some platforms. The standard library originally defined these as safe functions, but it was later determined that was not correct.

It is important to ensure that these functions are not called when any other thread might be running. See the [Safety] section of the function documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion src/rust-2024/rpit-lifetime-capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fn f<'a, T: 'a>(x: &'a (), y: T) -> impl Sized + 'a {
}
```

This trick was less baroque than the `Captures` trick, but also less correct. As we can see in the example above, even though any lifetime components within `T` are independent from the lifetime `'a`, we're required to add a `T: 'a` bound in order to make the trick work. This created undue and surprising restrictions on callers.
This trick was less baroque than the `Captures` trick, but also less correct. As we can see in the example above, even though any lifetime components within `T` are independent of the lifetime `'a`, we're required to add a `T: 'a` bound in order to make the trick work. This created undue and surprising restrictions on callers.

Using precise capturing, you can write the above instead, in all editions, as:

Expand Down
2 changes: 1 addition & 1 deletion src/rust-2024/temporary-tail-expr-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In 2021 the local variable `c` is dropped before the temporary created by `c.bor

### Temporary scope may be narrowed

When a temporary is created in order to evaluate an expression, the temporary is dropped based on the [temporary scope rules]. Those rules define how long the temporary will be kept alive. Before 2024, temporaries from tail expressions of a block would be extended outside of the block to the next temporary scope boundary. In many cases this would be the end of a statement or function body. In 2024, the temporaries of the tail expression may now be dropped immediately at the end of the block (before any local variables in the block).
When a temporary is created in order to evaluate an expression, the temporary is dropped based on the [temporary scope rules]. Those rules define how long the temporary will be kept alive. Before 2024, temporaries from tail expressions of a block would be extended outside the block to the next temporary scope boundary. In many cases this would be the end of a statement or function body. In 2024, the temporaries of the tail expression may now be dropped immediately at the end of the block (before any local variables in the block).

This narrowing of the temporary scope may cause programs to fail to compile in 2024. For example:

Expand Down