From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/borrowck/borrowck-loan-in-overloaded-op.rs | 23 ---------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs (limited to 'src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs') diff --git a/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs b/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs deleted file mode 100644 index b8f1650fc..000000000 --- a/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![feature(box_patterns)] - - -use std::ops::Add; - -#[derive(Clone)] -struct Foo(Box); - -impl Add for Foo { - type Output = Foo; - - fn add(self, f: Foo) -> Foo { - let Foo(box i) = self; - let Foo(box j) = f; - Foo(Box::new(i + j)) - } -} - -fn main() { - let x = Foo(Box::new(3)); - let _y = {x} + x.clone(); // the `{x}` forces a move to occur - //~^ ERROR borrow of moved value: `x` -} -- cgit v1.2.3