about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-07 14:10:11 +0000
committerGitHub <noreply@github.com>2022-01-07 14:10:11 +0000
commit40009e07d002bf676b4b32e90a858aed37ea4cc2 (patch)
tree03cbb6821b271c292ed6a206c83367d60292be21 /src/test/codegen/src-hash-algorithm
parentefb9b89163e4a6080f5d87133028de28cbaf310c (diff)
parent8e0a05eb70d2a3506e1441fb491c0f8b6ae4ac59 (diff)
downloadrust-40009e07d002bf676b4b32e90a858aed37ea4cc2.tar.gz
rust-40009e07d002bf676b4b32e90a858aed37ea4cc2.zip
Merge #11145
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj

Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields

before:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {<|>};
}
``` 

after: 

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {
        text: String::new(),
        num: 0,
        other: todo!(),
    };
}
``` 



Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions