-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
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.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
This fails to compile, with a rather cryptic error message: [playground]
#[derive(PartialEq, PartialOrd)]
struct Bad<'a>(&'a mut u8);
This is one of the errors in the expanded code (the rest are similar):
// error[E0389]: cannot borrow data mutably in a `&` reference
fn lt(&self, __arg_0: &Bad<'a>) -> bool {
match *__arg_0 {
Bad(ref __self_1_0) =>
// -------------- consider changing this to `ref mut __self_1_0`
match *self {
Bad(ref __self_0_0) =>
(*__self_0_0) < (*__self_1_0) ||
// ^^^^^^^^^^^^^ assignment into an immutable reference
!((*__self_1_0) < (*__self_0_0)) && false,
},
}
}
Seems quite similar to #15689.
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.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.