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

ices/71316.sh: fixed with errors #370

Merged
merged 1 commit into from
May 17, 2020
Merged

ices/71316.sh: fixed with errors #370

merged 1 commit into from
May 17, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#71316

#!/bin/bash

rustc -Zunleash-the-miri-inside-of-you - << END

#![feature(const_raw_ptr_deref)]
#![feature(const_mut_refs)]
#![allow(const_err)]

use std::cell::UnsafeCell;

// make sure we do not just intern this as mutable
const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;

fn main() {}

END
=== stdout ===
=== stderr ===
warning: constant is never used: `MUTABLE_BEHIND_RAW`
 --> <anon>:9:1
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

error: untyped pointers are not allowed in constant
 --> <anon>:9:1
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: skipping const checks
  |
help: skipping check that does not even have a feature gate
 --> <anon>:9:38
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  |                                      ^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 2 warnings emitted

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

=== stdout ===
=== stderr ===
warning: constant is never used: `MUTABLE_BEHIND_RAW`
 --> <anon>:9:1
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

error: untyped pointers are not allowed in constant
 --> <anon>:9:1
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: skipping const checks
  |
help: skipping check that does not even have a feature gate
 --> <anon>:9:38
  |
9 | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
  |                                      ^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 2 warnings emitted

==============
@JohnTitor JohnTitor merged commit 8752ee7 into master May 17, 2020
@JohnTitor JohnTitor deleted the autofix/ices/71316.sh branch May 17, 2020 12:08
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