Skip to content

latest version #3

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

Merged
merged 272 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
4ec434a
don't capitalize Undefined Behavior
Tiger0202 Aug 15, 2024
7009ea4
Merge pull request #1575 from RalfJung/ub
Tiger0202 Aug 15, 2024
6f503ee
Rewrite std_links
Tiger0202 Aug 17, 2024
cf34668
Switch mdbook-spec to build with release
Tiger0202 Aug 17, 2024
9cc7fab
Switch to automatic standard library links
Tiger0202 Aug 17, 2024
d8afb6b
Note some limitations of automatic std links
Tiger0202 Aug 17, 2024
caf5edd
Document the SPEC_RELATIVE option
Tiger0202 Aug 17, 2024
7de0d01
Add some basic docs for unsafe attrs
Tiger0202 Jul 21, 2024
501e757
Wordsmith text for unsafe attributes
Tiger0202 Jul 22, 2024
4a4db8e
Fix grammar for unsafe attributes
Tiger0202 Jul 22, 2024
5fd2cb5
Add to unsafety section for unsafe attributes
Tiger0202 Jul 22, 2024
e36508c
Fix the Attr grammar for unsafe attributes.
Tiger0202 Jul 25, 2024
39b9526
Use `unsafe` in the unsafe attribute examples.
Tiger0202 Jul 25, 2024
e918cf8
Merge pull request #1539 from carbotaniuman/add-unsafe-attr-docs
Tiger0202 Aug 19, 2024
e16450d
Optimize a bit
Tiger0202 Aug 20, 2024
a136907
Make some idiomatic tweaks
Tiger0202 Aug 20, 2024
311b413
Merge pull request #1578 from ehuss/std-links
Tiger0202 Aug 20, 2024
a34406a
operator expressions: add &raw
Tiger0202 Aug 10, 2024
feea143
use &raw instead of addr_of macros
Tiger0202 Aug 12, 2024
a229d14
markdown anchor tweaks
Tiger0202 Aug 18, 2024
df2f3dd
Merge pull request #1567 from RalfJung/raw-ptr-op
Tiger0202 Aug 20, 2024
aaacdaa
Merge pull request #1568 from compiler-errors/repr-transparent
Tiger0202 Aug 20, 2024
d89491c
bytes inside implicitly const-promoted expressions are immutable
Tiger0202 Aug 2, 2024
ffbd67d
clarify limitations on type system consts
Tiger0202 Aug 21, 2024
d70cd55
Make requested and CI stylistic changes to destructors.md identifiers
Tiger0202 Aug 21, 2024
880b132
Remove double line break from comments.md
Tiger0202 Aug 21, 2024
2fb357b
Add identifier syntax to identifiers.md
Tiger0202 Aug 22, 2024
4f7a360
Add spec identifier syntax to input-format.md
Tiger0202 Aug 22, 2024
2066db2
Merge pull request #1554 from RalfJung/promoted-immutable
Tiger0202 Aug 22, 2024
1cf8f0a
Merge pull request #1559 from mattheww/2024-08_pub_in_path
Tiger0202 Aug 22, 2024
e3d3c5b
Be consistent about how "Edition differences" is capitalized
Tiger0202 Aug 22, 2024
06dda7d
Remove stray newline
Tiger0202 Aug 23, 2024
172ac42
Merge pull request #1571 from chorman0773/spec-add-identifiers-destru…
Tiger0202 Aug 23, 2024
bd8b53e
Merge pull request #1566 from RalfJung/const-fn-float
Tiger0202 Aug 26, 2024
cadfc4a
Sync denied lints with upstream
Tiger0202 Aug 26, 2024
6c91560
const_eval: update for const_mut_refs and const_refs_to_cell stabiliz…
Tiger0202 Aug 27, 2024
4622546
Merge pull request #1589 from ehuss/idioms
Tiger0202 Aug 27, 2024
fa19f6c
Merge pull request #1586 from ehuss/edition-differences-capitalization
Tiger0202 Aug 27, 2024
1e24d68
Update enum.md
Tiger0202 May 2, 2023
80639e6
Merge pull request #1354 from ShalokShalom/patch-1
Tiger0202 Aug 27, 2024
903ad38
talk about const contexts, not const items
Tiger0202 Aug 28, 2024
c89cb2c
Add a prefix to rule HTML IDs
Tiger0202 Aug 28, 2024
c43a70b
Add a description of rule identifiers
Tiger0202 Aug 28, 2024
4722ccb
Allow admonition blockquotes with blank lines
Tiger0202 Aug 29, 2024
a65b9a1
Include the admonition term at the start of the admonition
Tiger0202 Aug 29, 2024
e05801c
Fix indented admonitions
Tiger0202 Aug 29, 2024
9dd841e
Merge pull request #1594 from ehuss/rule-description
Tiger0202 Aug 29, 2024
1d88e18
Merge pull request #1593 from ehuss/rule-prefix
Tiger0202 Aug 29, 2024
838bdb5
De-wrap warning blocks
Tiger0202 Aug 29, 2024
0018a1c
Switch warnings from div to blockquote admonitions
Tiger0202 Aug 29, 2024
712cd50
Update comment now that warnings use admonitions
Tiger0202 Aug 29, 2024
b6ab307
Fix CSS styling for warning admonitions
Tiger0202 Aug 29, 2024
726c011
stabilize `const_extern_fn`
Tiger0202 Aug 29, 2024
63b0b59
asm!: clarify that `nomem` / `readonly` can access "private" memory
Tiger0202 Aug 30, 2024
3e5dffd
Merge pull request #1577 from rust-lang/TC/precise-capturing
Tiger0202 Aug 30, 2024
7ba7c2b
stdcall is only a valid ABI on x86, except on windows
Tiger0202 Sep 3, 2024
419b155
Merge pull request #1600 from RalfJung/no-stdcall
Tiger0202 Sep 3, 2024
ff915b7
Merge pull request #1595 from ehuss/warning-div
Tiger0202 Sep 3, 2024
b285132
Merge pull request #1598 from lukas-code/asm-mem
Tiger0202 Sep 3, 2024
7392bd6
Document limitations on block doc comments
Tiger0202 Sep 7, 2024
7599e6d
also mention 'static's as a possible base for place projections
Tiger0202 Sep 9, 2024
33ca0cd
Update type_system.md
Tiger0202 Sep 9, 2024
fb4fb1f
Update type_system.md with proper Enum name
Tiger0202 Sep 9, 2024
8fc749b
Reword first sentence to be more specific.
Tiger0202 Sep 9, 2024
44ad71e
type-layout: mention that call ABI compatibility is a separate concern
Tiger0202 Sep 10, 2024
cf66339
Explain how to name rule identifiers
Tiger0202 Sep 10, 2024
078939f
Fixup exhaustive enum examples
Tiger0202 Sep 10, 2024
72257cd
Merge pull request #1607 from mixy1/patch-1
Tiger0202 Sep 10, 2024
9dfbb0c
Add identifier syntax to statements.md
Tiger0202 Sep 12, 2024
a975dd3
Update keywords.md
Tiger0202 Sep 14, 2024
61afffa
Merge pull request #1612 from montmorill/patch-1
Tiger0202 Sep 15, 2024
d5ddb19
Merge pull request #1590 from RalfJung/const-mut-refs
Tiger0202 Sep 15, 2024
8e77f0c
Merge pull request #1596 from folkertdev/stabilize-const-extern-fn
Tiger0202 Sep 15, 2024
6b3c3de
Add identifier syntax to subtyping.md
Tiger0202 Sep 16, 2024
f702e59
Add identifier syntax to type-layout.md
Tiger0202 Sep 16, 2024
218e406
Merge pull request #1608 from RalfJung/layout-is-not-abi
Tiger0202 Sep 17, 2024
c0e3291
Merge pull request #1606 from RalfJung/static-place-proj
Tiger0202 Sep 17, 2024
b9f4d73
Make note about markdown a note
Tiger0202 Sep 17, 2024
15a12bd
Merge pull request #1602 from GKFX/invalid-block-docs
Tiger0202 Sep 17, 2024
9892c81
Switch to normalization
Tiger0202 Sep 17, 2024
5fa1087
Remove ascii-limitations specific rules
Tiger0202 Sep 17, 2024
b38d401
Merge pull request #1584 from chorman0773/spec-add-identifiers-input-…
Tiger0202 Sep 17, 2024
2a17968
Add spec identifier syntax to interior-mutability.md
Tiger0202 Aug 22, 2024
d6e2ba7
Merge pull request #1585 from chorman0773/spec-add-identifiers-interi…
Tiger0202 Sep 17, 2024
6b5e30d
Add identifier syntax to types and subchapters.
Tiger0202 Sep 19, 2024
ce1c5fa
Remove extraneous trailing whitespace
Tiger0202 Sep 19, 2024
4d7609b
Apply suggestions from code review
Tiger0202 Sep 19, 2024
02ba9ff
Fix compilation issues in mdbook
Tiger0202 Sep 19, 2024
56c5e07
Add spec identifier syntax to `unsafe-keyword.md` and `unsafety.md`
Tiger0202 Sep 19, 2024
2826c68
Add identifier syntax to lexer chapters
Tiger0202 Sep 19, 2024
52312ae
do not talk about the 'address of a constant'
Tiger0202 Sep 22, 2024
80099f8
Merge pull request #1624 from RalfJung/const-has-no-addr
Tiger0202 Sep 22, 2024
c9f5df9
Remove restriction and constraint keywords
Tiger0202 Sep 23, 2024
7a23c68
Add idenfitiers to mbe and proc-macro
Tiger0202 Sep 23, 2024
c4780c1
Remove double line breaks
Tiger0202 Sep 23, 2024
2cb8528
Add identifiers to variables.md
Tiger0202 Sep 23, 2024
ff682b4
Add identifier syntax to visibility-and-privacy.md
Tiger0202 Sep 23, 2024
cb027f8
Fix identifier duplication `lex.token.literal.str-raw.content`
Tiger0202 Sep 23, 2024
9f43b7f
Hecking trailing space
Tiger0202 Sep 23, 2024
46a3ae6
Add newline to lexical-structure.md
Tiger0202 Sep 23, 2024
9afc995
Add spec identifiers to crates-and-source-files.md
Tiger0202 Aug 13, 2024
db11046
Fix formatting of crates-and-source-files.md
Tiger0202 Aug 13, 2024
227e44a
Remove double line break from crates-and-source-files.md
Tiger0202 Aug 21, 2024
217b4f0
Tweak rule names
Tiger0202 Sep 24, 2024
8a273e7
Merge pull request #1627 from chorman0773/spec-add-identifiers-visibi…
Tiger0202 Sep 24, 2024
560be62
Add review changes
Tiger0202 Sep 24, 2024
435eec5
Authoring guide: clarify standard library linking
Tiger0202 Sep 24, 2024
a5b41b7
Merge pull request #1563 from chorman0773/spec-add-identifiers-comments
Tiger0202 Sep 24, 2024
657f5bb
Merge pull request #1629 from ehuss/links-authoring
Tiger0202 Sep 24, 2024
46a1b9b
Add identifier syntax to trait-bounds.md
Tiger0202 Sep 26, 2024
641cf74
Add identifier syntax to type-coercions.md
Tiger0202 Sep 26, 2024
ce21183
Put `.intro` on identifier for intro paragraph of `coerce.least-upper…
Tiger0202 Sep 26, 2024
98c1359
Add identifier syntax to linkage.md
Tiger0202 Sep 26, 2024
46774cd
Apply requested changes from T-lang/docs
Tiger0202 Sep 26, 2024
89f7e05
Document naming conventions for admonition identifiers
Tiger0202 Sep 26, 2024
df666d9
Mention `--print cfg` under set configuration options
Tiger0202 Sep 28, 2024
fce7b35
Clarify definition of "immutable bytes"
Tiger0202 Sep 29, 2024
fd37367
Add two more WebAssembly features to the list of accepted ones
Tiger0202 Oct 1, 2024
1313d2d
Also add info on the tail-call proposal
Tiger0202 Oct 1, 2024
5850823
Fix misspellings
Tiger0202 Oct 2, 2024
1aad33f
Some minor rule identifier tweaks
Tiger0202 Oct 2, 2024
bfbb8cd
Merge pull request #1625 from chorman0773/spec-add-identifiers-macros…
Tiger0202 Oct 2, 2024
8f13367
Add `expr_2021` macro fragment specifier
Tiger0202 Oct 2, 2024
176acfa
Add expr_2021 to FOLLOW set rules
Tiger0202 Aug 20, 2024
b78a62e
Merge pull request #1580 from ehuss/2024-expr
Tiger0202 Oct 2, 2024
97ad750
Sort macro fragment specifiers
Tiger0202 Oct 2, 2024
0c83a24
Fix typos and formatting.
Tiger0202 Oct 3, 2024
ddca609
Remove "version history"
Tiger0202 Oct 3, 2024
d8db08a
Remove "singular forms"
Tiger0202 Oct 3, 2024
8bc5361
Merge pull request #1609 from chorman0773/spec-identifiers-explanation
Tiger0202 Oct 3, 2024
8f59020
Fix inline-assembly documentation for LoongArch
Tiger0202 Oct 4, 2024
2a3f1f0
Merge pull request #1644 from taiki-e/asm-fix
Tiger0202 Oct 5, 2024
fe8c290
Add preview artifacts in CI
Tiger0202 Oct 8, 2024
f6d15b1
Add restriction for cfg_attr with crate_type and crate_name
Tiger0202 Oct 8, 2024
9bbd3dd
Apply suggestions from code review
Tiger0202 Oct 10, 2024
f016dd2
trait bounds grammar: make `?` and `for<>` mutually exclusive
Tiger0202 Oct 11, 2024
be8f40d
Merge pull request #1650 from lukas-code/❓for<>
Tiger0202 Oct 12, 2024
9446153
Merge pull request #1647 from ehuss/preview-artifact
Tiger0202 Oct 12, 2024
df4fe1e
Merge pull request #1637 from RalfJung/immutable
Tiger0202 Oct 12, 2024
0807795
Merge pull request #1614 from chorman0773/spec-add-identifier-type-la…
Tiger0202 Oct 12, 2024
0eaa42e
Move rules handling to its own module
Tiger0202 Oct 7, 2024
9373134
Move Spec creation out of main
Tiger0202 Oct 7, 2024
5dc3dd9
Move rule collection into a separate pass with a new structure
Tiger0202 Oct 7, 2024
6fd3f12
Add tracking of rule prefixes
Tiger0202 Oct 7, 2024
2c69550
More directly document the SPEC_RELATIVE environment variable
Tiger0202 Oct 7, 2024
5274669
Document SPEC_DENY_WARNINGS
Tiger0202 Oct 7, 2024
4e9227c
Add test linking
Tiger0202 Oct 7, 2024
99c65ec
Link the appendix
Tiger0202 Oct 10, 2024
167ac4e
Add a little clarity around who is responsible for what
Tiger0202 Oct 10, 2024
1bafe5b
CI: Update preview job to include test links
Tiger0202 Oct 12, 2024
6047c71
Merge pull request #1611 from chorman0773/spec-add-identifiers-statem…
Tiger0202 Oct 17, 2024
c184207
Merge pull request #1613 from chorman0773/spec-add-identifiers-subtyping
Tiger0202 Oct 17, 2024
312e516
Merge pull request #1618 from chorman0773/spec-add-identifiers-types
Tiger0202 Oct 17, 2024
642865a
Merge pull request #1619 from chorman0773/spec-add-identifiers-unsafety
Tiger0202 Oct 17, 2024
d5e3c85
Merge pull request #1620 from chorman0773/spec-add-identifiers-lex-rest
Tiger0202 Oct 17, 2024
a358353
Merge pull request #1626 from chorman0773/spec-add-identifiers-variables
Tiger0202 Oct 17, 2024
430f658
Merge pull request #1632 from chorman0773/spec-add-identifiers-type-c…
Tiger0202 Oct 17, 2024
83684d8
Merge pull request #1633 from chorman0773/spec-add-identifier-linkage
Tiger0202 Oct 17, 2024
cd776a9
Merge pull request #1570 from chorman0773/spec-add-identifiers-crates…
Tiger0202 Oct 17, 2024
a51288c
Merge pull request #1583 from chorman0773/spec-add-identifiers-identi…
Tiger0202 Oct 17, 2024
0515d0b
Allow `deny` inside `forbid` as a no-op
Tiger0202 Oct 18, 2024
5d2ca7e
Merge pull request #1655 from Noratrieb/lint-deny-inside-forbid
Tiger0202 Oct 21, 2024
fbd00a8
Merge pull request #1646 from ehuss/test-summary
Tiger0202 Oct 21, 2024
540ac90
Add identifier syntax to attributes.md
Tiger0202 Aug 6, 2024
6e9117c
Add identifier syntax to attributes.codegen
Tiger0202 Aug 6, 2024
029898f
Add identifier syntax to attributes.debugger
Tiger0202 Aug 6, 2024
4f62f7c
Add identifier syntax to attributes.derive
Tiger0202 Aug 6, 2024
f906af5
Add identifier syntax to attributes.diagnostics
Tiger0202 Aug 6, 2024
20f1ff1
Add identifier syntax to attributes.limits
Tiger0202 Aug 6, 2024
23652c5
Add identifier syntax to attributes.testing
Tiger0202 Aug 6, 2024
3d14faf
Add identifier syntax to attributes.type_system
Tiger0202 Aug 6, 2024
6f39e37
Fix style in modified chapters
Tiger0202 Aug 8, 2024
3397e09
Appease link-checker
Tiger0202 Aug 8, 2024
e31ed97
Apply suggestions from PR review
Tiger0202 Sep 10, 2024
b5362cc
Replace uses of `constraint` and `restriction` in attributes chapters.
Tiger0202 Sep 26, 2024
8ce2c5a
Add identifiers to behaviour-considered-undefined.md
Tiger0202 Aug 8, 2024
a1ca311
Remove double line breaks from behaviour-considered-undefined
Tiger0202 Aug 21, 2024
d3a8783
Add identifier syntax to conditional-compilation.md
Tiger0202 Aug 8, 2024
f099fed
Fix duplicate key cfg.target_env.general
Tiger0202 Aug 8, 2024
6a8863a
Use proper keys in cfg.target_abi
Tiger0202 Aug 8, 2024
e1b12cc
I'm 0/3 on duplicate attributes, 4th times the charm?
Tiger0202 Aug 8, 2024
131f224
Remove double linebreaks from conditional-compilation.md
Tiger0202 Aug 21, 2024
abe3986
Add identifiers to const_eval.md
Tiger0202 Aug 13, 2024
b72d519
Remove double line break from const_eval
Tiger0202 Aug 21, 2024
b440726
Update src/trait-bounds.md
Tiger0202 Oct 21, 2024
785f2ef
Add identifier syntax to macro-ambiguity.md
Tiger0202 Sep 26, 2024
e0da140
Fix identifiers in Definitions & Conventions section
Tiger0202 Oct 21, 2024
790450b
Merge pull request #1562 from chorman0773/spec-add-identifiers-behavi…
Tiger0202 Oct 21, 2024
396da34
Merge pull request #1564 from chorman0773/spec-add-identifiers-condit…
Tiger0202 Oct 21, 2024
e63f320
Merge pull request #1634 from chorman0773/spec-add-identifiers-macro-…
Tiger0202 Oct 21, 2024
0067561
Merge pull request #1631 from chorman0773/spec-add-identifiers-trait-…
Tiger0202 Oct 21, 2024
40280c6
Merge pull request #1569 from chorman0773/spec-add-identifiers-const_…
Tiger0202 Oct 21, 2024
1d77d91
mdbook-spec: Fix Spec::new visibility
Tiger0202 Oct 21, 2024
35a887a
Add ability to set the rust root directory via the API
Tiger0202 Oct 21, 2024
7c445d7
Fix example broken by recent rustc change
Tiger0202 Oct 22, 2024
506c4a3
Remove `ignore` on windows test
Tiger0202 Oct 22, 2024
4ed8f63
Clarify that "macro attributes" refers to proc macros
Tiger0202 Oct 22, 2024
cb59922
Merge pull request #1659 from ehuss/fix-stdcall
Tiger0202 Oct 22, 2024
d9e83b3
Merge pull request #1658 from ehuss/spec-pub
Tiger0202 Oct 22, 2024
fb3c393
Merge pull request #1660 from joshtriplett/clarify-attrs
Tiger0202 Oct 22, 2024
4f09bea
Document mixed-site hygiene.
Tiger0202 Oct 19, 2024
759bebf
Prepare PR #1656 to be merged
Tiger0202 Oct 22, 2024
3434f27
Merge pull request #1656 from GoldsteinE/mixed-site-hygiene
Tiger0202 Oct 22, 2024
d9d0575
Merge pull request #1641 from ehuss/sort-fragments
Tiger0202 Oct 22, 2024
04d366d
Merge pull request #1649 from ehuss/cfg_attr-crate_name-crate_type
Tiger0202 Oct 22, 2024
4ca4834
Fix `pat` fragment specifier to be the "current" edition
Tiger0202 Oct 2, 2024
f189e0c
Merge pull request #1640 from ehuss/pat-edition
Tiger0202 Oct 22, 2024
d638f0d
Merge `--print cfg` with existing note block
Tiger0202 Oct 22, 2024
2779707
Merge pull request #1636 from tgross35/rustc-print-cfg
Tiger0202 Oct 22, 2024
55b20b5
Rename "object safe" to "dyn compatible"
Tiger0202 Oct 28, 2024
eaf83b9
Fix linkchecker for object-safety
Tiger0202 Oct 30, 2024
0a2d233
Move historical reference into an editorial note
Tiger0202 Oct 30, 2024
c5db4b0
Remove link to RFC 255
Tiger0202 Oct 30, 2024
867d907
Merge pull request #1666 from fmease/mv-obj-safe-dyn-compat
Tiger0202 Oct 30, 2024
f5a825d
Add identifier syntax to items.md and subchapters
Tiger0202 Aug 30, 2024
0850e67
Remove trailing spaces
Tiger0202 Sep 12, 2024
ce0ac44
Consistently use "items"
Tiger0202 Oct 30, 2024
67eb919
Rule annotation cleanup
Tiger0202 Oct 31, 2024
e949f30
Merge pull request #1599 from chorman0773/spec-add-identifiers-items
Tiger0202 Oct 31, 2024
6f976ce
fix typo referring to 'Unsize' trait
Tiger0202 Nov 1, 2024
3dbcc88
Merge pull request #1669 from astraw/fix-unsize-typo
Tiger0202 Nov 1, 2024
88f3c28
Update lifetimes for pre-expansion validation
Tiger0202 Oct 30, 2024
8280ebc
Fix header link for The Rust Representation
Tiger0202 Oct 30, 2024
4ca74b7
Further remove the "default" representation
Tiger0202 Oct 30, 2024
66b8c77
trait object constraint correction
Tiger0202 Nov 5, 2024
1c50098
Merge pull request #1668 from ehuss/label-pre-expansion
Tiger0202 Nov 5, 2024
eb8a26b
Merge pull request #1667 from ehuss/fix-header-link
Tiger0202 Nov 5, 2024
a477391
Update wording to be "not more than one"
Tiger0202 Nov 5, 2024
93f452d
Merge pull request #1670 from pazmank/master
Tiger0202 Nov 5, 2024
a08450e
Add s390x to inline-assembly documentation
Tiger0202 Nov 10, 2024
3ed8864
Merge pull request #1643 from taiki-e/s390x-asm
Tiger0202 Nov 10, 2024
8ccaf6b
Add Arm64EC to inline-assembly documentation
Tiger0202 Nov 9, 2024
7f03477
Merge pull request #1638 from alexcrichton/add-more-wasm-features
Tiger0202 Nov 11, 2024
248dc76
Merge pull request #1653 from taiki-e/arm64ec-asm
Tiger0202 Nov 11, 2024
deec7d2
Explaining how to link mixed C/Rust binaries.
Tiger0202 Jun 24, 2020
d2ebcbd
Merge pull request #838 from adetaylor/mixed_codebases
Tiger0202 Nov 12, 2024
7953af5
Add examples to clarify the casting rules
Tiger0202 Sep 29, 2019
657fbd0
Update example for changes in float behavior
Tiger0202 Nov 14, 2024
17f3e49
Avoid the use of overflowing_literals in the examples
Tiger0202 Nov 14, 2024
85418af
Merge pull request #686 from emilk/add-cast-examples
Tiger0202 Nov 14, 2024
e0ec920
fix typos
Tiger0202 Nov 14, 2024
0a95bc6
Merge pull request #1674 from CramBL/fix-typos
Tiger0202 Nov 14, 2024
60aa1a4
Fix various spelling and format errors
Tiger0202 Nov 15, 2024
2684f6f
Add back some newlines that were removed
Tiger0202 Nov 15, 2024
04f6c6a
Remove some double blank lines
Tiger0202 Nov 15, 2024
72f7551
Remove annotations from the attribute index
Tiger0202 Nov 15, 2024
2bb8df9
Change a few rule names
Tiger0202 Nov 15, 2024
ca23373
Use plural `diagnostics` for diagnostics chapter
Tiger0202 Nov 15, 2024
ad51135
Merge pull request #1560 from chorman0773/spec-add-identifiers-attrib…
Tiger0202 Nov 15, 2024
a5b23db
Merge branch 'Gankra-patch-1' into master
Tiger0202 Dec 11, 2024
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
49 changes: 45 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -35,6 +35,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout rust-lang/rust
uses: actions/checkout@master
with:
repository: rust-lang/rust
path: rust
- name: Update rustup
run: rustup self update
- name: Install Rust
@@ -52,16 +57,17 @@ jobs:
rustup --version
rustc -Vv
mdbook --version
- name: Verify the book builds
env:
SPEC_DENY_WARNINGS: 1
run: mdbook build
- name: Style checks
working-directory: style-check
run: cargo run --locked -- ../src
- name: Style fmt
working-directory: style-check
run: cargo fmt --check
- name: Verify the book builds
env:
SPEC_DENY_WARNINGS: 1
SPEC_RUST_ROOT: ${{ github.workspace }}/rust
run: mdbook build
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
@@ -98,6 +104,40 @@ jobs:
working-directory: ./mdbook-spec
run: cargo fmt --check

preview:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout rust-lang/rust
uses: actions/checkout@master
with:
repository: rust-lang/rust
path: rust
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Build the book
env:
SPEC_RELATIVE: 0
SPEC_RUST_ROOT: ${{ github.workspace }}/rust
run: mdbook build --dest-dir dist/preview-${{ github.event.pull_request.number }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: preview-${{ github.event.pull_request.number }}
overwrite: true
path: dist

# The success job is here to consolidate the total success/failure state of
# all other jobs. This job is then included in the GitHub branch protection
# rule which prevents merges unless all other jobs are passing. This makes
@@ -110,6 +150,7 @@ jobs:
- code-tests
- style-tests
- mdbook-spec
# preview is explicitly excluded here since it doesn't run on merge
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,13 +61,27 @@ To build the Reference locally (in `build/`) and open it in a web
browser, run:

```sh
mdbook build --open
SPEC_RELATIVE=0 mdbook build --open
```

This will open a browser with a websocket live-link to automatically reload whenever the source is updated.

You can also open any current build of the reference by running:
You can also use mdbook's live webserver option, which will automatically rebuild the book and reload your web browser whenever a source file is modified:

```sh
mdbook serve --open
SPEC_RELATIVE=0 mdbook serve --open
```

### `SPEC_RELATIVE`

The `SPEC_RELATIVE=0` environment variable makes links to the standard library go to <https://doc.rust-lang.org/> instead of being relative, which is useful when viewing locally since you normally don't have a copy of the standard library.

The published site at <https://doc.rust-lang.org/reference/> (or local docs using `rustup doc`) does not set this, which means it will use relative links which supports offline viewing and links to the correct version (for example, links in <https://doc.rust-lang.org/1.81.0/reference/> will stay within the 1.81.0 directory).

### `SPEC_DENY_WARNINGS`

The `SPEC_DENY_WARNINGS=1` environment variable will turn all warnings generated by `mdbook-spec` to errors. This is used in CI to ensure that there aren't any problems with the book content.

### `SPEC_RUST_ROOT`

The `SPEC_RUST_ROOT` can be used to point to the directory of a checkout of <https://github.com/rust-lang/rust>. This is used by the test-linking feature so that it can find tests linked to reference rules. If this is not set, then the tests won't be linked.
3 changes: 2 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ author = "The Rust Project Developers"

[output.html]
additional-css = ["theme/reference.css"]
additional-js = ["theme/reference.js"]
git-repository-url = "https://github.com/rust-lang/reference/"
edit-url-template = "https://github.com/rust-lang/reference/edit/master/{path}"
smart-punctuation = true
@@ -18,7 +19,7 @@ smart-punctuation = true
edition = "2021"

[preprocessor.spec]
command = "cargo run --manifest-path mdbook-spec/Cargo.toml"
command = "cargo run --release --manifest-path mdbook-spec/Cargo.toml"

[build]
extra-watch-dirs = ["mdbook-spec/src"]
53 changes: 51 additions & 2 deletions docs/authoring.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ This document serves as a guide for editors and reviewers. Some conventions and
* Code blocks should have an explicit language tag.
* Do not wrap long lines. This helps with reviewing diffs of the source.
* Use [smart punctuation] instead of Unicode characters. For example, use `---` for em-dash instead of the Unicode character. Characters like em-dash can be difficult to see in a fixed-width editor, and some editors may not have easy methods to enter such characters.
* Links should be relative with the `.md` extension. Links to other rust-lang books that are published with the reference or the standard library API should also be relative so that the linkchecker can validate them.
* Links should be relative with the `.md` extension. Links to other rust-lang books that are published with the reference should also be relative so that the linkchecker can validate them.
* Links to the standard library should use rustdoc-style links described in [Standard library links](#standard-library-links).
* The use of reference links is preferred, with shortcuts if appropriate. Place the sorted link reference definitions at the bottom of the file, or at the bottom of a section if there are an unusually large number of links that are specific to the section.

```markdown
@@ -75,6 +76,45 @@ Rules can be linked to by their ID using markdown such as `[foo.bar]`. There are

In the HTML, the rules are clickable just like headers.

When assigning rules to new paragraphs, or when modifying rule names, use the following guidelines:

1. A rule applies to one core idea, which should be easily determined when reading the paragraph it is applied to.
2. Other than the "intro" paragraph, purely explanatory, expository, or exemplary content does not need a rule. If the expository paragraph isn't directly related to the previous, separate it with a hard (rendered) line break.
* This content will be moved to `[!NOTE]` or more specific admonitions in the future.
3. Rust code examples and tests do not need their own rules.
4. Use the following guidelines for admonitions:
* Notes: Do not include a rule.
* Warning: Omit the rule if the warning follows from the previous paragraph or if the warning is explanatory and doesn't introduce any new rules.
* Target specific behavior: Always include the rule.
* Edition differences: Always include the rule.
5. The following keywords should be used to identify paragraphs when unambiguous:
* `intro`: The beginning paragraph of each section - should explain the construct being defined overall.
* `syntax`: Syntax definitions or explanations when BNF syntax definitions are not used.
* `namespace`: For items only, specifies the namespace(s) the item introduces a name in. May also be used elsewhere when defining a namespace (e.g. `r[attribute.diagnostic.namespace]`).
6. When a rule doesn't fall under the above keywords, or for section rule ids, name the subrule as follows:
* If the rule is naming a specific Rust language construct (e.g. an attribute, standard library type/function, or keyword-introduced concept), use the construct as named in the language, appropriately case-adjusted (but do not replace `_`s with `-`s).
* Other than Rust language concepts with `_`s in the name, use `-` characters to separate words within a "subrule".
* Whenever possible, do not repeat previous components of the rule.
* Edition differences admonitions should typically be named by the edition referenced directly by the rule. If multiple editions are named, use the one for which the behavior is defined by the admonition, and not by a previous paragraph.
* Target specific admonitions should typically be named by the least specific target property to which they apply (e.g. if a rule affects all x86 CPUs, the rule name should include `x86` rather than separately listing `i586`, `i686` and `x86_64`, and if a rule applies to all ELF platforms, it should be named `elf` rather than listing every ELF OS).
* Use an appropriately descriptive, but short, name if the language does not provide one.

#### Test rule annotations

Tests in <https://github.com/rust-lang/rust> can be linked to rules in the reference. The rule will include a link to the tests, and there is also an [appendix] which tracks how the rules are currently linked.

Tests in the `tests` directory can be annotated with the `//@ reference: x.y.z` header to link it to a rule. The header can be specified multiple times if a single file covers multiple rules.

Compiler developers are not expected to add `reference` annotations to tests. However, if they do want to help, their cooperation is very welcome. Reference authors and editors are responsible for making sure every rule has a test associated with it.

The tests are beneficial for reviewers to see the behavior of a rule. It is also a benefit to readers who may want to see examples of particular behaviors. When adding new rules, you should wait until the reference side is approved before submitting a PR to `rust-lang/rust` (to avoid churn if we decide on different names).

Prefixed rule names should not be used in tests. That is, do not use something like `asm.rules` when there are specific rules like `asm.rules.reg-not-input`.

We are not expecting 100% coverage at any time. Although it would be nice, it is unrealistic due to the sequence things are developed, and resources available.

[appendix]: https://doc.rust-lang.org/nightly/reference/test-summary.html

### Standard library links

You should link to the standard library without specifying a URL in a fashion similar to [rustdoc intra-doc links][intra]. Some examples:
@@ -109,6 +149,15 @@ Explicit namespace disambiguation is also supported:
[`std::vec`](mod@std::vec)
```

Beware there are some limitations, for example:

- Links to rexports from `std_arch` don't work due to <https://github.com/rust-lang/rust/issues/96506>.
- Links to keywords aren't supported.
- Links to trait impls where the trait is not in the prelude doesn't work. Traits must be in scope, and there currently isn't a way to add those.
- If there are multiple generic implementations, it will link to one randomly (see <https://github.com/rust-lang/rust/issues/76895>).

When running into a rustdoc limitation, consider manually linking to the correct page using a relative link. For example, `../std/arch/macro.is_x86_feature_detected.html`.

[intra]: https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html

### Admonitions
@@ -145,4 +194,4 @@ The reference does not document which targets exist, or the properties of specif

### Editions

The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition Differences" block.
The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition differences" block.
32 changes: 31 additions & 1 deletion mdbook-spec/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions mdbook-spec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,7 +13,10 @@ anyhow = "1.0.79"
mdbook = { version = "0.4.36", default-features = false }
once_cell = "1.19.0"
pathdiff = "0.2.1"
# Try to keep in sync with mdbook.
pulldown-cmark = { version = "0.10.3", default-features = false }
regex = "1.9.4"
semver = "1.0.21"
serde_json = "1.0.113"
tempfile = "3.10.1"
walkdir = "2.5.0"
Loading