rust/src/librustc/middle
Nick Cameron 3e626375d8 DST coercions and DST structs
[breaking-change]

1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code.

2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible.

3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-26 12:38:51 +12:00
..
borrowck DST coercions and DST structs 2014-08-26 12:38:51 +12:00
cfg DST coercions and DST structs 2014-08-26 12:38:51 +12:00
save librustc: Stop assuming that implementations and traits only contain 2014-08-14 11:40:22 -07:00
trans DST coercions and DST structs 2014-08-26 12:38:51 +12:00
typeck DST coercions and DST structs 2014-08-26 12:38:51 +12:00
astencode.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
check_const.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
check_loop.rs librustc: Tie up loose ends in unboxed closures. 2014-08-14 08:53:25 -07:00
check_match.rs Forbid extern statics from appearing in patterns 2014-08-18 00:08:57 +02:00
check_static.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
const_eval.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
dataflow.rs Removed the _frozen methods from dataflow API. 2014-07-18 13:48:53 +02:00
dead.rs librustc: handle repr on structs, require it for ffi, unify with packed 2014-08-20 21:02:23 -04:00
def.rs middle: Derive Show impls 2014-07-15 18:54:47 -04:00
dependency_format.rs
effect.rs Adjust the error messages to match the pattern "expected foo, found bar" 2014-08-24 09:53:01 +02:00
entry.rs Assign more diagnostic codes 2014-07-18 20:13:19 +02:00
expr_use_visitor.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
freevars.rs librustc: Tie up loose ends in unboxed closures. 2014-08-14 08:53:25 -07:00
graph.rs librustc: Remove uses of advance. 2014-07-09 15:51:58 -07:00
intrinsicck.rs Assign more diagnostic codes 2014-07-18 20:13:19 +02:00
kind.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
lang_items.rs Rename Share to Sync 2014-08-07 08:54:38 -07:00
liveness.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
mem_categorization.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
pat_util.rs AST refactoring: merge PatWild and PatWildMulti into one variant with a flag. 2014-08-06 17:04:44 +02:00
privacy.rs librustc: Stop assuming that implementations and traits only contain 2014-08-14 11:40:22 -07:00
reachable.rs librustc: Stop assuming that implementations and traits only contain 2014-08-14 11:40:22 -07:00
region.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
resolve_lifetime.rs librustc: Consider where clauses when traversing free regions in 2014-08-21 19:33:29 -07:00
resolve.rs librustc: Forbid external crates, imports, and/or items from being 2014-08-16 19:32:25 -07:00
stability.rs librustc: Stop assuming that implementations and traits only contain 2014-08-14 11:40:22 -07:00
subst.rs librustc: Don't ICE when trying to subst regions in destructor call. 2014-07-31 11:50:24 -07:00
ty_fold.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
ty.rs DST coercions and DST structs 2014-08-26 12:38:51 +12:00
weak_lang_items.rs