Skip to content
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

chore: fix some typos in conments #1961

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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/implementing_new_features.md
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ a new unstable feature:

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

Note that this block must be in alphbetical order.
Note that this block must be in alphabetical order.

1. Add a feature gate declaration to `rustc_feature/src/unstable.rs` in the unstable
`declare_features` block.
4 changes: 2 additions & 2 deletions src/thir.md
Original file line number Diff line number Diff line change
@@ -144,12 +144,12 @@ Thir {
span: oneplustwo.rs:2:13: 2:18 (#0),
kind: Binary {
op: Add,
// references to scopes surronding literals above
// references to scopes surrounding literals above
lhs: e1,
rhs: e3,
},
},
// expression 5, scope surronding expression 4
// expression 5, scope surrounding expression 4
Expr {
ty: i32,
temp_lifetime: Some(
2 changes: 1 addition & 1 deletion src/turbofishing-and-early-late-bound.md
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ fn accepts_fn_2(_: impl Fn(&'static ()) -> &'static ()) {}
fn main() {
let f = late::<'static>;

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

accepts_fn(late) // works
6 changes: 3 additions & 3 deletions src/what-does-early-late-bound-mean.md
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ fn foo_late<'a, T>(_: &'a u32, _: T) {}
fn accepts_hr_func<F: for<'a> Fn(&'a u32, u32)>(_: F) {}

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