diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-19 20:51:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-19 20:51:07 -0400 |
| commit | 6480a00222bf67f928e305bf9967302eb6ae6b3a (patch) | |
| tree | 1c21f54549f98c18d89c3b04dae02404592f5cca /src/test/run-pass/thinlto | |
| parent | 573e906594fdf7824f49789f24fdadb4496d7368 (diff) | |
| parent | 50aee36d26dd78ddc78670b2ad63d276c5faa646 (diff) | |
| download | rust-6480a00222bf67f928e305bf9967302eb6ae6b3a.tar.gz rust-6480a00222bf67f928e305bf9967302eb6ae6b3a.zip | |
Rollup merge of #40398 - eddyb:struct-hint, r=nikomatsakis
Propagate expected type hints through struct literals.
Partial fix for #31260 to maximize backwards-compatibility, i.e. the hint is provided but not coerced to.
The added test works because `{...; x}` with a hint of `T` coerces `x` to `T`, and the reasoning why that is slightly different has to do with DSTs: `&Struct { tail: [x] }: &Struct<[T]>` has a hint of `[T]` for `[x]`, but the inferred type should be `[T; 1]` to succeed later, so `[x]` shouldn't be *forced* to be `[T]`.
*However*, implementing that complete behavior in a backwards-compatible way may be non-trivial, and has not yet been fully investigated, while this PR fixes #40355 and can be backported.
r? @nikomatsakis
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
