pub fn const_get_real(&self, v: &'ll Value) -> Option<(f64, bool)> {
unsafe {
if self.is_const_real(v) {
+ #[allow(deprecated)]
let mut loses_info: llvm::Bool = ::std::mem::uninitialized();
let r = llvm::LLVMConstRealGetDouble(v, &mut loses_info);
let loses_info = if loses_info == 1 { true } else { false };
where R: Read, W: Write
{
let mut buf = unsafe {
+ #[allow(deprecated)]
let mut buf: [u8; super::DEFAULT_BUF_SIZE] = mem::uninitialized();
reader.initializer().initialize(&mut buf);
buf
+#![allow(deprecated)] // mem::uninitialized
+
use crate::io::ErrorKind;
use crate::mem;
//! This module contains the facade (aka platform-specific) implementations of
//! OS level functionality for Fortanix SGX.
+#![allow(deprecated)]
+
use crate::io::ErrorKind;
use crate::os::raw::c_char;
use crate::sync::atomic::{AtomicBool, Ordering};
let fg;
let bg;
unsafe {
+ #[allow(deprecated)]
let mut buffer_info = ::std::mem::uninitialized();
if GetConsoleScreenBufferInfo(GetStdHandle(-11i32 as DWORD), &mut buffer_info) != 0 {
fg = bits_to_color(buffer_info.wAttributes);
use std::mem;
fn main() {
+ #[allow(deprecated)]
let xs: [u8; 4] = unsafe { mem::uninitialized() };
let y = xs[0] + xs[1];
}
fn main() {
// Check that the tail statement in the body unifies with something
for _ in 0..3 {
+ #[allow(deprecated)]
unsafe { std::mem::uninitialized() }
}
impl FromUnchecked for [u8; 1] {
unsafe fn from_unchecked() {
+ #[allow(deprecated)]
let mut array: Self = std::mem::uninitialized();
let _ptr = &mut array as *mut [u8] as *mut u8;
}
// in a runtime panic.
#![feature(never_type)]
+#![allow(deprecated)]
use std::{mem, panic};
#[allow(unconditional_recursion)]
fn recurse(array: &[u64]) {
unsafe { black_box(array.as_ptr() as u64); }
+ #[allow(deprecated)]
let local: [_; 1024] = unsafe { mem::uninitialized() };
recurse(&local);
}
unsafe {
// This should be safe, because we don't match on it unless it's fully formed,
// and it doesn't have a destructor.
+ #[allow(deprecated)]
let mut dest: MyEnum = mem::uninitialized();
while buf.len() > 0 {
match parse_my_enum(&mut dest, &mut buf) {
unsafe {
// This should be safe, because we don't match on it unless it's fully formed,
// and it doesn't have a destructor.
+ #[allow(deprecated)]
let mut dest: MyEnum = mem::uninitialized();
while buf.len() > 0 {
match parse_my_enum(&mut dest, &mut buf) {
unsafe {
// This should be safe, because we don't match on it unless it's fully formed,
// and it doesn't have a destructor.
+ #[allow(deprecated)]
let mut dest: MyEnum = mem::uninitialized();
while buf.len() > 0 {
match parse_my_enum(&mut dest, &mut buf) {
#[derive(Clone)]
struct Foo;
+#[allow(deprecated)]
pub fn main() {
unsafe {
let _x: Foo = mem::uninitialized();
impl<U: Unsigned> Add<U> for UTerm {
type Output = U;
fn add(self, _: U) -> Self::Output {
+ #[allow(deprecated)]
unsafe { ::std::mem::uninitialized() }
}
}
fn foo<const SIZE: usize>() {
let arr: [u8; SIZE] = unsafe {
+ #[allow(deprecated)]
let mut array: [u8; SIZE] = mem::uninitialized();
array
};
// This note is annotated because the purpose of the test
// is to ensure that certain other notes are not generated.
#![deny(unused_unsafe)] //~ NOTE
+#![allow(deprecated)]
// (test that no note is generated on this unsafe fn)
pub unsafe fn a() {
error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:8:9
+ --> $DIR/issue-48131.rs:9:9
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
| ^^^^^^^^^^^^^
error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:19:13
+ --> $DIR/issue-48131.rs:20:13
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
+#![allow(deprecated)]
+
enum Void {}
fn main() {
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
- --> $DIR/uninhabited-matches-feature-gated.rs:5:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:7:19
|
LL | let _ = match x {
| ^ pattern `Err(_)` not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: type `&Void` is non-empty
- --> $DIR/uninhabited-matches-feature-gated.rs:10:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:12:19
|
LL | let _ = match x {};
| ^
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
- --> $DIR/uninhabited-matches-feature-gated.rs:13:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:15:19
|
LL | let _ = match x {};
| ^
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
- --> $DIR/uninhabited-matches-feature-gated.rs:16:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:18:19
|
LL | let _ = match x {};
| ^
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: `&[_]` not covered
- --> $DIR/uninhabited-matches-feature-gated.rs:19:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:21:19
|
LL | let _ = match x {
| ^ pattern `&[_]` not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
- --> $DIR/uninhabited-matches-feature-gated.rs:27:19
+ --> $DIR/uninhabited-matches-feature-gated.rs:29:19
|
LL | let _ = match x {
| ^ pattern `Err(_)` not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0005]: refutable pattern in local binding: `Err(_)` not covered
- --> $DIR/uninhabited-matches-feature-gated.rs:32:9
+ --> $DIR/uninhabited-matches-feature-gated.rs:34:9
|
LL | let Ok(x) = x;
| ^^^^^ pattern `Err(_)` not covered