Skip to content

Rustc dev guide subtree update #136254

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 27 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5be02d6
Add `@bors rollup=never` to rustc-push PR body
Kobzol Jan 21, 2025
0974081
Merge pull request #2217 from Kobzol/bors-rollup-never
jieyouxu Jan 21, 2025
353d916
Revert "Add `@bors rollup=never` to rustc-push PR body"
Kobzol Jan 24, 2025
17a14b6
fix(solve/significant-changes): typo
ada4a Jan 24, 2025
93d73d3
Merge pull request #2220 from rust-lang/revert-2217-bors-rollup-never
jieyouxu Jan 24, 2025
bda5664
Merge pull request #2221 from ada4a/patch-1
JohnTitor Jan 25, 2025
1392e07
CI: use key-restore for cache GH action
marxin Jan 25, 2025
40e051f
Update boring lines to sync with rustdoc
ehuss Jan 25, 2025
20818c4
Remove accidental leading empty line in code block
fmease Jan 26, 2025
c8ed8d4
Merge pull request #2224 from ehuss/rustdoc-boring
fmease Jan 26, 2025
5210a8d
Correct information on dylib compression
ehuss Jan 26, 2025
f6bd61a
Merge pull request #2225 from ehuss/patch-3
tshepang Jan 26, 2025
885641b
Merge pull request #2223 from marxin/CI-cache-restore-key
camelid Jan 26, 2025
2412289
Fix rustc-pull CI's bash commands
Kobzol Jan 27, 2025
3d4b24a
Merge pull request #2226 from Kobzol/rustc-pull-ci-bash
jieyouxu Jan 28, 2025
d63796f
Update about-this-guide.md
Joren-vanGoethem Jan 28, 2025
62102ee
Preparing for merge from rustc
BoxyUwU Jan 28, 2025
815c5d4
Merge from rustc
BoxyUwU Jan 28, 2025
5861aa2
Add some extra pointers for rustdoc frontend devs
notriddle Jan 28, 2025
941ab8c
Add "Writing tests" section
yegeunyang Jan 29, 2025
0127e64
Add link to declare_lint! macro
yegeunyang Jan 29, 2025
8520031
Merge pull request #2229 from notriddle/typescript
jieyouxu Jan 29, 2025
d8cca31
Merge pull request #2232 from yegeunyang/#2114
jieyouxu Jan 29, 2025
4260e3a
Touch up a sentence
yegeunyang Jan 29, 2025
7fa9822
Merge pull request #2231 from yegeunyang/#2069
jieyouxu Jan 29, 2025
bec4359
Merge pull request #2227 from Joren-vanGoethem/master
jieyouxu Jan 29, 2025
0b48908
Rustc pull
BoxyUwU Jan 29, 2025
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
6 changes: 4 additions & 2 deletions src/doc/rustc-dev-guide/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
uses: actions/cache/restore@v4
with:
path: book/linkcheck/cache.json
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}
restore-keys: |
linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--

- name: Install latest nightly Rust toolchain
if: steps.mdbook-cache.outputs.cache-hit != 'true'
Expand All @@ -66,7 +68,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: book/linkcheck/cache.json
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}

- name: Deploy to gh-pages
if: github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc-dev-guide/.github/workflows/rustc-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
RESULT=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | length' --json title`
if [[ "$RESULT" -eq 0 ]]; then
echo "Creating new pull request"
PR_URL=gh pr create -B master --title 'Rustc pull update' --body 'Latest update from rustc.'
PR_URL=`gh pr create -B master --title 'Rustc pull update' --body 'Latest update from rustc.'`
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
else
PR_URL=gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title
PR_URL=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title`
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
fi
env:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ecda83b30f0f68cf5692855dddc0bc38ee8863fc
66d6064f9eb888018775e08f84747ee6f39ba28e
1 change: 0 additions & 1 deletion src/doc/rustc-dev-guide/src/about-this-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ You might also find the following sites useful:
- The [Rust reference][rr], even though it doesn't specifically talk about
Rust's internals, is a great resource nonetheless
- Although out of date, [Tom Lee's great blog article][tlgba] is very helpful
- [rustaceans.org][ro] is helpful, but mostly dedicated to IRC
- The [Rust Compiler Testing Docs][rctd]
- For [@bors], [this cheat sheet][cheatsheet] is helpful
- Google is always helpful when programming.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ format is specific to `rustc`, and may change over time. This file contains:
### dylib

A `dylib` is a platform-specific shared library. It includes the `rustc`
[metadata] in a special link section called `.rustc` in a compressed format.
[metadata] in a special link section called `.rustc`.

### rmeta

Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ as the linter walks the AST. You can then choose to emit lints in a
very similar way to compile errors.

You also declare the metadata of a particular lint via the `declare_lint!`
macro. This includes the name, the default level, a short description, and some
macro. [This macro](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html) includes the name, the default level, a short description, and some
more details.

Note that the lint and the lint pass must be registered with the compiler.
Expand Down
64 changes: 32 additions & 32 deletions src/doc/rustc-dev-guide/src/early_late_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ In this example we call `foo`'s function item type twice, each time with a borro
If the lifetime parameter on `foo` was late bound this would be able to compile as each caller could provide a different lifetime argument for its borrow. See the following example which demonstrates this using the `bar` function defined above:

```rust
#fn foo<'a: 'a>(b: &'a String) -> &'a String { b }
#fn bar<'a>(b: &'a String) -> &'a String { b }

# fn foo<'a: 'a>(b: &'a String) -> &'a String { b }
# fn bar<'a>(b: &'a String) -> &'a String { b }
#
// Early bound parameters are instantiated here, however as `'a` is
// late bound it is not provided here.
let b = bar;
Expand Down Expand Up @@ -220,24 +220,24 @@ Then, for the first case, we can call each function with a single lifetime argum
```rust
#![deny(late_bound_lifetime_arguments)]

#fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#
#struct Foo;
# struct Foo;
#
#trait Trait: Sized {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
#}
# trait Trait: Sized {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
# }
#
#impl Trait for Foo {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#}
# impl Trait for Foo {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# }
#
#impl Foo {
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#}
# impl Foo {
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# }
#
// Specifying as many arguments as there are early
// bound parameters is always a future compat warning
Expand All @@ -251,24 +251,24 @@ free_function::<'static>(&(), &());

For the second case we call each function with more lifetime arguments than there are lifetime parameters (be it early or late bound) and note that method calls result in a FCW as opposed to the free/associated functions which result in a hard error:
```rust
#fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#
#struct Foo;
# struct Foo;
#
#trait Trait: Sized {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
#}
# trait Trait: Sized {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
# }
#
#impl Trait for Foo {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#}
# impl Trait for Foo {
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# }
#
#impl Foo {
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
#}
# impl Foo {
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
# }
#
// Specifying more arguments than there are early
// bound parameters is a future compat warning when
Expand Down Expand Up @@ -421,4 +421,4 @@ impl<'a> Fn<()> for FooFnItem<'a> {
type Output = &'a String;
/* fn call(...) -> ... { ... } */
}
```
```
4 changes: 4 additions & 0 deletions src/doc/rustc-dev-guide/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ pull request, continuing the work on the feature.

[abandoned-prs]: https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AS-inactive+is%3Aclosed

### Writing tests

Issues that have been resolved but do not have a regression test are marked with the `E-needs-test` label. Writing unit tests is a low-risk, lower-priority task that offers new contributors a great opportunity to familiarize themselves with the testing infrastructure and contribution workflow.

### Contributing to std (standard library)

See [std-dev-guide](https://std-dev-guide.rust-lang.org/).
Expand Down
9 changes: 9 additions & 0 deletions src/doc/rustc-dev-guide/src/rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
* If you want to copy those docs to a webserver, copy all of
`build/host/doc`, since that's where the CSS, JS, fonts, and landing
page are.
* For frontend debugging, disable the `rust.docs-minification` option in [`config.toml`].
* Use `./x test tests/rustdoc*` to run the tests using a stage1
rustdoc.
* See [Rustdoc internals] for more information about tests.

[`config.toml`]: ./building/how-to-build-and-run.md

## Code structure

* All paths in this section are relative to `src/librustdoc` in the rust-lang/rust repository.
Expand All @@ -77,6 +80,7 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
* The tests on the structure of rustdoc HTML output are located in `tests/rustdoc`, where
they're handled by the test runner of bootstrap and the supplementary script
`src/etc/htmldocck.py`.
* Frontend CSS and JavaScript are stored in `html/static/`.

## Tests

Expand All @@ -91,6 +95,11 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
browser-UI-test](https://github.com/GuillaumeGomez/browser-UI-test/) that uses
puppeteer to run tests in a headless browser and check rendering and
interactivity.
* Additionally, JavaScript type annotations are written using [TypeScript-flavored JSDoc]
comments and an external d.ts file. The code itself is plain, valid JavaScript; we only
use tsc as a linter.

[TypeScript-flavored JSDoc]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html

## Constraints

Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/solve/significant-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ old implementation structurally relates the aliases instead. This enables the
new solver to stall equality until it is able to normalize the related aliases.

The behavior of the old solver is incomplete and relies on eager normalization
which replaces ambiguous aliases with inference variables. As this is not
which replaces ambiguous aliases with inference variables. As this is
not possible for aliases containing bound variables, the old implementation does
not handle aliases inside of binders correctly, e.g. [#102048]. See the chapter on
[normalization] for more details.
Expand Down
Loading