rust/src
bors 4e1f5d90bc Auto merge of #123468 - compiler-errors:precise-capturing, r=oli-obk
Implement syntax for `impl Trait` to specify its captures explicitly (`feature(precise_capturing)`)

Implements `impl use<'a, 'b, T, U> Sized` syntax that allows users to explicitly list the captured parameters for an opaque, rather than inferring it from the opaque's bounds (or capturing *all* lifetimes under 2024-edition capture rules). This allows us to exclude some implicit captures, so this syntax may be used as a migration strategy for changes due to #117587.

We represent this list of captured params as `PreciseCapturingArg` in AST and HIR, resolving them between `rustc_resolve` and `resolve_bound_vars`. Later on, we validate that the opaques only capture the parameters in this list.

We artificially limit the feature to *require* mentioning all type and const parameters, since we don't currently have support for non-lifetime bivariant generics. This can be relaxed in the future.

We also may need to limit this to require naming *all* lifetime parameters for RPITIT, since GATs have no variance. I have to investigate this. This can also be relaxed in the future.

r? `@oli-obk`

Tracking issue:

- https://github.com/rust-lang/rust/issues/123432
2024-04-16 11:22:35 +00:00
..
bootstrap Rollup merge of #123548 - RalfJung:what-is-time, r=joboet 2024-04-15 16:56:14 +01:00
ci Auto merge of #123451 - Kobzol:arbitrary-try-build, r=pietroalbini 2024-04-15 21:28:25 +00:00
doc Rollup merge of #123666 - mountcount:master, r=lqd 2024-04-15 16:56:14 +01:00
etc Auto merge of #123317 - RalfJung:test-in-miri, r=m-ou-se,saethlin,onur-ozkan 2024-04-05 13:17:09 +00:00
librustdoc rustdoc: check redundant explicit links with correct itemid 2024-04-13 19:32:39 -07:00
llvm-project@af8f9eb61a Update to LLVM 18.1.3 2024-04-06 21:07:35 +08:00
rustdoc-json-types Normalize layout test to protect against android alignment differences 2024-04-08 12:06:28 +00:00
tools Auto merge of #123468 - compiler-errors:precise-capturing, r=oli-obk 2024-04-16 11:22:35 +00:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0.json Bump stage0 2024-03-19 19:27:24 -04:00
version Bump to 1.79.0 2024-03-16 09:56:09 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.