Skip to content

Commit 7a2b0e7

Browse files
committed
Fix typos in RFCs 2751-3000
1 parent 53b4788 commit 7a2b0e7

11 files changed

+36
-36
lines changed

text/2789-sparse-index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If the client is not interested in the deleted crate, it won't check it, but cha
5151
# Drawbacks
5252
[drawbacks]: #drawbacks
5353

54-
* crates-io plans to add a cryptographic signatures to the index as an extra layer of protection on top of HTTPS. Cryptographic verification of a git index is straigthforward, but signing of a sparse HTTP index may be challenging.
54+
* crates-io plans to add a cryptographic signatures to the index as an extra layer of protection on top of HTTPS. Cryptographic verification of a git index is straightforward, but signing of a sparse HTTP index may be challenging.
5555
* A basic solution, without the incremental changelog, needs many requests update the index. This could have higher latency than a git fetch. However, in preliminary benchmarks it appears to be faster than a git fetch if the CDN supports enough (>60) requests in parallel. For GitHub-hosted indexes Cargo has a fast path that checks in GitHub API whether the master branch has changed. With the incremental changelog file, the same fast path can be implemented by making a conditional HTTP request for the changelog file (i.e. checking `ETag` or `Last-Modified`).
5656
* Performant implementation of this solution depends on making many small requests in parallel. HTTP/2 support on the server makes checking twice as fast compared to HTTP/1.1, but speed over HTTP/1.1 is still reasonable.
5757
* `raw.githubusercontent.com` is not suitable as a CDN. The sparse index will have to be cached/hosted elsewhere.
@@ -120,4 +120,4 @@ The index does not require all files to form one cohesive snapshot. The index is
120120

121121
The only case where stale caches can cause a problem is when a new version of a crate depends on the latest version of a newly-published dependency, and caches expired for the parent crate before expiring for the dependency. Cargo requires dependencies with sufficient versions to be already visible in the index, and won't publish a "broken" crate.
122122

123-
However, there's always a possiblity that CDN caches will be stale or expire in a "wrong" order. If Cargo detects that its cached copy of the index is stale (i.e. it finds that a crate that depends on a dependency that doesn't appear to be in the index yet) it may recover from such situation by re-requesting files from the index with a "cache buster" (e.g. current timestamp) appended to their URL. This has an effect of reliably bypassing stale caches, even when CDNs don't honor `cache-control: no-cache` in requests.
123+
However, there's always a possibility that CDN caches will be stale or expire in a "wrong" order. If Cargo detects that its cached copy of the index is stale (i.e. it finds that a crate that depends on a dependency that doesn't appear to be in the index yet) it may recover from such situation by re-requesting files from the index with a "cache buster" (e.g. current timestamp) appended to their URL. This has an effect of reliably bypassing stale caches, even when CDNs don't honor `cache-control: no-cache` in requests.

text/2795-format-args-implicit-identifiers.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Implicit arguments would have lower precedence than the existing named arguments
8080
// expands to "hello Snoopy".
8181
println!("hello {person}", person="Snoopy");
8282

83-
Indeed, in this example above the `person` variable would be unused, and so in this case the unused varible warning will apply, like the below:
83+
Indeed, in this example above the `person` variable would be unused, and so in this case the unused variable warning will apply, like the below:
8484

8585
warning: unused variable: `person`
8686
--> src/foo.rs:X:Y
@@ -116,7 +116,7 @@ The implementation pathway is directly motivated by the guide level explanation
116116

117117
If this RFC were implemented, instead of this resulting in an error, this named argument would be treated as an **implicit named argument** and the final result of the expansion of the `format_args!` macro would be the same as if a named argument, with name equivalent to the identifier, had been provided to the macro invocation.
118118

119-
Because `person` is only treated as an implicit named argument if no exisiting named argument can be found, this ensures that implicit named arguments have lower precedence than explicit named arguments.
119+
Because `person` is only treated as an implicit named argument if no existing named argument can be found, this ensures that implicit named arguments have lower precedence than explicit named arguments.
120120

121121
## Macro Hygiene
122122
[macro-hygiene]: #macro-hygiene
@@ -274,7 +274,7 @@ Indeed the RFC's perverse example reads slightly easier with this syntax:
274274

275275
println!("hello {( if self.foo { &self.person } else { &self.other_person } )}");
276276

277-
Because the interpolation syntax `{(expr)}` is orthogonal to positional `{}` and named `{ident}` argument syntax, and is a superset of the functionality which would be offered by implict named arguments, the argument was made that we should make the leap directly to interpolation without introducing implicit named arguments so as to avoid complicating the existing cases.
277+
Because the interpolation syntax `{(expr)}` is orthogonal to positional `{}` and named `{ident}` argument syntax, and is a superset of the functionality which would be offered by implicit named arguments, the argument was made that we should make the leap directly to interpolation without introducing implicit named arguments so as to avoid complicating the existing cases.
278278

279279
### Argument Against Interpolation
280280

@@ -312,7 +312,7 @@ Similar to how implicit named arguments can be offered by third-party crates, in
312312

313313
The overall argument is not to deny that the standard library macros in question would not become more expressive if they were to gain fully interpolation.
314314

315-
However, the RFC author argues that adding interpolation to these macros is less neccessary to improve ergonomics when comparing against other languages which chose to introduce language-level interpolation support. Introduction of implicit named arguments will cater for many of the common instances where interpolation would have been desired. The existing positional and named arguments can accept arbitrary expressions, and are not so unergonomic that they feel overly cumbersome when the expression in question is also nontrivial.
315+
However, the RFC author argues that adding interpolation to these macros is less necessary to improve ergonomics when comparing against other languages which chose to introduce language-level interpolation support. Introduction of implicit named arguments will cater for many of the common instances where interpolation would have been desired. The existing positional and named arguments can accept arbitrary expressions, and are not so unergonomic that they feel overly cumbersome when the expression in question is also nontrivial.
316316

317317

318318
# Prior art
@@ -332,7 +332,7 @@ This syntax is widely used and clear to read. It's [introduced in the Rust Book
332332

333333
## Other languages
334334

335-
A number of languages support string-interpolation functionality with similar syntax to what Rust's formatting macros. The RFC author's influence comes primarily from Python 3's "f-strings" and Javscript's backticks.
335+
A number of languages support string-interpolation functionality with similar syntax to what Rust's formatting macros. The RFC author's influence comes primarily from Python 3's "f-strings" and JavaScript's backticks.
336336

337337
The following code would be the equivalent way to produce a new string combining a `greeting` and a `person` in a variety of languages:
338338

@@ -363,7 +363,7 @@ The following code would be the equivalent way to produce a new string combining
363363

364364
It is the RFC author's experience that these interpolating mechanisms read easily from left-to-right and it is clear where each variable is being substituted into the format string.
365365

366-
In the Rust formatting macros as illustrated above, the positional form suffers the drawback of not reading strictly from left to right; the reader of the code must refer back-and-forth between the format string and the argument list to determine where each variable will be subsituted. The named form avoids this drawback at the cost of much longer code.
366+
In the Rust formatting macros as illustrated above, the positional form suffers the drawback of not reading strictly from left to right; the reader of the code must refer back-and-forth between the format string and the argument list to determine where each variable will be substituted. The named form avoids this drawback at the cost of much longer code.
367367

368368
Implementing implicit named arguments in the fashion suggested in this RFC would eliminate the drawbacks of each of the Rust forms and permit new syntax much closer to the other languages:
369369

@@ -396,7 +396,7 @@ However, in current stable Rust the `panic!` macro does not forward to `format_a
396396

397397
This semantic of `panic!` has previously been acknowledged as a "papercut", for example in [this Rust issue](https://github.com/rust-lang/rust/issues/22932). However, it has so far been left as-is because changing the design was low priority, and changing it may break existing code.
398398

399-
If this RFC were to be implemented, users will very likely expect invoking `panic!` with only a string literal will capture any implicit named arguments. This semantic would quickly become percieved as a major bug rather than a papercut.
399+
If this RFC were to be implemented, users will very likely expect invoking `panic!` with only a string literal will capture any implicit named arguments. This semantic would quickly become perceived as a major bug rather than a papercut.
400400

401401
Implementing this RFC therefore would bring strong motivation for making a small breaking change to `panic!`: when a single argument passed to panic is a string literal, instead of the final panic message being that literal (the current behavior), the final panic message will be the formatted literal, substituting any implicit named arguments denoted in the literal.
402402

text/2834-cargo-report-future-incompat.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ For example, in our running example of `unwary`:
316316
will invoke `rustc` itself the same way, and each `rustc` invocation will emit
317317
the same set of diagnostics that it does today for each of those cases.
318318
* Thus, the warning lints in the downstream `brash` non-path dependency will
319-
be capped, and the future-incompatiblity warnings associated with that `rustc`
319+
be capped, and the future-incompatibility warnings associated with that `rustc`
320320
invocation will be hidden.
321321
* When `cargo` emits a future-incompatibility report at the end of the build,
322322
and reports that `brash` contains code that will be rejected by
@@ -383,7 +383,7 @@ The responsibilities of Cargo:
383383
are not mandated by this RFC, but some ideas are presented as
384384
[Future possibiilties][future-possibilities].
385385

386-
## Implmentation strategy: Leverage JSON error-format
386+
## Implementation strategy: Leverage JSON error-format
387387

388388
The cleanest way to implement the above division of responsbilities
389389
without perturbing *non-cargo* uses of `rustc` is probably to make
@@ -431,7 +431,7 @@ In particular, it may not be reasonable for someone to resolve the
431431
flagged problem in the short term.
432432

433433
In order to allow users to opt-out of being warned about future
434-
incompatiblity issues on every build, this RFC proposes
434+
incompatibility issues on every build, this RFC proposes
435435
extending the `.cargo/config` file with keys that allow
436436
the user to fine-tune the frequency of how often cargo will
437437
print the report. For example:
@@ -526,7 +526,7 @@ takes a lot of effort to make such transitions, (in no small part
526526
**because** of the issue described here).
527527

528528
In the cases where the compiler and language teams have turned such
529-
lints into hard errors, the teams spent signficant time evaluating
529+
lints into hard errors, the teams spent significant time evaluating
530530
breakage via crater and then addressing such breakage. The changes
531531
suggested here would hopefully encourage more Rust users *outside* of
532532
the compiler and language teams to address future-compatibility
@@ -547,7 +547,7 @@ to `rustc` itself, and isolate the implementation to `cargo` alone.
547547
The main way I can imagine doing this is to stop passing
548548
`--cap-lints=allow`, and then having Cargo capture all diagnostic
549549
output from the compiler and post-processing it to determine which
550-
lints are future-incompatible warnings. However, ths has a number of
550+
lints are future-incompatible warnings. However, this has a number of
551551
problems:
552552

553553
* It is fragile, since it relies on Cargo post-processing the compiler diagnostic output.
@@ -678,7 +678,7 @@ The main form of follow-up work I envisage for this RFC is what
678678
feedback that Cargo gives regarding the issues.
679679

680680
Cargo is responsible for suggesting to the user how they might address an
681-
instance of a future-incompatbility lint.
681+
instance of a future-incompatibility lint.
682682

683683
Some ideas for suggestions follow.
684684

text/2873-inline-asm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ In some cases, fine control is needed over the way a register name is formatted
321321

322322
By default the compiler will always choose the name that refers to the full register size (e.g. `rax` on x86-64, `eax` on x86, etc).
323323

324-
This default can be overriden by using modifiers on the template string operands, just like you would with format strings:
324+
This default can be overridden by using modifiers on the template string operands, just like you would with format strings:
325325

326326
```rust
327327
let mut x: u16 = 0xab;
@@ -860,7 +860,7 @@ There is however a fairly trivial mapping between the GCC-style and this format
860860

861861
Additionally, this RFC proposes using the Intel asm syntax by default on x86 instead of the AT&T syntax. We believe this syntax will be more familiar to most users, but may be surprising for users used to GCC-style asm.
862862

863-
The `cpuid` example above would look like this in GCC-sytle inline assembly:
863+
The `cpuid` example above would look like this in GCC-style inline assembly:
864864

865865
```C
866866
// GCC doesn't allow directly clobbering an input, we need

text/2906-cargo-workspace-deduplicate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ continue to prune accidentally unused entries.
440440
## Effect on `cargo metadata`
441441

442442
Executing `cargo metadata` to learn about a crate graph will implicitly perform
443-
all subsitution defined in this proposal. Consumers of `cargo metadata` will
443+
all substitution defined in this proposal. Consumers of `cargo metadata` will
444444
continue to get the same output they got before this proposal, meaning that
445445
implicit substitutions, if any, will be invisible to users of `cargo metadata`.
446446

@@ -455,7 +455,7 @@ Like today, `path` dependencies will be resolved relative to the file that
455455
defines them. This means that references to dependencies defined in the
456456
workspace means paths are still relative to the workspace root itself.
457457

458-
For example if you write down a `[workspace.depencencies]` directive with a
458+
For example if you write down a `[workspace.dependencies]` directive with a
459459
relative path:
460460

461461
```toml

text/2909-destructuring-assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ meaning for `@`-bindings in destructuring assignment is not inconceivable, we be
233233
confusing at best in this context. Conversely, destructuring tuples, slices or structs is very
234234
natural and we do not foresee confusion with allowing these.
235235

236-
Our implementation is forwards-compatible with allowing these patterns in destructuring assigmnent,
236+
Our implementation is forwards-compatible with allowing these patterns in destructuring assignment,
237237
in any case, so we lose nothing by not allowing them from the start.
238238

239239
Additionally, we do not give analogues for any of the following, which make little sense in this

text/2912-rust-analyzer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The RFC proposes a plan to adopt rust-analyzer as Rust's official LSP implementa
1212
* **Deprecation period** -- announce that the RLS is deprecated and encourage people to migrate to rust-analyzer
1313
* **Final transition** -- stop supporting the older RLS
1414

15-
As detailed below, one major concern with rust-analyzer as it stands today is that it shares very little code with rustc. To avoid creating an unsustainable maintainance burden, this RFC proposes extracting shared libraries that will be used by both rustc and rust-analyzer ("library-ification"), which should eventually lead to rustc and rust-analyzer being two front-ends over a shared codebase.
15+
As detailed below, one major concern with rust-analyzer as it stands today is that it shares very little code with rustc. To avoid creating an unsustainable maintenance burden, this RFC proposes extracting shared libraries that will be used by both rustc and rust-analyzer ("library-ification"), which should eventually lead to rustc and rust-analyzer being two front-ends over a shared codebase.
1616

1717
# Motivation
1818
[motivation]: #motivation
@@ -73,7 +73,7 @@ Library-ification can address these concerns by two distinct "host processes" th
7373
# Guide-level explanation
7474
[guide-level-explanation]: #guide-level-explanation
7575

76-
The high-level plan is effectively to adopt rust-analyzer as the primary LSP implementation for the Rust project, and to aggressively pursue 'library-ification' as a means to eliminate code duplication. The ultimate vision is that the majority of the compiler logic should live in shared libaries which have two "front-ends", one from rustc and one from rust-analyzer.
76+
The high-level plan is effectively to adopt rust-analyzer as the primary LSP implementation for the Rust project, and to aggressively pursue 'library-ification' as a means to eliminate code duplication. The ultimate vision is that the majority of the compiler logic should live in shared libraries which have two "front-ends", one from rustc and one from rust-analyzer.
7777

7878
## Adopting rust-analyzer as the primary LSP implementation
7979

@@ -141,7 +141,7 @@ The primary drawback to the plan is that, in the short term, rust-analyzer and r
141141

142142
A secondary drawback is that rust-analyzer today sometimes uses approximate answers where the current RLS is able to offer precise results. This can occur, for example, with jump to definition. This situation will continue to be the case until we make progress on library-ification of parsing and name resolution.
143143

144-
More generally, switching the offical IDE from RLS to rust-analyzer will incure tooling churn on users, and would not be strictly better in the short term (althought the expectation is that it will be significantly better on average).
144+
More generally, switching the official IDE from RLS to rust-analyzer will incur tooling churn on users, and would not be strictly better in the short term (although the expectation is that it will be significantly better on average).
145145

146146
# Rationale and alternatives
147147
[rationale-and-alternatives]: #rationale-and-alternatives
@@ -173,10 +173,10 @@ The reasons behind these limitations are that it will take some time to implemen
173173

174174
The current proposal is informed by experience with existing RLS and query-based compilation in rustc. Additionally, rust-analyzer heavily draws from lessons learned while developing IntelliJ Rust.
175175

176-
It's interesting that many compilers went through a phase with parallel implementaitons to get a great IDE support
176+
It's interesting that many compilers went through a phase with parallel implementations to get a great IDE support
177177

178-
* For C#, the [Roslyn](https://github.com/dotnet/roslyn) project was a from scratch implemenation.
179-
* [Dart for a long time had different front-ends for command line and interractive compilers](https://youtu.be/WjdrUphF5l4?t=2204)
178+
* For C#, the [Roslyn](https://github.com/dotnet/roslyn) project was a from scratch implementation.
179+
* [Dart for a long time had different front-ends for command line and interactive compilers](https://youtu.be/WjdrUphF5l4?t=2204)
180180
* [Swift is transitioning to new syntax tree library by "reimplement separately, then swap" approach](https://medium.com/@kitasuke/deep-dive-into-integrating-libsyntax-into-the-compiler-pipeline-2d478c8600a1)
181181

182182
Notable exceptions:

0 commit comments

Comments
 (0)