error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:34:23
   |
LL |     if let Some(Some(&&x)) = &Some(Some(&0)) {
   |                       ^^     --------------- this expression has type `&Option<Option<&{integer}>>`
   |                       |
   |                       expected integer, found `&_`
   |
   = note:   expected type `{integer}`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let Some(Some(&&x)) = &Some(Some(&0)) {
LL +     if let Some(Some(&x)) = &Some(Some(&0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:41:22
   |
LL |     if let Some(Some(&x)) = &Some(&Some(0)) {
   |                      ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
   |                      |
   |                      expected integer, found `&_`
   |
   = note:   expected type `{integer}`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let Some(Some(&x)) = &Some(&Some(0)) {
LL +     if let Some(Some(x)) = &Some(&Some(0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:46:17
   |
LL |     if let Some(&Some(x)) = &Some(Some(0)) {
   |                 ^^^^^^^^    -------------- this expression has type `&Option<Option<{integer}>>`
   |                 |
   |                 expected `Option<{integer}>`, found `&_`
   |
   = note:   expected enum `Option<{integer}>`
           found reference `&_`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:51:22
   |
LL |     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
   |                      ^^^^^^     ----------------------- this expression has type `&mut Option<&mut Option<{integer}>>`
   |                      |
   |                      expected integer, found `&mut _`
   |
   = note:           expected type `{integer}`
           found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
  --> $DIR/well-typed-edition-2024.rs:51:22
   |
LL |     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
   |                      ^^^^^^
help: consider removing `&mut` from the pattern
   |
LL -     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
LL +     if let Some(Some(x)) = &mut Some(&mut Some(0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:58:23
   |
LL |     if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
   |                       ^^     ------------------- this expression has type `Option<&Option<&mut {integer}>>`
   |                       |
   |                       types differ in mutability
   |
   = note: expected mutable reference `&mut {integer}`
                      found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
LL +     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:65:23
   |
LL |     if let Some(&Some(&x)) = &Some(&Some(0)) {
   |                       ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
   |                       |
   |                       expected integer, found `&_`
   |
   = note:   expected type `{integer}`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let Some(&Some(&x)) = &Some(&Some(0)) {
LL +     if let Some(&Some(x)) = &Some(&Some(0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:72:17
   |
LL |     if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
   |                 ^^^^^^^^^^^^^^^    ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
   |                 |
   |                 expected `Option<&mut Option<{integer}>>`, found `&_`
   |
   = note:   expected enum `Option<&mut Option<{integer}>>`
           found reference `&_`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:77:17
   |
LL |     if let Some(&Some(x)) = &mut Some(Some(0)) {
   |                 ^^^^^^^^    ------------------ this expression has type `&mut Option<Option<{integer}>>`
   |                 |
   |                 expected `Option<{integer}>`, found `&_`
   |
   = note:   expected enum `Option<{integer}>`
           found reference `&_`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:84:17
   |
LL |     if let Some(&Some(&x)) = &Some(&mut Some(0)) {
   |                 ^^^^^^^^^    ------------------- this expression has type `&Option<&mut Option<{integer}>>`
   |                 |
   |                 types differ in mutability
   |
   = note: expected mutable reference `&mut Option<{integer}>`
                      found reference `&_`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:90:23
   |
LL |     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
   |                       ^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
   |                       |
   |                       expected integer, found `&_`
   |
   = note:   expected type `{integer}`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
LL +     if let Some(&Some(x)) = &mut Some(&Some(0)) {
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:98:10
   |
LL |     let [&mut x] = &mut [&0];
   |          ^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
  --> $DIR/well-typed-edition-2024.rs:98:10
   |
LL |     let [&mut x] = &mut [&0];
   |          ^^^^^^
help: consider removing `&mut` from the pattern
   |
LL -     let [&mut x] = &mut [&0];
LL +     let [x] = &mut [&0];
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:104:10
   |
LL |     let [&mut ref x] = &mut [&0];
   |          ^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
  --> $DIR/well-typed-edition-2024.rs:104:10
   |
LL |     let [&mut ref x] = &mut [&0];
   |          ^^^^^^^^^^
help: consider removing `&mut` from the pattern
   |
LL -     let [&mut ref x] = &mut [&0];
LL +     let [ref x] = &mut [&0];
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:119:10
   |
LL |     let [&mut mut x] = &mut [&0];
   |          ^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
  --> $DIR/well-typed-edition-2024.rs:119:10
   |
LL |     let [&mut mut x] = &mut [&0];
   |          ^^^^^^^^^^
help: consider removing `&mut` from the pattern
   |
LL -     let [&mut mut x] = &mut [&0];
LL +     let [mut x] = &mut [&0];
   |

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:125:10
   |
LL |     let [&mut &x] = &mut [&0];
   |          ^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:131:10
   |
LL |     let [&mut &ref x] = &mut [&0];
   |          ^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:137:10
   |
LL |     let [&mut &(mut x)] = &mut [&0];
   |          ^^^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |          |
   |          types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`

error[E0308]: mismatched types
  --> $DIR/well-typed-edition-2024.rs:111:14
   |
LL |         let [&mut ref mut x] = &mut [&0];
   |              ^^^^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
   |              |
   |              types differ in mutability
   |
   = note:      expected reference `&{integer}`
           found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
  --> $DIR/well-typed-edition-2024.rs:111:14
   |
LL |         let [&mut ref mut x] = &mut [&0];
   |              ^^^^^^^^^^^^^^
help: consider removing `&mut` from the pattern
   |
LL -         let [&mut ref mut x] = &mut [&0];
LL +         let [ref mut x] = &mut [&0];
   |

error: aborting due to 17 previous errors

For more information about this error, try `rustc --explain E0308`.
