Merging master

This commit is contained in:
Matthias Einwag 2019-02-12 22:46:14 -08:00
commit 871338c3ae
1347 changed files with 17728 additions and 14515 deletions

View file

@ -0,0 +1,36 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
// min-llvm-version 7.0
#![crate_type = "lib"]
#![feature(repr_align_enum)]
#[repr(align(64))]
pub enum Align64 {
A(u32),
B(u32),
}
// CHECK: %Align64 = type { [0 x i32], i32, [15 x i32] }
pub struct Nested64 {
a: u8,
b: Align64,
c: u16,
}
// CHECK-LABEL: @align64
#[no_mangle]
pub fn align64(a: u32) -> Align64 {
// CHECK: %a64 = alloca %Align64, align 64
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 64 %{{.*}}, i8* align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
let a64 = Align64::A(a);
a64
}
// CHECK-LABEL: @nested64
#[no_mangle]
pub fn nested64(a: u8, b: u32, c: u16) -> Nested64 {
// CHECK: %n64 = alloca %Nested64, align 64
let n64 = Nested64 { a, b: Align64::B(b), c };
n64
}

View file

@ -9,5 +9,8 @@ use std::mem::MaybeUninit;
pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
// CHECK-LABEL: @box_uninitialized
// CHECK-NOT: store
// CHECK-NOT: alloca
// CHECK-NOT: memcpy
// CHECK-NOT: memset
Box::new(MaybeUninit::uninitialized())
}

View file

@ -60,7 +60,7 @@ pub mod point {
}
}
/// A fn that has the changed type in its signature; must currently be
/// A function that has the changed type in its signature; must currently be
/// rebuilt.
///
/// You could imagine that, in the future, if the change were
@ -76,7 +76,7 @@ pub mod fn_with_type_in_sig {
}
}
/// Call a fn that has the changed type in its signature; this
/// Call a function that has the changed type in its signature; this
/// currently must also be rebuilt.
///
/// You could imagine that, in the future, if the change were
@ -92,7 +92,7 @@ pub mod call_fn_with_type_in_sig {
}
}
/// A fn that uses the changed type, but only in its body, not its
/// A function that uses the changed type, but only in its body, not its
/// signature.
///
/// You could imagine that, in the future, if the change were
@ -108,10 +108,10 @@ pub mod fn_with_type_in_body {
}
}
/// A fn X that calls a fn Y, where Y uses the changed type in its
/// A function `X` that calls a function `Y`, where `Y` uses the changed type in its
/// body. In this case, the effects of the change should be contained
/// to Y; X should not have to be rebuilt, nor should it need to be
/// typechecked again.
/// to `Y`; `X` should not have to be rebuilt, nor should it need to be
/// type-checked again.
pub mod call_fn_with_type_in_body {
use fn_with_type_in_body;
@ -121,7 +121,7 @@ pub mod call_fn_with_type_in_body {
}
}
/// A fn item that makes an instance of `Point` but does not invoke methods
/// A function item that makes an instance of `Point` but does not invoke methods.
pub mod fn_make_struct {
use point::Point;
@ -131,7 +131,7 @@ pub mod fn_make_struct {
}
}
/// A fn item that reads fields from `Point` but does not invoke methods
/// A function item that reads fields from `Point` but does not invoke methods.
pub mod fn_read_field {
use point::Point;
@ -141,7 +141,7 @@ pub mod fn_read_field {
}
}
/// A fn item that writes to a field of `Point` but does not invoke methods
/// A function item that writes to a field of `Point` but does not invoke methods.
pub mod fn_write_field {
use point::Point;

View file

@ -25,7 +25,7 @@ pub fn change_callee_function() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_callee_function() {
callee2(1, 2)
@ -40,7 +40,7 @@ pub fn change_argument_function() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_function() {
callee1(1, 3)
@ -81,7 +81,7 @@ pub fn change_callee_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_callee_method() {
let s = Struct;
@ -98,7 +98,7 @@ pub fn change_argument_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_method() {
let s = Struct;
@ -115,7 +115,7 @@ pub fn change_ufcs_callee_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_ufcs_callee_method() {
let s = Struct;
@ -132,7 +132,7 @@ pub fn change_argument_method_ufcs() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_method_ufcs() {
let s = Struct;
@ -149,7 +149,7 @@ pub fn change_to_ufcs() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
// One might think this would be expanded in the HirBody/Mir, but it actually
// results in slightly different Hir/Mir.
@ -171,7 +171,7 @@ pub mod change_ufcs_callee_indirectly {
#[cfg(not(cfail1))]
use super::Struct2 as Struct;
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]

View file

@ -37,7 +37,7 @@ pub fn add_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_parameter() {
let x = 0u32;
@ -53,7 +53,7 @@ pub fn change_parameter_pattern() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_pattern() {
let _ = |&x: &u32| x;
@ -84,7 +84,7 @@ pub fn add_type_ascription_to_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_ascription_to_parameter() {
let closure = |x: u32| x + 1u32;
@ -101,7 +101,7 @@ pub fn change_parameter_type() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_type() {
let closure = |x: u16| (x as u64) + 1;

View file

@ -34,7 +34,7 @@ pub fn change_field_value_struct_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_struct_like() -> Enum {
Enum::Struct {
@ -96,7 +96,7 @@ pub fn change_constructor_path_struct_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_struct_like() {
let _ = Enum2::Struct {
@ -119,7 +119,7 @@ pub fn change_constructor_variant_struct_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_struct_like() {
let _ = Enum2::Struct2 {
@ -139,7 +139,7 @@ pub mod change_constructor_path_indirectly_struct_like {
#[rustc_clean(
cfg="cfail2",
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
except="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
@ -161,7 +161,7 @@ pub mod change_constructor_variant_indirectly_struct_like {
#[cfg(not(cfail1))]
use super::Enum2::Struct2 as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Enum2 {
Variant {
@ -180,7 +180,7 @@ pub fn change_field_value_tuple_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_tuple_like() -> Enum {
Enum::Tuple(0, 1, 3)
@ -197,7 +197,7 @@ pub fn change_constructor_path_tuple_like() {
#[cfg(not(cfail1))]
#[rustc_clean(
cfg="cfail2",
except="HirBody,MirOptimized,MirValidated,TypeckTables"
except="HirBody,MirOptimized,MirBuilt,TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_tuple_like() {
@ -215,7 +215,7 @@ pub fn change_constructor_variant_tuple_like() {
#[cfg(not(cfail1))]
#[rustc_clean(
cfg="cfail2",
except="HirBody,MirOptimized,MirValidated,TypeckTables"
except="HirBody,MirOptimized,MirBuilt,TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_tuple_like() {
@ -232,7 +232,7 @@ pub mod change_constructor_path_indirectly_tuple_like {
#[rustc_clean(
cfg="cfail2",
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
except="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
@ -251,7 +251,7 @@ pub mod change_constructor_variant_indirectly_tuple_like {
#[cfg(not(cfail1))]
use super::Enum2::Tuple2 as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Enum2 {
Variant(0, 1, 2)
@ -278,7 +278,7 @@ pub fn change_constructor_path_c_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_c_like() {
let _ = Clike2::B;
@ -293,7 +293,7 @@ pub fn change_constructor_variant_c_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_c_like() {
let _ = Clike::C;
@ -309,7 +309,7 @@ pub mod change_constructor_path_indirectly_c_like {
#[rustc_clean(
cfg="cfail2",
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
except="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
@ -328,7 +328,7 @@ pub mod change_constructor_variant_indirectly_c_like {
#[cfg(not(cfail1))]
use super::Clike::B as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Clike {
Variant

View file

@ -16,7 +16,7 @@ pub fn body_not_exported_to_metadata() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn body_not_exported_to_metadata() -> u32 {
2
@ -35,7 +35,7 @@ pub fn body_exported_to_metadata_because_of_inline() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_inline() -> u32 {
@ -55,7 +55,7 @@ pub fn body_exported_to_metadata_because_of_generic() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_generic() -> u32 {

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_iteration_variable_name() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_name() {
let mut _x = 0;
@ -71,7 +71,7 @@ pub fn change_iteration_variable_pattern() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_pattern() {
let mut _x = 0;
@ -94,7 +94,7 @@ pub fn change_iterable() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iterable() {
let mut _x = 0;
@ -116,7 +116,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -187,7 +187,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -237,7 +237,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -262,7 +262,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -24,7 +24,7 @@ pub fn add_parameter() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn add_parameter(p: i32) {}
@ -47,7 +47,7 @@ pub fn type_of_parameter(p: i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter(p: i64) {}
@ -59,7 +59,7 @@ pub fn type_of_parameter_ref(p: &i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter_ref(p: &mut i32) {}
@ -71,7 +71,7 @@ pub fn order_of_parameters(p1: i32, p2: i64) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn order_of_parameters(p2: i64, p1: i32) {}
@ -83,7 +83,7 @@ pub fn make_unsafe() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub unsafe fn make_unsafe() {}
@ -94,7 +94,7 @@ pub unsafe fn make_unsafe() {}
pub fn make_extern() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, MirBuilt, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub extern "C" fn make_extern() {}
@ -292,7 +292,7 @@ pub mod change_return_type_indirectly {
use super::ReferencedType2 as ReturnType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_return_type() -> ReturnType {
ReturnType {}
@ -309,7 +309,7 @@ pub mod change_parameter_type_indirectly {
use super::ReferencedType2 as ParameterType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirValidated, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_parameter_type(p: ParameterType) {}
}

View file

@ -25,7 +25,7 @@ pub fn change_condition(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_condition(x: bool) -> u32 {
if !x {
@ -46,7 +46,7 @@ pub fn change_then_branch(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_then_branch(x: bool) -> u32 {
if x {
@ -69,7 +69,7 @@ pub fn change_else_branch(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_else_branch(x: bool) -> u32 {
if x {
@ -120,7 +120,7 @@ pub fn change_condition_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_condition_if_let(x: Option<u32>) -> u32 {
if let Some(_) = x {
@ -143,7 +143,7 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
if let Some(x) = x {
@ -166,7 +166,7 @@ pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
if let Some(x) = x {

View file

@ -42,7 +42,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn method_body() {
println!("Hello, world!");
@ -63,7 +63,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn method_body_inlined() {
@ -114,7 +114,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirValidated"
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirBuilt"
)]
#[rustc_clean(cfg="cfail3")]
pub fn method_selfmutness(&mut self) { }
@ -154,7 +154,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirValidated"
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirBuilt"
)]
#[rustc_clean(cfg="cfail3")]
pub fn add_method_parameter(&self, _: i32) { }
@ -172,7 +172,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_parameter_name(&self, b: i64) { }
}
@ -191,7 +191,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,FnSignature,MirOptimized,MirValidated,TypeckTables")]
except="Hir,HirBody,FnSignature,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_return_type(&self) -> u8 { 0 }
}
@ -226,7 +226,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_parameter_order(&self, b: i64, a: i64) { }
}
@ -245,7 +245,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirValidated"
except="Hir,HirBody,FnSignature,TypeckTables,MirOptimized,MirBuilt"
)]
#[rustc_clean(cfg="cfail3")]
pub unsafe fn make_method_unsafe(&self) { }
@ -263,7 +263,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,FnSignature,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,MirBuilt,FnSignature,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub extern fn make_method_extern(&self) { }
}
@ -447,7 +447,7 @@ impl Bar<u32> {
impl<T> Bar<T> {
#[rustc_clean(
cfg="cfail2",
except="GenericsOfItem,FnSignature,TypeckTables,TypeOfItem,MirOptimized,MirValidated"
except="GenericsOfItem,FnSignature,TypeckTables,TypeOfItem,MirOptimized,MirBuilt"
)]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_parameter_to_impl(&self) { }
@ -465,7 +465,7 @@ impl Bar<u32> {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail3")]
impl Bar<u64> {
#[rustc_clean(cfg="cfail2", except="FnSignature,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="FnSignature,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_impl_self_type(&self) { }
}

View file

@ -33,7 +33,7 @@ pub fn change_template(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_template(a: i32) -> i32 {
@ -69,7 +69,7 @@ pub fn change_output(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_output(a: i32) -> i32 {
@ -105,7 +105,7 @@ pub fn change_input(_a: i32, _b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_input(_a: i32, _b: i32) -> i32 {
@ -140,7 +140,7 @@ pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
@ -175,7 +175,7 @@ pub fn change_clobber(_a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_clobber(_a: i32) -> i32 {
@ -210,7 +210,7 @@ pub fn change_options(_a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_options(_a: i32) -> i32 {

View file

@ -22,7 +22,7 @@ pub fn change_name() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name() {
let _y = 2u64;
@ -38,7 +38,7 @@ pub fn add_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type() {
let _x: u32 = 2u32;
@ -54,7 +54,7 @@ pub fn change_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_type() {
let _x: u8 = 2;
@ -70,7 +70,7 @@ pub fn change_mutability_of_reference_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_reference_type() {
let _x: &mut u64;
@ -86,7 +86,7 @@ pub fn change_mutability_of_slot() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_slot() {
let _x: u64 = 0;
@ -102,7 +102,7 @@ pub fn change_simple_binding_to_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_simple_binding_to_pattern() {
let (_a, _b) = (0u8, 'x');
@ -118,7 +118,7 @@ pub fn change_name_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_in_pattern() {
let (_a, _c) = (1u8, 'y');
@ -134,7 +134,7 @@ pub fn add_ref_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn add_ref_in_pattern() {
let (ref _a, _b) = (1u8, 'y');
@ -150,7 +150,7 @@ pub fn add_amp_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn add_amp_in_pattern() {
let (&_a, _b) = (&1u8, 'y');
@ -166,7 +166,7 @@ pub fn change_mutability_of_binding_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_binding_in_pattern() {
let (mut _a, _b) = (99u8, 'q');
@ -182,7 +182,7 @@ pub fn add_initializer() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,TypeckTables,MirValidated,MirOptimized")]
except="HirBody,TypeckTables,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn add_initializer() {
let _x: i16 = 3i16;
@ -198,7 +198,7 @@ pub fn change_initializer() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_initializer() {
let _x = 5u16;

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -47,7 +47,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -118,7 +118,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -168,7 +168,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -193,7 +193,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -26,7 +26,7 @@ pub fn add_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_arm(x: u32) -> u32 {
match x {
@ -51,7 +51,7 @@ pub fn change_order_of_arms(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_order_of_arms(x: u32) -> u32 {
match x {
@ -75,7 +75,7 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_guard_clause(x: u32, y: bool) -> u32 {
match x {
@ -99,7 +99,7 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_guard_clause(x: u32, y: bool) -> u32 {
match x {
@ -123,7 +123,7 @@ pub fn add_at_binding(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_at_binding(x: u32) -> u32 {
match x {
@ -147,7 +147,7 @@ pub fn change_name_of_at_binding(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_of_at_binding(x: u32) -> u32 {
match x {
@ -170,7 +170,7 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_simple_name_to_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -193,7 +193,7 @@ pub fn change_name_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -216,7 +216,7 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -238,7 +238,7 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -260,7 +260,7 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
match (&x, x & 1) {
@ -283,7 +283,7 @@ pub fn change_rhs_of_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized")]
except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_rhs_of_arm(x: u32) -> u32 {
match x {
@ -307,7 +307,7 @@ pub fn add_alternative_to_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,MirValidated,MirOptimized,TypeckTables")]
except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_alternative_to_arm(x: u32) -> u32 {
match x {

View file

@ -18,7 +18,7 @@
// Indexing expression ---------------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn indexing(slice: &[u8]) -> u8 {
#[cfg(cfail1)]
@ -33,7 +33,7 @@ pub fn indexing(slice: &[u8]) -> u8 {
// Arithmetic overflow plus ----------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
#[cfg(cfail1)]
@ -48,7 +48,7 @@ pub fn arithmetic_overflow_plus(val: i32) -> i32 {
// Arithmetic overflow minus ----------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
#[cfg(cfail1)]
@ -63,7 +63,7 @@ pub fn arithmetic_overflow_minus(val: i32) -> i32 {
// Arithmetic overflow mult ----------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
#[cfg(cfail1)]
@ -78,7 +78,7 @@ pub fn arithmetic_overflow_mult(val: i32) -> i32 {
// Arithmetic overflow negation ------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
#[cfg(cfail1)]
@ -93,7 +93,7 @@ pub fn arithmetic_overflow_negation(val: i32) -> i32 {
// Division by zero ------------------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn division_by_zero(val: i32) -> i32 {
#[cfg(cfail1)]
@ -107,7 +107,7 @@ pub fn division_by_zero(val: i32) -> i32 {
}
// Division by zero ------------------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn mod_by_zero(val: i32) -> i32 {
#[cfg(cfail1)]
@ -122,7 +122,7 @@ pub fn mod_by_zero(val: i32) -> i32 {
// shift left ------------------------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_left(val: i32, shift: usize) -> i32 {
#[cfg(cfail1)]
@ -137,7 +137,7 @@ pub fn shift_left(val: i32, shift: usize) -> i32 {
// shift right ------------------------------------------------------------------
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_right(val: i32, shift: usize) -> i32 {
#[cfg(cfail1)]

View file

@ -31,7 +31,7 @@ pub fn change_field_value_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_regular_struct() -> RegularStruct {
RegularStruct {
@ -82,7 +82,7 @@ pub fn add_field_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_field_regular_struct() -> RegularStruct {
let struct1 = RegularStruct {
@ -117,7 +117,7 @@ pub fn change_field_label_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_label_regular_struct() -> RegularStruct {
let struct1 = RegularStruct {
@ -152,7 +152,7 @@ pub fn change_constructor_path_regular_struct() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_regular_struct() {
let _ = RegularStruct2 {
@ -173,7 +173,7 @@ pub mod change_constructor_path_indirectly_regular_struct {
#[rustc_clean(
cfg="cfail2",
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
except="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Struct {
@ -196,7 +196,7 @@ pub fn change_field_value_tuple_struct() -> TupleStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_tuple_struct() -> TupleStruct {
TupleStruct(0, 1, 3)
@ -213,7 +213,7 @@ pub fn change_constructor_path_tuple_struct() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_tuple_struct() {
let _ = TupleStruct2(0, 1, 2);
@ -230,7 +230,7 @@ pub mod change_constructor_path_indirectly_tuple_struct {
#[rustc_clean(
cfg="cfail2",
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
except="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,TypeckTables"
)]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Struct {

View file

@ -21,7 +21,7 @@ pub fn const_negation() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn const_negation() -> i32 {
-1
@ -36,7 +36,7 @@ pub fn const_bitwise_not() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn const_bitwise_not() -> i32 {
!99
@ -51,7 +51,7 @@ pub fn var_negation(x: i32, y: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_negation(x: i32, y: i32) -> i32 {
-y
@ -66,7 +66,7 @@ pub fn var_bitwise_not(x: i32, y: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_bitwise_not(x: i32, y: i32) -> i32 {
!y
@ -81,7 +81,7 @@ pub fn var_deref(x: &i32, y: &i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated,TypeckTables", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt,TypeckTables", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_deref(x: &i32, y: &i32) -> i32 {
*y
@ -96,7 +96,7 @@ pub fn first_const_add() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn first_const_add() -> i32 {
2 + 3
@ -111,7 +111,7 @@ pub fn second_const_add() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn second_const_add() -> i32 {
1 + 3
@ -126,7 +126,7 @@ pub fn first_var_add(a: i32, b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn first_var_add(a: i32, b: i32) -> i32 {
b + 2
@ -141,7 +141,7 @@ pub fn second_var_add(a: i32, b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn second_var_add(a: i32, b: i32) -> i32 {
1 + b
@ -156,7 +156,7 @@ pub fn plus_to_minus(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_minus(a: i32) -> i32 {
1 - a
@ -171,7 +171,7 @@ pub fn plus_to_mult(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_mult(a: i32) -> i32 {
1 * a
@ -186,7 +186,7 @@ pub fn plus_to_div(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_div(a: i32) -> i32 {
1 / a
@ -201,7 +201,7 @@ pub fn plus_to_mod(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_mod(a: i32) -> i32 {
1 % a
@ -216,7 +216,7 @@ pub fn and_to_or(a: bool, b: bool) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn and_to_or(a: bool, b: bool) -> bool {
a || b
@ -231,7 +231,7 @@ pub fn bitwise_and_to_bitwise_or(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_bitwise_or(a: i32) -> i32 {
1 | a
@ -246,7 +246,7 @@ pub fn bitwise_and_to_bitwise_xor(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_bitwise_xor(a: i32) -> i32 {
1 ^ a
@ -261,7 +261,7 @@ pub fn bitwise_and_to_lshift(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_lshift(a: i32) -> i32 {
a << 1
@ -276,7 +276,7 @@ pub fn bitwise_and_to_rshift(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_rshift(a: i32) -> i32 {
a >> 1
@ -291,7 +291,7 @@ pub fn eq_to_uneq(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_uneq(a: i32) -> bool {
a != 1
@ -306,7 +306,7 @@ pub fn eq_to_lt(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_lt(a: i32) -> bool {
a < 1
@ -321,7 +321,7 @@ pub fn eq_to_gt(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_gt(a: i32) -> bool {
a > 1
@ -336,7 +336,7 @@ pub fn eq_to_le(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_le(a: i32) -> bool {
a <= 1
@ -351,7 +351,7 @@ pub fn eq_to_ge(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_ge(a: i32) -> bool {
a >= 1
@ -368,7 +368,7 @@ pub fn type_cast(a: u8) -> u64 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated,TypeckTables", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt,TypeckTables", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn type_cast(a: u8) -> u64 {
let b = a as u32;
@ -385,7 +385,7 @@ pub fn value_cast(a: u32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn value_cast(a: u32) -> i32 {
2 as i32
@ -403,7 +403,7 @@ pub fn place() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn place() -> i32 {
let mut x = 10;
@ -423,7 +423,7 @@ pub fn rvalue() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn rvalue() -> i32 {
let mut x = 10;
@ -440,7 +440,7 @@ pub fn index_to_slice(s: &[u8], i: usize, j: usize) -> u8 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(except="HirBody,MirOptimized,MirBuilt", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn index_to_slice(s: &[u8], i: usize, j: usize) -> u8 {
s[j]

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_loop_condition() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_condition() {
let mut _x = 0;
@ -70,7 +70,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -141,7 +141,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -191,7 +191,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -216,7 +216,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_loop_condition() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_condition() {
let mut _x = 0;
@ -70,7 +70,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -141,7 +141,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -191,7 +191,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -216,7 +216,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -1,14 +1,12 @@
-include ../tools.mk
# ignore-macos
#
# This hits an assertion in the linker on older versions of osx apparently
ifeq ($(shell uname),Darwin)
all:
echo ignored
else
all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs -C prefer-dynamic
$(RUSTC) bar.rs
$(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar)
endif

View file

@ -1,17 +1,15 @@
-include ../tools.mk
# ignore-macos
#
# This hits an assertion in the linker on older versions of osx apparently
# This overrides the LD_LIBRARY_PATH for RUN
TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
# This hits an assertion in the linker on older versions of osx apparently
ifeq ($(shell uname),Darwin)
all:
echo ignored
else
all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs
$(RUSTC) bar.rs
$(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar)
endif

View file

@ -1,7 +1,8 @@
-include ../tools.mk
# FIXME: ignore freebsd
ifneq ($(shell uname),FreeBSD)
# ignore-freebsd
# FIXME
all:
$(RUSTC) foo.rs
$(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \
@ -9,8 +10,3 @@ all:
$(call RUN,bar)
rm $(call STATICLIB,foo)
$(call RUN,bar)
else
all:
endif

View file

@ -3,13 +3,10 @@
-include ../tools.mk
# ignore-windows
# FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU
# See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753
ifdef IS_WINDOWS
all:
true
else
all:
$(RUSTC) foo.rs
nm -g "$(call DYLIB,foo)" | $(CGREP) -v __rdl_ __rde_ __rg_ __rust_
endif

View file

@ -1,17 +1,9 @@
-include ../tools.mk
ifneq (,$(findstring MINGW,$(UNAME)))
ifndef IS_MSVC
# only-mingw
all:
$(CXX) foo.cpp -c -o $(TMPDIR)/foo.o
$(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/foo.o
$(RUSTC) foo.rs -lfoo -lstdc++
$(call RUN,foo)
else
all:
endif
else
all:
endif

View file

@ -1,9 +1,9 @@
-include ../tools.mk
# FIXME: ignore freebsd/windows
# (windows: see `../dep-info/Makefile`)
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
# ignore-windows
# ignore-freebsd
# FIXME: (windows: see `../dep-info/Makefile`)
all:
cp lib.rs $(TMPDIR)/
cp 'foo foo.rs' $(TMPDIR)/
@ -17,12 +17,3 @@ all:
pwd
$(MAKE) -drf Makefile.foo
rm $(TMPDIR)/done && exit 1 || exit 0
else
all:
endif
else
all:
endif

View file

@ -1,11 +1,11 @@
-include ../tools.mk
# FIXME: ignore freebsd/windows
# on windows `rustc --dep-info` produces Makefile dependency with
# ignore-windows
# ignore-freebsd
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
# windows native paths (e.g. `c:\path\to\libfoo.a`)
# but msys make seems to fail to recognize such paths, so test fails.
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
all:
cp *.rs $(TMPDIR)
$(RUSTC) --emit dep-info,link --crate-type=lib $(TMPDIR)/lib.rs
@ -23,12 +23,3 @@ all:
rm $(TMPDIR)/bar.rs
cp $(TMPDIR)/lib2.rs $(TMPDIR)/lib.rs
$(MAKE) -drf Makefile.foo
else
all:
endif
else
all:
endif

View file

@ -1,31 +1,13 @@
-include ../tools.mk
# ignore-windows
# ignore-macos
# min-llvm-version 6.0
#
# This feature only works when the output object format is ELF so we ignore
# macOS and Windows
ifdef IS_WINDOWS
# Do nothing on Windows.
all:
exit 0
else ifneq (,$(filter $(TARGET),i686-apple-darwin x86_64-apple-darwin))
# Do nothing on macOS.
all:
exit 0
else
# check that the .stack_sizes section is generated
# this test requires LLVM >= 6.0.0
vers = $(shell $(RUSTC) -Vv)
ifneq (,$(findstring LLVM version: 3,$(vers)))
all:
exit 0
else ifneq (,$(findstring LLVM version: 4,$(vers)))
all:
exit 0
else ifneq (,$(findstring LLVM version: 5,$(vers)))
all:
exit 0
else
all:
$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
endif
endif

View file

@ -1,13 +1,10 @@
-include ../tools.mk
# ignore-windows
# ignore-macos
# Test for #39529.
# `-z text` causes ld to error if there are any non-PIC sections
ifeq ($(UNAME),Darwin)
all:
else ifdef IS_WINDOWS
all:
else
all:
$(RUSTC) hello.rs -C link-args=-Wl,-z,text
endif

View file

@ -1,20 +1,11 @@
-include ../tools.mk
# FIXME: ignore freebsd/windows
# on windows `rustc --dep-info` produces Makefile dependency with
# ignore-windows
# ignore-freebsd
# FIXME: on windows `rustc --dep-info` produces Makefile dependency with
# windows native paths (e.g. `c:\path\to\libfoo.a`)
# but msys make seems to fail to recognize such paths, so test fails.
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
all:
$(RUSTC) --emit dep-info main.rs
$(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d
else
all:
endif
else
all:
endif

View file

@ -1,15 +1,11 @@
-include ../tools.mk
ifndef IS_WINDOWS
# The assembly for exit-unreachable.rs should be shorter because it's missing
# (at minimum) a return instruction.
# ignore-windows
#
# Because of Windows exception handling, the code is not necessarily any shorter.
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
all:
$(RUSTC) -O --emit asm exit-ret.rs
$(RUSTC) -O --emit asm exit-unreachable.rs
test `wc -l < $(TMPDIR)/exit-unreachable.s` -lt `wc -l < $(TMPDIR)/exit-ret.s`
else
# Because of Windows exception handling, the code is not necessarily any shorter.
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
all:
endif

View file

@ -1,12 +1,10 @@
-include ../tools.mk
ifeq ($(UNAME),Linux)
# only-linux
all:
$(RUSTC) foo.rs
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -o $(TMPDIR)/foo
$(call RUN,foo)
$(CC) foo.c -lfoo -L $(TMPDIR) -Wl,--gc-sections -lpthread -ldl -pie -fPIC -o $(TMPDIR)/foo
$(call RUN,foo)
else
all:
endif

View file

@ -1,8 +1,9 @@
-include ../tools.mk
# ignore-windows
OUT := $(TMPDIR)/out
ifndef IS_WINDOWS
all: time
time: libc
@ -13,6 +14,3 @@ time: libc
libc:
mkdir -p $(OUT)/libc
$(RUSTC) in/libc/lib.rs --crate-name=libc -Cmetadata=foo -o $(OUT)/libc/liblibc.rlib
else
all:
endif

View file

@ -1,21 +1,12 @@
-include ../tools.mk
ifeq (musl,$(findstring musl,$(TARGET)))
all: skip
else
all: test
endif
# ignore-musl
test: foo
all: foo
$(call RUN,foo)
skip:
echo "expected failure"
foo: foo.rs $(call NATIVE_STATICLIB,foo)
$(RUSTC) $< -lfoo $(EXTRACXXFLAGS)
$(TMPDIR)/libfoo.o: foo.cpp
$(call COMPILE_OBJ_CXX,$@,$<)
.PHONY: all test skip

View file

@ -1,12 +1,8 @@
-include ../tools.mk
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1)
# ignore stage1
all:
# ignore-stage1
else
all:
$(RUSTC) a.rs && $(RUSTC) b.rs
$(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \
--out-dir=$(TMPDIR)
endif

View file

@ -1,10 +1,6 @@
-include ../tools.mk
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1)
# ignore stage1
all:
# ignore-stage1
else
all:
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
endif

View file

@ -1,13 +1,9 @@
-include ../tools.mk
ifdef IS_WINDOWS
# Do nothing on MSVC.
all:
exit 0
else
# ignore-windows
all:
$(RUSTC) --emit=obj app.rs
nm $(TMPDIR)/app.o | $(CGREP) rust_begin_unwind
nm $(TMPDIR)/app.o | $(CGREP) rust_eh_personality
nm $(TMPDIR)/app.o | $(CGREP) rust_oom
endif

View file

@ -1,6 +1,6 @@
-include ../tools.mk
ifeq ($(if $(IS_WINDOWS),$(IS_MSVC),no),)
# only-mingw
all: empty.rs
cp -r $(shell cygpath -u $(shell $(RUSTC) --print sysroot)) $(TMPDIR)/sysroot
@ -8,9 +8,3 @@ all: empty.rs
mkdir -p $(TMPDIR)/obj
mv $(TMPDIR)/sysroot/lib/rustlib/$(TARGET)/lib/crt2.o $(TMPDIR)/obj/crt2.o
$(RUSTC) --target $(TARGET) --sysroot $(TMPDIR)/sysroot -L$(TMPDIR)/obj -Z print-link-args empty.rs | $(CGREP) 'obj\\crt2.o'
else
all:
endif

View file

@ -1,8 +1,6 @@
-include ../tools.mk
ifdef IS_WINDOWS
all:
else
# ignore-windows
NAME := $(shell $(RUSTC) --print file-names foo.rs)
@ -11,4 +9,3 @@ all:
$(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME)
ln -nsf outdir/$(NAME) $(TMPDIR)
RUST_LOG=rustc_metadata::loader $(RUSTC) bar.rs
endif

View file

@ -2,16 +2,16 @@
# Make sure we don't ICE if the linker prints a non-UTF-8 error message.
# Ignore Windows and Apple
# ignore-windows
#
# This does not work in its current form on windows, possibly due to
# gcc bugs or something about valid Windows paths. See issue #29151
# for more information.
ifndef IS_WINDOWS
# ignore-macos
#
# This also does not work on Apple APFS due to the filesystem requiring
# valid UTF-8 paths.
ifneq ($(shell uname),Darwin)
# The zzz it to allow humans to tab complete or glob this thing.
bad_dir := $(TMPDIR)/zzz$$'\xff'
@ -21,12 +21,3 @@ all:
mkdir $(bad_dir)
mv $(TMPDIR)/liblibrary.a $(bad_dir)
LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | $(CGREP) this_symbol_not_defined
else
all:
endif
else
all:
endif

View file

@ -1,5 +1,7 @@
-include ../tools.mk
# only-linux
# This tests ensure that global variables respect the target minimum alignment.
# The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have
# type-alignment of 1, but some targets require greater global alignment.
@ -8,7 +10,6 @@ SRC = min_global_align.rs
LL = $(TMPDIR)/min_global_align.ll
all:
ifeq ($(UNAME),Linux)
# Most targets are happy with default alignment -- take i686 for example.
ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86)
$(RUSTC) --target=i686-unknown-linux-gnu --emit=llvm-ir $(SRC)
@ -19,4 +20,3 @@ ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz)
$(RUSTC) --target=s390x-unknown-linux-gnu --emit=llvm-ir $(SRC)
[ "$$(grep -c 'align 2' "$(LL)")" -eq "3" ]
endif
endif

View file

@ -1,7 +1,8 @@
-include ../tools.mk
# only-linux
# only-x86_64
all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
$(RUSTC) hello.rs -C no_integrated_as
$(call RUN,hello)
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk
# ignore-windows
all:
ifeq ($(PROFILER_SUPPORT),1)
ifndef IS_WINDOWS
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk
# ignore-windows
all:
ifeq ($(PROFILER_SUPPORT),1)
ifndef IS_WINDOWS
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif
endif

View file

@ -1,11 +1,9 @@
-include ../tools.mk
ifdef IS_WINDOWS
# ignore windows
RUSTC_FLAGS =
else
# ignore-windows
# Notice the space in the end, this emulates the output of pkg-config
RUSTC_FLAGS = -C link-args="-lc "
endif
all:
$(RUSTC) $(RUSTC_FLAGS) empty.rs

View file

@ -1,9 +1,10 @@
-include ../tools.mk
# only-linux
#
# This tests the different -Zrelro-level values, and makes sure that they work properly.
all:
ifeq ($(UNAME),Linux)
# Ensure that binaries built with the full relro level links them with both
# RELRO and BIND_NOW for doing eager symbol resolving.
$(RUSTC) -Zrelro-level=full hello.rs
@ -18,4 +19,3 @@ ifeq ($(UNAME),Linux)
# enabled by default.
$(RUSTC) -Zrelro-level=off hello.rs
! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
endif

View file

@ -4,10 +4,10 @@
# while generating files. Ideally this would be a rustdoc-ui test, so we could
# verify the error message as well.
OUTPUT_DIR := "$(TMPDIR)/rustdoc-io-error"
# ignore-windows
# The test uses `chmod`.
# Ignore Windows: the test uses `chmod`.
ifndef IS_WINDOWS
OUTPUT_DIR := "$(TMPDIR)/rustdoc-io-error"
# This test operates by creating a temporary directory and modifying its
# permissions so that it is not writable. We have to take special care to set
@ -18,8 +18,3 @@ all:
-$(shell $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs)
chmod u+w $(OUTPUT_DIR)
exit $($(.SHELLSTATUS) -eq 1)
else
all:
endif

View file

@ -1,16 +1,12 @@
-include ../tools.mk
# only-linux
# only-x86_64
# ignore-test
# FIXME(#46126) ThinLTO for libstd broke this test
ifeq (1,0)
all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ifdef SANITIZER_SUPPORT
$(RUSTC) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP) librustc_lsan
$(TMPDIR)/leak 2>&1 | $(CGREP) 'detected memory leaks'
endif
endif
else
all:
endif

View file

@ -1,10 +1,10 @@
-include ../tools.mk
# only-linux
# only-x86_64
all:
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ifdef SANITIZER_SUPPORT
$(RUSTC) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP) librustc_msan
$(TMPDIR)/uninit 2>&1 | $(CGREP) use-of-uninitialized-value
endif
endif

View file

@ -0,0 +1,5 @@
-include ../tools.mk
all: $(call NATIVE_STATICLIB,define-foo)
$(RUSTC) -ldefine-foo use-foo.rs
$(call RUN,use-foo) || exit 1

View file

@ -0,0 +1,11 @@
#include <stdint.h>
struct Foo {
uint8_t x;
};
struct Foo FOO = { 42 };
uint8_t bar(const struct Foo* foo) {
return foo->x;
}

View file

@ -0,0 +1,14 @@
#![feature(extern_types)]
extern "C" {
type Foo;
static FOO: Foo;
fn bar(foo: *const Foo) -> u8;
}
fn main() {
unsafe {
let foo = &FOO;
assert_eq!(bar(foo), 42);
}
}

View file

@ -1,12 +1,9 @@
include ../tools.mk
ifdef IS_WINDOWS
# Do nothing on MSVC.
# ignore-windows
#
# On MINGW the --version-script, --dynamic-list, and --retain-symbol args don't
# seem to work reliably.
all:
exit 0
else
NM=nm -D
CDYLIB_NAME=liba_cdylib.so
@ -89,4 +86,3 @@ all:
# Check that an executable does not export any dynamic symbols
[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_c_function_from_rlib)" -eq "0" ]
[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_rust_function_from_exe)" -eq "0" ]
endif

View file

@ -1,7 +1,7 @@
-include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys.
ifndef IS_WINDOWS
# ignore-windows
# `ln` is actually `cp` on msys.
all:
$(RUSTC) foo.rs
@ -9,8 +9,3 @@ all:
ln -nsf $(TMPDIR)/libfoo.rlib $(TMPDIR)/other
$(RUSTC) bar.rs -L $(TMPDIR)
$(RUSTC) baz.rs --extern foo=$(TMPDIR)/other/libfoo.rlib -L $(TMPDIR)
else
all:
endif

View file

@ -1,15 +1,10 @@
-include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys.
ifndef IS_WINDOWS
# ignore-windows
# `ln` is actually `cp` on msys.
all:
$(RUSTC) foo.rs -C prefer-dynamic
mkdir -p $(TMPDIR)/other
ln -nsf $(TMPDIR)/$(call DYLIB_GLOB,foo) $(TMPDIR)/other
$(RUSTC) bar.rs -L $(TMPDIR)/other
else
all:
endif

View file

@ -1,14 +1,9 @@
-include ../tools.mk
# ignore windows: `ln` is actually `cp` on msys.
ifndef IS_WINDOWS
# ignore-windows
# `ln` is actually `cp` on msys.
all:
$(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo.xxx
ln -nsf $(TMPDIR)/foo.xxx $(TMPDIR)/libfoo.rlib
$(RUSTC) bar.rs -L $(TMPDIR)
else
all:
endif

View file

@ -1,8 +1,11 @@
-include ../tools.mk
# only-linux
# only-x86_64
#
# I *really* don't want to deal with a cross-platform way to compare file sizes,
# tests in `make` sort of are awful
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
all: $(TMPDIR)/out.log
# Make sure no warnings about "unknown CPU `native`" were emitted
if [ "$$(wc -c $(TMPDIR)/out.log | cut -d' ' -f 1)" = "0" ]; then \
@ -10,9 +13,6 @@ all: $(TMPDIR)/out.log
else \
exit 1; \
fi
else
all: $(TMPDIR)/out.log
endif
$(TMPDIR)/out.log:

View file

@ -1,8 +1,9 @@
-include ../tools.mk
SKIP_OS := 'FreeBSD OpenBSD Bitrig SunOS'
ifneq ($(UNAME),$(findstring $(UNAME),$(SKIP_OS)))
# ignore-freebsd
# ignore-openbsd
# ignore-bitrig
# ignore-sunos
HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
ifeq ($(findstring i686,$(HOST)),i686)
@ -15,7 +16,3 @@ all:
$(RUSTC) foo.rs -C extra-filename=-host
$(RUSTC) bar.rs -C extra-filename=-targ --target $(TARGET)
$(RUSTC) baz.rs --extern a=$(TMPDIR)/liba-targ.rlib --target $(TARGET)
else
# FreeBSD, OpenBSD, and Bitrig support only x86_64 architecture for now
all:
endif

View file

@ -1,11 +1,7 @@
-include ../tools.mk
ifdef IS_WINDOWS
# Do nothing on MSVC.
all:
exit 0
else
# ignore-windows
all:
$(RUSTC) -C opt-level=3 --emit=obj used.rs
nm $(TMPDIR)/used.o | $(CGREP) FOO
endif

View file

@ -1,14 +1,8 @@
-include ../tools.mk
ifdef IS_WINDOWS
# only-windows
all:
$(RUSTC) -o "$(TMPDIR)/hopefullydoesntexist bar.exe" hello.rs
$(RUSTC) spawn.rs
$(TMPDIR)/spawn.exe
else
all:
endif

View file

@ -10,8 +10,10 @@
# - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
# - thumbv7m-none-eabi (Bare Cortex-M3)
# See https://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi))
# only-thumbv6m-none-eabi
# only-thumbv7em-none-eabi
# only-thumbv7em-none-eabihf
# only-thumbv7m-none-eabi
# For cargo setting
RUSTC := $(RUSTC_ORIGINAL)
@ -36,8 +38,3 @@ all:
# These come from the top-level Rust workspace, that this crate is not a
# member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
cd $(WORK_DIR) && cd $(CRATE) && env RUSTC_BOOTSTRAP=1 $(CARGO) build --target $(TARGET) -v
else
all:
endif

View file

@ -1,11 +1,12 @@
-include ../../run-make-fulldeps/tools.mk
# only-thumbv7m-none-eabi
# only-thumbv6m-none-eabi
# How to run this
# $ ./x.py clean
# $ ./x.py test --target thumbv7m-none-eabi src/test/run-make
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7m-none-eabi))
# For cargo setting
export RUSTC := $(RUSTC_ORIGINAL)
export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
@ -25,6 +26,3 @@ unexport CXX
all:
bash script.sh
else
all:
endif

View file

@ -1,10 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown
$(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,9 +1,7 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) bar.rs --target wasm32-unknown-unknown
$(RUSTC) foo.rs --target wasm32-unknown-unknown
@ -10,7 +11,3 @@ all:
$(NODE) verify.js $(TMPDIR)/foo.wasm
$(RUSTC) foo.rs --target wasm32-unknown-unknown -C lto
$(NODE) verify.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -1,10 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown
$(RUSTC) bar.rs -C lto -O --target wasm32-unknown-unknown
$(NODE) foo.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg a
wc -c < $(TMPDIR)/foo.wasm
@ -14,7 +15,3 @@ all:
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown --cfg d
wc -c < $(TMPDIR)/foo.wasm
[ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "5120" ]
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown
$(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
@ -10,7 +11,3 @@ all:
$(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
$(RUSTC) bar.rs --target wasm32-unknown-unknown -O
$(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
else
all:
endif

View file

@ -1,6 +1,7 @@
-include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
# only-wasm32
all:
$(RUSTC) foo.rs --target wasm32-unknown-unknown
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
@ -10,7 +11,3 @@ all:
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
$(RUSTC) foo.rs --target wasm32-unknown-unknown -O -C lto
$(NODE) verify-no-imports.js $(TMPDIR)/foo.wasm
else
all:
endif

View file

@ -43,7 +43,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
NormalTT {
expander: Box::new(Expander { args: args, }),
def_info: None,
allow_internal_unstable: false,
allow_internal_unstable: None,
allow_internal_unsafe: false,
local_inner_macros: false,
unstable_feature: None,

View file

@ -27,7 +27,7 @@ use rustc_data_structures::thin_vec::ThinVec;
use syntax::ast::*;
use syntax::source_map::{Spanned, DUMMY_SP, FileName};
use syntax::source_map::FilePathMapping;
use syntax::fold::{self, Folder};
use syntax::mut_visit::{self, MutVisitor, visit_clobber};
use syntax::parse::{self, ParseSess};
use syntax::print::pprust;
use syntax::ptr::P;
@ -59,8 +59,8 @@ fn make_x() -> P<Expr> {
expr(ExprKind::Path(None, path))
}
/// Iterate over exprs of depth up to `depth`. The goal is to explore all "interesting"
/// combinations of expression nesting. For example, we explore combinations using `if`, but not
/// Iterate over exprs of depth up to `depth`. The goal is to explore all "interesting"
/// combinations of expression nesting. For example, we explore combinations using `if`, but not
/// `while` or `match`, since those should print and parse in much the same way as `if`.
fn iter_exprs(depth: usize, f: &mut FnMut(P<Expr>)) {
if depth == 0 {
@ -157,32 +157,34 @@ fn iter_exprs(depth: usize, f: &mut FnMut(P<Expr>)) {
// Folders for manipulating the placement of `Paren` nodes. See below for why this is needed.
/// Folder that removes all `ExprKind::Paren` nodes.
/// MutVisitor that removes all `ExprKind::Paren` nodes.
struct RemoveParens;
impl Folder for RemoveParens {
fn fold_expr(&mut self, e: P<Expr>) -> P<Expr> {
let e = match e.node {
ExprKind::Paren(ref inner) => inner.clone(),
_ => e.clone(),
impl MutVisitor for RemoveParens {
fn visit_expr(&mut self, e: &mut P<Expr>) {
match e.node.clone() {
ExprKind::Paren(inner) => *e = inner,
_ => {}
};
e.map(|e| fold::noop_fold_expr(e, self))
mut_visit::noop_visit_expr(e, self);
}
}
/// Folder that inserts `ExprKind::Paren` nodes around every `Expr`.
/// MutVisitor that inserts `ExprKind::Paren` nodes around every `Expr`.
struct AddParens;
impl Folder for AddParens {
fn fold_expr(&mut self, e: P<Expr>) -> P<Expr> {
let e = e.map(|e| fold::noop_fold_expr(e, self));
P(Expr {
id: DUMMY_NODE_ID,
node: ExprKind::Paren(e),
span: DUMMY_SP,
attrs: ThinVec::new(),
})
impl MutVisitor for AddParens {
fn visit_expr(&mut self, e: &mut P<Expr>) {
mut_visit::noop_visit_expr(e, self);
visit_clobber(e, |e| {
P(Expr {
id: DUMMY_NODE_ID,
node: ExprKind::Paren(e),
span: DUMMY_SP,
attrs: ThinVec::new(),
})
});
}
}
@ -193,13 +195,13 @@ fn main() {
fn run() {
let ps = ParseSess::new(FilePathMapping::empty());
iter_exprs(2, &mut |e| {
iter_exprs(2, &mut |mut e| {
// If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,
// modulo placement of `Paren` nodes.
let printed = pprust::expr_to_string(&e);
println!("printed: {}", printed);
let parsed = parse_expr(&ps, &printed);
let mut parsed = parse_expr(&ps, &printed);
// We want to know if `parsed` is structurally identical to `e`, ignoring trivial
// differences like placement of `Paren`s or the exact ranges of node spans.
@ -207,10 +209,12 @@ fn run() {
// everywhere we can, then pretty-print. This should give an unambiguous representation of
// each `Expr`, and it bypasses nearly all of the parenthesization logic, so we aren't
// relying on the correctness of the very thing we're testing.
let e1 = AddParens.fold_expr(RemoveParens.fold_expr(e));
let text1 = pprust::expr_to_string(&e1);
let e2 = AddParens.fold_expr(RemoveParens.fold_expr(parsed));
let text2 = pprust::expr_to_string(&e2);
RemoveParens.visit_expr(&mut e);
AddParens.visit_expr(&mut e);
let text1 = pprust::expr_to_string(&e);
RemoveParens.visit_expr(&mut parsed);
AddParens.visit_expr(&mut parsed);
let text2 = pprust::expr_to_string(&parsed);
assert!(text1 == text2,
"exprs are not equal:\n e = {:?}\n parsed = {:?}",
text1, text2);

View file

@ -1,7 +1,7 @@
//! This is a client of the `a` crate defined in "svn-a-base.rs". The
//! rpass and cfail tests (such as "run-pass/svh-add-comment.rs") use
//! This is a client of the `a` crate defined in `svn-a-base.rs`. The
//! rpass and cfail tests (such as `run-pass/svh-add-comment.rs`) use
//! it by swapping in a different object code library crate built from
//! some variant of "svn-a-base.rs", and then we are checking if the
//! some variant of `svn-a-base.rs`, and then we are checking if the
//! compiler properly ignores or accepts the change, based on whether
//! the change could affect the downstream crate content or not
//! (#14132).

View file

@ -0,0 +1,34 @@
// ignore-emscripten no i128 support
#![feature(const_saturating_int_methods)]
const INT_U32_NO: u32 = (42 as u32).saturating_add(2);
const INT_U32: u32 = u32::max_value().saturating_add(1);
const INT_U128: u128 = u128::max_value().saturating_add(1);
const INT_I128: i128 = i128::max_value().saturating_add(1);
const INT_I128_NEG: i128 = i128::min_value().saturating_add(-1);
const INT_U32_NO_SUB: u32 = (42 as u32).saturating_sub(2);
const INT_U32_SUB: u32 = (1 as u32).saturating_sub(2);
const INT_I32_NO_SUB: i32 = (-42 as i32).saturating_sub(2);
const INT_I32_NEG_SUB: i32 = i32::min_value().saturating_sub(1);
const INT_I32_POS_SUB: i32 = i32::max_value().saturating_sub(-1);
const INT_U128_SUB: u128 = (0 as u128).saturating_sub(1);
const INT_I128_NEG_SUB: i128 = i128::min_value().saturating_sub(1);
const INT_I128_POS_SUB: i128 = i128::max_value().saturating_sub(-1);
fn main() {
assert_eq!(INT_U32_NO, 44);
assert_eq!(INT_U32, u32::max_value());
assert_eq!(INT_U128, u128::max_value());
assert_eq!(INT_I128, i128::max_value());
assert_eq!(INT_I128_NEG, i128::min_value());
assert_eq!(INT_U32_NO_SUB, 40);
assert_eq!(INT_U32_SUB, 0);
assert_eq!(INT_I32_NO_SUB, -44);
assert_eq!(INT_I32_NEG_SUB, i32::min_value());
assert_eq!(INT_I32_POS_SUB, i32::max_value());
assert_eq!(INT_U128_SUB, 0);
assert_eq!(INT_I128_NEG_SUB, i128::min_value());
assert_eq!(INT_I128_POS_SUB, i128::max_value());
}

View file

@ -5,7 +5,7 @@
/*
# Comparison of static arrays
The expected behaviour would be that test==test1, therefore 'true'
The expected behaviour would be that `test == test1`, therefore 'true'
would be printed, however the below prints false.
*/

View file

@ -163,7 +163,7 @@ mod test_foreign_items {
}
// FIXME #623 - these aren't supported yet
// FIXME(#623): - these aren't supported yet
/*mod test_literals {
#![str = "s"]
#![char = 'c']

View file

@ -73,7 +73,7 @@ macro_rules! follow_block {
($b:block $t:ty) => {};
($b:block $s:stmt) => {};
($b:block $p:path) => {};
($b:block $b:block) => {};
($b:block $c:block) => {};
($b:block $i:ident) => {};
($b:block $t:tt) => {};
($b:block $i:item) => {};
@ -99,9 +99,9 @@ macro_rules! follow_ident {
($i:ident $s:stmt) => {};
($i:ident $p:path) => {};
($i:ident $b:block) => {};
($i:ident $i:ident) => {};
($i:ident $j:ident) => {};
($i:ident $t:tt) => {};
($i:ident $i:item) => {};
($i:ident $j:item) => {};
($i:ident $m:meta) => {};
}
// FOLLOW(tt) = any token
@ -120,12 +120,12 @@ macro_rules! follow_tt {
($t:tt ident) => {};
($t:tt $p:pat) => {};
($t:tt $e:expr) => {};
($t:tt $t:ty) => {};
($t:tt $v:ty) => {};
($t:tt $s:stmt) => {};
($t:tt $p:path) => {};
($t:tt $b:block) => {};
($t:tt $i:ident) => {};
($t:tt $t:tt) => {};
($t:tt $v:tt) => {};
($t:tt $i:item) => {};
($t:tt $m:meta) => {};
}
@ -149,9 +149,9 @@ macro_rules! follow_item {
($i:item $s:stmt) => {};
($i:item $p:path) => {};
($i:item $b:block) => {};
($i:item $i:ident) => {};
($i:item $j:ident) => {};
($i:item $t:tt) => {};
($i:item $i:item) => {};
($i:item $j:item) => {};
($i:item $m:meta) => {};
}
// FOLLOW(meta) = any token
@ -177,7 +177,7 @@ macro_rules! follow_meta {
($m:meta $i:ident) => {};
($m:meta $t:tt) => {};
($m:meta $i:item) => {};
($m:meta $m:meta) => {};
($m:meta $n:meta) => {};
}
fn main() {}

View file

@ -0,0 +1,59 @@
// Check that method matching does not make "guesses" depending on
// Deref impls that don't eventually end up being picked.
use std::ops::Deref;
// An impl with less derefs will get called over an impl with more derefs,
// so `(t: Foo<_>).my_fn()` will use `<Foo<u32> as MyTrait1>::my_fn(t)`,
// and does *not* force the `_` to equal `()`, because the Deref impl
// was *not* used.
trait MyTrait1 {
fn my_fn(&self) {}
}
impl MyTrait1 for Foo<u32> {}
struct Foo<T>(T);
impl Deref for Foo<()> {
type Target = dyn MyTrait1 + 'static;
fn deref(&self) -> &(dyn MyTrait1 + 'static) {
panic!()
}
}
// ...but if there is no impl with less derefs, the "guess" will be
// forced, so `(t: Bar<_>).my_fn2()` is `<dyn MyTrait2 as MyTrait2>::my_fn2(*t)`,
// and because the deref impl is used, the `_` is forced to equal `u8`.
trait MyTrait2 {
fn my_fn2(&self) {}
}
impl MyTrait2 for u32 {}
struct Bar<T>(T, u32);
impl Deref for Bar<u8> {
type Target = dyn MyTrait2 + 'static;
fn deref(&self) -> &(dyn MyTrait2 + 'static) {
&self.1
}
}
// actually invoke things
fn main() {
let mut foo: Option<Foo<_>> = None;
let mut bar: Option<Bar<_>> = None;
let mut first_iter = true;
loop {
if !first_iter {
foo.as_ref().unwrap().my_fn();
bar.as_ref().unwrap().my_fn2();
break;
}
foo = Some(Foo(0));
bar = Some(Bar(Default::default(), 0));
first_iter = false;
}
}

View file

@ -2,7 +2,7 @@
/*!
* On x86_64-linux-gnu and possibly other platforms, structs get 8-byte "preferred" alignment,
* but their "ABI" alignment (i.e., what actually matters for data layout) is the largest alignment
* of any field. (Also, u64 has 8-byte ABI alignment; this is not always true).
* of any field. (Also, `u64` has 8-byte ABI alignment; this is not always true).
*
* On such platforms, if monomorphize uses the "preferred" alignment, then it will unify
* `A` and `B`, even though `S<A>` and `S<B>` have the field `t` at different offsets,

View file

@ -175,7 +175,7 @@ fn test_op_assigns() {
assert_eq!(black_box(tmp), Wrapping($ans));
}
// FIXME(30524): Uncomment this test
// FIXME(30524): uncomment this test
/*
{
let mut tmp = Wrapping($initial);

View file

@ -36,7 +36,7 @@ fn main() {
assert_eq!(
panic::catch_unwind(|| {
mem::MaybeUninit::<!>::uninitialized().into_inner()
mem::MaybeUninit::<!>::uninitialized().into_initialized()
}).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
s == "Attempted to instantiate uninhabited type !"
})),
@ -63,7 +63,7 @@ fn main() {
assert_eq!(
panic::catch_unwind(|| {
mem::MaybeUninit::<Foo>::uninitialized().into_inner()
mem::MaybeUninit::<Foo>::uninitialized().into_initialized()
}).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
s == "Attempted to instantiate uninhabited type Foo"
})),
@ -90,7 +90,7 @@ fn main() {
assert_eq!(
panic::catch_unwind(|| {
mem::MaybeUninit::<Bar>::uninitialized().into_inner()
mem::MaybeUninit::<Bar>::uninitialized().into_initialized()
}).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
s == "Attempted to instantiate uninhabited type Bar"
})),

View file

@ -0,0 +1,55 @@
// run-pass
#![allow(dead_code)]
#![feature(repr_align_enum)]
use std::mem;
// Raising alignment
#[repr(align(16))]
enum Align16 {
Foo { foo: u32 },
Bar { bar: u32 },
}
// Raise alignment by maximum
#[repr(align(1), align(16))]
#[repr(align(32))]
#[repr(align(4))]
enum Align32 {
Foo,
Bar,
}
// Not reducing alignment
#[repr(align(4))]
enum AlsoAlign16 {
Foo { limb_with_align16: Align16 },
Bar,
}
// No niche for discriminant when used as limb
#[repr(align(16))]
struct NoNiche16(u64, u64);
// Discriminant will require extra space, but enum needs to stay compatible
// with alignment 16
#[repr(align(1))]
enum AnotherAlign16 {
Foo { limb_with_noniche16: NoNiche16 },
Bar,
Baz,
}
fn main() {
assert_eq!(mem::align_of::<Align16>(), 16);
assert_eq!(mem::size_of::<Align16>(), 16);
assert_eq!(mem::align_of::<Align32>(), 32);
assert_eq!(mem::size_of::<Align32>(), 32);
assert_eq!(mem::align_of::<AlsoAlign16>(), 16);
assert_eq!(mem::size_of::<AlsoAlign16>(), 16);
assert_eq!(mem::align_of::<AnotherAlign16>(), 16);
assert_eq!(mem::size_of::<AnotherAlign16>(), 32);
}

View file

@ -2,9 +2,6 @@
// pretty-expanded FIXME #23616
#![allow(warnings)]
#![feature(iter_empty)]
#![feature(iter_once)]
#![feature(str_escape)]
use std::iter::{empty, once, repeat};

View file

@ -1,14 +1,35 @@
// edition:2018
// compile-flags:-Z unstable-options
// FIXME: once `--edition` is stable in rustdoc, remove that `compile-flags` directive
#![feature(async_await, futures_api)]
// @has async_fn/struct.S.html
// @has - '//code' 'pub async fn f()'
pub struct S;
// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option<Foo>'
pub async fn foo() -> Option<Foo> {
None
}
impl S {
// @has async_fn/fn.bar.html '//pre[@class="rust fn"]' 'pub async fn bar(a: i32, b: i32) -> i32'
pub async fn bar(a: i32, b: i32) -> i32 {
0
}
// @has async_fn/fn.baz.html '//pre[@class="rust fn"]' 'pub async fn baz<T>(a: T) -> T'
pub async fn baz<T>(a: T) -> T {
a
}
trait Bar {}
impl Bar for () {}
// @has async_fn/fn.quux.html '//pre[@class="rust fn"]' 'pub async fn quux() -> impl Bar'
pub async fn quux() -> impl Bar {
()
}
// @has async_fn/struct.Foo.html
// @matches - '//code' 'pub async fn f\(\)$'
pub struct Foo;
impl Foo {
pub async fn f() {}
}

View file

@ -22,7 +22,7 @@
//! This crate exports a macro `enum_from_primitive!` that wraps an
//! `enum` declaration and automatically adds an implementation of
//! `num::FromPrimitive` (reexported here), to allow conversion from
//! primitive integers to the enum. It therefore provides an
//! primitive integers to the enum. It therefore provides an
//! alternative to the built-in `#[derive(FromPrimitive)]`, which
//! requires the unstable `std::num::FromPrimitive` and is disabled in
//! Rust 1.0.

View file

@ -1,7 +1,9 @@
#![feature(deprecated)]
// @matches deprecated/index.html '//*[@class="docblock-short"]' \
// '^\[Deprecated\] Deprecated docs'
// @has deprecated/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @has - '//*[@class="docblock-short"]' 'Deprecated docs'
// @has deprecated/struct.S.html '//*[@class="stab deprecated"]' \
// 'Deprecated since 1.0.0: text'
/// Deprecated docs

View file

@ -7,7 +7,8 @@
extern crate macros;
// @has foo/index.html '//*[@class="docblock-short"]' '[Deprecated] [Experimental]'
// @has foo/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' Deprecated
// @has - '//*[@class="docblock-short"]/span[@class="stab unstable"]' Experimental
// @has foo/macro.my_macro.html
// @has - '//*[@class="docblock"]' 'docs for my_macro'

View file

@ -1,7 +1,9 @@
// compile-flags: -Z force-unstable-if-unmarked
// @matches internal/index.html '//*[@class="docblock-short"]' \
// '^\[Internal\] Docs'
// @matches internal/index.html '//*[@class="docblock-short"]/span[@class="stab internal"]' \
// 'Internal'
// @matches - '//*[@class="docblock-short"]' 'Docs'
// @has internal/struct.S.html '//*[@class="stab internal"]' \
// 'This is an internal compiler API. (rustc_private)'
/// Docs

View file

@ -1,4 +1,4 @@
/// Test | Table
/// Tests | Table
/// ------|-------------
/// t = b | id = \|x\| x
pub struct Foo; // @has issue_27862/struct.Foo.html //td 'id = |x| x'

View file

@ -3,8 +3,11 @@
#![unstable(feature="test", issue = "32374")]
// @matches issue_32374/index.html '//*[@class="docblock-short"]' \
// '^\[Deprecated\] \[Experimental\] Docs'
// @matches issue_32374/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @matches issue_32374/index.html '//*[@class="docblock-short"]/span[@class="stab unstable"]' \
// 'Experimental'
// @matches issue_32374/index.html '//*[@class="docblock-short"]/text()' 'Docs'
// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \
// 'Deprecated since 1.0.0: text'

View file

@ -7,7 +7,7 @@
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
// @has foo/keyword.match.html '//section[@id="main"]//div[@class="docblock"]//p' 'this is a test!'
// @!has foo/index.html '//a/@href' 'foo/index.html'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/foo/index.html
// @!has-dir foo/foo
#[doc(keyword = "match")]

View file

@ -0,0 +1,12 @@
#![feature(staged_api)]
#![unstable(feature = "test", issue = "0")]
pub struct Unstable {
// @has stability/struct.Unstable.html \
// '//div[@class="stability"]//div[@class="stab unstable"]' \
// 'This is a nightly-only experimental API'
// @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0
pub foo: u32,
pub bar: u32,
}

View file

@ -0,0 +1,21 @@
#![feature(trait_alias)]
#![crate_name = "foo"]
use std::fmt::Debug;
// @has foo/all.html '//a[@href="traitalias.CopyAlias.html"]' 'CopyAlias'
// @has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
// @has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo'
// @has foo/index.html '//h2[@id="trait-aliases"]' 'Trait aliases'
// @has foo/index.html '//a[@class="traitalias"]' 'CopyAlias'
// @has foo/index.html '//a[@class="traitalias"]' 'Alias2'
// @has foo/index.html '//a[@class="traitalias"]' 'Foo'
// @has foo/traitalias.CopyAlias.html '//section[@id="main"]/pre' 'trait CopyAlias = Copy;'
pub trait CopyAlias = Copy;
// @has foo/traitalias.Alias2.html '//section[@id="main"]/pre' 'trait Alias2 = Copy + Debug;'
pub trait Alias2 = Copy + Debug;
// @has foo/traitalias.Foo.html '//section[@id="main"]/pre' 'trait Foo<T> = Into<T> + Debug;'
pub trait Foo<T> = Into<T> + Debug;

View file

@ -0,0 +1,8 @@
// edition:2018
// ICE when rustdoc encountered a use statement of a non-macro attribute (see #58054)
// @has use_attr/index.html
// @has - '//code' 'pub use proc_macro_attribute'
pub use proc_macro_attribute;
use proc_macro_derive;

View file

@ -41,7 +41,7 @@ impl ToOwned for u8 {
pub trait ToOwned {
type Owned;
/// Create owned data from borrowed data, usually by copying.
/// Creates owned data from borrowed data, usually by copying.
fn to_owned(&self) -> Self::Owned;
}

View file

@ -1,4 +1,5 @@
#![feature(repr_simd)]
#![feature(repr_align_enum)]
#[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
fn f() {}
@ -18,7 +19,7 @@ struct SInt(f64, f64);
#[repr(C)]
enum EExtern { A, B }
#[repr(align(8))] //~ ERROR: attribute should be applied to struct
#[repr(align(8))]
enum EAlign { A, B }
#[repr(packed)] //~ ERROR: attribute should be applied to struct

View file

@ -1,5 +1,5 @@
error[E0517]: attribute should be applied to struct, enum or union
--> $DIR/attr-usage-repr.rs:3:8
--> $DIR/attr-usage-repr.rs:4:8
|
LL | #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
| ^
@ -7,7 +7,7 @@ LL | fn f() {}
| --------- not a struct, enum or union
error[E0517]: attribute should be applied to enum
--> $DIR/attr-usage-repr.rs:15:8
--> $DIR/attr-usage-repr.rs:16:8
|
LL | #[repr(i8)] //~ ERROR: attribute should be applied to enum
| ^^
@ -15,15 +15,7 @@ LL | struct SInt(f64, f64);
| ---------------------- not an enum
error[E0517]: attribute should be applied to struct or union
--> $DIR/attr-usage-repr.rs:21:8
|
LL | #[repr(align(8))] //~ ERROR: attribute should be applied to struct
| ^^^^^^^^
LL | enum EAlign { A, B }
| -------------------- not a struct or union
error[E0517]: attribute should be applied to struct or union
--> $DIR/attr-usage-repr.rs:24:8
--> $DIR/attr-usage-repr.rs:25:8
|
LL | #[repr(packed)] //~ ERROR: attribute should be applied to struct
| ^^^^^^
@ -31,13 +23,13 @@ LL | enum EPacked { A, B }
| --------------------- not a struct or union
error[E0517]: attribute should be applied to struct
--> $DIR/attr-usage-repr.rs:27:8
--> $DIR/attr-usage-repr.rs:28:8
|
LL | #[repr(simd)] //~ ERROR: attribute should be applied to struct
| ^^^^
LL | enum ESimd { A, B }
| ------------------- not a struct
error: aborting due to 5 previous errors
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0517`.

View file

@ -0,0 +1,3 @@
fn foo<#[attr]>() {} //~ ERROR attribute without generic parameters
fn main() {}

View file

@ -0,0 +1,8 @@
error: attribute without generic parameters
--> $DIR/attribute-with-no-generics-in-parameter-list.rs:1:8
|
LL | fn foo<#[attr]>() {} //~ ERROR attribute without generic parameters
| ^^^^^^^ attributes are only permitted when preceding parameters
error: aborting due to previous error

View file

@ -7,7 +7,7 @@
struct RefIntPair<'a, 'b>(&'a u32, &'b u32);
impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {
//~^ ERROR trailing attribute after lifetime parameters
//~^ ERROR trailing attribute after generic parameter
}
fn main() {

View file

@ -1,4 +1,4 @@
error: trailing attribute after lifetime parameters
error: trailing attribute after generic parameter
--> $DIR/attrs-with-no-formal-in-generics-1.rs:9:25
|
LL | impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {

Some files were not shown because too many files have changed in this diff Show more