rust/src
bors 5530030420 Auto merge of #37035 - petrochenkov:selfstruct, r=eddyb
Support `Self` in struct expressions and patterns

Struct expressions and patterns generally support type aliases `Alias { field: 10 }` i.e. they already have to work with `ty::Ty` to do their job. `Self` is a type alias (when it's not a type parameter) => struct expressions and patterns should support `Self`.

Typical example:
```
impl MyStruct {
    fn new() -> Self {
        Self { a: 10, b: "Hello" }
    }
}
```

The first commit does some preparations and cleanups, see the commit message for  details.
This also fixes couple of bugs related to aliases in struct paths (fixes https://github.com/rust-lang/rust/issues/36286).

EDIT:
Since struct expressions and patterns always work with `ty::Ty` now, associated paths in them are also supported. If associated type `A::B` successfully resolves to a struct (or union) type, then `A::B { /* fields */ }` is a valid expression/pattern. This will become more important when enum variants are treated as [associated items](https://github.com/rust-lang/rust/issues/26264#issuecomment-250603946).

r? @eddyb
2016-10-27 18:18:56 -07:00
..
bootstrap
build_helper
compiler-rt@f03ba5a4e8
doc
driver
etc
grammar
jemalloc@e058ca6616
liballoc
liballoc_jemalloc
liballoc_system
libarena
libbacktrace
libcollections
libcollectionstest
libcompiler_builtins
libcore
libcoretest
libflate
libfmt_macros
libgetopts
libgraphviz
liblibc@c95defce07
liblog
libpanic_abort
libpanic_unwind
libproc_macro
libproc_macro_plugin
librand
librustc Address comments + Fix rebase 2016-10-27 22:20:25 +03:00
librustc_back
librustc_bitflags
librustc_borrowck
librustc_const_eval Address comments + Fix rebase 2016-10-27 22:20:25 +03:00
librustc_const_math
librustc_data_structures
librustc_driver
librustc_errors
librustc_incremental
librustc_lint Auto merge of #36894 - petrochenkov:deny, r=nikomatsakis 2016-10-27 04:06:31 -07:00
librustc_llvm
librustc_metadata Auto merge of #37350 - srinivasreddy:meta_2, r=nrc 2016-10-27 12:51:49 -07:00
librustc_mir
librustc_passes Preparations and cleanup 2016-10-27 22:14:41 +03:00
librustc_platform_intrinsics
librustc_plugin
librustc_privacy
librustc_resolve Preparations and cleanup 2016-10-27 22:14:41 +03:00
librustc_save_analysis Preparations and cleanup 2016-10-27 22:14:41 +03:00
librustc_trans
librustc_typeck Address comments + Fix rebase 2016-10-27 22:20:25 +03:00
librustc_unicode
librustdoc
libserialize
libstd
libsyntax Auto merge of #37245 - goffrie:recovery, r=nrc 2016-10-27 07:19:16 -07:00
libsyntax_ext deprecation message for custom derive 2016-10-27 11:44:42 +13:00
libsyntax_pos
libterm
libtest
libunwind
llvm@8c9961a9cc
rt
rtstartup
rust-installer@4f99485080
rustc
rustllvm
test Address comments + Fix rebase 2016-10-27 22:20:25 +03:00
tools
Cargo.lock
Cargo.toml
stage0.txt