fix the &mut _ patterns
This commit is contained in:
parent
ed4bebda96
commit
7d72719efc
15 changed files with 23 additions and 23 deletions
|
|
@ -118,7 +118,7 @@ fn transform(piece: Vec<(int, int)> , all: bool) -> Vec<Vec<(int, int)>> {
|
|||
// translating to (0, 0) as minimum coordinates.
|
||||
for cur_piece in res.iter_mut() {
|
||||
let (dy, dx) = *cur_piece.iter().min_by(|e| *e).unwrap();
|
||||
for &(ref mut y, ref mut x) in cur_piece.iter_mut() {
|
||||
for &mut (ref mut y, ref mut x) in cur_piece.iter_mut() {
|
||||
*y -= dy; *x -= dx;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use std::slice::ChunksMut;
|
|||
fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>)
|
||||
{
|
||||
for
|
||||
&something
|
||||
&mut something
|
||||
//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[T]`
|
||||
in arg2
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
|
||||
// (separate lines to ensure the spans are accurate)
|
||||
|
||||
let &_ // ~ ERROR expected `&mut isize`, found `&_`
|
||||
let &_ //~ ERROR expected `&mut isize`, found `&_`
|
||||
= foo;
|
||||
let &mut _ = foo;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ enum Option<T> {
|
|||
|
||||
fn main() {
|
||||
match &mut Some(1i) {
|
||||
ref mut z @ &Some(ref a) => {
|
||||
ref mut z @ &mut Some(ref a) => {
|
||||
//~^ ERROR pattern bindings are not allowed after an `@`
|
||||
**z = None;
|
||||
println!("{}", *a);
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ enum Foo {
|
|||
impl Drop for Foo {
|
||||
fn drop(&mut self) {
|
||||
match self {
|
||||
&Foo::SimpleVariant(ref mut sender) => {
|
||||
&mut Foo::SimpleVariant(ref mut sender) => {
|
||||
sender.send(Message::DestructorRan).unwrap();
|
||||
}
|
||||
&Foo::NestedVariant(_, _, ref mut sender) => {
|
||||
&mut Foo::NestedVariant(_, _, ref mut sender) => {
|
||||
sender.send(Message::DestructorRan).unwrap();
|
||||
}
|
||||
&Foo::FailingVariant { .. } => {
|
||||
&mut Foo::FailingVariant { .. } => {
|
||||
panic!("Failed");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ impl Deref for X {
|
|||
|
||||
impl DerefMut for X {
|
||||
fn deref_mut(&mut self) -> &mut int {
|
||||
let &X(box ref mut x) = self;
|
||||
let &mut X(box ref mut x) = self;
|
||||
x
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue