about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/doc/book/casting-between-types.md4
-rw-r--r--src/libcore/macros.rs2
-rw-r--r--src/libcore/sync/atomic.rs11
-rw-r--r--src/librustc/hir/lowering.rs6
-rw-r--r--src/librustc_borrowck/borrowck/gather_loans/move_error.rs2
-rw-r--r--src/librustc_trans/base.rs8
-rw-r--r--src/librustc_trans/mir/rvalue.rs9
-rw-r--r--src/librustc_trans/type_of.rs11
-rw-r--r--src/test/compile-fail/E0036.rs23
-rw-r--r--src/test/compile-fail/E0038.rs20
-rw-r--r--src/test/compile-fail/E0040.rs24
-rw-r--r--src/test/compile-fail/E0044.rs14
-rw-r--r--src/test/compile-fail/E0045.rs14
-rw-r--r--src/test/compile-fail/E0046.rs20
-rw-r--r--src/test/compile-fail/E0049.rs22
-rw-r--r--src/test/compile-fail/E0050.rs22
-rw-r--r--src/test/compile-fail/E0053.rs24
-rw-r--r--src/test/compile-fail/E0054.rs14
-rw-r--r--src/test/compile-fail/E0055.rs23
-rw-r--r--src/test/compile-fail/E0057.rs16
-rw-r--r--src/test/compile-fail/E0059.rs16
-rw-r--r--src/test/compile-fail/E0060.rs17
-rw-r--r--src/test/compile-fail/E0061.rs15
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs2
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs6
-rw-r--r--src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs2
-rw-r--r--src/test/compile-fail/issue-2392.rs6
-rw-r--r--src/test/compile-fail/paren-span.rs31
-rw-r--r--src/test/run-pass/issue-33387.rs44
31 files changed, 415 insertions, 25 deletions
diff --git a/src/doc/book/casting-between-types.md b/src/doc/book/casting-between-types.md
index 7056a6c0f17..a101f397c37 100644
--- a/src/doc/book/casting-between-types.md
+++ b/src/doc/book/casting-between-types.md
@@ -135,14 +135,14 @@ cast four bytes into a `u32`:
 ```rust,ignore
 let a = [0u8, 0u8, 0u8, 0u8];
 
-let b = a as u32; // four eights makes 32
+let b = a as u32; // four u8s makes a u32
 ```
 
 This errors with:
 
 ```text
 error: non-scalar cast: `[u8; 4]` as `u32`
-let b = a as u32; // four eights makes 32
+let b = a as u32; // four u8s makes a u32
         ^~~~~~~~
 ```
 
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index ad90b447508..a40608b0762 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -86,7 +86,7 @@ macro_rules! assert {
 #[stable(feature = "rust1", since = "1.0.0")]
 macro_rules! assert_eq {
     ($left:expr , $right:expr) => ({
-        match (&($left), &($right)) {
+        match (&$left, &$right) {
             (left_val, right_val) => {
                 if !(*left_val == *right_val) {
                     panic!("assertion failed: `(left == right)` \
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 52ba8d9a631..1bdab88d71d 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -26,8 +26,9 @@
 //! [1]: http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations
 //!
 //! Atomic variables are safe to share between threads (they implement `Sync`)
-//! but they do not themselves provide the mechanism for sharing. The most
-//! common way to share an atomic variable is to put it into an `Arc` (an
+//! but they do not themselves provide the mechanism for sharing and follow the
+//! [threading model](../../../std/thread/index.html#the-threading-model) of rust.
+//! The most common way to share an atomic variable is to put it into an `Arc` (an
 //! atomically-reference-counted shared pointer).
 //!
 //! Most atomic types may be stored in static variables, initialized using
@@ -48,12 +49,16 @@
 //!     let spinlock = Arc::new(AtomicUsize::new(1));
 //!
 //!     let spinlock_clone = spinlock.clone();
-//!     thread::spawn(move|| {
+//!     let thread = thread::spawn(move|| {
 //!         spinlock_clone.store(0, Ordering::SeqCst);
 //!     });
 //!
 //!     // Wait for the other thread to release the lock
 //!     while spinlock.load(Ordering::SeqCst) != 0 {}
+//!
+//!     if let Err(panic) = thread.join() {
+//!         println!("Thread had an error: {:?}", panic);
+//!     }
 //! }
 //! ```
 //!
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index ba655b35eda..28506fd20fe 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -1286,8 +1286,12 @@ impl<'a> LoweringContext<'a> {
                                     maybe_expr.as_ref().map(|x| self.lower_expr(x)))
                 }
                 ExprKind::Paren(ref ex) => {
-                    // merge attributes into the inner expression.
                     return self.lower_expr(ex).map(|mut ex| {
+                        // include parens in span, but only if it is a super-span.
+                        if e.span.contains(ex.span) {
+                            ex.span = e.span;
+                        }
+                        // merge attributes into the inner expression.
                         ex.attrs.update(|attrs| {
                             attrs.prepend(e.attrs.clone())
                         });
diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
index 5ebb1ab32b8..c1e83588570 100644
--- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
+++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
@@ -152,7 +152,7 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                 ty::TyEnum(def, _) if def.has_dtor() => {
                     let mut err = struct_span_err!(bccx, move_from.span, E0509,
                                                    "cannot move out of type `{}`, \
-                                                   which defines the `Drop` trait",
+                                                   which implements the `Drop` trait",
                                                    b.ty);
                     err.span_label(move_from.span, &format!("cannot move out of here"));
                     err
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
index d68998927da..992e07fa744 100644
--- a/src/librustc_trans/base.rs
+++ b/src/librustc_trans/base.rs
@@ -617,7 +617,13 @@ pub fn coerce_unsized_into<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         (&ty::TyRawPtr(..), &ty::TyRawPtr(..)) => {
             let (base, info) = if common::type_is_fat_ptr(bcx.tcx(), src_ty) {
                 // fat-ptr to fat-ptr unsize preserves the vtable
-                load_fat_ptr(bcx, src, src_ty)
+                // i.e. &'a fmt::Debug+Send => &'a fmt::Debug
+                // So we need to pointercast the base to ensure
+                // the types match up.
+                let (base, info) = load_fat_ptr(bcx, src, src_ty);
+                let llcast_ty = type_of::fat_ptr_base_ty(bcx.ccx(), dst_ty);
+                let base = PointerCast(bcx, base, llcast_ty);
+                (base, info)
             } else {
                 let base = load_ty(bcx, src, src_ty);
                 unsize_thin_ptr(bcx, base, src_ty, dst_ty)
diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs
index bcbf3e1fa18..5945e8813a4 100644
--- a/src/librustc_trans/mir/rvalue.rs
+++ b/src/librustc_trans/mir/rvalue.rs
@@ -262,14 +262,17 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
                         assert!(common::type_is_fat_ptr(bcx.tcx(), cast_ty));
 
                         match operand.val {
-                            OperandValue::FatPtr(..) => {
+                            OperandValue::FatPtr(lldata, llextra) => {
                                 // unsize from a fat pointer - this is a
                                 // "trait-object-to-supertrait" coercion, for
                                 // example,
                                 //   &'a fmt::Debug+Send => &'a fmt::Debug,
-                                // and is a no-op at the LLVM level
+                                // So we need to pointercast the base to ensure
+                                // the types match up.
                                 self.set_operand_dropped(&bcx, source);
-                                operand.val
+                                let llcast_ty = type_of::fat_ptr_base_ty(bcx.ccx(), cast_ty);
+                                let lldata = bcx.pointercast(lldata, llcast_ty);
+                                OperandValue::FatPtr(lldata, llextra)
                             }
                             OperandValue::Immediate(lldata) => {
                                 // "standard" unsize
diff --git a/src/librustc_trans/type_of.rs b/src/librustc_trans/type_of.rs
index 98ec87ebbcf..e5acb9b6699 100644
--- a/src/librustc_trans/type_of.rs
+++ b/src/librustc_trans/type_of.rs
@@ -157,6 +157,17 @@ pub fn sizing_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Typ
     llsizingty
 }
 
+pub fn fat_ptr_base_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Type {
+    match ty.sty {
+        ty::TyBox(t) |
+        ty::TyRef(_, ty::TypeAndMut { ty: t, .. }) |
+        ty::TyRawPtr(ty::TypeAndMut { ty: t, .. }) if !type_is_sized(ccx.tcx(), t) => {
+            in_memory_type_of(ccx, t).ptr_to()
+        }
+        _ => bug!("expected fat ptr ty but got {:?}", ty)
+    }
+}
+
 fn unsized_info_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Type {
     let unsized_part = ccx.tcx().struct_tail(ty);
     match unsized_part.sty {
diff --git a/src/test/compile-fail/E0036.rs b/src/test/compile-fail/E0036.rs
new file mode 100644
index 00000000000..35fd6e8942f
--- /dev/null
+++ b/src/test/compile-fail/E0036.rs
@@ -0,0 +1,23 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Test;
+
+impl Test {
+    fn method<T>(&self, v: &[T]) -> usize {
+        v.len()
+    }
+}
+
+fn main() {
+    let x = Test;
+    let v = &[0];
+    x.method::<i32, i32>(v); //~ ERROR E0036
+}
diff --git a/src/test/compile-fail/E0038.rs b/src/test/compile-fail/E0038.rs
new file mode 100644
index 00000000000..26d2f339763
--- /dev/null
+++ b/src/test/compile-fail/E0038.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Trait {
+    fn foo(&self) -> Self;
+}
+
+fn call_foo(x: Box<Trait>) { //~ ERROR E0038
+    let y = x.foo();
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0040.rs b/src/test/compile-fail/E0040.rs
new file mode 100644
index 00000000000..f998778a50d
--- /dev/null
+++ b/src/test/compile-fail/E0040.rs
@@ -0,0 +1,24 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Foo {
+    x: i32,
+}
+
+impl Drop for Foo {
+    fn drop(&mut self) {
+        println!("kaboom");
+    }
+}
+
+fn main() {
+    let mut x = Foo { x: -7 };
+    x.drop(); //~ ERROR E0040
+}
diff --git a/src/test/compile-fail/E0044.rs b/src/test/compile-fail/E0044.rs
new file mode 100644
index 00000000000..48fe2300031
--- /dev/null
+++ b/src/test/compile-fail/E0044.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern { fn some_func<T>(x: T); } //~ ERROR E0044
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0045.rs b/src/test/compile-fail/E0045.rs
new file mode 100644
index 00000000000..edec911d3c0
--- /dev/null
+++ b/src/test/compile-fail/E0045.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern "rust-call" { fn foo(x: u8, ...); } //~ ERROR E0045
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0046.rs b/src/test/compile-fail/E0046.rs
new file mode 100644
index 00000000000..63bd0a5ca28
--- /dev/null
+++ b/src/test/compile-fail/E0046.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo();
+}
+
+struct Bar;
+
+impl Foo for Bar {} //~ ERROR E0046
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0049.rs b/src/test/compile-fail/E0049.rs
new file mode 100644
index 00000000000..5867e11e9ac
--- /dev/null
+++ b/src/test/compile-fail/E0049.rs
@@ -0,0 +1,22 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo<T: Default>(x: T) -> Self;
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    fn foo(x: bool) -> Self { Bar } //~ ERROR E0049
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0050.rs b/src/test/compile-fail/E0050.rs
new file mode 100644
index 00000000000..2f7dc96361f
--- /dev/null
+++ b/src/test/compile-fail/E0050.rs
@@ -0,0 +1,22 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo(&self, x: u8) -> bool;
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    fn foo(&self) -> bool { true } //~ ERROR E0050
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0053.rs b/src/test/compile-fail/E0053.rs
new file mode 100644
index 00000000000..4effda3c49e
--- /dev/null
+++ b/src/test/compile-fail/E0053.rs
@@ -0,0 +1,24 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo(x: u16);
+    fn bar(&self);
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    fn foo(x: i16) { } //~ ERROR E0053
+    fn bar(&mut self) { } //~ ERROR E0053
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0054.rs b/src/test/compile-fail/E0054.rs
new file mode 100644
index 00000000000..158cd6ff9bb
--- /dev/null
+++ b/src/test/compile-fail/E0054.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let x = 5;
+    let x_is_nonzero = x as bool; //~ ERROR E0054
+}
diff --git a/src/test/compile-fail/E0055.rs b/src/test/compile-fail/E0055.rs
new file mode 100644
index 00000000000..cb78f4b3bb5
--- /dev/null
+++ b/src/test/compile-fail/E0055.rs
@@ -0,0 +1,23 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![recursion_limit="2"]
+struct Foo;
+
+impl Foo {
+    fn foo(&self) {}
+}
+
+fn main() {
+    let foo = Foo;
+    let ref_foo = &&Foo;
+    ref_foo.foo(); //~ ERROR E0055
+                   //~^ ERROR E0275
+}
diff --git a/src/test/compile-fail/E0057.rs b/src/test/compile-fail/E0057.rs
new file mode 100644
index 00000000000..1fb5498b099
--- /dev/null
+++ b/src/test/compile-fail/E0057.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let f = |x| x * 3;
+    let a = f(); //~ ERROR E0057
+    let b = f(4);
+    let c = f(2, 3); //~ ERROR E0057
+}
diff --git a/src/test/compile-fail/E0059.rs b/src/test/compile-fail/E0059.rs
new file mode 100644
index 00000000000..4ae9b2f91d2
--- /dev/null
+++ b/src/test/compile-fail/E0059.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(unboxed_closures)]
+
+fn foo<F: Fn<i32>>(f: F) -> F::Output { f(3) } //~ ERROR E0059
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0060.rs b/src/test/compile-fail/E0060.rs
new file mode 100644
index 00000000000..b4a28987497
--- /dev/null
+++ b/src/test/compile-fail/E0060.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern "C" {
+    fn printf(_: *const u8, ...) -> u32;
+}
+
+fn main() {
+    unsafe { printf(); } //~ ERROR E0060
+}
diff --git a/src/test/compile-fail/E0061.rs b/src/test/compile-fail/E0061.rs
new file mode 100644
index 00000000000..4a8eac2a9e2
--- /dev/null
+++ b/src/test/compile-fail/E0061.rs
@@ -0,0 +1,15 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn f(a: u16, b: &str) {}
+
+fn main() {
+    f(0); //~ ERROR E0061
+}
diff --git a/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs b/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
index 438a548819b..5d9c9d0bd46 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
@@ -37,7 +37,7 @@ impl Drop for S {
 
 fn move_in_match() {
     match (S {f: "foo".to_string(), g: "bar".to_string()}) {
-        S {         //~ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        S {         //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
         //~| cannot move out of here
             f: _s,  //~ NOTE to prevent move
             g: _t   //~ NOTE and here
diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
index 3d13cbe30c5..16302d276ce 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
@@ -16,17 +16,17 @@ impl Drop for S {
 fn move_in_match() {
     match (S {f:"foo".to_string()}) {
         S {f:_s} => {}
-        //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
     }
 }
 
 fn move_in_let() {
     let S {f:_s} = S {f:"foo".to_string()};
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn move_in_fn_arg(S {f:_s}: S) {
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
index 625f7184905..f5fedb8d487 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
@@ -16,17 +16,17 @@ impl Drop for S {
 fn move_in_match() {
     match S("foo".to_string()) {
         S(_s) => {}
-        //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
     }
 }
 
 fn move_in_let() {
     let S(_s) = S("foo".to_string());
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn move_in_fn_arg(S(_s): S) {
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
index bf1497420e2..c364788a9cc 100644
--- a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
@@ -19,11 +19,13 @@ struct T { a: isize, mv: Box<isize> }
 impl Drop for T { fn drop(&mut self) { } }
 
 fn f(s0:S) {
-    let _s2 = S{a: 2, ..s0}; //~error: cannot move out of type `S`, which defines the `Drop` trait
+    let _s2 = S{a: 2, ..s0};
+    //~^ error: cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn g(s0:T) {
-    let _s2 = T{a: 2, ..s0}; //~error: cannot move out of type `T`, which defines the `Drop` trait
+    let _s2 = T{a: 2, ..s0};
+    //~^ error: cannot move out of type `T`, which implements the `Drop` trait
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
index 5078009d4b2..38049209903 100644
--- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
+++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
@@ -23,6 +23,6 @@ fn main() {
 
     match x {
         X { x: y } => println!("contents: {}", y)
-        //~^ ERROR cannot move out of type `X`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `X`, which implements the `Drop` trait
     }
 }
diff --git a/src/test/compile-fail/issue-2392.rs b/src/test/compile-fail/issue-2392.rs
index 47d50eb9d53..790b774bd21 100644
--- a/src/test/compile-fail/issue-2392.rs
+++ b/src/test/compile-fail/issue-2392.rs
@@ -81,11 +81,11 @@ impl FuncContainerOuter {
     fn run(&self) {
         unsafe {
             (*self.container).f1(1); //~ ERROR no method named `f1` found
-            //~^ NOTE use `(*self.container.f1)(...)`
+            //~^ NOTE use `((*self.container).f1)(...)`
             (*self.container).f2(1); //~ ERROR no method named `f2` found
-            //~^ NOTE use `(*self.container.f2)(...)`
+            //~^ NOTE use `((*self.container).f2)(...)`
             (*self.container).f3(1); //~ ERROR no method named `f3` found
-            //~^ NOTE use `(*self.container.f3)(...)`
+            //~^ NOTE use `((*self.container).f3)(...)`
         }
     }
 }
diff --git a/src/test/compile-fail/paren-span.rs b/src/test/compile-fail/paren-span.rs
new file mode 100644
index 00000000000..8ed5050f3de
--- /dev/null
+++ b/src/test/compile-fail/paren-span.rs
@@ -0,0 +1,31 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Be smart about span of parenthesized expression in macro.
+
+macro_rules! paren {
+    ($e:expr) => (($e))
+    //            ^^^^ do not highlight here
+}
+
+mod m {
+    pub struct S {
+        x: i32
+    }
+    pub fn make() -> S {
+        S { x: 0 }
+    }
+}
+
+fn main() {
+    let s = m::make();
+    paren!(s.x); //~ ERROR field `x` of struct `m::S` is private
+    //     ^^^ highlight here
+}
diff --git a/src/test/run-pass/issue-33387.rs b/src/test/run-pass/issue-33387.rs
new file mode 100644
index 00000000000..a4b85bc7a09
--- /dev/null
+++ b/src/test/run-pass/issue-33387.rs
@@ -0,0 +1,44 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(rustc_attrs)]
+
+use std::sync::Arc;
+
+trait Foo {
+    fn get(&self) -> [u8; 2];
+}
+
+impl Foo for [u8; 2] {
+    fn get(&self) -> [u8; 2] {
+        *self
+    }
+}
+
+struct Bar<T: ?Sized>(T);
+
+#[rustc_mir]
+fn unsize_fat_ptr<'a>(x: &'a Bar<Foo + Send + 'a>) -> &'a Bar<Foo + 'a> {
+    x
+}
+
+#[rustc_mir]
+fn unsize_nested_fat_ptr(x: Arc<Foo + Send>) -> Arc<Foo> {
+    x
+}
+
+#[rustc_mir]
+fn main() {
+    let x: Box<Bar<Foo + Send>> = Box::new(Bar([1,2]));
+    assert_eq!(unsize_fat_ptr(&*x).0.get(), [1, 2]);
+
+    let x: Arc<Foo + Send> = Arc::new([3, 4]);
+    assert_eq!(unsize_nested_fat_ptr(x).get(), [3, 4]);
+}