]> git.lizzy.rs Git - rust.git/commit
Auto merge of #34365 - petrochenkov:deferr, r=eddyb
authorbors <bors@rust-lang.org>
Sat, 9 Jul 2016 22:16:21 +0000 (15:16 -0700)
committerGitHub <noreply@github.com>
Sat, 9 Jul 2016 22:16:21 +0000 (15:16 -0700)
commitf93aaf84cb50dfaaba44b08c05bd51320263f592
treec3c591b8c329f811807e4d2f85d1155282679fd4
parentd40c593f42fafbac1ff3d827f6df96338b5b7d8b
parentd27e55c5d81eaee11ff2d414793cb7278d58d578
Auto merge of #34365 - petrochenkov:deferr, r=eddyb

Some more pattern cleanup and bugfixing

The next part of https://github.com/rust-lang/rust/pull/34095

The most significant fixed mistake is definitions for partially resolved associated types not being updated after full resolution.
```
fn f<T: Fn()>(arg: T::Output) { .... } // <- the definition of T::Output was not updated in def_map
```
For this reason unstable associated types of stable traits, like `FnOnce::Output`, could be used in stable code when written in unqualified form. Now they are properly checked, this is a **[breaking-change]** (pretty minor one, but a crater run would be nice). The fix is not to use unstable library features in stable code, alternatively `FnOnce::Output` can be stabilized.

Besides that, paths in struct patterns and expressions `S::A { .. }` are now fully resolved as associated types. Such types cannot be identified as structs at the moment, i.e. the change doesn't make previously invalid code valid, but it improves error diagnostics.

Other changes: `Def::Err` is supported better (less chances for ICEs for erroneous code), some incorrect error messages are corrected, some duplicated error messages are not reported, ADT definitions are now available through constructor IDs, everything else is cleanup and code audit.

Fixes https://github.com/rust-lang/rust/issues/34209
Closes https://github.com/rust-lang/rust/issues/22933 (adds tests)

r? @eddyb
src/librustc_trans/consts.rs