Commit Graph

2650 Commits

Author SHA1 Message Date
Nicholas Nethercote ed695f4484 Separate `Analysis` and `Results`.
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate
thing about this is that the analysis needs to be mutable everywhere
(`&mut Analysis`) which forces the `Results` to be mutable everywhere,
even though `EntryStates` is immutable everywhere.

To fix this, this commit renames `Results` as `AnalysisAndResults`,
renames `EntryStates` as `Results`, and separates the analysis and
results as much as possible. (`AnalysisAndResults` doesn't get much use,
it's mostly there to facilitate method chaining of
`iterate_to_fixpoint`.)

`Results` is immutable everywhere, which:
- is a bit clearer on how the data is used,
- avoids an unnecessary clone of entry states in
  `locals_live_across_suspend_points`, and
- moves the results outside the `RefCell` in Formatter.

The commit also reformulates `ResultsHandle` as the generic `CowMut`,
which is simpler than `ResultsHandle` because it doesn't need the
`'tcx` lifetime and the trait bounds. It also which sits nicely
alongside the new use of `Cow` in `ResultsCursor`.
2025-04-24 11:36:07 +10:00
Jieyou Xu dd639a47fe
rustc-dev-guide: document that `//@ add-core-stubs` imply `-Cforce-unwind-tables=yes` 2025-04-23 17:18:20 +08:00
Manuel Drehwald e74f97682c update build and test instructions 2025-04-22 01:16:04 -04:00
The rustc-dev-guide Cronjob Bot 4c6635291d Merge from rustc 2025-04-21 04:03:09 +00:00
Chris Denton c1b574ef00
Rollup merge of #140044 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? ``@ghost``
2025-04-20 13:02:49 +00:00
Tshepang Mbambo 43a4aedbbe improve readability by adding pauses 2025-04-19 17:58:12 +02:00
Tshepang Mbambo 0e5847e7c8 fix grammar 2025-04-19 17:58:12 +02:00
Tshepang Mbambo 58d5664e4e needed a stronger pause 2025-04-19 17:51:41 +02:00
Chris Denton 6cbd6c0838
Rollup merge of #138934 - onur-ozkan:extended-config-profiles, r=Kobzol
support config extensions

_Copied from the `rustc-dev-guide` addition:_

>When working on different tasks, you might need to switch between different bootstrap >configurations.
>Sometimes you may want to keep an old configuration for future use. But saving raw config >values in
>random files and manually copying and pasting them can quickly become messy, especially if >you have a
>long history of different configurations.
>
>To simplify managing multiple configurations, you can create config extensions.
>
>For example, you can create a simple config file named `cross.toml`:
>
>```toml
>[build]
>build = "x86_64-unknown-linux-gnu"
>host = ["i686-unknown-linux-gnu"]
>target = ["i686-unknown-linux-gnu"]
>
>
>[llvm]
>download-ci-llvm = false
>
>[target.x86_64-unknown-linux-gnu]
>llvm-config = "/path/to/llvm-19/bin/llvm-config"
>```
>
>Then, include this in your `bootstrap.toml`:
>
>```toml
>include = ["cross.toml"]
>```
>
>You can also include extensions within extensions recursively.
>
>**Note:** In the `include` field, the overriding logic follows a right-to-left order. For example,
in `include = ["a.toml", "b.toml"]`, extension `b.toml` overrides `a.toml`. Also, parent extensions
always overrides the inner ones.

try-job: x86_64-mingw-2
2025-04-19 15:09:32 +00:00
许杰友 Jieyou Xu (Joe) 3587bad938
Merge pull request #2346 from folkertdev/bootstrap-in-dependencies 2025-04-19 22:13:41 +08:00
Folkert de Vries 4aa47cdf02
document `#[cfg(bootstrap)]` in dependencies 2025-04-19 16:09:18 +02:00
Tshepang Mbambo 3a23ec2529 fix broken link 2025-04-19 16:04:22 +02:00
The rustc-dev-guide Cronjob Bot 87eb26fc96 Merge from rustc 2025-04-19 13:53:12 +00:00
Haowei Hsu a250445f8e fix(docs): add newlines between prefix/suffix chapters
add newlines between prefix/suffix chapters in SUMMARY.md
to ensure correct extraction by mdbook-i18n-helpers.
2025-04-18 18:49:34 +08:00
Manuel Drehwald 23c4b36751 upstream autodiff build instructions 2025-04-17 20:52:07 -04:00
Jieyou Xu bde086e3fa
rustc-dev-guide: document `//@ ignore-auxiliary` 2025-04-17 18:52:57 +08:00
许杰友 Jieyou Xu (Joe) b8d3c51b30
Merge pull request #2339 from rust-lang/autodiff-docs 2025-04-17 14:03:30 +08:00
Manuel Drehwald 5cedd19842
add a first version of autodiff docs 2025-04-17 14:01:05 +08:00
Matthias Krüger 960baa6bb3
Rollup merge of #139770 - nnethercote:rename-LifetimeName, r=BoxyUwU
Rename `LifetimeName` as `LifetimeKind`.

It's a much better name, more consistent with how we name such things.

Also rename `Lifetime::res` as `Lifetime::kind` to match. I suspect this field used to have the type `LifetimeRes` and then the type was changed but the field name remained the same.

r? ``@BoxyUwU``
2025-04-17 00:14:26 +02:00
Jakub Beránek 01928b1abd
Merge pull request #2337 from xizheyin/sync-code
Remind to update dev branch while behind too many commits
2025-04-16 07:36:00 +02:00
xizheyin 523f2a571a
Remind to update dev branch while behind too many commits
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-16 13:09:29 +08:00
Nicholas Nethercote 299077b6c3 Improve `borrowck_graphviz_*` documentation.
In particular, `borrowck_graphviz_preflow` no longer exists.
2025-04-16 08:57:15 +10:00
Nicholas Nethercote 220d208efd Rename `LifetimeName` as `LifetimeKind`.
It's a much better name, more consistent with how we name such things.

Also rename `Lifetime::res` as `Lifetime::kind` to match. I suspect this
field used to have the type `LifetimeRes` and then the type was changed
but the field name remained the same.
2025-04-16 07:16:40 +10:00
onur-ozkan 3ed7cc887e document `include` in `bootstrap.example.toml`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:06 +03:00
onur-ozkan b4426b7c4b document config extensions
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:32:56 +03:00
Tshepang Mbambo 85c796488d
Merge pull request #2333 from rust-lang/convetions-chapt-cleaning
Coding conventions chapter cleaning
2025-04-14 08:43:05 +02:00
Tshepang Mbambo 07d3c69637 clean "Coding conventions" chapter
- use correct code block markers
- add missing title
- rustfmt can now use edition setting in its config
  ... and this is set in Rust repo
- reduce visual noise
- needless repetition
- convention is to start sentence with upper case
- sembr
- whitespace
- semi-heading not adding much value
- fix grammar
2025-04-14 08:41:22 +02:00
Nicholas Nethercote b557b97e1e Documentation fixes.
Remove old references to the HIR map.
2025-04-14 09:18:15 +10:00
许杰友 Jieyou Xu (Joe) 78a5c64129
Merge pull request #2334 from rust-lang/consistency 2025-04-13 23:38:27 +08:00
Jieyou Xu 79af744efe
tests: document `-A {unused,internal_features}` ui test mode presets 2025-04-13 23:34:24 +08:00
Chris Denton 6a7bff3d89
Rollup merge of #139618 - petrochenkov:virsugg, r=jieyouxu
compiletest: Make `SUGGESTION` annotations viral

If one of them is expected in a test file, then others should be annotated as well, in the same way as with `HELP`s and `NOTE`s.
This doesn't require much of an additional annotation burden, but simplifies the rules.

r? ```@jieyouxu```
2025-04-13 11:48:17 +00:00
Tshepang Mbambo 4a71db13fa use consistent title capitalization 2025-04-12 13:01:16 +02:00
Tshepang Mbambo e4fab61c10
fix path 2025-04-12 10:41:48 +02:00
Tshepang Mbambo 2904f18294
Merge pull request #2330 from rust-lang/tshepang-patch-5
date-check rdg contribution section
2025-04-12 10:28:49 +02:00
Tshepang Mbambo a0a83bc7c8
date-check rdg contribution section 2025-04-12 10:28:15 +02:00
许杰友 Jieyou Xu (Joe) 72c9cc85cd
Merge pull request #2327 from rust-lang/tshepang-patch-1 2025-04-12 16:25:17 +08:00
Tshepang Mbambo d7794fb801
Merge pull request #2329 from rust-lang/tshepang-patch-4
add missing word
2025-04-12 10:25:07 +02:00
Tshepang Mbambo 8721d56e32
add missing word 2025-04-12 10:24:31 +02:00
Tshepang Mbambo 962701f408
remove implied text
"how much to trust" implies the opposite
2025-04-12 10:21:10 +02:00
Tshepang Mbambo 5c08026fe2
use more simple language
Not obvious what "sort by" means
2025-04-12 09:39:13 +02:00
Tshepang Mbambo 8d31603721
ease copy-paste 2025-04-12 06:14:37 +02:00
Freya Arbjerg 54b7da853a Update "crater" link to actually point to crater.md 2025-04-12 00:05:26 +02:00
Jakub Beránek 35acfcc46b Document that `opt-dist` requires metrics to be enabled 2025-04-11 21:30:10 +02:00
Tshepang Mbambo 58cbfe4ea8
Merge pull request #2320 from smanilov/patch-1
Update table of contents in about-this-guide.md
2025-04-11 18:43:11 +02:00
Stan Manilov 281f106cde Update table of contents in about-this-guide.md
1. added two new parts: Bootstrapping and Supporting Infrastructure;
2. touched up names of pre-existing parts, to match actual names in sidebar;
3. syntactic nits (start description of Analysis with a capital letter); and
4. make numbered list use only 1.

Co-authored-by: Tshepang Mbambo <tshepang@gmail.com>
2025-04-11 16:57:44 +03:00
bors 9f227ffb56 Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015`

Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter.

This PR fixes the two categories of failures happening when `--edition=2015` is passed:

* Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error.
* Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation.

Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests.

I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed.

r? `@jieyouxu`
2025-04-11 10:53:45 +00:00
Stan Manilov ca410e88e4
Fix link to rustc_* TEST attributes in ui.md 2025-04-11 12:12:46 +03:00
Vadim Petrochenkov 0423c7b2df dev-guide: Document `dont-require-annotations`
and its use cases in more detail
2025-04-10 23:48:57 +03:00
Pietro Albini d7631d20aa
mention --edition restrictions in rustc-dev-guide 2025-04-10 12:34:57 +02:00
Jieyou Xu 5fb6b8e48f
rustc-dev-guide: document `needs-crate-type` 2025-04-10 12:52:08 +08:00
timesince f34fa18b01
Remove redundant words 2025-04-09 18:46:50 +08:00
Tshepang Mbambo e76ab78d1d
improve flow 2025-04-07 06:42:37 +02:00
The rustc-dev-guide Cronjob Bot 216eb512fb Merge from rustc 2025-04-07 04:12:22 +00:00
Levi Zim 4188afe2e7
Fix deadlink in libs-and-metadata.md 2025-04-06 20:05:03 +08:00
binarycat 7fda61b116 add some links about the rustdoc-gui test suite 2025-04-03 15:09:11 -05:00
bors 20d0bf9f27 Auto merge of #139301 - matthiaskrgr:rollup-sa6ali8, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #139080 (Experimental feature gate for `super let`)
 - #139145 (slice: Remove some uses of unsafe in first/last chunk methods)
 - #139149 (unstable book: document import_trait_associated_functions)
 - #139273 (Apply requested API changes to `cell_update`)
 - #139282 (rustdoc: make settings checkboxes always square)
 - #139283 (Rustc dev guide subtree update)
 - #139294 (Fix the `f16`/`f128` feature gates on integer literals)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-03 15:31:20 +00:00
Vadim Petrochenkov 8f4357e7a2 compiletest: Require `//~` annotations even if `error-pattern` is specified 2025-04-03 11:08:55 +03:00
Tshepang Mbambo a90cb7416c
test directive can appear anywhere in the file 2025-04-03 02:04:49 +02:00
Jieyou Xu 64527fa438
Merge from rustc 2025-04-02 23:26:35 +08:00
clubby789 fcb6370406 Fix partial clone link 2025-03-30 13:21:01 +01:00
Tshepang Mbambo 01bbdec63c
Merge pull request #2289 from y1lan/fix_compiler_err_of_examples
Fix compile errors of all the examples
2025-03-29 23:10:13 +02:00
许杰友 Jieyou Xu (Joe) fdca2d3605
Merge pull request #2288 from rust-lang/tshepang-known-bug-takes-args
mention that known-bug test directive takes arguments
2025-03-30 02:31:33 +08:00
Tshepang Mbambo 6c1077e05d mention that know-bug test directive takes arguments 2025-03-29 20:02:01 +02:00
Vadim Petrochenkov 628eb7064d compiletest: Support matching diagnostics on lines below 2025-03-29 13:30:20 +03:00
Samuel Tardieu f1a4e592db Fix trivial typo of `BoundVariableKind` 2025-03-28 21:04:21 +01:00
Santiago Pastorino a480687c6c
Fix code generation link 2025-03-28 12:38:32 -03:00
mejrs 9745529523 Delete from_method from rustc_on_unimplemented documentation 2025-03-27 18:32:48 +01:00
Vadim Petrochenkov 2e81955d9c compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
Tshepang Mbambo 55e47b61f5
typo 2025-03-24 10:41:19 +02:00
Tshepang Mbambo 07e905fbe6
add needed break 2025-03-24 10:40:03 +02:00
许杰友 Jieyou Xu (Joe) 354463193d
Merge pull request #2299 from jieyouxu/test-jobs-reorg
Slightly reorganize ecosystem tests, stub out codegen backend test pages
2025-03-24 16:29:25 +08:00
Chiichen 6f9680da7a doc: fix reference to #create-a-configtoml 2025-03-23 12:38:46 +08:00
Jieyou Xu b7fc809e0b
Stub out codegen backend test pages 2025-03-21 16:48:58 +08:00
Jieyou Xu 8c3302aa5f
Move Fuchsia and RfL under `ecosystem-test-jobs/` folder
Includes redirects to avoid breaking existing links.
2025-03-21 16:48:57 +08:00
Boxy b5522c1f58 Update `ParamEnv` section for `TypingEnv` changes 2025-03-20 17:30:22 +00:00
Vadim Petrochenkov c95537b30a
Merge pull request #2199 from sagudev/patch-1
Fix rib example
2025-03-20 15:26:12 +03:00
许杰友 Jieyou Xu (Joe) 047ccc0a28
Merge pull request #2295 from lolbinarycat/rustdoc-htmldocck
add new section on the `rustdoc` test suite
2025-03-20 14:49:50 +08:00
Jieyou Xu 0da80bbea1
Disambiguate between wg-llvm and icebreakers-llvm in rustc-dev-guide 2025-03-20 12:40:51 +08:00
Tshepang Mbambo 86aa63456e
use correct code block markers
This makes this command pass

  mdbook test --chapter "Remarks on perma-unstable features"
2025-03-19 18:06:50 +02:00
Matthias Krüger 7d4c53d816
Rollup merge of #138655 - Kobzol:rdg-sync, r=jieyouxu
rustc-dev-guide sync

r? `@jieyouxu`
2025-03-19 08:17:15 +01:00
binarycat 59f11cdfe5 update filename in link 2025-03-18 13:29:14 -05:00
binarycat 871280d6df normalize link titles 2025-03-18 13:25:39 -05:00
binarycat 2e1c4999c8 clean up wording/grammar and mention double quotes 2025-03-18 13:23:37 -05:00
binarycat 174678da35 rename htmldocck.md -> rustdoc-test-suite.md 2025-03-18 13:21:15 -05:00
binarycat 72aa06dff1 rustdoc test suite: clean up wording and intro 2025-03-18 13:19:33 -05:00
binarycat f248d2f57c htmldocck: expand limitations and mention compiletest directives 2025-03-18 13:10:26 -05:00
binarycat 8b501562a8 add htmldocck.md to SUMMARY.md 2025-03-18 12:10:43 -05:00
binarycat f00643aa1c add new section on the `rustdoc` test suite 2025-03-18 12:04:47 -05:00
Jakub Beránek 1bcd02da96
Add Fuchsia ping group page 2025-03-18 16:22:57 +01:00
Jakub Beránek ba77a8030b
Reorder RfL tests page to move the "what if it breaks" section to the top 2025-03-18 16:17:59 +01:00
Jakub Beránek db56758b57
Add Fuchsia ping group notice 2025-03-18 16:16:28 +01:00
许杰友 Jieyou Xu (Joe) c3b9e8ae0a
Merge pull request #2268 from xizheyin/issue-137421
Add issue link for explaining that why rustc_private linker fails
2025-03-18 22:44:16 +08:00
xizheyin e0d9704841 Add chapter Remarks on perma-unstable features
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-18 20:49:20 +08:00
Jieyou Xu af667b8696
Merge from rustc 2025-03-18 12:08:38 +08:00
Matthias Krüger 7ceeee7ca4
Rollup merge of #138533 - Kobzol:try-job-auto-tests, r=marcoieni
Only use `DIST_TRY_BUILD` for try jobs that were not selected explicitly

Some CI jobs (x64 Linux, ARM64 Linux and x64 MSVC) use the `opt-dist` tool to build an optimized toolchain using PGO and BOLT. When performing a default try build for x64 Linux, in most cases we want to run perf. on that artifact. To reduce the latency of this common use-case, `opt-dist` skips building several components not needed for perf., and it also skips running post-optimization tests, when it detects that the job is executed as a try job (not a merge/auto job).

This is useful, but it also means that if you *want* to run the tests, you had to go to `jobs.yml` and manually comment this environment variable, create a WIP commit, do a try build, and then remove the WIP commit, which is annoying (in the similar way that modifying what gets run in try builds was annoying before we had the `try-job` annotations).

I thought that we could introduce some additional PR description marker like `try-job-run-tests`, but it's hard to discover that such things exist.

Instead, I think that there's a much simpler heuristic for determining whether `DIST_TRY_BUILD` should be used (that I implemented in this PR):
- If you do just ``@bors` try`, without any custom try jobs selected, `DIST_TRY_BUILD` will be activated, to finish the build as fast as possible.
- If you specify any custom try jobs, you are most likely doing experiments and you want to see if tests pass and everything builds as it should. The `DIST_TRY_BUILD` variable will thus *not* be set in this case.

In this way, if you want to run dist tests, you can just add the `try-job: dist-x86_64-linux` line to the PR description, and you don't need to create any WIP commits.

r? `@marcoieni`
2025-03-17 22:49:06 +01:00
bit-aloo e4ddc21c8a
replace config.toml to bootstrap.toml in src:doc:rustc-dev-guide 2025-03-17 12:56:44 +05:30
jyn bfda715ef4 expand ${workspaceFolder} in sample vim config 2025-03-16 21:06:18 -04:00
Jakub Beránek f6940a6e7c Add a note to rustc-dev-guide 2025-03-16 20:42:37 +01:00
Yang Lin 832299550c Following commit 401dd84 in the Rust project
(https://github.com/rust-lang/rust),
`ErrorGuaranteed` was replaced by fatal errors.
As a result, `tcx.analysis()` now aborts directly
instead of returning an error guard.
To accommodate this change, this update replaces
`tcx.analysis()` with `typeck()`
to perform type checking in the example.
2025-03-16 23:43:17 +08:00
Tshepang Mbambo b04865b8d2 add some copy-paste goodness 2025-03-15 11:35:41 +02:00