Fix some comments
Signed-off-by: JohnEndson <jiayuzhen@outlook.com>
This commit is contained in:
parent
b93095aade
commit
69c820a470
|
|
@ -19,7 +19,7 @@ Example of case (1):
|
||||||
```rust
|
```rust
|
||||||
type Opaque<X> = impl Sized;
|
type Opaque<X> = impl Sized;
|
||||||
|
|
||||||
// `T` is a type paramter.
|
// `T` is a type parameter.
|
||||||
// Opaque<T> := ();
|
// Opaque<T> := ();
|
||||||
fn good<T>() -> Opaque<T> {}
|
fn good<T>() -> Opaque<T> {}
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ fn bad<T>(t: T) -> Opaque<T, T> { t } //~ ERROR
|
||||||
```
|
```
|
||||||
**Motivation:** In the first case `Opaque<()> := ()`, the hidden type is ambiguous because
|
**Motivation:** In the first case `Opaque<()> := ()`, the hidden type is ambiguous because
|
||||||
it is compatible with two different interpretaions: `Opaque<X> := X` and `Opaque<X> := ()`.
|
it is compatible with two different interpretaions: `Opaque<X> := X` and `Opaque<X> := ()`.
|
||||||
Similarily for the second case `Opaque<T, T> := T`, it is ambiguous whether it should be
|
Similarly for the second case `Opaque<T, T> := T`, it is ambiguous whether it should be
|
||||||
interpreted as `Opaque<X, Y> := X` or as `Opaque<X, Y> := Y`.
|
interpreted as `Opaque<X, Y> := X` or as `Opaque<X, Y> := Y`.
|
||||||
Because of this ambiguity, both cases are rejected as invalid defining uses.
|
Because of this ambiguity, both cases are rejected as invalid defining uses.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ let
|
||||||
''
|
''
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
/* ... */
|
/* ... */
|
||||||
# This environment varaible tells bootstrap where our config.toml is.
|
# This environment variable tells bootstrap where our config.toml is.
|
||||||
RUST_BOOTSTRAP_CONFIG = config;
|
RUST_BOOTSTRAP_CONFIG = config;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ error: Please commit or stash them.
|
||||||
(See <https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F#_the_three_states> for the difference between the two.)
|
(See <https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F#_the_three_states> for the difference between the two.)
|
||||||
|
|
||||||
This means you have made changes since the last time you made a commit. To be able to rebase, either
|
This means you have made changes since the last time you made a commit. To be able to rebase, either
|
||||||
commit your changes, or make a temporary commit called a "stash" to have them still not be commited
|
commit your changes, or make a temporary commit called a "stash" to have them still not be committed
|
||||||
when you finish rebasing. You may want to configure git to make this "stash" automatically, which
|
when you finish rebasing. You may want to configure git to make this "stash" automatically, which
|
||||||
will prevent the "cannot rebase" error in nearly all cases:
|
will prevent the "cannot rebase" error in nearly all cases:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ a few of them do not hold in Rust right now. This is either a fundamental to its
|
||||||
caused by bugs and something that may change in the future.
|
caused by bugs and something that may change in the future.
|
||||||
|
|
||||||
It is important to know about the things you can assume while working on - and with - the
|
It is important to know about the things you can assume while working on - and with - the
|
||||||
type system, so here's an incomplete and inofficial list of invariants of
|
type system, so here's an incomplete and unofficial list of invariants of
|
||||||
the core type system:
|
the core type system:
|
||||||
|
|
||||||
- ✅: this invariant mostly holds, with some weird exceptions, you can rely on it outside
|
- ✅: this invariant mostly holds, with some weird exceptions, you can rely on it outside
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ closure type. Closures are [currently unsound](https://github.com/rust-lang/rust
|
||||||
ways that are closely related to the distinction between early/late bound
|
ways that are closely related to the distinction between early/late bound
|
||||||
parameters (more on this later)
|
parameters (more on this later)
|
||||||
|
|
||||||
The early/late boundness of generic parameters is only relevent for the desugaring of
|
The early/late boundness of generic parameters is only relevant for the desugaring of
|
||||||
functions/closures into types with builtin `Fn*` impls. It does not make sense to talk about
|
functions/closures into types with builtin `Fn*` impls. It does not make sense to talk about
|
||||||
in other contexts.
|
in other contexts.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue