]> git.lizzy.rs Git - rust.git/commit
auto merge of #8554 : michaelwoerister/rust/generics, r=brson
authorbors <bors@rust-lang.org>
Sat, 17 Aug 2013 22:22:04 +0000 (15:22 -0700)
committerbors <bors@rust-lang.org>
Sat, 17 Aug 2013 22:22:04 +0000 (15:22 -0700)
commit679102109fd72c2560de0988324c14af3ae27c7a
treeac90aa5ba2c85b7dd296fac2bc04f3caddeda36f
parentcb8a231eb8b730128c5b7e89c8eac9eab36642c4
parent80fb2f20561afb254c820c8112e4f439d75cf16b
auto merge of #8554 : michaelwoerister/rust/generics, r=brson

This pull request includes support for generic functions and self arguments in methods, and combinations thereof. This also encompasses any kind of trait methods, regular and static, with and without default implementation. The implementation is backed up by a felt ton of test cases `:)`

This is a very important step towards being able to compile larger programs with debug info, since practically any generic function caused an ICE before.

One point worth discussing is that activating debug info now automatically (and silently) sets the `no_monomorphic_collapse` flag. Otherwise debug info would show wrong type names in all but one instance of the monomorphized function.

Another thing to note is that the handling of generic types does not strictly follow the DWARF specification. That is, variables with type `T` (where `T=int`) are described as having type `int` and not as having type `T`. In other words, we are losing information whether a variable has been declared with a type parameter as its type. In practice this should not make much of difference though since the concrete type is mostly what one is interested in. I'll post an issue later so this won't be forgotten.

Also included are a number of bug fixes:
* Closes #1758
* Closes #8513
* Closes #8443
* Fixes handling of field names in tuple structs
* Fixes and re-enables test case for option-like enums that relied on undefined behavior before
* Closes #1339 (should have been closed a while ago)

Cheers,
Michael
src/librustc/middle/trans/base.rs