rust/src/tools
bors 6cd6bad51f Auto merge of #101692 - cjgillot:generator-lazy-witness, r=oli-obk
Compute generator saved locals on MIR

Generators are currently type-checked by introducing a `witness` type variable, which is unified with a `GeneratorWitness(captured types)` whose purpose is to ensure that the auto traits correctly migrate from the captured types to the `witness` type.  This requires computing the captured types on HIR during type-checking, only to re-do it on MIR later.

This PR proposes to drop the HIR-based computation, and only keep the MIR one.  This is done in 3 steps.
1. During type-checking, the `witness` type variable is never unified.  This allows to stall all the obligations that depend on it until the end of type-checking.  Then, the stalled obligations are marked as successful, and saved into the typeck results for later verification.
2. At type-checking writeback, `witness` is replaced by `GeneratorWitnessMIR(def_id, substs)`.  From this point on, all trait selection involving `GeneratorWitnessMIR` will fetch the MIR-computed locals, similar to what opaque types do.  There is no lifetime to be preserved here: we consider all the lifetimes appearing in this witness type to be higher-ranked.
3. After borrowck, the stashed obligations are verified against the actually computed types, in the `check_generator_obligations` query.  If any obligation was wrongly marked as fulfilled in step 1, it should be reported here.

There are still many issues:
- ~I am not too happy having to filter out some locals from the checked bounds, I think this is MIR building that introduces raw pointers polluting the analysis;~ solved by a check specific to static variables.
- the diagnostics for captured types don't show where they are used/dropped;
- I do not attempt to support chalk.

cc `@eholk` `@jyn514` for the drop-tracking work
r? `@oli-obk` as you warned me of potential unsoundness
2023-01-28 01:05:29 +00:00
..
build-manifest Add vendor to Fuchsia's target triple 2023-01-05 09:34:22 -05:00
build_helper Handle non-existant upstream master branches in x fmt 2023-01-06 20:18:50 +01:00
bump-stage0 Allow passing a specific date to bump-stage0 2023-01-03 03:40:58 +00:00
cargo@3c5af6bed9 Update cargo 2023-01-24 20:34:38 +00:00
cargotest Override linker in cargotest on windows 2022-10-23 19:33:03 -05:00
clippy Auto merge of #101692 - cjgillot:generator-lazy-witness, r=oli-obk 2023-01-28 01:05:29 +00:00
collect-license-metadata address review feedback 2022-11-24 17:25:35 +01:00
compiletest Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum 2023-01-22 11:43:07 +01:00
error_index_generator error-index: Don't generate 404 instead of removing it. 2023-01-05 11:07:35 -08:00
expand-yaml-anchors
generate-copyright initial prototype of the tool to generate copyright notices 2022-11-15 15:02:03 +01:00
html-checker parallelize HTML checking tool 2022-07-29 23:26:38 -04:00
jsondocck Remove need to give JSON file path 2022-08-18 10:48:06 +02:00
jsondoclint jsondoclint: Check local items in paths are also in index. 2023-01-06 23:10:14 +00:00
linkchecker Remove reference from the intra-doc link checker. 2022-11-03 22:02:39 -07:00
lint-docs fix the lint as requested 2022-10-24 21:25:30 +02:00
lld-wrapper fix lld-wrapper lld flavor detection 2022-09-07 14:51:54 +02:00
miri add EarlyBinder::no_bound_vars 2023-01-26 20:28:31 -07:00
miropt-test-tools couple of clippy::perf fixes 2022-11-18 10:30:47 +01:00
remote-test-client tools/remote-test-{server,client}: Use /data/local/tmp on Android 2022-10-06 13:42:32 -07:00
remote-test-server Use u32 methods instead of manual shifting 2022-12-23 16:08:23 +05:30
replace-version-placeholder Also replace the version placeholder in rustc_attr 2022-09-02 01:47:01 +02:00
rls Sunset RLS 2022-08-27 21:36:08 -07:00
rust-analyzer Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rust-demangler
rust-installer@5b2eee7eed Bump rust-installer 2022-12-27 16:27:49 -05:00
rustbook Update mdbook 2023-01-09 17:04:14 -08:00
rustc-workspace-hack Update cargo 2023-01-04 15:58:52 +00:00
rustdoc rustdoc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler 2022-10-24 20:40:46 +02:00
rustdoc-gui Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustdoc-js rustdoc: add hash to filename of toolchain files 2022-10-29 12:47:48 -07:00
rustdoc-themes
rustfmt Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk 2023-01-26 12:44:47 +00:00
tidy Update tidy for cranelift-egraph removal and new windows-sys targets 2023-01-24 19:03:13 +01:00
tier-check Encourage developers not to use periods in target names 2022-11-17 10:41:41 +01:00
unicode-table-generator Address feedback from PR #101401 2022-09-04 08:07:53 -07:00
unstable-book-gen unstable-book-gen: use std::fs::write 2022-08-28 00:40:58 +02:00
x keep --wrapper-version argument in x 2023-01-11 12:13:35 -07:00
cherry-pick.sh
publish_toolstate.py Remove miri from the submodule list and require it for CI to pass 2022-09-21 15:35:53 +00:00