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

ices/83539.rs: fixed with errors #1695

Merged
merged 1 commit into from
Oct 25, 2023
Merged

ices/83539.rs: fixed with errors #1695

merged 1 commit into from
Oct 25, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#83539

#![crate_type = "staticlib"]
#![feature(rustc_attrs)]
struct S;
#[rustc_mir()]
fn foo(x: &S) {
    let ret;
    *x;
    ret
}
=== stdout ===
=== stderr ===
warning: the feature `rustc_attrs` is internal to the compiler or standard library
 --> /home/runner/work/glacier/glacier/ices/83539.rs:2:12
  |
2 | #![feature(rustc_attrs)]
  |            ^^^^^^^^^^^
  |
  = note: using it is strongly discouraged
  = note: `#[warn(internal_features)]` on by default

error[E0507]: cannot move out of `*x` which is behind a shared reference
 --> /home/runner/work/glacier/glacier/ices/83539.rs:7:5
  |
7 |     *x;
  |     ^^ move occurs because `*x` has type `S`, which does not implement the `Copy` trait

error[E0381]: used binding `ret` isn't initialized
 --> /home/runner/work/glacier/glacier/ices/83539.rs:8:5
  |
6 |     let ret;
  |         --- binding declared here but left uninitialized
7 |     *x;
8 |     ret
  |     ^^^ `ret` used here but it isn't initialized
  |
help: consider assigning a value
  |
6 |     let ret = todo!();
  |             +++++++++

error: aborting due to 2 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `rustc_attrs` is internal to the compiler or standard library
 --> /home/runner/work/glacier/glacier/ices/83539.rs:2:12
  |
2 | #![feature(rustc_attrs)]
  |            ^^^^^^^^^^^
  |
  = note: using it is strongly discouraged
  = note: `#[warn(internal_features)]` on by default

error[E0507]: cannot move out of `*x` which is behind a shared reference
 --> /home/runner/work/glacier/glacier/ices/83539.rs:7:5
  |
7 |     *x;
  |     ^^ move occurs because `*x` has type `S`, which does not implement the `Copy` trait

error[E0381]: used binding `ret` isn't initialized
 --> /home/runner/work/glacier/glacier/ices/83539.rs:8:5
  |
6 |     let ret;
  |         --- binding declared here but left uninitialized
7 |     *x;
8 |     ret
  |     ^^^ `ret` used here but it isn't initialized
  |
help: consider assigning a value
  |
6 |     let ret = todo!();
  |             +++++++++

error: aborting due to 2 previous errors; 1 warning emitted

Some errors have detailed explanations: E0381, E0507.
For more information about an error, try `rustc --explain E0381`.
==============
@JohnTitor JohnTitor merged commit 3402e51 into master Oct 25, 2023
@JohnTitor JohnTitor deleted the autofix/ices/83539.rs branch October 25, 2023 14:34
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