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

ices/89682-2.rs: fixed with no errors #1140

Merged
merged 1 commit into from
Feb 19, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#89682

#![feature(allocator_api)]
use core::alloc::{AllocError, Allocator, Layout};
use core::ptr::NonNull;

struct ZST;
unsafe impl Allocator for &ZST {
    fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
        todo!()
    }
    unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
        todo!()
    }
}
fn main() {
    let _ = Box::<i32, &ZST>::new_in(43, &ZST);
}
=== stdout ===
=== stderr ===
warning: unused variable: `layout`
 --> /home/runner/work/glacier/glacier/ices/89682-2.rs:7:24
  |
7 |     fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
  |                        ^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `ptr`
  --> /home/runner/work/glacier/glacier/ices/89682-2.rs:10:33
   |
10 |     unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
   |                                 ^^^ help: if this is intentional, prefix it with an underscore: `_ptr`

warning: unused variable: `layout`
  --> /home/runner/work/glacier/glacier/ices/89682-2.rs:10:51
   |
10 |     unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
   |                                                   ^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout`

warning: 3 warnings emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `layout`
 --> /home/runner/work/glacier/glacier/ices/89682-2.rs:7:24
  |
7 |     fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
  |                        ^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `ptr`
  --> /home/runner/work/glacier/glacier/ices/89682-2.rs:10:33
   |
10 |     unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
   |                                 ^^^ help: if this is intentional, prefix it with an underscore: `_ptr`

warning: unused variable: `layout`
  --> /home/runner/work/glacier/glacier/ices/89682-2.rs:10:51
   |
10 |     unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
   |                                                   ^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout`

warning: 3 warnings emitted

==============
@Alexendoo Alexendoo merged commit 135f737 into master Feb 19, 2022
@Alexendoo Alexendoo deleted the autofix/ices/89682-2.rs branch February 19, 2022 12:19
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