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

ices/94835.rs: fixed with no errors #1170

Merged
merged 1 commit into from
Mar 14, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#94835

#![feature(allocator_api)]
use std::alloc::Global;

fn main() {
    // f(()) // no ICE
    f(32); // ICE
}

pub fn f<T>(val: T) {
    *Box::new_in(val, &Global);
}
=== stdout ===
=== stderr ===
warning: unused unary operation that must be used
  --> /home/runner/work/glacier/glacier/ices/94835.rs:10:5
   |
10 |     *Box::new_in(val, &Global);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the unary operation produces a value
   |
   = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
   |
10 |     let _ = *Box::new_in(val, &Global);
   |     +++++++

warning: 1 warning emitted

==============

=== stdout ===
=== stderr ===
warning: unused unary operation that must be used
  --> /home/runner/work/glacier/glacier/ices/94835.rs:10:5
   |
10 |     *Box::new_in(val, &Global);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the unary operation produces a value
   |
   = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
   |
10 |     let _ = *Box::new_in(val, &Global);
   |     +++++++

warning: 1 warning emitted

==============
@Alexendoo Alexendoo merged commit f022dc2 into master Mar 14, 2022
@Alexendoo Alexendoo deleted the autofix/ices/94835.rs branch March 14, 2022 13:23
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