Skip to content

Commit 9fbba97

Browse files
needsuretshepang
authored andcommitted
chore: fix some typos in conments
Signed-off-by: needsure <qinzhipeng@outlook.com>
1 parent 61c1e83 commit 9fbba97

4 files changed

+7
-7
lines changed

src/implementing_new_features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ a new unstable feature:
123123

124124
1. Add the feature name to `rustc_span/src/symbol.rs` in the `Symbols {...}` block.
125125

126-
Note that this block must be in alphbetical order.
126+
Note that this block must be in alphabetical order.
127127

128128
1. Add a feature gate declaration to `rustc_feature/src/unstable.rs` in the unstable
129129
`declare_features` block.

src/thir.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ Thir {
144144
span: oneplustwo.rs:2:13: 2:18 (#0),
145145
kind: Binary {
146146
op: Add,
147-
// references to scopes surronding literals above
147+
// references to scopes surrounding literals above
148148
lhs: e1,
149149
rhs: e3,
150150
},
151151
},
152-
// expression 5, scope surronding expression 4
152+
// expression 5, scope surrounding expression 4
153153
Expr {
154154
ty: i32,
155155
temp_lifetime: Some(

src/turbofishing-and-early-late-bound.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn accepts_fn_2(_: impl Fn(&'static ()) -> &'static ()) {}
9191
fn main() {
9292
let f = late::<'static>;
9393

94-
accepts_fn(f); //~ error: `f` doesnt implement `for<'a> Fn(&'a ()) -> &'a ()`
94+
accepts_fn(f); //~ error: `f` doesn't implement `for<'a> Fn(&'a ()) -> &'a ()`
9595
accepts_fn_2(f) // works
9696

9797
accepts_fn(late) // works

src/what-does-early-late-bound-mean.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn foo_late<'a, T>(_: &'a u32, _: T) {}
4747
fn accepts_hr_func<F: for<'a> Fn(&'a u32, u32)>(_: F) {}
4848

4949
fn main() {
50-
// doesnt work, the substituted bound is `for<'a> FnDef<'?0>: Fn(&'a u32, u32)`
50+
// doesn't work, the substituted bound is `for<'a> FnDef<'?0>: Fn(&'a u32, u32)`
5151
// `foo_early` only implements `for<'a> FnDef<'a>: Fn(&'a u32, u32)`- the lifetime
5252
// of the borrow in the function argument must be the same as the lifetime
5353
// on the `FnDef`.
@@ -116,11 +116,11 @@ fn foo3<'a, T: 'a>(_: &'a T) {}
116116
fn foo4<'a, 'b: 'a>(_: Inv<&'a ()>, _: Inv<&'b ()>) {}
117117
// ^^ ^^ ^^^ note:
118118
// ^^ ^^ `Inv` stands for `Invariant` and is used to
119-
// ^^ ^^ make the the type parameter invariant. This
119+
// ^^ ^^ make the type parameter invariant. This
120120
// ^^ ^^ is necessary for demonstration purposes as
121121
// ^^ ^^ `for<'a, 'b> fn(&'a (), &'b ())` and
122122
// ^^ ^^ `for<'a> fn(&'a u32, &'a u32)` are subtypes-
123-
// ^^ ^^ of eachother which makes the bound trivially
123+
// ^^ ^^ of each other which makes the bound trivially
124124
// ^^ ^^ satisfiable when making the fnptr. `Inv`
125125
// ^^ ^^ disables this subtyping.
126126
// ^^ ^^

0 commit comments

Comments
 (0)