Skip to content

Commit f17e862

Browse files
committed
Increase heading level of all headings
This increases the heading level so that RFCs do not contain multiple level-1 headings. mdbook expects that chapters have only a single level-1 heading (and that usually should be at the very top). More than one h1 element on a page is generally not recommended (for example, https://www.a11yproject.com/posts/how-to-accessible-heading-structure/#one-h1).
1 parent 9289533 commit f17e862

File tree

616 files changed

+8405
-8438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

616 files changed

+8405
-8438
lines changed

0000-template.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000)
44
- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000)
55

6-
# Summary
6+
## Summary
77
[summary]: #summary
88

99
One paragraph explanation of the feature.
1010

11-
# Motivation
11+
## Motivation
1212
[motivation]: #motivation
1313

1414
Any changes to Rust should focus on solving a problem that users of Rust are having.
@@ -19,7 +19,7 @@ This can then be used to guide the design of the feature.
1919

2020
This section is one of the most important sections of any RFC, and can be lengthy.
2121

22-
# Guide-level explanation
22+
## Guide-level explanation
2323
[guide-level-explanation]: #guide-level-explanation
2424

2525
Explain the proposal as if it was already included in the language and you were teaching it to another Rust programmer. That generally means:
@@ -33,7 +33,7 @@ Explain the proposal as if it was already included in the language and you were
3333

3434
For implementation-oriented RFCs (e.g. for compiler internals), this section should focus on how compiler contributors should think about the change, and give examples of its concrete impact. For policy RFCs, this section should provide an example-driven introduction to the policy, and explain its impact in concrete terms.
3535

36-
# Reference-level explanation
36+
## Reference-level explanation
3737
[reference-level-explanation]: #reference-level-explanation
3838

3939
This is the technical portion of the RFC. Explain the design in sufficient detail that:
@@ -44,20 +44,20 @@ This is the technical portion of the RFC. Explain the design in sufficient detai
4444

4545
The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work.
4646

47-
# Drawbacks
47+
## Drawbacks
4848
[drawbacks]: #drawbacks
4949

5050
Why should we *not* do this?
5151

52-
# Rationale and alternatives
52+
## Rationale and alternatives
5353
[rationale-and-alternatives]: #rationale-and-alternatives
5454

5555
- Why is this design the best in the space of possible designs?
5656
- What other designs have been considered and what is the rationale for not choosing them?
5757
- What is the impact of not doing this?
5858
- If this is a language proposal, could this be done in a library or macro instead? Does the proposed change make Rust code easier or harder to read, understand, and maintain?
5959

60-
# Prior art
60+
## Prior art
6161
[prior-art]: #prior-art
6262

6363
Discuss prior art, both the good and the bad, in relation to this proposal.
@@ -74,14 +74,14 @@ If there is no prior art, that is fine - your ideas are interesting to us whethe
7474
Note that while precedent set by other languages is some motivation, it does not on its own motivate an RFC.
7575
Please also take into consideration that rust sometimes intentionally diverges from common language features.
7676

77-
# Unresolved questions
77+
## Unresolved questions
7878
[unresolved-questions]: #unresolved-questions
7979

8080
- What parts of the design do you expect to resolve through the RFC process before this gets merged?
8181
- What parts of the design do you expect to resolve through the implementation of this feature before stabilization?
8282
- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?
8383

84-
# Future possibilities
84+
## Future possibilities
8585
[future-possibilities]: #future-possibilities
8686

8787
Think about what the natural extension and evolution of your proposal would

libs_changes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RFC guidelines - libraries sub-team
22

3-
# Motivation
3+
## Motivation
44

55
* RFCs are heavyweight:
66
* RFCs generally take at minimum 2 weeks from posting to land. In
@@ -42,7 +42,7 @@ the RFC process, it is important that we be maximally friendly towards their
4242
needs.
4343

4444

45-
# Is an RFC required?
45+
## Is an RFC required?
4646

4747
The overarching philosophy is: *do whatever is easiest*. If an RFC
4848
would be less work than an implementation, that's a good sign that an RFC is
@@ -66,7 +66,7 @@ as `std` has become more conservative in favour of the much more agile cargovers
6666
* **Do the easier thing** if uncertain. (choosing a path is not final)
6767

6868

69-
# Non-RFC process
69+
## Non-RFC process
7070

7171
* A (non-RFC) PR is likely to be **closed** if clearly not acceptable:
7272
* Disproportionate breaking change (small inference breakage may be acceptable)

text/0001-private-fields.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
- RFC PR: [rust-lang/rfcs#1](https://github.com/rust-lang/rfcs/pull/1)
33
- Rust Issue: [rust-lang/rust#8122](https://github.com/rust-lang/rust/issues/8122)
44

5-
# Summary
5+
## Summary
66

77
This is an RFC to make all struct fields private by default. This includes both
88
tuple structs and structural structs.
99

10-
# Motivation
10+
## Motivation
1111

1212
Reasons for default private visibility
1313

@@ -38,7 +38,7 @@ Reasons for inherited visibility (today's design)
3838
* Private definitions certainly want private fields (to hide implementation
3939
details).
4040

41-
# Detailed design
41+
## Detailed design
4242

4343
Currently, rustc has two policies for dealing with the privacy of struct fields:
4444

@@ -146,13 +146,13 @@ This RFC does not impact enum variants in any way. All enum variants will
146146
continue to inherit privacy from the outer enum type. This includes both the
147147
fields of tuple variants as well as fields of struct variants in enums.
148148

149-
# Alternatives
149+
## Alternatives
150150

151151
The main alternative to this design is what is currently implemented today,
152152
where fields inherit the privacy of the outer structure. The pros and cons of
153153
this strategy are discussed above.
154154

155-
# Unresolved questions
155+
## Unresolved questions
156156

157157
As the above statistics show, almost all structures are either all public or all
158158
private. This RFC provides an easy method to make struct fields all private, but

text/0002-rfc-process.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
- RFC PR: [rust-lang/rfcs#2](https://github.com/rust-lang/rfcs/pull/2), [rust-lang/rfcs#6](https://github.com/rust-lang/rfcs/pull/6)
33
- Rust Issue: N/A
44

5-
# Summary
5+
## Summary
66

77
The "RFC" (request for comments) process is intended to provide a
88
consistent and controlled path for new features to enter the language
99
and standard libraries, so that all stakeholders can be confident about
1010
the direction the language is evolving in.
1111

12-
# Motivation
12+
## Motivation
1313

1414
The freewheeling way that we add new features to Rust has been good for
1515
early development, but for Rust to become a mature platform we need to
@@ -18,7 +18,7 @@ This is a proposal for a more principled RFC process to make it
1818
a more integral part of the overall development process, and one that is
1919
followed consistently to introduce features to Rust.
2020

21-
# Detailed design
21+
## Detailed design
2222

2323
Many changes, including bug fixes and documentation improvements can be
2424
implemented and reviewed via the normal GitHub pull request workflow.
@@ -27,7 +27,7 @@ Some changes though are "substantial", and we ask that these be put
2727
through a bit of a design process and produce a consensus among the Rust
2828
community and the [core team].
2929

30-
## When you need to follow this process
30+
### When you need to follow this process
3131

3232
You need to follow this process if you intend to make "substantial"
3333
changes to the Rust distribution. What constitutes a "substantial"
@@ -53,7 +53,7 @@ If you submit a pull request to implement a new feature without going
5353
through the RFC process, it may be closed with a polite request to
5454
submit an RFC first.
5555

56-
## What the process is
56+
### What the process is
5757

5858
In short, to get a major feature added to Rust, one must first get the
5959
RFC merged into the RFC repo as a markdown file. At that point the RFC
@@ -99,7 +99,7 @@ after becoming active is 'inactive' and moves to the 'inactive' folder.
9999

100100
[Active RFC List]: ../README.md#active-rfc-list
101101

102-
# Alternatives
102+
## Alternatives
103103

104104
Retain the current informal RFC process. The newly proposed RFC process is
105105
designed to improve over the informal process in the following ways:
@@ -111,7 +111,7 @@ understand why new features are being merged
111111

112112
As an alternative, we could adopt an even stricter RFC process than the one proposed here. If desired, we should likely look to Python's [PEP] process for inspiration.
113113

114-
# Unresolved questions
114+
## Unresolved questions
115115

116116
1. Does this RFC strike a favorable balance between formality and agility?
117117
2. Does this RFC successfully address the aforementioned issues with the current

text/0003-attribute-usage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
- RFC PR: [rust-lang/rfcs#3](https://github.com/rust-lang/rfcs/pull/3)
33
- Rust Issue: [rust-lang/rust#14373](https://github.com/rust-lang/rust/issues/14373)
44

5-
# Summary
5+
## Summary
66

77
Rust currently has an attribute usage lint but it does not work particularly
88
well. This RFC proposes a new implementation strategy that should make it
99
significantly more useful.
1010

11-
# Motivation
11+
## Motivation
1212

1313
The current implementation has two major issues:
1414

@@ -39,7 +39,7 @@ pub struct Foo {
3939
}
4040
```
4141

42-
# Detailed design
42+
## Detailed design
4343

4444
The current implementation is implemented as a simple fold over the AST,
4545
comparing attributes against a whitelist. Crate-level attributes use a separate
@@ -82,15 +82,15 @@ Attributes in code that has been eliminated with `#[cfg()]` will not be linted,
8282
but I feel that this is consistent with the way `#[cfg()]` works in general
8383
(e.g. the code won't be type-checked either).
8484

85-
# Alternatives
85+
## Alternatives
8686

8787
An alternative would be to rewrite `rustc::middle::lint` to robustly check
8888
that attributes are used where they're supposed to be. This will be fairly
8989
complex and be prone to failure if/when more nodes are added to the AST. This
9090
also doesn't solve motivation #2, which would require externally loaded lint
9191
support.
9292

93-
# Unresolved questions
93+
## Unresolved questions
9494

9595
+ This implementation doesn't allow for a distinction between "unused" and
9696
"unknown" attributes. The `#[phase(syntax)]` crate loading infrastructure could

text/0008-new-intrinsics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
design may still be useful in the future, but before implementing we
77
would prefer to revisit it so as to be sure it is up to date.**
88

9-
# Summary
9+
## Summary
1010

1111
The way our intrinsics work forces them to be wrapped in order to
1212
behave like normal functions. As a result, rustc is forced to inline a
@@ -17,7 +17,7 @@ in the language so that they behave the same as normal Rust functions
1717
by removing the "rust-intrinsic" foreign ABI and reusing the "Rust"
1818
ABI.
1919

20-
# Motivation
20+
## Motivation
2121

2222
A number of commonly-used intrinsics, including `transmute`, `forget`,
2323
`init`, `uninit`, and `move_val_init`, are accessed through wrappers
@@ -39,7 +39,7 @@ let transmute: fn(int) -> uint = intrinsics::transmute;
3939
This incongruity means that we can't just expose the intrinsics
4040
directly as part of the public API.
4141

42-
# Detailed design
42+
## Detailed design
4343

4444
`extern "Rust" fn` is already equivalent to `fn`, so if intrinsics
4545
have the "Rust" ABI then the problem is solved.
@@ -66,7 +66,7 @@ abstractions.
6666
Currently, "Rust" foreign functions may not be generic; this change
6767
will require a special case that allows intrinsics to be generic.
6868

69-
# Alternatives
69+
## Alternatives
7070

7171
1. Instead of making intrinsics lang items we could create a slightly
7272
different mechanism, like an `#[intrinsic]` attribute, that would
@@ -78,6 +78,6 @@ continue letting intrinsics to be redeclared.
7878
3. We could also make "rust-intrinsic" coerce or otherwise be the same
7979
as "Rust" externs and normal Rust functions.
8080

81-
# Unresolved questions
81+
## Unresolved questions
8282

8383
None.

text/0016-more-attributes.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
- RFC PR: [rust-lang/rfcs#16](https://github.com/rust-lang/rfcs/pull/16)
33
- Rust Issue: [rust-lang/rust#15701](https://github.com/rust-lang/rust/issues/15701)
44

5-
# Summary
5+
## Summary
66

77
Allow attributes on more places inside functions, such as statements,
88
blocks and expressions.
99

10-
# Motivation
10+
## Motivation
1111

1212
One sometimes wishes to annotate things inside functions with, for
1313
example, lint `#[allow]`s, conditional compilation `#[cfg]`s, and even
@@ -43,7 +43,7 @@ The minimum useful functionality would be supporting attributes on
4343
blocks and `let` statements, since these are flexible enough to allow
4444
for relatively precise attribute handling.
4545

46-
# Detailed design
46+
## Detailed design
4747

4848
Normal attribute syntax on `let` statements, blocks and expressions.
4949

@@ -74,7 +74,7 @@ fn foo() {
7474
Attributes bind tighter than any operator, that is `#[attr] x op y` is
7575
always parsed as `(#[attr] x) op y`.
7676

77-
## `cfg`
77+
### `cfg`
7878

7979
It is definitely an error to place a `#[cfg]` attribute on a
8080
non-statement expressions, that is, `attr1`--`attr4` can possibly be
@@ -87,7 +87,7 @@ the ability for attributes to be placed in specific places, it is not
8787
mandating that `#[cfg]` actually be stripped in those places (although
8888
it should be an error if it is ignored).
8989

90-
## Inner attributes
90+
### Inner attributes
9191

9292
Inner attributes can be placed at the top of blocks (and other
9393
structure incorporating a block) and apply to that block.
@@ -118,7 +118,7 @@ match bar {
118118
}
119119
```
120120

121-
## `if`
121+
### `if`
122122

123123
Attributes would be disallowed on `if` for now, because the
124124
interaction with `if`/`else` chains are funky, and can be simulated in
@@ -174,7 +174,7 @@ match cond {
174174
}
175175
```
176176

177-
# Drawbacks
177+
## Drawbacks
178178

179179
This starts mixing attributes with nearly arbitrary code, possibly
180180
dramatically restricting syntactic changes related to them, for
@@ -189,7 +189,7 @@ reason about, but (also stated), this RFC is not for making such
189189
`#[cfg]`s be obeyed, it just opens the language syntax to possibly
190190
allow it.
191191

192-
# Alternatives
192+
## Alternatives
193193

194194
These instances could possibly be approximated with macros and helper
195195
functions, but to a low degree degree (e.g. how would one annotate a
@@ -209,7 +209,7 @@ difference between interior and exterior for an `else {` branch, and
209209
so `else #[attr] {` is sufficient.
210210

211211

212-
# Unresolved questions
212+
## Unresolved questions
213213

214214
Are the complications of allowing attributes on arbitrary
215215
expressions worth the benefits?

0 commit comments

Comments
 (0)