You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/2789-sparse-index.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ If the client is not interested in the deleted crate, it won't check it, but cha
51
51
# Drawbacks
52
52
[drawbacks]: #drawbacks
53
53
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.
55
55
* 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`).
56
56
* 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.
57
57
*`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
120
120
121
121
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.
122
122
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.
Copy file name to clipboardExpand all lines: text/2795-format-args-implicit-identifiers.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Implicit arguments would have lower precedence than the existing named arguments
80
80
// expands to "hello Snoopy".
81
81
println!("hello {person}", person="Snoopy");
82
82
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:
84
84
85
85
warning: unused variable: `person`
86
86
--> src/foo.rs:X:Y
@@ -116,7 +116,7 @@ The implementation pathway is directly motivated by the guide level explanation
116
116
117
117
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.
118
118
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.
120
120
121
121
## Macro Hygiene
122
122
[macro-hygiene]: #macro-hygiene
@@ -274,7 +274,7 @@ Indeed the RFC's perverse example reads slightly easier with this syntax:
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.
278
278
279
279
### Argument Against Interpolation
280
280
@@ -312,7 +312,7 @@ Similar to how implicit named arguments can be offered by third-party crates, in
312
312
313
313
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.
314
314
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.
316
316
317
317
318
318
# Prior art
@@ -332,7 +332,7 @@ This syntax is widely used and clear to read. It's [introduced in the Rust Book
332
332
333
333
## Other languages
334
334
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.
336
336
337
337
The following code would be the equivalent way to produce a new string combining a `greeting` and a `person` in a variety of languages:
338
338
@@ -363,7 +363,7 @@ The following code would be the equivalent way to produce a new string combining
363
363
364
364
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.
365
365
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.
367
367
368
368
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:
369
369
@@ -396,7 +396,7 @@ However, in current stable Rust the `panic!` macro does not forward to `format_a
396
396
397
397
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.
398
398
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.
400
400
401
401
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.
Copy file name to clipboardExpand all lines: text/2873-inline-asm.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -321,7 +321,7 @@ In some cases, fine control is needed over the way a register name is formatted
321
321
322
322
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).
323
323
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:
325
325
326
326
```rust
327
327
letmutx:u16=0xab;
@@ -860,7 +860,7 @@ There is however a fairly trivial mapping between the GCC-style and this format
860
860
861
861
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.
862
862
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:
864
864
865
865
```C
866
866
// GCC doesn't allow directly clobbering an input, we need
Copy file name to clipboardExpand all lines: text/2912-rust-analyzer.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The RFC proposes a plan to adopt rust-analyzer as Rust's official LSP implementa
12
12
***Deprecation period** -- announce that the RLS is deprecated and encourage people to migrate to rust-analyzer
13
13
***Final transition** -- stop supporting the older RLS
14
14
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.
16
16
17
17
# Motivation
18
18
[motivation]: #motivation
@@ -73,7 +73,7 @@ Library-ification can address these concerns by two distinct "host processes" th
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.
77
77
78
78
## Adopting rust-analyzer as the primary LSP implementation
79
79
@@ -141,7 +141,7 @@ The primary drawback to the plan is that, in the short term, rust-analyzer and r
141
141
142
142
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.
143
143
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).
@@ -173,10 +173,10 @@ The reasons behind these limitations are that it will take some time to implemen
173
173
174
174
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.
175
175
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
177
177
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)
180
180
*[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)
0 commit comments