diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-11 23:31:24 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-11 23:31:24 +0000 |
| commit | bbe61565bb06cfbc5a0b7587467cc7c828eb0169 (patch) | |
| tree | 27acf38f35af9500e2ea958418d344c6e3b219e6 /src/test/codegen/src-hash-algorithm | |
| parent | 224a255c5a7c75efb5567fc38b3772c5dbb094c4 (diff) | |
| parent | 8a284306765512367c64a3c070648f560ed5bacf (diff) | |
| download | rust-bbe61565bb06cfbc5a0b7587467cc7c828eb0169.tar.gz rust-bbe61565bb06cfbc5a0b7587467cc7c828eb0169.zip | |
Merge #11683
11683: fix: Stop wrapping ConstParam's default values in ConstArg r=Veykril a=steven-joruk
I came across this problem while implementing the assist for inlining type aliases. This was causing `ConstParam::default_val` to always return `None` for block expressions. The `const_arg_path` test was actually testing const params so I've updated that.
The only code that uses `default_val` right now is the `extract_function` assist. I couldn't figure out how to hit the affected code path, if someone can give me hint I'll add a test.
This test in my WIP branch fails without this:
```rust
#[test]
fn param_expression() {
check_assist(
inline_type_alias,
r#"
type A<const N: usize = { 1 }> = [u32; N];
fn main() {
let a: $0A;
}
"#,
r#"
type A<const N: usize = { 1 }> = [u32; N];
fn main() {
let a: [u32; { 1 }];
}
"#,
);
}
```
Co-authored-by: Steven Joruk <steven@joruk.com>
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
