]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-object-lifetime.rs
Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyup
[rust.git] / src / test / ui / borrowck / borrowck-object-lifetime.rs
index cb7486aefa28ba8c7b2fcb09fa9d5dc0260da765..137a9adbc40ac36b23b2ee9f3a50146c747ca7e2 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2014 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.
-
 // Test that borrows that occur due to calls to object methods
 // properly "claim" the object path.
 
@@ -18,26 +8,26 @@ trait Foo {
     fn mut_borrowed(&mut self) -> &();
 }
 
-fn borrowed_receiver(x: &Foo) {
+fn borrowed_receiver(x: &dyn Foo) {
     let y = x.borrowed();
     let z = x.borrowed();
     z.use_ref();
     y.use_ref();
 }
 
-fn mut_borrowed_receiver(x: &mut Foo) {
+fn mut_borrowed_receiver(x: &mut dyn Foo) {
     let y = x.borrowed();
     let z = x.mut_borrowed(); //~ ERROR cannot borrow
     y.use_ref();
 }
 
-fn mut_owned_receiver(mut x: Box<Foo>) {
+fn mut_owned_receiver(mut x: Box<dyn Foo>) {
     let y = x.borrowed();
     let z = &mut x; //~ ERROR cannot borrow
     y.use_ref();
 }
 
-fn imm_owned_receiver(mut x: Box<Foo>) {
+fn imm_owned_receiver(mut x: Box<dyn Foo>) {
     let y = x.borrowed();
     let z = &x;
     z.use_ref();