rust/src
bors 03b9e1d154 Auto merge of #105409 - compiler-errors:closure-infer-cycle, r=jackh726
Don't deduce a signature that makes a closure cyclic

Sometimes when elaborating supertrait bounds for closure signature inference, we end up deducing a closure signature that is cyclical because either a parameter or the return type references a projection mentioning `Self` that also has escaping bound vars, which means that it's not eagerly replaced with an inference variable.

Interestingly, this is not *just* related to my PR that elaborates supertrait bounds for closure signature deduction. The committed test `supertrait-hint-cycle-3.rs` shows **stable** code that is fixed by this PR:

```rust
trait Foo<'a> {
    type Input;
}

impl<F: Fn(u32)> Foo<'_> for F {
    type Input = u32;
}

fn needs_super<F: for<'a> Fn(<F as Foo<'a>>::Input) + for<'a> Foo<'a>>(_: F) {}

fn main() {
    needs_super(|_: u32| {});
}
```

Fixes #105401
Fixes #105396

r? types
2023-01-05 03:59:31 +00:00
..
bootstrap Rollup merge of #106396 - jyn514:bump-stage-date, r=pietroalbini 2023-01-04 07:28:56 +01:00
ci Cleanup mingw-tidy docker job 2023-01-01 21:44:18 +00:00
doc Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqd 2023-01-04 07:28:54 +01:00
etc Make the pre-push script work on directories with spaces 2022-12-17 17:18:53 -06:00
librustdoc Rollup merge of #106437 - notriddle:notriddle/http-url, r=GuillaumeGomez 2023-01-04 23:39:50 +01:00
llvm-project@3dfd4d93fa Update LLVM submodule 2022-12-07 08:40:49 +01:00
rustdoc-json-types Rustdoc-Json: Report discriminant on all kinds of enum variant. 2023-01-01 19:48:26 +00:00
test Auto merge of #105409 - compiler-errors:closure-infer-cycle, r=jackh726 2023-01-05 03:59:31 +00:00
tools Rollup merge of #106460 - c410-f3r:moar-errors, r=compiler-errors 2023-01-04 23:39:51 +01:00
README.md Remove miri from the submodule list and require it for CI to pass 2022-09-21 15:35:53 +00:00
stage0.json bump stage0 2022-12-28 09:18:43 -05:00
version bump version to 1.68 2022-12-09 17:49:45 +01:00

This directory contains the source code of the rust project, including:

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

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