-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as not planned
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
use std::sync::Arc;
use std::fmt;
use std::cmp::PartialEq;
trait Foo {}
impl PartialEq for Foo {
fn eq(&self, other: &Foo) -> bool {
true
}
}
type Bar = Arc<Foo>;
#[derive(PartialEq)]
struct Baz {
bar: Bar,
}
fn main() {}
error[E0507]: cannot move out of borrowed content
--> foo.rs:17:5
|
17 | bar: Bar,
| ^^^^^^^^ cannot move out of borrowed content
error[E0507]: cannot move out of borrowed content
--> foo.rs:17:5
|
17 | bar: Bar,
| ^^^^^^^^ cannot move out of borrowed content
error: aborting due to 2 previous errors
Expanded:
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
use std::sync::Arc;
use std::fmt;
use std::cmp::PartialEq;
trait Foo { }
impl PartialEq for Foo {
fn eq(&self, other: &Foo) -> bool { true }
}
type Bar = Arc<Foo>;
struct Baz {
bar: Bar,
}
#[automatically_derived]
#[allow(unused_qualifications)]
impl ::std::cmp::PartialEq for Baz {
#[inline]
fn eq(&self, __arg_0: &Baz) -> bool {
match *__arg_0 {
Baz { bar: ref __self_1_0 } =>
match *self {
Baz { bar: ref __self_0_0 } =>
true && (*__self_0_0) == (*__self_1_0),
},
}
}
#[inline]
fn ne(&self, __arg_0: &Baz) -> bool {
match *__arg_0 {
Baz { bar: ref __self_1_0 } =>
match *self {
Baz { bar: ref __self_0_0 } =>
false || (*__self_0_0) != (*__self_1_0),
},
}
}
}
fn main() { }
ColonelThirtyTwo, MatrixDev and robinhundt
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.