rust/src
Matthias Krüger 01469693de
Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, r=wesleywiser
fold instead of obliterating args

Fixes #105608

we call `const_eval_resolve` on the following constant:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  ConstKind::Unevaluated {
    def: playground::{impl#0}::and::{constant#0},
    substs: [
      ConstKind::Value(0x0),
      _,
    ]
  }
  _,
],
```
when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  PLACEHOLDER,
  PLACEHOLDER,
],
```
Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  ConstKind::Unevaluated {
    def: playground::{impl#0}::and::{constant#0},
    substs: [
      ConstKind::Value(0x0),
      PLACEHOLDER,
    ]
  }
  PLACEHOLDER,
],
```
which ctfe _can_ handle.

I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars 🤔
2022-12-14 10:31:08 +01:00
..
bootstrap Adjust miri to still be optional 2022-12-13 00:01:20 +01:00
ci Revert "enable ThinLTO for rustc on x86_64-apple-darwin dist builds" 2022-12-13 01:11:54 +00:00
doc doc: document remap matching behaviour in rustc flags 2022-12-10 16:04:00 +01:00
etc Fix natvis VecDeque formatter 2022-11-27 18:09:56 +01:00
librustdoc Combine projection and opaque into alias 2022-12-13 17:48:55 +00:00
llvm-project@3dfd4d93fa Update LLVM submodule 2022-12-07 08:40:49 +01:00
rustdoc-json-types Rollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez 2022-11-30 19:53:17 +01:00
test Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, r=wesleywiser 2022-12-14 10:31:08 +01:00
tools Auto merge of #104986 - compiler-errors:opaques, r=oli-obk 2022-12-14 01:19:24 +00:00
README.md
stage0.json Bump to latest beta 2022-11-06 17:11:02 -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.