about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-13 07:56:03 +0000
committerbors <bors@rust-lang.org>2015-12-13 07:56:03 +0000
commitd382fcdb82dd07c739cb48cdd6a768e273b47256 (patch)
tree39fe26468fbf8aeb80675d2b95fca6697e6bbe48 /src/rustllvm/RustWrapper.cpp
parentc4c191afae23be19cc845f67de2a36a2862c4fa1 (diff)
parent15743919dcb60b9fa2c7ef6b698cc0ef1c972ed8 (diff)
downloadrust-d382fcdb82dd07c739cb48cdd6a768e273b47256.tar.gz
rust-d382fcdb82dd07c739cb48cdd6a768e273b47256.zip
Auto merge of #30314 - fhahn:issue-30299-missing-fields, r=pnkfelix
This PR for #30299 adds the name of the type where the field is missing.

The span that's used for the error seems correct. What may be confusing is when the initializer with the missing field contains other intializers. These are then included in the span. For example, consider the following listing.

    struct A {
        a1: i32,
        a2: B,
    }

    struct B {
        b1: i32,
        b2: i32
    }

    fn main() {
        let x = A {
            a2: B {
                b1: 1,
                b2: 1
            },
        };
    }

It will display the following code snippet along with the message that field `a2` is missing:

        let x = A {
            a2: B {
                b1: 1,
                b2: 1
            },
        };

By adding the name of the type it's clearer where the field is missing.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions