Idea for struct spread syntax RFC (PartialDefault)

There's been lots of talk about optional arguments and syntax work to file down the boilerplate for defaults/optionals. Myself, I've worked on GitHub - jkelleyrtp/optargs: Easy-to-use optional function arguments for Rust which generates a macro_rules for a struct/function that provides ad-hoc optional/named argument support.

Most of the RFCs and proposals I've seen so far have stalled due to one concern or the other. However, I think a very slight tweak to the struct spread syntax might help alleviate the noise and bring simpler optional arguments.

The Idea

Today, the destructure syntax only lets you destructure an item of one type into itself. This means destructuring is enforced at the item level.

This is available today in the form of destructuring:

struct Foo {
    a: i32,
    b: &'static str,
}
fn test2() {
    let foo1 = Foo { a: 10, b: "abc" };
    let foo2 = Foo { a: 20, ..foo1 };
}

But this is not available today, even though it semantically makes sense:

struct Foo {
    a: i32,
    b: &'static str,
}
struct SubFoo {
    b: &'static str,
}
fn test2() {
    let subfoo = SubFoo { b: "abc" };
    let foo2 = Foo { a: 20, ..subfoo };
}

Theoretically, since the fields and types of those fields match, then the second example would make complete sense and be semantically correct at compile time.

The behavior switches away from merging by item type, and instead by field. This could potentially enable merging multiple items together, or by merging by modulespace or trait space.

Real world use case

In a real-world use case, this would allow the use of something like a compile time PartialDefault

trait PartialDefault {
    type Out: Default;
    fn partial_default() -> Self::Out {
        Self::Out::default()
    }
}

struct NoDefault;
struct Settings {
    a: NoDefault,
    b: &'static str,
}

#[derive(Default)]
struct DefaultSettings {
    b: &'static str,
}
impl PartialDefault for Settings {
    type Out = DefaultSettings;
}

fn test2() {
    let settings = Settings {
        a: NoDefault,
        ..PartialDefault::partial_default()
    };
}

This would allow the use of Default for fields on a struct that has both defaultable (primitives) and nondefaultable (closures).

This would be very useful for optional/named arguments where the struct pattern could be used and compile-time verified.

I'm curious what the community's thoughts are and if it's worth filing an RFC for.