mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Fix some irrelevant warnings in tests/incremental
This avoids having to add several unhelpful annotations when enabling diagnostic checks for `cpass` and `rpass` revisions.
This commit is contained in:
@@ -995,6 +995,7 @@ fn compile_test_general(
|
||||
AllowUnused::No
|
||||
}
|
||||
}
|
||||
TestMode::Incremental => AllowUnused::Yes,
|
||||
_ => AllowUnused::No,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//@ revisions: rpass1 rpass2 rpass3
|
||||
//@ compile-flags: -Zincremental-ignore-spans
|
||||
//@ ignore-backends: gcc
|
||||
#![feature(generic_associated_types)]
|
||||
|
||||
// This test unsures that with_opt_const_param returns the
|
||||
// def_id of the N param in the Foo::Assoc GAT.
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
extern crate a;
|
||||
|
||||
#[cfg(rpass1)]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: a::X = 22;
|
||||
x as u32
|
||||
}
|
||||
|
||||
#[cfg(rpass2)]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
22
|
||||
}
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
#[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: a::X = 22;
|
||||
x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: a::Y = 'c';
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// ignore-tidy-linelength
|
||||
//@ only-x86_64-unknown-linux-gnu
|
||||
//@ revisions:rpass1 rpass2 rpass3 rpass4
|
||||
//@ ignore-backends: gcc
|
||||
|
||||
//@ [rpass1]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
|
||||
//@ [rpass2]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#![cfg_attr(rpass2, warn(dead_code))]
|
||||
|
||||
pub static mut BAA: *const i8 = unsafe { &BOO as *const _ as *const i8 };
|
||||
pub static mut BAA: *const i8 = unsafe { &raw const BOO as *const i8 };
|
||||
|
||||
pub static mut BOO: *const i8 = unsafe { &BAA as *const _ as *const i8 };
|
||||
pub static mut BOO: *const i8 = unsafe { &raw const BAA as *const i8 };
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -23,17 +23,17 @@ pub struct Y {
|
||||
}
|
||||
|
||||
#[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")]
|
||||
pub fn use_X(x: X) -> u32 {
|
||||
pub fn use_x(x: X) -> u32 {
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ pub struct Y {
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="cfail2")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
//[cfail2]~^ ERROR struct `X` has no field named `x`
|
||||
x.x as u32
|
||||
@@ -35,13 +35,13 @@ pub fn use_X() -> u32 {
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="cfail2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
//[cfail2]~^ ERROR no field `x` on type `X`
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -26,19 +26,19 @@ pub struct Y {
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(x: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(x: EmbedX) -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -10,18 +10,18 @@
|
||||
use a::*;
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -26,19 +26,19 @@ pub struct Y {
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_EmbedX(x: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(x: EmbedX) -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ pub struct Y {
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root,fn_sig", cfg="rpass2")]
|
||||
pub fn use_X(x: X) -> u32 {
|
||||
pub fn use_x(x: X) -> u32 {
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
pub fn use_embed_x(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: Y = Y { y: 'c' };
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_X() -> u32 {
|
||||
pub fn use_x() -> u32 {
|
||||
let x: a::X = 22;
|
||||
x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_Y() {
|
||||
pub fn use_y() {
|
||||
let x: a::Y = 'c';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user