Skip to content

Commit 53b4788

Browse files
committed
Fix typos in RFCs 2501-2750
1 parent 6bdce2f commit 53b4788

13 files changed

+27
-27
lines changed

text/2514-union-initialization-and-drop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ union U<T> { x:(), f: ManuallyDrop<T> }
193193

194194
fn main() {
195195
let mut u : U<(Vec<i32>,)> = U { x: () };
196-
unsafe { u.f.0 = Vec::new() }; // uninitialized `Vec` being droped
196+
unsafe { u.f.0 = Vec::new() }; // uninitialized `Vec` being dropped
197197
}
198198
```
199199
This requires `unsafe` because it desugars to `ManuallyDrop::deref_mut(&mut u.f).0`,

text/2515-type_alias_impl_trait.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn foo() -> __foo_return {
5252
}
5353
```
5454

55-
The generated type `__foo_return` is not exposed: it is automatically contructed from any valid type (as in `(3)`).
55+
The generated type `__foo_return` is not exposed: it is automatically constructed from any valid type (as in `(3)`).
5656

5757
Note that, in order for the type inference to support argument-position `impl Trait`, which may be polymorphic (just like a generic parameter), the inference used here is actually a more expressive form of type inference similar to ML-style let polymorphism. Here, the inference of function types may result in additional generic parameters, specifically relating to the occurrences of argument-position `impl Trait`.
5858

@@ -96,7 +96,7 @@ fn foo() -> Baz {
9696
}
9797
```
9898

99-
However, if the function is parameterised, it may be necessary to add explicit parameters to the type alias (due to the return-type being within the scope of the function's generic paramters, unlike the type alias).
99+
However, if the function is parameterised, it may be necessary to add explicit parameters to the type alias (due to the return-type being within the scope of the function's generic parameters, unlike the type alias).
100100

101101
Using `Baz` in multiple locations constrains all occurrences of the inferred type to be the same, just as with `existential type`.
102102

text/2521-c_void-reunification.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ A pointer returned from one library can now be passed to the other library witho
8080
In the standard library:
8181

8282
* Create a new `core::ffi` module.
83-
* Move the `enum` definiton of `c_void` there.
83+
* Move the `enum` definition of `c_void` there.
8484
* In `c_void`’s former location (`std::os::raw`), replace it with a `pub use` reexport.
8585
* For consistency between `core` and `std`, also add a similar `pub use` reexport at `std::ffi::c_void`.
8686
(Note that the `std::ffi` module already exists.)
@@ -91,7 +91,7 @@ Once the above lands in Nightly, in the `libc` crate:
9191
(for example by executing `$RUSTC` with a temporary file like
9292
`#![crate_type = "lib"] #![no_std] pub use core::ffi::c_void;`)
9393
and conditionally set a compilation flag for the library.
94-
* In the library, based on the precence of that flag,
94+
* In the library, based on the presence of that flag,
9595
make `c_void` be either `pub use core::ffi::c_void;` or its current `enum` definition,
9696
to keep compatibility with older Rust versions.
9797

@@ -147,7 +147,7 @@ for example, `ptr::null::<c_void>()` and `<*mut c_void>::offset(n)` would not be
147147

148148
We could deprecated `c_void` and replace it with a new differently-named extern type,
149149
but forcing the ecosystem through that transition seems too costly for this theoretical nicety.
150-
Plus, this woud still be a nominal type.
150+
Plus, this would still be a nominal type.
151151
If this new type is to be present if both `libc` and `std`,
152152
it would still have to be in `core` as well.
153153

@@ -176,5 +176,5 @@ This is left for a future RFC.
176176
This RFC does not propose any change such as moving to libcore for the C types other than `c_void`.
177177

178178
Although some in previous discussions have expressed desire for using C-compatible types
179-
without linking to the C runtime libray (which the `libc` crate does) or depending on `std`.
179+
without linking to the C runtime library (which the `libc` crate does) or depending on `std`.
180180
This use case is also left for a future proposal or RFC.

text/2526-const-wildcard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ compile if the type `MyType` doesn't implement the trait `MyTrait`:
1919
```rust
2020
const _FOO: () = {
2121
use std::marker::PhantomData;
22-
struct ImpelementsMyTrait<T: MyTrait>(PhantomData<T>);
22+
struct ImplementsMyTrait<T: MyTrait>(PhantomData<T>);
2323
let _ = ImplementsMyTrait::<MyType>(PhantomData); // type checking error if MyType: !MyTrait
2424
()
2525
};

text/2532-associated-type-defaults.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ associated type include:
976976
type Output = Self;
977977

978978
// OK to assume what `Output` really is because any overriding
979-
// must override both `Outout` and `finish`.
979+
// must override both `Output` and `finish`.
980980
fn finish(self) -> Self::Output { self }
981981
}
982982
}
@@ -1403,7 +1403,7 @@ impl Bar for Theta {
14031403

14041404
impl Bar for Iota {
14051405
// We have overridden `Bar` which is in the root group.
1406-
// Since all other items are decendants of the same group as `Bar` is in,
1406+
// Since all other items are descendants of the same group as `Bar` is in,
14071407
// they are allowed to depend on what `Bar` is.
14081408
type Bar = u8;
14091409

text/2535-or-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ param : pat<no_top_alt> ':' ty_sum ;
527527
For closures we now have:
528528

529529
```rust
530-
inferrable_param : pat<no_top_alt> maybe_ty_ascription ;
530+
inferable_param : pat<no_top_alt> maybe_ty_ascription ;
531531
```
532532

533533
Finally, `pat` macro fragment specifiers will also match the `pat<no_top_alt>`
@@ -851,7 +851,7 @@ There is support for or-patterns in [various lisp libraries][lisp_libs].
851851
# Unresolved questions
852852
[unresolved]: #unresolved-questions
853853

854-
1. Should we allow `top_pat` or `pat<allow_top_alt>` in `inferrable_param` such
854+
1. Should we allow `top_pat` or `pat<allow_top_alt>` in `inferable_param` such
855855
that closures permit `|Ok(x) | Err(x)|` without first wrapping in parenthesis?
856856

857857
We defer this decision to stabilization as it may depend on experimentation.

text/2539-cfg_attr-multiple-attrs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For an example of multiple attributes, say we want to have two attribute macros
3030
(`sparkles` and `crackles`), but only when `feature = "magic"` is enabled. We
3131
can write this as:
3232

33-
```rust,igore
33+
```rust,ignore
3434
#[cfg_attr(feature = "magic", sparkles, crackles)]
3535
fn bewitched() {}
3636
```
@@ -86,7 +86,7 @@ mod os;
8686
For an example of multiple attributes, say we want to have two attribute macros,
8787
but only when `feature = "magic"` is enabled. We can write this as:
8888

89-
```rust,igore
89+
```rust,ignore
9090
#[cfg_attr(feature = "magic", sparkles, crackles)]
9191
fn bewitched() {}
9292
```
@@ -122,7 +122,7 @@ Today, an attribute can look like:
122122
* ``name = `TokenTree` ``
123123

124124
where `TokenStream` is a sequence of tokens that only has the restriction that
125-
delimiters match and `TokenTree` is a single identifer, literal, punctuation
125+
delimiters match and `TokenTree` is a single identifier, literal, punctuation
126126
mark, or a delimited `TokenStream`.
127127

128128
With this RFC accepted, the following cannot ever be parsed as attributes:

text/2580-ptr-meta.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ from the standard library.
3131
as it was guaranteed to have the same memory layout.
3232
This was replaced with more specific and less wildly unsafe
3333
`std::slice::from_raw_parts` and `std::slice::from_raw_parts_mut` functions,
34-
together with `as_ptr` and `len` methods that extract each fat pointer component separatly.
34+
together with `as_ptr` and `len` methods that extract each fat pointer component separately.
3535

3636
For trait objects, where we still have an unstable `std::raw::TraitObject` type
3737
that can only be used with `transmute`:
@@ -46,7 +46,7 @@ pub struct TraitObject {
4646

4747
[`std::raw::Repr`]: https://doc.rust-lang.org/1.10.0/std/raw/trait.Repr.html
4848
[`std::raw::Slice`]: https://doc.rust-lang.org/1.10.0/std/raw/struct.Slice.html
49-
[`std::raw::TraitObjet`]: https://doc.rust-lang.org/1.30.0/std/raw/struct.TraitObject.html
49+
[`std::raw::TraitObject`]: https://doc.rust-lang.org/1.30.0/std/raw/struct.TraitObject.html
5050

5151

5252
# Motivation
@@ -100,7 +100,7 @@ struct WithMeta<T: ?Sized> {
100100
Since [unsized rvalues] are not implemented yet,
101101
our constructor is going to “unsize” from a concrete type that implements our trait.
102102
The `Unsize` bound ensures we can cast from `&S` to a `&Dyn` trait object
103-
and construct the appopriate metadata.
103+
and construct the appropriate metadata.
104104

105105
[unsized rvalues]: https://github.com/rust-lang/rust/issues/48055
106106

@@ -373,7 +373,7 @@ Except for `DynMetadata`’s methods, this RFC proposes a subset of what that th
373373
This might reduce monomorphization cost,
374374
but would force that the size, alignment, and destruction pointers
375375
be in the same location (offset) for every vtable.
376-
But keeping them in the same location is probaly desirable anyway to keep code size small.
376+
But keeping them in the same location is probably desirable anyway to keep code size small.
377377

378378
* The name of `Thin`.
379379
This name is short and sweet but `T: Thin` suggests that `T` itself is thin,
@@ -385,7 +385,7 @@ Except for `DynMetadata`’s methods, this RFC proposes a subset of what that th
385385
Or could it ever make sense to have fat pointers to statically-sized types?
386386

387387
* Are there other generic standard library APIs like `ptr::null()`
388-
that have an (implicit) `T: Sized` bound that unneccesarily excludes extern types?
388+
that have an (implicit) `T: Sized` bound that unnecessarily excludes extern types?
389389

390390
* Should `<*mut _>::from_raw_parts` and friends be `unsafe fn`s?
391391

text/2582-raw-reference-mir-operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Currently, if one wants to create a raw pointer pointing to something, one has n
1818
The problem with this is that there are some invariants that we want to attach to references, that have to *always hold*.
1919
The details of this are not finally decided yet, but true in practice because of annotations we emit to LLVM.
2020
It is also the next topic of discussion in the [Unsafe Code Guidelines](https://github.com/rust-rfcs/unsafe-code-guidelines/).
21-
In particular, references must be aligned and dereferencable, even when they are created and never used.
21+
In particular, references must be aligned and dereferenceable, even when they are created and never used.
2222

2323
One consequence of these rules is that it becomes essentially impossible to create a raw pointer pointing to an unaligned struct field:
2424
`&packed.field as *const _` creates an intermediate unaligned reference, triggering undefined behavior because it is not aligned.
@@ -63,7 +63,7 @@ let x = unsafe { &packed.field }; // `x` is not aligned -> undefined behavior
6363
```
6464

6565
There is no situation in which the above code is correct, and hence it is a hard error to write this (after a transition period).
66-
This applies to most ways of creating a reference, i.e., all of the following are UB if `X` is not properly aligned and dereferencable:
66+
This applies to most ways of creating a reference, i.e., all of the following are UB if `X` is not properly aligned and dereferenceable:
6767

6868
```rust
6969
fn foo() -> &T {

text/2591-exhaustive-integer-pattern-matching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The implementation of this features uses interval arithmetic and an extension of
6767

6868
This feature has already [been implemented](https://github.com/rust-lang/rust/pull/50912), so the code there may be used for further reference. The source contains detailed comments about the implementation.
6969

70-
For `usize` and `isize`, no assumptions about the maximimum value are permitted. To exhaustively match on either pointer-size integer type a wildcard pattern (`_`) must be used (or if [open-ended range patterns are added](https://github.com/rust-lang/rfcs/issues/947), ranges must be open ended [e.g. `0..`]). An unstable feature `precise_pointer_size_matching` will be added to permit matching exactly on pointer-size integer types.
70+
For `usize` and `isize`, no assumptions about the maximum value are permitted. To exhaustively match on either pointer-size integer type a wildcard pattern (`_`) must be used (or if [open-ended range patterns are added](https://github.com/rust-lang/rfcs/issues/947), ranges must be open ended [e.g. `0..`]). An unstable feature `precise_pointer_size_matching` will be added to permit matching exactly on pointer-size integer types.
7171

7272
# Drawbacks
7373
[drawbacks]: #drawbacks

0 commit comments

Comments
 (0)