Skip to content

Commit 7354b42

Browse files
RCoder01tshepang
authored andcommitted
Consistent ordered list indexing
1 parent 01a51b2 commit 7354b42

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

Diff for: src/bug-fix-procedure.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Please see [the RFC][rfc 1122] for full details!
5353
The procedure for making a breaking change is as follows (each of these steps is
5454
described in more detail below):
5555

56-
0. Do a **crater run** to assess the impact of the change.
57-
1. Make a **special tracking issue** dedicated to the change.
58-
1. Do not report an error right away. Instead, **issue forwards-compatibility
56+
1. Do a **crater run** to assess the impact of the change.
57+
2. Make a **special tracking issue** dedicated to the change.
58+
3. Do not report an error right away. Instead, **issue forwards-compatibility
5959
lint warnings**.
6060
- Sometimes this is not straightforward. See the text below for suggestions
6161
on different techniques we have employed in the past.
@@ -65,7 +65,7 @@ described in more detail below):
6565
- Submit PRs to all known affected crates that fix the issue
6666
- or, at minimum, alert the owners of those crates to the problem and
6767
direct them to the tracking issue
68-
1. Once the change has been in the wild for at least one cycle, we can
68+
4. Once the change has been in the wild for at least one cycle, we can
6969
**stabilize the change**, converting those warnings into errors.
7070

7171
Finally, for changes to `rustc_ast` that will affect plugins, the general policy

Diff for: src/macro-expansion.md

+39-39
Original file line numberDiff line numberDiff line change
@@ -48,45 +48,45 @@ iteration, this represents a compile error. Here is the [algorithm][original]:
4848
[fef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/expand/struct.MacroExpander.html#method.fully_expand_fragment
4949
[original]: https://github.com/rust-lang/rust/pull/53778#issuecomment-419224049
5050

51-
0. Initialize an `queue` of unresolved macros.
52-
1. Repeat until `queue` is empty (or we make no progress, which is an error):
53-
0. [Resolve](./name-resolution.md) imports in our partially built crate as
54-
much as possible.
55-
1. Collect as many macro [`Invocation`s][inv] as possible from our
56-
partially built crate (fn-like, attributes, derives) and add them to the
57-
queue.
58-
2. Dequeue the first element, and attempt to resolve it.
59-
3. If it's resolved:
60-
0. Run the macro's expander function that consumes a [`TokenStream`] or
61-
AST and produces a [`TokenStream`] or [`AstFragment`] (depending on
62-
the macro kind). (A `TokenStream` is a collection of [`TokenTree`s][tt],
63-
each of which are a token (punctuation, identifier, or literal) or a
64-
delimited group (anything inside `()`/`[]`/`{}`)).
65-
- At this point, we know everything about the macro itself and can
66-
call `set_expn_data` to fill in its properties in the global data;
67-
that is the hygiene data associated with `ExpnId`. (See [the
68-
"Hygiene" section below][hybelow]).
69-
1. Integrate that piece of AST into the big existing partially built
70-
AST. This is essentially where the "token-like mass" becomes a
71-
proper set-in-stone AST with side-tables. It happens as follows:
72-
- If the macro produces tokens (e.g. a proc macro), we parse into
73-
an AST, which may produce parse errors.
74-
- During expansion, we create `SyntaxContext`s (hierarchy 2). (See
75-
[the "Hygiene" section below][hybelow])
76-
- These three passes happen one after another on every AST fragment
77-
freshly expanded from a macro:
78-
- [`NodeId`]s are assigned by [`InvocationCollector`]. This
79-
also collects new macro calls from this new AST piece and
80-
adds them to the queue.
81-
- ["Def paths"][defpath] are created and [`DefId`]s are
82-
assigned to them by [`DefCollector`].
83-
- Names are put into modules (from the resolver's point of
84-
view) by [`BuildReducedGraphVisitor`].
85-
2. After expanding a single macro and integrating its output, continue
86-
to the next iteration of [`fully_expand_fragment`][fef].
87-
4. If it's not resolved:
88-
0. Put the macro back in the queue
89-
1. Continue to next iteration...
51+
1. Initialize an `queue` of unresolved macros.
52+
2. Repeat until `queue` is empty (or we make no progress, which is an error):
53+
1. [Resolve](./name-resolution.md) imports in our partially built crate as
54+
much as possible.
55+
2. Collect as many macro [`Invocation`s][inv] as possible from our
56+
partially built crate (fn-like, attributes, derives) and add them to the
57+
queue.
58+
3. Dequeue the first element, and attempt to resolve it.
59+
4. If it's resolved:
60+
1. Run the macro's expander function that consumes a [`TokenStream`] or
61+
AST and produces a [`TokenStream`] or [`AstFragment`] (depending on
62+
the macro kind). (A `TokenStream` is a collection of [`TokenTree`s][tt],
63+
each of which are a token (punctuation, identifier, or literal) or a
64+
delimited group (anything inside `()`/`[]`/`{}`)).
65+
- At this point, we know everything about the macro itself and can
66+
call `set_expn_data` to fill in its properties in the global data;
67+
that is the hygiene data associated with `ExpnId`. (See [the
68+
"Hygiene" section below][hybelow]).
69+
2. Integrate that piece of AST into the big existing partially built
70+
AST. This is essentially where the "token-like mass" becomes a
71+
proper set-in-stone AST with side-tables. It happens as follows:
72+
- If the macro produces tokens (e.g. a proc macro), we parse into
73+
an AST, which may produce parse errors.
74+
- During expansion, we create `SyntaxContext`s (hierarchy 2). (See
75+
[the "Hygiene" section below][hybelow])
76+
- These three passes happen one after another on every AST fragment
77+
freshly expanded from a macro:
78+
- [`NodeId`]s are assigned by [`InvocationCollector`]. This
79+
also collects new macro calls from this new AST piece and
80+
adds them to the queue.
81+
- ["Def paths"][defpath] are created and [`DefId`]s are
82+
assigned to them by [`DefCollector`].
83+
- Names are put into modules (from the resolver's point of
84+
view) by [`BuildReducedGraphVisitor`].
85+
3. After expanding a single macro and integrating its output, continue
86+
to the next iteration of [`fully_expand_fragment`][fef].
87+
5. If it's not resolved:
88+
1. Put the macro back in the queue
89+
2. Continue to next iteration...
9090

9191
[defpath]: hir.md#identifiers-in-the-hir
9292
[`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/node_id/struct.NodeId.html

Diff for: src/part-5-intro.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ Now, we will finally take the MIR and produce some executable machine code.
2121
2222
So what do we need to do?
2323

24-
0. First, we need to collect the set of things to generate code for.
24+
1. First, we need to collect the set of things to generate code for.
2525
In particular,
2626
we need to find out which concrete types to substitute for generic ones,
2727
since we need to generate code for the concrete types.
2828
Generating code for the concrete types
2929
(i.e. emitting a copy of the code for each concrete type) is called _monomorphization_,
3030
so the process of collecting all the concrete types is called _monomorphization collection_.
31-
1. Next, we need to actually lower the MIR to a codegen IR
31+
2. Next, we need to actually lower the MIR to a codegen IR
3232
(usually LLVM IR) for each concrete type we collected.
33-
2. Finally, we need to invoke the codegen backend,
33+
3. Finally, we need to invoke the codegen backend,
3434
which runs a bunch of optimization passes,
3535
generates executable code,
3636
and links together an executable binary.

Diff for: src/stability.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ Furthermore this attribute is needed to mark an intrinsic as callable from
7272

7373
To stabilize a feature, follow these steps:
7474

75-
0. Ask a **@T-libs-api** member to start an FCP on the tracking issue and wait for
75+
1. Ask a **@T-libs-api** member to start an FCP on the tracking issue and wait for
7676
the FCP to complete (with `disposition-merge`).
77-
1. Change `#[unstable(...)]` to `#[stable(since = "CURRENT_RUSTC_VERSION")]`.
78-
2. Remove `#![feature(...)]` from any test or doc-test for this API. If the feature is used in the
77+
2. Change `#[unstable(...)]` to `#[stable(since = "CURRENT_RUSTC_VERSION")]`.
78+
3. Remove `#![feature(...)]` from any test or doc-test for this API. If the feature is used in the
7979
compiler or tools, remove it from there as well.
80-
3. If applicable, change `#[rustc_const_unstable(...)]` to
80+
4. If applicable, change `#[rustc_const_unstable(...)]` to
8181
`#[rustc_const_stable(since = "CURRENT_RUSTC_VERSION")]`.
82-
4. Open a PR against `rust-lang/rust`.
82+
5. Open a PR against `rust-lang/rust`.
8383
- Add the appropriate labels: `@rustbot modify labels: +T-libs-api`.
8484
- Link to the tracking issue and say "Closes #XXXXX".
8585

0 commit comments

Comments
 (0)