Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/91816.rs: fixed with errors #1081

Merged
merged 1 commit into from
Jan 8, 2022
Merged

ices/91816.rs: fixed with errors #1081

merged 1 commit into from
Jan 8, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 8, 2022

Issue: rust-lang/rust#91816

struct S<T>([T; 1]);

impl<K, V> S<(K, V)> {
    pub const fn foo(mut self, value: V) -> Self {
        let _arr = self.0;
        self.0[0].1 = value; //~ move
        self
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0493]: destructors cannot be evaluated at compile-time
 --> /home/runner/work/glacier/glacier/ices/91816.rs:6:9
  |
6 |         self.0[0].1 = value; //~ move
  |         ^^^^^^^^^^^
  |         |
  |         constant functions cannot evaluate destructors
  |         value is dropped here

error[E0493]: destructors cannot be evaluated at compile-time
 --> /home/runner/work/glacier/glacier/ices/91816.rs:5:13
  |
5 |         let _arr = self.0;
  |             ^^^^ constant functions cannot evaluate destructors
...
8 |     }
  |     - value is dropped here

error[E0382]: assign to part of moved value: `self.0`
 --> /home/runner/work/glacier/glacier/ices/91816.rs:6:9
  |
5 |         let _arr = self.0;
  |                    ------ value moved here
6 |         self.0[0].1 = value; //~ move
  |         ^^^^^^^^^^^ value partially assigned here after move
  |
  = note: move occurs because `self.0` has type `[(K, V); 1]`, which does not implement the `Copy` trait

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0382, E0493.
For more information about an error, try `rustc --explain E0382`.
==============

=== stdout ===
=== stderr ===
error[E0493]: destructors cannot be evaluated at compile-time
 --> /home/runner/work/glacier/glacier/ices/91816.rs:6:9
  |
6 |         self.0[0].1 = value; //~ move
  |         ^^^^^^^^^^^
  |         |
  |         constant functions cannot evaluate destructors
  |         value is dropped here

error[E0493]: destructors cannot be evaluated at compile-time
 --> /home/runner/work/glacier/glacier/ices/91816.rs:5:13
  |
5 |         let _arr = self.0;
  |             ^^^^ constant functions cannot evaluate destructors
...
8 |     }
  |     - value is dropped here

error[E0382]: assign to part of moved value: `self.0`
 --> /home/runner/work/glacier/glacier/ices/91816.rs:6:9
  |
5 |         let _arr = self.0;
  |                    ------ value moved here
6 |         self.0[0].1 = value; //~ move
  |         ^^^^^^^^^^^ value partially assigned here after move
  |
  = note: move occurs because `self.0` has type `[(K, V); 1]`, which does not implement the `Copy` trait

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0382, E0493.
For more information about an error, try `rustc --explain E0382`.
==============
@Alexendoo Alexendoo merged commit d3cb97e into master Jan 8, 2022
@Alexendoo Alexendoo deleted the autofix/ices/91816.rs branch January 8, 2022 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants