diff --git a/RELEASES.md b/RELEASES.md index 819c9184364f..08470e731d8e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,16 @@ +Version 1.29.1 (2018-09-25) +=========================== + +Security Notes +-------------- + +- The standard library's `str::repeat` function contained an out of bounds write + caused by an integer overflow. This has been fixed by deterministically + panicking when an overflow happens. + + Thank you to Scott McMurray for responsibily disclosing this vulnerability to + us. + Version 1.29.0 (2018-09-13) ========================== diff --git a/src/Cargo.lock b/src/Cargo.lock index 40a5ea6b12bf..5a44b696a03e 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -344,6 +344,7 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2372,6 +2373,7 @@ dependencies = [ "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_codegen_utils 0.0.0", "rustc_data_structures 0.0.0", "rustc_target 0.0.0", "rustc_typeck 0.0.0", diff --git a/src/doc/unstable-book/src/compiler-flags/emit-stack-sizes.md b/src/doc/unstable-book/src/compiler-flags/emit-stack-sizes.md new file mode 100644 index 000000000000..47f45a0b91f8 --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/emit-stack-sizes.md @@ -0,0 +1,167 @@ +# `emit-stack-sizes` + +The tracking issue for this feature is: [#54192] + +[#54192]: https://github.com/rust-lang/rust/issues/54192 + +------------------------ + +The rustc flag `-Z emit-stack-sizes` makes LLVM emit stack size metadata. + +> **NOTE**: This LLVM feature only supports the ELF object format as of LLVM +> 8.0. Using this flag with targets that use other object formats (e.g. macOS +> and Windows) will result in it being ignored. + +Consider this crate: + +``` +#![crate_type = "lib"] + +use std::ptr; + +pub fn foo() { + // this function doesn't use the stack +} + +pub fn bar() { + let xs = [0u32; 2]; + + // force LLVM to allocate `xs` on the stack + unsafe { ptr::read_volatile(&xs.as_ptr()); } +} +``` + +Using the `-Z emit-stack-sizes` flag produces extra linker sections in the +output *object file*. + +``` console +$ rustc -C opt-level=3 --emit=obj foo.rs + +$ size -A foo.o +foo.o : +section size addr +.text 0 0 +.text._ZN3foo3foo17he211d7b4a3a0c16eE 1 0 +.text._ZN3foo3bar17h1acb594305f70c2eE 22 0 +.note.GNU-stack 0 0 +.eh_frame 72 0 +Total 95 + +$ rustc -C opt-level=3 --emit=obj -Z emit-stack-sizes foo.rs + +$ size -A foo.o +foo.o : +section size addr +.text 0 0 +.text._ZN3foo3foo17he211d7b4a3a0c16eE 1 0 +.stack_sizes 9 0 +.text._ZN3foo3bar17h1acb594305f70c2eE 22 0 +.stack_sizes 9 0 +.note.GNU-stack 0 0 +.eh_frame 72 0 +Total 113 +``` + +As of LLVM 7.0 the data will be written into a section named `.stack_sizes` and +the format is "an array of pairs of function symbol values (pointer size) and +stack sizes (unsigned LEB128)". + +``` console +$ objdump -d foo.o + +foo.o: file format elf64-x86-64 + +Disassembly of section .text._ZN3foo3foo17he211d7b4a3a0c16eE: + +0000000000000000 <_ZN3foo3foo17he211d7b4a3a0c16eE>: + 0: c3 retq + +Disassembly of section .text._ZN3foo3bar17h1acb594305f70c2eE: + +0000000000000000 <_ZN3foo3bar17h1acb594305f70c2eE>: + 0: 48 83 ec 10 sub $0x10,%rsp + 4: 48 8d 44 24 08 lea 0x8(%rsp),%rax + 9: 48 89 04 24 mov %rax,(%rsp) + d: 48 8b 04 24 mov (%rsp),%rax + 11: 48 83 c4 10 add $0x10,%rsp + 15: c3 retq + +$ objdump -s -j .stack_sizes foo.o + +foo.o: file format elf64-x86-64 + +Contents of section .stack_sizes: + 0000 00000000 00000000 00 ......... +Contents of section .stack_sizes: + 0000 00000000 00000000 10 ......... +``` + +It's important to note that linkers will discard this linker section by default. +To preserve the section you can use a linker script like the one shown below. + +``` text +/* file: keep-stack-sizes.x */ +SECTIONS +{ + /* `INFO` makes the section not allocatable so it won't be loaded into memory */ + .stack_sizes (INFO) : + { + KEEP(*(.stack_sizes)); + } +} +``` + +The linker script must be passed to the linker using a rustc flag like `-C +link-arg`. + +``` +// file: src/main.rs +use std::ptr; + +#[inline(never)] +fn main() { + let xs = [0u32; 2]; + + // force LLVM to allocate `xs` on the stack + unsafe { ptr::read_volatile(&xs.as_ptr()); } +} +``` + +``` console +$ RUSTFLAGS="-Z emit-stack-sizes" cargo build --release + +$ size -A target/release/hello | grep stack_sizes || echo section was not found +section was not found + +$ RUSTFLAGS="-Z emit-stack-sizes" cargo rustc --release -- \ + -C link-arg=-Wl,-Tkeep-stack-sizes.x \ + -C link-arg=-N + +$ size -A target/release/hello | grep stack_sizes +.stack_sizes 90 176272 + +$ # non-allocatable section (flags don't contain the "A" (alloc) flag) +$ readelf -S target/release/hello +Section Headers: + [Nr] Name Type Address Offset + Size EntSize Flags Link Info Align +(..) + [1031] .stack_sizes PROGBITS 000000000002b090 0002b0f0 + 000000000000005a 0000000000000000 L 5 0 1 + +$ objdump -s -j .stack_sizes target/release/hello + +target/release/hello: file format elf64-x86-64 + +Contents of section .stack_sizes: + 2b090 c0040000 00000000 08f00400 00000000 ................ + 2b0a0 00080005 00000000 00000810 05000000 ................ + 2b0b0 00000000 20050000 00000000 10400500 .... ........@.. + 2b0c0 00000000 00087005 00000000 00000080 ......p......... + 2b0d0 05000000 00000000 90050000 00000000 ................ + 2b0e0 00a00500 00000000 0000 .......... +``` + +> Author note: I'm not entirely sure why, in *this* case, `-N` is required in +> addition to `-Tkeep-stack-sizes.x`. For example, it's not required when +> producing statically linked files for the ARM Cortex-M architecture. diff --git a/src/etc/gdb_rust_pretty_printing.py b/src/etc/gdb_rust_pretty_printing.py index b1252f386df3..216915dba5fe 100755 --- a/src/etc/gdb_rust_pretty_printing.py +++ b/src/etc/gdb_rust_pretty_printing.py @@ -322,11 +322,8 @@ class RustStdBTreeSetPrinter(object): def children(self): (length, data_ptr) = \ rustpp.extract_length_and_ptr_from_std_btreeset(self.__val) - leaf_node = GdbValue(data_ptr.get_wrapped_value().dereference()) - maybe_uninit_keys = leaf_node.get_child_at_index(3) - manually_drop_keys = maybe_uninit_keys.get_child_at_index(1) - keys = manually_drop_keys.get_child_at_index(0) - gdb_ptr = keys.get_wrapped_value() + val = GdbValue(data_ptr.get_wrapped_value().dereference()).get_child_at_index(3) + gdb_ptr = val.get_wrapped_value() for index in xrange(length): yield (str(index), gdb_ptr[index]) @@ -348,14 +345,9 @@ class RustStdBTreeMapPrinter(object): def children(self): (length, data_ptr) = \ rustpp.extract_length_and_ptr_from_std_btreemap(self.__val) - leaf_node = GdbValue(data_ptr.get_wrapped_value().dereference()) - maybe_uninit_keys = leaf_node.get_child_at_index(3) - manually_drop_keys = maybe_uninit_keys.get_child_at_index(1) - keys = manually_drop_keys.get_child_at_index(0) + keys = GdbValue(data_ptr.get_wrapped_value().dereference()).get_child_at_index(3) keys_ptr = keys.get_wrapped_value() - maybe_uninit_vals = leaf_node.get_child_at_index(4) - manually_drop_vals = maybe_uninit_vals.get_child_at_index(1) - vals = manually_drop_vals.get_child_at_index(0) + vals = GdbValue(data_ptr.get_wrapped_value().dereference()).get_child_at_index(4) vals_ptr = vals.get_wrapped_value() for index in xrange(length): yield (str(index), keys_ptr[index]) diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index c86278fc5dda..0315545262b6 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -42,7 +42,7 @@ // This implies that even an empty internal node has at least one edge. use core::marker::PhantomData; -use core::mem::{self, MaybeUninit}; +use core::mem; use core::ptr::{self, Unique, NonNull}; use core::slice; @@ -73,7 +73,7 @@ struct LeafNode { /// This node's index into the parent node's `edges` array. /// `*node.parent.edges[node.parent_idx]` should be the same thing as `node`. /// This is only guaranteed to be initialized when `parent` is nonnull. - parent_idx: MaybeUninit, + parent_idx: u16, /// The number of keys and values this node stores. /// @@ -83,8 +83,8 @@ struct LeafNode { /// The arrays storing the actual data of the node. Only the first `len` elements of each /// array are initialized and valid. - keys: MaybeUninit<[K; CAPACITY]>, - vals: MaybeUninit<[V; CAPACITY]>, + keys: [K; CAPACITY], + vals: [V; CAPACITY], } impl LeafNode { @@ -94,10 +94,10 @@ impl LeafNode { LeafNode { // As a general policy, we leave fields uninitialized if they can be, as this should // be both slightly faster and easier to track in Valgrind. - keys: MaybeUninit::uninitialized(), - vals: MaybeUninit::uninitialized(), + keys: mem::uninitialized(), + vals: mem::uninitialized(), parent: ptr::null(), - parent_idx: MaybeUninit::uninitialized(), + parent_idx: mem::uninitialized(), len: 0 } } @@ -115,10 +115,10 @@ unsafe impl Sync for LeafNode<(), ()> {} // ever take a pointer past the first key. static EMPTY_ROOT_NODE: LeafNode<(), ()> = LeafNode { parent: ptr::null(), - parent_idx: MaybeUninit::uninitialized(), + parent_idx: 0, len: 0, - keys: MaybeUninit::uninitialized(), - vals: MaybeUninit::uninitialized(), + keys: [(); CAPACITY], + vals: [(); CAPACITY], }; /// The underlying representation of internal nodes. As with `LeafNode`s, these should be hidden @@ -430,7 +430,7 @@ impl NodeRef { root: self.root, _marker: PhantomData }, - idx: unsafe { usize::from(*self.as_leaf().parent_idx.get_ref()) }, + idx: self.as_leaf().parent_idx as usize, _marker: PhantomData }) } else { @@ -567,7 +567,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef, K, V, Type> { // the node, which is allowed by LLVM. unsafe { slice::from_raw_parts( - self.as_leaf().keys.as_ptr() as *const K, + self.as_leaf().keys.as_ptr(), self.len() ) } @@ -578,7 +578,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef, K, V, Type> { debug_assert!(!self.is_shared_root()); unsafe { slice::from_raw_parts( - self.as_leaf().vals.as_ptr() as *const V, + self.as_leaf().vals.as_ptr(), self.len() ) } @@ -605,7 +605,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef, K, V, Type> { } else { unsafe { slice::from_raw_parts_mut( - self.as_leaf_mut().keys.get_mut() as *mut [K] as *mut K, + &mut self.as_leaf_mut().keys as *mut [K] as *mut K, self.len() ) } @@ -616,7 +616,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef, K, V, Type> { debug_assert!(!self.is_shared_root()); unsafe { slice::from_raw_parts_mut( - self.as_leaf_mut().vals.get_mut() as *mut [V] as *mut V, + &mut self.as_leaf_mut().vals as *mut [V] as *mut V, self.len() ) } @@ -1013,7 +1013,7 @@ impl<'a, K, V> Handle, K, V, marker::Internal>, marker:: let ptr = self.node.as_internal_mut() as *mut _; let mut child = self.descend(); child.as_leaf_mut().parent = ptr; - child.as_leaf_mut().parent_idx.set(idx); + child.as_leaf_mut().parent_idx = idx; } /// Unsafely asserts to the compiler some static information about whether the underlying @@ -1152,12 +1152,12 @@ impl<'a, K, V> Handle, K, V, marker::Leaf>, marker::KV> ptr::copy_nonoverlapping( self.node.keys().as_ptr().add(self.idx + 1), - new_node.keys.as_mut_ptr() as *mut K, + new_node.keys.as_mut_ptr(), new_len ); ptr::copy_nonoverlapping( self.node.vals().as_ptr().add(self.idx + 1), - new_node.vals.as_mut_ptr() as *mut V, + new_node.vals.as_mut_ptr(), new_len ); @@ -1210,12 +1210,12 @@ impl<'a, K, V> Handle, K, V, marker::Internal>, marker:: ptr::copy_nonoverlapping( self.node.keys().as_ptr().add(self.idx + 1), - new_node.data.keys.as_mut_ptr() as *mut K, + new_node.data.keys.as_mut_ptr(), new_len ); ptr::copy_nonoverlapping( self.node.vals().as_ptr().add(self.idx + 1), - new_node.data.vals.as_mut_ptr() as *mut V, + new_node.data.vals.as_mut_ptr(), new_len ); ptr::copy_nonoverlapping( diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 7960936dad6b..f92075cc84e5 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -120,7 +120,6 @@ #![feature(rustc_const_unstable)] #![feature(const_vec_new)] #![feature(slice_partition_dedup)] -#![feature(maybe_uninit)] // Allow testing this library diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index d01cd012031d..03e7a9a49d8a 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -9,7 +9,7 @@ // except according to those terms. use fmt::{Formatter, Result, LowerExp, UpperExp, Display, Debug}; -use mem::MaybeUninit; +use mem; use num::flt2dec; // Don't inline this so callers don't use the stack space this function @@ -20,11 +20,11 @@ fn float_to_decimal_common_exact(fmt: &mut Formatter, num: &T, where T: flt2dec::DecodableFloat { unsafe { - let mut buf = MaybeUninit::<[u8; 1024]>::uninitialized(); // enough for f32 and f64 - let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninitialized(); + let mut buf: [u8; 1024] = mem::uninitialized(); // enough for f32 and f64 + let mut parts: [flt2dec::Part; 4] = mem::uninitialized(); let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact, *num, sign, precision, - false, buf.get_mut(), parts.get_mut()); + false, &mut buf, &mut parts); fmt.pad_formatted_parts(&formatted) } } @@ -38,11 +38,10 @@ fn float_to_decimal_common_shortest(fmt: &mut Formatter, num: &T, { unsafe { // enough for f32 and f64 - let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninitialized(); - let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninitialized(); + let mut buf: [u8; flt2dec::MAX_SIG_DIGITS] = mem::uninitialized(); + let mut parts: [flt2dec::Part; 4] = mem::uninitialized(); let formatted = flt2dec::to_shortest_str(flt2dec::strategy::grisu::format_shortest, *num, - sign, precision, false, buf.get_mut(), - parts.get_mut()); + sign, precision, false, &mut buf, &mut parts); fmt.pad_formatted_parts(&formatted) } } @@ -76,11 +75,11 @@ fn float_to_exponential_common_exact(fmt: &mut Formatter, num: &T, where T: flt2dec::DecodableFloat { unsafe { - let mut buf = MaybeUninit::<[u8; 1024]>::uninitialized(); // enough for f32 and f64 - let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninitialized(); + let mut buf: [u8; 1024] = mem::uninitialized(); // enough for f32 and f64 + let mut parts: [flt2dec::Part; 6] = mem::uninitialized(); let formatted = flt2dec::to_exact_exp_str(flt2dec::strategy::grisu::format_exact, *num, sign, precision, - upper, buf.get_mut(), parts.get_mut()); + upper, &mut buf, &mut parts); fmt.pad_formatted_parts(&formatted) } } @@ -95,11 +94,11 @@ fn float_to_exponential_common_shortest(fmt: &mut Formatter, { unsafe { // enough for f32 and f64 - let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninitialized(); - let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninitialized(); + let mut buf: [u8; flt2dec::MAX_SIG_DIGITS] = mem::uninitialized(); + let mut parts: [flt2dec::Part; 6] = mem::uninitialized(); let formatted = flt2dec::to_shortest_exp_str(flt2dec::strategy::grisu::format_shortest, *num, sign, (0, 0), upper, - buf.get_mut(), parts.get_mut()); + &mut buf, &mut parts); fmt.pad_formatted_parts(&formatted) } } diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 3b7646fa2686..675e73e952cc 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -246,8 +246,6 @@ macro_rules! test_v512 { ($item:item) => {}; } #[allow(unused_macros)] macro_rules! vector_impl { ($([$f:ident, $($args:tt)*]),*) => { $($f!($($args)*);)* } } #[path = "../stdsimd/coresimd/mod.rs"] -// replacing uses of mem::{uninitialized,zeroed} with MaybeUninit needs to be in the stdsimd repo -#[allow(deprecated)] #[allow(missing_docs, missing_debug_implementations, dead_code, unused_imports)] #[unstable(feature = "stdsimd", issue = "48556")] #[cfg(not(stage0))] // allow changes to how stdsimd works in stage0 diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index d09a545aecfa..0224560af4c7 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -293,21 +293,21 @@ where } #[unstable(feature = "pin", issue = "49150")] -impl<'a, P: fmt::Debug> fmt::Debug for Pin

{ +impl fmt::Debug for Pin

{ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(&self.pointer, f) } } #[unstable(feature = "pin", issue = "49150")] -impl<'a, P: fmt::Display> fmt::Display for Pin

{ +impl fmt::Display for Pin

{ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.pointer, f) } } #[unstable(feature = "pin", issue = "49150")] -impl<'a, P: fmt::Pointer> fmt::Pointer for Pin

{ +impl fmt::Pointer for Pin

{ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Pointer::fmt(&self.pointer, f) } @@ -319,10 +319,10 @@ impl<'a, P: fmt::Pointer> fmt::Pointer for Pin

{ // for other reasons, though, so we just need to take care not to allow such // impls to land in std. #[unstable(feature = "pin", issue = "49150")] -impl<'a, P, U> CoerceUnsized> for Pin

+impl CoerceUnsized> for Pin

where P: CoerceUnsized, {} #[unstable(feature = "pin", issue = "49150")] -impl<'a, P> Unpin for Pin

{} +impl

Unpin for Pin

{} diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index b23b72c37201..14f2148a64e0 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -79,7 +79,7 @@ use ops::CoerceUnsized; use fmt; use hash; use marker::{PhantomData, Unsize}; -use mem::{self, MaybeUninit}; +use mem; use nonzero::NonZero; use cmp::Ordering::{self, Less, Equal, Greater}; @@ -294,12 +294,16 @@ pub const fn null_mut() -> *mut T { 0 as *mut T } #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn swap(x: *mut T, y: *mut T) { // Give ourselves some scratch space to work with - let mut tmp = MaybeUninit::::uninitialized(); + let mut tmp: T = mem::uninitialized(); // Perform the swap - copy_nonoverlapping(x, tmp.as_mut_ptr(), 1); + copy_nonoverlapping(x, &mut tmp, 1); copy(y, x, 1); // `x` and `y` may overlap - copy_nonoverlapping(tmp.get_ref(), y, 1); + copy_nonoverlapping(&tmp, y, 1); + + // y and t now point to the same thing, but we need to completely forget `tmp` + // because it's no longer relevant. + mem::forget(tmp); } /// Swaps `count * size_of::()` bytes between the two regions of memory @@ -386,8 +390,8 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t = mem::MaybeUninit::::uninitialized(); - let t = t.as_mut_ptr() as *mut u8; + let mut t: Block = mem::uninitialized(); + let t = &mut t as *mut _ as *mut u8; let x = x.add(i); let y = y.add(i); @@ -401,10 +405,10 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) { if i < len { // Swap any remaining bytes - let mut t = mem::MaybeUninit::::uninitialized(); + let mut t: UnalignedBlock = mem::uninitialized(); let rem = len - i; - let t = t.as_mut_ptr() as *mut u8; + let t = &mut t as *mut _ as *mut u8; let x = x.add(i); let y = y.add(i); @@ -569,9 +573,9 @@ pub unsafe fn replace(dst: *mut T, mut src: T) -> T { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn read(src: *const T) -> T { - let mut tmp = MaybeUninit::::uninitialized(); - copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - tmp.into_inner() + let mut tmp: T = mem::uninitialized(); + copy_nonoverlapping(src, &mut tmp, 1); + tmp } /// Reads the value from `src` without moving it. This leaves the @@ -636,11 +640,11 @@ pub unsafe fn read(src: *const T) -> T { #[inline] #[stable(feature = "ptr_unaligned", since = "1.17.0")] pub unsafe fn read_unaligned(src: *const T) -> T { - let mut tmp = MaybeUninit::::uninitialized(); + let mut tmp: T = mem::uninitialized(); copy_nonoverlapping(src as *const u8, - tmp.as_mut_ptr() as *mut u8, + &mut tmp as *mut T as *mut u8, mem::size_of::()); - tmp.into_inner() + tmp } /// Overwrites a memory location with the given value without reading or diff --git a/src/libcore/slice/rotate.rs b/src/libcore/slice/rotate.rs index 07153735300b..0d182b849745 100644 --- a/src/libcore/slice/rotate.rs +++ b/src/libcore/slice/rotate.rs @@ -9,7 +9,7 @@ // except according to those terms. use cmp; -use mem::{self, MaybeUninit}; +use mem; use ptr; /// Rotation is much faster if it has access to a little bit of memory. This @@ -26,6 +26,12 @@ union RawArray { } impl RawArray { + fn new() -> Self { + unsafe { mem::uninitialized() } + } + fn ptr(&self) -> *mut T { + unsafe { &self.typed as *const T as *mut T } + } fn cap() -> usize { if mem::size_of::() == 0 { usize::max_value() @@ -82,8 +88,8 @@ pub unsafe fn ptr_rotate(mut left: usize, mid: *mut T, mut right: usize) { } } - let mut rawarray = MaybeUninit::>::uninitialized(); - let buf = &mut (*rawarray.as_mut_ptr()).typed as *mut [T; 2] as *mut T; + let rawarray = RawArray::new(); + let buf = rawarray.ptr(); let dim = mid.sub(left).add(right); if left <= right { diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index affe84fbef91..e4c1fd03f9eb 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -17,7 +17,7 @@ //! stable sorting implementation. use cmp; -use mem::{self, MaybeUninit}; +use mem; use ptr; /// When dropped, copies from `src` into `dest`. @@ -226,14 +226,14 @@ fn partition_in_blocks(v: &mut [T], pivot: &T, is_less: &mut F) -> usize let mut block_l = BLOCK; let mut start_l = ptr::null_mut(); let mut end_l = ptr::null_mut(); - let mut offsets_l = MaybeUninit::<[u8; BLOCK]>::uninitialized(); + let mut offsets_l: [u8; BLOCK] = unsafe { mem::uninitialized() }; // The current block on the right side (from `r.sub(block_r)` to `r`). let mut r = unsafe { l.add(v.len()) }; let mut block_r = BLOCK; let mut start_r = ptr::null_mut(); let mut end_r = ptr::null_mut(); - let mut offsets_r = MaybeUninit::<[u8; BLOCK]>::uninitialized(); + let mut offsets_r: [u8; BLOCK] = unsafe { mem::uninitialized() }; // FIXME: When we get VLAs, try creating one array of length `min(v.len(), 2 * BLOCK)` rather // than two fixed-size arrays of length `BLOCK`. VLAs might be more cache-efficient. @@ -272,8 +272,8 @@ fn partition_in_blocks(v: &mut [T], pivot: &T, is_less: &mut F) -> usize if start_l == end_l { // Trace `block_l` elements from the left side. - start_l = offsets_l.as_mut_ptr() as *mut u8; - end_l = offsets_l.as_mut_ptr() as *mut u8; + start_l = offsets_l.as_mut_ptr(); + end_l = offsets_l.as_mut_ptr(); let mut elem = l; for i in 0..block_l { @@ -288,8 +288,8 @@ fn partition_in_blocks(v: &mut [T], pivot: &T, is_less: &mut F) -> usize if start_r == end_r { // Trace `block_r` elements from the right side. - start_r = offsets_r.as_mut_ptr() as *mut u8; - end_r = offsets_r.as_mut_ptr() as *mut u8; + start_r = offsets_r.as_mut_ptr(); + end_r = offsets_r.as_mut_ptr(); let mut elem = r; for i in 0..block_r { diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs index c85cee736605..fa4bf1511b87 100644 --- a/src/librustc/hir/map/definitions.rs +++ b/src/librustc/hir/map/definitions.rs @@ -287,6 +287,31 @@ impl DefPath { s } + /// Return filename friendly string of the DefPah with the + /// crate-prefix. + pub fn to_string_friendly(&self, crate_imported_name: F) -> String + where F: FnOnce(CrateNum) -> Symbol + { + let crate_name_str = crate_imported_name(self.krate).as_str(); + let mut s = String::with_capacity(crate_name_str.len() + self.data.len() * 16); + + write!(s, "::{}", crate_name_str).unwrap(); + + for component in &self.data { + if component.disambiguator == 0 { + write!(s, "::{}", component.data.as_interned_str()).unwrap(); + } else { + write!(s, + "{}[{}]", + component.data.as_interned_str(), + component.disambiguator) + .unwrap(); + } + } + + s + } + /// Return filename friendly string of the DefPah without /// the crate-prefix. This method is useful if you don't have /// a TyCtxt available. diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index cf76c3b7e02d..e3bbdab4fd96 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -55,23 +55,22 @@ //! ported to this system, and which relies on string concatenation at the //! time of error detection. -use infer; -use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs}; -use super::region_constraints::GenericKind; use super::lexical_region_resolve::RegionResolutionError; +use super::region_constraints::GenericKind; +use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs}; +use infer::{self, SuppressRegionErrors}; -use std::{cmp, fmt}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; use hir; -use hir::Node; use hir::def_id::DefId; +use hir::Node; use middle::region; -use traits::{ObligationCause, ObligationCauseCode}; -use ty::{self, subst::Subst, Region, Ty, TyCtxt, TypeFoldable, TyKind}; -use ty::error::TypeError; -use session::config::BorrowckMode; +use std::{cmp, fmt}; use syntax::ast::DUMMY_NODE_ID; use syntax_pos::{Pos, Span}; -use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; +use traits::{ObligationCause, ObligationCauseCode}; +use ty::error::TypeError; +use ty::{self, subst::Subst, Region, Ty, TyCtxt, TyKind, TypeFoldable}; mod note; @@ -153,8 +152,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } // We shouldn't encounter an error message with ReClosureBound. - ty::ReCanonical(..) | - ty::ReClosureBound(..) => { + ty::ReCanonical(..) | ty::ReClosureBound(..) => { bug!("encountered unexpected ReClosureBound: {:?}", region,); } }; @@ -176,9 +174,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { fn msg_span_from_free_region(self, region: ty::Region<'tcx>) -> (String, Option) { match *region { - ty::ReEarlyBound(_) | ty::ReFree(_) => { + ty::ReEarlyBound(_) | ty::ReFree(_) => { self.msg_span_from_early_bound_and_free_regions(region) - }, + } ty::ReStatic => ("the static lifetime".to_owned(), None), _ => bug!("{:?}", region), } @@ -197,25 +195,28 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { Some(Node::Item(it)) => Self::item_scope_tag(&it), Some(Node::TraitItem(it)) => Self::trait_item_scope_tag(&it), Some(Node::ImplItem(it)) => Self::impl_item_scope_tag(&it), - _ => unreachable!() + _ => unreachable!(), }; let (prefix, span) = match *region { ty::ReEarlyBound(ref br) => { let mut sp = cm.def_span(self.hir.span(node)); - if let Some(param) = self.hir.get_generics(scope).and_then(|generics| { - generics.get_named(&br.name) - }) { + if let Some(param) = self.hir + .get_generics(scope) + .and_then(|generics| generics.get_named(&br.name)) + { sp = param.span; } (format!("the lifetime {} as defined on", br.name), sp) } ty::ReFree(ty::FreeRegion { - bound_region: ty::BoundRegion::BrNamed(_, ref name), .. + bound_region: ty::BoundRegion::BrNamed(_, ref name), + .. }) => { let mut sp = cm.def_span(self.hir.span(node)); - if let Some(param) = self.hir.get_generics(scope).and_then(|generics| { - generics.get_named(&name) - }) { + if let Some(param) = self.hir + .get_generics(scope) + .and_then(|generics| generics.get_named(&name)) + { sp = param.span; } (format!("the lifetime {} as defined on", name), sp) @@ -278,9 +279,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { fn impl_item_scope_tag(item: &hir::ImplItem) -> &'static str { match item.node { hir::ImplItemKind::Method(..) => "method body", - hir::ImplItemKind::Const(..) | - hir::ImplItemKind::Existential(..) | - hir::ImplItemKind::Type(..) => "associated item", + hir::ImplItemKind::Const(..) + | hir::ImplItemKind::Existential(..) + | hir::ImplItemKind::Type(..) => "associated item", } } @@ -298,20 +299,16 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { &self, region_scope_tree: ®ion::ScopeTree, errors: &Vec>, - will_later_be_reported_by_nll: bool, + suppress: SuppressRegionErrors, ) { - debug!("report_region_errors(): {} errors to start", errors.len()); + debug!( + "report_region_errors(): {} errors to start, suppress = {:?}", + errors.len(), + suppress + ); - // If the errors will later be reported by NLL, choose wether to display them or not based - // on the borrowck mode - if will_later_be_reported_by_nll { - match self.tcx.borrowck_mode() { - // If we're on AST or Migrate mode, report AST region errors - BorrowckMode::Ast | BorrowckMode::Migrate => {}, - // If we're on MIR or Compare mode, don't report AST region errors as they should - // be reported by NLL - BorrowckMode::Compare | BorrowckMode::Mir => return, - } + if suppress.suppressed() { + return; } // try to pre-process the errors, which will group some of them @@ -482,17 +479,18 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } else { err.span_label(arm_span, msg); } - }, - hir::MatchSource::TryDesugar => { // Issue #51632 + } + hir::MatchSource::TryDesugar => { + // Issue #51632 if let Ok(try_snippet) = self.tcx.sess.source_map().span_to_snippet(arm_span) { err.span_suggestion_with_applicability( arm_span, "try wrapping with a success variant", format!("Ok({})", try_snippet), - Applicability::MachineApplicable + Applicability::MachineApplicable, ); } - }, + } _ => { let msg = "match arm with an incompatible type"; if self.tcx.sess.source_map().is_multiline(arm_span) { @@ -641,16 +639,21 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { fn strip_generic_default_params( &self, def_id: DefId, - substs: &ty::subst::Substs<'tcx> + substs: &ty::subst::Substs<'tcx>, ) -> &'tcx ty::subst::Substs<'tcx> { let generics = self.tcx.generics_of(def_id); let mut num_supplied_defaults = 0; - let mut type_params = generics.params.iter().rev().filter_map(|param| match param.kind { - ty::GenericParamDefKind::Lifetime => None, - ty::GenericParamDefKind::Type { has_default, .. } => { - Some((param.def_id, has_default)) - } - }).peekable(); + let mut type_params = generics + .params + .iter() + .rev() + .filter_map(|param| match param.kind { + ty::GenericParamDefKind::Lifetime => None, + ty::GenericParamDefKind::Type { has_default, .. } => { + Some((param.def_id, has_default)) + } + }) + .peekable(); let has_default = { let has_default = type_params.peek().map(|(_, has_default)| has_default); *has_default.unwrap_or(&false) @@ -684,10 +687,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { | (&ty::Infer(ty::InferTy::IntVar(_)), &ty::Infer(ty::InferTy::IntVar(_))) | (&ty::Float(_), &ty::Infer(ty::InferTy::FloatVar(_))) | (&ty::Infer(ty::InferTy::FloatVar(_)), &ty::Float(_)) - | ( - &ty::Infer(ty::InferTy::FloatVar(_)), - &ty::Infer(ty::InferTy::FloatVar(_)), - ) => true, + | (&ty::Infer(ty::InferTy::FloatVar(_)), &ty::Infer(ty::InferTy::FloatVar(_))) => { + true + } _ => false, } } @@ -703,11 +705,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { "&{}{}{}", r, if r == "" { "" } else { " " }, - if mutbl == hir::MutMutable { - "mut " - } else { - "" - } + if mutbl == hir::MutMutable { "mut " } else { "" } )); s.push_normal(ty.to_string()); } @@ -738,9 +736,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { let common_len = cmp::min(len1, len2); let remainder1: Vec<_> = sub1.types().skip(common_len).collect(); let remainder2: Vec<_> = sub2.types().skip(common_len).collect(); - let common_default_params = - remainder1.iter().rev().zip(remainder2.iter().rev()) - .filter(|(a, b)| a == b).count(); + let common_default_params = remainder1 + .iter() + .rev() + .zip(remainder2.iter().rev()) + .filter(|(a, b)| a == b) + .count(); let len = sub1.len() - common_default_params; // Only draw `<...>` if there're lifetime/type arguments. @@ -866,8 +867,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } // When encountering &T != &mut T, highlight only the borrow - (&ty::Ref(r1, ref_ty1, mutbl1), - &ty::Ref(r2, ref_ty2, mutbl2)) if equals(&ref_ty1, &ref_ty2) => { + (&ty::Ref(r1, ref_ty1, mutbl1), &ty::Ref(r2, ref_ty2, mutbl2)) + if equals(&ref_ty1, &ref_ty2) => + { let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new()); push_ty_ref(&r1, ref_ty1, mutbl1, &mut values.0); push_ty_ref(&r2, ref_ty2, mutbl2, &mut values.1); @@ -1068,11 +1070,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { bound_kind: GenericKind<'tcx>, sub: Region<'tcx>, ) { - self.construct_generic_bound_failure(region_scope_tree, - span, - origin, - bound_kind, - sub) + self.construct_generic_bound_failure(region_scope_tree, span, origin, bound_kind, sub) .emit() } @@ -1083,8 +1081,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { origin: Option>, bound_kind: GenericKind<'tcx>, sub: Region<'tcx>, - ) -> DiagnosticBuilder<'a> - { + ) -> DiagnosticBuilder<'a> { // Attempt to obtain the span of the parameter so we can // suggest adding an explicit lifetime bound to it. let type_param_span = match (self.in_progress_tables, bound_kind) { @@ -1161,8 +1158,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { let tail = if has_lifetimes { " + " } else { "" }; let suggestion = format!("{}: {}{}", bound_kind, sub, tail); err.span_suggestion_short_with_applicability( - sp, consider, suggestion, - Applicability::MaybeIncorrect // Issue #41966 + sp, + consider, + suggestion, + Applicability::MaybeIncorrect, // Issue #41966 ); } else { err.help(consider); @@ -1358,12 +1357,10 @@ impl<'tcx> ObligationCause<'tcx> { match self.code { CompareImplMethodObligation { .. } => Error0308("method not compatible with trait"), MatchExpressionArm { source, .. } => Error0308(match source { - hir::MatchSource::IfLetDesugar { .. } => { - "`if let` arms have incompatible types" - }, + hir::MatchSource::IfLetDesugar { .. } => "`if let` arms have incompatible types", hir::MatchSource::TryDesugar => { "try expression alternatives have incompatible types" - }, + } _ => "match arms have incompatible types", }), IfExpression => Error0308("if and else have incompatible types"), diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index 120b45ec01e5..a8fbfc3b64df 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -10,23 +10,26 @@ //! The code to do lexical region resolution. -use infer::SubregionOrigin; -use infer::RegionVariableOrigin; use infer::region_constraints::Constraint; use infer::region_constraints::GenericKind; use infer::region_constraints::RegionConstraintData; use infer::region_constraints::VarInfos; use infer::region_constraints::VerifyBound; +use infer::RegionVariableOrigin; +use infer::SubregionOrigin; use middle::free_region::RegionRelations; -use rustc_data_structures::indexed_vec::{Idx, IndexVec}; use rustc_data_structures::fx::FxHashSet; -use rustc_data_structures::graph::implementation::{Graph, Direction, NodeIndex, INCOMING, OUTGOING}; +use rustc_data_structures::graph::implementation::{ + Direction, Graph, NodeIndex, INCOMING, OUTGOING, +}; +use rustc_data_structures::indexed_vec::{Idx, IndexVec}; use std::fmt; use std::u32; -use ty::{self, TyCtxt}; -use ty::{Region, RegionVid}; +use ty::fold::TypeFoldable; +use ty::{self, Ty, TyCtxt}; use ty::{ReEarlyBound, ReEmpty, ReErased, ReFree, ReStatic}; use ty::{ReLateBound, ReScope, ReSkolemized, ReVar}; +use ty::{Region, RegionVid}; mod graphviz; @@ -108,11 +111,15 @@ struct LexicalResolver<'cx, 'gcx: 'tcx, 'tcx: 'cx> { } impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { + fn tcx(&self) -> TyCtxt<'cx, 'gcx, 'tcx> { + self.region_rels.tcx + } + fn infer_variable_values( &mut self, errors: &mut Vec>, ) -> LexicalRegionResolutions<'tcx> { - let mut var_data = self.construct_var_data(self.region_rels.tcx); + let mut var_data = self.construct_var_data(self.tcx()); // Dorky hack to cause `dump_constraints` to only get called // if debug mode is enabled: @@ -239,9 +246,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { debug!( "Expanding value of {:?} from {:?} to {:?}", - b_vid, - cur_region, - lub + b_vid, cur_region, lub ); *b_data = VarValue::Value(lub); @@ -254,18 +259,17 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { } } - fn lub_concrete_regions(&self, a: Region<'tcx>, b: Region<'tcx>) -> Region<'tcx> { - let tcx = self.region_rels.tcx; + let tcx = self.tcx(); match (a, b) { - (&ty::ReCanonical(..), _) | - (_, &ty::ReCanonical(..)) | - (&ty::ReClosureBound(..), _) | - (_, &ty::ReClosureBound(..)) | - (&ReLateBound(..), _) | - (_, &ReLateBound(..)) | - (&ReErased, _) | - (_, &ReErased) => { + (&ty::ReCanonical(..), _) + | (_, &ty::ReCanonical(..)) + | (&ty::ReClosureBound(..), _) + | (_, &ty::ReClosureBound(..)) + | (&ReLateBound(..), _) + | (_, &ReLateBound(..)) + | (&ReErased, _) + | (_, &ReErased) => { bug!("cannot relate region: LUB({:?}, {:?})", a, b); } @@ -287,20 +291,20 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { ); } - (&ReEarlyBound(_), &ReScope(s_id)) | - (&ReScope(s_id), &ReEarlyBound(_)) | - (&ReFree(_), &ReScope(s_id)) | - (&ReScope(s_id), &ReFree(_)) => { + (&ReEarlyBound(_), &ReScope(s_id)) + | (&ReScope(s_id), &ReEarlyBound(_)) + | (&ReFree(_), &ReScope(s_id)) + | (&ReScope(s_id), &ReFree(_)) => { // A "free" region can be interpreted as "some region // at least as big as fr.scope". So, we can // reasonably compare free regions and scopes: let fr_scope = match (a, b) { (&ReEarlyBound(ref br), _) | (_, &ReEarlyBound(ref br)) => self.region_rels .region_scope_tree - .early_free_scope(self.region_rels.tcx, br), + .early_free_scope(self.tcx(), br), (&ReFree(ref fr), _) | (_, &ReFree(ref fr)) => self.region_rels .region_scope_tree - .free_scope(self.region_rels.tcx, fr), + .free_scope(self.tcx(), fr), _ => bug!(), }; let r_id = self.region_rels @@ -332,10 +336,10 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { tcx.mk_region(ReScope(lub)) } - (&ReEarlyBound(_), &ReEarlyBound(_)) | - (&ReFree(_), &ReEarlyBound(_)) | - (&ReEarlyBound(_), &ReFree(_)) | - (&ReFree(_), &ReFree(_)) => self.region_rels.lub_free_regions(a, b), + (&ReEarlyBound(_), &ReEarlyBound(_)) + | (&ReFree(_), &ReEarlyBound(_)) + | (&ReEarlyBound(_), &ReFree(_)) + | (&ReFree(_), &ReFree(_)) => self.region_rels.lub_free_regions(a, b), // For these types, we cannot define any additional // relationship: @@ -358,8 +362,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { for (constraint, origin) in &self.data.constraints { debug!( "collect_errors: constraint={:?} origin={:?}", - constraint, - origin + constraint, origin ); match *constraint { Constraint::RegSubVar(..) | Constraint::VarSubVar(..) => { @@ -374,9 +377,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { debug!( "collect_errors: region error at {:?}: \ cannot verify that {:?} <= {:?}", - origin, - sub, - sup + origin, sub, sup ); errors.push(RegionResolutionError::ConcreteFailure( @@ -402,10 +403,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { debug!( "collect_errors: region error at {:?}: \ cannot verify that {:?}={:?} <= {:?}", - origin, - a_vid, - a_region, - b_region + origin, a_vid, a_region, b_region ); *a_data = VarValue::ErrorValue; } @@ -415,7 +413,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { for verify in &self.data.verifys { debug!("collect_errors: verify={:?}", verify); - let sub = var_data.normalize(verify.region); + let sub = var_data.normalize(self.tcx(), verify.region); // This was an inference variable which didn't get // constrained, therefore it can be assume to hold. @@ -423,16 +421,15 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { continue; } - if self.bound_is_met(&verify.bound, var_data, sub) { + let verify_kind_ty = verify.kind.to_ty(self.tcx()); + if self.bound_is_met(&verify.bound, var_data, verify_kind_ty, sub) { continue; } debug!( "collect_errors: region error at {:?}: \ cannot verify that {:?} <= {:?}", - verify.origin, - verify.region, - verify.bound + verify.origin, verify.region, verify.bound ); errors.push(RegionResolutionError::GenericBoundFailure( @@ -580,10 +577,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { debug!( "region inference error at {:?} for {:?}: SubSupConflict sub: {:?} \ sup: {:?}", - origin, - node_idx, - lower_bound.region, - upper_bound.region + origin, node_idx, lower_bound.region, upper_bound.region ); errors.push(RegionResolutionError::SubSupConflict( origin, @@ -645,8 +639,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { debug!( "collect_concrete_regions(orig_node_idx={:?}, node_idx={:?})", - orig_node_idx, - node_idx + orig_node_idx, node_idx ); process_edges(&self.data, &mut state, graph, node_idx, dir); @@ -721,20 +714,26 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> { &self, bound: &VerifyBound<'tcx>, var_values: &LexicalRegionResolutions<'tcx>, + generic_ty: Ty<'tcx>, min: ty::Region<'tcx>, ) -> bool { match bound { - VerifyBound::AnyRegion(rs) => rs.iter() - .map(|&r| var_values.normalize(r)) - .any(|r| self.region_rels.is_subregion_of(min, r)), + VerifyBound::IfEq(k, b) => { + (var_values.normalize(self.region_rels.tcx, *k) == generic_ty) + && self.bound_is_met(b, var_values, generic_ty, min) + } - VerifyBound::AllRegions(rs) => rs.iter() - .map(|&r| var_values.normalize(r)) - .all(|r| self.region_rels.is_subregion_of(min, r)), + VerifyBound::OutlivedBy(r) => + self.region_rels.is_subregion_of( + min, + var_values.normalize(self.tcx(), r), + ), - VerifyBound::AnyBound(bs) => bs.iter().any(|b| self.bound_is_met(b, var_values, min)), + VerifyBound::AnyBound(bs) => bs.iter() + .any(|b| self.bound_is_met(b, var_values, generic_ty, min)), - VerifyBound::AllBounds(bs) => bs.iter().all(|b| self.bound_is_met(b, var_values, min)), + VerifyBound::AllBounds(bs) => bs.iter() + .all(|b| self.bound_is_met(b, var_values, generic_ty, min)), } } } @@ -745,13 +744,15 @@ impl<'tcx> fmt::Debug for RegionAndOrigin<'tcx> { } } - impl<'tcx> LexicalRegionResolutions<'tcx> { - fn normalize(&self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { - match *r { - ty::ReVar(rid) => self.resolve_var(rid), + fn normalize(&self, tcx: TyCtxt<'_, '_, 'tcx>, value: T) -> T + where + T: TypeFoldable<'tcx>, + { + tcx.fold_regions(&value, &mut false, |r, _db| match r { + ty::ReVar(rid) => self.resolve_var(*rid), _ => r, - } + }) } fn value(&self, rid: RegionVid) -> &VarValue<'tcx> { diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index e628a3458f9e..dc10ec03feef 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -24,6 +24,7 @@ use middle::free_region::RegionRelations; use middle::lang_items; use middle::region; use rustc_data_structures::unify as ut; +use session::config::BorrowckMode; use std::cell::{Cell, Ref, RefCell, RefMut}; use std::collections::BTreeMap; use std::fmt; @@ -80,6 +81,38 @@ pub type Bound = Option; pub type UnitResult<'tcx> = RelateResult<'tcx, ()>; // "unify result" pub type FixupResult = Result; // "fixup result" +/// A flag that is used to suppress region errors. This is normally +/// false, but sometimes -- when we are doing region checks that the +/// NLL borrow checker will also do -- it might be set to true. +#[derive(Copy, Clone, Default, Debug)] +pub struct SuppressRegionErrors { + suppressed: bool +} + +impl SuppressRegionErrors { + pub fn suppressed(self) -> bool { + self.suppressed + } + + /// Indicates that the MIR borrowck will repeat these region + /// checks, so we should ignore errors if NLL is (unconditionally) + /// enabled. + pub fn when_nll_is_enabled(tcx: TyCtxt<'_, '_, '_>) -> Self { + match tcx.borrowck_mode() { + // If we're on AST or Migrate mode, report AST region errors + BorrowckMode::Ast | BorrowckMode::Migrate => SuppressRegionErrors { + suppressed: false + }, + + // If we're on MIR or Compare mode, don't report AST region errors as they should + // be reported by NLL + BorrowckMode::Compare | BorrowckMode::Mir => SuppressRegionErrors { + suppressed: true + }, + } + } +} + pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { pub tcx: TyCtxt<'a, 'gcx, 'tcx>, @@ -408,7 +441,7 @@ pub enum FixupError { pub struct RegionObligation<'tcx> { pub sub_region: ty::Region<'tcx>, pub sup_type: Ty<'tcx>, - pub cause: ObligationCause<'tcx>, + pub origin: SubregionOrigin<'tcx>, } impl fmt::Display for FixupError { @@ -1039,34 +1072,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { region_context: DefId, region_map: ®ion::ScopeTree, outlives_env: &OutlivesEnvironment<'tcx>, - ) { - self.resolve_regions_and_report_errors_inner( - region_context, - region_map, - outlives_env, - false, - ) - } - - /// Like `resolve_regions_and_report_errors`, but skips error - /// reporting if NLL is enabled. This is used for fn bodies where - /// the same error may later be reported by the NLL-based - /// inference. - pub fn resolve_regions_and_report_errors_unless_nll( - &self, - region_context: DefId, - region_map: ®ion::ScopeTree, - outlives_env: &OutlivesEnvironment<'tcx>, - ) { - self.resolve_regions_and_report_errors_inner(region_context, region_map, outlives_env, true) - } - - fn resolve_regions_and_report_errors_inner( - &self, - region_context: DefId, - region_map: ®ion::ScopeTree, - outlives_env: &OutlivesEnvironment<'tcx>, - will_later_be_reported_by_nll: bool, + suppress: SuppressRegionErrors, ) { assert!( self.is_tainted_by_errors() || self.region_obligations.borrow().is_empty(), @@ -1098,7 +1104,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { // this infcx was in use. This is totally hokey but // otherwise we have a hard time separating legit region // errors from silly ones. - self.report_region_errors(region_map, &errors, will_later_be_reported_by_nll); + self.report_region_errors(region_map, &errors, suppress); } } diff --git a/src/librustc/infer/outlives/env.rs b/src/librustc/infer/outlives/env.rs index 7f59a6794efb..631ff58d3e37 100644 --- a/src/librustc/infer/outlives/env.rs +++ b/src/librustc/infer/outlives/env.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use infer::{GenericKind, InferCtxt}; use infer::outlives::free_region_map::FreeRegionMap; -use traits::query::outlives_bounds::{self, OutlivesBound}; -use ty::{self, Ty}; - +use infer::{GenericKind, InferCtxt}; +use rustc_data_structures::fx::FxHashMap; use syntax::ast; use syntax_pos::Span; +use traits::query::outlives_bounds::{self, OutlivesBound}; +use ty::{self, Ty}; /// The `OutlivesEnvironment` collects information about what outlives /// what in a given type-checking setting. For example, if we have a @@ -39,15 +39,51 @@ use syntax_pos::Span; pub struct OutlivesEnvironment<'tcx> { param_env: ty::ParamEnv<'tcx>, free_region_map: FreeRegionMap<'tcx>, - region_bound_pairs: Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>, + + // Contains, for each body B that we are checking (that is, the fn + // item, but also any nested closures), the set of implied region + // bounds that are in scope in that particular body. + // + // Example: + // + // ``` + // fn foo<'a, 'b, T>(x: &'a T, y: &'b ()) { + // bar(x, y, |y: &'b T| { .. } // body B1) + // } // body B0 + // ``` + // + // Here, for body B0, the list would be `[T: 'a]`, because we + // infer that `T` must outlive `'a` from the implied bounds on the + // fn declaration. + // + // For the body B1, the list would be `[T: 'a, T: 'b]`, because we + // also can see that -- within the closure body! -- `T` must + // outlive `'b`. This is not necessarily true outside the closure + // body, since the closure may never be called. + // + // We collect this map as we descend the tree. We then use the + // results when proving outlives obligations like `T: 'x` later + // (e.g., if `T: 'x` must be proven within the body B1, then we + // know it is true if either `'a: 'x` or `'b: 'x`). + region_bound_pairs_map: FxHashMap>, + + // Used to compute `region_bound_pairs_map`: contains the set of + // in-scope region-bound pairs thus far. + region_bound_pairs_accum: RegionBoundPairs<'tcx>, } +/// "Region-bound pairs" tracks outlives relations that are known to +/// be true, either because of explicit where clauses like `T: 'a` or +/// because of implied bounds. +pub type RegionBoundPairs<'tcx> = Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>; + impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> { pub fn new(param_env: ty::ParamEnv<'tcx>) -> Self { let mut env = OutlivesEnvironment { param_env, free_region_map: FreeRegionMap::new(), - region_bound_pairs: vec![], + region_bound_pairs_map: FxHashMap::default(), + region_bound_pairs_accum: vec![], }; env.add_outlives_bounds(None, outlives_bounds::explicit_outlives_bounds(param_env)); @@ -61,8 +97,8 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> { } /// Borrows current value of the `region_bound_pairs`. - pub fn region_bound_pairs(&self) -> &[(ty::Region<'tcx>, GenericKind<'tcx>)] { - &self.region_bound_pairs + pub fn region_bound_pairs_map(&self) -> &FxHashMap> { + &self.region_bound_pairs_map } /// Returns ownership of the `free_region_map`. @@ -108,12 +144,12 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> { /// similar leaks around givens that seem equally suspicious, to /// be honest. --nmatsakis pub fn push_snapshot_pre_closure(&self) -> usize { - self.region_bound_pairs.len() + self.region_bound_pairs_accum.len() } /// See `push_snapshot_pre_closure`. pub fn pop_snapshot_post_closure(&mut self, len: usize) { - self.region_bound_pairs.truncate(len); + self.region_bound_pairs_accum.truncate(len); } /// This method adds "implied bounds" into the outlives environment. @@ -149,6 +185,15 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> { } } + /// Save the current set of region-bound pairs under the given `body_id`. + pub fn save_implied_bounds(&mut self, body_id: ast::NodeId) { + let old = self.region_bound_pairs_map.insert( + body_id, + self.region_bound_pairs_accum.clone(), + ); + assert!(old.is_none()); + } + /// Processes outlives bounds that are known to hold, whether from implied or other sources. /// /// The `infcx` parameter is optional; if the implied bounds may @@ -167,16 +212,18 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> { for outlives_bound in outlives_bounds { debug!("add_outlives_bounds: outlives_bound={:?}", outlives_bound); match outlives_bound { - OutlivesBound::RegionSubRegion(r_a @ &ty::ReEarlyBound(_), &ty::ReVar(vid_b)) | - OutlivesBound::RegionSubRegion(r_a @ &ty::ReFree(_), &ty::ReVar(vid_b)) => { - infcx.expect("no infcx provided but region vars found").add_given(r_a, vid_b); + OutlivesBound::RegionSubRegion(r_a @ &ty::ReEarlyBound(_), &ty::ReVar(vid_b)) + | OutlivesBound::RegionSubRegion(r_a @ &ty::ReFree(_), &ty::ReVar(vid_b)) => { + infcx + .expect("no infcx provided but region vars found") + .add_given(r_a, vid_b); } OutlivesBound::RegionSubParam(r_a, param_b) => { - self.region_bound_pairs + self.region_bound_pairs_accum .push((r_a, GenericKind::Param(param_b))); } OutlivesBound::RegionSubProjection(r_a, projection_b) => { - self.region_bound_pairs + self.region_bound_pairs_accum .push((r_a, GenericKind::Projection(projection_b))); } OutlivesBound::RegionSubRegion(r_a, r_b) => { diff --git a/src/librustc/infer/outlives/mod.rs b/src/librustc/infer/outlives/mod.rs index bb3703b21573..282aef786f08 100644 --- a/src/librustc/infer/outlives/mod.rs +++ b/src/librustc/infer/outlives/mod.rs @@ -13,3 +13,4 @@ pub mod env; pub mod free_region_map; pub mod obligations; +pub mod verify; diff --git a/src/librustc/infer/outlives/obligations.rs b/src/librustc/infer/outlives/obligations.rs index 817280b97e03..332859d4f81d 100644 --- a/src/librustc/infer/outlives/obligations.rs +++ b/src/librustc/infer/outlives/obligations.rs @@ -69,13 +69,14 @@ //! might later infer `?U` to something like `&'b u32`, which would //! imply that `'b: 'a`. -use hir::def_id::DefId; +use infer::outlives::env::RegionBoundPairs; +use infer::outlives::verify::VerifyBoundCx; use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound}; +use rustc_data_structures::fx::FxHashMap; use syntax::ast; -use traits; +use traits::ObligationCause; use ty::outlives::Component; -use ty::subst::{Subst, Substs}; -use ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::{self, Region, Ty, TyCtxt, TypeFoldable}; impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { /// Registers that the given region obligation must be resolved @@ -98,6 +99,26 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { .push((body_id, obligation)); } + pub fn register_region_obligation_with_cause( + &self, + sup_type: Ty<'tcx>, + sub_region: Region<'tcx>, + cause: &ObligationCause<'tcx>, + ) { + let origin = SubregionOrigin::from_obligation_cause(cause, || { + infer::RelateParamBound(cause.span, sup_type) + }); + + self.register_region_obligation( + cause.body_id, + RegionObligation { + sup_type, + sub_region, + origin, + }, + ); + } + /// Trait queries just want to pass back type obligations "as is" pub fn take_registered_region_obligations(&self) -> Vec<(ast::NodeId, RegionObligation<'tcx>)> { ::std::mem::replace(&mut *self.region_obligations.borrow_mut(), vec![]) @@ -138,10 +159,9 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { /// processed. pub fn process_registered_region_obligations( &self, - region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs_map: &FxHashMap>, implicit_region_bound: Option>, param_env: ty::ParamEnv<'tcx>, - body_id: ast::NodeId, ) { assert!( !self.in_snapshot.get(), @@ -150,41 +170,39 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { debug!("process_registered_region_obligations()"); - // pull out the region obligations with the given `body_id` (leaving the rest) - let mut my_region_obligations = Vec::with_capacity(self.region_obligations.borrow().len()); - { - let mut r_o = self.region_obligations.borrow_mut(); - my_region_obligations.extend( - r_o.drain_filter(|(ro_body_id, _)| *ro_body_id == body_id) - .map(|(_, obligation)| obligation) - ); - } + let my_region_obligations = self.take_registered_region_obligations(); - let outlives = &mut TypeOutlives::new( - self, - self.tcx, - region_bound_pairs, - implicit_region_bound, - param_env, - ); - - for RegionObligation { - sup_type, - sub_region, - cause, - } in my_region_obligations + for ( + body_id, + RegionObligation { + sup_type, + sub_region, + origin, + }, + ) in my_region_obligations { debug!( - "process_registered_region_obligations: sup_type={:?} sub_region={:?} cause={:?}", - sup_type, sub_region, cause + "process_registered_region_obligations: sup_type={:?} sub_region={:?} origin={:?}", + sup_type, sub_region, origin ); - let origin = SubregionOrigin::from_obligation_cause(&cause, || { - infer::RelateParamBound(cause.span, sup_type) - }); - let sup_type = self.resolve_type_vars_if_possible(&sup_type); - outlives.type_must_outlive(origin, sup_type, sub_region); + + if let Some(region_bound_pairs) = region_bound_pairs_map.get(&body_id) { + let outlives = &mut TypeOutlives::new( + self, + self.tcx, + ®ion_bound_pairs, + implicit_region_bound, + param_env, + ); + outlives.type_must_outlive(origin, sup_type, sub_region); + } else { + self.tcx.sess.delay_span_bug( + origin.span(), + &format!("no region-bound-pairs for {:?}", body_id), + ) + } } } @@ -192,7 +210,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { /// registered in advance. pub fn type_must_outlive( &self, - region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &RegionBoundPairs<'tcx>, implicit_region_bound: Option>, param_env: ty::ParamEnv<'tcx>, origin: infer::SubregionOrigin<'tcx>, @@ -225,9 +243,7 @@ where // of these fields. delegate: D, tcx: TyCtxt<'cx, 'gcx, 'tcx>, - region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)], - implicit_region_bound: Option>, - param_env: ty::ParamEnv<'tcx>, + verify_bound: VerifyBoundCx<'cx, 'gcx, 'tcx>, } pub trait TypeOutlivesDelegate<'tcx> { @@ -254,16 +270,19 @@ where pub fn new( delegate: D, tcx: TyCtxt<'cx, 'gcx, 'tcx>, - region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'cx RegionBoundPairs<'tcx>, implicit_region_bound: Option>, param_env: ty::ParamEnv<'tcx>, ) -> Self { Self { delegate, tcx, - region_bound_pairs, - implicit_region_bound, - param_env, + verify_bound: VerifyBoundCx::new( + tcx, + region_bound_pairs, + implicit_region_bound, + param_env, + ), } } @@ -302,7 +321,8 @@ where let origin = origin.clone(); match component { Component::Region(region1) => { - self.delegate.push_sub_region_constraint(origin, region, region1); + self.delegate + .push_sub_region_constraint(origin, region, region1); } Component::Param(param_ty) => { self.param_ty_must_outlive(origin, region, param_ty); @@ -337,8 +357,8 @@ where region, param_ty, origin ); - let verify_bound = self.param_bound(param_ty); let generic = GenericKind::Param(param_ty); + let verify_bound = self.verify_bound.generic_bound(generic); self.delegate .push_verify(origin, generic, region, verify_bound); } @@ -368,19 +388,22 @@ where // rule might not apply (but another rule might). For now, we err // on the side of adding too few edges into the graph. - // Compute the bounds we can derive from the environment or trait - // definition. We know that the projection outlives all the - // regions in this list. - let env_bounds = self.projection_declared_bounds(projection_ty); + // Compute the bounds we can derive from the environment. This + // is an "approximate" match -- in some cases, these bounds + // may not apply. + let approx_env_bounds = self.verify_bound + .projection_approx_declared_bounds_from_env(projection_ty); + debug!( + "projection_must_outlive: approx_env_bounds={:?}", + approx_env_bounds + ); - debug!("projection_must_outlive: env_bounds={:?}", env_bounds); - - // If we know that the projection outlives 'static, then we're - // done here. - if env_bounds.contains(&&ty::ReStatic) { - debug!("projection_must_outlive: 'static as declared bound"); - return; - } + // Compute the bounds we can derive from the trait definition. + // These are guaranteed to apply, no matter the inference + // results. + let trait_bounds: Vec<_> = self.verify_bound + .projection_declared_bounds_from_trait(projection_ty) + .collect(); // If declared bounds list is empty, the only applicable rule is // OutlivesProjectionComponent. If there are inference variables, @@ -397,7 +420,7 @@ where // inference variables, we use a verify constraint instead of adding // edges, which winds up enforcing the same condition. let needs_infer = projection_ty.needs_infer(); - if env_bounds.is_empty() && needs_infer { + if approx_env_bounds.is_empty() && trait_bounds.is_empty() && needs_infer { debug!("projection_must_outlive: no declared bounds"); for component_ty in projection_ty.substs.types() { @@ -405,36 +428,38 @@ where } for r in projection_ty.substs.regions() { - self.delegate.push_sub_region_constraint(origin.clone(), region, r); + self.delegate + .push_sub_region_constraint(origin.clone(), region, r); } return; } - // If we find that there is a unique declared bound `'b`, and this bound - // appears in the trait reference, then the best action is to require that `'b:'r`, - // so do that. This is best no matter what rule we use: + // If we found a unique bound `'b` from the trait, and we + // found nothing else from the environment, then the best + // action is to require that `'b: 'r`, so do that. // - // - OutlivesProjectionEnv or OutlivesProjectionTraitDef: these would translate to - // the requirement that `'b:'r` - // - OutlivesProjectionComponent: this would require `'b:'r` in addition to - // other conditions - if !env_bounds.is_empty() && env_bounds[1..].iter().all(|b| *b == env_bounds[0]) { - let unique_bound = env_bounds[0]; + // This is best no matter what rule we use: + // + // - OutlivesProjectionEnv: these would translate to the requirement that `'b:'r` + // - OutlivesProjectionTraitDef: these would translate to the requirement that `'b:'r` + // - OutlivesProjectionComponent: this would require `'b:'r` + // in addition to other conditions + if !trait_bounds.is_empty() + && trait_bounds[1..] + .iter() + .chain(approx_env_bounds.iter().map(|b| &b.1)) + .all(|b| *b == trait_bounds[0]) + { + let unique_bound = trait_bounds[0]; debug!( - "projection_must_outlive: unique declared bound = {:?}", + "projection_must_outlive: unique trait bound = {:?}", unique_bound ); - if projection_ty - .substs - .regions() - .any(|r| env_bounds.contains(&r)) - { - debug!("projection_must_outlive: unique declared bound appears in trait ref"); - self.delegate - .push_sub_region_constraint(origin.clone(), region, unique_bound); - return; - } + debug!("projection_must_outlive: unique declared bound appears in trait ref"); + self.delegate + .push_sub_region_constraint(origin.clone(), region, unique_bound); + return; } // Fallback to verifying after the fact that there exists a @@ -442,216 +467,11 @@ where // projection outlive; in some cases, this may add insufficient // edges into the inference graph, leading to inference failures // even though a satisfactory solution exists. - let verify_bound = self.projection_bound(env_bounds, projection_ty); let generic = GenericKind::Projection(projection_ty); + let verify_bound = self.verify_bound.generic_bound(generic); self.delegate .push_verify(origin, generic.clone(), region, verify_bound); } - - fn type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> { - match ty.sty { - ty::Param(p) => self.param_bound(p), - ty::Projection(data) => { - let declared_bounds = self.projection_declared_bounds(data); - self.projection_bound(declared_bounds, data) - } - _ => self.recursive_type_bound(ty), - } - } - - fn param_bound(&self, param_ty: ty::ParamTy) -> VerifyBound<'tcx> { - debug!("param_bound(param_ty={:?})", param_ty); - - let mut param_bounds = self.declared_generic_bounds_from_env(GenericKind::Param(param_ty)); - - // Add in the default bound of fn body that applies to all in - // scope type parameters: - param_bounds.extend(self.implicit_region_bound); - - VerifyBound::AnyRegion(param_bounds) - } - - fn projection_declared_bounds( - &self, - projection_ty: ty::ProjectionTy<'tcx>, - ) -> Vec> { - // First assemble bounds from where clauses and traits. - - let mut declared_bounds = - self.declared_generic_bounds_from_env(GenericKind::Projection(projection_ty)); - - declared_bounds - .extend_from_slice(&self.declared_projection_bounds_from_trait(projection_ty)); - - declared_bounds - } - - fn projection_bound( - &self, - declared_bounds: Vec>, - projection_ty: ty::ProjectionTy<'tcx>, - ) -> VerifyBound<'tcx> { - debug!( - "projection_bound(declared_bounds={:?}, projection_ty={:?})", - declared_bounds, projection_ty - ); - - // see the extensive comment in projection_must_outlive - let ty = self - .tcx - .mk_projection(projection_ty.item_def_id, projection_ty.substs); - let recursive_bound = self.recursive_type_bound(ty); - - VerifyBound::AnyRegion(declared_bounds).or(recursive_bound) - } - - fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> { - let mut bounds = ty.walk_shallow().map(|subty| self.type_bound(subty)).collect::>(); - - let mut regions = ty.regions(); - regions.retain(|r| !r.is_late_bound()); // ignore late-bound regions - bounds.push(VerifyBound::AllRegions(regions)); - - // remove bounds that must hold, since they are not interesting - bounds.retain(|b| !b.must_hold()); - - if bounds.len() == 1 { - bounds.pop().unwrap() - } else { - VerifyBound::AllBounds(bounds) - } - } - - fn declared_generic_bounds_from_env( - &self, - generic: GenericKind<'tcx>, - ) -> Vec> { - let tcx = self.tcx; - - // To start, collect bounds from user environment. Note that - // parameter environments are already elaborated, so we don't - // have to worry about that. Comparing using `==` is a bit - // dubious for projections, but it will work for simple cases - // like `T` and `T::Item`. It may not work as well for things - // like `>::Item`. - let generic_ty = generic.to_ty(tcx); - let c_b = self.param_env.caller_bounds; - let mut param_bounds = self.collect_outlives_from_predicate_list(generic_ty, c_b); - - // Next, collect regions we scraped from the well-formedness - // constraints in the fn signature. To do that, we walk the list - // of known relations from the fn ctxt. - // - // This is crucial because otherwise code like this fails: - // - // fn foo<'a, A>(x: &'a A) { x.bar() } - // - // The problem is that the type of `x` is `&'a A`. To be - // well-formed, then, A must be lower-generic by `'a`, but we - // don't know that this holds from first principles. - for &(r, p) in self.region_bound_pairs { - debug!("generic={:?} p={:?}", generic, p); - if generic == p { - param_bounds.push(r); - } - } - - param_bounds - } - - /// Given a projection like `>::Bar`, returns any bounds - /// declared in the trait definition. For example, if the trait were - /// - /// ```rust - /// trait Foo<'a> { - /// type Bar: 'a; - /// } - /// ``` - /// - /// then this function would return `'x`. This is subject to the - /// limitations around higher-ranked bounds described in - /// `region_bounds_declared_on_associated_item`. - fn declared_projection_bounds_from_trait( - &self, - projection_ty: ty::ProjectionTy<'tcx>, - ) -> Vec> { - debug!("projection_bounds(projection_ty={:?})", projection_ty); - let mut bounds = self.region_bounds_declared_on_associated_item(projection_ty.item_def_id); - for r in &mut bounds { - *r = r.subst(self.tcx, projection_ty.substs); - } - bounds - } - - /// Given the def-id of an associated item, returns any region - /// bounds attached to that associated item from the trait definition. - /// - /// For example: - /// - /// ```rust - /// trait Foo<'a> { - /// type Bar: 'a; - /// } - /// ``` - /// - /// If we were given the def-id of `Foo::Bar`, we would return - /// `'a`. You could then apply the substitutions from the - /// projection to convert this into your namespace. This also - /// works if the user writes `where >::Bar: 'a` on - /// the trait. In fact, it works by searching for just such a - /// where-clause. - /// - /// It will not, however, work for higher-ranked bounds like: - /// - /// ```rust - /// trait Foo<'a, 'b> - /// where for<'x> >::Bar: 'x - /// { - /// type Bar; - /// } - /// ``` - /// - /// This is for simplicity, and because we are not really smart - /// enough to cope with such bounds anywhere. - fn region_bounds_declared_on_associated_item( - &self, - assoc_item_def_id: DefId, - ) -> Vec> { - let tcx = self.tcx; - let assoc_item = tcx.associated_item(assoc_item_def_id); - let trait_def_id = assoc_item.container.assert_trait(); - let trait_predicates = tcx.predicates_of(trait_def_id); - let identity_substs = Substs::identity_for_item(tcx, assoc_item_def_id); - let identity_proj = tcx.mk_projection(assoc_item_def_id, identity_substs); - self.collect_outlives_from_predicate_list( - identity_proj, - traits::elaborate_predicates(tcx, trait_predicates.predicates), - ) - } - - /// Searches through a predicate list for a predicate `T: 'a`. - /// - /// Careful: does not elaborate predicates, and just uses `==` - /// when comparing `ty` for equality, so `ty` must be something - /// that does not involve inference variables and where you - /// otherwise want a precise match. - fn collect_outlives_from_predicate_list( - &self, - ty: Ty<'tcx>, - predicates: I, - ) -> Vec> - where - I: IntoIterator, - P: AsRef>, - { - predicates - .into_iter() - .filter_map(|p| p.as_ref().to_opt_type_outlives()) - .filter_map(|p| p.no_late_bound_regions()) - .filter(|p| p.0 == ty) - .map(|p| p.1) - .collect() - } } impl<'cx, 'gcx, 'tcx> TypeOutlivesDelegate<'tcx> for &'cx InferCtxt<'cx, 'gcx, 'tcx> { @@ -674,4 +494,3 @@ impl<'cx, 'gcx, 'tcx> TypeOutlivesDelegate<'tcx> for &'cx InferCtxt<'cx, 'gcx, ' self.verify_generic_bound(origin, kind, a, bound) } } - diff --git a/src/librustc/infer/outlives/verify.rs b/src/librustc/infer/outlives/verify.rs new file mode 100644 index 000000000000..e1db295b7e14 --- /dev/null +++ b/src/librustc/infer/outlives/verify.rs @@ -0,0 +1,329 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use hir::def_id::DefId; +use infer::outlives::env::RegionBoundPairs; +use infer::{GenericKind, VerifyBound}; +use traits; +use ty::subst::{Subst, Substs}; +use ty::{self, Ty, TyCtxt}; +use util::captures::Captures; + +/// The `TypeOutlives` struct has the job of "lowering" a `T: 'a` +/// obligation into a series of `'a: 'b` constraints and "verifys", as +/// described on the module comment. The final constraints are emitted +/// via a "delegate" of type `D` -- this is usually the `infcx`, which +/// accrues them into the `region_obligations` code, but for NLL we +/// use something else. +pub struct VerifyBoundCx<'cx, 'gcx: 'tcx, 'tcx: 'cx> { + tcx: TyCtxt<'cx, 'gcx, 'tcx>, + region_bound_pairs: &'cx RegionBoundPairs<'tcx>, + implicit_region_bound: Option>, + param_env: ty::ParamEnv<'tcx>, +} + +impl<'cx, 'gcx, 'tcx> VerifyBoundCx<'cx, 'gcx, 'tcx> { + pub fn new( + tcx: TyCtxt<'cx, 'gcx, 'tcx>, + region_bound_pairs: &'cx RegionBoundPairs<'tcx>, + implicit_region_bound: Option>, + param_env: ty::ParamEnv<'tcx>, + ) -> Self { + Self { + tcx, + region_bound_pairs, + implicit_region_bound, + param_env, + } + } + + /// Returns a "verify bound" that encodes what we know about + /// `generic` and the regions it outlives. + pub fn generic_bound(&self, generic: GenericKind<'tcx>) -> VerifyBound<'tcx> { + match generic { + GenericKind::Param(param_ty) => self.param_bound(param_ty), + GenericKind::Projection(projection_ty) => self.projection_bound(projection_ty), + } + } + + fn type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> { + match ty.sty { + ty::Param(p) => self.param_bound(p), + ty::Projection(data) => self.projection_bound(data), + _ => self.recursive_type_bound(ty), + } + } + + fn param_bound(&self, param_ty: ty::ParamTy) -> VerifyBound<'tcx> { + debug!("param_bound(param_ty={:?})", param_ty); + + // Start with anything like `T: 'a` we can scrape from the + // environment + let param_bounds = self.declared_generic_bounds_from_env(GenericKind::Param(param_ty)) + .into_iter() + .map(|outlives| outlives.1); + + // Add in the default bound of fn body that applies to all in + // scope type parameters: + let param_bounds = param_bounds.chain(self.implicit_region_bound); + + VerifyBound::AnyBound(param_bounds.map(|r| VerifyBound::OutlivedBy(r)).collect()) + } + + /// Given a projection like `T::Item`, searches the environment + /// for where-clauses like `T::Item: 'a`. Returns the set of + /// regions `'a` that it finds. + /// + /// This is an "approximate" check -- it may not find all + /// applicable bounds, and not all the bounds it returns can be + /// relied upon. In particular, this check ignores region + /// identity. So, for example, if we have `>::Item` where `'0` is a region variable, and the + /// user has `>::Item: 'b` in the environment, then + /// the clause from the environment only applies if `'0 = 'a`, + /// which we don't know yet. But we would still include `'b` in + /// this list. + pub fn projection_approx_declared_bounds_from_env( + &self, + projection_ty: ty::ProjectionTy<'tcx>, + ) -> Vec, ty::Region<'tcx>>> { + let projection_ty = GenericKind::Projection(projection_ty).to_ty(self.tcx); + let erased_projection_ty = self.tcx.erase_regions(&projection_ty); + self.declared_generic_bounds_from_env_with_compare_fn(|ty| { + if let ty::Projection(..) = ty.sty { + let erased_ty = self.tcx.erase_regions(&ty); + erased_ty == erased_projection_ty + } else { + false + } + }) + } + + /// Searches the where clauses in scope for regions that + /// `projection_ty` is known to outlive. Currently requires an + /// exact match. + pub fn projection_declared_bounds_from_trait( + &self, + projection_ty: ty::ProjectionTy<'tcx>, + ) -> impl Iterator> + 'cx + Captures<'gcx> { + self.declared_projection_bounds_from_trait(projection_ty) + } + + pub fn projection_bound(&self, projection_ty: ty::ProjectionTy<'tcx>) -> VerifyBound<'tcx> { + debug!("projection_bound(projection_ty={:?})", projection_ty); + + let projection_ty_as_ty = + self.tcx.mk_projection(projection_ty.item_def_id, projection_ty.substs); + + // Search the env for where clauses like `P: 'a`. + let env_bounds = self.projection_approx_declared_bounds_from_env(projection_ty) + .into_iter() + .map(|ty::OutlivesPredicate(ty, r)| { + let vb = VerifyBound::OutlivedBy(r); + if ty == projection_ty_as_ty { + // Micro-optimize if this is an exact match (this + // occurs often when there are no region variables + // involved). + vb + } else { + VerifyBound::IfEq(ty, Box::new(vb)) + } + }); + + // Extend with bounds that we can find from the trait. + let trait_bounds = self.projection_declared_bounds_from_trait(projection_ty) + .into_iter() + .map(|r| VerifyBound::OutlivedBy(r)); + + // see the extensive comment in projection_must_outlive + let ty = self.tcx + .mk_projection(projection_ty.item_def_id, projection_ty.substs); + let recursive_bound = self.recursive_type_bound(ty); + + VerifyBound::AnyBound(env_bounds.chain(trait_bounds).collect()).or(recursive_bound) + } + + fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> { + let mut bounds = ty.walk_shallow() + .map(|subty| self.type_bound(subty)) + .collect::>(); + + let mut regions = ty.regions(); + regions.retain(|r| !r.is_late_bound()); // ignore late-bound regions + bounds.push(VerifyBound::AllBounds( + regions + .into_iter() + .map(|r| VerifyBound::OutlivedBy(r)) + .collect(), + )); + + // remove bounds that must hold, since they are not interesting + bounds.retain(|b| !b.must_hold()); + + if bounds.len() == 1 { + bounds.pop().unwrap() + } else { + VerifyBound::AllBounds(bounds) + } + } + + /// Searches the environment for where-clauses like `G: 'a` where + /// `G` is either some type parameter `T` or a projection like + /// `T::Item`. Returns a vector of the `'a` bounds it can find. + /// + /// This is a conservative check -- it may not find all applicable + /// bounds, but all the bounds it returns can be relied upon. + fn declared_generic_bounds_from_env( + &self, + generic: GenericKind<'tcx>, + ) -> Vec, ty::Region<'tcx>>> { + let generic_ty = generic.to_ty(self.tcx); + self.declared_generic_bounds_from_env_with_compare_fn(|ty| ty == generic_ty) + } + + fn declared_generic_bounds_from_env_with_compare_fn( + &self, + compare_ty: impl Fn(Ty<'tcx>) -> bool, + ) -> Vec, ty::Region<'tcx>>> { + let tcx = self.tcx; + + // To start, collect bounds from user environment. Note that + // parameter environments are already elaborated, so we don't + // have to worry about that. Comparing using `==` is a bit + // dubious for projections, but it will work for simple cases + // like `T` and `T::Item`. It may not work as well for things + // like `>::Item`. + let c_b = self.param_env.caller_bounds; + let param_bounds = self.collect_outlives_from_predicate_list(&compare_ty, c_b); + + // Next, collect regions we scraped from the well-formedness + // constraints in the fn signature. To do that, we walk the list + // of known relations from the fn ctxt. + // + // This is crucial because otherwise code like this fails: + // + // fn foo<'a, A>(x: &'a A) { x.bar() } + // + // The problem is that the type of `x` is `&'a A`. To be + // well-formed, then, A must be lower-generic by `'a`, but we + // don't know that this holds from first principles. + let from_region_bound_pairs = self.region_bound_pairs.iter().filter_map(|&(r, p)| { + debug!( + "declared_generic_bounds_from_env_with_compare_fn: region_bound_pair = {:?}", + (r, p) + ); + let p_ty = p.to_ty(tcx); + if compare_ty(p_ty) { + Some(ty::OutlivesPredicate(p_ty, r)) + } else { + None + } + }); + + param_bounds + .chain(from_region_bound_pairs) + .inspect(|bound| { + debug!( + "declared_generic_bounds_from_env_with_compare_fn: result predicate = {:?}", + bound + ) + }) + .collect() + } + + /// Given a projection like `>::Bar`, returns any bounds + /// declared in the trait definition. For example, if the trait were + /// + /// ```rust + /// trait Foo<'a> { + /// type Bar: 'a; + /// } + /// ``` + /// + /// then this function would return `'x`. This is subject to the + /// limitations around higher-ranked bounds described in + /// `region_bounds_declared_on_associated_item`. + fn declared_projection_bounds_from_trait( + &self, + projection_ty: ty::ProjectionTy<'tcx>, + ) -> impl Iterator> + 'cx + Captures<'gcx> { + debug!("projection_bounds(projection_ty={:?})", projection_ty); + let tcx = self.tcx; + self.region_bounds_declared_on_associated_item(projection_ty.item_def_id) + .map(move |r| r.subst(tcx, projection_ty.substs)) + } + + /// Given the def-id of an associated item, returns any region + /// bounds attached to that associated item from the trait definition. + /// + /// For example: + /// + /// ```rust + /// trait Foo<'a> { + /// type Bar: 'a; + /// } + /// ``` + /// + /// If we were given the def-id of `Foo::Bar`, we would return + /// `'a`. You could then apply the substitutions from the + /// projection to convert this into your namespace. This also + /// works if the user writes `where >::Bar: 'a` on + /// the trait. In fact, it works by searching for just such a + /// where-clause. + /// + /// It will not, however, work for higher-ranked bounds like: + /// + /// ```rust + /// trait Foo<'a, 'b> + /// where for<'x> >::Bar: 'x + /// { + /// type Bar; + /// } + /// ``` + /// + /// This is for simplicity, and because we are not really smart + /// enough to cope with such bounds anywhere. + fn region_bounds_declared_on_associated_item( + &self, + assoc_item_def_id: DefId, + ) -> impl Iterator> + 'cx + Captures<'gcx> { + let tcx = self.tcx; + let assoc_item = tcx.associated_item(assoc_item_def_id); + let trait_def_id = assoc_item.container.assert_trait(); + let trait_predicates = tcx.predicates_of(trait_def_id).predicates + .into_iter() + .map(|(p, _)| p) + .collect(); + let identity_substs = Substs::identity_for_item(tcx, assoc_item_def_id); + let identity_proj = tcx.mk_projection(assoc_item_def_id, identity_substs); + self.collect_outlives_from_predicate_list( + move |ty| ty == identity_proj, + traits::elaborate_predicates(tcx, trait_predicates), + ).map(|b| b.1) + } + + /// Searches through a predicate list for a predicate `T: 'a`. + /// + /// Careful: does not elaborate predicates, and just uses `==` + /// when comparing `ty` for equality, so `ty` must be something + /// that does not involve inference variables and where you + /// otherwise want a precise match. + fn collect_outlives_from_predicate_list( + &self, + compare_ty: impl Fn(Ty<'tcx>) -> bool, + predicates: impl IntoIterator>>, + ) -> impl Iterator, ty::Region<'tcx>>> { + predicates + .into_iter() + .filter_map(|p| p.as_ref().to_opt_type_outlives()) + .filter_map(|p| p.no_late_bound_regions()) + .filter(move |p| compare_ty(p.0)) + } +} diff --git a/src/librustc/infer/region_constraints/mod.rs b/src/librustc/infer/region_constraints/mod.rs index d8f3b9a05bd4..bc9027a08258 100644 --- a/src/librustc/infer/region_constraints/mod.rs +++ b/src/librustc/infer/region_constraints/mod.rs @@ -155,29 +155,94 @@ pub enum GenericKind<'tcx> { Projection(ty::ProjectionTy<'tcx>), } -/// When we introduce a verification step, we wish to test that a -/// particular region (let's call it `'min`) meets some bound. -/// The bound is described the by the following grammar: +EnumTypeFoldableImpl! { + impl<'tcx> TypeFoldable<'tcx> for GenericKind<'tcx> { + (GenericKind::Param)(a), + (GenericKind::Projection)(a), + } +} + +/// Describes the things that some `GenericKind` value G is known to +/// outlive. Each variant of `VerifyBound` can be thought of as a +/// function: +/// +/// fn(min: Region) -> bool { .. } +/// +/// where `true` means that the region `min` meets that `G: min`. +/// (False means nothing.) +/// +/// So, for example, if we have the type `T` and we have in scope that +/// `T: 'a` and `T: 'b`, then the verify bound might be: +/// +/// fn(min: Region) -> bool { +/// ('a: min) || ('b: min) +/// } +/// +/// This is described with a `AnyRegion('a, 'b)` node. #[derive(Debug, Clone)] pub enum VerifyBound<'tcx> { - /// B = exists {R} --> some 'r in {R} must outlive 'min + /// Given a kind K and a bound B, expands to a function like the + /// following, where `G` is the generic for which this verify + /// bound was created: /// - /// Put another way, the subject value is known to outlive all - /// regions in {R}, so if any of those outlives 'min, then the - /// bound is met. - AnyRegion(Vec>), - - /// B = forall {R} --> all 'r in {R} must outlive 'min + /// fn(min) -> bool { + /// if G == K { + /// B(min) + /// } else { + /// false + /// } + /// } /// - /// Put another way, the subject value is known to outlive some - /// region in {R}, so if all of those outlives 'min, then the bound - /// is met. - AllRegions(Vec>), + /// In other words, if the generic `G` that we are checking is + /// equal to `K`, then check the associated verify bound + /// (otherwise, false). + /// + /// This is used when we have something in the environment that + /// may or may not be relevant, depending on the region inference + /// results. For example, we may have `where >::Item: 'b` in our where clauses. If we are + /// generating the verify-bound for `>::Item`, then + /// this where-clause is only relevant if `'0` winds up inferred + /// to `'a`. + /// + /// So we would compile to a verify-bound like + /// + /// IfEq(>::Item, AnyRegion('a)) + /// + /// meaning, if the subject G is equal to `>::Item` + /// (after inference), and `'a: min`, then `G: min`. + IfEq(Ty<'tcx>, Box>), - /// B = exists {B} --> 'min must meet some bound b in {B} + /// Given a region `R`, expands to the function: + /// + /// fn(min) -> bool { + /// R: min + /// } + /// + /// This is used when we can establish that `G: R` -- therefore, + /// if `R: min`, then by transitivity `G: min`. + OutlivedBy(Region<'tcx>), + + /// Given a set of bounds `B`, expands to the function: + /// + /// fn(min) -> bool { + /// exists (b in B) { b(min) } + /// } + /// + /// In other words, if we meet some bound in `B`, that suffices. + /// This is used when all the bounds in `B` are known to apply to + /// G. AnyBound(Vec>), - /// B = forall {B} --> 'min must meet all bounds b in {B} + /// Given a set of bounds `B`, expands to the function: + /// + /// fn(min) -> bool { + /// forall (b in B) { b(min) } + /// } + /// + /// In other words, if we meet *all* bounds in `B`, that suffices. + /// This is used when *some* bound in `B` is known to suffice, but + /// we don't know which. AllBounds(Vec>), } @@ -882,33 +947,23 @@ impl<'a, 'gcx, 'tcx> GenericKind<'tcx> { } impl<'a, 'gcx, 'tcx> VerifyBound<'tcx> { - fn for_each_region(&self, f: &mut dyn FnMut(ty::Region<'tcx>)) { - match self { - &VerifyBound::AnyRegion(ref rs) | &VerifyBound::AllRegions(ref rs) => for &r in rs { - f(r); - }, - - &VerifyBound::AnyBound(ref bs) | &VerifyBound::AllBounds(ref bs) => for b in bs { - b.for_each_region(f); - }, - } - } - pub fn must_hold(&self) -> bool { match self { - &VerifyBound::AnyRegion(ref bs) => bs.contains(&&ty::ReStatic), - &VerifyBound::AllRegions(ref bs) => bs.is_empty(), - &VerifyBound::AnyBound(ref bs) => bs.iter().any(|b| b.must_hold()), - &VerifyBound::AllBounds(ref bs) => bs.iter().all(|b| b.must_hold()), + VerifyBound::IfEq(..) => false, + VerifyBound::OutlivedBy(ty::ReStatic) => true, + VerifyBound::OutlivedBy(_) => false, + VerifyBound::AnyBound(bs) => bs.iter().any(|b| b.must_hold()), + VerifyBound::AllBounds(bs) => bs.iter().all(|b| b.must_hold()), } } pub fn cannot_hold(&self) -> bool { match self { - &VerifyBound::AnyRegion(ref bs) => bs.is_empty(), - &VerifyBound::AllRegions(ref bs) => bs.contains(&&ty::ReEmpty), - &VerifyBound::AnyBound(ref bs) => bs.iter().all(|b| b.cannot_hold()), - &VerifyBound::AllBounds(ref bs) => bs.iter().any(|b| b.cannot_hold()), + VerifyBound::IfEq(_, b) => b.cannot_hold(), + VerifyBound::OutlivedBy(ty::ReEmpty) => true, + VerifyBound::OutlivedBy(_) => false, + VerifyBound::AnyBound(bs) => bs.iter().all(|b| b.cannot_hold()), + VerifyBound::AllBounds(bs) => bs.iter().any(|b| b.cannot_hold()), } } diff --git a/src/librustc/infer/region_constraints/taint.rs b/src/librustc/infer/region_constraints/taint.rs index ee45f7bd8280..4f513cd5d484 100644 --- a/src/librustc/infer/region_constraints/taint.rs +++ b/src/librustc/infer/region_constraints/taint.rs @@ -13,34 +13,39 @@ use super::*; #[derive(Debug)] pub(super) struct TaintSet<'tcx> { directions: TaintDirections, - regions: FxHashSet> + regions: FxHashSet>, } impl<'tcx> TaintSet<'tcx> { - pub(super) fn new(directions: TaintDirections, - initial_region: ty::Region<'tcx>) - -> Self { + pub(super) fn new(directions: TaintDirections, initial_region: ty::Region<'tcx>) -> Self { let mut regions = FxHashSet(); regions.insert(initial_region); - TaintSet { directions: directions, regions: regions } + TaintSet { + directions: directions, + regions: regions, + } } - pub(super) fn fixed_point(&mut self, - tcx: TyCtxt<'_, '_, 'tcx>, - undo_log: &[UndoLogEntry<'tcx>], - verifys: &[Verify<'tcx>]) { + pub(super) fn fixed_point( + &mut self, + tcx: TyCtxt<'_, '_, 'tcx>, + undo_log: &[UndoLogEntry<'tcx>], + verifys: &[Verify<'tcx>], + ) { let mut prev_len = 0; while prev_len < self.len() { - debug!("tainted: prev_len = {:?} new_len = {:?}", - prev_len, self.len()); + debug!( + "tainted: prev_len = {:?} new_len = {:?}", + prev_len, + self.len() + ); prev_len = self.len(); for undo_entry in undo_log { match undo_entry { &AddConstraint(Constraint::VarSubVar(a, b)) => { - self.add_edge(tcx.mk_region(ReVar(a)), - tcx.mk_region(ReVar(b))); + self.add_edge(tcx.mk_region(ReVar(a)), tcx.mk_region(ReVar(b))); } &AddConstraint(Constraint::RegSubVar(a, b)) => { self.add_edge(a, tcx.mk_region(ReVar(b))); @@ -55,15 +60,13 @@ impl<'tcx> TaintSet<'tcx> { self.add_edge(a, tcx.mk_region(ReVar(b))); } &AddVerify(i) => { - verifys[i].bound.for_each_region(&mut |b| { - self.add_edge(verifys[i].region, b); - }); + span_bug!( + verifys[i].origin.span(), + "we never add verifications while doing higher-ranked things", + ) } - &Purged | - &AddCombination(..) | - &AddVar(..) | - &OpenSnapshot | - &CommitedSnapshot => {} + &Purged | &AddCombination(..) | &AddVar(..) | &OpenSnapshot + | &CommitedSnapshot => {} } } } @@ -77,9 +80,7 @@ impl<'tcx> TaintSet<'tcx> { self.regions.len() } - fn add_edge(&mut self, - source: ty::Region<'tcx>, - target: ty::Region<'tcx>) { + fn add_edge(&mut self, source: ty::Region<'tcx>, target: ty::Region<'tcx>) { if self.directions.incoming { if self.regions.contains(&target) { self.regions.insert(source); @@ -93,4 +94,3 @@ impl<'tcx> TaintSet<'tcx> { } } } - diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index e6452ad09278..38ec414fda9e 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -338,6 +338,12 @@ declare_lint! { cannot be referred to by absolute paths" } +declare_lint! { + pub EXPLICIT_OUTLIVES_REQUIREMENTS, + Allow, + "outlives requirements can be inferred" +} + /// Some lints that are buffered from `libsyntax`. See `syntax::early_buffered_lints`. pub mod parser { declare_lint! { diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index f856475c3376..8fea749e5ab4 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -1631,7 +1631,7 @@ impl<'tcx> Statement<'tcx> { #[derive(Clone, Debug, RustcEncodable, RustcDecodable)] pub enum StatementKind<'tcx> { /// Write the RHS Rvalue to the LHS Place. - Assign(Place<'tcx>, Rvalue<'tcx>), + Assign(Place<'tcx>, Box>), /// This represents all the reading that a pattern match may do /// (e.g. inspecting constants and discriminant values), and the @@ -1654,8 +1654,8 @@ pub enum StatementKind<'tcx> { /// Execute a piece of inline Assembly. InlineAsm { asm: Box, - outputs: Vec>, - inputs: Vec>, + outputs: Box<[Place<'tcx>]>, + inputs: Box<[Operand<'tcx>]>, }, /// Assert the given places to be valid inhabitants of their type. These statements are diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 8fa15d48a5dc..eb779e6382f4 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1385,6 +1385,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "run the self profiler"), profile_json: bool = (false, parse_bool, [UNTRACKED], "output a json file with profiler results"), + emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED], + "emits a section containing stack size metadata"), } pub fn default_lib_output() -> CrateType { diff --git a/src/librustc/traits/auto_trait.rs b/src/librustc/traits/auto_trait.rs index 4bed3c5935cd..8f106a081253 100644 --- a/src/librustc/traits/auto_trait.rs +++ b/src/librustc/traits/auto_trait.rs @@ -16,10 +16,9 @@ use super::*; use std::collections::hash_map::Entry; use std::collections::VecDeque; -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; - use infer::region_constraints::{Constraint, RegionConstraintData}; -use infer::{InferCtxt, RegionObligation}; +use infer::InferCtxt; +use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use ty::fold::TypeFolder; use ty::{Region, RegionVid}; @@ -227,20 +226,18 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { .iter() .filter_map(|param| match param.kind { ty::GenericParamDefKind::Lifetime => Some(param.name.to_string()), - _ => None + _ => None, }) .collect(); - let body_ids: FxHashSet<_> = infcx + let body_id_map: FxHashMap<_, _> = infcx .region_obligations .borrow() .iter() - .map(|&(id, _)| id) + .map(|&(id, _)| (id, vec![])) .collect(); - for id in body_ids { - infcx.process_registered_region_obligations(&[], None, full_env.clone(), id); - } + infcx.process_registered_region_obligations(&body_id_map, None, full_env.clone()); let region_data = infcx .borrow_region_constraints() @@ -359,8 +356,10 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { &Err(SelectionError::Unimplemented) => { if self.is_of_param(pred.skip_binder().trait_ref.substs) { already_visited.remove(&pred); - self.add_user_pred(&mut user_computed_preds, - ty::Predicate::Trait(pred.clone())); + self.add_user_pred( + &mut user_computed_preds, + ty::Predicate::Trait(pred.clone()), + ); predicates.push_back(pred); } else { debug!( @@ -418,8 +417,11 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { // under which a type implements an auto trait. A trait predicate involving // a HRTB means that the type needs to work with any choice of lifetime, // not just one specific lifetime (e.g. 'static). - fn add_user_pred<'c>(&self, user_computed_preds: &mut FxHashSet>, - new_pred: ty::Predicate<'c>) { + fn add_user_pred<'c>( + &self, + user_computed_preds: &mut FxHashSet>, + new_pred: ty::Predicate<'c>, + ) { let mut should_add_new = true; user_computed_preds.retain(|&old_pred| { match (&new_pred, old_pred) { @@ -431,20 +433,19 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { if !new_substs.types().eq(old_substs.types()) { // We can't compare lifetimes if the types are different, // so skip checking old_pred - return true + return true; } - for (new_region, old_region) in new_substs - .regions() - .zip(old_substs.regions()) { - + for (new_region, old_region) in + new_substs.regions().zip(old_substs.regions()) + { match (new_region, old_region) { // If both predicates have an 'ReLateBound' (a HRTB) in the // same spot, we do nothing ( ty::RegionKind::ReLateBound(_, _), - ty::RegionKind::ReLateBound(_, _) - ) => {}, + ty::RegionKind::ReLateBound(_, _), + ) => {} (ty::RegionKind::ReLateBound(_, _), _) => { // The new predicate has a HRTB in a spot where the old @@ -458,7 +459,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { // so we return 'false' to remove the old predicate from // user_computed_preds return false; - }, + } (_, ty::RegionKind::ReLateBound(_, _)) => { // This is the opposite situation as the previous arm - the // old predicate has a HRTB lifetime in a place where the @@ -471,10 +472,10 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { } } } - }, + } _ => {} } - return true + return true; }); if should_add_new { @@ -513,28 +514,20 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { match constraint { &Constraint::VarSubVar(r1, r2) => { { - let deps1 = vid_map - .entry(RegionTarget::RegionVid(r1)) - .or_default(); + let deps1 = vid_map.entry(RegionTarget::RegionVid(r1)).or_default(); deps1.larger.insert(RegionTarget::RegionVid(r2)); } - let deps2 = vid_map - .entry(RegionTarget::RegionVid(r2)) - .or_default(); + let deps2 = vid_map.entry(RegionTarget::RegionVid(r2)).or_default(); deps2.smaller.insert(RegionTarget::RegionVid(r1)); } &Constraint::RegSubVar(region, vid) => { { - let deps1 = vid_map - .entry(RegionTarget::Region(region)) - .or_default(); + let deps1 = vid_map.entry(RegionTarget::Region(region)).or_default(); deps1.larger.insert(RegionTarget::RegionVid(vid)); } - let deps2 = vid_map - .entry(RegionTarget::RegionVid(vid)) - .or_default(); + let deps2 = vid_map.entry(RegionTarget::RegionVid(vid)).or_default(); deps2.smaller.insert(RegionTarget::Region(region)); } &Constraint::VarSubReg(vid, region) => { @@ -542,15 +535,11 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { } &Constraint::RegSubReg(r1, r2) => { { - let deps1 = vid_map - .entry(RegionTarget::Region(r1)) - .or_default(); + let deps1 = vid_map.entry(RegionTarget::Region(r1)).or_default(); deps1.larger.insert(RegionTarget::Region(r2)); } - let deps2 = vid_map - .entry(RegionTarget::Region(r2)) - .or_default(); + let deps2 = vid_map.entry(RegionTarget::Region(r2)).or_default(); deps2.smaller.insert(RegionTarget::Region(r1)); } } @@ -683,7 +672,11 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { } } &ty::Predicate::RegionOutlives(ref binder) => { - if select.infcx().region_outlives_predicate(&dummy_cause, binder).is_err() { + if select + .infcx() + .region_outlives_predicate(&dummy_cause, binder) + .is_err() + { return false; } } @@ -693,23 +686,17 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { binder.map_bound_ref(|pred| pred.0).no_late_bound_regions(), ) { (None, Some(t_a)) => { - select.infcx().register_region_obligation( - ast::DUMMY_NODE_ID, - RegionObligation { - sup_type: t_a, - sub_region: select.infcx().tcx.types.re_static, - cause: dummy_cause.clone(), - }, + select.infcx().register_region_obligation_with_cause( + t_a, + select.infcx().tcx.types.re_static, + &dummy_cause, ); } (Some(ty::OutlivesPredicate(t_a, r_b)), _) => { - select.infcx().register_region_obligation( - ast::DUMMY_NODE_ID, - RegionObligation { - sup_type: t_a, - sub_region: r_b, - cause: dummy_cause.clone(), - }, + select.infcx().register_region_obligation_with_cause( + t_a, + r_b, + &dummy_cause, ); } _ => {} diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs index 251743b0d3bb..9e9cdc69441c 100644 --- a/src/librustc/traits/coherence.rs +++ b/src/librustc/traits/coherence.rs @@ -96,10 +96,10 @@ fn with_fresh_ty_vars<'cx, 'gcx, 'tcx>(selcx: &mut SelectionContext<'cx, 'gcx, ' let header = ty::ImplHeader { impl_def_id, - self_ty: tcx.type_of(impl_def_id), - trait_ref: tcx.impl_trait_ref(impl_def_id), - predicates: tcx.predicates_of(impl_def_id).predicates - }.subst(tcx, impl_substs); + self_ty: tcx.type_of(impl_def_id).subst(tcx, impl_substs), + trait_ref: tcx.impl_trait_ref(impl_def_id).subst(tcx, impl_substs), + predicates: tcx.predicates_of(impl_def_id).instantiate(tcx, impl_substs).predicates, + }; let Normalized { value: mut header, obligations } = traits::normalize(selcx, param_env, ObligationCause::dummy(), &header); diff --git a/src/librustc/traits/fulfill.rs b/src/librustc/traits/fulfill.rs index 707af02acbf4..19ee2c1aabfa 100644 --- a/src/librustc/traits/fulfill.rs +++ b/src/librustc/traits/fulfill.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use infer::{RegionObligation, InferCtxt}; +use infer::InferCtxt; use mir::interpret::GlobalId; use ty::{self, Ty, TypeFoldable, ToPolyTraitRef, ToPredicate}; use ty::error::ExpectedFound; @@ -372,13 +372,11 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx, Some(t_a) => { let r_static = self.selcx.tcx().types.re_static; if self.register_region_obligations { - self.selcx.infcx().register_region_obligation( - obligation.cause.body_id, - RegionObligation { - sup_type: t_a, - sub_region: r_static, - cause: obligation.cause.clone(), - }); + self.selcx.infcx().register_region_obligation_with_cause( + t_a, + r_static, + &obligation.cause, + ); } ProcessResult::Changed(vec![]) } @@ -387,13 +385,11 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx, // If there aren't, register the obligation. Some(ty::OutlivesPredicate(t_a, r_b)) => { if self.register_region_obligations { - self.selcx.infcx().register_region_obligation( - obligation.cause.body_id, - RegionObligation { - sup_type: t_a, - sub_region: r_b, - cause: obligation.cause.clone() - }); + self.selcx.infcx().register_region_obligation_with_cause( + t_a, + r_b, + &obligation.cause, + ); } ProcessResult::Changed(vec![]) } diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index edf7772f2f78..6b1092814a40 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -20,6 +20,7 @@ pub use self::ObligationCauseCode::*; use chalk_engine; use hir; use hir::def_id::DefId; +use infer::SuppressRegionErrors; use infer::outlives::env::OutlivesEnvironment; use middle::region; use mir::interpret::ConstEvalErr; @@ -715,7 +716,12 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // cares about declarations like `'a: 'b`. let outlives_env = OutlivesEnvironment::new(elaborated_env); - infcx.resolve_regions_and_report_errors(region_context, ®ion_scope_tree, &outlives_env); + infcx.resolve_regions_and_report_errors( + region_context, + ®ion_scope_tree, + &outlives_env, + SuppressRegionErrors::default(), + ); let predicates = match infcx.fully_resolve(&predicates) { Ok(predicates) => predicates, @@ -810,11 +816,10 @@ fn substitute_normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx key: (DefId, &'tcx Substs<'tcx>)) -> bool { - use ty::subst::Subst; debug!("substitute_normalize_and_test_predicates(key={:?})", key); - let predicates = tcx.predicates_of(key.0).predicates.subst(tcx, key.1); + let predicates = tcx.predicates_of(key.0).instantiate(tcx, key.1).predicates; let result = normalize_and_test_predicates(tcx, predicates); debug!("substitute_normalize_and_test_predicates(key={:?}) = {:?}", diff --git a/src/librustc/traits/object_safety.rs b/src/librustc/traits/object_safety.rs index 0046a23a085e..d5942e738fdd 100644 --- a/src/librustc/traits/object_safety.rs +++ b/src/librustc/traits/object_safety.rs @@ -179,7 +179,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { predicates .predicates .into_iter() - .map(|predicate| predicate.subst_supertrait(self, &trait_ref)) + .map(|(predicate, _)| predicate.subst_supertrait(self, &trait_ref)) .any(|predicate| { match predicate { ty::Predicate::Trait(ref data) => { @@ -311,7 +311,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { if self.predicates_of(method.def_id).predicates.into_iter() // A trait object can't claim to live more than the concrete type, // so outlives predicates will always hold. - .filter(|p| p.to_opt_type_outlives().is_none()) + .filter(|(p, _)| p.to_opt_type_outlives().is_none()) .collect::>() // Do a shallow visit so that `contains_illegal_self_type_reference` // may apply it's custom visiting. diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index abeec93c0410..ab71d13ab068 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -3401,7 +3401,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { // that order. let predicates = tcx.predicates_of(def_id); assert_eq!(predicates.parent, None); - let mut predicates: Vec<_> = predicates.predicates.iter().flat_map(|predicate| { + let mut predicates: Vec<_> = predicates.predicates.iter().flat_map(|(predicate, _)| { let predicate = normalize_with_depth(self, param_env, cause.clone(), recursion_depth, &predicate.subst(tcx, substs)); predicate.obligations.into_iter().chain( diff --git a/src/librustc/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs index dbd84397b597..bd6c2982065e 100644 --- a/src/librustc/traits/specialize/mod.rs +++ b/src/librustc/traits/specialize/mod.rs @@ -428,7 +428,7 @@ fn to_pretty_impl_header(tcx: TyCtxt, impl_def_id: DefId) -> Option { let mut pretty_predicates = Vec::with_capacity( predicates.len() + types_without_default_bounds.len()); - for p in predicates { + for (p, _) in predicates { if let Some(poly_trait_ref) = p.to_opt_poly_trait_ref() { if Some(poly_trait_ref.def_id()) == sized_trait { types_without_default_bounds.remove(poly_trait_ref.self_ty()); diff --git a/src/librustc/traits/util.rs b/src/librustc/traits/util.rs index 2ca8214daf76..7c273fb14db5 100644 --- a/src/librustc/traits/util.rs +++ b/src/librustc/traits/util.rs @@ -137,7 +137,7 @@ impl<'cx, 'gcx, 'tcx> Elaborator<'cx, 'gcx, 'tcx> { let mut predicates: Vec<_> = predicates.predicates .iter() - .map(|p| p.subst_supertrait(tcx, &data.to_poly_trait_ref())) + .map(|(p, _)| p.subst_supertrait(tcx, &data.to_poly_trait_ref())) .collect(); debug!("super_predicates: data={:?} predicates={:?}", @@ -311,7 +311,7 @@ impl<'cx, 'gcx, 'tcx> Iterator for SupertraitDefIds<'cx, 'gcx, 'tcx> { self.stack.extend( predicates.predicates .iter() - .filter_map(|p| p.to_opt_poly_trait_ref()) + .filter_map(|(p, _)| p.to_opt_poly_trait_ref()) .map(|t| t.def_id()) .filter(|&super_def_id| visited.insert(super_def_id))); Some(def_id) diff --git a/src/librustc/ty/codec.rs b/src/librustc/ty/codec.rs index cc3e8a458a01..45280402e489 100644 --- a/src/librustc/ty/codec.rs +++ b/src/librustc/ty/codec.rs @@ -109,8 +109,9 @@ pub fn encode_predicates<'tcx, E, C>(encoder: &mut E, { predicates.parent.encode(encoder)?; predicates.predicates.len().encode(encoder)?; - for predicate in &predicates.predicates { - encode_with_shorthand(encoder, predicate, &cache)? + for (predicate, span) in &predicates.predicates { + encode_with_shorthand(encoder, predicate, &cache)?; + span.encode(encoder)?; } Ok(()) } @@ -178,7 +179,7 @@ pub fn decode_predicates<'a, 'tcx, D>(decoder: &mut D) parent: Decodable::decode(decoder)?, predicates: (0..decoder.read_usize()?).map(|_| { // Handle shorthands first, if we have an usize > 0x80. - if decoder.positioned_at_shorthand() { + let predicate = if decoder.positioned_at_shorthand() { let pos = decoder.read_usize()?; assert!(pos >= SHORTHAND_OFFSET); let shorthand = pos - SHORTHAND_OFFSET; @@ -186,7 +187,8 @@ pub fn decode_predicates<'a, 'tcx, D>(decoder: &mut D) decoder.with_position(shorthand, ty::Predicate::decode) } else { ty::Predicate::decode(decoder) - } + }?; + Ok((predicate, Decodable::decode(decoder)?)) }) .collect::, _>>()?, }) diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index 3d2088ea12e8..4e37a34a0c8a 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -449,7 +449,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> { } } - if sized && fields.iter().any(|f| f.abi.is_uninhabited()) { + if sized && fields.iter().any(|f| f.abi == Abi::Uninhabited) { abi = Abi::Uninhabited; } @@ -724,7 +724,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> { // See issue #49298 for more details on the need to leave space // for non-ZST uninhabited data (mostly partial initialization). let absent = |fields: &[TyLayout]| { - let uninhabited = fields.iter().any(|f| f.abi.is_uninhabited()); + let uninhabited = fields.iter().any(|f| f.abi == Abi::Uninhabited); let is_zst = fields.iter().all(|f| f.is_zst()); uninhabited && is_zst }; @@ -872,7 +872,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> { _ => Abi::Aggregate { sized: true }, }; - if st.iter().all(|v| v.abi.is_uninhabited()) { + if st.iter().all(|v| v.abi == Abi::Uninhabited) { abi = Abi::Uninhabited; } @@ -900,7 +900,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> { let discr_type = def.repr.discr_type(); let bits = Integer::from_attr(tcx, discr_type).size().bits(); for (i, discr) in def.discriminants(tcx).enumerate() { - if variants[i].iter().any(|f| f.abi.is_uninhabited()) { + if variants[i].iter().any(|f| f.abi == Abi::Uninhabited) { continue; } let mut x = discr.val as i128; @@ -1096,7 +1096,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> { } } - if layout_variants.iter().all(|v| v.abi.is_uninhabited()) { + if layout_variants.iter().all(|v| v.abi == Abi::Uninhabited) { abi = Abi::Uninhabited; } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 1f8fb921e0c3..df9335e909bc 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -982,7 +982,7 @@ impl<'a, 'gcx, 'tcx> Generics { #[derive(Clone, Default)] pub struct GenericPredicates<'tcx> { pub parent: Option, - pub predicates: Vec>, + pub predicates: Vec<(Predicate<'tcx>, Span)>, } impl<'tcx> serialize::UseSpecializedEncodable for GenericPredicates<'tcx> {} @@ -998,7 +998,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> { pub fn instantiate_own(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, substs: &Substs<'tcx>) -> InstantiatedPredicates<'tcx> { InstantiatedPredicates { - predicates: self.predicates.subst(tcx, substs) + predicates: self.predicates.iter().map(|(p, _)| p.subst(tcx, substs)).collect(), } } @@ -1008,7 +1008,9 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> { if let Some(def_id) = self.parent { tcx.predicates_of(def_id).instantiate_into(tcx, instantiated, substs); } - instantiated.predicates.extend(self.predicates.iter().map(|p| p.subst(tcx, substs))) + instantiated.predicates.extend( + self.predicates.iter().map(|(p, _)| p.subst(tcx, substs)), + ); } pub fn instantiate_identity(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) @@ -1023,7 +1025,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> { if let Some(def_id) = self.parent { tcx.predicates_of(def_id).instantiate_identity_into(tcx, instantiated); } - instantiated.predicates.extend(&self.predicates) + instantiated.predicates.extend(self.predicates.iter().map(|&(p, _)| p)) } pub fn instantiate_supertrait(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, @@ -1032,7 +1034,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> { { assert_eq!(self.parent, None); InstantiatedPredicates { - predicates: self.predicates.iter().map(|pred| { + predicates: self.predicates.iter().map(|(pred, _)| { pred.subst_supertrait(tcx, poly_trait_ref) }).collect() } @@ -2351,7 +2353,7 @@ impl<'a, 'gcx, 'tcx> AdtDef { substs: tcx.mk_substs_trait(ty, &[]) }).to_predicate(); let predicates = tcx.predicates_of(self.did).predicates; - if predicates.into_iter().any(|p| p == sized_predicate) { + if predicates.into_iter().any(|(p, _)| p == sized_predicate) { vec![] } else { vec![ty] diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 0e4d2f1f6473..296602e21bad 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -606,6 +606,7 @@ impl<'a, 'tcx, 'x> SpecializedDecoder for CacheDecoder<'a, ' alloc_decoding_session.decode_alloc_id(self) } } + impl<'a, 'tcx, 'x> SpecializedDecoder for CacheDecoder<'a, 'tcx, 'x> { fn specialized_decode(&mut self) -> Result { let tag: u8 = Decodable::decode(self)?; diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index bd9dfc6b8551..aab268c07c4f 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -720,6 +720,16 @@ impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Vec { } } +impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Box<[T]> { + fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { + self.iter().map(|t| t.fold_with(folder)).collect::>().into_boxed_slice() + } + + fn super_visit_with>(&self, visitor: &mut V) -> bool { + self.iter().any(|t| t.visit_with(visitor)) + } +} + impl<'tcx, T:TypeFoldable<'tcx>> TypeFoldable<'tcx> for ty::Binder { fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { self.map_bound_ref(|ty| ty.fold_with(folder)) diff --git a/src/librustc_codegen_llvm/asm.rs b/src/librustc_codegen_llvm/asm.rs index 5d27f8eab3ec..f1bb41bcebac 100644 --- a/src/librustc_codegen_llvm/asm.rs +++ b/src/librustc_codegen_llvm/asm.rs @@ -30,7 +30,7 @@ pub fn codegen_inline_asm( ia: &hir::InlineAsm, outputs: Vec>, mut inputs: Vec<&'ll Value> -) { +) -> bool { let mut ext_constraints = vec![]; let mut output_types = vec![]; @@ -97,6 +97,10 @@ pub fn codegen_inline_asm( ia.alignstack, dialect ); + if r.is_none() { + return false; + } + let r = r.unwrap(); // Again, based on how many outputs we have let outputs = ia.outputs.iter().zip(&outputs).filter(|&(ref o, _)| !o.is_indirect); @@ -117,6 +121,8 @@ pub fn codegen_inline_asm( llvm::LLVMSetMetadata(r, kind, llvm::LLVMMDNodeInContext(bx.cx.llcx, &val, 1)); } + + return true; } pub fn codegen_global_asm<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs index 8248385c1276..ce52fe00b0eb 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -47,7 +47,8 @@ use std::str; use syntax::attr; pub use rustc_codegen_utils::link::{find_crate_name, filename_for_input, default_output_for_target, - invalid_output_for_target, out_filename, check_file_is_writeable}; + invalid_output_for_target, out_filename, check_file_is_writeable, + filename_for_metadata}; // The third parameter is for env vars, used on windows to set up the // path for MSVC to find its DLLs, and gcc to find its bundled @@ -218,15 +219,6 @@ fn preserve_objects_for_their_debuginfo(sess: &Session) -> bool { false } -fn filename_for_metadata(sess: &Session, crate_name: &str, outputs: &OutputFilenames) -> PathBuf { - let out_filename = outputs.single_output_file.clone() - .unwrap_or(outputs - .out_directory - .join(&format!("lib{}{}.rmeta", crate_name, sess.opts.cg.extra_filename))); - check_file_is_writeable(&out_filename, sess); - out_filename -} - pub(crate) fn each_linked_rlib(sess: &Session, info: &CrateInfo, f: &mut dyn FnMut(CrateNum, &Path)) -> Result<(), String> { diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 447b505e79c6..02ef690b9423 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -196,6 +196,7 @@ pub fn target_machine_factory(sess: &Session, find_features: bool) let features = CString::new(features).unwrap(); let is_pie_binary = !find_features && is_pie_binary(sess); let trap_unreachable = sess.target.target.options.trap_unreachable; + let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes; let asm_comments = sess.asm_comments(); @@ -213,6 +214,7 @@ pub fn target_machine_factory(sess: &Session, find_features: bool) trap_unreachable, singlethread, asm_comments, + emit_stack_size_section, ) }; diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index e3526a5a2eea..77de88997e49 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -737,7 +737,7 @@ impl Builder<'a, 'll, 'tcx> { pub fn inline_asm_call(&self, asm: *const c_char, cons: *const c_char, inputs: &[&'ll Value], output: &'ll Type, volatile: bool, alignstack: bool, - dia: AsmDialect) -> &'ll Value { + dia: AsmDialect) -> Option<&'ll Value> { self.count_insn("inlineasm"); let volatile = if volatile { llvm::True } @@ -753,9 +753,17 @@ impl Builder<'a, 'll, 'tcx> { debug!("Asm Output Type: {:?}", output); let fty = Type::func(&argtys[..], output); unsafe { - let v = llvm::LLVMRustInlineAsm( - fty, asm, cons, volatile, alignstack, dia); - self.call(v, inputs, None) + // Ask LLVM to verify that the constraints are well-formed. + let constraints_ok = llvm::LLVMRustInlineAsmVerify(fty, cons); + debug!("Constraint verification result: {:?}", constraints_ok); + if constraints_ok == llvm::True { + let v = llvm::LLVMRustInlineAsm( + fty, asm, cons, volatile, alignstack, dia); + Some(self.call(v, inputs, None)) + } else { + // LLVM has detected an issue with our constaints, bail out + None + } } } diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs index 7b0c413e8576..99919a940b40 100644 --- a/src/librustc_codegen_llvm/debuginfo/mod.rs +++ b/src/librustc_codegen_llvm/debuginfo/mod.rs @@ -279,7 +279,7 @@ pub fn create_function_debug_context( } None => {} }; - if cx.layout_of(sig.output()).abi.is_uninhabited() { + if cx.layout_of(sig.output()).abi == ty::layout::Abi::Uninhabited { flags = flags | DIFlags::FlagNoReturn; } diff --git a/src/librustc_codegen_llvm/declare.rs b/src/librustc_codegen_llvm/declare.rs index 7141c9ece89d..5e743ac51bc6 100644 --- a/src/librustc_codegen_llvm/declare.rs +++ b/src/librustc_codegen_llvm/declare.rs @@ -23,7 +23,7 @@ use llvm; use llvm::AttributePlace::Function; use rustc::ty::{self, Ty}; -use rustc::ty::layout::LayoutOf; +use rustc::ty::layout::{self, LayoutOf}; use rustc::session::config::Sanitizer; use rustc_data_structures::small_c_str::SmallCStr; use rustc_target::spec::PanicStrategy; @@ -137,7 +137,7 @@ pub fn declare_fn( let fty = FnType::new(cx, sig, &[]); let llfn = declare_raw_fn(cx, name, fty.llvm_cconv(), fty.llvm_type(cx)); - if cx.layout_of(sig.output()).abi.is_uninhabited() { + if cx.layout_of(sig.output()).abi == layout::Abi::Uninhabited { llvm::Attribute::NoReturn.apply_llfn(Function, llfn); } diff --git a/src/librustc_codegen_llvm/diagnostics.rs b/src/librustc_codegen_llvm/diagnostics.rs index 94776f17c798..242b7a1a119f 100644 --- a/src/librustc_codegen_llvm/diagnostics.rs +++ b/src/librustc_codegen_llvm/diagnostics.rs @@ -47,4 +47,26 @@ unsafe { simd_add(i32x2(0, 0), i32x2(1, 2)); } // ok! ``` "##, +E0668: r##" +Malformed inline assembly rejected by LLVM. + +LLVM checks the validity of the constraints and the assembly string passed to +it. This error implies that LLVM seems something wrong with the inline +assembly call. + +In particular, it can happen if you forgot the closing bracket of a register +constraint (see issue #51430): +```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail) +#![feature(asm)] + +fn main() { + let rax: u64; + unsafe { + asm!("" :"={rax"(rax)); + println!("Accumulator is: {}", rax); + } +} +``` +"##, + } diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index a5f4137c62b1..8485db4210cb 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1208,6 +1208,9 @@ extern "C" { AlignStack: Bool, Dialect: AsmDialect) -> &Value; + pub fn LLVMRustInlineAsmVerify(Ty: &Type, + Constraints: *const c_char) + -> Bool; pub fn LLVMRustDebugMetadataVersion() -> u32; pub fn LLVMRustVersionMajor() -> u32; @@ -1460,7 +1463,8 @@ extern "C" { DataSections: bool, TrapUnreachable: bool, Singlethread: bool, - AsmComments: bool) + AsmComments: bool, + EmitStackSizeSection: bool) -> Option<&'static mut TargetMachine>; pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine); pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module); diff --git a/src/librustc_codegen_llvm/mir/block.rs b/src/librustc_codegen_llvm/mir/block.rs index 709fceb49250..a534b4e478fb 100644 --- a/src/librustc_codegen_llvm/mir/block.rs +++ b/src/librustc_codegen_llvm/mir/block.rs @@ -482,54 +482,6 @@ impl FunctionCx<'a, 'll, 'tcx> { _ => FnType::new(bx.cx, sig, &extra_args) }; - // emit a panic instead of instantiating an uninhabited type - if (intrinsic == Some("init") || intrinsic == Some("uninit")) && - fn_ty.ret.layout.abi.is_uninhabited() - { - let loc = bx.sess().source_map().lookup_char_pos(span.lo()); - let filename = Symbol::intern(&loc.file.name.to_string()).as_str(); - let filename = C_str_slice(bx.cx, filename); - let line = C_u32(bx.cx, loc.line as u32); - let col = C_u32(bx.cx, loc.col.to_usize() as u32 + 1); - let align = tcx.data_layout.aggregate_align - .max(tcx.data_layout.i32_align) - .max(tcx.data_layout.pointer_align); - - let str = format!( - "Attempted to instantiate uninhabited type {} using mem::{}", - sig.output(), - if intrinsic == Some("init") { "zeroed" } else { "uninitialized" } - ); - let msg_str = Symbol::intern(&str).as_str(); - let msg_str = C_str_slice(bx.cx, msg_str); - let msg_file_line_col = C_struct(bx.cx, - &[msg_str, filename, line, col], - false); - let msg_file_line_col = consts::addr_of(bx.cx, - msg_file_line_col, - align, - Some("panic_loc")); - - // Obtain the panic entry point. - let def_id = - common::langcall(bx.tcx(), Some(span), "", lang_items::PanicFnLangItem); - let instance = ty::Instance::mono(bx.tcx(), def_id); - let fn_ty = FnType::of_instance(bx.cx, &instance); - let llfn = callee::get_fn(bx.cx, instance); - - // Codegen the actual panic invoke/call. - do_call( - self, - bx, - fn_ty, - llfn, - &[msg_file_line_col], - destination.as_ref().map(|(_, bb)| (ReturnDest::Nothing, *bb)), - cleanup, - ); - return; - } - // The arguments we'll be passing. Plus one to account for outptr, if used. let arg_count = fn_ty.args.len() + fn_ty.ret.is_indirect() as usize; let mut llargs = Vec::with_capacity(arg_count); diff --git a/src/librustc_codegen_llvm/mir/place.rs b/src/librustc_codegen_llvm/mir/place.rs index bc6ebd360e83..c781b456af6b 100644 --- a/src/librustc_codegen_llvm/mir/place.rs +++ b/src/librustc_codegen_llvm/mir/place.rs @@ -173,10 +173,7 @@ impl PlaceRef<'ll, 'tcx> { let cx = bx.cx; let field = self.layout.field(cx, ix); let offset = self.layout.fields.offset(ix); - let effective_field_align = self.align - .min(self.layout.align) - .min(field.align) - .restrict_for_offset(offset); + let effective_field_align = self.align.restrict_for_offset(offset); let simple = || { // Unions and newtypes only use an offset of 0. @@ -278,7 +275,7 @@ impl PlaceRef<'ll, 'tcx> { /// Obtain the actual discriminant of a value. pub fn codegen_get_discr(self, bx: &Builder<'a, 'll, 'tcx>, cast_to: Ty<'tcx>) -> &'ll Value { let cast_to = bx.cx.layout_of(cast_to).immediate_llvm_type(bx.cx); - if self.layout.abi.is_uninhabited() { + if self.layout.abi == layout::Abi::Uninhabited { return C_undef(cast_to); } match self.layout.variants { @@ -341,7 +338,7 @@ impl PlaceRef<'ll, 'tcx> { /// Set the discriminant for a new value of the given case of the given /// representation. pub fn codegen_set_discr(&self, bx: &Builder<'a, 'll, 'tcx>, variant_index: usize) { - if self.layout.for_variant(bx.cx, variant_index).abi.is_uninhabited() { + if self.layout.for_variant(bx.cx, variant_index).abi == layout::Abi::Uninhabited { return; } match self.layout.variants { diff --git a/src/librustc_codegen_llvm/mir/rvalue.rs b/src/librustc_codegen_llvm/mir/rvalue.rs index fa22bdff94dd..c3ec347f6087 100644 --- a/src/librustc_codegen_llvm/mir/rvalue.rs +++ b/src/librustc_codegen_llvm/mir/rvalue.rs @@ -290,7 +290,7 @@ impl FunctionCx<'a, 'll, 'tcx> { mir::CastKind::Misc => { assert!(cast.is_llvm_immediate()); let ll_t_out = cast.immediate_llvm_type(bx.cx); - if operand.layout.abi.is_uninhabited() { + if operand.layout.abi == layout::Abi::Uninhabited { return (bx, OperandRef { val: OperandValue::Immediate(C_undef(ll_t_out)), layout: cast, diff --git a/src/librustc_codegen_llvm/mir/statement.rs b/src/librustc_codegen_llvm/mir/statement.rs index b4eb7615f98b..6bd41bfe16fe 100644 --- a/src/librustc_codegen_llvm/mir/statement.rs +++ b/src/librustc_codegen_llvm/mir/statement.rs @@ -86,7 +86,11 @@ impl FunctionCx<'a, 'll, 'tcx> { self.codegen_operand(&bx, input).immediate() }).collect(); - asm::codegen_inline_asm(&bx, asm, outputs, input_vals); + let res = asm::codegen_inline_asm(&bx, asm, outputs, input_vals); + if !res { + span_err!(bx.sess(), statement.source_info.span, E0668, + "malformed inline assembly"); + } bx } mir::StatementKind::FakeRead(..) | diff --git a/src/librustc_codegen_utils/link.rs b/src/librustc_codegen_utils/link.rs index 75f1d614ae72..3d47f91a6239 100644 --- a/src/librustc_codegen_utils/link.rs +++ b/src/librustc_codegen_utils/link.rs @@ -97,6 +97,19 @@ pub fn find_crate_name(sess: Option<&Session>, "rust_out".to_string() } +pub fn filename_for_metadata(sess: &Session, + crate_name: &str, + outputs: &OutputFilenames) -> PathBuf { + let libname = format!("{}{}", crate_name, sess.opts.cg.extra_filename); + + let out_filename = outputs.single_output_file.clone() + .unwrap_or(outputs.out_directory.join(&format!("lib{}.rmeta", libname))); + + check_file_is_writeable(&out_filename, sess); + + out_filename +} + pub fn filename_for_input(sess: &Session, crate_type: config::CrateType, crate_name: &str, diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index 2f11fea46d69..a59bf9d530c4 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -535,6 +535,13 @@ impl IndexVec { self.raw.len() } + /// Gives the next index that will be assigned when `push` is + /// called. + #[inline] + pub fn next_index(&self) -> I { + I::new(self.len()) + } + #[inline] pub fn is_empty(&self) -> bool { self.raw.is_empty() diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index f8ca154d168b..27176a821b4a 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -980,6 +980,7 @@ pub fn enable_save_analysis(control: &mut CompileController) { state.expanded_crate.unwrap(), state.analysis.unwrap(), state.crate_name.unwrap(), + state.input, None, DumpHandler::new(state.out_dir, state.crate_name.unwrap())) diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 0a7bd3d97022..f18f40bf7a14 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -14,29 +14,29 @@ use std::path::PathBuf; use std::sync::mpsc; use driver; -use rustc_lint; -use rustc_resolve::MakeGlobMap; -use rustc::middle::region; -use rustc::ty::subst::Subst; -use rustc::traits::ObligationCause; -use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; -use rustc::ty::query::OnDiskCache; -use rustc::infer::{self, InferOk, InferResult}; -use rustc::infer::outlives::env::OutlivesEnvironment; -use rustc::infer::type_variable::TypeVariableOrigin; -use rustc_metadata::cstore::CStore; -use rustc::hir::map as hir_map; -use rustc::session::{self, config}; -use rustc::session::config::{OutputFilenames, OutputTypes}; -use rustc_data_structures::sync::{self, Lrc}; -use syntax; -use syntax::ast; -use rustc_target::spec::abi::Abi; -use syntax::source_map::{SourceMap, FilePathMapping, FileName}; use errors; use errors::emitter::Emitter; -use errors::{Level, DiagnosticBuilder}; +use errors::{DiagnosticBuilder, Level}; +use rustc::hir::map as hir_map; +use rustc::infer::outlives::env::OutlivesEnvironment; +use rustc::infer::type_variable::TypeVariableOrigin; +use rustc::infer::{self, InferOk, InferResult, SuppressRegionErrors}; +use rustc::middle::region; +use rustc::session::config::{OutputFilenames, OutputTypes}; +use rustc::session::{self, config}; +use rustc::traits::ObligationCause; +use rustc::ty::query::OnDiskCache; +use rustc::ty::subst::Subst; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc_data_structures::sync::{self, Lrc}; +use rustc_lint; +use rustc_metadata::cstore::CStore; +use rustc_resolve::MakeGlobMap; +use rustc_target::spec::abi::Abi; +use syntax; +use syntax::ast; use syntax::feature_gate::UnstableFeatures; +use syntax::source_map::{FileName, FilePathMapping, SourceMap}; use syntax::symbol::Symbol; use syntax_pos::DUMMY_SP; @@ -90,13 +90,15 @@ impl Emitter for ExpectErrorEmitter { fn errors(msgs: &[&str]) -> (Box, usize) { let v = msgs.iter().map(|m| m.to_string()).collect(); - (box ExpectErrorEmitter { messages: v } as Box, msgs.len()) + ( + box ExpectErrorEmitter { messages: v } as Box, + msgs.len(), + ) } -fn test_env(source_string: &str, - args: (Box, usize), - body: F) - where F: FnOnce(Env) +fn test_env(source_string: &str, args: (Box, usize), body: F) +where + F: FnOnce(Env), { syntax::with_globals(|| { let mut options = config::Options::default(); @@ -113,34 +115,41 @@ fn test_env_with_pool( options: config::Options, source_string: &str, (emitter, expected_err_count): (Box, usize), - body: F -) - where F: FnOnce(Env) + body: F, +) where + F: FnOnce(Env), { let diagnostic_handler = errors::Handler::with_emitter(true, false, emitter); - let sess = session::build_session_(options, - None, - diagnostic_handler, - Lrc::new(SourceMap::new(FilePathMapping::empty()))); + let sess = session::build_session_( + options, + None, + diagnostic_handler, + Lrc::new(SourceMap::new(FilePathMapping::empty())), + ); let cstore = CStore::new(::get_codegen_backend(&sess).metadata_loader()); rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess)); let input = config::Input::Str { name: FileName::Anon, input: source_string.to_string(), }; - let krate = driver::phase_1_parse_input(&driver::CompileController::basic(), - &sess, - &input).unwrap(); - let driver::ExpansionResult { defs, resolutions, mut hir_forest, .. } = { - driver::phase_2_configure_and_expand(&sess, - &cstore, - krate, - None, - "test", - None, - MakeGlobMap::No, - |_| Ok(())) - .expect("phase 2 aborted") + let krate = + driver::phase_1_parse_input(&driver::CompileController::basic(), &sess, &input).unwrap(); + let driver::ExpansionResult { + defs, + resolutions, + mut hir_forest, + .. + } = { + driver::phase_2_configure_and_expand( + &sess, + &cstore, + krate, + None, + "test", + None, + MakeGlobMap::No, + |_| Ok(()), + ).expect("phase 2 aborted") }; let arenas = ty::AllArenas::new(); @@ -155,32 +164,39 @@ fn test_env_with_pool( extra: String::new(), outputs: OutputTypes::new(&[]), }; - TyCtxt::create_and_enter(&sess, - &cstore, - ty::query::Providers::default(), - ty::query::Providers::default(), - &arenas, - resolutions, - hir_map, - OnDiskCache::new_empty(sess.source_map()), - "test_crate", - tx, - &outputs, - |tcx| { - tcx.infer_ctxt().enter(|infcx| { - let mut region_scope_tree = region::ScopeTree::default(); - let param_env = ty::ParamEnv::empty(); - body(Env { - infcx: &infcx, - region_scope_tree: &mut region_scope_tree, - param_env: param_env, + TyCtxt::create_and_enter( + &sess, + &cstore, + ty::query::Providers::default(), + ty::query::Providers::default(), + &arenas, + resolutions, + hir_map, + OnDiskCache::new_empty(sess.source_map()), + "test_crate", + tx, + &outputs, + |tcx| { + tcx.infer_ctxt().enter(|infcx| { + let mut region_scope_tree = region::ScopeTree::default(); + let param_env = ty::ParamEnv::empty(); + body(Env { + infcx: &infcx, + region_scope_tree: &mut region_scope_tree, + param_env: param_env, + }); + let outlives_env = OutlivesEnvironment::new(param_env); + let def_id = tcx.hir.local_def_id(ast::CRATE_NODE_ID); + infcx.resolve_regions_and_report_errors( + def_id, + ®ion_scope_tree, + &outlives_env, + SuppressRegionErrors::default(), + ); + assert_eq!(tcx.sess.err_count(), expected_err_count); }); - let outlives_env = OutlivesEnvironment::new(param_env); - let def_id = tcx.hir.local_def_id(ast::CRATE_NODE_ID); - infcx.resolve_regions_and_report_errors(def_id, ®ion_scope_tree, &outlives_env); - assert_eq!(tcx.sess.err_count(), expected_err_count); - }); - }); + }, + ); } fn d1() -> ty::DebruijnIndex { @@ -196,9 +212,15 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { self.infcx.tcx } - pub fn create_region_hierarchy(&mut self, rh: &RH, - parent: (region::Scope, region::ScopeDepth)) { - let me = region::Scope { id: rh.id, data: region::ScopeData::Node }; + pub fn create_region_hierarchy( + &mut self, + rh: &RH, + parent: (region::Scope, region::ScopeDepth), + ) { + let me = region::Scope { + id: rh.id, + data: region::ScopeData::Node, + }; self.region_scope_tree.record_scope_parent(me, Some(parent)); for child_rh in rh.sub { self.create_region_hierarchy(child_rh, (me, parent.1 + 1)); @@ -211,20 +233,25 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { let dscope = region::Scope { id: hir::ItemLocalId(1), - data: region::ScopeData::Destruction + data: region::ScopeData::Destruction, }; self.region_scope_tree.record_scope_parent(dscope, None); - self.create_region_hierarchy(&RH { - id: hir::ItemLocalId(1), - sub: &[RH { - id: hir::ItemLocalId(10), - sub: &[], + self.create_region_hierarchy( + &RH { + id: hir::ItemLocalId(1), + sub: &[ + RH { + id: hir::ItemLocalId(10), + sub: &[], + }, + RH { + id: hir::ItemLocalId(11), + sub: &[], + }, + ], }, - RH { - id: hir::ItemLocalId(11), - sub: &[], - }], - }, (dscope, 1)); + (dscope, 1), + ); } #[allow(dead_code)] // this seems like it could be useful, even if we don't use it now @@ -236,11 +263,12 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { } }; - fn search_mod(this: &Env, - m: &hir::Mod, - idx: usize, - names: &[String]) - -> Option { + fn search_mod( + this: &Env, + m: &hir::Mod, + idx: usize, + names: &[String], + ) -> Option { assert!(idx < names.len()); for item in &m.item_ids { let item = this.infcx.tcx.hir.expect_item(item.id); @@ -257,22 +285,22 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { } return match it.node { - hir::ItemKind::Use(..) | - hir::ItemKind::ExternCrate(..) | - hir::ItemKind::Const(..) | - hir::ItemKind::Static(..) | - hir::ItemKind::Fn(..) | - hir::ItemKind::ForeignMod(..) | - hir::ItemKind::GlobalAsm(..) | - hir::ItemKind::Existential(..) | - hir::ItemKind::Ty(..) => None, + hir::ItemKind::Use(..) + | hir::ItemKind::ExternCrate(..) + | hir::ItemKind::Const(..) + | hir::ItemKind::Static(..) + | hir::ItemKind::Fn(..) + | hir::ItemKind::ForeignMod(..) + | hir::ItemKind::GlobalAsm(..) + | hir::ItemKind::Existential(..) + | hir::ItemKind::Ty(..) => None, - hir::ItemKind::Enum(..) | - hir::ItemKind::Struct(..) | - hir::ItemKind::Union(..) | - hir::ItemKind::Trait(..) | - hir::ItemKind::TraitAlias(..) | - hir::ItemKind::Impl(..) => None, + hir::ItemKind::Enum(..) + | hir::ItemKind::Struct(..) + | hir::ItemKind::Union(..) + | hir::ItemKind::Trait(..) + | hir::ItemKind::TraitAlias(..) + | hir::ItemKind::Impl(..) => None, hir::ItemKind::Mod(ref m) => search_mod(this, m, idx, names), }; @@ -280,7 +308,10 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { } pub fn make_subtype(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> bool { - match self.infcx.at(&ObligationCause::dummy(), self.param_env).sub(a, b) { + match self.infcx + .at(&ObligationCause::dummy(), self.param_env) + .sub(a, b) + { Ok(_) => true, Err(ref e) => panic!("Encountered error: {}", e), } @@ -302,13 +333,15 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { } pub fn t_fn(&self, input_tys: &[Ty<'tcx>], output_ty: Ty<'tcx>) -> Ty<'tcx> { - self.infcx.tcx.mk_fn_ptr(ty::Binder::bind(self.infcx.tcx.mk_fn_sig( - input_tys.iter().cloned(), - output_ty, - false, - hir::Unsafety::Normal, - Abi::Rust - ))) + self.infcx + .tcx + .mk_fn_ptr(ty::Binder::bind(self.infcx.tcx.mk_fn_sig( + input_tys.iter().cloned(), + output_ty, + false, + hir::Unsafety::Normal, + Abi::Rust, + ))) } pub fn t_nil(&self) -> Ty<'tcx> { @@ -321,23 +354,30 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { pub fn t_param(&self, index: u32) -> Ty<'tcx> { let name = format!("T{}", index); - self.infcx.tcx.mk_ty_param(index, Symbol::intern(&name).as_interned_str()) + self.infcx + .tcx + .mk_ty_param(index, Symbol::intern(&name).as_interned_str()) } pub fn re_early_bound(&self, index: u32, name: &'static str) -> ty::Region<'tcx> { let name = Symbol::intern(name).as_interned_str(); - self.infcx.tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion { - def_id: self.infcx.tcx.hir.local_def_id(ast::CRATE_NODE_ID), - index, - name, - })) + self.infcx + .tcx + .mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion { + def_id: self.infcx.tcx.hir.local_def_id(ast::CRATE_NODE_ID), + index, + name, + })) } - pub fn re_late_bound_with_debruijn(&self, - id: u32, - debruijn: ty::DebruijnIndex) - -> ty::Region<'tcx> { - self.infcx.tcx.mk_region(ty::ReLateBound(debruijn, ty::BrAnon(id))) + pub fn re_late_bound_with_debruijn( + &self, + id: u32, + debruijn: ty::DebruijnIndex, + ) -> ty::Region<'tcx> { + self.infcx + .tcx + .mk_region(ty::ReLateBound(debruijn, ty::BrAnon(id))) } pub fn t_rptr(&self, r: ty::Region<'tcx>) -> Ty<'tcx> { @@ -349,10 +389,11 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { self.infcx.tcx.mk_imm_ref(r, self.tcx().types.isize) } - pub fn t_rptr_late_bound_with_debruijn(&self, - id: u32, - debruijn: ty::DebruijnIndex) - -> Ty<'tcx> { + pub fn t_rptr_late_bound_with_debruijn( + &self, + id: u32, + debruijn: ty::DebruijnIndex, + ) -> Ty<'tcx> { let r = self.re_late_bound_with_debruijn(id, debruijn); self.infcx.tcx.mk_imm_ref(r, self.tcx().types.isize) } @@ -360,9 +401,11 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { pub fn t_rptr_scope(&self, id: u32) -> Ty<'tcx> { let r = ty::ReScope(region::Scope { id: hir::ItemLocalId(id), - data: region::ScopeData::Node + data: region::ScopeData::Node, }); - self.infcx.tcx.mk_imm_ref(self.infcx.tcx.mk_region(r), self.tcx().types.isize) + self.infcx + .tcx + .mk_imm_ref(self.infcx.tcx.mk_region(r), self.tcx().types.isize) } pub fn re_free(&self, id: u32) -> ty::Region<'tcx> { @@ -378,14 +421,19 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> { } pub fn sub(&self, t1: Ty<'tcx>, t2: Ty<'tcx>) -> InferResult<'tcx, ()> { - self.infcx.at(&ObligationCause::dummy(), self.param_env).sub(t1, t2) + self.infcx + .at(&ObligationCause::dummy(), self.param_env) + .sub(t1, t2) } /// Checks that `t1 <: t2` is true (this may register additional /// region checks). pub fn check_sub(&self, t1: Ty<'tcx>, t2: Ty<'tcx>) { match self.sub(t1, t2) { - Ok(InferOk { obligations, value: () }) => { + Ok(InferOk { + obligations, + value: (), + }) => { // None of these tests should require nested obligations: assert!(obligations.is_empty()); } @@ -445,8 +493,10 @@ fn sub_free_bound_false() { env.create_simple_region_hierarchy(); let t_rptr_free1 = env.t_rptr_free(1); let t_rptr_bound1 = env.t_rptr_late_bound(1); - env.check_not_sub(env.t_fn(&[t_rptr_free1], env.tcx().types.isize), - env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); + env.check_not_sub( + env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + ); }) } @@ -462,8 +512,10 @@ fn sub_bound_free_true() { env.create_simple_region_hierarchy(); let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_free1 = env.t_rptr_free(1); - env.check_sub(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), - env.t_fn(&[t_rptr_free1], env.tcx().types.isize)); + env.check_sub( + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + ); }) } @@ -476,10 +528,13 @@ fn sub_free_bound_false_infer() { //! does NOT hold for any instantiation of `_#1`. test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { - let t_infer1 = env.infcx.next_ty_var(TypeVariableOrigin::MiscVariable(DUMMY_SP)); + let t_infer1 = env.infcx + .next_ty_var(TypeVariableOrigin::MiscVariable(DUMMY_SP)); let t_rptr_bound1 = env.t_rptr_late_bound(1); - env.check_not_sub(env.t_fn(&[t_infer1], env.tcx().types.isize), - env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); + env.check_not_sub( + env.t_fn(&[t_infer1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + ); }) } @@ -487,7 +542,6 @@ fn sub_free_bound_false_infer() { /// This requires adjusting the Debruijn index. #[test] fn subst_ty_renumber_bound() { - test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { // Situation: // Theta = [A -> &'a foo] @@ -509,11 +563,10 @@ fn subst_ty_renumber_bound() { env.t_fn(&[t_ptr_bound2], env.t_nil()) }; - debug!("subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", - t_source, - substs, - t_substituted, - t_expected); + debug!( + "subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", + t_source, substs, t_substituted, t_expected + ); assert_eq!(t_substituted, t_expected); }) @@ -546,11 +599,10 @@ fn subst_ty_renumber_some_bounds() { env.t_pair(t_rptr_bound1, env.t_fn(&[t_rptr_bound2], env.t_nil())) }; - debug!("subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", - t_source, - substs, - t_substituted, - t_expected); + debug!( + "subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", + t_source, substs, t_substituted, t_expected + ); assert_eq!(t_substituted, t_expected); }) @@ -559,7 +611,6 @@ fn subst_ty_renumber_some_bounds() { /// Test that we correctly compute whether a type has escaping regions or not. #[test] fn escaping() { - test_env(EMPTY_SOURCE_STR, errors(&[]), |mut env| { // Situation: // Theta = [A -> &'a foo] @@ -608,11 +659,10 @@ fn subst_region_renumber_region() { env.t_fn(&[t_rptr_bound2], env.t_nil()) }; - debug!("subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", - t_source, - substs, - t_substituted, - t_expected); + debug!( + "subst_bound: t_source={:?} substs={:?} t_substituted={:?} t_expected={:?}", + t_source, substs, t_substituted, t_expected + ); assert_eq!(t_substituted, t_expected); }) @@ -627,9 +677,13 @@ fn walk_ty() { let tup1_ty = tcx.intern_tup(&[int_ty, usize_ty, int_ty, usize_ty]); let tup2_ty = tcx.intern_tup(&[tup1_ty, tup1_ty, usize_ty]); let walked: Vec<_> = tup2_ty.walk().collect(); - assert_eq!(walked, - [tup2_ty, tup1_ty, int_ty, usize_ty, int_ty, usize_ty, tup1_ty, int_ty, - usize_ty, int_ty, usize_ty, usize_ty]); + assert_eq!( + walked, + [ + tup2_ty, tup1_ty, int_ty, usize_ty, int_ty, usize_ty, tup1_ty, int_ty, usize_ty, + int_ty, usize_ty, usize_ty + ] + ); }) } @@ -644,14 +698,16 @@ fn walk_ty_skip_subtree() { // types we expect to see (in order), plus a boolean saying // whether to skip the subtree. - let mut expected = vec![(tup2_ty, false), - (tup1_ty, false), - (int_ty, false), - (usize_ty, false), - (int_ty, false), - (usize_ty, false), - (tup1_ty, true), // skip the isize/usize/isize/usize - (usize_ty, false)]; + let mut expected = vec![ + (tup2_ty, false), + (tup1_ty, false), + (int_ty, false), + (usize_ty, false), + (int_ty, false), + (usize_ty, false), + (tup1_ty, true), // skip the isize/usize/isize/usize + (usize_ty, false), + ]; expected.reverse(); let mut walker = tup2_ty.walk(); diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index adf23a5cf2c8..7eda6e94dd07 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1736,8 +1736,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TrivialConstraints { if cx.tcx.features().trivial_bounds { let def_id = cx.tcx.hir.local_def_id(item.id); let predicates = cx.tcx.predicates_of(def_id); - for predicate in &predicates.predicates { - let predicate_kind_name = match *predicate { + for &(predicate, span) in &predicates.predicates { + let predicate_kind_name = match predicate { Trait(..) => "Trait", TypeOutlives(..) | RegionOutlives(..) => "Lifetime", @@ -1755,7 +1755,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TrivialConstraints { if predicate.is_global() { cx.span_lint( TRIVIAL_BOUNDS, - item.span, + span, &format!("{} bound {} does not depend on any type \ or lifetime parameters", predicate_kind_name, predicate), ); @@ -1999,3 +1999,233 @@ impl EarlyLintPass for KeywordIdents { lint.emit() } } + + +pub struct ExplicitOutlivesRequirements; + +impl LintPass for ExplicitOutlivesRequirements { + fn get_lints(&self) -> LintArray { + lint_array![EXPLICIT_OUTLIVES_REQUIREMENTS] + } +} + +impl ExplicitOutlivesRequirements { + fn collect_outlives_bound_spans( + &self, + cx: &LateContext, + item_def_id: DefId, + param_name: &str, + bounds: &hir::GenericBounds, + infer_static: bool + ) -> Vec<(usize, Span)> { + // For lack of a more elegant strategy for comparing the `ty::Predicate`s + // returned by this query with the params/bounds grabbed from the HIR—and + // with some regrets—we're going to covert the param/lifetime names to + // strings + let inferred_outlives = cx.tcx.inferred_outlives_of(item_def_id); + + let ty_lt_names = inferred_outlives.iter().filter_map(|pred| { + let binder = match pred { + ty::Predicate::TypeOutlives(binder) => binder, + _ => { return None; } + }; + let ty_outlives_pred = binder.skip_binder(); + let ty_name = match ty_outlives_pred.0.sty { + ty::Param(param) => param.name.to_string(), + _ => { return None; } + }; + let lt_name = match ty_outlives_pred.1 { + ty::RegionKind::ReEarlyBound(region) => { + region.name.to_string() + }, + _ => { return None; } + }; + Some((ty_name, lt_name)) + }).collect::>(); + + let mut bound_spans = Vec::new(); + for (i, bound) in bounds.iter().enumerate() { + if let hir::GenericBound::Outlives(lifetime) = bound { + let is_static = match lifetime.name { + hir::LifetimeName::Static => true, + _ => false + }; + if is_static && !infer_static { + // infer-outlives for 'static is still feature-gated (tracking issue #44493) + continue; + } + + let lt_name = &lifetime.name.ident().to_string(); + if ty_lt_names.contains(&(param_name.to_owned(), lt_name.to_owned())) { + bound_spans.push((i, bound.span())); + } + } + } + bound_spans + } + + fn consolidate_outlives_bound_spans( + &self, + lo: Span, + bounds: &hir::GenericBounds, + bound_spans: Vec<(usize, Span)> + ) -> Vec { + if bounds.is_empty() { + return Vec::new(); + } + if bound_spans.len() == bounds.len() { + let (_, last_bound_span) = bound_spans[bound_spans.len()-1]; + // If all bounds are inferable, we want to delete the colon, so + // start from just after the parameter (span passed as argument) + vec![lo.to(last_bound_span)] + } else { + let mut merged = Vec::new(); + let mut last_merged_i = None; + + let mut from_start = true; + for (i, bound_span) in bound_spans { + match last_merged_i { + // If the first bound is inferable, our span should also eat the trailing `+` + None if i == 0 => { + merged.push(bound_span.to(bounds[1].span().shrink_to_lo())); + last_merged_i = Some(0); + }, + // If consecutive bounds are inferable, merge their spans + Some(h) if i == h+1 => { + if let Some(tail) = merged.last_mut() { + // Also eat the trailing `+` if the first + // more-than-one bound is inferable + let to_span = if from_start && i < bounds.len() { + bounds[i+1].span().shrink_to_lo() + } else { + bound_span + }; + *tail = tail.to(to_span); + last_merged_i = Some(i); + } else { + bug!("another bound-span visited earlier"); + } + }, + _ => { + // When we find a non-inferable bound, subsequent inferable bounds + // won't be consecutive from the start (and we'll eat the leading + // `+` rather than the trailing one) + from_start = false; + merged.push(bounds[i-1].span().shrink_to_hi().to(bound_span)); + last_merged_i = Some(i); + } + } + } + merged + } + } +} + +impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements { + fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) { + let infer_static = cx.tcx.features().infer_static_outlives_requirements; + let def_id = cx.tcx.hir.local_def_id(item.id); + if let hir::ItemKind::Struct(_, ref generics) = item.node { + let mut bound_count = 0; + let mut lint_spans = Vec::new(); + + for param in &generics.params { + let param_name = match param.kind { + hir::GenericParamKind::Lifetime { .. } => { continue; }, + hir::GenericParamKind::Type { .. } => { + match param.name { + hir::ParamName::Fresh(_) => { continue; }, + hir::ParamName::Plain(name) => name.to_string() + } + } + }; + let bound_spans = self.collect_outlives_bound_spans( + cx, def_id, ¶m_name, ¶m.bounds, infer_static + ); + bound_count += bound_spans.len(); + lint_spans.extend( + self.consolidate_outlives_bound_spans( + param.span.shrink_to_hi(), ¶m.bounds, bound_spans + ) + ); + } + + let mut where_lint_spans = Vec::new(); + let mut dropped_predicate_count = 0; + let num_predicates = generics.where_clause.predicates.len(); + for (i, where_predicate) in generics.where_clause.predicates.iter().enumerate() { + if let hir::WherePredicate::BoundPredicate(predicate) = where_predicate { + let param_name = match predicate.bounded_ty.node { + hir::TyKind::Path(ref qpath) => { + if let hir::QPath::Resolved(None, ty_param_path) = qpath { + ty_param_path.segments[0].ident.to_string() + } else { + continue; + } + }, + _ => { continue; } + }; + let bound_spans = self.collect_outlives_bound_spans( + cx, def_id, ¶m_name, &predicate.bounds, infer_static + ); + bound_count += bound_spans.len(); + + let drop_predicate = bound_spans.len() == predicate.bounds.len(); + if drop_predicate { + dropped_predicate_count += 1; + } + + // If all the bounds on a predicate were inferable and there are + // further predicates, we want to eat the trailing comma + if drop_predicate && i + 1 < num_predicates { + let next_predicate_span = generics.where_clause.predicates[i+1].span(); + where_lint_spans.push( + predicate.span.to(next_predicate_span.shrink_to_lo()) + ); + } else { + where_lint_spans.extend( + self.consolidate_outlives_bound_spans( + predicate.span.shrink_to_lo(), + &predicate.bounds, + bound_spans + ) + ); + } + } + } + + // If all predicates are inferable, drop the entire clause + // (including the `where`) + if num_predicates > 0 && dropped_predicate_count == num_predicates { + let full_where_span = generics.span.shrink_to_hi() + .to(generics.where_clause.span() + .expect("span of (nonempty) where clause should exist")); + lint_spans.push( + full_where_span + ); + } else { + lint_spans.extend(where_lint_spans); + } + + if !lint_spans.is_empty() { + let mut err = cx.struct_span_lint( + EXPLICIT_OUTLIVES_REQUIREMENTS, + lint_spans.clone(), + "outlives requirements can be inferred" + ); + err.multipart_suggestion_with_applicability( + if bound_count == 1 { + "remove this bound" + } else { + "remove these bounds" + }, + lint_spans.into_iter().map(|span| (span, "".to_owned())).collect::>(), + Applicability::MachineApplicable + ); + err.emit(); + } + + } + } + +} diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 9e2e3435bd9b..9e0471f59fba 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -48,6 +48,7 @@ use rustc::lint::builtin::{ BARE_TRAIT_OBJECTS, ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, ELIDED_LIFETIMES_IN_PATHS, + EXPLICIT_OUTLIVES_REQUIREMENTS, parser::QUESTION_MARK_MACRO_SEP }; use rustc::session; @@ -157,6 +158,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { TypeLimits: TypeLimits::new(), MissingDoc: MissingDoc::new(), MissingDebugImplementations: MissingDebugImplementations::new(), + ExplicitOutlivesRequirements: ExplicitOutlivesRequirements, ]], ['tcx]); store.register_late_pass(sess, false, box BuiltinCombinedLateLintPass::new()); @@ -199,7 +201,8 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { BARE_TRAIT_OBJECTS, UNUSED_EXTERN_CRATES, ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, - ELIDED_LIFETIMES_IN_PATHS + ELIDED_LIFETIMES_IN_PATHS, + EXPLICIT_OUTLIVES_REQUIREMENTS // FIXME(#52665, #47816) not always applicable and not all // macros are ready for this yet. diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 6eef2397f9c6..fa2debf2c0dc 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -256,6 +256,7 @@ impl<'a> CrateLoader<'a> { let cmeta = cstore::CrateMetadata { name: crate_root.name, + imported_name: ident, extern_crate: Lock::new(None), def_path_table: Lrc::new(def_path_table), trait_impls, diff --git a/src/librustc_metadata/cstore.rs b/src/librustc_metadata/cstore.rs index aad632f89180..ec48a4a4c699 100644 --- a/src/librustc_metadata/cstore.rs +++ b/src/librustc_metadata/cstore.rs @@ -53,8 +53,13 @@ pub struct ImportedSourceFile { } pub struct CrateMetadata { + /// Original name of the crate. pub name: Symbol, + /// Name of the crate as imported. I.e. if imported with + /// `extern crate foo as bar;` this will be `bar`. + pub imported_name: Symbol, + /// Information about the extern crate that caused this crate to /// be loaded. If this is `None`, then the crate was injected /// (e.g., by the allocator) diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/cstore_impl.rs index 23f941f744b3..fb0d68379860 100644 --- a/src/librustc_metadata/cstore_impl.rs +++ b/src/librustc_metadata/cstore_impl.rs @@ -441,8 +441,7 @@ impl cstore::CStore { let data = self.get_crate_data(id.krate); if let Some(ref proc_macros) = data.proc_macros { return LoadedMacro::ProcMacro(proc_macros[id.index.to_proc_macro_index()].1.clone()); - } else if data.name == "proc_macro" && - self.get_crate_data(id.krate).item_name(id.index) == "quote" { + } else if data.name == "proc_macro" && data.item_name(id.index) == "quote" { use syntax::ext::base::SyntaxExtension; use syntax_ext::proc_macro_impl::BangProcMacro; @@ -454,8 +453,9 @@ impl cstore::CStore { return LoadedMacro::ProcMacro(Lrc::new(ext)); } - let (name, def) = data.get_macro(id.index); - let source_name = FileName::Macros(name.to_string()); + let def = data.get_macro(id.index); + let macro_full_name = data.def_path(id.index).to_string_friendly(|_| data.imported_name); + let source_name = FileName::Macros(macro_full_name); let source_file = sess.parse_sess.source_map().new_source_file(source_name, def.body); let local_span = Span::new(source_file.start_pos, source_file.end_pos, NO_EXPANSION); diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 35ce6eb91b69..33a4af053eb7 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -1106,10 +1106,10 @@ impl<'a, 'tcx> CrateMetadata { } } - pub fn get_macro(&self, id: DefIndex) -> (InternedString, MacroDef) { + pub fn get_macro(&self, id: DefIndex) -> MacroDef { let entry = self.entry(id); match entry.kind { - EntryKind::MacroDef(macro_def) => (self.item_name(id), macro_def.decode(self)), + EntryKind::MacroDef(macro_def) => macro_def.decode(self), _ => bug!(), } } diff --git a/src/librustc_mir/borrow_check/error_reporting.rs b/src/librustc_mir/borrow_check/error_reporting.rs index f29870623a9e..a4e9e9579950 100644 --- a/src/librustc_mir/borrow_check/error_reporting.rs +++ b/src/librustc_mir/borrow_check/error_reporting.rs @@ -1319,7 +1319,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { ); if let StatementKind::Assign( Place::Local(assigned_to), - rvalue, + box rvalue, ) = &stmt.kind { debug!("annotate_argument_and_return_for_borrow: assigned_to={:?} \ rvalue={:?}", assigned_to, rvalue); @@ -1823,7 +1823,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { None => return OtherUse(self.mir.source_info(location).span), }; - if let StatementKind::Assign(_, Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { + if let StatementKind::Assign(_, box Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { if let AggregateKind::Closure(def_id, _) = **kind { debug!("find_closure_move_span: found closure {:?}", places); @@ -1886,7 +1886,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { } for stmt in &self.mir[location.block].statements[location.statement_index + 1..] { - if let StatementKind::Assign(_, Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { + if let StatementKind::Assign(_, box Rvalue::Aggregate(ref kind, ref places)) + = stmt.kind { if let AggregateKind::Closure(def_id, _) = **kind { debug!("find_closure_borrow_span: found closure {:?}", places); diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 06394ee44ccb..6ecbc5ee727c 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -534,7 +534,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx ref inputs, } => { let context = ContextKind::InlineAsm.new(location); - for (o, output) in asm.outputs.iter().zip(outputs) { + for (o, output) in asm.outputs.iter().zip(outputs.iter()) { if o.is_indirect { // FIXME(eddyb) indirect inline asm outputs should // be encoeded through MIR place derefs instead. @@ -561,7 +561,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx ); } } - for input in inputs { + for input in inputs.iter() { self.consume_operand(context, (input, span), flow_state); } } diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index 8a97f25ef581..1c55806872d5 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -100,7 +100,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { // flow could be used. if let Some(StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Move(move_from)), + box Rvalue::Use(Operand::Move(move_from)), )) = self.mir.basic_blocks()[location.block] .statements .get(location.statement_index) diff --git a/src/librustc_mir/borrow_check/nll/invalidation.rs b/src/librustc_mir/borrow_check/nll/invalidation.rs index 1246f7120c4f..f19c102adcfe 100644 --- a/src/librustc_mir/borrow_check/nll/invalidation.rs +++ b/src/librustc_mir/borrow_check/nll/invalidation.rs @@ -109,7 +109,7 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> { ref inputs, } => { let context = ContextKind::InlineAsm.new(location); - for (o, output) in asm.outputs.iter().zip(outputs) { + for (o, output) in asm.outputs.iter().zip(outputs.iter()) { if o.is_indirect { // FIXME(eddyb) indirect inline asm outputs should // be encoeded through MIR place derefs instead. @@ -128,7 +128,7 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> { ); } } - for input in inputs { + for input in inputs.iter() { self.consume_operand(context, input); } } @@ -479,7 +479,7 @@ impl<'cg, 'cx, 'tcx, 'gcx> InvalidationGenerator<'cx, 'tcx, 'gcx> { /// Generate a new invalidates(L, B) fact fn generate_invalidates(&mut self, b: BorrowIndex, l: Location) { - let lidx = self.location_table.mid_index(l); + let lidx = self.location_table.start_index(l); self.all_facts.invalidates.push((lidx, b)); } } diff --git a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs index 75f14a6bbdac..2dbb5cd9deb1 100644 --- a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs +++ b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs @@ -10,15 +10,13 @@ use super::universal_regions::UniversalRegions; use borrow_check::nll::constraints::graph::NormalConstraintGraph; -use borrow_check::nll::constraints::{ - ConstraintSccIndex, ConstraintSet, OutlivesConstraint, -}; +use borrow_check::nll::constraints::{ConstraintSccIndex, ConstraintSet, OutlivesConstraint}; use borrow_check::nll::region_infer::values::{RegionElement, ToElementIndex}; use borrow_check::nll::type_check::free_region_relations::UniversalRegionRelations; use borrow_check::nll::type_check::Locations; use rustc::hir::def_id::DefId; use rustc::infer::canonical::QueryRegionConstraint; -use rustc::infer::region_constraints::{GenericKind, VarInfos}; +use rustc::infer::region_constraints::{GenericKind, VarInfos, VerifyBound}; use rustc::infer::{InferCtxt, NLLRegionVariableOrigin, RegionVariableOrigin}; use rustc::mir::{ ClosureOutlivesRequirement, ClosureOutlivesSubject, ClosureRegionRequirements, Local, Location, @@ -29,7 +27,7 @@ use rustc::util::common; use rustc_data_structures::bit_set::BitSet; use rustc_data_structures::graph::scc::Sccs; use rustc_data_structures::indexed_vec::IndexVec; -use rustc_errors::{DiagnosticBuilder, Diagnostic}; +use rustc_errors::{Diagnostic, DiagnosticBuilder}; use std::rc::Rc; @@ -71,6 +69,15 @@ pub struct RegionInferenceContext<'tcx> { /// visible from this index. scc_universes: IndexVec, + /// Contains a "representative" from each SCC. This will be the + /// minimal RegionVid belonging to that universe. It is used as a + /// kind of hacky way to manage checking outlives relationships, + /// since we can 'canonicalize' each region to the representative + /// of its SCC and be sure that -- if they have the same repr -- + /// they *must* be equal (though not having the same repr does not + /// mean they are unequal). + scc_representatives: IndexVec, + /// The final inferred values of the region variables; we compute /// one value per SCC. To get the value for any given *region*, /// you first find which scc it is a part of. @@ -162,42 +169,7 @@ pub struct TypeTest<'tcx> { /// A test which, if met by the region `'x`, proves that this type /// constraint is satisfied. - pub test: RegionTest, -} - -/// A "test" that can be applied to some "subject region" `'x`. These are used to -/// describe type constraints. Tests do not presently affect the -/// region values that get inferred for each variable; they only -/// examine the results *after* inference. This means they can -/// conveniently include disjuction ("a or b must be true"). -#[derive(Clone, Debug)] -pub enum RegionTest { - /// The subject region `'x` must by outlived by *some* region in - /// the given set of regions. - /// - /// This test comes from e.g. a where clause like `T: 'a + 'b`, - /// which implies that we know that `T: 'a` and that `T: - /// 'b`. Therefore, if we are trying to prove that `T: 'x`, we can - /// do so by showing that `'a: 'x` *or* `'b: 'x`. - IsOutlivedByAnyRegionIn(Vec), - - /// The subject region `'x` must by outlived by *all* regions in - /// the given set of regions. - /// - /// This test comes from e.g. a projection type like `T = >::Foo`, which must outlive `'a` or `'b`, and - /// maybe both. Therefore we can prove that `T: 'x` if we know - /// that `'a: 'x` *and* `'b: 'x`. - IsOutlivedByAllRegionsIn(Vec), - - /// Any of the given tests are true. - /// - /// This arises from projections, for which there are multiple - /// ways to prove an outlives relationship. - Any(Vec), - - /// All of the given tests are true. - All(Vec), + pub verify_bound: VerifyBound<'tcx>, } impl<'tcx> RegionInferenceContext<'tcx> { @@ -245,6 +217,8 @@ impl<'tcx> RegionInferenceContext<'tcx> { let scc_universes = Self::compute_scc_universes(&constraint_sccs, &definitions); + let scc_representatives = Self::compute_scc_representatives(&constraint_sccs, &definitions); + let mut result = Self { definitions, liveness_constraints, @@ -252,6 +226,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { constraint_graph, constraint_sccs, scc_universes, + scc_representatives, scc_values, type_tests, universal_regions, @@ -288,6 +263,27 @@ impl<'tcx> RegionInferenceContext<'tcx> { scc_universes } + /// For each SCC, we compute a unique `RegionVid` (in fact, the + /// minimal one that belongs to the SCC). See + /// `scc_representatives` field of `RegionInferenceContext` for + /// more details. + fn compute_scc_representatives( + constraints_scc: &Sccs, + definitions: &IndexVec>, + ) -> IndexVec { + let num_sccs = constraints_scc.num_sccs(); + let next_region_vid = definitions.next_index(); + let mut scc_representatives = IndexVec::from_elem_n(next_region_vid, num_sccs); + + for region_vid in definitions.indices() { + let scc = constraints_scc.scc(region_vid); + let prev_min = scc_representatives[scc]; + scc_representatives[scc] = region_vid.min(prev_min); + } + + scc_representatives + } + /// Initializes the region variables for each universally /// quantified region (lifetime parameter). The first N variables /// always correspond to the regions appearing in the function @@ -582,7 +578,14 @@ impl<'tcx> RegionInferenceContext<'tcx> { for type_test in &self.type_tests { debug!("check_type_test: {:?}", type_test); - if self.eval_region_test(mir, type_test.lower_bound, &type_test.test) { + let generic_ty = type_test.generic_kind.to_ty(tcx); + if self.eval_verify_bound( + tcx, + mir, + generic_ty, + type_test.lower_bound, + &type_test.verify_bound, + ) { continue; } @@ -689,7 +692,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { generic_kind, lower_bound, locations, - test: _, + verify_bound: _, } = type_test; let generic_ty = generic_kind.to_ty(tcx); @@ -716,7 +719,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { // where `ur` is a local bound -- we are sometimes in a // position to prove things that our caller cannot. See // #53570 for an example. - if self.eval_region_test(mir, ur, &type_test.test) { + if self.eval_verify_bound(tcx, mir, generic_ty, ur, &type_test.verify_bound) { continue; } @@ -888,31 +891,99 @@ impl<'tcx> RegionInferenceContext<'tcx> { /// Test if `test` is true when applied to `lower_bound` at /// `point`, and returns true or false. - fn eval_region_test(&self, mir: &Mir<'tcx>, lower_bound: RegionVid, test: &RegionTest) -> bool { + fn eval_verify_bound( + &self, + tcx: TyCtxt<'_, '_, 'tcx>, + mir: &Mir<'tcx>, + generic_ty: Ty<'tcx>, + lower_bound: RegionVid, + verify_bound: &VerifyBound<'tcx>, + ) -> bool { debug!( - "eval_region_test(lower_bound={:?}, test={:?})", - lower_bound, test + "eval_verify_bound(lower_bound={:?}, verify_bound={:?})", + lower_bound, verify_bound ); - match test { - RegionTest::IsOutlivedByAllRegionsIn(regions) => regions - .iter() - .all(|&r| self.eval_outlives(mir, r, lower_bound)), + match verify_bound { + VerifyBound::IfEq(test_ty, verify_bound1) => { + self.eval_if_eq(tcx, mir, generic_ty, lower_bound, test_ty, verify_bound1) + } - RegionTest::IsOutlivedByAnyRegionIn(regions) => regions - .iter() - .any(|&r| self.eval_outlives(mir, r, lower_bound)), + VerifyBound::OutlivedBy(r) => { + let r_vid = self.to_region_vid(r); + self.eval_outlives(mir, r_vid, lower_bound) + } - RegionTest::Any(tests) => tests - .iter() - .any(|test| self.eval_region_test(mir, lower_bound, test)), + VerifyBound::AnyBound(verify_bounds) => verify_bounds.iter().any(|verify_bound| { + self.eval_verify_bound(tcx, mir, generic_ty, lower_bound, verify_bound) + }), - RegionTest::All(tests) => tests - .iter() - .all(|test| self.eval_region_test(mir, lower_bound, test)), + VerifyBound::AllBounds(verify_bounds) => verify_bounds.iter().all(|verify_bound| { + self.eval_verify_bound(tcx, mir, generic_ty, lower_bound, verify_bound) + }), } } + fn eval_if_eq( + &self, + tcx: TyCtxt<'_, '_, 'tcx>, + mir: &Mir<'tcx>, + generic_ty: Ty<'tcx>, + lower_bound: RegionVid, + test_ty: Ty<'tcx>, + verify_bound: &VerifyBound<'tcx>, + ) -> bool { + let generic_ty_normalized = self.normalize_to_scc_representatives(tcx, generic_ty); + let test_ty_normalized = self.normalize_to_scc_representatives(tcx, test_ty); + if generic_ty_normalized == test_ty_normalized { + self.eval_verify_bound(tcx, mir, generic_ty, lower_bound, verify_bound) + } else { + false + } + } + + /// This is a conservative normalization procedure. It takes every + /// free region in `value` and replaces it with the + /// "representative" of its SCC (see `scc_representatives` field). + /// We are guaranteed that if two values normalize to the same + /// thing, then they are equal; this is a conservative check in + /// that they could still be equal even if they normalize to + /// different results. (For example, there might be two regions + /// with the same value that are not in the same SCC). + /// + /// NB. This is not an ideal approach and I would like to revisit + /// it. However, it works pretty well in practice. In particular, + /// this is needed to deal with projection outlives bounds like + /// + /// >::Item: '1 + /// + /// In particular, this routine winds up being important when + /// there are bounds like `where >::Item: 'b` in the + /// environment. In this case, if we can show that `'0 == 'a`, + /// and that `'b: '1`, then we know that the clause is + /// satisfied. In such cases, particularly due to limitations of + /// the trait solver =), we usually wind up with a where-clause like + /// `T: Foo<'a>` in scope, which thus forces `'0 == 'a` to be added as + /// a constraint, and thus ensures that they are in the same SCC. + /// + /// So why can't we do a more correct routine? Well, we could + /// *almost* use the `relate_tys` code, but the way it is + /// currently setup it creates inference variables to deal with + /// higher-ranked things and so forth, and right now the inference + /// context is not permitted to make more inference variables. So + /// we use this kind of hacky solution. + fn normalize_to_scc_representatives(&self, tcx: TyCtxt<'_, '_, 'tcx>, value: T) -> T + where + T: TypeFoldable<'tcx>, + { + tcx.fold_regions(&value, &mut false, |r, _db| { + let vid = self.to_region_vid(r); + let scc = self.constraint_sccs.scc(vid); + let repr = self.scc_representatives[scc]; + tcx.mk_region(ty::ReVar(repr)) + }) + } + // Evaluate whether `sup_region: sub_region @ point`. fn eval_outlives( &self, diff --git a/src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs b/src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs index 430c8d673921..dabf669eca65 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs @@ -8,13 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use borrow_check::location::LocationTable; use borrow_check::nll::constraints::{ConstraintCategory, ConstraintSet, OutlivesConstraint}; -use borrow_check::nll::facts::AllFacts; -use borrow_check::nll::region_infer::{RegionTest, TypeTest}; +use borrow_check::nll::region_infer::TypeTest; use borrow_check::nll::type_check::Locations; use borrow_check::nll::universal_regions::UniversalRegions; use rustc::infer::canonical::QueryRegionConstraint; +use rustc::infer::outlives::env::RegionBoundPairs; use rustc::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate}; use rustc::infer::region_constraints::{GenericKind, VerifyBound}; use rustc::infer::{self, SubregionOrigin}; @@ -25,35 +24,30 @@ use syntax_pos::DUMMY_SP; crate struct ConstraintConversion<'a, 'gcx: 'tcx, 'tcx: 'a> { tcx: TyCtxt<'a, 'gcx, 'tcx>, universal_regions: &'a UniversalRegions<'tcx>, - location_table: &'a LocationTable, - region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'a RegionBoundPairs<'tcx>, implicit_region_bound: Option>, param_env: ty::ParamEnv<'tcx>, locations: Locations, category: ConstraintCategory, outlives_constraints: &'a mut ConstraintSet, type_tests: &'a mut Vec>, - all_facts: &'a mut Option, } impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> { crate fn new( tcx: TyCtxt<'a, 'gcx, 'tcx>, universal_regions: &'a UniversalRegions<'tcx>, - location_table: &'a LocationTable, - region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'a RegionBoundPairs<'tcx>, implicit_region_bound: Option>, param_env: ty::ParamEnv<'tcx>, locations: Locations, category: ConstraintCategory, outlives_constraints: &'a mut ConstraintSet, type_tests: &'a mut Vec>, - all_facts: &'a mut Option, ) -> Self { Self { tcx, universal_regions, - location_table, region_bound_pairs, implicit_region_bound, param_env, @@ -61,7 +55,6 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> { category, outlives_constraints, type_tests, - all_facts, } } @@ -100,23 +93,6 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> { let r1_vid = self.to_region_vid(r1); let r2_vid = self.to_region_vid(r2); self.add_outlives(r1_vid, r2_vid); - - // In the new analysis, all outlives relations etc - // "take effect" at the mid point of the statement - // that requires them, so ignore the `at_location`. - if let Some(all_facts) = &mut self.all_facts { - if let Some(from_location) = self.locations.from_location() { - all_facts.outlives.push(( - r1_vid, - r2_vid, - self.location_table.mid_index(from_location), - )); - } else { - for location in self.location_table.all_points() { - all_facts.outlives.push((r1_vid, r2_vid, location)); - } - } - } } UnpackedKind::Type(t1) => { @@ -139,43 +115,15 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> { &self, generic_kind: GenericKind<'tcx>, region: ty::Region<'tcx>, - bound: VerifyBound<'tcx>, + verify_bound: VerifyBound<'tcx>, ) -> TypeTest<'tcx> { let lower_bound = self.to_region_vid(region); - let test = self.verify_bound_to_region_test(&bound); - TypeTest { generic_kind, lower_bound, locations: self.locations, - test, - } - } - - fn verify_bound_to_region_test(&self, verify_bound: &VerifyBound<'tcx>) -> RegionTest { - match verify_bound { - VerifyBound::AnyRegion(regions) => RegionTest::IsOutlivedByAnyRegionIn( - regions.iter().map(|r| self.to_region_vid(r)).collect(), - ), - - VerifyBound::AllRegions(regions) => RegionTest::IsOutlivedByAllRegionsIn( - regions.iter().map(|r| self.to_region_vid(r)).collect(), - ), - - VerifyBound::AnyBound(bounds) => RegionTest::Any( - bounds - .iter() - .map(|b| self.verify_bound_to_region_test(b)) - .collect(), - ), - - VerifyBound::AllBounds(bounds) => RegionTest::All( - bounds - .iter() - .map(|b| self.verify_bound_to_region_test(b)) - .collect(), - ), + verify_bound, } } diff --git a/src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs b/src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs index 61c612b3c011..f33909db78f9 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use borrow_check::location::LocationTable; -use borrow_check::nll::facts::AllFacts; use borrow_check::nll::type_check::constraint_conversion; use borrow_check::nll::type_check::{Locations, MirTypeckRegionConstraints}; use borrow_check::nll::universal_regions::UniversalRegions; @@ -69,19 +67,15 @@ crate struct CreateResult<'tcx> { crate fn create( infcx: &InferCtxt<'_, '_, 'tcx>, param_env: ty::ParamEnv<'tcx>, - location_table: &LocationTable, implicit_region_bound: Option>, universal_regions: &Rc>, constraints: &mut MirTypeckRegionConstraints<'tcx>, - all_facts: &mut Option, ) -> CreateResult<'tcx> { UniversalRegionRelationsBuilder { infcx, param_env, implicit_region_bound, constraints, - location_table, - all_facts, universal_regions: universal_regions.clone(), region_bound_pairs: Vec::new(), relations: UniversalRegionRelations { @@ -210,11 +204,9 @@ impl UniversalRegionRelations<'tcx> { struct UniversalRegionRelationsBuilder<'this, 'gcx: 'tcx, 'tcx: 'this> { infcx: &'this InferCtxt<'this, 'gcx, 'tcx>, param_env: ty::ParamEnv<'tcx>, - location_table: &'this LocationTable, universal_regions: Rc>, implicit_region_bound: Option>, constraints: &'this mut MirTypeckRegionConstraints<'tcx>, - all_facts: &'this mut Option, // outputs: relations: UniversalRegionRelations<'tcx>, @@ -281,7 +273,6 @@ impl UniversalRegionRelationsBuilder<'cx, 'gcx, 'tcx> { constraint_conversion::ConstraintConversion::new( self.infcx.tcx, &self.universal_regions, - &self.location_table, &self.region_bound_pairs, self.implicit_region_bound, self.param_env, @@ -289,7 +280,6 @@ impl UniversalRegionRelationsBuilder<'cx, 'gcx, 'tcx> { ConstraintCategory::Internal, &mut self.constraints.outlives_constraints, &mut self.constraints.type_tests, - &mut self.all_facts, ).convert_all(&data); } diff --git a/src/librustc_mir/borrow_check/nll/type_check/liveness/liveness_map.rs b/src/librustc_mir/borrow_check/nll/type_check/liveness/liveness_map.rs index 467554dc38a6..cc176cbc4039 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/liveness/liveness_map.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/liveness/liveness_map.rs @@ -17,6 +17,7 @@ //! types, instead of all variables. use borrow_check::nll::ToRegionVid; +use borrow_check::nll::facts::{AllFacts, AllFactsExt}; use rustc::mir::{Local, Mir}; use rustc::ty::{RegionVid, TyCtxt}; use rustc_data_structures::fx::FxHashSet; @@ -61,12 +62,13 @@ impl NllLivenessMap { mir: &Mir<'tcx>, ) -> Self { let mut to_local = IndexVec::default(); + let facts_enabled = AllFacts::enabled(tcx); let from_local: IndexVec> = mir.local_decls .iter_enumerated() .map(|(local, local_decl)| { if tcx.all_free_regions_meet(&local_decl.ty, |r| { free_regions.contains(&r.to_region_vid()) - }) { + }) && !facts_enabled { // If all the regions in the type are free regions // (or there are no regions), then we don't need // to track liveness for this variable. diff --git a/src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs b/src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs index 357e9ee72102..9ccdc84db156 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use borrow_check::location::LocationTable; use borrow_check::nll::region_infer::values::RegionValueElements; use borrow_check::nll::constraints::ConstraintSet; use borrow_check::nll::NllLivenessMap; @@ -40,6 +41,7 @@ pub(super) fn generate<'gcx, 'tcx>( elements: &Rc, flow_inits: &mut FlowAtLocation>, move_data: &MoveData<'tcx>, + location_table: &LocationTable, ) { debug!("liveness::generate"); let free_regions = { @@ -51,7 +53,7 @@ pub(super) fn generate<'gcx, 'tcx>( ) }; let liveness_map = NllLivenessMap::compute(typeck.tcx(), &free_regions, mir); - trace::trace(typeck, mir, elements, flow_inits, move_data, &liveness_map); + trace::trace(typeck, mir, elements, flow_inits, move_data, &liveness_map, location_table); } /// Compute all regions that are (currently) known to outlive free diff --git a/src/librustc_mir/borrow_check/nll/type_check/liveness/trace.rs b/src/librustc_mir/borrow_check/nll/type_check/liveness/trace.rs index e706c1adaddf..6c1252fc73d8 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/liveness/trace.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/liveness/trace.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use borrow_check::location::LocationTable; use borrow_check::nll::constraints::ConstraintCategory; use borrow_check::nll::region_infer::values::{self, PointIndex, RegionValueElements}; use borrow_check::nll::type_check::liveness::liveness_map::{LiveVar, NllLivenessMap}; @@ -49,6 +50,7 @@ pub(super) fn trace( flow_inits: &mut FlowAtLocation>, move_data: &MoveData<'tcx>, liveness_map: &NllLivenessMap, + location_table: &LocationTable, ) { debug!("trace()"); @@ -67,6 +69,7 @@ pub(super) fn trace( move_data, liveness_map, drop_data: FxHashMap::default(), + location_table, }; LivenessResults::new(cx).compute_for_all_locals(); @@ -105,6 +108,9 @@ where /// Map tracking which variables need liveness computation. liveness_map: &'me NllLivenessMap, + + /// Maps between a MIR Location and a LocationIndex + location_table: &'me LocationTable, } struct DropData<'tcx> { @@ -453,7 +459,13 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> { ) { debug!("add_use_live_facts_for(value={:?})", value); - Self::make_all_regions_live(self.elements, &mut self.typeck, value, live_at) + Self::make_all_regions_live( + self.elements, + &mut self.typeck, + value, + live_at, + self.location_table, + ) } /// Some variable with type `live_ty` is "drop live" at `location` @@ -505,7 +517,13 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> { // All things in the `outlives` array may be touched by // the destructor and must be live at this point. for &kind in &drop_data.dropck_result.kinds { - Self::make_all_regions_live(self.elements, &mut self.typeck, kind, live_at); + Self::make_all_regions_live( + self.elements, + &mut self.typeck, + kind, + live_at, + self.location_table, + ); } } @@ -514,6 +532,7 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> { typeck: &mut TypeChecker<'_, '_, 'tcx>, value: impl TypeFoldable<'tcx>, live_at: &HybridBitSet, + location_table: &LocationTable, ) { debug!("make_all_regions_live(value={:?})", value); debug!( @@ -532,8 +551,12 @@ impl LivenessContext<'_, '_, '_, '_, 'tcx> { .liveness_constraints .add_elements(live_region_vid, live_at); - if let Some(_) = borrowck_context.all_facts { - bug!("polonius liveness facts not implemented yet") + if let Some(facts) = borrowck_context.all_facts { + for point in live_at.iter() { + let loc = elements.to_location(point); + facts.region_live_at.push((live_region_vid, location_table.start_index(loc))); + facts.region_live_at.push((live_region_vid, location_table.mid_index(loc))); + } } }); } diff --git a/src/librustc_mir/borrow_check/nll/type_check/mod.rs b/src/librustc_mir/borrow_check/nll/type_check/mod.rs index 70687d0efa40..4c2ef58a3a78 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/mod.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/mod.rs @@ -17,37 +17,38 @@ use borrow_check::nll::constraints::{ConstraintCategory, ConstraintSet, Outlives use borrow_check::nll::facts::AllFacts; use borrow_check::nll::region_infer::values::{LivenessValues, RegionValueElements}; use borrow_check::nll::region_infer::{ClosureRegionRequirementsExt, TypeTest}; +use borrow_check::nll::renumber; use borrow_check::nll::type_check::free_region_relations::{ CreateResult, UniversalRegionRelations, }; use borrow_check::nll::universal_regions::UniversalRegions; use borrow_check::nll::ToRegionVid; -use borrow_check::nll::renumber; use dataflow::move_paths::MoveData; use dataflow::FlowAtLocation; use dataflow::MaybeInitializedPlaces; use rustc::hir; use rustc::hir::def_id::DefId; use rustc::infer::canonical::QueryRegionConstraint; -use rustc::infer::region_constraints::GenericKind; +use rustc::infer::outlives::env::RegionBoundPairs; use rustc::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime}; use rustc::mir::interpret::EvalErrorKind::BoundsCheck; use rustc::mir::tcx::PlaceTy; use rustc::mir::visit::{PlaceContext, Visitor}; use rustc::mir::*; -use rustc::traits::{ObligationCause, PredicateObligations}; use rustc::traits::query::type_op; use rustc::traits::query::type_op::custom::CustomTypeOp; use rustc::traits::query::{Fallible, NoSolution}; +use rustc::traits::{ObligationCause, PredicateObligations}; use rustc::ty::fold::TypeFoldable; -use rustc::ty::{self, CanonicalTy, RegionVid, ToPolyTraitRef, Ty, TyCtxt, TyKind}; use rustc::ty::subst::Subst; -use std::fmt; +use rustc::ty::{self, CanonicalTy, RegionVid, ToPolyTraitRef, Ty, TyCtxt, TyKind}; +use std::{fmt, iter}; use std::rc::Rc; use syntax_pos::{Span, DUMMY_SP}; use transform::{MirPass, MirSource}; use rustc_data_structures::fx::FxHashSet; +use either::Either; macro_rules! span_mirbug { ($context:expr, $elem:expr, $($message:tt)*) => ({ @@ -135,41 +136,35 @@ pub(crate) fn type_check<'gcx, 'tcx>( } = free_region_relations::create( infcx, param_env, - location_table, Some(implicit_region_bound), universal_regions, &mut constraints, - all_facts, ); - { - let mut borrowck_context = BorrowCheckContext { - universal_regions, - location_table, - borrow_set, - all_facts, - constraints: &mut constraints, - }; + let mut borrowck_context = BorrowCheckContext { + universal_regions, + location_table, + borrow_set, + all_facts, + constraints: &mut constraints, + }; - type_check_internal( - infcx, - mir_def_id, - param_env, - mir, - ®ion_bound_pairs, - Some(implicit_region_bound), - Some(&mut borrowck_context), - Some(&universal_region_relations), - |cx| { - cx.equate_inputs_and_outputs( - mir, - universal_regions, - &normalized_inputs_and_output, - ); - liveness::generate(cx, mir, elements, flow_inits, move_data); - }, - ); - } + type_check_internal( + infcx, + mir_def_id, + param_env, + mir, + ®ion_bound_pairs, + Some(implicit_region_bound), + Some(&mut borrowck_context), + Some(&universal_region_relations), + |cx| { + cx.equate_inputs_and_outputs(mir, universal_regions, &normalized_inputs_and_output); + liveness::generate(cx, mir, elements, flow_inits, move_data, location_table); + + cx.borrowck_context.as_mut().map(|bcx| translate_outlives_facts(bcx)); + }, + ); MirTypeckResults { constraints, @@ -182,7 +177,7 @@ fn type_check_internal<'a, 'gcx, 'tcx, R>( mir_def_id: DefId, param_env: ty::ParamEnv<'gcx>, mir: &'a Mir<'tcx>, - region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'a RegionBoundPairs<'tcx>, implicit_region_bound: Option>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>, @@ -212,6 +207,27 @@ fn type_check_internal<'a, 'gcx, 'tcx, R>( extra(&mut checker) } +fn translate_outlives_facts(cx: &mut BorrowCheckContext) { + if let Some(facts) = cx.all_facts { + let location_table = cx.location_table; + facts.outlives.extend( + cx.constraints.outlives_constraints.iter().flat_map(|constraint: &OutlivesConstraint| { + if let Some(from_location) = constraint.locations.from_location() { + Either::Left(iter::once(( + constraint.sup, + constraint.sub, + location_table.mid_index(from_location), + ))) + } else { + Either::Right(location_table.all_points().map(move |location| { + (constraint.sup, constraint.sub, location) + })) + } + }) + ); + } +} + fn mirbug(tcx: TyCtxt, span: Span, msg: &str) { // We sometimes see MIR failures (notably predicate failures) due to // the fact that we check rvalue sized predicates here. So use `delay_span_bug` @@ -377,14 +393,12 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> { debug!("sanitize_constant: expected_ty={:?}", constant.literal.ty); - if let Err(terr) = self.cx - .eq_types( - constant.literal.ty, - constant.ty, - location.to_locations(), - ConstraintCategory::Boring, - ) - { + if let Err(terr) = self.cx.eq_types( + constant.literal.ty, + constant.ty, + location.to_locations(), + ConstraintCategory::Boring, + ) { span_mirbug!( self, constant, @@ -429,12 +443,10 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> { let sty = self.sanitize_type(place, sty); let ty = self.tcx().type_of(def_id); let ty = self.cx.normalize(ty, location); - if let Err(terr) = self.cx.eq_types( - ty, - sty, - location.to_locations(), - ConstraintCategory::Boring, - ) { + if let Err(terr) = + self.cx + .eq_types(ty, sty, location.to_locations(), ConstraintCategory::Boring) + { span_mirbug!( self, place, @@ -693,7 +705,7 @@ struct TypeChecker<'a, 'gcx: 'tcx, 'tcx: 'a> { last_span: Span, mir: &'a Mir<'tcx>, mir_def_id: DefId, - region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'a RegionBoundPairs<'tcx>, implicit_region_bound: Option>, reported_errors: FxHashSet<(Ty<'tcx>, Span)>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, @@ -802,7 +814,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { mir: &'a Mir<'tcx>, mir_def_id: DefId, param_env: ty::ParamEnv<'gcx>, - region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)], + region_bound_pairs: &'a RegionBoundPairs<'tcx>, implicit_region_bound: Option>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>, @@ -861,7 +873,6 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { constraint_conversion::ConstraintConversion::new( self.infcx.tcx, borrowck_context.universal_regions, - borrowck_context.location_table, self.region_bound_pairs, self.implicit_region_bound, self.param_env, @@ -869,7 +880,6 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { category, &mut borrowck_context.constraints.outlives_constraints, &mut borrowck_context.constraints.type_tests, - &mut borrowck_context.all_facts, ).convert_all(&data); } } @@ -955,66 +965,55 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let tcx = infcx.tcx; let param_env = self.param_env; let parent_def_id = infcx.tcx.closure_base_def_id(self.mir_def_id); - let opaque_type_map = - self.fully_perform_op( - locations, - category, - CustomTypeOp::new( - |infcx| { - let mut obligations = ObligationAccumulator::default(); + let opaque_type_map = self.fully_perform_op( + locations, + category, + CustomTypeOp::new( + |infcx| { + let mut obligations = ObligationAccumulator::default(); - let dummy_body_id = ObligationCause::dummy().body_id; - let (output_ty, opaque_type_map) = - obligations.add(infcx.instantiate_opaque_types( - parent_def_id, - dummy_body_id, - param_env, - &anon_ty, - )); + let dummy_body_id = ObligationCause::dummy().body_id; + let (output_ty, opaque_type_map) = + obligations.add(infcx.instantiate_opaque_types( + parent_def_id, + dummy_body_id, + param_env, + &anon_ty, + )); + debug!( + "eq_opaque_type_and_type: \ + instantiated output_ty={:?} \ + opaque_type_map={:#?} \ + revealed_ty={:?}", + output_ty, opaque_type_map, revealed_ty + ); + obligations.add(infcx + .at(&ObligationCause::dummy(), param_env) + .eq(output_ty, revealed_ty)?); + + for (&opaque_def_id, opaque_decl) in &opaque_type_map { + let opaque_defn_ty = tcx.type_of(opaque_def_id); + let opaque_defn_ty = opaque_defn_ty.subst(tcx, opaque_decl.substs); + let opaque_defn_ty = renumber::renumber_regions(infcx, &opaque_defn_ty); debug!( - "eq_opaque_type_and_type: \ - instantiated output_ty={:?} \ - opaque_type_map={:#?} \ - revealed_ty={:?}", - output_ty, - opaque_type_map, - revealed_ty - ); - obligations.add( - infcx - .at(&ObligationCause::dummy(), param_env) - .eq(output_ty, revealed_ty)?, + "eq_opaque_type_and_type: concrete_ty={:?} opaque_defn_ty={:?}", + opaque_decl.concrete_ty, opaque_defn_ty ); + obligations.add(infcx + .at(&ObligationCause::dummy(), param_env) + .eq(opaque_decl.concrete_ty, opaque_defn_ty)?); + } - for (&opaque_def_id, opaque_decl) in &opaque_type_map { - let opaque_defn_ty = tcx.type_of(opaque_def_id); - let opaque_defn_ty = opaque_defn_ty.subst(tcx, opaque_decl.substs); - let opaque_defn_ty = renumber::renumber_regions( - infcx, - &opaque_defn_ty, - ); - debug!( - "eq_opaque_type_and_type: concrete_ty={:?} opaque_defn_ty={:?}", - opaque_decl.concrete_ty, - opaque_defn_ty - ); - obligations.add( - infcx - .at(&ObligationCause::dummy(), param_env) - .eq(opaque_decl.concrete_ty, opaque_defn_ty)?, - ); - } + debug!("eq_opaque_type_and_type: equated"); - debug!("eq_opaque_type_and_type: equated"); - - Ok(InferOk { - value: Some(opaque_type_map), - obligations: obligations.into_vec(), - }) - }, - || "input_output".to_string(), - ), - )?; + Ok(InferOk { + value: Some(opaque_type_map), + obligations: obligations.into_vec(), + }) + }, + || "input_output".to_string(), + ), + )?; let universal_region_relations = match self.universal_region_relations { Some(rel) => rel, @@ -1035,7 +1034,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { infcx.constrain_opaque_type( opaque_def_id, &opaque_decl, - universal_region_relations + universal_region_relations, ); Ok(InferOk { value: (), @@ -1073,12 +1072,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let place_ty = place.ty(mir, tcx).to_ty(tcx); let rv_ty = rv.ty(mir, tcx); - if let Err(terr) = self.sub_types_or_anon( - rv_ty, - place_ty, - location.to_locations(), - category, - ) { + if let Err(terr) = + self.sub_types_or_anon(rv_ty, place_ty, location.to_locations(), category) + { span_mirbug!( self, stmt, @@ -1117,7 +1113,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { self.prove_trait_ref( trait_ref, location.to_locations(), - ConstraintCategory::SizedBound, + ConstraintCategory::SizedBound, ); } } @@ -1148,15 +1144,13 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { } StatementKind::AscribeUserType(ref place, variance, c_ty) => { let place_ty = place.ty(mir, tcx).to_ty(tcx); - if let Err(terr) = - self.relate_type_and_user_type( - place_ty, - variance, - c_ty, - Locations::All(stmt.source_info.span), - ConstraintCategory::TypeAnnotation, - ) - { + if let Err(terr) = self.relate_type_and_user_type( + place_ty, + variance, + c_ty, + Locations::All(stmt.source_info.span), + ConstraintCategory::TypeAnnotation, + ) { span_mirbug!( self, stmt, @@ -1208,12 +1202,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let rv_ty = value.ty(mir, tcx); let locations = term_location.to_locations(); - if let Err(terr) = self.sub_types( - rv_ty, - place_ty, - locations, - ConstraintCategory::Assignment, - ) { + if let Err(terr) = + self.sub_types(rv_ty, place_ty, locations, ConstraintCategory::Assignment) + { span_mirbug!( self, term, @@ -1327,8 +1318,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { ty, term_location.to_locations(), ConstraintCategory::Return, - ) - { + ) { span_mirbug!( self, term, @@ -1366,12 +1356,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let locations = term_location.to_locations(); - if let Err(terr) = self.sub_types_or_anon( - sig.output(), - dest_ty, - locations, - category, - ) { + if let Err(terr) = + self.sub_types_or_anon(sig.output(), dest_ty, locations, category) + { span_mirbug!( self, term, @@ -1539,12 +1526,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { } } - fn check_local( - &mut self, - mir: &Mir<'tcx>, - local: Local, - local_decl: &LocalDecl<'tcx>, - ) { + fn check_local(&mut self, mir: &Mir<'tcx>, local: Local, local_decl: &LocalDecl<'tcx>) { match mir.local_kind(local) { LocalKind::ReturnPointer | LocalKind::Arg => { // return values of normal functions are required to be @@ -1713,13 +1695,13 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { ConstraintCategory::Cast, ) { span_mirbug!( - self, - rvalue, - "equating {:?} with {:?} yields {:?}", - ty_fn_ptr_from, - ty, - terr - ); + self, + rvalue, + "equating {:?} with {:?} yields {:?}", + ty_fn_ptr_from, + ty, + terr + ); } } @@ -1739,13 +1721,13 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { ConstraintCategory::Cast, ) { span_mirbug!( - self, - rvalue, - "equating {:?} with {:?} yields {:?}", - ty_fn_ptr_from, - ty, - terr - ); + self, + rvalue, + "equating {:?} with {:?} yields {:?}", + ty_fn_ptr_from, + ty, + terr + ); } } @@ -1768,13 +1750,13 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { ConstraintCategory::Cast, ) { span_mirbug!( - self, - rvalue, - "equating {:?} with {:?} yields {:?}", - ty_fn_ptr_from, - ty, - terr - ); + self, + rvalue, + "equating {:?} with {:?} yields {:?}", + ty_fn_ptr_from, + ty, + terr + ); } } @@ -1957,14 +1939,6 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { category: ConstraintCategory::Boring, }); - if let Some(all_facts) = all_facts { - all_facts.outlives.push(( - ref_region.to_region_vid(), - borrow_region.to_region_vid(), - location_table.mid_index(location), - )); - } - match mutbl { hir::Mutability::MutImmutable => { // Immutable reference. We don't need the base @@ -2232,7 +2206,7 @@ impl MirPass for TypeckMir { def_id, param_env, mir, - &[], + &vec![], None, None, None, @@ -2277,4 +2251,3 @@ impl<'tcx> ObligationAccumulator<'tcx> { self.obligations } } - diff --git a/src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs b/src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs index 130b4b31d08e..13d59c3ba29c 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs @@ -10,15 +10,13 @@ use borrow_check::nll::constraints::{ConstraintCategory, OutlivesConstraint}; use borrow_check::nll::type_check::{BorrowCheckContext, Locations}; -use borrow_check::nll::universal_regions::UniversalRegions; -use borrow_check::nll::ToRegionVid; use rustc::infer::canonical::{Canonical, CanonicalVarInfos}; use rustc::infer::{InferCtxt, NLLRegionVariableOrigin}; use rustc::traits::query::Fallible; use rustc::ty::fold::{TypeFoldable, TypeVisitor}; use rustc::ty::relate::{self, Relate, RelateResult, TypeRelation}; use rustc::ty::subst::Kind; -use rustc::ty::{self, CanonicalTy, CanonicalVar, RegionVid, Ty, TyCtxt}; +use rustc::ty::{self, CanonicalTy, CanonicalVar, Ty, TyCtxt}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::indexed_vec::IndexVec; @@ -33,11 +31,9 @@ pub(super) fn sub_types<'tcx>( ) -> Fallible<()> { debug!("sub_types(a={:?}, b={:?}, locations={:?})", a, b, locations); TypeRelating::new( - infcx, + infcx.tcx, + NllTypeRelatingDelegate::new(infcx, borrowck_context, locations, category), ty::Variance::Covariant, - locations, - category, - borrowck_context, ty::List::empty(), ).relate(&a, &b)?; Ok(()) @@ -54,11 +50,9 @@ pub(super) fn eq_types<'tcx>( ) -> Fallible<()> { debug!("eq_types(a={:?}, b={:?}, locations={:?})", a, b, locations); TypeRelating::new( - infcx, + infcx.tcx, + NllTypeRelatingDelegate::new(infcx, borrowck_context, locations, category), ty::Variance::Invariant, - locations, - category, - borrowck_context, ty::List::empty(), ).relate(&a, &b)?; Ok(()) @@ -91,18 +85,22 @@ pub(super) fn relate_type_and_user_type<'tcx>( let v1 = ty::Contravariant.xform(v); TypeRelating::new( - infcx, + infcx.tcx, + NllTypeRelatingDelegate::new(infcx, borrowck_context, locations, category), v1, - locations, - category, - borrowck_context, b_variables, ).relate(&b_value, &a)?; Ok(()) } -struct TypeRelating<'cx, 'bccx: 'cx, 'gcx: 'tcx, 'tcx: 'bccx> { - infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>, +struct TypeRelating<'me, 'gcx: 'tcx, 'tcx: 'me, D> +where + D: TypeRelatingDelegate<'tcx>, +{ + tcx: TyCtxt<'me, 'gcx, 'tcx>, + + /// Callback to use when we deduce an outlives relationship + delegate: D, /// How are we relating `a` and `b`? /// @@ -122,19 +120,10 @@ struct TypeRelating<'cx, 'bccx: 'cx, 'gcx: 'tcx, 'tcx: 'bccx> { /// /// This field stores the instantiations for late-bound regions in /// the `a` type. - a_scopes: Vec, + a_scopes: Vec>, /// Same as `a_scopes`, but for the `b` type. - b_scopes: Vec, - - /// Where (and why) is this relation taking place? - locations: Locations, - - category: ConstraintCategory, - - /// This will be `Some` when we are running the type check as part - /// of NLL, and `None` if we are running a "sanity check". - borrowck_context: Option<&'cx mut BorrowCheckContext<'bccx, 'tcx>>, + b_scopes: Vec>, /// As we execute, the type on the LHS *may* come from a canonical /// source. In that case, we will sometimes find a constraint like @@ -150,37 +139,128 @@ struct TypeRelating<'cx, 'bccx: 'cx, 'gcx: 'tcx, 'tcx: 'bccx> { canonical_var_values: IndexVec>>, } +trait TypeRelatingDelegate<'tcx> { + /// Push a constraint `sup: sub` -- this constraint must be + /// satisfied for the two types to be related. `sub` and `sup` may + /// be regions from the type or new variables created through the + /// delegate. + fn push_outlives(&mut self, sup: ty::Region<'tcx>, sub: ty::Region<'tcx>); + + /// Creates a new region variable representing an instantiated + /// higher-ranked region; this will be either existential or + /// universal depending on the context. So e.g. if you have + /// `for<'a> fn(..) <: for<'b> fn(..)`, then we will first + /// instantiate `'b` with a universally quantitifed region and + /// then `'a` with an existentially quantified region (the order + /// is important so that the existential region `'a` can see the + /// universal one). + fn next_region_var( + &mut self, + universally_quantified: UniversallyQuantified, + ) -> ty::Region<'tcx>; + + /// Creates a new existential region in the given universe. This + /// is used when handling subtyping and type variables -- if we + /// have that `?X <: Foo<'a>`, for example, we would instantiate + /// `?X` with a type like `Foo<'?0>` where `'?0` is a fresh + /// existential variable created by this function. We would then + /// relate `Foo<'?0>` with `Foo<'a>` (and probably add an outlives + /// relation stating that `'?0: 'a`). + fn generalize_existential(&mut self, universe: ty::UniverseIndex) -> ty::Region<'tcx>; +} + +struct NllTypeRelatingDelegate<'me, 'bccx: 'me, 'gcx: 'tcx, 'tcx: 'bccx> { + infcx: &'me InferCtxt<'me, 'gcx, 'tcx>, + borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>, + + /// Where (and why) is this relation taking place? + locations: Locations, + + /// What category do we assign the resulting `'a: 'b` relationships? + category: ConstraintCategory, +} + +impl NllTypeRelatingDelegate<'me, 'bccx, 'gcx, 'tcx> { + fn new( + infcx: &'me InferCtxt<'me, 'gcx, 'tcx>, + borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>, + locations: Locations, + category: ConstraintCategory, + ) -> Self { + Self { + infcx, + borrowck_context, + locations, + category, + } + } +} + +impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, '_, 'tcx> { + fn next_region_var( + &mut self, + universally_quantified: UniversallyQuantified, + ) -> ty::Region<'tcx> { + let origin = if universally_quantified.0 { + NLLRegionVariableOrigin::BoundRegion(self.infcx.create_subuniverse()) + } else { + NLLRegionVariableOrigin::Existential + }; + self.infcx.next_nll_region_var(origin) + } + + fn generalize_existential(&mut self, universe: ty::UniverseIndex) -> ty::Region<'tcx> { + self.infcx + .next_nll_region_var_in_universe(NLLRegionVariableOrigin::Existential, universe) + } + + fn push_outlives(&mut self, sup: ty::Region<'tcx>, sub: ty::Region<'tcx>) { + if let Some(borrowck_context) = &mut self.borrowck_context { + let sub = borrowck_context.universal_regions.to_region_vid(sub); + let sup = borrowck_context.universal_regions.to_region_vid(sup); + borrowck_context + .constraints + .outlives_constraints + .push(OutlivesConstraint { + sup, + sub, + locations: self.locations, + category: self.category, + }); + } + } +} + #[derive(Clone, Debug)] struct ScopesAndKind<'tcx> { - scopes: Vec, + scopes: Vec>, kind: Kind<'tcx>, } #[derive(Clone, Debug, Default)] -struct BoundRegionScope { - map: FxHashMap, +struct BoundRegionScope<'tcx> { + map: FxHashMap>, } #[derive(Copy, Clone)] struct UniversallyQuantified(bool); -impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { +impl<'me, 'gcx, 'tcx, D> TypeRelating<'me, 'gcx, 'tcx, D> +where + D: TypeRelatingDelegate<'tcx>, +{ fn new( - infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>, + tcx: TyCtxt<'me, 'gcx, 'tcx>, + delegate: D, ambient_variance: ty::Variance, - locations: Locations, - category: ConstraintCategory, - borrowck_context: Option<&'cx mut BorrowCheckContext<'bccx, 'tcx>>, canonical_var_infos: CanonicalVarInfos<'tcx>, ) -> Self { let canonical_var_values = IndexVec::from_elem_n(None, canonical_var_infos.len()); Self { - infcx, + tcx, + delegate, ambient_variance, - borrowck_context, - locations, canonical_var_values, - category, a_scopes: vec![], b_scopes: vec![], } @@ -204,10 +284,10 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { &mut self, value: &ty::Binder>, universally_quantified: UniversallyQuantified, - ) -> BoundRegionScope { + ) -> BoundRegionScope<'tcx> { let mut scope = BoundRegionScope::default(); value.skip_binder().visit_with(&mut ScopeInstantiator { - infcx: self.infcx, + delegate: &mut self.delegate, target_index: ty::INNERMOST, universally_quantified, bound_region_scope: &mut scope, @@ -227,8 +307,8 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { debruijn: ty::DebruijnIndex, br: &ty::BoundRegion, first_free_index: ty::DebruijnIndex, - scopes: &[BoundRegionScope], - ) -> RegionVid { + scopes: &[BoundRegionScope<'tcx>], + ) -> ty::Region<'tcx> { // The debruijn index is a "reverse index" into the // scopes listing. So when we have INNERMOST (0), we // want the *last* scope pushed, and so forth. @@ -245,40 +325,23 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { /// with. Otherwise just return `r`. fn replace_bound_region( &self, - universal_regions: &UniversalRegions<'tcx>, r: ty::Region<'tcx>, first_free_index: ty::DebruijnIndex, - scopes: &[BoundRegionScope], - ) -> RegionVid { - match r { - ty::ReLateBound(debruijn, br) => { - Self::lookup_bound_region(*debruijn, br, first_free_index, scopes) - } - - ty::ReVar(v) => *v, - - _ => universal_regions.to_region_vid(r), + scopes: &[BoundRegionScope<'tcx>], + ) -> ty::Region<'tcx> { + if let ty::ReLateBound(debruijn, br) = r { + Self::lookup_bound_region(*debruijn, br, first_free_index, scopes) + } else { + r } } /// Push a new outlives requirement into our output set of /// constraints. - fn push_outlives(&mut self, sup: RegionVid, sub: RegionVid) { + fn push_outlives(&mut self, sup: ty::Region<'tcx>, sub: ty::Region<'tcx>) { debug!("push_outlives({:?}: {:?})", sup, sub); - if let Some(borrowck_context) = &mut self.borrowck_context { - borrowck_context - .constraints - .outlives_constraints - .push(OutlivesConstraint { - sup, - sub, - locations: self.locations, - category: self.category, - }); - - // FIXME all facts! - } + self.delegate.push_outlives(sup, sub); } /// When we encounter a canonical variable `var` in the output, @@ -316,12 +379,10 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { return result; } - fn generalize_value( - &self, - kind: Kind<'tcx>, - ) -> Kind<'tcx> { + fn generalize_value(&mut self, kind: Kind<'tcx>) -> Kind<'tcx> { TypeGeneralizer { - type_rel: self, + tcx: self.tcx, + delegate: &mut self.delegate, first_free_index: ty::INNERMOST, ambient_variance: self.ambient_variance, @@ -333,11 +394,12 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> { } } -impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> - for TypeRelating<'cx, 'bccx, 'gcx, 'tcx> +impl TypeRelation<'me, 'gcx, 'tcx> for TypeRelating<'me, 'gcx, 'tcx, D> +where + D: TypeRelatingDelegate<'tcx>, { - fn tcx(&self) -> TyCtxt<'cx, 'gcx, 'tcx> { - self.infcx.tcx + fn tcx(&self) -> TyCtxt<'me, 'gcx, 'tcx> { + self.tcx } fn tag(&self) -> &'static str { @@ -397,37 +459,30 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> a: ty::Region<'tcx>, b: ty::Region<'tcx>, ) -> RelateResult<'tcx, ty::Region<'tcx>> { - if let Some(&mut BorrowCheckContext { - universal_regions, .. - }) = self.borrowck_context - { - if let ty::ReCanonical(var) = a { - self.relate_var(*var, b.into())?; - return Ok(a); - } + if let ty::ReCanonical(var) = a { + self.relate_var(*var, b.into())?; + return Ok(a); + } - debug!( - "regions(a={:?}, b={:?}, variance={:?})", - a, b, self.ambient_variance - ); + debug!( + "regions(a={:?}, b={:?}, variance={:?})", + a, b, self.ambient_variance + ); - let v_a = - self.replace_bound_region(universal_regions, a, ty::INNERMOST, &self.a_scopes); - let v_b = - self.replace_bound_region(universal_regions, b, ty::INNERMOST, &self.b_scopes); + let v_a = self.replace_bound_region(a, ty::INNERMOST, &self.a_scopes); + let v_b = self.replace_bound_region(b, ty::INNERMOST, &self.b_scopes); - debug!("regions: v_a = {:?}", v_a); - debug!("regions: v_b = {:?}", v_b); + debug!("regions: v_a = {:?}", v_a); + debug!("regions: v_b = {:?}", v_b); - if self.ambient_covariance() { - // Covariance: a <= b. Hence, `b: a`. - self.push_outlives(v_b, v_a); - } + if self.ambient_covariance() { + // Covariance: a <= b. Hence, `b: a`. + self.push_outlives(v_b, v_a); + } - if self.ambient_contravariance() { - // Contravariant: b <= a. Hence, `a: b`. - self.push_outlives(v_a, v_b); - } + if self.ambient_contravariance() { + // Contravariant: b <= a. Hence, `a: b`. + self.push_outlives(v_a, v_b); } Ok(a) @@ -527,10 +582,8 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> // Reset ambient variance to contravariance. See the // covariant case above for an explanation. - let variance = ::std::mem::replace( - &mut self.ambient_variance, - ty::Variance::Contravariant, - ); + let variance = + ::std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant); self.relate(a.skip_binder(), b.skip_binder())?; @@ -551,15 +604,21 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> /// binder depth, and finds late-bound regions targeting the /// `for<..`>. For each of those, it creates an entry in /// `bound_region_scope`. -struct ScopeInstantiator<'cx, 'gcx: 'tcx, 'tcx: 'cx> { - infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>, +struct ScopeInstantiator<'me, 'tcx: 'me, D> +where + D: TypeRelatingDelegate<'tcx> + 'me, +{ + delegate: &'me mut D, // The debruijn index of the scope we are instantiating. target_index: ty::DebruijnIndex, universally_quantified: UniversallyQuantified, - bound_region_scope: &'cx mut BoundRegionScope, + bound_region_scope: &'me mut BoundRegionScope<'tcx>, } -impl<'cx, 'gcx, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'cx, 'gcx, 'tcx> { +impl<'me, 'tcx, D> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx, D> +where + D: TypeRelatingDelegate<'tcx>, +{ fn visit_binder>(&mut self, t: &ty::Binder) -> bool { self.target_index.shift_in(1); t.super_visit_with(self); @@ -570,21 +629,18 @@ impl<'cx, 'gcx, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'cx, 'gcx, 'tcx> { fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool { let ScopeInstantiator { - infcx, universally_quantified, + bound_region_scope, + delegate, .. - } = *self; + } = self; match r { ty::ReLateBound(debruijn, br) if *debruijn == self.target_index => { - self.bound_region_scope.map.entry(*br).or_insert_with(|| { - let origin = if universally_quantified.0 { - NLLRegionVariableOrigin::BoundRegion(infcx.create_subuniverse()) - } else { - NLLRegionVariableOrigin::Existential - }; - infcx.next_nll_region_var(origin).to_region_vid() - }); + bound_region_scope + .map + .entry(*br) + .or_insert_with(|| delegate.next_region_var(*universally_quantified)); } _ => {} @@ -613,8 +669,13 @@ impl<'cx, 'gcx, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'cx, 'gcx, 'tcx> { /// scopes. /// /// [blog post]: https://is.gd/0hKvIr -struct TypeGeneralizer<'me, 'bccx: 'me, 'gcx: 'tcx, 'tcx: 'bccx> { - type_rel: &'me TypeRelating<'me, 'bccx, 'gcx, 'tcx>, +struct TypeGeneralizer<'me, 'gcx: 'tcx, 'tcx: 'me, D> +where + D: TypeRelatingDelegate<'tcx> + 'me, +{ + tcx: TyCtxt<'me, 'gcx, 'tcx>, + + delegate: &'me mut D, /// After we generalize this type, we are going to relative it to /// some other type. What will be the variance at this point? @@ -625,9 +686,12 @@ struct TypeGeneralizer<'me, 'bccx: 'me, 'gcx: 'tcx, 'tcx: 'bccx> { universe: ty::UniverseIndex, } -impl TypeRelation<'me, 'gcx, 'tcx> for TypeGeneralizer<'me, 'bbcx, 'gcx, 'tcx> { +impl TypeRelation<'me, 'gcx, 'tcx> for TypeGeneralizer<'me, 'gcx, 'tcx, D> +where + D: TypeRelatingDelegate<'tcx>, +{ fn tcx(&self) -> TyCtxt<'me, 'gcx, 'tcx> { - self.type_rel.infcx.tcx + self.tcx } fn tag(&self) -> &'static str { @@ -710,9 +774,7 @@ impl TypeRelation<'me, 'gcx, 'tcx> for TypeGeneralizer<'me, 'bbcx, 'gcx, 'tcx> { // though, we may however need to check well-formedness or // risk a problem like #41677 again. - let replacement_region_vid = self.type_rel - .infcx - .next_nll_region_var_in_universe(NLLRegionVariableOrigin::Existential, self.universe); + let replacement_region_vid = self.delegate.generalize_existential(self.universe); Ok(replacement_region_vid) } diff --git a/src/librustc_mir/build/cfg.rs b/src/librustc_mir/build/cfg.rs index 8e40fd19941b..619ebb1675ca 100644 --- a/src/librustc_mir/build/cfg.rs +++ b/src/librustc_mir/build/cfg.rs @@ -76,7 +76,7 @@ impl<'tcx> CFG<'tcx> { rvalue: Rvalue<'tcx>) { self.push(block, Statement { source_info, - kind: StatementKind::Assign(place.clone(), rvalue) + kind: StatementKind::Assign(place.clone(), box rvalue) }); } diff --git a/src/librustc_mir/build/expr/stmt.rs b/src/librustc_mir/build/expr/stmt.rs index 0086cff46e53..32f09599ace8 100644 --- a/src/librustc_mir/build/expr/stmt.rs +++ b/src/librustc_mir/build/expr/stmt.rs @@ -143,11 +143,13 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { let outputs = outputs .into_iter() .map(|output| unpack!(block = this.as_place(block, output))) - .collect(); + .collect::>() + .into_boxed_slice(); let inputs = inputs .into_iter() .map(|input| unpack!(block = this.as_local_operand(block, input))) - .collect(); + .collect::>() + .into_boxed_slice(); this.cfg.push( block, Statement { diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index ed2f780baf1c..caf87fdd5ccc 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -270,7 +270,7 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> { // re-consider the current implementations of the // propagate_call_return method. - if let mir::Rvalue::Ref(region, _, ref place) = *rhs { + if let mir::Rvalue::Ref(region, _, ref place) = **rhs { if place.ignore_borrow( self.tcx, self.mir, diff --git a/src/librustc_mir/dataflow/move_paths/builder.rs b/src/librustc_mir/dataflow/move_paths/builder.rs index 63adcb5132a7..2884b15ca47d 100644 --- a/src/librustc_mir/dataflow/move_paths/builder.rs +++ b/src/librustc_mir/dataflow/move_paths/builder.rs @@ -290,7 +290,7 @@ impl<'b, 'a, 'gcx, 'tcx> Gatherer<'b, 'a, 'gcx, 'tcx> { self.gather_init(output, InitKind::Deep); } } - for input in inputs { + for input in inputs.iter() { self.gather_operand(input); } } diff --git a/src/librustc_mir/hair/pattern/check_match.rs b/src/librustc_mir/hair/pattern/check_match.rs index 23667d1b331a..6187e091319e 100644 --- a/src/librustc_mir/hair/pattern/check_match.rs +++ b/src/librustc_mir/hair/pattern/check_match.rs @@ -539,7 +539,7 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor, .emit(); } else if has_guard && !cx.tcx.allow_bind_by_move_patterns_with_guards() { let mut err = struct_span_err!(cx.tcx.sess, p.span, E0008, - "cannot bind by-move into a pattern guard"); + "cannot bind by-move into a pattern guard"); err.span_label(p.span, "moves value into pattern guard"); if cx.tcx.sess.opts.unstable_features.is_nightly_build() && cx.tcx.use_mir_borrowck() { err.help("add #![feature(bind_by_move_pattern_guards)] to the \ diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index a11150c47836..fef2f916b415 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -514,7 +514,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> rval: OpTy<'tcx>, ) -> EvalResult<'tcx, (u128, usize)> { trace!("read_discriminant_value {:#?}", rval.layout); - if rval.layout.abi.is_uninhabited() { + if rval.layout.abi == layout::Abi::Uninhabited { return err!(Unreachable); } diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs index a6c039756857..7ba72366af73 100644 --- a/src/librustc_mir/shim.rs +++ b/src/librustc_mir/shim.rs @@ -407,7 +407,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let ret_statement = self.make_statement( StatementKind::Assign( Place::Local(RETURN_PLACE), - Rvalue::Use(Operand::Copy(rcvr)) + box Rvalue::Use(Operand::Copy(rcvr)) ) ); self.block(vec![ret_statement], TerminatorKind::Return, false); @@ -458,7 +458,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let statement = self.make_statement( StatementKind::Assign( ref_loc.clone(), - Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src) + box Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src) ) ); @@ -485,7 +485,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let compute_cond = self.make_statement( StatementKind::Assign( cond.clone(), - Rvalue::BinaryOp(BinOp::Ne, Operand::Copy(end), Operand::Copy(beg)) + box Rvalue::BinaryOp(BinOp::Ne, Operand::Copy(end), Operand::Copy(beg)) ) ); @@ -521,13 +521,13 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::Use(Operand::Constant(self.make_usize(0))) + box Rvalue::Use(Operand::Constant(self.make_usize(0))) ) ), self.make_statement( StatementKind::Assign( end.clone(), - Rvalue::Use(Operand::Constant(self.make_usize(len))) + box Rvalue::Use(Operand::Constant(self.make_usize(len))) ) ) ]; @@ -555,7 +555,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::BinaryOp( + box Rvalue::BinaryOp( BinOp::Add, Operand::Copy(Place::Local(beg)), Operand::Constant(self.make_usize(1)) @@ -578,7 +578,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let init = self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::Use(Operand::Constant(self.make_usize(0))) + box Rvalue::Use(Operand::Constant(self.make_usize(0))) ) ); self.block(vec![init], TerminatorKind::Goto { target: BasicBlock::new(6) }, true); @@ -605,7 +605,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let statement = self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::BinaryOp( + box Rvalue::BinaryOp( BinOp::Add, Operand::Copy(Place::Local(beg)), Operand::Constant(self.make_usize(1)) @@ -715,7 +715,7 @@ fn build_call_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, source_info, kind: StatementKind::Assign( Place::Local(ref_rcvr), - Rvalue::Ref(tcx.types.re_erased, borrow_kind, rcvr_l) + box Rvalue::Ref(tcx.types.re_erased, borrow_kind, rcvr_l) ) }); Operand::Move(Place::Local(ref_rcvr)) @@ -851,7 +851,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>, source_info, kind: StatementKind::Assign( Place::Local(RETURN_PLACE), - Rvalue::Aggregate( + box Rvalue::Aggregate( box AggregateKind::Adt(adt_def, variant_no, substs, None, None), (1..sig.inputs().len()+1).map(|i| { Operand::Move(Place::Local(Local::new(i))) diff --git a/src/librustc_mir/transform/add_validation.rs b/src/librustc_mir/transform/add_validation.rs index 6efefdaa0040..5b489b5db942 100644 --- a/src/librustc_mir/transform/add_validation.rs +++ b/src/librustc_mir/transform/add_validation.rs @@ -320,12 +320,12 @@ impl MirPass for AddValidation { for i in (0..block_data.statements.len()).rev() { match block_data.statements[i].kind { // When the borrow of this ref expires, we need to recover validation. - StatementKind::Assign(_, Rvalue::Ref(_, _, _)) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, _)) => { // Due to a lack of NLL; we can't capture anything directly here. // Instead, we have to re-match and clone there. let (dest_place, re, src_place) = match block_data.statements[i].kind { StatementKind::Assign(ref dest_place, - Rvalue::Ref(re, _, ref src_place)) => { + box Rvalue::Ref(re, _, ref src_place)) => { (dest_place.clone(), re, src_place.clone()) }, _ => bug!("We already matched this."), @@ -354,17 +354,17 @@ impl MirPass for AddValidation { block_data.statements.insert(i, release_stmt); } // Casts can change what validation does (e.g. unsizing) - StatementKind::Assign(_, Rvalue::Cast(kind, Operand::Copy(_), _)) | - StatementKind::Assign(_, Rvalue::Cast(kind, Operand::Move(_), _)) + StatementKind::Assign(_, box Rvalue::Cast(kind, Operand::Copy(_), _)) | + StatementKind::Assign(_, box Rvalue::Cast(kind, Operand::Move(_), _)) if kind != CastKind::Misc => { // Due to a lack of NLL; we can't capture anything directly here. // Instead, we have to re-match and clone there. let (dest_place, src_place) = match block_data.statements[i].kind { StatementKind::Assign(ref dest_place, - Rvalue::Cast(_, Operand::Copy(ref src_place), _)) | + box Rvalue::Cast(_, Operand::Copy(ref src_place), _)) | StatementKind::Assign(ref dest_place, - Rvalue::Cast(_, Operand::Move(ref src_place), _)) => + box Rvalue::Cast(_, Operand::Move(ref src_place), _)) => { (dest_place.clone(), src_place.clone()) }, diff --git a/src/librustc_mir/transform/copy_prop.rs b/src/librustc_mir/transform/copy_prop.rs index fba60c7e8dc2..6d0b25b2c694 100644 --- a/src/librustc_mir/transform/copy_prop.rs +++ b/src/librustc_mir/transform/copy_prop.rs @@ -104,7 +104,7 @@ impl MirPass for CopyPropagation { // That use of the source must be an assignment. match statement.kind { - StatementKind::Assign(Place::Local(local), Rvalue::Use(ref operand)) if + StatementKind::Assign(Place::Local(local), box Rvalue::Use(ref operand)) if local == dest_local => { let maybe_action = match *operand { Operand::Copy(ref src_place) | @@ -155,11 +155,11 @@ fn eliminate_self_assignments<'tcx>( match stmt.kind { StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Copy(Place::Local(src_local))), + box Rvalue::Use(Operand::Copy(Place::Local(src_local))), ) | StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Move(Place::Local(src_local))), + box Rvalue::Use(Operand::Move(Place::Local(src_local))), ) if local == dest_local && dest_local == src_local => {} _ => { continue; diff --git a/src/librustc_mir/transform/deaggregator.rs b/src/librustc_mir/transform/deaggregator.rs index cff098c7b73d..8a14890f92e1 100644 --- a/src/librustc_mir/transform/deaggregator.rs +++ b/src/librustc_mir/transform/deaggregator.rs @@ -26,7 +26,7 @@ impl MirPass for Deaggregator { bb.expand_statements(|stmt| { // FIXME(eddyb) don't match twice on `stmt.kind` (post-NLL). if let StatementKind::Assign(_, ref rhs) = stmt.kind { - if let Rvalue::Aggregate(ref kind, _) = *rhs { + if let Rvalue::Aggregate(ref kind, _) = **rhs { // FIXME(#48193) Deaggregate arrays when it's cheaper to do so. if let AggregateKind::Array(_) = **kind { return None; @@ -41,8 +41,12 @@ impl MirPass for Deaggregator { let stmt = stmt.replace_nop(); let source_info = stmt.source_info; let (mut lhs, kind, operands) = match stmt.kind { - StatementKind::Assign(lhs, Rvalue::Aggregate(kind, operands)) - => (lhs, kind, operands), + StatementKind::Assign(lhs, box rvalue) => { + match rvalue { + Rvalue::Aggregate(kind, operands) => (lhs, kind, operands), + _ => bug!() + } + } _ => bug!() }; @@ -82,7 +86,7 @@ impl MirPass for Deaggregator { }; Statement { source_info, - kind: StatementKind::Assign(lhs_field, Rvalue::Use(op)), + kind: StatementKind::Assign(lhs_field, box Rvalue::Use(op)), } }).chain(set_discriminant)) }); diff --git a/src/librustc_mir/transform/elaborate_drops.rs b/src/librustc_mir/transform/elaborate_drops.rs index 92b6af8b51f7..9d77289d7b9b 100644 --- a/src/librustc_mir/transform/elaborate_drops.rs +++ b/src/librustc_mir/transform/elaborate_drops.rs @@ -478,7 +478,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { assert!(!data.is_cleanup, "DropAndReplace in unwind path not supported"); let assign = Statement { - kind: StatementKind::Assign(location.clone(), Rvalue::Use(value.clone())), + kind: StatementKind::Assign(location.clone(), box Rvalue::Use(value.clone())), source_info: terminator.source_info }; diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index 96111519550f..62adbf1bdf7d 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -188,7 +188,7 @@ impl<'a, 'tcx> TransformVisitor<'a, 'tcx> { }); Statement { source_info, - kind: StatementKind::Assign(state, Rvalue::Use(val)), + kind: StatementKind::Assign(state, box Rvalue::Use(val)), } } } @@ -246,7 +246,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for TransformVisitor<'a, 'tcx> { data.statements.push(Statement { source_info, kind: StatementKind::Assign(Place::Local(RETURN_PLACE), - self.make_state(state_idx, v)), + box self.make_state(state_idx, v)), }); let state = if let Some(resume) = resume { // Yield let state = 3 + self.suspension_points.len() as u32; diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs index 04f61235ca19..040ee35632cb 100644 --- a/src/librustc_mir/transform/inline.rs +++ b/src/librustc_mir/transform/inline.rs @@ -447,7 +447,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> { let stmt = Statement { source_info: callsite.location, - kind: StatementKind::Assign(tmp.clone(), dest) + kind: StatementKind::Assign(tmp.clone(), box dest) }; caller_mir[callsite.bb] .statements.push(stmt); @@ -594,7 +594,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> { let stmt = Statement { source_info: callsite.location, - kind: StatementKind::Assign(Place::Local(arg_tmp), arg), + kind: StatementKind::Assign(Place::Local(arg_tmp), box arg), }; caller_mir[callsite.bb].statements.push(stmt); arg_tmp diff --git a/src/librustc_mir/transform/lower_128bit.rs b/src/librustc_mir/transform/lower_128bit.rs index 8ed5600400b5..b2ddbe04d755 100644 --- a/src/librustc_mir/transform/lower_128bit.rs +++ b/src/librustc_mir/transform/lower_128bit.rs @@ -79,11 +79,14 @@ impl Lower128Bit { let bin_statement = block.statements.pop().unwrap(); let source_info = bin_statement.source_info; let (place, lhs, mut rhs) = match bin_statement.kind { - StatementKind::Assign(place, Rvalue::BinaryOp(_, lhs, rhs)) - | StatementKind::Assign(place, Rvalue::CheckedBinaryOp(_, lhs, rhs)) => { - (place, lhs, rhs) + StatementKind::Assign(place, box rvalue) => { + match rvalue { + Rvalue::BinaryOp(_, lhs, rhs) + | Rvalue::CheckedBinaryOp(_, lhs, rhs) => (place, lhs, rhs), + _ => bug!(), + } } - _ => bug!("Statement doesn't match pattern any more?"), + _ => bug!() }; if let Some(local) = cast_local { @@ -95,7 +98,7 @@ impl Lower128Bit { source_info: source_info, kind: StatementKind::Assign( Place::Local(local), - Rvalue::Cast( + box Rvalue::Cast( CastKind::Misc, rhs, rhs_override_ty.unwrap())), @@ -154,13 +157,13 @@ fn lower_to<'a, 'tcx, D>(statement: &Statement<'tcx>, local_decls: &D, tcx: TyCt where D: HasLocalDecls<'tcx> { match statement.kind { - StatementKind::Assign(_, Rvalue::BinaryOp(bin_op, ref lhs, _)) => { + StatementKind::Assign(_, box Rvalue::BinaryOp(bin_op, ref lhs, _)) => { let ty = lhs.ty(local_decls, tcx); if let Some(is_signed) = sign_of_128bit(ty) { return item_for_op(bin_op, is_signed); } }, - StatementKind::Assign(_, Rvalue::CheckedBinaryOp(bin_op, ref lhs, _)) => { + StatementKind::Assign(_, box Rvalue::CheckedBinaryOp(bin_op, ref lhs, _)) => { let ty = lhs.ty(local_decls, tcx); if let Some(is_signed) = sign_of_128bit(ty) { return item_for_checked_op(bin_op, is_signed); diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs index bb66b9ed6ece..34339b063419 100644 --- a/src/librustc_mir/transform/promote_consts.rs +++ b/src/librustc_mir/transform/promote_consts.rs @@ -182,7 +182,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { span, scope: OUTERMOST_SOURCE_SCOPE }, - kind: StatementKind::Assign(Place::Local(dest), rvalue) + kind: StatementKind::Assign(Place::Local(dest), box rvalue) }); } @@ -217,7 +217,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { // First, take the Rvalue or Call out of the source MIR, // or duplicate it, depending on keep_original. if loc.statement_index < no_stmts { - let (mut rvalue, source_info) = { + let (rvalue, source_info) = { let statement = &mut self.source[loc.block].statements[loc.statement_index]; let rhs = match statement.kind { StatementKind::Assign(_, ref mut rhs) => rhs, @@ -230,11 +230,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { (if self.keep_original { rhs.clone() } else { - let unit = Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); + let unit = box Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); mem::replace(rhs, unit) }, statement.source_info) }; + let mut rvalue = *rvalue; self.visit_rvalue(&mut rvalue, loc); self.assign(new_temp, rvalue, source_info.span); } else { @@ -301,7 +302,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { Candidate::Ref(loc) => { let ref mut statement = blocks[loc.block].statements[loc.statement_index]; match statement.kind { - StatementKind::Assign(_, Rvalue::Ref(_, _, ref mut place)) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, ref mut place)) => { // Find the underlying local for this (necessarily interior) borrow. // HACK(eddyb) using a recursive function because of mutable borrows. fn interior_base<'a, 'tcx>(place: &'a mut Place<'tcx>) diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index fed634f0f257..a6e2cad50940 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -388,7 +388,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> { match *candidate { Candidate::Ref(Location { block: bb, statement_index: stmt_idx }) => { match self.mir[bb].statements[stmt_idx].kind { - StatementKind::Assign(_, Rvalue::Ref(_, _, Place::Local(index))) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, Place::Local(index))) => { promoted_temps.insert(index); } _ => {} diff --git a/src/librustc_mir/transform/qualify_min_const_fn.rs b/src/librustc_mir/transform/qualify_min_const_fn.rs index 541b3c0607de..98420115d75d 100644 --- a/src/librustc_mir/transform/qualify_min_const_fn.rs +++ b/src/librustc_mir/transform/qualify_min_const_fn.rs @@ -15,7 +15,7 @@ pub fn is_min_const_fn( let mut current = def_id; loop { let predicates = tcx.predicates_of(current); - for predicate in &predicates.predicates { + for (predicate, _) in &predicates.predicates { match predicate { | Predicate::RegionOutlives(_) | Predicate::TypeOutlives(_) diff --git a/src/librustc_mir/transform/remove_noop_landing_pads.rs b/src/librustc_mir/transform/remove_noop_landing_pads.rs index 298e38228d35..4b4b284b02cd 100644 --- a/src/librustc_mir/transform/remove_noop_landing_pads.rs +++ b/src/librustc_mir/transform/remove_noop_landing_pads.rs @@ -60,7 +60,7 @@ impl RemoveNoopLandingPads { // instructions, but this should all run after borrowck). } - StatementKind::Assign(Place::Local(_), Rvalue::Use(_)) => { + StatementKind::Assign(Place::Local(_), box Rvalue::Use(_)) => { // Writing to a local (e.g. a drop flag) does not // turn a landing pad to a non-nop } diff --git a/src/librustc_mir/transform/rustc_peek.rs b/src/librustc_mir/transform/rustc_peek.rs index 487a18f6620b..05044574e5ca 100644 --- a/src/librustc_mir/transform/rustc_peek.rs +++ b/src/librustc_mir/transform/rustc_peek.rs @@ -171,7 +171,7 @@ fn each_block<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>, }; if place == peek_arg_place { - if let mir::Rvalue::Ref(_, mir::BorrowKind::Shared, ref peeking_at_place) = *rvalue { + if let mir::Rvalue::Ref(_, mir::BorrowKind::Shared, ref peeking_at_place) = **rvalue { // Okay, our search is over. match move_data.rev_lookup.find(peeking_at_place) { LookupResult::Exact(peek_mpi) => { diff --git a/src/librustc_mir/transform/uniform_array_move_out.rs b/src/librustc_mir/transform/uniform_array_move_out.rs index 78464b2a104e..b123a846596e 100644 --- a/src/librustc_mir/transform/uniform_array_move_out.rs +++ b/src/librustc_mir/transform/uniform_array_move_out.rs @@ -184,7 +184,7 @@ impl MirPass for RestoreSubsliceArrayMoveOut { for candidate in &visitor.candidates { let statement = &mir[candidate.block].statements[candidate.statement_index]; if let StatementKind::Assign(ref dst_place, ref rval) = statement.kind { - if let Rvalue::Aggregate(box AggregateKind::Array(_), ref items) = *rval { + if let Rvalue::Aggregate(box AggregateKind::Array(_), ref items) = **rval { let items : Vec<_> = items.iter().map(|item| { if let Operand::Move(Place::Local(local)) = item { let local_use = &visitor.locals_use[*local]; @@ -268,7 +268,7 @@ impl RestoreSubsliceArrayMoveOut { let statement = &block.statements[location.statement_index]; if let StatementKind::Assign( Place::Local(_), - Rvalue::Use(Operand::Move(Place::Projection(box PlaceProjection{ + box Rvalue::Use(Operand::Move(Place::Projection(box PlaceProjection{ ref base, elem: ProjectionElem::ConstantIndex{ offset, min_length: _, from_end: false}})))) = statement.kind { return Some((offset, base)) diff --git a/src/librustc_mir/util/elaborate_drops.rs b/src/librustc_mir/util/elaborate_drops.rs index 50bdc14d5099..9b8165181cc1 100644 --- a/src/librustc_mir/util/elaborate_drops.rs +++ b/src/librustc_mir/util/elaborate_drops.rs @@ -977,7 +977,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> fn assign(&self, lhs: &Place<'tcx>, rhs: Rvalue<'tcx>) -> Statement<'tcx> { Statement { source_info: self.source_info, - kind: StatementKind::Assign(lhs.clone(), rhs) + kind: StatementKind::Assign(lhs.clone(), box rhs) } } } diff --git a/src/librustc_mir/util/patch.rs b/src/librustc_mir/util/patch.rs index c2a56adc18f5..807c8386693f 100644 --- a/src/librustc_mir/util/patch.rs +++ b/src/librustc_mir/util/patch.rs @@ -130,7 +130,7 @@ impl<'tcx> MirPatch<'tcx> { } pub fn add_assign(&mut self, loc: Location, place: Place<'tcx>, rv: Rvalue<'tcx>) { - self.add_statement(loc, StatementKind::Assign(place, rv)); + self.add_statement(loc, StatementKind::Assign(place, box rv)); } pub fn make_nop(&mut self, loc: Location) { diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 47e8588857d6..1fe370b44c5b 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -434,7 +434,7 @@ impl<'b, 'a, 'tcx> ReachEverythingInTheInterfaceVisitor<'b, 'a, 'tcx> { fn predicates(&mut self) -> &mut Self { let predicates = self.ev.tcx.predicates_of(self.item_def_id); - for predicate in &predicates.predicates { + for (predicate, _) in &predicates.predicates { predicate.visit_with(self); match predicate { &ty::Predicate::Trait(poly_predicate) => { @@ -781,7 +781,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> { if self.check_trait_ref(*principal.skip_binder()) { return; } - for poly_predicate in projections { + for (poly_predicate, _) in projections { let tcx = self.tcx; if self.check_trait_ref(poly_predicate.skip_binder().projection_ty.trait_ref(tcx)) { return; @@ -956,7 +956,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> { } } ty::Opaque(def_id, ..) => { - for predicate in &self.tcx.predicates_of(def_id).predicates { + for (predicate, _) in &self.tcx.predicates_of(def_id).predicates { let trait_ref = match *predicate { ty::Predicate::Trait(ref poly_trait_predicate) => { Some(poly_trait_predicate.skip_binder().trait_ref) @@ -1387,7 +1387,7 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> { // for the inferred outlives rules; see // `src/test/ui/rfc-2093-infer-outlives/privacy.rs`. let predicates = self.tcx.explicit_predicates_of(self.item_def_id); - for predicate in &predicates.predicates { + for (predicate, _) in &predicates.predicates { predicate.visit_with(self); match predicate { &ty::Predicate::Trait(poly_predicate) => { diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 91b0e9c1dca6..5e3f74700991 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -42,8 +42,9 @@ use rustc::lint; use rustc::hir::def::*; use rustc::hir::def::Namespace::*; use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, DefId}; -use rustc::ty; use rustc::hir::{Freevar, FreevarMap, TraitCandidate, TraitMap, GlobMap}; +use rustc::session::config::nightly_options; +use rustc::ty; use rustc::util::nodemap::{NodeMap, NodeSet, FxHashMap, FxHashSet, DefIdMap}; use rustc_metadata::creader::CrateLoader; @@ -1381,6 +1382,9 @@ pub struct Resolver<'a, 'b: 'a> { /// The current self type if inside an impl (used for better errors). current_self_type: Option, + /// The current self item if inside an ADT (used for better errors). + current_self_item: Option, + /// The idents for the primitive types. primitive_type_table: PrimitiveTypeTable, @@ -1710,6 +1714,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { current_trait_ref: None, current_self_type: None, + current_self_item: None, primitive_type_table: PrimitiveTypeTable::new(), @@ -2186,15 +2191,17 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { } fn resolve_adt(&mut self, item: &Item, generics: &Generics) { - self.with_type_parameter_rib(HasTypeParameters(generics, ItemRibKind), |this| { - let item_def_id = this.definitions.local_def_id(item.id); - if this.session.features_untracked().self_in_typedefs { - this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| { + self.with_current_self_item(item, |this| { + this.with_type_parameter_rib(HasTypeParameters(generics, ItemRibKind), |this| { + let item_def_id = this.definitions.local_def_id(item.id); + if this.session.features_untracked().self_in_typedefs { + this.with_self_rib(Def::SelfTy(None, Some(item_def_id)), |this| { + visit::walk_item(this, item); + }); + } else { visit::walk_item(this, item); - }); - } else { - visit::walk_item(this, item); - } + } + }); }); } @@ -2435,6 +2442,15 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { result } + fn with_current_self_item(&mut self, self_item: &Item, f: F) -> T + where F: FnOnce(&mut Resolver) -> T + { + let previous_value = replace(&mut self.current_self_item, Some(self_item.id)); + let result = f(self); + self.current_self_item = previous_value; + result + } + /// This is called to resolve a trait reference from an `impl` (i.e. `impl Trait for Foo`) fn with_optional_trait_ref(&mut self, opt_trait_ref: Option<&TraitRef>, f: F) -> T where F: FnOnce(&mut Resolver, Option) -> T @@ -3004,6 +3020,10 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { "traits and impls" }; err.span_label(span, format!("`Self` is only available in {}", available_in)); + if this.current_self_item.is_some() && nightly_options::is_nightly_build() { + err.help("add #![feature(self_in_typedefs)] to the crate attributes \ + to enable"); + } return (err, Vec::new()); } if is_self_value(path, ns) { diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml index b6dd9ec8d3fd..e47f89c64ff0 100644 --- a/src/librustc_save_analysis/Cargo.toml +++ b/src/librustc_save_analysis/Cargo.toml @@ -12,6 +12,7 @@ crate-type = ["dylib"] log = "0.4" rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } +rustc_codegen_utils = { path = "../librustc_codegen_utils" } rustc_target = { path = "../librustc_target" } rustc_typeck = { path = "../librustc_typeck" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index d719d257f352..ab8f46867294 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -25,10 +25,12 @@ use rustc::hir::def::Def as HirDef; use rustc::hir::def_id::DefId; +use rustc::session::config::Input; use rustc::ty::{self, TyCtxt}; use rustc_data_structures::fx::FxHashSet; use std::path::Path; +use std::env; use syntax::ast::{self, Attribute, NodeId, PatKind, CRATE_NODE_ID}; use syntax::parse::token; @@ -49,8 +51,8 @@ use json_dumper::{Access, DumpOutput, JsonDumper}; use span_utils::SpanUtils; use sig; -use rls_data::{CratePreludeData, Def, DefKind, GlobalCrateId, Import, ImportKind, Ref, RefKind, - Relation, RelationKind, SpanData}; +use rls_data::{CompilationOptions, CratePreludeData, Def, DefKind, GlobalCrateId, Import, + ImportKind, Ref, RefKind, Relation, RelationKind, SpanData}; macro_rules! down_cast_data { ($id:ident, $kind:ident, $sp:expr) => { @@ -169,6 +171,54 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> { self.dumper.crate_prelude(data); } + pub fn dump_compilation_options(&mut self, input: &Input, crate_name: &str) { + // Apply possible `remap-path-prefix` remapping to the input source file + // (and don't include remapping args anymore) + let (program, arguments) = { + let remap_arg_indices = { + let mut indices = FxHashSet(); + // Args are guaranteed to be valid UTF-8 (checked early) + for (i, e) in env::args().enumerate() { + if e.starts_with("--remap-path-prefix=") { + indices.insert(i); + } else if e == "--remap-path-prefix" { + indices.insert(i); + indices.insert(i + 1); + } + } + indices + }; + + let mut args = env::args() + .enumerate() + .filter(|(i, _)| !remap_arg_indices.contains(i)) + .map(|(_, arg)| { + match input { + Input::File(ref path) if path == Path::new(&arg) => { + let mapped = &self.tcx.sess.local_crate_source_file; + mapped + .as_ref() + .unwrap() + .to_string_lossy() + .into() + }, + _ => arg, + } + }); + + (args.next().unwrap(), args.collect()) + }; + + let data = CompilationOptions { + directory: self.tcx.sess.working_dir.0.clone(), + program, + arguments, + output: self.save_ctxt.compilation_output(crate_name), + }; + + self.dumper.compilation_opts(data); + } + // Return all non-empty prefixes of a path. // For each prefix, we return the span for the last segment in the prefix and // a str representation of the entire prefix. diff --git a/src/librustc_save_analysis/json_dumper.rs b/src/librustc_save_analysis/json_dumper.rs index d2e52f98238d..e14ac73ee102 100644 --- a/src/librustc_save_analysis/json_dumper.rs +++ b/src/librustc_save_analysis/json_dumper.rs @@ -12,9 +12,9 @@ use std::io::Write; use rustc_serialize::json::as_json; -use rls_data::{self, Analysis, CratePreludeData, Def, DefKind, Import, MacroRef, Ref, RefKind, - Relation, Impl}; use rls_data::config::Config; +use rls_data::{self, Analysis, CompilationOptions, CratePreludeData, Def, DefKind, Impl, Import, + MacroRef, Ref, RefKind, Relation}; use rls_span::{Column, Row}; #[derive(Debug)] @@ -89,6 +89,10 @@ impl<'b, O: DumpOutput + 'b> JsonDumper { self.result.prelude = Some(data) } + pub fn compilation_opts(&mut self, data: CompilationOptions) { + self.result.compilation = Some(data); + } + pub fn macro_use(&mut self, data: MacroRef) { if self.config.pub_only || self.config.reachable_only { return; diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index c9bae297031f..f6045c7b2d2d 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -23,6 +23,7 @@ extern crate rustc; #[macro_use] extern crate log; extern crate rustc_data_structures; +extern crate rustc_codegen_utils; extern crate rustc_serialize; extern crate rustc_target; extern crate rustc_typeck; @@ -45,9 +46,10 @@ use rustc::hir::def::Def as HirDef; use rustc::hir::Node; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; use rustc::middle::cstore::ExternCrate; -use rustc::session::config::CrateType; +use rustc::session::config::{CrateType, Input, OutputType}; use rustc::ty::{self, TyCtxt}; use rustc_typeck::hir_ty_to_ty; +use rustc_codegen_utils::link::{filename_for_metadata, out_filename}; use std::cell::Cell; use std::default::Default; @@ -110,6 +112,24 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { } } + // Returns path to the compilation output (e.g. libfoo-12345678.rmeta) + pub fn compilation_output(&self, crate_name: &str) -> PathBuf { + let sess = &self.tcx.sess; + // Save-analysis is emitted per whole session, not per each crate type + let crate_type = sess.crate_types.borrow()[0]; + let outputs = &*self.tcx.output_filenames(LOCAL_CRATE); + + if outputs.outputs.contains_key(&OutputType::Metadata) { + filename_for_metadata(sess, crate_name, outputs) + } else if outputs.outputs.should_codegen() { + out_filename(sess, crate_type, outputs, crate_name) + } else { + // Otherwise it's only a DepInfo, in which case we return early and + // not even reach the analysis stage. + unreachable!() + } + } + // List external crates used by the current crate. pub fn get_external_crates(&self) -> Vec { let mut result = Vec::with_capacity(self.tcx.crates().len()); @@ -126,7 +146,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { result.push(ExternalCrateData { // FIXME: change file_name field to PathBuf in rls-data // https://github.com/nrc/rls-data/issues/7 - file_name: self.span_utils.make_path_string(&lo_loc.file.name), + file_name: self.span_utils.make_filename_string(&lo_loc.file), num: n.as_u32(), id: GlobalCrateId { name: self.tcx.crate_name(n).to_string(), @@ -1015,6 +1035,7 @@ pub trait SaveHandler { save_ctxt: SaveContext<'l, 'tcx>, krate: &ast::Crate, cratename: &str, + input: &'l Input, ); } @@ -1080,12 +1101,14 @@ impl<'a> SaveHandler for DumpHandler<'a> { save_ctxt: SaveContext<'l, 'tcx>, krate: &ast::Crate, cratename: &str, + input: &'l Input, ) { let output = &mut self.output_file(&save_ctxt); let mut dumper = JsonDumper::new(output, save_ctxt.config.clone()); let mut visitor = DumpVisitor::new(save_ctxt, &mut dumper); visitor.dump_crate_info(cratename, krate); + visitor.dump_compilation_options(input, cratename); visit::walk_crate(&mut visitor, krate); } } @@ -1101,6 +1124,7 @@ impl<'b> SaveHandler for CallbackHandler<'b> { save_ctxt: SaveContext<'l, 'tcx>, krate: &ast::Crate, cratename: &str, + input: &'l Input, ) { // We're using the JsonDumper here because it has the format of the // save-analysis results that we will pass to the callback. IOW, we are @@ -1111,6 +1135,7 @@ impl<'b> SaveHandler for CallbackHandler<'b> { let mut visitor = DumpVisitor::new(save_ctxt, &mut dumper); visitor.dump_crate_info(cratename, krate); + visitor.dump_compilation_options(input, cratename); visit::walk_crate(&mut visitor, krate); } } @@ -1120,6 +1145,7 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>( krate: &ast::Crate, analysis: &'l ty::CrateAnalysis, cratename: &str, + input: &'l Input, config: Option, mut handler: H, ) { @@ -1137,7 +1163,7 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>( impl_counter: Cell::new(0), }; - handler.save(save_ctxt, krate, cratename) + handler.save(save_ctxt, krate, cratename, input) }) } diff --git a/src/librustc_save_analysis/span_utils.rs b/src/librustc_save_analysis/span_utils.rs index 2550a312c5d6..47677a751712 100644 --- a/src/librustc_save_analysis/span_utils.rs +++ b/src/librustc_save_analysis/span_utils.rs @@ -35,14 +35,24 @@ impl<'a> SpanUtils<'a> { } } - pub fn make_path_string(&self, path: &FileName) -> String { - match *path { - FileName::Real(ref path) if !path.is_absolute() => - self.sess.working_dir.0 - .join(&path) - .display() - .to_string(), - _ => path.to_string(), + pub fn make_filename_string(&self, file: &SourceFile) -> String { + match &file.name { + FileName::Real(path) if !file.name_was_remapped => { + if path.is_absolute() { + self.sess.source_map().path_mapping() + .map_prefix(path.clone()).0 + .display() + .to_string() + } else { + self.sess.working_dir.0 + .join(&path) + .display() + .to_string() + } + }, + // If the file name is already remapped, we assume the user + // configured it the way they wanted to, so use that directly + filename => filename.to_string() } } diff --git a/src/librustc_target/abi/mod.rs b/src/librustc_target/abi/mod.rs index 96eb69163220..5c4cd849f89b 100644 --- a/src/librustc_target/abi/mod.rs +++ b/src/librustc_target/abi/mod.rs @@ -802,14 +802,6 @@ impl Abi { _ => false, } } - - /// Returns true if this is an uninhabited type - pub fn is_uninhabited(&self) -> bool { - match *self { - Abi::Uninhabited => true, - _ => false, - } - } } #[derive(PartialEq, Eq, Hash, Debug)] diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs index 3c68b5a7ab11..3f1e8ee55286 100644 --- a/src/librustc_target/spec/mod.rs +++ b/src/librustc_target/spec/mod.rs @@ -761,7 +761,7 @@ impl Default for TargetOptions { } impl Target { - /// Given a function ABI, turn "System" into the correct ABI for this target. + /// Given a function ABI, turn it into the correct ABI for this target. pub fn adjust_abi(&self, abi: Abi) -> Abi { match abi { Abi::System => { @@ -771,6 +771,16 @@ impl Target { Abi::C } }, + // These ABI kinds are ignored on non-x86 Windows targets. + // See https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions + // and the individual pages for __stdcall et al. + Abi::Stdcall | Abi::Fastcall | Abi::Vectorcall | Abi::Thiscall => { + if self.options.is_like_windows && self.arch != "x86" { + Abi::C + } else { + abi + } + }, abi => abi } } diff --git a/src/librustc_traits/lowering.rs b/src/librustc_traits/lowering.rs index 9fd3b318ec14..ad724babe49f 100644 --- a/src/librustc_traits/lowering.rs +++ b/src/librustc_traits/lowering.rs @@ -260,7 +260,10 @@ fn program_clauses_for_trait<'a, 'tcx>( let clauses = iter::once(Clause::ForAll(ty::Binder::dummy(implemented_from_env))); - let where_clauses = &tcx.predicates_defined_on(def_id).predicates; + let where_clauses = &tcx.predicates_defined_on(def_id).predicates + .into_iter() + .map(|(wc, _)| wc.lower()) + .collect::>(); // Rule Implied-Bound-From-Trait // @@ -273,8 +276,8 @@ fn program_clauses_for_trait<'a, 'tcx>( // `FromEnv(WC) :- FromEnv(Self: Trait)`, for each where clause WC let implied_bound_clauses = where_clauses - .into_iter() - .map(|wc| wc.lower()) + .iter() + .cloned() // `FromEnv(WC) :- FromEnv(Self: Trait)` .map(|wc| wc.map_bound(|goal| ProgramClause { @@ -296,8 +299,8 @@ fn program_clauses_for_trait<'a, 'tcx>( let wf_conditions = iter::once(ty::Binder::dummy(trait_pred.lower())) .chain( where_clauses - .into_iter() - .map(|wc| wc.lower()) + .iter() + .cloned() .map(|wc| wc.map_bound(|goal| goal.into_well_formed_goal())) ); @@ -338,7 +341,10 @@ fn program_clauses_for_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId let trait_pred = ty::TraitPredicate { trait_ref }.lower(); // `WC` - let where_clauses = tcx.predicates_of(def_id).predicates.lower(); + let where_clauses = tcx.predicates_of(def_id).predicates + .into_iter() + .map(|(wc, _)| wc.lower()) + .collect::>(); // `Implemented(A0: Trait) :- WC` let clause = ProgramClause { @@ -370,7 +376,10 @@ pub fn program_clauses_for_type_def<'a, 'tcx>( let ty = tcx.type_of(def_id); // `WC` - let where_clauses = tcx.predicates_of(def_id).predicates.lower(); + let where_clauses = tcx.predicates_of(def_id).predicates + .into_iter() + .map(|(wc, _)| wc.lower()) + .collect::>(); // `WellFormed(Ty<...>) :- WC1, ..., WCm` let well_formed = ProgramClause { diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 72502cda6e02..057a586e9ac9 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -693,7 +693,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { pub(super) fn instantiate_poly_trait_ref_inner(&self, trait_ref: &hir::TraitRef, self_ty: Ty<'tcx>, - poly_projections: &mut Vec>, + poly_projections: &mut Vec<(ty::PolyProjectionPredicate<'tcx>, Span)>, speculative: bool) -> ty::PolyTraitRef<'tcx> { @@ -716,7 +716,8 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { let predicate: Result<_, ErrorReported> = self.ast_type_binding_to_poly_projection_predicate( trait_ref.ref_id, poly_trait_ref, binding, speculative, &mut dup_bindings); - predicate.ok() // ok to ignore Err() because ErrorReported (see above) + // ok to ignore Err() because ErrorReported (see above) + Some((predicate.ok()?, binding.span)) })); debug!("ast_path_to_poly_trait_ref({:?}, projections={:?}) -> {:?}", @@ -727,7 +728,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { pub fn instantiate_poly_trait_ref(&self, poly_trait_ref: &hir::PolyTraitRef, self_ty: Ty<'tcx>, - poly_projections: &mut Vec>) + poly_projections: &mut Vec<(ty::PolyProjectionPredicate<'tcx>, Span)>) -> ty::PolyTraitRef<'tcx> { self.instantiate_poly_trait_ref_inner(&poly_trait_ref.trait_ref, self_ty, @@ -974,7 +975,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { let existential_principal = principal.map_bound(|trait_ref| { self.trait_ref_to_existential(trait_ref) }); - let existential_projections = projection_bounds.iter().map(|bound| { + let existential_projections = projection_bounds.iter().map(|(bound, _)| { bound.map_bound(|b| { let trait_ref = self.trait_ref_to_existential(b.projection_ty.trait_ref(tcx)); ty::ExistentialProjection { @@ -1006,7 +1007,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { .map(|item| item.def_id)); } - for projection_bound in &projection_bounds { + for (projection_bound, _) in &projection_bounds { associated_types.remove(&projection_bound.projection_def_id()); } @@ -1089,7 +1090,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { let tcx = self.tcx(); let bounds: Vec<_> = self.get_type_parameter_bounds(span, ty_param_def_id) - .predicates.into_iter().filter_map(|p| p.to_opt_poly_trait_ref()).collect(); + .predicates.into_iter().filter_map(|(p, _)| p.to_opt_poly_trait_ref()).collect(); // Check that there is exactly one way to find an associated type with the // correct name. @@ -1701,42 +1702,41 @@ fn split_auto_traits<'a, 'b, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, // and return from functions in multiple places. #[derive(PartialEq, Eq, Clone, Debug)] pub struct Bounds<'tcx> { - pub region_bounds: Vec>, - pub implicitly_sized: bool, - pub trait_bounds: Vec>, - pub projection_bounds: Vec>, + pub region_bounds: Vec<(ty::Region<'tcx>, Span)>, + pub implicitly_sized: Option, + pub trait_bounds: Vec<(ty::PolyTraitRef<'tcx>, Span)>, + pub projection_bounds: Vec<(ty::PolyProjectionPredicate<'tcx>, Span)>, } impl<'a, 'gcx, 'tcx> Bounds<'tcx> { pub fn predicates(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, param_ty: Ty<'tcx>) - -> Vec> + -> Vec<(ty::Predicate<'tcx>, Span)> { // If it could be sized, and is, add the sized predicate - let sized_predicate = if self.implicitly_sized { + let sized_predicate = self.implicitly_sized.and_then(|span| { tcx.lang_items().sized_trait().map(|sized| { let trait_ref = ty::TraitRef { def_id: sized, substs: tcx.mk_substs_trait(param_ty, &[]) }; - trait_ref.to_predicate() + (trait_ref.to_predicate(), span) }) - } else { - None - }; + }); sized_predicate.into_iter().chain( - self.region_bounds.iter().map(|®ion_bound| { + self.region_bounds.iter().map(|&(region_bound, span)| { // account for the binder being introduced below; no need to shift `param_ty` // because, at present at least, it can only refer to early-bound regions let region_bound = tcx.mk_region(ty::fold::shift_region(*region_bound, 1)); - ty::Binder::dummy(ty::OutlivesPredicate(param_ty, region_bound)).to_predicate() + let outlives = ty::OutlivesPredicate(param_ty, region_bound); + (ty::Binder::dummy(outlives).to_predicate(), span) }).chain( - self.trait_bounds.iter().map(|bound_trait_ref| { - bound_trait_ref.to_predicate() + self.trait_bounds.iter().map(|&(bound_trait_ref, span)| { + (bound_trait_ref.to_predicate(), span) }) ).chain( - self.projection_bounds.iter().map(|projection| { - projection.to_predicate() + self.projection_bounds.iter().map(|&(projection, span)| { + (projection.to_predicate(), span) }) ) ).collect() diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index ac754f9af58f..88e2e02cf503 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -81,35 +81,33 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // // See the examples in `run-pass/match-defbm*.rs`. let mut pat_adjustments = vec![]; - expected = loop { + while let ty::Ref(_, inner_ty, inner_mutability) = exp_ty.sty { debug!("inspecting {:?} with type {:?}", exp_ty, exp_ty.sty); - match exp_ty.sty { - ty::Ref(_, inner_ty, inner_mutability) => { - debug!("current discriminant is Ref, inserting implicit deref"); - // Preserve the reference type. We'll need it later during HAIR lowering. - pat_adjustments.push(exp_ty); - exp_ty = inner_ty; - def_bm = match def_bm { - // If default binding mode is by value, make it `ref` or `ref mut` - // (depending on whether we observe `&` or `&mut`). - ty::BindByValue(_) => - ty::BindByReference(inner_mutability), + debug!("current discriminant is Ref, inserting implicit deref"); + // Preserve the reference type. We'll need it later during HAIR lowering. + pat_adjustments.push(exp_ty); - // Once a `ref`, always a `ref`. This is because a `& &mut` can't mutate - // the underlying value. - ty::BindByReference(hir::Mutability::MutImmutable) => - ty::BindByReference(hir::Mutability::MutImmutable), + exp_ty = inner_ty; + def_bm = match def_bm { + // If default binding mode is by value, make it `ref` or `ref mut` + // (depending on whether we observe `&` or `&mut`). + ty::BindByValue(_) => + ty::BindByReference(inner_mutability), + + // Once a `ref`, always a `ref`. This is because a `& &mut` can't mutate + // the underlying value. + ty::BindByReference(hir::Mutability::MutImmutable) => + ty::BindByReference(hir::Mutability::MutImmutable), + + // When `ref mut`, stay a `ref mut` (on `&mut`) or downgrade to `ref` + // (on `&`). + ty::BindByReference(hir::Mutability::MutMutable) => + ty::BindByReference(inner_mutability), + }; + } + expected = exp_ty; - // When `ref mut`, stay a `ref mut` (on `&mut`) or downgrade to `ref` - // (on `&`). - ty::BindByReference(hir::Mutability::MutMutable) => - ty::BindByReference(inner_mutability), - }; - }, - _ => break exp_ty, - } - }; if pat_adjustments.len() > 0 { debug!("default binding mode is now {:?}", def_bm); self.inh.tables.borrow_mut() @@ -153,7 +151,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { if let ty::Ref(_, r_ty, _) = expected_ty.sty { if let ty::Slice(_) = r_ty.sty { pat_ty = tcx.mk_imm_ref(tcx.types.re_static, - tcx.mk_slice(tcx.types.u8)) + tcx.mk_slice(tcx.types.u8)) } } } @@ -294,7 +292,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let element_tys_iter = (0..max_len).map(|_| self.next_ty_var( // FIXME: MiscVariable for now, obtaining the span and name information - // from all tuple elements isn't trivial. + // from all tuple elements isn't trivial. TypeVariableOrigin::TypeInference(pat.span))); let element_tys = tcx.mk_type_list(element_tys_iter); let pat_ty = tcx.mk_ty(ty::Tuple(element_tys)); @@ -394,7 +392,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { tcx.sess, pat.span, E0527, "pattern requires {} elements but array has {}", min_len, size) - .span_label(pat.span, format!("expected {} elements",size)) + .span_label(pat.span, format!("expected {} elements", size)) .emit(); } (inner_ty, tcx.types.err) @@ -857,7 +855,7 @@ https://doc.rust-lang.org/reference/types.html#trait-objects"); subpats.len(), subpats_ending, def.kind_name(), variant.fields.len(), fields_ending) .span_label(pat.span, format!("expected {} field{}, found {}", - variant.fields.len(), fields_ending, subpats.len())) + variant.fields.len(), fields_ending, subpats.len())) .emit(); on_error(); return tcx.types.err; diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index 53186c64befd..de4293aaaeac 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -166,34 +166,31 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { None => continue, }; - match self.lookup_method_in_trait(call_expr.span, - method_name, - trait_def_id, - adjusted_ty, - None) { - None => continue, - Some(ok) => { - let method = self.register_infer_ok_obligations(ok); - let mut autoref = None; - if borrow { - if let ty::Ref(region, _, mutbl) = method.sig.inputs()[0].sty { - let mutbl = match mutbl { - hir::MutImmutable => AutoBorrowMutability::Immutable, - hir::MutMutable => AutoBorrowMutability::Mutable { - // For initial two-phase borrow - // deployment, conservatively omit - // overloaded function call ops. - allow_two_phase_borrow: AllowTwoPhase::No, - } - }; - autoref = Some(Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(region, mutbl)), - target: method.sig.inputs()[0] - }); - } + if let Some(ok) = self.lookup_method_in_trait(call_expr.span, + method_name, + trait_def_id, + adjusted_ty, + None) { + let method = self.register_infer_ok_obligations(ok); + let mut autoref = None; + if borrow { + if let ty::Ref(region, _, mutbl) = method.sig.inputs()[0].sty { + let mutbl = match mutbl { + hir::MutImmutable => AutoBorrowMutability::Immutable, + hir::MutMutable => AutoBorrowMutability::Mutable { + // For initial two-phase borrow + // deployment, conservatively omit + // overloaded function call ops. + allow_two_phase_borrow: AllowTwoPhase::No, + } + }; + autoref = Some(Adjustment { + kind: Adjust::Borrow(AutoBorrow::Ref(region, mutbl)), + target: method.sig.inputs()[0] + }); } - return Some((autoref, method)); } + return Some((autoref, method)); } } @@ -238,7 +235,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { err.span_suggestion_with_applicability( call_expr.span, &format!("`{}` is a unit variant, you need to write it \ - without the parenthesis", path), + without the parenthesis", path), path.to_string(), Applicability::MachineApplicable ); diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 85641854e6e2..564ecae15dc3 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -219,11 +219,11 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { let cast_ty = fcx.ty_to_string(self.cast_ty); err.span_label(error_span, format!("cannot cast `{}` as `{}`", - fcx.ty_to_string(self.expr_ty), - cast_ty)); + fcx.ty_to_string(self.expr_ty), + cast_ty)); if let Ok(snippet) = fcx.sess().source_map().span_to_snippet(self.expr.span) { err.span_help(self.expr.span, - &format!("did you mean `*{}`?", snippet)); + &format!("did you mean `*{}`?", snippet)); } err.emit(); } @@ -267,16 +267,16 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { } CastError::CastToChar => { type_error_struct!(fcx.tcx.sess, self.span, self.expr_ty, E0604, - "only `u8` can be cast as `char`, not `{}`", self.expr_ty).emit(); + "only `u8` can be cast as `char`, not `{}`", self.expr_ty).emit(); } CastError::NonScalar => { type_error_struct!(fcx.tcx.sess, self.span, self.expr_ty, E0605, - "non-primitive cast: `{}` as `{}`", - self.expr_ty, - fcx.ty_to_string(self.cast_ty)) - .note("an `as` expression can only be used to convert between \ - primitive types. Consider using the `From` trait") - .emit(); + "non-primitive cast: `{}` as `{}`", + self.expr_ty, + fcx.ty_to_string(self.cast_ty)) + .note("an `as` expression can only be used to convert between \ + primitive types. Consider using the `From` trait") + .emit(); } CastError::SizedUnsizedCast => { use structured_errors::{SizedUnsizedCastError, StructuredDiagnostic}; @@ -445,7 +445,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { self.expr_ty, fcx.tcx.mk_fn_ptr(f), AllowTwoPhase::No); - if !res.is_ok() { + if res.is_err() { return Err(CastError::NonScalar); } (FnPtr, t_cast) diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index f2c20238734e..202789d1d8af 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -231,20 +231,19 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { obligation.predicate ); - match obligation.predicate { + if let ty::Predicate::Projection(ref proj_predicate) = obligation.predicate { // Given a Projection predicate, we can potentially infer // the complete signature. - ty::Predicate::Projection(ref proj_predicate) => { - let trait_ref = proj_predicate.to_poly_trait_ref(self.tcx); - self.self_type_matches_expected_vid(trait_ref, expected_vid) - .and_then(|_| { - self.deduce_sig_from_projection( - Some(obligation.cause.span), - proj_predicate, - ) - }) - } - _ => None, + let trait_ref = proj_predicate.to_poly_trait_ref(self.tcx); + self.self_type_matches_expected_vid(trait_ref, expected_vid) + .and_then(|_| { + self.deduce_sig_from_projection( + Some(obligation.cause.span), + proj_predicate + ) + }) + } else { + None } }) .next(); @@ -318,9 +317,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let input_tys = match arg_param_ty.sty { ty::Tuple(tys) => tys.into_iter(), - _ => { - return None; - } + _ => return None }; let ret_param_ty = projection.skip_binder().ty; @@ -560,8 +557,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // The liberated version of this signature should be be a subtype // of the liberated form of the expectation. for ((hir_ty, &supplied_ty), expected_ty) in decl.inputs.iter() - .zip(*supplied_sig.inputs().skip_binder()) // binder moved to (*) below - .zip(expected_sigs.liberated_sig.inputs()) + .zip(*supplied_sig.inputs().skip_binder()) // binder moved to (*) below + .zip(expected_sigs.liberated_sig.inputs()) // `liberated_sig` is E'. { // Instantiate (this part of..) S to S', i.e., with fresh variables. @@ -638,11 +635,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tcx.types.err }); - match decl.output { - hir::Return(ref output) => { - astconv.ast_ty_to_ty(&output); - } - hir::DefaultReturn(_) => {} + if let hir::Return(ref output) = decl.output { + astconv.ast_ty_to_ty(&output); } let result = ty::Binder::bind(self.tcx.mk_fn_sig( diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index 716dfce32fdc..967c710ac34a 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -144,8 +144,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { fn unify(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> InferResult<'tcx, Ty<'tcx>> { self.commit_if_ok(|_| { if self.use_lub { - self.at(&self.cause, self.fcx.param_env) - .lub(b, a) + self.at(&self.cause, self.fcx.param_env).lub(b, a) } else { self.at(&self.cause, self.fcx.param_env) .sup(b, a) @@ -256,8 +255,8 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { b: Ty<'tcx>, r_b: ty::Region<'tcx>, mt_b: TypeAndMut<'tcx>) - -> CoerceResult<'tcx> { - + -> CoerceResult<'tcx> + { debug!("coerce_borrowed_pointer(a={:?}, b={:?})", a, b); // If we have a parameter of type `&M T_a` and the value @@ -591,9 +590,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { } Ok(Some(vtable)) => { - for obligation in vtable.nested_obligations() { - queue.push_back(obligation); - } + queue.extend(vtable.nested_obligations()) } } } @@ -620,12 +617,11 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { G: FnOnce(Ty<'tcx>) -> Vec> { if let ty::FnPtr(fn_ty_b) = b.sty { - match (fn_ty_a.unsafety(), fn_ty_b.unsafety()) { - (hir::Unsafety::Normal, hir::Unsafety::Unsafe) => { - let unsafe_a = self.tcx.safe_to_unsafe_fn_ty(fn_ty_a); - return self.unify_and(unsafe_a, b, to_unsafe); - } - _ => {} + if let (hir::Unsafety::Normal, hir::Unsafety::Unsafe) + = (fn_ty_a.unsafety(), fn_ty_b.unsafety()) + { + let unsafe_a = self.tcx.safe_to_unsafe_fn_ty(fn_ty_a); + return self.unify_and(unsafe_a, b, to_unsafe); } } self.unify_and(a, b, normal) @@ -653,7 +649,6 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { -> CoerceResult<'tcx> { //! Attempts to coerce from the type of a Rust function item //! into a closure or a `proc`. - //! let b = self.shallow_resolve(b); debug!("coerce_from_fn_item(a={:?}, b={:?})", a, b); @@ -724,9 +719,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { let (is_ref, mt_a) = match a.sty { ty::Ref(_, ty, mutbl) => (true, ty::TypeAndMut { ty, mutbl }), ty::RawPtr(mt) => (false, mt), - _ => { - return self.unify_and(a, b, identity); - } + _ => return self.unify_and(a, b, identity) }; // Check that the types which they point at are compatible. @@ -896,10 +889,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { }; if !noop { - return self.commit_if_ok(|_| { + return self.commit_if_ok(|_| self.at(cause, self.param_env) .lub(prev_ty, new_ty) - }).map(|ok| self.register_infer_ok_obligations(ok)); + ).map(|ok| self.register_infer_ok_obligations(ok)); } } @@ -909,10 +902,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { if let Some(e) = first_error { Err(e) } else { - self.commit_if_ok(|_| { + self.commit_if_ok(|_| self.at(cause, self.param_env) .lub(prev_ty, new_ty) - }).map(|ok| self.register_infer_ok_obligations(ok)) + ).map(|ok| self.register_infer_ok_obligations(ok)) } } Ok(ok) => { @@ -1005,7 +998,7 @@ impl<'gcx, 'tcx, 'exprs, E> CoerceMany<'gcx, 'tcx, 'exprs, E> /// needlessly cloning the slice. pub fn with_coercion_sites(expected_ty: Ty<'tcx>, coercion_sites: &'exprs [E]) - -> Self { + -> Self { Self::make(expected_ty, Expressions::UpFront(coercion_sites)) } diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index a192068d28f2..29770dc12eb3 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -20,7 +20,7 @@ use errors::Applicability; use syntax_pos::Span; -use super::{Inherited, FnCtxt}; +use super::{Inherited, FnCtxt, potentially_plural_count}; /// Checks that a method from an impl conforms to the signature of /// the same method as declared in the trait. @@ -209,8 +209,8 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // // We then register the obligations from the impl_m and check to see // if all constraints hold. - hybrid_preds.predicates - .extend(trait_m_predicates.instantiate_own(tcx, trait_to_skol_substs).predicates); + hybrid_preds.predicates.extend( + trait_m_predicates.instantiate_own(tcx, trait_to_skol_substs).predicates); // Construct trait parameter environment and then shift it into the skolemized viewpoint. // The key step here is to update the caller_bounds's predicates to be @@ -320,12 +320,12 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, trait_m.ident); if let TypeError::Mutability = terr { if let Some(trait_err_span) = trait_err_span { - if let Ok(trait_err_str) = tcx.sess.source_map(). - span_to_snippet(trait_err_span) { + if let Ok(trait_err_str) = tcx.sess.source_map() + .span_to_snippet(trait_err_span) { diag.span_suggestion_with_applicability( impl_err_span, "consider change the type to match the mutability in trait", - format!("{}", trait_err_str), + trait_err_str.to_string(), Applicability::MachineApplicable, ); } @@ -334,7 +334,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, infcx.note_type_err(&mut diag, &cause, - trait_err_span.map(|sp| (sp, "type in trait".to_string())), + trait_err_span.map(|sp| (sp, "type in trait".to_owned())), Some(infer::ValuePairs::Types(ExpectedFound { expected: trait_fty, found: impl_fty, @@ -408,7 +408,7 @@ fn check_region_bounds_on_impl_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, return Err(ErrorReported); } - return Ok(()); + Ok(()) } fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>, @@ -470,14 +470,14 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a impl_iter.zip(trait_iter) .zip(impl_m_iter) .zip(trait_m_iter) - .filter_map(|(((&impl_arg_ty, &trait_arg_ty), impl_arg), trait_arg)| { + .filter_map(|(((&impl_arg_ty, &trait_arg_ty), impl_arg), trait_arg)| match infcx.at(&cause, param_env).sub(trait_arg_ty, impl_arg_ty) { Ok(_) => None, Err(_) => Some((impl_arg.span, Some(trait_arg.span))), } - }) + ) .next() - .unwrap_or_else(|| { + .unwrap_or_else(|| if infcx.at(&cause, param_env) .sup(trait_sig.output(), impl_sig.output()) @@ -487,7 +487,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a } else { (cause.span(&tcx), tcx.hir.span_if_local(trait_m.def_id)) } - }) + ) } else { (cause.span(&tcx), tcx.hir.span_if_local(trait_m.def_id)) } @@ -526,9 +526,9 @@ fn compare_self_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ); let can_eq_self = |ty| infcx.can_eq(param_env, untransformed_self_ty, ty).is_ok(); match ExplicitSelf::determine(self_arg_ty, can_eq_self) { - ExplicitSelf::ByValue => "self".to_string(), - ExplicitSelf::ByReference(_, hir::MutImmutable) => "&self".to_string(), - ExplicitSelf::ByReference(_, hir::MutMutable) => "&mut self".to_string(), + ExplicitSelf::ByValue => "self".to_owned(), + ExplicitSelf::ByReference(_, hir::MutImmutable) => "&self".to_owned(), + ExplicitSelf::ByReference(_, hir::MutMutable) => "&mut self".to_owned(), _ => format!("self: {}", self_arg_ty) } }) @@ -591,6 +591,7 @@ fn compare_number_of_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let trait_m_generics = tcx.generics_of(trait_m.def_id); let num_impl_m_type_params = impl_m_generics.own_counts().types; let num_trait_m_type_params = trait_m_generics.own_counts().types; + if num_impl_m_type_params != num_trait_m_type_params { let impl_m_node_id = tcx.hir.as_local_node_id(impl_m.def_id).unwrap(); let impl_m_item = tcx.hir.expect_impl_item(impl_m_node_id); @@ -600,43 +601,26 @@ fn compare_number_of_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_m_item.generics.span }; - let mut err = struct_span_err!(tcx.sess, - span, - E0049, - "method `{}` has {} type parameter{} but its trait \ - declaration has {} type parameter{}", - trait_m.ident, - num_impl_m_type_params, - if num_impl_m_type_params == 1 { "" } else { "s" }, - num_trait_m_type_params, - if num_trait_m_type_params == 1 { - "" - } else { - "s" - }); + let mut err = struct_span_err!(tcx.sess, span, E0049, + "method `{}` has {} but its trait declaration has {}", + trait_m.ident, + potentially_plural_count(num_impl_m_type_params, "type parameter"), + potentially_plural_count(num_trait_m_type_params, "type parameter") + ); let mut suffix = None; if let Some(span) = trait_item_span { - err.span_label(span, - format!("expected {}", - &if num_trait_m_type_params != 1 { - format!("{} type parameters", num_trait_m_type_params) - } else { - format!("{} type parameter", num_trait_m_type_params) - })); + err.span_label(span, format!("expected {}", + potentially_plural_count(num_trait_m_type_params, "type parameter"))); } else { suffix = Some(format!(", expected {}", num_trait_m_type_params)); } err.span_label(span, format!("found {}{}", - &if num_impl_m_type_params != 1 { - format!("{} type parameters", num_impl_m_type_params) - } else { - "1 type parameter".to_string() - }, - suffix.as_ref().map(|s| &s[..]).unwrap_or(""))); + potentially_plural_count(num_impl_m_type_params, "type parameter"), + suffix.as_ref().map(|s| &s[..]).unwrap_or(""))); err.emit(); @@ -694,33 +678,21 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mut err = struct_span_err!(tcx.sess, impl_span, E0050, - "method `{}` has {} parameter{} but the declaration in \ + "method `{}` has {} but the declaration in \ trait `{}` has {}", trait_m.ident, - impl_number_args, - if impl_number_args == 1 { "" } else { "s" }, + potentially_plural_count(impl_number_args, "parameter"), tcx.item_path_str(trait_m.def_id), trait_number_args); if let Some(trait_span) = trait_span { - err.span_label(trait_span, - format!("trait requires {}", - &if trait_number_args != 1 { - format!("{} parameters", trait_number_args) - } else { - format!("{} parameter", trait_number_args) - })); + err.span_label(trait_span, format!("trait requires {}", + potentially_plural_count(trait_number_args, "parameter"))); } else { err.note_trait_signature(trait_m.ident.to_string(), trait_m.signature(&tcx)); } - err.span_label(impl_span, - format!("expected {}, found {}", - &if trait_number_args != 1 { - format!("{} parameters", trait_number_args) - } else { - format!("{} parameter", trait_number_args) - }, - impl_number_args)); + err.span_label(impl_span, format!("expected {}, found {}", + potentially_plural_count(trait_number_args, "parameter"), impl_number_args)); err.emit(); return Err(ErrorReported); } @@ -750,8 +722,9 @@ fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, GenericParamDefKind::Lifetime => None, } }); - for ((impl_def_id, impl_synthetic), - (trait_def_id, trait_synthetic)) in impl_m_type_params.zip(trait_m_type_params) { + for ((impl_def_id, impl_synthetic), (trait_def_id, trait_synthetic)) + in impl_m_type_params.zip(trait_m_type_params) + { if impl_synthetic != trait_synthetic { let impl_node_id = tcx.hir.as_local_node_id(impl_def_id).unwrap(); let impl_span = tcx.hir.span(impl_node_id); @@ -831,15 +804,14 @@ fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl<'v> hir::intravisit::Visitor<'v> for Visitor { fn visit_ty(&mut self, ty: &'v hir::Ty) { hir::intravisit::walk_ty(self, ty); - match ty.node { - hir::TyKind::Path(hir::QPath::Resolved(None, ref path)) => { - if let hir::def::Def::TyParam(def_id) = path.def { - if def_id == self.1 { - self.0 = Some(ty.span); - } + if let hir::TyKind::Path( + hir::QPath::Resolved(None, ref path)) = ty.node + { + if let hir::def::Def::TyParam(def_id) = path.def { + if def_id == self.1 { + self.0 = Some(ty.span); } - }, - _ => {} + } } } fn nested_visit_map<'this>( @@ -975,7 +947,7 @@ pub fn compare_const_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, infcx.note_type_err(&mut diag, &cause, - trait_c_span.map(|span| (span, "type in trait".to_string())), + trait_c_span.map(|span| (span, "type in trait".to_owned())), Some(infer::ValuePairs::Types(ExpectedFound { expected: trait_ty, found: impl_ty, diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index ee19574dc4e9..71c78e7f87c0 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -115,19 +115,20 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // field is of the found type, suggest such variants. See Issue // #42764. if let ty::Adt(expected_adt, substs) = expected.sty { - let mut compatible_variants = vec![]; - for variant in &expected_adt.variants { - if variant.fields.len() == 1 { - let sole_field = &variant.fields[0]; - let sole_field_ty = sole_field.ty(self.tcx, substs); - if self.can_coerce(expr_ty, sole_field_ty) { - let mut variant_path = self.tcx.item_path_str(variant.did); - variant_path = variant_path.trim_left_matches("std::prelude::v1::") - .to_string(); - compatible_variants.push(variant_path); - } + let compatible_variants = expected_adt.variants + .iter() + .filter(|variant| variant.fields.len() == 1) + .filter_map(|variant| { + let sole_field = &variant.fields[0]; + let sole_field_ty = sole_field.ty(self.tcx, substs); + if self.can_coerce(expr_ty, sole_field_ty) { + let variant_path = self.tcx.item_path_str(variant.did); + Some(variant_path.trim_left_matches("std::prelude::v1::").to_string()) + } else { + None } - } + }).collect::>(); + if !compatible_variants.is_empty() { let expr_text = print::to_string(print::NO_ANN, |s| s.print_expr(expr)); let suggestions = compatible_variants.iter() @@ -380,15 +381,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { expected_ty: Ty<'tcx>) -> bool { let parent_id = self.tcx.hir.get_parent_node(expr.id); - match self.tcx.hir.find(parent_id) { - Some(parent) => { - // Shouldn't suggest `.into()` on `const`s. - if let Node::Item(Item { node: ItemKind::Const(_, _), .. }) = parent { - // FIXME(estebank): modify once we decide to suggest `as` casts - return false; - } + if let Some(parent) = self.tcx.hir.find(parent_id) { + // Shouldn't suggest `.into()` on `const`s. + if let Node::Item(Item { node: ItemKind::Const(_, _), .. }) = parent { + // FIXME(estebank): modify once we decide to suggest `as` casts + return false; } - None => {} }; let will_truncate = "will truncate the source value"; @@ -662,7 +660,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { expr.span, &format!("{}, producing the floating point representation of the \ integer", - msg), + msg), into_suggestion, Applicability::MachineApplicable ); @@ -670,7 +668,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { err.span_suggestion_with_applicability(expr.span, &format!("{}, producing the floating point representation of the \ integer, rounded if necessary", - msg), + msg), cast_suggestion, Applicability::MaybeIncorrect // lossy conversion ); @@ -684,7 +682,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { expr.span, &format!("{}, producing the floating point representation of the \ integer", - msg), + msg), into_suggestion, Applicability::MachineApplicable ); @@ -693,7 +691,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { expr.span, &format!("{}, producing the floating point representation of the \ integer, rounded if necessary", - msg), + msg), cast_suggestion, Applicability::MaybeIncorrect // lossy conversion ); diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index 9d3cbf910e05..b8544177bbbb 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -11,12 +11,12 @@ use check::regionck::RegionCtxt; use hir::def_id::DefId; -use rustc::infer::{self, InferOk}; use rustc::infer::outlives::env::OutlivesEnvironment; +use rustc::infer::{self, InferOk, SuppressRegionErrors}; use rustc::middle::region; +use rustc::traits::{ObligationCause, TraitEngine, TraitEngineExt}; use rustc::ty::subst::{Subst, Substs, UnpackedKind}; use rustc::ty::{self, Ty, TyCtxt}; -use rustc::traits::{ObligationCause, TraitEngine, TraitEngineExt}; use util::common::ErrorReported; use syntax::ast; @@ -39,23 +39,28 @@ use syntax_pos::Span; /// struct/enum definition for the nominal type itself (i.e. /// cannot do `struct S; impl Drop for S { ... }`). /// -pub fn check_drop_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - drop_impl_did: DefId) - -> Result<(), ErrorReported> { +pub fn check_drop_impl<'a, 'tcx>( + tcx: TyCtxt<'a, 'tcx, 'tcx>, + drop_impl_did: DefId, +) -> Result<(), ErrorReported> { let dtor_self_type = tcx.type_of(drop_impl_did); let dtor_predicates = tcx.predicates_of(drop_impl_did); match dtor_self_type.sty { ty::Adt(adt_def, self_to_impl_substs) => { - ensure_drop_params_and_item_params_correspond(tcx, - drop_impl_did, - dtor_self_type, - adt_def.did)?; + ensure_drop_params_and_item_params_correspond( + tcx, + drop_impl_did, + dtor_self_type, + adt_def.did, + )?; - ensure_drop_predicates_are_implied_by_item_defn(tcx, - drop_impl_did, - &dtor_predicates, - adt_def.did, - self_to_impl_substs) + ensure_drop_predicates_are_implied_by_item_defn( + tcx, + drop_impl_did, + &dtor_predicates, + adt_def.did, + self_to_impl_substs, + ) } _ => { // Destructors only work on nominal types. This was @@ -63,8 +68,7 @@ pub fn check_drop_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // not have been terminated. let span = tcx.def_span(drop_impl_did); tcx.sess.delay_span_bug(span, - &format!("should have been rejected by coherence check: {}", - dtor_self_type)); + &format!("should have been rejected by coherence check: {}", dtor_self_type)); Err(ErrorReported) } } @@ -74,9 +78,8 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>( tcx: TyCtxt<'a, 'tcx, 'tcx>, drop_impl_did: DefId, drop_impl_ty: Ty<'tcx>, - self_type_did: DefId) - -> Result<(), ErrorReported> -{ + self_type_did: DefId, +) -> Result<(), ErrorReported> { let drop_impl_node_id = tcx.hir.as_local_node_id(drop_impl_did).unwrap(); // check that the impl type can be made to match the trait type. @@ -89,22 +92,29 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>( let named_type = tcx.type_of(self_type_did); let drop_impl_span = tcx.def_span(drop_impl_did); - let fresh_impl_substs = - infcx.fresh_substs_for_item(drop_impl_span, drop_impl_did); + let fresh_impl_substs = infcx.fresh_substs_for_item(drop_impl_span, drop_impl_did); let fresh_impl_self_ty = drop_impl_ty.subst(tcx, fresh_impl_substs); let cause = &ObligationCause::misc(drop_impl_span, drop_impl_node_id); - match infcx.at(cause, impl_param_env).eq(named_type, fresh_impl_self_ty) { + match infcx + .at(cause, impl_param_env) + .eq(named_type, fresh_impl_self_ty) + { Ok(InferOk { obligations, .. }) => { fulfillment_cx.register_predicate_obligations(infcx, obligations); } Err(_) => { let item_span = tcx.def_span(self_type_did); - struct_span_err!(tcx.sess, drop_impl_span, E0366, - "Implementations of Drop cannot be specialized") - .span_note(item_span, - "Use same sequence of generic type and region \ - parameters that is on the struct/enum definition") + struct_span_err!( + tcx.sess, + drop_impl_span, + E0366, + "Implementations of Drop cannot be specialized" + ).span_note( + item_span, + "Use same sequence of generic type and region \ + parameters that is on the struct/enum definition", + ) .emit(); return Err(ErrorReported); } @@ -128,7 +138,12 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>( // conservative. -nmatsakis let outlives_env = OutlivesEnvironment::new(ty::ParamEnv::empty()); - infcx.resolve_regions_and_report_errors(drop_impl_did, ®ion_scope_tree, &outlives_env); + infcx.resolve_regions_and_report_errors( + drop_impl_did, + ®ion_scope_tree, + &outlives_env, + SuppressRegionErrors::default(), + ); Ok(()) }) } @@ -140,9 +155,8 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'a, 'tcx>( drop_impl_did: DefId, dtor_predicates: &ty::GenericPredicates<'tcx>, self_type_did: DefId, - self_to_impl_substs: &Substs<'tcx>) - -> Result<(), ErrorReported> -{ + self_to_impl_substs: &Substs<'tcx>, +) -> Result<(), ErrorReported> { let mut result = Ok(()); // Here is an example, analogous to that from @@ -198,7 +212,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'a, 'tcx>( // just to look for all the predicates directly. assert_eq!(dtor_predicates.parent, None); - for predicate in &dtor_predicates.predicates { + for (predicate, _) in &dtor_predicates.predicates { // (We do not need to worry about deep analysis of type // expressions etc because the Drop impls are already forced // to take on a structure that is roughly an alpha-renaming of @@ -213,11 +227,17 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'a, 'tcx>( if !assumptions_in_impl_context.contains(&predicate) { let item_span = tcx.hir.span(self_type_node_id); - struct_span_err!(tcx.sess, drop_impl_span, E0367, - "The requirement `{}` is added only by the Drop impl.", predicate) - .span_note(item_span, - "The same requirement must be part of \ - the struct/enum definition") + struct_span_err!( + tcx.sess, + drop_impl_span, + E0367, + "The requirement `{}` is added only by the Drop impl.", + predicate + ).span_note( + item_span, + "The same requirement must be part of \ + the struct/enum definition", + ) .emit(); result = Err(ErrorReported); } @@ -283,18 +303,16 @@ pub fn check_safety_of_destructor_if_necessary<'a, 'gcx, 'tcx>( ty: Ty<'tcx>, span: Span, body_id: ast::NodeId, - scope: region::Scope) - -> Result<(), ErrorReported> -{ + scope: region::Scope, +) -> Result<(), ErrorReported> { debug!("check_safety_of_destructor_if_necessary typ: {:?} scope: {:?}", ty, scope); - let parent_scope = match rcx.region_scope_tree.opt_encl_scope(scope) { Some(parent_scope) => parent_scope, // If no enclosing scope, then it must be the root scope // which cannot be outlived. - None => return Ok(()) + None => return Ok(()), }; let parent_scope = rcx.tcx.mk_region(ty::ReScope(parent_scope)); let origin = || infer::SubregionOrigin::SafeDestructor(span); diff --git a/src/librustc_typeck/check/generator_interior.rs b/src/librustc_typeck/check/generator_interior.rs index f0afc58b3cec..83005bc374ef 100644 --- a/src/librustc_typeck/check/generator_interior.rs +++ b/src/librustc_typeck/check/generator_interior.rs @@ -48,7 +48,7 @@ impl<'a, 'gcx, 'tcx> InteriorVisitor<'a, 'gcx, 'tcx> { // See the mega-comment at `yield_in_scope` for a proof. debug!("comparing counts yield: {} self: {}, source_span = {:?}", - expr_count, self.expr_count, source_span); + expr_count, self.expr_count, source_span); if expr_count >= self.expr_count { Some(yield_span) diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 499d58bc2eec..d630c5b3040b 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -57,7 +57,7 @@ fn equate_intrinsic_type<'a, 'tcx>( struct_span_err!(tcx.sess, span, E0094, "intrinsic has wrong number of type \ - parameters: found {}, expected {}", + parameters: found {}, expected {}", i_n_tps, n_tps) .span_label(span, format!("expected {} type parameter", n_tps)) .emit(); @@ -83,7 +83,7 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let name = it.name.as_str(); let (n_tps, inputs, output, unsafety) = if name.starts_with("atomic_") { let split : Vec<&str> = name.split('_').collect(); - assert!(split.len() >= 2, "Atomic intrinsic not correct format"); + assert!(split.len() >= 2, "Atomic intrinsic in an incorrect format"); //We only care about the operation here let (n_tps, inputs, output) = match split[1] { @@ -127,8 +127,8 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, "size_of_val" | "min_align_of_val" => { (1, vec![ tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::INNERMOST, - ty::BrAnon(0))), - param(0)) + ty::BrAnon(0))), + param(0)) ], tcx.types.usize) } "rustc_peek" => (1, vec![param(0)], param(0)), @@ -306,7 +306,7 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, "discriminant_value" => (1, vec![ tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::INNERMOST, - ty::BrAnon(0))), + ty::BrAnon(0))), param(0))], tcx.types.u64), "try" => { @@ -327,10 +327,10 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ref other => { struct_span_err!(tcx.sess, it.span, E0093, - "unrecognized intrinsic function: `{}`", - *other) - .span_label(it.span, "unrecognized intrinsic") - .emit(); + "unrecognized intrinsic function: `{}`", + *other) + .span_label(it.span, "unrecognized intrinsic") + .emit(); return; } }; diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index 6057c18663a6..4e5488b432d4 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -210,9 +210,6 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { target } - /////////////////////////////////////////////////////////////////////////// - // - /// Returns a set of substitutions for the method *receiver* where all type and region /// parameters are instantiated with fresh variables. This substitution does not include any /// parameters declared on the method itself. @@ -291,18 +288,18 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { self.fcx .autoderef(self.span, self_ty) .include_raw_pointers() - .filter_map(|(ty, _)| { + .filter_map(|(ty, _)| match ty.sty { ty::Dynamic(ref data, ..) => data.principal().map(|p| closure(self, ty, p)), _ => None, } - }) + ) .next() - .unwrap_or_else(|| { + .unwrap_or_else(|| span_bug!(self.span, "self-type `{}` for ObjectPick never dereferenced to an object", self_ty) - }) + ) } fn instantiate_method_substs( @@ -373,9 +370,6 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { } } - /////////////////////////////////////////////////////////////////////////// - // - // NOTE: this returns the *unnormalized* predicates and method sig. Because of // inference guessing, the predicates and method signature can't be normalized // until we unify the `Self` type. @@ -444,11 +438,10 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { /// respectively. fn convert_place_derefs_to_mutable(&self) { // Gather up expressions we want to munge. - let mut exprs = Vec::new(); - exprs.push(self.self_expr); + let mut exprs = vec![self.self_expr]; + loop { - let last = exprs[exprs.len() - 1]; - match last.node { + match exprs.last().unwrap().node { hir::ExprKind::Field(ref expr, _) | hir::ExprKind::Index(ref expr, _) | hir::ExprKind::Unary(hir::UnDeref, ref expr) => exprs.push(&expr), diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 499daccf5e80..ec4483204f05 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -17,6 +17,9 @@ use check::FnCtxt; use hir::def_id::DefId; use hir::def::Def; use namespace::Namespace; +use rustc::hir; +use rustc::lint; +use rustc::session::config::nightly_options; use rustc::ty::subst::{Subst, Substs}; use rustc::traits::{self, ObligationCause}; use rustc::ty::{self, Ty, ToPolyTraitRef, ToPredicate, TraitRef, TypeFoldable}; @@ -28,8 +31,6 @@ use rustc::middle::stability; use syntax::ast; use syntax::util::lev_distance::{lev_distance, find_best_match_for_name}; use syntax_pos::{Span, symbol::Symbol}; -use rustc::hir; -use rustc::lint; use std::mem; use std::ops::Deref; use std::rc::Rc; @@ -1073,9 +1074,9 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { self.tcx.item_path_str(stable_pick.item.def_id), )); - if ::rustc::session::config::nightly_options::is_nightly_build() { + if nightly_options::is_nightly_build() { for (candidate, feature) in unstable_candidates { - diag.note(&format!( + diag.help(&format!( "add #![feature({})] to the crate attributes to enable `{}`", feature, self.tcx.item_path_str(candidate.item.def_id), @@ -1255,9 +1256,8 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { { // Do all probes correspond to the same trait? let container = probes[0].0.item.container; - match container { - ty::TraitContainer(_) => {} - ty::ImplContainer(_) => return None, + if let ty::ImplContainer(_) = container { + return None } if probes[1..].iter().any(|&(p, _)| p.item.container != container) { return None; @@ -1461,7 +1461,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { .filter(|x| { let dist = lev_distance(&*name.as_str(), &x.ident.as_str()); Namespace::from(x.kind) == Namespace::Value && dist > 0 - && dist <= max_dist + && dist <= max_dist }) .collect() } else { diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index fe5128a69584..f5d332521ff0 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -88,7 +88,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } let report_candidates = |err: &mut DiagnosticBuilder, mut sources: Vec| { - sources.sort(); sources.dedup(); // Dynamic limit to avoid hiding just one candidate, which is silly. @@ -225,9 +224,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // ({integer}/{float}). let mut candidates = all_traits(self.tcx) .into_iter() - .filter(|info| { - self.associated_item(info.def_id, item_name, Namespace::Value).is_some() - }); + .filter_map(|info| + self.associated_item(info.def_id, item_name, Namespace::Value) + ); if let (true, false, Some(expr), Some(_)) = (actual.is_numeric(), actual.has_concrete_skeleton(), rcvr_expr, @@ -247,9 +246,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { "f32" }; match expr.node { - hir::ExprKind::Lit(ref lit) => { // numeric literal + hir::ExprKind::Lit(ref lit) => { // numeric literal let snippet = tcx.sess.source_map().span_to_snippet(lit.span) - .unwrap_or("".to_string()); + .unwrap_or("".to_owned()); err.span_suggestion_with_applicability( lit.span, @@ -342,8 +341,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // give a helping note that it has to be called as (x.f)(...). if let Some(expr) = rcvr_expr { for (ty, _) in self.autoderef(span, rcvr_ty) { - match ty.sty { - ty::Adt(def, substs) if !def.is_enum() => { + if let ty::Adt(def, substs) = ty.sty { + if !def.is_enum() { let variant = &def.non_enum_variant(); if let Some(index) = self.tcx.find_field_index(item_name, variant) { let field = &variant.fields[index]; @@ -377,7 +376,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { break; } } - _ => {} } } } else { @@ -722,12 +720,9 @@ fn compute_all_traits<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Vec } impl<'v, 'a, 'tcx> itemlikevisit::ItemLikeVisitor<'v> for Visitor<'a, 'tcx> { fn visit_item(&mut self, i: &'v hir::Item) { - match i.node { - hir::ItemKind::Trait(..) => { - let def_id = self.map.local_def_id(i.id); - self.traits.push(def_id); - } - _ => {} + if let hir::ItemKind::Trait(..) = i.node { + let def_id = self.map.local_def_id(i.id); + self.traits.push(def_id); } } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 5f6cc4c60c38..a9354e12deb3 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -662,7 +662,8 @@ impl<'a, 'gcx, 'tcx> Inherited<'a, 'gcx, 'tcx> { } fn register_predicates(&self, obligations: I) - where I: IntoIterator> { + where I: IntoIterator> + { for obligation in obligations { self.register_predicate(obligation); } @@ -1150,19 +1151,16 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>, if let Some(term_id) = fcx.tcx.lang_items().termination() { if let Some((id, _, entry_type)) = *fcx.tcx.sess.entry_fn.borrow() { if id == fn_id { - match entry_type { - config::EntryFnType::Main => { - let substs = fcx.tcx.mk_substs_trait(declared_ret_ty, &[]); - let trait_ref = ty::TraitRef::new(term_id, substs); - let return_ty_span = decl.output.span(); - let cause = traits::ObligationCause::new( - return_ty_span, fn_id, ObligationCauseCode::MainFunctionType); + if let config::EntryFnType::Main = entry_type { + let substs = fcx.tcx.mk_substs_trait(declared_ret_ty, &[]); + let trait_ref = ty::TraitRef::new(term_id, substs); + let return_ty_span = decl.output.span(); + let cause = traits::ObligationCause::new( + return_ty_span, fn_id, ObligationCauseCode::MainFunctionType); - inherited.register_predicate( - traits::Obligation::new( - cause, param_env, trait_ref.to_predicate())); - }, - config::EntryFnType::Start => {}, + inherited.register_predicate( + traits::Obligation::new( + cause, param_env, trait_ref.to_predicate())); } } } @@ -1540,10 +1538,10 @@ fn check_impl_items_against_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_trait_ref); } else { let mut err = struct_span_err!(tcx.sess, impl_item.span, E0323, - "item `{}` is an associated const, \ - which doesn't match its trait `{}`", - ty_impl_item.ident, - impl_trait_ref); + "item `{}` is an associated const, \ + which doesn't match its trait `{}`", + ty_impl_item.ident, + impl_trait_ref); err.span_label(impl_item.span, "does not match trait"); // We can only get the spans from local trait definition // Same for E0324 and E0325 @@ -1564,10 +1562,10 @@ fn check_impl_items_against_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, trait_span); } else { let mut err = struct_span_err!(tcx.sess, impl_item.span, E0324, - "item `{}` is an associated method, \ - which doesn't match its trait `{}`", - ty_impl_item.ident, - impl_trait_ref); + "item `{}` is an associated method, \ + which doesn't match its trait `{}`", + ty_impl_item.ident, + impl_trait_ref); err.span_label(impl_item.span, "does not match trait"); if let Some(trait_span) = tcx.hir.span_if_local(ty_trait_item.def_id) { err.span_label(trait_span, "item in trait"); @@ -1583,10 +1581,10 @@ fn check_impl_items_against_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } } else { let mut err = struct_span_err!(tcx.sess, impl_item.span, E0325, - "item `{}` is an associated type, \ - which doesn't match its trait `{}`", - ty_impl_item.ident, - impl_trait_ref); + "item `{}` is an associated type, \ + which doesn't match its trait `{}`", + ty_impl_item.ident, + impl_trait_ref); err.span_label(impl_item.span, "does not match trait"); if let Some(trait_span) = tcx.hir.span_if_local(ty_trait_item.def_id) { err.span_label(trait_span, "item in trait"); @@ -1624,8 +1622,8 @@ fn check_impl_items_against_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mut err = struct_span_err!(tcx.sess, impl_span, E0046, "not all trait items implemented, missing: `{}`", missing_items.iter() - .map(|trait_item| trait_item.ident.to_string()) - .collect::>().join("`, `")); + .map(|trait_item| trait_item.ident.to_string()) + .collect::>().join("`, `")); err.span_label(impl_span, format!("missing `{}` in implementation", missing_items.iter() .map(|trait_item| trait_item.ident.to_string()) @@ -1683,8 +1681,8 @@ fn check_representable<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, def_id: DefId) { let t = tcx.type_of(def_id); - match t.sty { - ty::Adt(def, substs) if def.is_struct() => { + if let ty::Adt(def, substs) = t.sty { + if def.is_struct() { let fields = &def.non_enum_variant().fields; if fields.is_empty() { span_err!(tcx.sess, sp, E0075, "SIMD vector cannot be empty"); @@ -1699,7 +1697,7 @@ pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, def_id: DefId } match e.sty { ty::Param(_) => { /* struct(T, T, T, T) is ok */ } - _ if e.is_machine() => { /* struct(u8, u8, u8, u8) is ok */ } + _ if e.is_machine() => { /* struct(u8, u8, u8, u8) is ok */ } _ => { span_err!(tcx.sess, sp, E0077, "SIMD vector element type should be machine type"); @@ -1707,7 +1705,6 @@ pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, def_id: DefId } } } - _ => () } } @@ -1743,8 +1740,8 @@ fn check_packed_inner<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, debug!("check_packed_inner: {:?} is recursive", t); return false; } - match t.sty { - ty::Adt(def, substs) if def.is_struct() || def.is_union() => { + if let ty::Adt(def, substs) = t.sty { + if def.is_struct() || def.is_union() { if tcx.adt_def(def.did).repr.align > 0 { return true; } @@ -1752,19 +1749,15 @@ fn check_packed_inner<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, stack.push(def_id); for field in &def.non_enum_variant().fields { let f = field.ty(tcx, substs); - match f.sty { - ty::Adt(def, _) => { - if check_packed_inner(tcx, def.did, stack) { - return true; - } + if let ty::Adt(def, _) = f.sty { + if check_packed_inner(tcx, def.did, stack) { + return true; } - _ => () } } // only need to pop if not early out stack.pop(); } - _ => () } false } @@ -1793,7 +1786,7 @@ fn check_transparent<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, def_id: De let field_spans: Vec<_> = non_zst_fields.map(|(span, _zst, _align1)| *span).collect(); struct_span_err!(tcx.sess, sp, E0690, "transparent struct needs exactly one non-zero-sized field, but has {}", - non_zst_count) + non_zst_count) .span_note(field_spans, "non-zero-sized field") .emit(); } @@ -1842,7 +1835,7 @@ pub fn check_enum<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } } - let mut disr_vals: Vec> = Vec::new(); + let mut disr_vals: Vec> = Vec::with_capacity(vs.len()); for (discr, v) in def.discriminants(tcx).zip(vs) { // Check for duplicate discriminant values if let Some(i) = disr_vals.iter().position(|&x| x.val == discr.val) { @@ -1882,14 +1875,17 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> { let index = generics.param_def_id_to_index[&def_id]; ty::GenericPredicates { parent: None, - predicates: self.param_env.caller_bounds.iter().filter(|predicate| { - match **predicate { - ty::Predicate::Trait(ref data) => { - data.skip_binder().self_ty().is_param(index) + predicates: self.param_env.caller_bounds.iter().filter_map(|&predicate| { + match predicate { + ty::Predicate::Trait(ref data) + if data.skip_binder().self_ty().is_param(index) => { + // HACK(eddyb) should get the original `Span`. + let span = tcx.def_span(def_id); + Some((predicate, span)) } - _ => false + _ => None } - }).cloned().collect() + }).collect() } } @@ -2078,13 +2074,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } pub fn local_ty(&self, span: Span, nid: ast::NodeId) -> LocalTy<'tcx> { - match self.locals.borrow().get(&nid) { - Some(&t) => t, - None => { - span_bug!(span, "no type for local variable {}", - self.tcx.hir.node_to_string(nid)); - } - } + self.locals.borrow().get(&nid).cloned().unwrap_or_else(|| + span_bug!(span, "no type for local variable {}", + self.tcx.hir.node_to_string(nid)) + ) } #[inline] @@ -2373,8 +2366,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } /// Registers obligations that all types appearing in `substs` are well-formed. - pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &hir::Expr) - { + pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &hir::Expr) { for ty in substs.types() { self.register_wf_obligation(ty, expr.span, traits::MiscObligation); } @@ -2421,8 +2413,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { substs: &Substs<'tcx>) -> Ty<'tcx> { - self.normalize_associated_types_in(span, - &field.ty(self.tcx, substs)) + self.normalize_associated_types_in(span, &field.ty(self.tcx, substs)) } fn check_casts(&self) { @@ -2473,11 +2464,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// Select as many obligations as we can at present. fn select_obligations_where_possible(&self, fallback_has_occurred: bool) { - match self.fulfillment_cx.borrow_mut().select_where_possible(self) { - Ok(()) => { } - Err(errors) => { - self.report_fulfillment_errors(&errors, self.inh.body_id, fallback_has_occurred); - }, + if let Err(errors) = self.fulfillment_cx.borrow_mut().select_where_possible(self) { + self.report_fulfillment_errors(&errors, self.inh.body_id, fallback_has_occurred); } } @@ -2772,17 +2760,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let expected_arg_count = fn_inputs.len(); let param_count_error = |expected_count: usize, - arg_count: usize, - error_code: &str, - variadic: bool, - sugg_unit: bool| { + arg_count: usize, + error_code: &str, + variadic: bool, + sugg_unit: bool| { let mut err = tcx.sess.struct_span_err_with_code(sp, - &format!("this function takes {}{} parameter{} but {} parameter{} supplied", + &format!("this function takes {}{} but {} {} supplied", if variadic {"at least "} else {""}, - expected_count, - if expected_count == 1 {""} else {"s"}, - arg_count, - if arg_count == 1 {" was"} else {"s were"}), + potentially_plural_count(expected_count, "parameter"), + potentially_plural_count(arg_count, "parameter"), + if arg_count == 1 {"was"} else {"were"}), DiagnosticId::Error(error_code.to_owned())); if let Some(def_s) = def_span.map(|sp| tcx.sess.source_map().def_span(sp)) { @@ -2798,10 +2785,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { String::from("()"), Applicability::MachineApplicable); } else { - err.span_label(sp, format!("expected {}{} parameter{}", - if variadic {"at least "} else {""}, - expected_count, - if expected_count == 1 {""} else {"s"})); + err.span_label(sp, format!("expected {}{}", + if variadic {"at least "} else {""}, + potentially_plural_count(expected_count, "parameter"))); } err.emit(); }; @@ -2967,7 +2953,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } fn err_args(&self, len: usize) -> Vec> { - (0..len).map(|_| self.tcx.types.err).collect() + vec![self.tcx.types.err; len] } // AST fragment checking @@ -2982,7 +2968,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { ast::LitKind::Str(..) => tcx.mk_static_str(), ast::LitKind::ByteStr(ref v) => { tcx.mk_imm_ref(tcx.types.re_static, - tcx.mk_array(tcx.types.u8, v.len() as u64)) + tcx.mk_array(tcx.types.u8, v.len() as u64)) } ast::LitKind::Byte(_) => tcx.types.u8, ast::LitKind::Char(_) => tcx.types.char, @@ -3051,23 +3037,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { if let Some(mut err) = self.demand_suptype_diag(expr.span, expected_ty, ty) { // Add help to type error if this is an `if` condition with an assignment - match (expected, &expr.node) { - (ExpectIfCondition, &hir::ExprKind::Assign(ref lhs, ref rhs)) => { - let msg = "try comparing for equality"; - if let (Ok(left), Ok(right)) = ( - self.tcx.sess.source_map().span_to_snippet(lhs.span), - self.tcx.sess.source_map().span_to_snippet(rhs.span)) - { - err.span_suggestion_with_applicability( - expr.span, - msg, - format!("{} == {}", left, right), - Applicability::MaybeIncorrect); - } else { - err.help(msg); - } + if let (ExpectIfCondition, &hir::ExprKind::Assign(ref lhs, ref rhs)) + = (expected, &expr.node) + { + let msg = "try comparing for equality"; + if let (Ok(left), Ok(right)) = ( + self.tcx.sess.source_map().span_to_snippet(lhs.span), + self.tcx.sess.source_map().span_to_snippet(rhs.span)) + { + err.span_suggestion_with_applicability( + expr.span, + msg, + format!("{} == {}", left, right), + Applicability::MaybeIncorrect); + } else { + err.help(msg); } - _ => (), } err.emit(); } @@ -3355,8 +3340,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tcx().types.err } else if self.method_exists(field, expr_t, expr.id, true) { type_error_struct!(self.tcx().sess, field.span, expr_t, E0615, - "attempted to take value of method `{}` on type `{}`", - field, expr_t) + "attempted to take value of method `{}` on type `{}`", + field, expr_t) .help("maybe a `()` to call it is missing?") .emit(); self.tcx().types.err @@ -3441,14 +3426,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } fn available_field_names(&self, variant: &'tcx ty::VariantDef) -> Vec { - let mut available = Vec::new(); - for field in variant.fields.iter() { + variant.fields.iter().filter(|field| { let def_scope = self.tcx.adjust_ident(field.ident, variant.did, self.body_id).1; - if field.vis.is_accessible_from(def_scope, self.tcx) { - available.push(field.ident.name); - } - } - available + field.vis.is_accessible_from(def_scope, self.tcx) + }) + .map(|field| field.ident.name) + .collect() } fn name_series_display(&self, names: Vec) -> String { @@ -3480,13 +3463,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { |actual| match ty.sty { ty::Adt(adt, ..) if adt.is_enum() => { struct_span_err!(self.tcx.sess, field.ident.span, E0559, - "{} `{}::{}` has no field named `{}`", - kind_name, actual, variant.name, field.ident) + "{} `{}::{}` has no field named `{}`", + kind_name, actual, variant.name, field.ident) } _ => { struct_span_err!(self.tcx.sess, field.ident.span, E0560, - "{} `{}` has no field named `{}`", - kind_name, actual, field.ident) + "{} `{}` has no field named `{}`", + kind_name, actual, field.ident) } }, ty); @@ -3571,10 +3554,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { error_happened = true; if let Some(prev_span) = seen_fields.get(&ident) { let mut err = struct_span_err!(self.tcx.sess, - field.ident.span, - E0062, - "field `{}` specified more than once", - ident); + field.ident.span, + E0062, + "field `{}` specified more than once", + ident); err.span_label(field.ident.span, "used more than once"); err.span_label(*prev_span, format!("first use of `{}`", ident)); @@ -3638,11 +3621,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { for field in fields { self.check_expr(&field.expr); } - match *base_expr { - Some(ref base) => { - self.check_expr(&base); - }, - None => {} + if let Some(ref base) = *base_expr { + self.check_expr(&base); } } @@ -3972,11 +3952,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { ty } hir::ExprKind::InlineAsm(_, ref outputs, ref inputs) => { - for output in outputs { - self.check_expr(output); - } - for input in inputs { - self.check_expr(input); + for expr in outputs.iter().chain(inputs.iter()) { + self.check_expr(expr); } tcx.mk_unit() } @@ -4075,7 +4052,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { hir::ExprKind::Ret(ref expr_opt) => { if self.ret_coercion.is_none() { struct_span_err!(self.tcx.sess, expr.span, E0572, - "return statement outside of function body").emit(); + "return statement outside of function body").emit(); } else if let Some(ref e) = *expr_opt { self.check_return_expr(e); } else { @@ -4393,7 +4370,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } if needs_note { err.help("to access tuple elements, use tuple indexing \ - syntax (e.g. `tuple.0`)"); + syntax (e.g. `tuple.0`)"); } } err.emit(); @@ -4409,7 +4386,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } None => { struct_span_err!(self.tcx.sess, expr.span, E0627, - "yield statement outside of generator literal").emit(); + "yield statement outside of generator literal").emit(); } } tcx.mk_unit() @@ -4523,7 +4500,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } } - pub fn check_decl_local(&self, local: &'gcx hir::Local) { + pub fn check_decl_local(&self, local: &'gcx hir::Local) { let t = self.local_ty(local.span, local.id).decl_ty; self.write_ty(local.hir_id, t); @@ -4547,11 +4524,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // Don't do all the complex logic below for DeclItem. match stmt.node { hir::StmtKind::Decl(ref decl, _) => { - match decl.node { - hir::DeclKind::Local(_) => {} - hir::DeclKind::Item(_) => { - return; - } + if let hir::DeclKind::Item(_) = decl.node { + return } } hir::StmtKind::Expr(..) | hir::StmtKind::Semi(..) => {} @@ -4809,7 +4783,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { Some(format!("{}{}", receiver, method_call)) } } - }) .collect::>(); + }).collect::>(); if !suggestions.is_empty() { err.span_suggestions_with_applicability( expr.span, @@ -5286,18 +5260,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // If our calling expression is indeed the function itself, we're good! // If not, generate an error that this can only be called directly. - match self.tcx.hir.get(self.tcx.hir.get_parent_node(node_id)) { - Node::Expr(expr) => { - match expr.node { - hir::ExprKind::Call(ref callee, ..) => { - if callee.id == node_id { - return - } - } - _ => {} + if let Node::Expr(expr) = self.tcx.hir.get(self.tcx.hir.get_parent_node(node_id)) { + if let hir::ExprKind::Call(ref callee, ..) = expr.node { + if callee.id == node_id { + return } } - _ => {} } self.tcx.sess.span_err(span, "this function can only be invoked \ @@ -5323,8 +5291,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } fn with_breakable_ctxt R, R>(&self, id: ast::NodeId, - ctxt: BreakableCtxt<'gcx, 'tcx>, f: F) - -> (BreakableCtxt<'gcx, 'tcx>, R) { + ctxt: BreakableCtxt<'gcx, 'tcx>, f: F) + -> (BreakableCtxt<'gcx, 'tcx>, R) { let index; { let mut enclosing_breakables = self.enclosing_breakables.borrow_mut(); @@ -5398,3 +5366,7 @@ fn fatally_break_rust(sess: &Session) { ::session::config::host_triple(), )); } + +fn potentially_plural_count(count: usize, word: &str) -> String { + format!("{} {}{}", count, word, if count == 1 { "" } else { "s" }) +} diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 5969f288d732..89ed689b5d40 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -311,7 +311,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { hir::BinOpKind::BitOr => Some("std::ops::BitOrAssign"), hir::BinOpKind::Shl => Some("std::ops::ShlAssign"), hir::BinOpKind::Shr => Some("std::ops::ShrAssign"), - _ => None + _ => None }; if let Some(missing_trait) = missing_trait { if op.node == hir::BinOpKind::Add && @@ -338,15 +338,15 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } IsAssign::No => { let mut err = struct_span_err!(self.tcx.sess, expr.span, E0369, - "binary operation `{}` cannot be applied to type `{}`", - op.node.as_str(), - lhs_ty); + "binary operation `{}` cannot be applied to type `{}`", + op.node.as_str(), + lhs_ty); let mut suggested_deref = false; if let Ref(_, mut rty, _) = lhs_ty.sty { if { !self.infcx.type_moves_by_default(self.param_env, - rty, - lhs_expr.span) && + rty, + lhs_expr.span) && self.lookup_op_method(rty, &[rhs_ty], Op::Binary(op, is_assign)) diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index fbf8afc3be23..80b4ba6240d3 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -88,27 +88,32 @@ use middle::mem_categorization as mc; use middle::mem_categorization::Categorization; use middle::region; use rustc::hir::def_id::DefId; +use rustc::infer::outlives::env::OutlivesEnvironment; +use rustc::infer::{self, RegionObligation, SuppressRegionErrors}; +use rustc::ty::adjustment; use rustc::ty::subst::Substs; use rustc::ty::{self, Ty}; -use rustc::infer; -use rustc::infer::outlives::env::OutlivesEnvironment; -use rustc::ty::adjustment; +use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; +use rustc::hir::{self, PatKind}; +use rustc_data_structures::sync::Lrc; use std::mem; use std::ops::Deref; use std::rc::Rc; -use rustc_data_structures::sync::Lrc; use syntax::ast; use syntax_pos::Span; -use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap}; -use rustc::hir::{self, PatKind}; // a variation on try that just returns unit macro_rules! ignore_err { - ($e:expr) => (match $e { Ok(e) => e, Err(_) => { - debug!("ignoring mem-categorization error!"); - return () - }}) + ($e:expr) => { + match $e { + Ok(e) => e, + Err(_) => { + debug!("ignoring mem-categorization error!"); + return (); + } + } + }; } /////////////////////////////////////////////////////////////////////////// @@ -118,17 +123,24 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { pub fn regionck_expr(&self, body: &'gcx hir::Body) { let subject = self.tcx.hir.body_owner_def_id(body.id()); let id = body.value.id; - let mut rcx = RegionCtxt::new(self, - RepeatingScope(id), - id, - Subject(subject), - self.param_env); + let mut rcx = RegionCtxt::new( + self, + RepeatingScope(id), + id, + Subject(subject), + self.param_env, + ); + + // There are no add'l implied bounds when checking a + // standalone expr (e.g., the `E` in a type like `[u32; E]`). + rcx.outlives_environment.save_implied_bounds(id); + if self.err_count_since_creation() == 0 { // regionck assumes typeck succeeded rcx.visit_body(body); rcx.visit_region_obligations(id); } - rcx.resolve_regions_and_report_errors_unless_nll(); + rcx.resolve_regions_and_report_errors(SuppressRegionErrors::when_nll_is_enabled(self.tcx)); assert!(self.tables.borrow().free_region_map.is_empty()); self.tables.borrow_mut().free_region_map = rcx.outlives_environment.into_free_region_map(); @@ -136,20 +148,21 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// Region checking during the WF phase for items. `wf_tys` are the /// types from which we should derive implied bounds, if any. - pub fn regionck_item(&self, - item_id: ast::NodeId, - span: Span, - wf_tys: &[Ty<'tcx>]) { + pub fn regionck_item(&self, item_id: ast::NodeId, span: Span, wf_tys: &[Ty<'tcx>]) { debug!("regionck_item(item.id={:?}, wf_tys={:?})", item_id, wf_tys); let subject = self.tcx.hir.local_def_id(item_id); - let mut rcx = RegionCtxt::new(self, - RepeatingScope(item_id), - item_id, - Subject(subject), - self.param_env); - rcx.outlives_environment.add_implied_bounds(self, wf_tys, item_id, span); + let mut rcx = RegionCtxt::new( + self, + RepeatingScope(item_id), + item_id, + Subject(subject), + self.param_env, + ); + rcx.outlives_environment + .add_implied_bounds(self, wf_tys, item_id, span); + rcx.outlives_environment.save_implied_bounds(item_id); rcx.visit_region_obligations(item_id); - rcx.resolve_regions_and_report_errors(); + rcx.resolve_regions_and_report_errors(SuppressRegionErrors::default()); } /// Region check a function body. Not invoked on closures, but @@ -160,24 +173,24 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// rest of type check and because sometimes we need type /// inference to have completed before we can determine which /// constraints to add. - pub fn regionck_fn(&self, - fn_id: ast::NodeId, - body: &'gcx hir::Body) { + pub fn regionck_fn(&self, fn_id: ast::NodeId, body: &'gcx hir::Body) { debug!("regionck_fn(id={})", fn_id); let subject = self.tcx.hir.body_owner_def_id(body.id()); let node_id = body.value.id; - let mut rcx = RegionCtxt::new(self, - RepeatingScope(node_id), - node_id, - Subject(subject), - self.param_env); + let mut rcx = RegionCtxt::new( + self, + RepeatingScope(node_id), + node_id, + Subject(subject), + self.param_env, + ); if self.err_count_since_creation() == 0 { // regionck assumes typeck succeeded rcx.visit_fn_body(fn_id, body, self.tcx.hir.span(fn_id)); } - rcx.resolve_regions_and_report_errors_unless_nll(); + rcx.resolve_regions_and_report_errors(SuppressRegionErrors::when_nll_is_enabled(self.tcx)); // In this mode, we also copy the free-region-map into the // tables of the enclosing fcx. In the other regionck modes @@ -190,7 +203,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /////////////////////////////////////////////////////////////////////////// // INTERNALS -pub struct RegionCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { +pub struct RegionCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { pub fcx: &'a FnCtxt<'a, 'gcx, 'tcx>, pub region_scope_tree: Lrc, @@ -208,7 +221,6 @@ pub struct RegionCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { // id of AST node being analyzed (the subject of the analysis). subject_def_id: DefId, - } impl<'a, 'gcx, 'tcx> Deref for RegionCtxt<'a, 'gcx, 'tcx> { @@ -222,12 +234,13 @@ pub struct RepeatingScope(ast::NodeId); pub struct Subject(DefId); impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { - pub fn new(fcx: &'a FnCtxt<'a, 'gcx, 'tcx>, - RepeatingScope(initial_repeating_scope): RepeatingScope, - initial_body_id: ast::NodeId, - Subject(subject): Subject, - param_env: ty::ParamEnv<'tcx>) - -> RegionCtxt<'a, 'gcx, 'tcx> { + pub fn new( + fcx: &'a FnCtxt<'a, 'gcx, 'tcx>, + RepeatingScope(initial_repeating_scope): RepeatingScope, + initial_body_id: ast::NodeId, + Subject(subject): Subject, + param_env: ty::ParamEnv<'tcx>, + ) -> RegionCtxt<'a, 'gcx, 'tcx> { let region_scope_tree = fcx.tcx.region_scope_tree(subject); let outlives_environment = OutlivesEnvironment::new(param_env); RegionCtxt { @@ -296,11 +309,12 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// closures, however, we save and restore any "scoped state" /// before we invoke this function. (See `visit_fn` in the /// `intravisit::Visitor` impl below.) - fn visit_fn_body(&mut self, - id: ast::NodeId, // the id of the fn itself - body: &'gcx hir::Body, - span: Span) - { + fn visit_fn_body( + &mut self, + id: ast::NodeId, // the id of the fn itself + body: &'gcx hir::Body, + span: Span, + ) { // When we enter a function, we can derive debug!("visit_fn_body(id={})", id); @@ -309,7 +323,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { let call_site = region::Scope { id: body.value.hir_id.local_id, - data: region::ScopeData::CallSite + data: region::ScopeData::CallSite, }; self.call_site_scope = Some(call_site); @@ -328,32 +342,41 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // because it will have no effect. // // FIXME(#27579) return types should not be implied bounds - let fn_sig_tys: Vec<_> = - fn_sig.inputs().iter().cloned().chain(Some(fn_sig.output())).collect(); + let fn_sig_tys: Vec<_> = fn_sig + .inputs() + .iter() + .cloned() + .chain(Some(fn_sig.output())) + .collect(); self.outlives_environment.add_implied_bounds( self.fcx, &fn_sig_tys[..], body_id.node_id, - span); + span, + ); + self.outlives_environment + .save_implied_bounds(body_id.node_id); self.link_fn_args( region::Scope { id: body.value.hir_id.local_id, - data: region::ScopeData::Node + data: region::ScopeData::Node, }, - &body.arguments); + &body.arguments, + ); self.visit_body(body); self.visit_region_obligations(body_id.node_id); let call_site_scope = self.call_site_scope.unwrap(); - debug!("visit_fn_body body.id {:?} call_site_scope: {:?}", - body.id(), call_site_scope); + debug!( + "visit_fn_body body.id {:?} call_site_scope: {:?}", + body.id(), + call_site_scope + ); let call_site_region = self.tcx.mk_region(ty::ReScope(call_site_scope)); let body_hir_id = self.tcx.hir.node_to_hir_id(body_id.node_id); - self.type_of_node_must_outlive(infer::CallReturn(span), - body_hir_id, - call_site_region); + self.type_of_node_must_outlive(infer::CallReturn(span), body_hir_id, call_site_region); self.constrain_opaque_types( &self.fcx.opaque_types.borrow(), @@ -361,32 +384,28 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { ); } - fn visit_region_obligations(&mut self, node_id: ast::NodeId) - { + fn visit_region_obligations(&mut self, node_id: ast::NodeId) { debug!("visit_region_obligations: node_id={}", node_id); // region checking can introduce new pending obligations // which, when processed, might generate new region // obligations. So make sure we process those. self.select_all_obligations_or_error(); + } + fn resolve_regions_and_report_errors(&self, suppress: SuppressRegionErrors) { self.infcx.process_registered_region_obligations( - self.outlives_environment.region_bound_pairs(), + self.outlives_environment.region_bound_pairs_map(), self.implicit_region_bound, self.param_env, - self.body_id); - } + ); - fn resolve_regions_and_report_errors(&self) { - self.fcx.resolve_regions_and_report_errors(self.subject_def_id, - &self.region_scope_tree, - &self.outlives_environment); - } - - fn resolve_regions_and_report_errors_unless_nll(&self) { - self.fcx.resolve_regions_and_report_errors_unless_nll(self.subject_def_id, - &self.region_scope_tree, - &self.outlives_environment); + self.fcx.resolve_regions_and_report_errors( + self.subject_def_id, + &self.region_scope_tree, + &self.outlives_environment, + suppress, + ); } fn constrain_bindings_in_pat(&mut self, pat: &hir::Pat) { @@ -423,7 +442,8 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { let typ = self.resolve_node_type(hir_id); let body_id = self.body_id; let _ = dropck::check_safety_of_destructor_if_necessary( - self, typ, span, body_id, var_scope); + self, typ, span, body_id, var_scope, + ); }) } } @@ -441,14 +461,21 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { NestedVisitorMap::None } - fn visit_fn(&mut self, - fk: intravisit::FnKind<'gcx>, - _: &'gcx hir::FnDecl, - body_id: hir::BodyId, - span: Span, - id: ast::NodeId) { - assert!(match fk { intravisit::FnKind::Closure(..) => true, _ => false }, - "visit_fn invoked for something other than a closure"); + fn visit_fn( + &mut self, + fk: intravisit::FnKind<'gcx>, + _: &'gcx hir::FnDecl, + body_id: hir::BodyId, + span: Span, + id: ast::NodeId, + ) { + assert!( + match fk { + intravisit::FnKind::Closure(..) => true, + _ => false, + }, + "visit_fn invoked for something other than a closure" + ); // Save state of current function before invoking // `visit_fn_body`. We will restore afterwards. @@ -460,7 +487,8 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { self.visit_fn_body(id, body, span); // Restore state from previous function. - self.outlives_environment.pop_snapshot_post_closure(env_snapshot); + self.outlives_environment + .pop_snapshot_post_closure(env_snapshot); self.call_site_scope = old_call_site_scope; self.body_id = old_body_id; } @@ -483,20 +511,24 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { } fn visit_expr(&mut self, expr: &'gcx hir::Expr) { - debug!("regionck::visit_expr(e={:?}, repeating_scope={})", - expr, self.repeating_scope); + debug!( + "regionck::visit_expr(e={:?}, repeating_scope={})", + expr, self.repeating_scope + ); // No matter what, the type of each expression must outlive the // scope of that expression. This also guarantees basic WF. let expr_ty = self.resolve_node_type(expr.hir_id); // the region corresponding to this expression - let expr_region = self.tcx.mk_region(ty::ReScope( - region::Scope { - id: expr.hir_id.local_id, - data: region::ScopeData::Node - })); - self.type_must_outlive(infer::ExprTypeIsNotInScope(expr_ty, expr.span), - expr_ty, expr_region); + let expr_region = self.tcx.mk_region(ty::ReScope(region::Scope { + id: expr.hir_id.local_id, + data: region::ScopeData::Node, + })); + self.type_must_outlive( + infer::ExprTypeIsNotInScope(expr_ty, expr.span), + expr_ty, + expr_region, + ); let is_method_call = self.tables.borrow().is_method_call(expr); @@ -506,12 +538,11 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { // provided as arguments outlive the call. if is_method_call { let origin = match expr.node { - hir::ExprKind::MethodCall(..) => - infer::ParameterOrigin::MethodCall, - hir::ExprKind::Unary(op, _) if op == hir::UnDeref => - infer::ParameterOrigin::OverloadedDeref, - _ => - infer::ParameterOrigin::OverloadedOperator + hir::ExprKind::MethodCall(..) => infer::ParameterOrigin::MethodCall, + hir::ExprKind::Unary(op, _) if op == hir::UnDeref => { + infer::ParameterOrigin::OverloadedDeref + } + _ => infer::ParameterOrigin::OverloadedOperator, }; let substs = self.tables.borrow().node_substs(expr.hir_id); @@ -533,8 +564,10 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { } } - debug!("regionck::visit_expr(e={:?}, repeating_scope={}) - visiting subexprs", - expr, self.repeating_scope); + debug!( + "regionck::visit_expr(e={:?}, repeating_scope={}) - visiting subexprs", + expr, self.repeating_scope + ); match expr.node { hir::ExprKind::Path(_) => { let substs = self.tables.borrow().node_substs(expr.hir_id); @@ -571,7 +604,7 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { self.constrain_call(expr, Some(&lhs), Some(&**rhs).into_iter()); intravisit::walk_expr(self, expr); - }, + } hir::ExprKind::Binary(_, ref lhs, ref rhs) if is_method_call => { // As `ExprKind::MethodCall`, but the call is via an overloaded op. @@ -586,8 +619,7 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { let lhs_ty = self.resolve_expr_type_adjusted(&lhs); let rhs_ty = self.resolve_expr_type_adjusted(&rhs); for &ty in &[lhs_ty, rhs_ty] { - self.type_must_outlive(infer::Operand(expr.span), - ty, expr_region); + self.type_must_outlive(infer::Operand(expr.span), ty, expr_region); } intravisit::walk_expr(self, expr); } @@ -674,12 +706,16 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { hir::ExprKind::Ret(Some(ref ret_expr)) => { let call_site_scope = self.call_site_scope; - debug!("visit_expr ExprKind::Ret ret_expr.id {} call_site_scope: {:?}", - ret_expr.id, call_site_scope); + debug!( + "visit_expr ExprKind::Ret ret_expr.id {} call_site_scope: {:?}", + ret_expr.id, call_site_scope + ); let call_site_region = self.tcx.mk_region(ty::ReScope(call_site_scope.unwrap())); - self.type_of_node_must_outlive(infer::CallReturn(ret_expr.span), - ret_expr.hir_id, - call_site_region); + self.type_of_node_must_outlive( + infer::CallReturn(ret_expr.span), + ret_expr.hir_id, + call_site_region, + ); intravisit::walk_expr(self, expr); } @@ -691,13 +727,11 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { } impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { - fn constrain_cast(&mut self, - cast_expr: &hir::Expr, - source_expr: &hir::Expr) - { - debug!("constrain_cast(cast_expr={:?}, source_expr={:?})", - cast_expr, - source_expr); + fn constrain_cast(&mut self, cast_expr: &hir::Expr, source_expr: &hir::Expr) { + debug!( + "constrain_cast(cast_expr={:?}, source_expr={:?})", + cast_expr, source_expr + ); let source_ty = self.resolve_node_type(source_expr.hir_id); let target_ty = self.resolve_node_type(cast_expr.hir_id); @@ -705,40 +739,35 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { self.walk_cast(cast_expr, source_ty, target_ty); } - fn walk_cast(&mut self, - cast_expr: &hir::Expr, - from_ty: Ty<'tcx>, - to_ty: Ty<'tcx>) { - debug!("walk_cast(from_ty={:?}, to_ty={:?})", - from_ty, - to_ty); + fn walk_cast(&mut self, cast_expr: &hir::Expr, from_ty: Ty<'tcx>, to_ty: Ty<'tcx>) { + debug!("walk_cast(from_ty={:?}, to_ty={:?})", from_ty, to_ty); match (&from_ty.sty, &to_ty.sty) { - /*From:*/ (&ty::Ref(from_r, from_ty, _), - /*To: */ &ty::Ref(to_r, to_ty, _)) => { + /*From:*/ + (&ty::Ref(from_r, from_ty, _), /*To: */ &ty::Ref(to_r, to_ty, _)) => { // Target cannot outlive source, naturally. self.sub_regions(infer::Reborrow(cast_expr.span), to_r, from_r); self.walk_cast(cast_expr, from_ty, to_ty); } - /*From:*/ (_, - /*To: */ &ty::Dynamic(.., r)) => { + /*From:*/ + (_, /*To: */ &ty::Dynamic(.., r)) => { // When T is existentially quantified as a trait // `Foo+'to`, it must outlive the region bound `'to`. self.type_must_outlive(infer::RelateObjectBound(cast_expr.span), from_ty, r); } - /*From:*/ (&ty::Adt(from_def, _), - /*To: */ &ty::Adt(to_def, _)) if from_def.is_box() && to_def.is_box() => { + /*From:*/ + (&ty::Adt(from_def, _), /*To: */ &ty::Adt(to_def, _)) + if from_def.is_box() && to_def.is_box() => + { self.walk_cast(cast_expr, from_ty.boxed_ty(), to_ty.boxed_ty()); } - _ => { } + _ => {} } } - fn check_expr_fn_block(&mut self, - expr: &'gcx hir::Expr, - body_id: hir::BodyId) { + fn check_expr_fn_block(&mut self, expr: &'gcx hir::Expr, body_id: hir::BodyId) { let repeating_scope = self.set_repeating_scope(body_id.node_id); intravisit::walk_expr(self, expr); self.set_repeating_scope(repeating_scope); @@ -747,7 +776,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { fn constrain_callee(&mut self, callee_expr: &hir::Expr) { let callee_ty = self.resolve_node_type(callee_expr.hir_id); match callee_ty.sty { - ty::FnDef(..) | ty::FnPtr(_) => { } + ty::FnDef(..) | ty::FnPtr(_) => {} _ => { // this should not happen, but it does if the program is // erroneous @@ -760,18 +789,21 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { } } - fn constrain_call<'b, I: Iterator>(&mut self, - call_expr: &hir::Expr, - receiver: Option<&hir::Expr>, - arg_exprs: I) { + fn constrain_call<'b, I: Iterator>( + &mut self, + call_expr: &hir::Expr, + receiver: Option<&hir::Expr>, + arg_exprs: I, + ) { //! Invoked on every call site (i.e., normal calls, method calls, //! and overloaded operators). Constrains the regions which appear //! in the type of the function. Also constrains the regions that //! appear in the arguments appropriately. - debug!("constrain_call(call_expr={:?}, receiver={:?})", - call_expr, - receiver); + debug!( + "constrain_call(call_expr={:?}, receiver={:?})", + call_expr, receiver + ); // `callee_region` is the scope representing the time in which the // call occurs. @@ -779,7 +811,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // FIXME(#6268) to support nested method calls, should be callee_id let callee_scope = region::Scope { id: call_expr.hir_id.local_id, - data: region::ScopeData::Node + data: region::ScopeData::Node, }; let callee_region = self.tcx.mk_region(ty::ReScope(callee_scope)); @@ -790,27 +822,30 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // ensure that any regions appearing in the argument type are // valid for at least the lifetime of the function: - self.type_of_node_must_outlive(infer::CallArg(arg_expr.span), - arg_expr.hir_id, - callee_region); + self.type_of_node_must_outlive( + infer::CallArg(arg_expr.span), + arg_expr.hir_id, + callee_region, + ); } // as loop above, but for receiver if let Some(r) = receiver { debug!("receiver: {:?}", r); - self.type_of_node_must_outlive(infer::CallRcvr(r.span), - r.hir_id, - callee_region); + self.type_of_node_must_outlive(infer::CallRcvr(r.span), r.hir_id, callee_region); } } /// Create a temporary `MemCategorizationContext` and pass it to the closure. fn with_mc(&self, f: F) -> R - where F: for<'b> FnOnce(mc::MemCategorizationContext<'b, 'gcx, 'tcx>) -> R + where + F: for<'b> FnOnce(mc::MemCategorizationContext<'b, 'gcx, 'tcx>) -> R, { - f(mc::MemCategorizationContext::with_infer(&self.infcx, - &self.region_scope_tree, - &self.tables.borrow())) + f(mc::MemCategorizationContext::with_infer( + &self.infcx, + &self.region_scope_tree, + &self.tables.borrow(), + )) } /// Invoked on any adjustments that occur. Checks that if this is a region pointer being @@ -832,37 +867,46 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // expression. self.check_safety_of_rvalue_destructor_if_necessary(&cmt, expr.span); - let expr_region = self.tcx.mk_region(ty::ReScope( - region::Scope { - id: expr.hir_id.local_id, - data: region::ScopeData::Node - })); + let expr_region = self.tcx.mk_region(ty::ReScope(region::Scope { + id: expr.hir_id.local_id, + data: region::ScopeData::Node, + })); for adjustment in adjustments { - debug!("constrain_adjustments: adjustment={:?}, cmt={:?}", - adjustment, cmt); + debug!( + "constrain_adjustments: adjustment={:?}, cmt={:?}", + adjustment, cmt + ); if let adjustment::Adjust::Deref(Some(deref)) = adjustment.kind { debug!("constrain_adjustments: overloaded deref: {:?}", deref); // Treat overloaded autoderefs as if an AutoBorrow adjustment // was applied on the base type, as that is always the case. - let input = self.tcx.mk_ref(deref.region, ty::TypeAndMut { - ty: cmt.ty, - mutbl: deref.mutbl, - }); - let output = self.tcx.mk_ref(deref.region, ty::TypeAndMut { - ty: adjustment.target, - mutbl: deref.mutbl, - }); + let input = self.tcx.mk_ref( + deref.region, + ty::TypeAndMut { + ty: cmt.ty, + mutbl: deref.mutbl, + }, + ); + let output = self.tcx.mk_ref( + deref.region, + ty::TypeAndMut { + ty: adjustment.target, + mutbl: deref.mutbl, + }, + ); - self.link_region(expr.span, deref.region, - ty::BorrowKind::from_mutbl(deref.mutbl), &cmt); + self.link_region( + expr.span, + deref.region, + ty::BorrowKind::from_mutbl(deref.mutbl), + &cmt, + ); // Specialized version of constrain_call. - self.type_must_outlive(infer::CallRcvr(expr.span), - input, expr_region); - self.type_must_outlive(infer::CallReturn(expr.span), - output, expr_region); + self.type_must_outlive(infer::CallRcvr(expr.span), input, expr_region); + self.type_must_outlive(infer::CallReturn(expr.span), output, expr_region); } if let adjustment::Adjust::Borrow(ref autoref) = adjustment.kind { @@ -872,73 +916,83 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // the current node. // // FIXME(#6268) remove to support nested method calls - self.type_of_node_must_outlive(infer::AutoBorrow(expr.span), - expr.hir_id, - expr_region); + self.type_of_node_must_outlive( + infer::AutoBorrow(expr.span), + expr.hir_id, + expr_region, + ); } cmt = self.with_mc(|mc| mc.cat_expr_adjusted(expr, cmt, &adjustment))?; if let Categorization::Deref(_, mc::BorrowedPtr(_, r_ptr)) = cmt.cat { - self.mk_subregion_due_to_dereference(expr.span, - expr_region, r_ptr); + self.mk_subregion_due_to_dereference(expr.span, expr_region, r_ptr); } } Ok(cmt) } - pub fn mk_subregion_due_to_dereference(&mut self, - deref_span: Span, - minimum_lifetime: ty::Region<'tcx>, - maximum_lifetime: ty::Region<'tcx>) { - self.sub_regions(infer::DerefPointer(deref_span), - minimum_lifetime, maximum_lifetime) + pub fn mk_subregion_due_to_dereference( + &mut self, + deref_span: Span, + minimum_lifetime: ty::Region<'tcx>, + maximum_lifetime: ty::Region<'tcx>, + ) { + self.sub_regions( + infer::DerefPointer(deref_span), + minimum_lifetime, + maximum_lifetime, + ) } - fn check_safety_of_rvalue_destructor_if_necessary(&mut self, - cmt: &mc::cmt_<'tcx>, - span: Span) { - match cmt.cat { - Categorization::Rvalue(region) => { - match *region { - ty::ReScope(rvalue_scope) => { - let typ = self.resolve_type(cmt.ty); - let body_id = self.body_id; - let _ = dropck::check_safety_of_destructor_if_necessary( - self, typ, span, body_id, rvalue_scope); - } - ty::ReStatic => {} - _ => { - span_bug!(span, - "unexpected rvalue region in rvalue \ - destructor safety checking: `{:?}`", - region); - } + fn check_safety_of_rvalue_destructor_if_necessary(&mut self, cmt: &mc::cmt_<'tcx>, span: Span) { + if let Categorization::Rvalue(region) = cmt.cat { + match *region { + ty::ReScope(rvalue_scope) => { + let typ = self.resolve_type(cmt.ty); + let body_id = self.body_id; + let _ = dropck::check_safety_of_destructor_if_necessary( + self, + typ, + span, + body_id, + rvalue_scope, + ); + } + ty::ReStatic => {} + _ => { + span_bug!( + span, + "unexpected rvalue region in rvalue \ + destructor safety checking: `{:?}`", + region + ); } } - _ => {} } } /// Invoked on any index expression that occurs. Checks that if this is a slice /// being indexed, the lifetime of the pointer includes the deref expr. - fn constrain_index(&mut self, - index_expr: &hir::Expr, - indexed_ty: Ty<'tcx>) - { - debug!("constrain_index(index_expr=?, indexed_ty={}", - self.ty_to_string(indexed_ty)); + fn constrain_index(&mut self, index_expr: &hir::Expr, indexed_ty: Ty<'tcx>) { + debug!( + "constrain_index(index_expr=?, indexed_ty={}", + self.ty_to_string(indexed_ty) + ); let r_index_expr = ty::ReScope(region::Scope { id: index_expr.hir_id.local_id, - data: region::ScopeData::Node + data: region::ScopeData::Node, }); if let ty::Ref(r_ptr, r_ty, _) = indexed_ty.sty { match r_ty.sty { ty::Slice(_) | ty::Str => { - self.sub_regions(infer::IndexSlice(index_expr.span), - self.tcx.mk_region(r_index_expr), r_ptr); + self.sub_regions( + infer::IndexSlice(index_expr.span), + self.tcx.mk_region(r_index_expr), + r_ptr, + ); } _ => {} } @@ -947,27 +1001,29 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// Guarantees that any lifetimes which appear in the type of the node `id` (after applying /// adjustments) are valid for at least `minimum_lifetime` - fn type_of_node_must_outlive(&mut self, + fn type_of_node_must_outlive( + &mut self, origin: infer::SubregionOrigin<'tcx>, hir_id: hir::HirId, - minimum_lifetime: ty::Region<'tcx>) - { + minimum_lifetime: ty::Region<'tcx>, + ) { // Try to resolve the type. If we encounter an error, then typeck // is going to fail anyway, so just stop here and let typeck // report errors later on in the writeback phase. let ty0 = self.resolve_node_type(hir_id); let ty = self.tables - .borrow() - .adjustments() - .get(hir_id) - .and_then(|adj| adj.last()) - .map_or(ty0, |adj| adj.target); + .borrow() + .adjustments() + .get(hir_id) + .and_then(|adj| adj.last()) + .map_or(ty0, |adj| adj.target); let ty = self.resolve_type(ty); - debug!("constrain_regions_in_type_of_node(\ - ty={}, ty0={}, id={:?}, minimum_lifetime={:?})", - ty, ty0, - hir_id, minimum_lifetime); + debug!( + "constrain_regions_in_type_of_node(\ + ty={}, ty0={}, id={:?}, minimum_lifetime={:?})", + ty, ty0, hir_id, minimum_lifetime + ); self.type_must_outlive(origin, ty, minimum_lifetime); } @@ -979,23 +1035,25 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// - `origin`, the reason we need this constraint /// - `ty`, the type `T` /// - `region`, the region `'a` - pub fn type_must_outlive(&self, - origin: infer::SubregionOrigin<'tcx>, - ty: Ty<'tcx>, - region: ty::Region<'tcx>) - { - self.infcx.type_must_outlive(self.outlives_environment.region_bound_pairs(), - self.implicit_region_bound, - self.param_env, - origin, - ty, - region); + pub fn type_must_outlive( + &self, + origin: infer::SubregionOrigin<'tcx>, + ty: Ty<'tcx>, + region: ty::Region<'tcx>, + ) { + self.infcx.register_region_obligation( + self.body_id, + RegionObligation { + sub_region: region, + sup_type: ty, + origin, + }, + ); } /// Computes the guarantor for an expression `&base` and then ensures that the lifetime of the /// resulting pointer is linked to the lifetime of its guarantor (if any). - fn link_addr_of(&mut self, expr: &hir::Expr, - mutability: hir::Mutability, base: &hir::Expr) { + fn link_addr_of(&mut self, expr: &hir::Expr, mutability: hir::Mutability, base: &hir::Expr) { debug!("link_addr_of(expr={:?}, base={:?})", expr, base); let cmt = ignore_err!(self.with_mc(|mc| mc.cat_expr(base))); @@ -1011,7 +1069,9 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { fn link_local(&self, local: &hir::Local) { debug!("regionck::for_local()"); let init_expr = match local.init { - None => { return; } + None => { + return; + } Some(ref expr) => &**expr, }; let discr_cmt = Rc::new(ignore_err!(self.with_mc(|mc| mc.cat_expr(init_expr)))); @@ -1043,10 +1103,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { let arg_cmt = self.with_mc(|mc| { Rc::new(mc.cat_rvalue(arg.hir_id, arg.pat.span, re_scope, arg_ty)) }); - debug!("arg_ty={:?} arg_cmt={:?} arg={:?}", - arg_ty, - arg_cmt, - arg); + debug!("arg_ty={:?} arg_cmt={:?} arg={:?}", arg_ty, arg_cmt, arg); self.link_pattern(arg_cmt, &arg.pat); } } @@ -1054,24 +1111,28 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// Link lifetimes of any ref bindings in `root_pat` to the pointers found /// in the discriminant, if needed. fn link_pattern(&self, discr_cmt: mc::cmt<'tcx>, root_pat: &hir::Pat) { - debug!("link_pattern(discr_cmt={:?}, root_pat={:?})", - discr_cmt, - root_pat); + debug!( + "link_pattern(discr_cmt={:?}, root_pat={:?})", + discr_cmt, root_pat + ); ignore_err!(self.with_mc(|mc| { mc.cat_pattern(discr_cmt, root_pat, |sub_cmt, sub_pat| { - match sub_pat.node { - // `ref x` pattern - PatKind::Binding(..) => { - if let Some(&bm) = mc.tables.pat_binding_modes().get(sub_pat.hir_id) { - if let ty::BindByReference(mutbl) = bm { - self.link_region_from_node_type(sub_pat.span, sub_pat.hir_id, - mutbl, &sub_cmt); - } - } else { - self.tcx.sess.delay_span_bug(sub_pat.span, "missing binding mode"); + // `ref x` pattern + if let PatKind::Binding(..) = sub_pat.node { + if let Some(&bm) = mc.tables.pat_binding_modes().get(sub_pat.hir_id) { + if let ty::BindByReference(mutbl) = bm { + self.link_region_from_node_type( + sub_pat.span, + sub_pat.hir_id, + mutbl, + &sub_cmt, + ); } + } else { + self.tcx + .sess + .delay_span_bug(sub_pat.span, "missing binding mode"); } - _ => {} } }) })); @@ -1079,12 +1140,16 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// Link lifetime of borrowed pointer resulting from autoref to lifetimes in the value being /// autoref'd. - fn link_autoref(&self, - expr: &hir::Expr, - expr_cmt: &mc::cmt_<'tcx>, - autoref: &adjustment::AutoBorrow<'tcx>) - { - debug!("link_autoref(autoref={:?}, expr_cmt={:?})", autoref, expr_cmt); + fn link_autoref( + &self, + expr: &hir::Expr, + expr_cmt: &mc::cmt_<'tcx>, + autoref: &adjustment::AutoBorrow<'tcx>, + ) { + debug!( + "link_autoref(autoref={:?}, expr_cmt={:?})", + autoref, expr_cmt + ); match *autoref { adjustment::AutoBorrow::Ref(r, m) => { @@ -1094,7 +1159,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { adjustment::AutoBorrow::RawPtr(m) => { let r = self.tcx.mk_region(ty::ReScope(region::Scope { id: expr.hir_id.local_id, - data: region::ScopeData::Node + data: region::ScopeData::Node, })); self.link_region(expr.span, r, ty::BorrowKind::from_mutbl(m), expr_cmt); } @@ -1103,17 +1168,21 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// Like `link_region()`, except that the region is extracted from the type of `id`, /// which must be some reference (`&T`, `&str`, etc). - fn link_region_from_node_type(&self, - span: Span, - id: hir::HirId, - mutbl: hir::Mutability, - cmt_borrowed: &mc::cmt_<'tcx>) { - debug!("link_region_from_node_type(id={:?}, mutbl={:?}, cmt_borrowed={:?})", - id, mutbl, cmt_borrowed); + fn link_region_from_node_type( + &self, + span: Span, + id: hir::HirId, + mutbl: hir::Mutability, + cmt_borrowed: &mc::cmt_<'tcx>, + ) { + debug!( + "link_region_from_node_type(id={:?}, mutbl={:?}, cmt_borrowed={:?})", + id, mutbl, cmt_borrowed + ); let rptr_ty = self.resolve_node_type(id); if let ty::Ref(r, _, _) = rptr_ty.sty { - debug!("rptr_ty={}", rptr_ty); + debug!("rptr_ty={}", rptr_ty); self.link_region(span, r, ty::BorrowKind::from_mutbl(mutbl), cmt_borrowed); } } @@ -1122,11 +1191,13 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// kind `borrow_kind` and lifetime `borrow_region`. /// In order to ensure borrowck is satisfied, this may create constraints /// between regions, as explained in `link_reborrowed_region()`. - fn link_region(&self, - span: Span, - borrow_region: ty::Region<'tcx>, - borrow_kind: ty::BorrowKind, - borrow_cmt: &mc::cmt_<'tcx>) { + fn link_region( + &self, + span: Span, + borrow_region: ty::Region<'tcx>, + borrow_kind: ty::BorrowKind, + borrow_cmt: &mc::cmt_<'tcx>, + ) { let origin = infer::DataBorrowed(borrow_cmt.ty, span); self.type_must_outlive(origin, borrow_cmt.ty, borrow_region); @@ -1134,16 +1205,21 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { let mut borrow_cmt_cat = borrow_cmt.cat.clone(); loop { - debug!("link_region(borrow_region={:?}, borrow_kind={:?}, borrow_cmt={:?})", - borrow_region, - borrow_kind, - borrow_cmt); + debug!( + "link_region(borrow_region={:?}, borrow_kind={:?}, borrow_cmt={:?})", + borrow_region, borrow_kind, borrow_cmt + ); match borrow_cmt_cat { Categorization::Deref(ref_cmt, mc::BorrowedPtr(ref_kind, ref_region)) => { - match self.link_reborrowed_region(span, - borrow_region, borrow_kind, - ref_cmt, ref_region, ref_kind, - borrow_cmt.note) { + match self.link_reborrowed_region( + span, + borrow_region, + borrow_kind, + ref_cmt, + ref_region, + ref_kind, + borrow_cmt.note, + ) { Some((c, k)) => { borrow_cmt_cat = c.cat.clone(); borrow_kind = k; @@ -1154,20 +1230,20 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { } } - Categorization::Downcast(cmt_base, _) | - Categorization::Deref(cmt_base, mc::Unique) | - Categorization::Interior(cmt_base, _) => { + Categorization::Downcast(cmt_base, _) + | Categorization::Deref(cmt_base, mc::Unique) + | Categorization::Interior(cmt_base, _) => { // Borrowing interior or owned data requires the base // to be valid and borrowable in the same fashion. borrow_cmt_cat = cmt_base.cat.clone(); borrow_kind = borrow_kind; } - Categorization::Deref(_, mc::UnsafePtr(..)) | - Categorization::StaticItem | - Categorization::Upvar(..) | - Categorization::Local(..) | - Categorization::Rvalue(..) => { + Categorization::Deref(_, mc::UnsafePtr(..)) + | Categorization::StaticItem + | Categorization::Upvar(..) + | Categorization::Local(..) + | Categorization::Rvalue(..) => { // These are all "base cases" with independent lifetimes // that are not subject to inference return; @@ -1218,16 +1294,16 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// /// The return value of this function indicates whether we need to /// recurse and process `ref_cmt` (see case 2 above). - fn link_reborrowed_region(&self, - span: Span, - borrow_region: ty::Region<'tcx>, - borrow_kind: ty::BorrowKind, - ref_cmt: mc::cmt<'tcx>, - ref_region: ty::Region<'tcx>, - mut ref_kind: ty::BorrowKind, - note: mc::Note) - -> Option<(mc::cmt<'tcx>, ty::BorrowKind)> - { + fn link_reborrowed_region( + &self, + span: Span, + borrow_region: ty::Region<'tcx>, + borrow_kind: ty::BorrowKind, + ref_cmt: mc::cmt<'tcx>, + ref_region: ty::Region<'tcx>, + mut ref_kind: ty::BorrowKind, + note: mc::Note, + ) -> Option<(mc::cmt<'tcx>, ty::BorrowKind)> { // Possible upvar ID we may need later to create an entry in the // maybe link map. @@ -1243,7 +1319,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { infer::ReborrowUpvar(span, *upvar_id) } _ => { - span_bug!( span, "Illegal upvar id: {:?}", upvar_id); + span_bug!(span, "Illegal upvar id: {:?}", upvar_id); } } } @@ -1253,14 +1329,13 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // link infer::ReborrowUpvar(span, *upvar_id) } - _ => { - infer::Reborrow(span) - } + _ => infer::Reborrow(span), }; - debug!("link_reborrowed_region: {:?} <= {:?}", - borrow_region, - ref_region); + debug!( + "link_reborrowed_region: {:?} <= {:?}", + borrow_region, ref_region + ); self.sub_regions(cause, borrow_region, ref_region); // If we end up needing to recurse and establish a region link @@ -1272,10 +1347,8 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { // borrowck requires a unique path to the `&mut` reference but not // necessarily a *mutable* path. let new_borrow_kind = match borrow_kind { - ty::ImmBorrow => - ty::ImmBorrow, - ty::MutBorrow | ty::UniqueImmBorrow => - ty::UniqueImmBorrow + ty::ImmBorrow => ty::ImmBorrow, + ty::MutBorrow | ty::UniqueImmBorrow => ty::UniqueImmBorrow, }; // Decide whether we need to recurse and link any regions within @@ -1329,16 +1402,20 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { /// Checks that the values provided for type/region arguments in a given /// expression are well-formed and in-scope. - fn substs_wf_in_scope(&mut self, - origin: infer::ParameterOrigin, - substs: &Substs<'tcx>, - expr_span: Span, - expr_region: ty::Region<'tcx>) { - debug!("substs_wf_in_scope(substs={:?}, \ - expr_region={:?}, \ - origin={:?}, \ - expr_span={:?})", - substs, expr_region, origin, expr_span); + fn substs_wf_in_scope( + &mut self, + origin: infer::ParameterOrigin, + substs: &Substs<'tcx>, + expr_span: Span, + expr_region: ty::Region<'tcx>, + ) { + debug!( + "substs_wf_in_scope(substs={:?}, \ + expr_region={:?}, \ + origin={:?}, \ + expr_span={:?})", + substs, expr_region, origin, expr_span + ); let origin = infer::ParameterInScope(origin, expr_span); diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index 41df937980ff..99effce4ee08 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -73,15 +73,11 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for InferBorrowKindVisitor<'a, 'gcx, 'tcx> { } fn visit_expr(&mut self, expr: &'gcx hir::Expr) { - match expr.node { - hir::ExprKind::Closure(cc, _, body_id, _, _) => { - let body = self.fcx.tcx.hir.body(body_id); - self.visit_body(body); - self.fcx - .analyze_closure(expr.id, expr.hir_id, expr.span, body, cc); - } - - _ => {} + if let hir::ExprKind::Closure(cc, _, body_id, _, _) = expr.node { + let body = self.fcx.tcx.hir.body(body_id); + self.visit_body(body); + self.fcx + .analyze_closure(expr.id, expr.hir_id, expr.span, body, cc); } intravisit::walk_expr(self, expr); @@ -335,49 +331,46 @@ impl<'a, 'gcx, 'tcx> InferBorrowKind<'a, 'gcx, 'tcx> { "adjust_upvar_borrow_kind_for_consume: guarantor.cat={:?}", guarantor.cat ); - match guarantor.cat { - Categorization::Deref(_, mc::BorrowedPtr(..)) => { - debug!( - "adjust_upvar_borrow_kind_for_consume: found deref with note {:?}", - cmt.note - ); - match guarantor.note { - mc::NoteUpvarRef(upvar_id) => { - debug!( - "adjust_upvar_borrow_kind_for_consume: \ - setting upvar_id={:?} to by value", - upvar_id - ); + if let Categorization::Deref(_, mc::BorrowedPtr(..)) = guarantor.cat { + debug!( + "adjust_upvar_borrow_kind_for_consume: found deref with note {:?}", + cmt.note + ); + match guarantor.note { + mc::NoteUpvarRef(upvar_id) => { + debug!( + "adjust_upvar_borrow_kind_for_consume: \ + setting upvar_id={:?} to by value", + upvar_id + ); - // to move out of an upvar, this must be a FnOnce closure - self.adjust_closure_kind( - upvar_id.closure_expr_id, - ty::ClosureKind::FnOnce, - guarantor.span, - var_name(tcx, upvar_id.var_id), - ); + // to move out of an upvar, this must be a FnOnce closure + self.adjust_closure_kind( + upvar_id.closure_expr_id, + ty::ClosureKind::FnOnce, + guarantor.span, + var_name(tcx, upvar_id.var_id), + ); - self.adjust_upvar_captures - .insert(upvar_id, ty::UpvarCapture::ByValue); - } - mc::NoteClosureEnv(upvar_id) => { - // we get just a closureenv ref if this is a - // `move` closure, or if the upvar has already - // been inferred to by-value. In any case, we - // must still adjust the kind of the closure - // to be a FnOnce closure to permit moves out - // of the environment. - self.adjust_closure_kind( - upvar_id.closure_expr_id, - ty::ClosureKind::FnOnce, - guarantor.span, - var_name(tcx, upvar_id.var_id), - ); - } - mc::NoteIndex | mc::NoteNone => {} + self.adjust_upvar_captures + .insert(upvar_id, ty::UpvarCapture::ByValue); } + mc::NoteClosureEnv(upvar_id) => { + // we get just a closureenv ref if this is a + // `move` closure, or if the upvar has already + // been inferred to by-value. In any case, we + // must still adjust the kind of the closure + // to be a FnOnce closure to permit moves out + // of the environment. + self.adjust_closure_kind( + upvar_id.closure_expr_id, + ty::ClosureKind::FnOnce, + guarantor.span, + var_name(tcx, upvar_id.var_id), + ); + } + mc::NoteIndex | mc::NoteNone => {} } - _ => {} } } diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index a355bc99fd8e..cc1906d91d4c 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -77,8 +77,8 @@ pub fn check_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: Def let item = tcx.hir.expect_item(node_id); debug!("check_item_well_formed(it.id={}, it.name={})", - item.id, - tcx.item_path_str(def_id)); + item.id, + tcx.item_path_str(def_id)); match item.node { // Right now we check that every default trait implementation @@ -110,8 +110,8 @@ pub fn check_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: Def // FIXME(#27579) what amount of WF checking do we need for neg impls? if trait_ref.is_some() && !is_auto { span_err!(tcx.sess, item.span, E0192, - "negative impls are only allowed for \ - auto traits (e.g., `Send` and `Sync`)") + "negative impls are only allowed for \ + auto traits (e.g., `Send` and `Sync`)") } } } @@ -175,9 +175,9 @@ pub fn check_impl_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) { } fn check_associated_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - item_id: ast::NodeId, - span: Span, - sig_if_method: Option<&hir::MethodSig>) { + item_id: ast::NodeId, + span: Span, + sig_if_method: Option<&hir::MethodSig>) { let code = ObligationCauseCode::MiscObligation; for_id(tcx, item_id, span).with_fcx(|fcx, tcx| { let item = fcx.tcx.associated_item(fcx.tcx.hir.local_def_id(item_id)); @@ -185,7 +185,7 @@ fn check_associated_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let (mut implied_bounds, self_ty) = match item.container { ty::TraitContainer(_) => (vec![], fcx.tcx.mk_self_type()), ty::ImplContainer(def_id) => (fcx.impl_implied_bounds(def_id, span), - fcx.tcx.type_of(def_id)) + fcx.tcx.type_of(def_id)) }; match item.kind { @@ -199,7 +199,7 @@ fn check_associated_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let sig = fcx.tcx.fn_sig(item.def_id); let sig = fcx.normalize_associated_types_in(span, &sig); check_fn_or_method(tcx, fcx, span, sig, - item.def_id, &mut implied_bounds); + item.def_id, &mut implied_bounds); let sig_if_method = sig_if_method.expect("bad signature for method"); check_method_receiver(fcx, sig_if_method, &item, self_ty); } @@ -220,12 +220,12 @@ fn check_associated_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } fn for_item<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, item: &hir::Item) - -> CheckWfFcxBuilder<'a, 'gcx, 'tcx> { + -> CheckWfFcxBuilder<'a, 'gcx, 'tcx> { for_id(tcx, item.id, item.span) } fn for_id<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, id: ast::NodeId, span: Span) - -> CheckWfFcxBuilder<'a, 'gcx, 'tcx> { + -> CheckWfFcxBuilder<'a, 'gcx, 'tcx> { let def_id = tcx.hir.local_def_id(id); CheckWfFcxBuilder { inherited: Inherited::build(tcx, def_id), @@ -330,14 +330,12 @@ fn check_item_fn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item: &hir::Item) { let sig = fcx.normalize_associated_types_in(item.span, &sig); let mut implied_bounds = vec![]; check_fn_or_method(tcx, fcx, item.span, sig, - def_id, &mut implied_bounds); + def_id, &mut implied_bounds); implied_bounds }) } -fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - item: &hir::Item) -{ +fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item: &hir::Item) { debug!("check_item_type: {:?}", item); for_item(tcx, item).with_fcx(|fcx, _this| { @@ -351,9 +349,9 @@ fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - item: &hir::Item, - ast_self_ty: &hir::Ty, - ast_trait_ref: &Option) + item: &hir::Item, + ast_self_ty: &hir::Ty, + ast_trait_ref: &Option) { debug!("check_impl: {:?}", item); @@ -462,7 +460,7 @@ fn check_where_clauses<'a, 'gcx, 'fcx, 'tcx>( } }); // Now we build the substituted predicates. - let default_obligations = predicates.predicates.iter().flat_map(|&pred| { + let default_obligations = predicates.predicates.iter().flat_map(|&(pred, _)| { struct CountParams { params: FxHashSet } impl<'tcx> ty::fold::TypeVisitor<'tcx> for CountParams { fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { @@ -484,12 +482,9 @@ fn check_where_clauses<'a, 'gcx, 'fcx, 'tcx>( let substituted_pred = pred.subst(fcx.tcx, substs); // Don't check non-defaulted params, dependent defaults (including lifetimes) // or preds with multiple params. - if { - substituted_pred.references_error() || param_count.params.len() > 1 - || has_region - } { - None - } else if predicates.predicates.contains(&substituted_pred) { + if substituted_pred.references_error() || param_count.params.len() > 1 || has_region { + None + } else if predicates.predicates.iter().any(|&(p, _)| p == substituted_pred) { // Avoid duplication of predicates that contain no parameters, for example. None } else { @@ -535,11 +530,11 @@ fn check_where_clauses<'a, 'gcx, 'fcx, 'tcx>( } fn check_fn_or_method<'a, 'fcx, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, - fcx: &FnCtxt<'fcx, 'gcx, 'tcx>, - span: Span, - sig: ty::PolyFnSig<'tcx>, - def_id: DefId, - implied_bounds: &mut Vec>) + fcx: &FnCtxt<'fcx, 'gcx, 'tcx>, + span: Span, + sig: ty::PolyFnSig<'tcx>, + def_id: DefId, + implied_bounds: &mut Vec>) { let sig = fcx.normalize_associated_types_in(span, &sig); let sig = fcx.tcx.liberate_late_bound_regions(def_id, &sig); @@ -679,10 +674,10 @@ fn check_existential_types<'a, 'fcx, 'gcx, 'tcx>( "check_existential_types may define. adding predicates: {:#?}", predicates, ); - for &pred in predicates.predicates.iter() { + for &(pred, _) in predicates.predicates.iter() { let substituted_pred = pred.subst(fcx.tcx, substs); // Avoid duplication of predicates that contain no parameters, for example. - if !predicates.predicates.contains(&substituted_pred) { + if !predicates.predicates.iter().any(|&(p, _)| p == substituted_pred) { substituted_predicates.push(substituted_pred); } } @@ -702,7 +697,7 @@ fn check_method_receiver<'fcx, 'gcx, 'tcx>(fcx: &FnCtxt<'fcx, 'gcx, 'tcx>, { // check that the method has a valid receiver type, given the type `Self` debug!("check_method_receiver({:?}, self_ty={:?})", - method, self_ty); + method, self_ty); if !method.method_has_self_argument { return; @@ -806,14 +801,14 @@ fn check_variances_for_type_defn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mut constrained_parameters: FxHashSet<_> = variances.iter().enumerate() - .filter(|&(_, &variance)| variance != ty::Bivariant) - .map(|(index, _)| Parameter(index as u32)) - .collect(); + .filter(|&(_, &variance)| variance != ty::Bivariant) + .map(|(index, _)| Parameter(index as u32)) + .collect(); identify_constrained_type_params(tcx, - ty_predicates.predicates.as_slice(), - None, - &mut constrained_parameters); + &ty_predicates, + None, + &mut constrained_parameters); for (index, _) in variances.iter().enumerate() { if constrained_parameters.contains(&Parameter(index as u32)) { @@ -826,22 +821,17 @@ fn check_variances_for_type_defn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } fn report_bivariance<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - span: Span, - param_name: ast::Name) + span: Span, + param_name: ast::Name) { let mut err = error_392(tcx, span, param_name); let suggested_marker_id = tcx.lang_items().phantom_data(); - match suggested_marker_id { - Some(def_id) => { - err.help( - &format!("consider removing `{}` or using a marker such as `{}`", - param_name, - tcx.item_path_str(def_id))); - } - None => { - // no lang items, no help! - } + // help is available only in presence of lang items + if let Some(def_id) = suggested_marker_id { + err.help(&format!("consider removing `{}` or using a marker such as `{}`", + param_name, + tcx.item_path_str(def_id))); } err.emit(); } @@ -855,11 +845,10 @@ fn reject_shadowing_parameters(tcx: TyCtxt, def_id: DefId) { }).collect(); for method_param in &generics.params { - match method_param.kind { - // Shadowing is checked in resolve_lifetime. - GenericParamDefKind::Lifetime => continue, - _ => {}, - }; + // Shadowing is checked in resolve_lifetime. + if let GenericParamDefKind::Lifetime = method_param.kind { + continue + } if impl_params.contains_key(&method_param.name) { // Tighten up the span to focus on only the shadowing type let type_span = tcx.def_span(method_param.def_id); @@ -876,16 +865,19 @@ fn reject_shadowing_parameters(tcx: TyCtxt, def_id: DefId) { /// Feature gates RFC 2056 - trivial bounds, checking for global bounds that /// aren't true. fn check_false_global_bounds<'a, 'gcx, 'tcx>( - fcx: &FnCtxt<'a, 'gcx, 'tcx>, - span: Span, - id: ast::NodeId, -) { + fcx: &FnCtxt<'a, 'gcx, 'tcx>, + span: Span, + id: ast::NodeId) +{ use rustc::ty::TypeFoldable; let empty_env = ty::ParamEnv::empty(); let def_id = fcx.tcx.hir.local_def_id(id); - let predicates = fcx.tcx.predicates_of(def_id).predicates; + let predicates = fcx.tcx.predicates_of(def_id).predicates + .into_iter() + .map(|(p, _)| p) + .collect(); // Check elaborated bounds let implied_obligations = traits::elaborate_predicates(fcx.tcx, predicates); @@ -963,15 +955,13 @@ struct AdtField<'tcx> { impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { fn non_enum_variant(&self, struct_def: &hir::VariantData) -> AdtVariant<'tcx> { - let fields = - struct_def.fields().iter() - .map(|field| { - let field_ty = self.tcx.type_of(self.tcx.hir.local_def_id(field.id)); - let field_ty = self.normalize_associated_types_in(field.span, - &field_ty); - AdtField { ty: field_ty, span: field.span } - }) - .collect(); + let fields = struct_def.fields().iter().map(|field| { + let field_ty = self.tcx.type_of(self.tcx.hir.local_def_id(field.id)); + let field_ty = self.normalize_associated_types_in(field.span, + &field_ty); + AdtField { ty: field_ty, span: field.span } + }) + .collect(); AdtVariant { fields: fields } } @@ -1010,8 +1000,8 @@ fn error_392<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, span: Span, param_name: ast: fn error_194(tcx: TyCtxt, span: Span, trait_decl_span: Span, name: &str) { struct_span_err!(tcx.sess, span, E0194, - "type parameter `{}` shadows another type parameter of the same name", - name) + "type parameter `{}` shadows another type parameter of the same name", + name) .span_label(span, "shadows another type parameter") .span_label(trait_decl_span, format!("first `{}` declared here", name)) .emit(); diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 6595ce0facf6..40f5d27356c7 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -178,39 +178,34 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> { if let hir::ExprKind::Index(ref base, ref index) = e.node { let mut tables = self.fcx.tables.borrow_mut(); - match tables.expr_ty_adjusted(&base).sty { - // All valid indexing looks like this - ty::Ref(_, base_ty, _) => { - let index_ty = tables.expr_ty_adjusted(&index); - let index_ty = self.fcx.resolve_type_vars_if_possible(&index_ty); + // All valid indexing looks like this; might encounter non-valid indexes at this point + if let ty::Ref(_, base_ty, _) = tables.expr_ty_adjusted(&base).sty { + let index_ty = tables.expr_ty_adjusted(&index); + let index_ty = self.fcx.resolve_type_vars_if_possible(&index_ty); - if base_ty.builtin_index().is_some() && index_ty == self.fcx.tcx.types.usize { - // Remove the method call record - tables.type_dependent_defs_mut().remove(e.hir_id); - tables.node_substs_mut().remove(e.hir_id); + if base_ty.builtin_index().is_some() && index_ty == self.fcx.tcx.types.usize { + // Remove the method call record + tables.type_dependent_defs_mut().remove(e.hir_id); + tables.node_substs_mut().remove(e.hir_id); - tables.adjustments_mut().get_mut(base.hir_id).map(|a| { - // Discard the need for a mutable borrow - match a.pop() { - // Extra adjustment made when indexing causes a drop - // of size information - we need to get rid of it - // Since this is "after" the other adjustment to be - // discarded, we do an extra `pop()` - Some(Adjustment { - kind: Adjust::Unsize, - .. - }) => { - // So the borrow discard actually happens here - a.pop(); - } - _ => {} + tables.adjustments_mut().get_mut(base.hir_id).map(|a| { + // Discard the need for a mutable borrow + match a.pop() { + // Extra adjustment made when indexing causes a drop + // of size information - we need to get rid of it + // Since this is "after" the other adjustment to be + // discarded, we do an extra `pop()` + Some(Adjustment { + kind: Adjust::Unsize, + .. + }) => { + // So the borrow discard actually happens here + a.pop(); } - }); - } + _ => {} + } + }); } - // Might encounter non-valid indexes at this point, so there - // has to be a fall-through - _ => {} } } } @@ -445,7 +440,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> { span, &format!( "type parameter `{}` is part of concrete type but not used \ - in parameter list for existential type", + in parameter list for existential type", ty, ), ) @@ -767,10 +762,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Resolver<'cx, 'gcx, 'tcx> { // FIXME This should be carefully checked // We could use `self.report_error` but it doesn't accept a ty::Region, right now. fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { - match self.infcx.fully_resolve(&r) { - Ok(r) => r, - Err(_) => self.tcx.types.re_static, - } + self.infcx.fully_resolve(&r).unwrap_or(self.tcx.types.re_static) } } diff --git a/src/librustc_typeck/coherence/builtin.rs b/src/librustc_typeck/coherence/builtin.rs index efc35fad820c..db08bf809535 100644 --- a/src/librustc_typeck/coherence/builtin.rs +++ b/src/librustc_typeck/coherence/builtin.rs @@ -11,6 +11,7 @@ //! Check properties that are required by built-in traits and set //! up data structures required by type-checking/codegen. +use rustc::infer::SuppressRegionErrors; use rustc::infer::outlives::env::OutlivesEnvironment; use rustc::middle::region; use rustc::middle::lang_items::UnsizeTraitLangItem; @@ -396,6 +397,7 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>, impl_did, ®ion_scope_tree, &outlives_env, + SuppressRegionErrors::default(), ); CoerceUnsizedInfo { diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 996468ee3826..fe6be5adc6fe 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -56,6 +56,8 @@ use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc::hir::GenericParamKind; use rustc::hir::{self, CodegenFnAttrFlags, CodegenFnAttrs, Unsafety}; +use std::iter; + /////////////////////////////////////////////////////////////////////////// // Main entry point @@ -292,9 +294,10 @@ fn type_param_predicates<'a, 'tcx>( ItemKind::Trait(_, _, ref generics, ..) => { // Implied `Self: Trait` and supertrait bounds. if param_id == item_node_id { + let identity_trait_ref = ty::TraitRef::identity(tcx, item_def_id); result .predicates - .push(ty::TraitRef::identity(tcx, item_def_id).to_predicate()); + .push((identity_trait_ref.to_predicate(), item.span)); } generics } @@ -327,7 +330,7 @@ impl<'a, 'tcx> ItemCtxt<'a, 'tcx> { ast_generics: &hir::Generics, param_id: ast::NodeId, ty: Ty<'tcx>, - ) -> Vec> { + ) -> Vec<(ty::Predicate<'tcx>, Span)> { let from_ty_params = ast_generics .params .iter() @@ -705,8 +708,10 @@ fn super_predicates_of<'a, 'tcx>( // Now require that immediate supertraits are converted, // which will, in turn, reach indirect supertraits. - for bound in superbounds.iter().filter_map(|p| p.to_opt_poly_trait_ref()) { - tcx.at(item.span).super_predicates_of(bound.def_id()); + for &(pred, span) in &superbounds { + if let ty::Predicate::Trait(bound) = pred { + tcx.at(span).super_predicates_of(bound.def_id()); + } } ty::GenericPredicates { @@ -1584,10 +1589,10 @@ fn predicates_defined_on<'a, 'tcx>( def_id: DefId, ) -> ty::GenericPredicates<'tcx> { let explicit = tcx.explicit_predicates_of(def_id); - let predicates = [ - &explicit.predicates[..], - &tcx.inferred_outlives_of(def_id)[..], - ].concat(); + let span = tcx.def_span(def_id); + let predicates = explicit.predicates.into_iter().chain( + tcx.inferred_outlives_of(def_id).iter().map(|&p| (p, span)) + ).collect(); ty::GenericPredicates { parent: explicit.parent, @@ -1617,7 +1622,8 @@ fn predicates_of<'a, 'tcx>( // prove that the trait applies to the types that were // used, and adding the predicate into this list ensures // that this is done. - predicates.push(ty::TraitRef::identity(tcx, def_id).to_predicate()); + let span = tcx.def_span(def_id); + predicates.push((ty::TraitRef::identity(tcx, def_id).to_predicate(), span)); } ty::GenericPredicates { parent, predicates } @@ -1747,7 +1753,7 @@ fn explicit_predicates_of<'a, 'tcx>( // (see below). Recall that a default impl is not itself an impl, but rather a // set of defaults that can be incorporated into another impl. if let Some(trait_ref) = is_default_impl_trait { - predicates.push(trait_ref.to_poly_trait_ref().to_predicate()); + predicates.push((trait_ref.to_poly_trait_ref().to_predicate(), tcx.def_span(def_id))); } // Collect the region predicates that were declared inline as @@ -1768,7 +1774,7 @@ fn explicit_predicates_of<'a, 'tcx>( hir::GenericBound::Outlives(lt) => { let bound = AstConv::ast_region_to_region(&icx, <, None); let outlives = ty::Binder::bind(ty::OutlivesPredicate(region, bound)); - predicates.push(outlives.to_predicate()); + predicates.push((outlives.to_predicate(), lt.span)); } _ => bug!(), }); @@ -1812,7 +1818,8 @@ fn explicit_predicates_of<'a, 'tcx>( // users who never wrote `where Type:,` themselves, to // compiler/tooling bugs from not handling WF predicates. } else { - predicates.push(ty::Predicate::WellFormed(ty)); + let span = bound_pred.bounded_ty.span; + predicates.push((ty::Predicate::WellFormed(ty), span)); } } @@ -1828,14 +1835,16 @@ fn explicit_predicates_of<'a, 'tcx>( &mut projections, ); - predicates.push(trait_ref.to_predicate()); - predicates.extend(projections.iter().map(|p| p.to_predicate())); + predicates.push((trait_ref.to_predicate(), poly_trait_ref.span)); + predicates.extend(projections.iter().map(|&(p, span)| { + (p.to_predicate(), span) + })); } &hir::GenericBound::Outlives(ref lifetime) => { let region = AstConv::ast_region_to_region(&icx, lifetime, None); let pred = ty::Binder::bind(ty::OutlivesPredicate(ty, region)); - predicates.push(ty::Predicate::TypeOutlives(pred)) + predicates.push((ty::Predicate::TypeOutlives(pred), lifetime.span)) } } } @@ -1844,14 +1853,14 @@ fn explicit_predicates_of<'a, 'tcx>( &hir::WherePredicate::RegionPredicate(ref region_pred) => { let r1 = AstConv::ast_region_to_region(&icx, ®ion_pred.lifetime, None); for bound in ®ion_pred.bounds { - let r2 = match bound { + let (r2, span) = match bound { hir::GenericBound::Outlives(lt) => { - AstConv::ast_region_to_region(&icx, lt, None) + (AstConv::ast_region_to_region(&icx, lt, None), lt.span) } _ => bug!(), }; let pred = ty::Binder::bind(ty::OutlivesPredicate(r1, r2)); - predicates.push(ty::Predicate::RegionOutlives(pred)) + predicates.push((ty::Predicate::RegionOutlives(pred), span)) } } @@ -1940,22 +1949,25 @@ pub fn compute_bounds<'gcx: 'tcx, 'tcx>( let mut projection_bounds = vec![]; - let mut trait_bounds: Vec<_> = trait_bounds - .iter() - .map(|&bound| astconv.instantiate_poly_trait_ref(bound, param_ty, &mut projection_bounds)) - .collect(); + let mut trait_bounds: Vec<_> = trait_bounds.iter().map(|&bound| { + (astconv.instantiate_poly_trait_ref(bound, param_ty, &mut projection_bounds), bound.span) + }).collect(); let region_bounds = region_bounds .into_iter() - .map(|r| astconv.ast_region_to_region(r, None)) + .map(|r| (astconv.ast_region_to_region(r, None), r.span)) .collect(); - trait_bounds.sort_by_key(|t| t.def_id()); + trait_bounds.sort_by_key(|(t, _)| t.def_id()); let implicitly_sized = if let SizedByDefault::Yes = sized_by_default { - !is_unsized(astconv, ast_bounds, span) + if !is_unsized(astconv, ast_bounds, span) { + Some(span) + } else { + None + } } else { - false + None }; Bounds { @@ -1975,21 +1987,21 @@ fn predicates_from_bound<'tcx>( astconv: &dyn AstConv<'tcx, 'tcx>, param_ty: Ty<'tcx>, bound: &hir::GenericBound, -) -> Vec> { +) -> Vec<(ty::Predicate<'tcx>, Span)> { match *bound { hir::GenericBound::Trait(ref tr, hir::TraitBoundModifier::None) => { let mut projections = Vec::new(); let pred = astconv.instantiate_poly_trait_ref(tr, param_ty, &mut projections); - projections - .into_iter() - .map(|p| p.to_predicate()) - .chain(Some(pred.to_predicate())) - .collect() + iter::once((pred.to_predicate(), tr.span)).chain( + projections + .into_iter() + .map(|(p, span)| (p.to_predicate(), span)) + ).collect() } hir::GenericBound::Outlives(ref lifetime) => { let region = astconv.ast_region_to_region(lifetime, None); let pred = ty::Binder::bind(ty::OutlivesPredicate(param_ty, region)); - vec![ty::Predicate::TypeOutlives(pred)] + vec![(ty::Predicate::TypeOutlives(pred), lifetime.span)] } hir::GenericBound::Trait(_, hir::TraitBoundModifier::Maybe) => vec![], } diff --git a/src/librustc_typeck/constrained_type_params.rs b/src/librustc_typeck/constrained_type_params.rs index 1b481fc5a7d3..1ef599ec58f9 100644 --- a/src/librustc_typeck/constrained_type_params.rs +++ b/src/librustc_typeck/constrained_type_params.rs @@ -11,6 +11,7 @@ use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::fold::{TypeFoldable, TypeVisitor}; use rustc::util::nodemap::FxHashSet; +use syntax::source_map::Span; #[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Parameter(pub u32); @@ -86,12 +87,12 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector { } } -pub fn identify_constrained_type_params<'tcx>(tcx: TyCtxt, - predicates: &[ty::Predicate<'tcx>], +pub fn identify_constrained_type_params<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, + predicates: &ty::GenericPredicates<'tcx>, impl_trait_ref: Option>, input_parameters: &mut FxHashSet) { - let mut predicates = predicates.to_owned(); + let mut predicates = predicates.predicates.clone(); setup_constraining_predicates(tcx, &mut predicates, impl_trait_ref, input_parameters); } @@ -137,7 +138,7 @@ pub fn identify_constrained_type_params<'tcx>(tcx: TyCtxt, /// by 0. I should probably pick a less tangled example, but I can't /// think of any. pub fn setup_constraining_predicates<'tcx>(tcx: TyCtxt, - predicates: &mut [ty::Predicate<'tcx>], + predicates: &mut [(ty::Predicate<'tcx>, Span)], impl_trait_ref: Option>, input_parameters: &mut FxHashSet) { @@ -169,7 +170,7 @@ pub fn setup_constraining_predicates<'tcx>(tcx: TyCtxt, changed = false; for j in i..predicates.len() { - if let ty::Predicate::Projection(ref poly_projection) = predicates[j] { + if let ty::Predicate::Projection(ref poly_projection) = predicates[j].0 { // Note that we can skip binder here because the impl // trait ref never contains any late-bound regions. let projection = poly_projection.skip_binder(); diff --git a/src/librustc_typeck/impl_wf_check.rs b/src/librustc_typeck/impl_wf_check.rs index 11260b8f11e1..abb59dc9d9a3 100644 --- a/src/librustc_typeck/impl_wf_check.rs +++ b/src/librustc_typeck/impl_wf_check.rs @@ -100,7 +100,7 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mut input_parameters = ctp::parameters_for_impl(impl_self_ty, impl_trait_ref); ctp::identify_constrained_type_params( - tcx, &impl_predicates.predicates.as_slice(), impl_trait_ref, &mut input_parameters); + tcx, &impl_predicates, impl_trait_ref, &mut input_parameters); // Disallow unconstrained lifetimes, but only if they appear in assoc types. let lifetimes_in_associated_types: FxHashSet<_> = impl_item_refs.iter() diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index c9aa0339dd46..1de79ddf4a49 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -392,7 +392,7 @@ pub fn hir_ty_to_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_ty: &hir::Ty) -> } pub fn hir_trait_to_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_trait: &hir::TraitRef) - -> (ty::PolyTraitRef<'tcx>, Vec>) { + -> (ty::PolyTraitRef<'tcx>, Vec<(ty::PolyProjectionPredicate<'tcx>, Span)>) { // In case there are any projections etc, find the "environment" // def-id that will be used to determine the traits/predicates in // scope. This is derived from the enclosing item-like thing. diff --git a/src/librustc_typeck/outlives/explicit.rs b/src/librustc_typeck/outlives/explicit.rs index a7ecfc269f35..75f8b78b9ecf 100644 --- a/src/librustc_typeck/outlives/explicit.rs +++ b/src/librustc_typeck/outlives/explicit.rs @@ -40,7 +40,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> { let mut required_predicates = RequiredPredicates::default(); // process predicates and convert to `RequiredPredicates` entry, see below - for pred in predicates.into_iter() { + for (pred, _) in predicates.into_iter() { match pred { ty::Predicate::TypeOutlives(predicate) => { let OutlivesPredicate(ref ty, ref reg) = predicate.skip_binder(); diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 1ea130cf16ae..a435712ac3d6 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -13,7 +13,7 @@ use std::iter::once; use syntax::ast; -use syntax::ext::base::MacroKind; +use syntax::ext::base::{MacroKind, SyntaxExtension}; use syntax_pos::Span; use rustc::hir; @@ -105,12 +105,12 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa record_extern_fqn(cx, did, clean::TypeKind::Const); clean::ConstantItem(build_const(cx, did)) } - // FIXME(misdreavus): if attributes/derives come down here we should probably document them - // separately + // FIXME: proc-macros don't propagate attributes or spans across crates, so they look empty Def::Macro(did, MacroKind::Bang) => { - record_extern_fqn(cx, did, clean::TypeKind::Macro); - if let Some(mac) = build_macro(cx, did, name) { - clean::MacroItem(mac) + let mac = build_macro(cx, did, name); + if let clean::MacroItem(..) = mac { + record_extern_fqn(cx, did, clean::TypeKind::Macro); + mac } else { return None; } @@ -442,31 +442,41 @@ fn build_static(cx: &DocContext, did: DefId, mutable: bool) -> clean::Static { } } -fn build_macro(cx: &DocContext, did: DefId, name: ast::Name) -> Option { +fn build_macro(cx: &DocContext, did: DefId, name: ast::Name) -> clean::ItemEnum { let imported_from = cx.tcx.original_crate_name(did.krate); - let def = match cx.cstore.load_macro_untracked(did, cx.sess()) { - LoadedMacro::MacroDef(macro_def) => macro_def, - // FIXME(jseyfried): document proc macro re-exports - LoadedMacro::ProcMacro(..) => return None, - }; + match cx.cstore.load_macro_untracked(did, cx.sess()) { + LoadedMacro::MacroDef(def) => { + let matchers: hir::HirVec = if let ast::ItemKind::MacroDef(ref def) = def.node { + let tts: Vec<_> = def.stream().into_trees().collect(); + tts.chunks(4).map(|arm| arm[0].span()).collect() + } else { + unreachable!() + }; - let matchers: hir::HirVec = if let ast::ItemKind::MacroDef(ref def) = def.node { - let tts: Vec<_> = def.stream().into_trees().collect(); - tts.chunks(4).map(|arm| arm[0].span()).collect() - } else { - unreachable!() - }; + let source = format!("macro_rules! {} {{\n{}}}", + name.clean(cx), + matchers.iter().map(|span| { + format!(" {} => {{ ... }};\n", span.to_src(cx)) + }).collect::()); - let source = format!("macro_rules! {} {{\n{}}}", - name.clean(cx), - matchers.iter().map(|span| { - format!(" {} => {{ ... }};\n", span.to_src(cx)) - }).collect::()); + clean::MacroItem(clean::Macro { + source, + imported_from: Some(imported_from).clean(cx), + }) + } + LoadedMacro::ProcMacro(ext) => { + let helpers = match &*ext { + &SyntaxExtension::ProcMacroDerive(_, ref syms, ..) => { syms.clean(cx) } + _ => Vec::new(), + }; + + clean::ProcMacroItem(clean::ProcMacro { + kind: ext.kind(), + helpers, + }) + } + } - Some(clean::Macro { - source, - imported_from: Some(imported_from).clean(cx), - }) } /// A trait's generics clause actually contains all of the predicates for all of diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a982933f6c1a..a91f2fd7474f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -21,6 +21,7 @@ pub use self::Visibility::{Public, Inherited}; use rustc_target::spec::abi::Abi; use syntax::ast::{self, AttrStyle, Ident}; use syntax::attr; +use syntax::ext::base::MacroKind; use syntax::source_map::{dummy_spanned, Spanned}; use syntax::ptr::P; use syntax::symbol::keywords::{self, Keyword}; @@ -527,6 +528,7 @@ pub enum ItemEnum { /// `type`s from an extern block ForeignTypeItem, MacroItem(Macro), + ProcMacroItem(ProcMacro), PrimitiveItem(PrimitiveType), AssociatedConstItem(Type, Option), AssociatedTypeItem(Vec, Option), @@ -588,6 +590,7 @@ impl Clean for doctree::Module { items.extend(self.traits.iter().map(|x| x.clean(cx))); items.extend(self.impls.iter().flat_map(|x| x.clean(cx))); items.extend(self.macros.iter().map(|x| x.clean(cx))); + items.extend(self.proc_macros.iter().map(|x| x.clean(cx))); // determine if we should display the inner contents or // the outer `mod` item for the source code. @@ -1571,7 +1574,9 @@ impl<'a, 'tcx> Clean for (&'a ty::Generics, } }).collect::>(); - let mut where_predicates = preds.predicates.to_vec().clean(cx); + let mut where_predicates = preds.predicates.iter() + .map(|(p, _)| p.clean(cx)) + .collect::>(); // Type parameters and have a Sized bound by default unless removed with // ?Sized. Scan through the predicates and mark any type parameter with @@ -2189,6 +2194,8 @@ pub enum TypeKind { Typedef, Foreign, Macro, + Attr, + Derive, } pub trait GetDefId { @@ -3725,7 +3732,12 @@ pub fn register_def(cx: &DocContext, def: Def) -> DefId { Def::Static(i, _) => (i, TypeKind::Static), Def::Variant(i) => (cx.tcx.parent_def_id(i).expect("cannot get parent def id"), TypeKind::Enum), - Def::Macro(i, _) => (i, TypeKind::Macro), + Def::Macro(i, mac_kind) => match mac_kind { + MacroKind::Bang => (i, TypeKind::Macro), + MacroKind::Attr => (i, TypeKind::Attr), + MacroKind::Derive => (i, TypeKind::Derive), + MacroKind::ProcMacroStub => unreachable!(), + }, Def::SelfTy(Some(def_id), _) => (def_id, TypeKind::Trait), Def::SelfTy(_, Some(impl_def_id)) => { return impl_def_id @@ -3780,6 +3792,30 @@ impl Clean for doctree::Macro { } } +#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +pub struct ProcMacro { + pub kind: MacroKind, + pub helpers: Vec, +} + +impl Clean for doctree::ProcMacro { + fn clean(&self, cx: &DocContext) -> Item { + Item { + name: Some(self.name.clean(cx)), + attrs: self.attrs.clean(cx), + source: self.whence.clean(cx), + visibility: Some(Public), + stability: self.stab.clean(cx), + deprecation: self.depr.clean(cx), + def_id: cx.tcx.hir.local_def_id(self.id), + inner: ProcMacroItem(ProcMacro { + kind: self.kind, + helpers: self.helpers.clean(cx), + }), + } + } +} + #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct Stability { pub level: stability::StabilityLevel, diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index e938d2d0a165..eda522af9224 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -157,7 +157,7 @@ fn trait_is_same_or_supertrait(cx: &DocContext, child: DefId, return true } let predicates = cx.tcx.super_predicates_of(child).predicates; - predicates.iter().filter_map(|pred| { + predicates.iter().filter_map(|(pred, _)| { if let ty::Predicate::Trait(ref pred) = *pred { if pred.skip_binder().trait_ref.self_ty().is_self() { Some(pred.def_id()) diff --git a/src/librustdoc/doctree.rs b/src/librustdoc/doctree.rs index dd1e1e99957c..4a6a4ee09ea1 100644 --- a/src/librustdoc/doctree.rs +++ b/src/librustdoc/doctree.rs @@ -15,6 +15,7 @@ pub use self::StructType::*; use syntax::ast; use syntax::ast::{Name, NodeId}; use syntax::attr; +use syntax::ext::base::MacroKind; use syntax::ptr::P; use syntax::source_map::Spanned; use syntax_pos::{self, Span}; @@ -46,6 +47,7 @@ pub struct Module { pub impls: Vec, pub foreigns: Vec, pub macros: Vec, + pub proc_macros: Vec, pub is_crate: bool, } @@ -75,6 +77,7 @@ impl Module { impls : Vec::new(), foreigns : Vec::new(), macros : Vec::new(), + proc_macros: Vec::new(), is_crate : false, } } @@ -264,6 +267,17 @@ pub struct Import { pub whence: Span, } +pub struct ProcMacro { + pub name: Name, + pub id: NodeId, + pub kind: MacroKind, + pub helpers: Vec, + pub attrs: hir::HirVec, + pub whence: Span, + pub stab: Option, + pub depr: Option, +} + pub fn struct_type_from_def(vdata: &hir::VariantData) -> StructType { match *vdata { hir::VariantData::Struct(..) => Plain, diff --git a/src/librustdoc/html/item_type.rs b/src/librustdoc/html/item_type.rs index a5131e327e08..acb8f6a66dfc 100644 --- a/src/librustdoc/html/item_type.rs +++ b/src/librustdoc/html/item_type.rs @@ -11,6 +11,7 @@ //! Item types. use std::fmt; +use syntax::ext::base::MacroKind; use clean; /// Item type. Corresponds to `clean::ItemEnum` variants. @@ -19,6 +20,11 @@ use clean; /// discriminants. JavaScript then is used to decode them into the original value. /// Consequently, every change to this type should be synchronized to /// the `itemTypes` mapping table in `static/main.js`. +/// +/// In addition, code in `html::render` uses this enum to generate CSS classes, page prefixes, and +/// module headings. If you are adding to this enum and want to ensure that the sidebar also prints +/// a heading, edit the listing in `html/render.rs`, function `sidebar_module`. This uses an +/// ordering based on a helper function inside `item_module`, in the same file. #[derive(Copy, PartialEq, Clone, Debug)] pub enum ItemType { Module = 0, @@ -44,6 +50,8 @@ pub enum ItemType { ForeignType = 20, Keyword = 21, Existential = 22, + ProcAttribute = 23, + ProcDerive = 24, } @@ -88,6 +96,12 @@ impl<'a> From<&'a clean::Item> for ItemType { clean::AssociatedTypeItem(..) => ItemType::AssociatedType, clean::ForeignTypeItem => ItemType::ForeignType, clean::KeywordItem(..) => ItemType::Keyword, + clean::ProcMacroItem(ref mac) => match mac.kind { + MacroKind::Bang => ItemType::Macro, + MacroKind::Attr => ItemType::ProcAttribute, + MacroKind::Derive => ItemType::ProcDerive, + MacroKind::ProcMacroStub => unreachable!(), + } clean::StrippedItem(..) => unreachable!(), } } @@ -107,7 +121,9 @@ impl From for ItemType { clean::TypeKind::Variant => ItemType::Variant, clean::TypeKind::Typedef => ItemType::Typedef, clean::TypeKind::Foreign => ItemType::ForeignType, - clean::TypeKind::Macro => ItemType::Macro, + clean::TypeKind::Macro => ItemType::Macro, + clean::TypeKind::Attr => ItemType::ProcAttribute, + clean::TypeKind::Derive => ItemType::ProcDerive, } } } @@ -138,6 +154,8 @@ impl ItemType { ItemType::ForeignType => "foreigntype", ItemType::Keyword => "keyword", ItemType::Existential => "existential", + ItemType::ProcAttribute => "attr", + ItemType::ProcDerive => "derive", } } @@ -166,7 +184,9 @@ impl ItemType { ItemType::Constant | ItemType::AssociatedConst => NameSpace::Value, - ItemType::Macro => NameSpace::Macro, + ItemType::Macro | + ItemType::ProcAttribute | + ItemType::ProcDerive => NameSpace::Macro, ItemType::Keyword => NameSpace::Keyword, } diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 3e1720f8b8ab..1c61e73fae03 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -56,6 +56,7 @@ use externalfiles::ExternalHtml; use serialize::json::{ToJson, Json, as_json}; use syntax::ast; +use syntax::ext::base::MacroKind; use syntax::source_map::FileName; use syntax::feature_gate::UnstableFeatures; use rustc::hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId}; @@ -1595,6 +1596,8 @@ struct AllTypes { statics: FxHashSet, constants: FxHashSet, keywords: FxHashSet, + attributes: FxHashSet, + derives: FxHashSet, } impl AllTypes { @@ -1613,6 +1616,8 @@ impl AllTypes { statics: new_set(100), constants: new_set(100), keywords: new_set(100), + attributes: new_set(100), + derives: new_set(100), } } @@ -1634,6 +1639,8 @@ impl AllTypes { ItemType::Existential => self.existentials.insert(ItemEntry::new(new_url, name)), ItemType::Static => self.statics.insert(ItemEntry::new(new_url, name)), ItemType::Constant => self.constants.insert(ItemEntry::new(new_url, name)), + ItemType::ProcAttribute => self.attributes.insert(ItemEntry::new(new_url, name)), + ItemType::ProcDerive => self.derives.insert(ItemEntry::new(new_url, name)), _ => true, }; } @@ -1673,6 +1680,8 @@ impl fmt::Display for AllTypes { print_entries(f, &self.primitives, "Primitives", "primitives")?; print_entries(f, &self.traits, "Traits", "traits")?; print_entries(f, &self.macros, "Macros", "macros")?; + print_entries(f, &self.attributes, "Attribute Macros", "attributes")?; + print_entries(f, &self.derives, "Derive Macros", "derives")?; print_entries(f, &self.functions, "Functions", "functions")?; print_entries(f, &self.typedefs, "Typedefs", "typedefs")?; print_entries(f, &self.existentials, "Existentials", "existentials")?; @@ -2155,6 +2164,12 @@ impl<'a> fmt::Display for Item<'a> { clean::EnumItem(..) => write!(fmt, "Enum ")?, clean::TypedefItem(..) => write!(fmt, "Type Definition ")?, clean::MacroItem(..) => write!(fmt, "Macro ")?, + clean::ProcMacroItem(ref mac) => match mac.kind { + MacroKind::Bang => write!(fmt, "Macro ")?, + MacroKind::Attr => write!(fmt, "Attribute Macro ")?, + MacroKind::Derive => write!(fmt, "Derive Macro ")?, + MacroKind::ProcMacroStub => unreachable!(), + } clean::PrimitiveItem(..) => write!(fmt, "Primitive Type ")?, clean::StaticItem(..) | clean::ForeignStaticItem(..) => write!(fmt, "Static ")?, clean::ConstantItem(..) => write!(fmt, "Constant ")?, @@ -2191,6 +2206,7 @@ impl<'a> fmt::Display for Item<'a> { clean::EnumItem(ref e) => item_enum(fmt, self.cx, self.item, e), clean::TypedefItem(ref t, _) => item_typedef(fmt, self.cx, self.item, t), clean::MacroItem(ref m) => item_macro(fmt, self.cx, self.item, m), + clean::ProcMacroItem(ref m) => item_proc_macro(fmt, self.cx, self.item, m), clean::PrimitiveItem(ref p) => item_primitive(fmt, self.cx, self.item, p), clean::StaticItem(ref i) | clean::ForeignStaticItem(ref i) => item_static(fmt, self.cx, self.item, i), @@ -4079,11 +4095,12 @@ impl<'a> fmt::Display for Sidebar<'a> { write!(fmt, "

\

Version {}

\ -
-

See all {}'s items

", - version, - it.name.as_ref().unwrap())?; + ", + version)?; } + + write!(fmt, "

See all {}'s items

", + it.name.as_ref().expect("crates always have a name"))?; } write!(fmt, "
")?; @@ -4523,6 +4540,8 @@ fn item_ty_to_strs(ty: &ItemType) -> (&'static str, &'static str) { ItemType::ForeignType => ("foreign-types", "Foreign Types"), ItemType::Keyword => ("keywords", "Keywords"), ItemType::Existential => ("existentials", "Existentials"), + ItemType::ProcAttribute => ("attributes", "Attribute Macros"), + ItemType::ProcDerive => ("derives", "Derive Macros"), } } @@ -4598,6 +4617,39 @@ fn item_macro(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, document(w, cx, it) } +fn item_proc_macro(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, m: &clean::ProcMacro) + -> fmt::Result +{ + let name = it.name.as_ref().expect("proc-macros always have names"); + match m.kind { + MacroKind::Bang => { + write!(w, "
")?;
+            write!(w, "{}!() {{ /* proc-macro */ }}", name)?;
+            write!(w, "
")?; + } + MacroKind::Attr => { + write!(w, "
")?;
+            write!(w, "#[{}]", name)?;
+            write!(w, "
")?; + } + MacroKind::Derive => { + write!(w, "
")?;
+            write!(w, "#[derive({})]", name)?;
+            if !m.helpers.is_empty() {
+                writeln!(w, "\n{{")?;
+                writeln!(w, "    // Attributes available to this derive:")?;
+                for attr in &m.helpers {
+                    writeln!(w, "    #[{}]", attr)?;
+                }
+                write!(w, "}}")?;
+            }
+            write!(w, "
")?; + } + _ => {} + } + document(w, cx, it) +} + fn item_primitive(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, _p: &clean::PrimitiveType) -> fmt::Result { diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 0b56692bc2e7..6307dda454da 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -39,7 +39,10 @@ "associatedconstant", "union", "foreigntype", - "keyword"]; + "keyword", + "existential", + "attr", + "derive"]; var search_input = document.getElementsByClassName('search-input')[0]; diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index 12d220848936..34a1d71beecf 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -124,6 +124,8 @@ pre { .content .highlighted.tymethod { background-color: #4950ed; } .content .highlighted.type { background-color: #38902c; } .content .highlighted.foreigntype { background-color: #b200d6; } +.content .highlighted.attr, +.content .highlighted.derive, .content .highlighted.macro { background-color: #217d1c; } .content .highlighted.constant, .content .highlighted.static { background-color: #0063cc; } @@ -134,6 +136,8 @@ pre { .content span.struct, .content a.struct, .block a.current.struct { color: #2dbfb8; } .content span.type, .content a.type, .block a.current.type { color: #ff7f00; } .content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #dd7de8; } +.content span.attr, .content a.attr, .block a.current.attr, +.content span.derive, .content a.derive, .block a.current.derive, .content span.macro, .content a.macro, .block a.current.macro { color: #09bd00; } .content span.union, .content a.union, .block a.current.union { color: #a6ae37; } .content span.constant, .content a.constant, .block a.current.constant, diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index 043d7ae23c2e..8218b1b371ea 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -124,6 +124,8 @@ pre { .content .highlighted.tymethod { background-color: #c6afb3; } .content .highlighted.type { background-color: #ffc891; } .content .highlighted.foreigntype { background-color: #f5c4ff; } +.content .highlighted.attr, +.content .highlighted.derive, .content .highlighted.macro { background-color: #8ce488; } .content .highlighted.constant, .content .highlighted.static { background-color: #c3e0ff; } @@ -134,6 +136,8 @@ pre { .content span.struct, .content a.struct, .block a.current.struct { color: #ad448e; } .content span.type, .content a.type, .block a.current.type { color: #ba5d00; } .content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #cd00e2; } +.content span.attr, .content a.attr, .block a.current.attr, +.content span.derive, .content a.derive, .block a.current.derive, .content span.macro, .content a.macro, .block a.current.macro { color: #068000; } .content span.union, .content a.union, .block a.current.union { color: #767b27; } .content span.constant, .content a.constant, .block a.current.constant, diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs index 24fec62dd573..d00eb3257d43 100644 --- a/src/librustdoc/passes/mod.rs +++ b/src/librustdoc/passes/mod.rs @@ -249,6 +249,9 @@ impl<'a> fold::DocFolder for Stripper<'a> { // tymethods/macros have no control over privacy clean::MacroItem(..) | clean::TyMethodItem(..) => {} + // Proc-macros are always public + clean::ProcMacroItem(..) => {} + // Primitives are never stripped clean::PrimitiveItem(..) => {} diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 0e12fd34eb7d..92d8dbed0718 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -15,6 +15,7 @@ use std::mem; use syntax::ast; use syntax::attr; +use syntax::ext::base::MacroKind; use syntax::source_map::Spanned; use syntax_pos::{self, Span}; @@ -168,24 +169,75 @@ impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { } } - pub fn visit_fn(&mut self, item: &hir::Item, + pub fn visit_fn(&mut self, om: &mut Module, item: &hir::Item, name: ast::Name, fd: &hir::FnDecl, header: hir::FnHeader, gen: &hir::Generics, - body: hir::BodyId) -> Function { + body: hir::BodyId) { debug!("Visiting fn"); - Function { - id: item.id, - vis: item.vis.clone(), - stab: self.stability(item.id), - depr: self.deprecation(item.id), - attrs: item.attrs.clone(), - decl: fd.clone(), - name, - whence: item.span, - generics: gen.clone(), - header, - body, + let macro_kind = item.attrs.iter().filter_map(|a| { + if a.check_name("proc_macro") { + Some(MacroKind::Bang) + } else if a.check_name("proc_macro_derive") { + Some(MacroKind::Derive) + } else if a.check_name("proc_macro_attribute") { + Some(MacroKind::Attr) + } else { + None + } + }).next(); + match macro_kind { + Some(kind) => { + let name = if kind == MacroKind::Derive { + item.attrs.lists("proc_macro_derive") + .filter_map(|mi| mi.name()) + .next() + .expect("proc-macro derives require a name") + } else { + name + }; + + let mut helpers = Vec::new(); + for mi in item.attrs.lists("proc_macro_derive") { + if !mi.check_name("attributes") { + continue; + } + + if let Some(list) = mi.meta_item_list() { + for inner_mi in list { + if let Some(name) = inner_mi.name() { + helpers.push(name); + } + } + } + } + + om.proc_macros.push(ProcMacro { + name, + id: item.id, + kind, + helpers, + attrs: item.attrs.clone(), + whence: item.span, + stab: self.stability(item.id), + depr: self.deprecation(item.id), + }); + } + None => { + om.fns.push(Function { + id: item.id, + vis: item.vis.clone(), + stab: self.stability(item.id), + depr: self.deprecation(item.id), + attrs: item.attrs.clone(), + decl: fd.clone(), + name, + whence: item.span, + generics: gen.clone(), + header, + body, + }); + } } } @@ -425,7 +477,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { hir::ItemKind::Union(ref sd, ref gen) => om.unions.push(self.visit_union_data(item, name, sd, gen)), hir::ItemKind::Fn(ref fd, header, ref gen, body) => - om.fns.push(self.visit_fn(item, name, &**fd, header, gen, body)), + self.visit_fn(om, item, name, &**fd, header, gen, body), hir::ItemKind::Ty(ref ty, ref gen) => { let t = Typedef { ty: ty.clone(), diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 278ee7951b3d..e263db24fc2c 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1204,8 +1204,8 @@ pub trait Write { pub trait Seek { /// Seek to an offset, in bytes, in a stream. /// - /// A seek beyond the end of a stream is allowed, but implementation - /// defined. + /// A seek beyond the end of a stream is allowed, but behavior is defined + /// by the implementation. /// /// If the seek operation completed successfully, /// this method returns the new position from the start of the stream. diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 6eb2db8e63bf..f79c986cc89e 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -517,6 +517,7 @@ pub fn update_count_then_panic(msg: Box) -> ! { } /// A private no-mangle function on which to slap yer breakpoints. +#[inline(never)] #[no_mangle] #[allow(private_no_mangle_fns)] // yes we get it, but we like breakpoints pub fn rust_panic(mut msg: &mut dyn BoxMeUp) -> ! { diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index cd2efb4c7472..9ed628e2ed33 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1885,6 +1885,8 @@ pub struct Mod { /// to the last token in the external file. pub inner: Span, pub items: Vec>, + /// For `mod foo;` inline is false, for `mod foo { .. }` it is true. + pub inline: bool, } /// Foreign module declaration. diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 3d9f4a92f818..a9ce23655777 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -90,6 +90,7 @@ impl<'a> StripUnconfigured<'a> { parser.expect(&token::Comma)?; let lo = parser.span.lo(); let (path, tokens) = parser.parse_meta_item_unrestricted()?; + parser.eat(&token::Comma); // Optional trailing comma parser.expect(&token::CloseDelim(token::Paren))?; Ok((cfg, path, tokens, parser.prev_span.with_lo(lo))) }) { diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index b1bed9602f36..6210003a40da 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -1101,6 +1101,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { ast::ItemKind::Mod(ast::Mod { inner: inner_span, items, + inline: true }) ) } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 87c53d168754..52322e98d46f 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -303,6 +303,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { krate.module = ast::Mod { inner: orig_mod_span, items: vec![], + inline: true, }; }, _ => unreachable!(), diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 3e422f5af81a..95a2298ca757 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -1044,10 +1044,11 @@ pub fn noop_fold_fn_header(mut header: FnHeader, folder: &mut T) -> F header } -pub fn noop_fold_mod(Mod {inner, items}: Mod, folder: &mut T) -> Mod { +pub fn noop_fold_mod(Mod {inner, items, inline}: Mod, folder: &mut T) -> Mod { Mod { inner: folder.new_span(inner), items: items.move_flat_map(|x| folder.fold_item(x)), + inline: inline, } } @@ -1077,6 +1078,7 @@ pub fn noop_fold_crate(Crate {module, attrs, span}: Crate, None => (ast::Mod { inner: span, items: vec![], + inline: true, }, vec![], span) }; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d6cbe47a66ef..5571a18b5962 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6297,6 +6297,7 @@ impl<'a> Parser<'a> { Ok(ast::Mod { inner: inner_lo.to(hi), items, + inline: true }) } @@ -6334,6 +6335,7 @@ impl<'a> Parser<'a> { self.submod_path(id, &outer_attrs, id_span)?; let (module, mut attrs) = self.eval_src_mod(path, directory_ownership, id.to_string(), id_span)?; + // Record that we fetched the mod from an external file if warn { let attr = Attribute { id: attr::mk_attr_id(), @@ -6346,9 +6348,13 @@ impl<'a> Parser<'a> { attr::mark_known(&attr); attrs.push(attr); } - Ok((id, module, Some(attrs))) + Ok((id, ItemKind::Mod(module), Some(attrs))) } else { - let placeholder = ast::Mod { inner: syntax_pos::DUMMY_SP, items: Vec::new() }; + let placeholder = ast::Mod { + inner: syntax_pos::DUMMY_SP, + items: Vec::new(), + inline: false + }; Ok((id, ItemKind::Mod(placeholder), None)) } } else { @@ -6548,7 +6554,7 @@ impl<'a> Parser<'a> { directory_ownership: DirectoryOwnership, name: String, id_sp: Span) - -> PResult<'a, (ast::ItemKind, Vec )> { + -> PResult<'a, (ast::Mod, Vec )> { let mut included_mod_stack = self.sess.included_mod_stack.borrow_mut(); if let Some(i) = included_mod_stack.iter().position(|p| *p == path) { let mut err = String::from("circular modules: "); @@ -6568,9 +6574,10 @@ impl<'a> Parser<'a> { p0.cfg_mods = self.cfg_mods; let mod_inner_lo = p0.span; let mod_attrs = p0.parse_inner_attributes()?; - let m0 = p0.parse_mod_items(&token::Eof, mod_inner_lo)?; + let mut m0 = p0.parse_mod_items(&token::Eof, mod_inner_lo)?; + m0.inline = false; self.sess.included_mod_stack.borrow_mut().pop(); - Ok((ast::ItemKind::Mod(m0), mod_attrs)) + Ok((m0, mod_attrs)) } /// Parse a function declaration from a foreign module diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 85d29a5be89d..f2acdb3f469d 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -61,6 +61,7 @@ pub struct State<'a> { cur_cmnt: usize, boxes: Vec, ann: &'a (dyn PpAnn+'a), + is_expanded: bool } fn rust_printer<'a>(writer: Box, ann: &'a dyn PpAnn) -> State<'a> { @@ -72,6 +73,7 @@ fn rust_printer<'a>(writer: Box, ann: &'a dyn PpAnn) -> State<'a> cur_cmnt: 0, boxes: Vec::new(), ann, + is_expanded: false } } @@ -133,14 +135,17 @@ impl<'a> State<'a> { // If the code is post expansion, don't use the table of // literals, since it doesn't correspond with the literals // in the AST anymore. - if is_expanded { None } else { Some(lits) }) + if is_expanded { None } else { Some(lits) }, + is_expanded + ) } pub fn new(cm: &'a SourceMap, out: Box, ann: &'a dyn PpAnn, comments: Option>, - literals: Option>) -> State<'a> { + literals: Option>, + is_expanded: bool) -> State<'a> { State { s: pp::mk_printer(out, DEFAULT_COLUMNS), cm: Some(cm), @@ -149,6 +154,7 @@ impl<'a> State<'a> { cur_cmnt: 0, boxes: Vec::new(), ann, + is_expanded: is_expanded } } } @@ -1260,10 +1266,18 @@ impl<'a> State<'a> { ast::ItemKind::Mod(ref _mod) => { self.head(&visibility_qualified(&item.vis, "mod"))?; self.print_ident(item.ident)?; - self.nbsp()?; - self.bopen()?; - self.print_mod(_mod, &item.attrs)?; - self.bclose(item.span)?; + + if _mod.inline || self.is_expanded { + self.nbsp()?; + self.bopen()?; + self.print_mod(_mod, &item.attrs)?; + self.bclose(item.span)?; + } else { + self.s.word(";")?; + self.end()?; // end inner head-block + self.end()?; // end outer head-block + } + } ast::ItemKind::ForeignMod(ref nmod) => { self.head("extern")?; diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 744e2e4a5fdb..9f554a90afbc 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -237,6 +237,7 @@ fn mk_reexport_mod(cx: &mut TestCtxt, })).collect(); let reexport_mod = ast::Mod { + inline: true, inner: DUMMY_SP, items, }; diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index bd70344b0181..67fd847a2ae9 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -87,7 +87,7 @@ scoped_thread_local!(pub static GLOBALS: Globals); #[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, RustcDecodable, RustcEncodable)] pub enum FileName { Real(PathBuf), - /// e.g. "std" macros + /// A macro. This includes the full name of the macro, so that there are no clashes. Macros(String), /// call to `quote!` QuoteExpansion, diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 5c4bb61781ed..06f75d981e3d 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -373,7 +373,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( bool DataSections, bool TrapUnreachable, bool Singlethread, - bool AsmComments) { + bool AsmComments, + bool EmitStackSizeSection) { auto OptLevel = fromRust(RustOptLevel); auto RM = fromRust(RustReloc); @@ -411,6 +412,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( } #if LLVM_VERSION_GE(6, 0) + Options.EmitStackSizeSection = EmitStackSizeSection; + Optional CM; #else CodeModel::Model CM = CodeModel::Model::Default; diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 9b9c908ea527..f1ab1d4ddfa4 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -426,6 +426,11 @@ extern "C" LLVMValueRef LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, HasSideEffects, IsAlignStack, fromRust(Dialect))); } +extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, + char *Constraints) { + return InlineAsm::Verify(unwrap(Ty), Constraints); +} + extern "C" void LLVMRustAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm) { unwrap(M)->appendModuleInlineAsm(StringRef(Asm)); } diff --git a/src/test/codegen/align-struct.rs b/src/test/codegen/align-struct.rs index bf119da2e829..887c43c6761e 100644 --- a/src/test/codegen/align-struct.rs +++ b/src/test/codegen/align-struct.rs @@ -48,6 +48,16 @@ pub fn align64(i : i32) -> Align64 { a64 } +// For issue 54028: make sure that we are specifying the correct alignment for fields of aligned +// structs +// CHECK-LABEL: @align64_load +#[no_mangle] +pub fn align64_load(a: Align64) -> i32 { +// CHECK: [[FIELD:%.*]] = bitcast %Align64* %{{.*}} to i32* +// CHECK: {{%.*}} = load i32, i32* [[FIELD]], align 64 + a.0 +} + // CHECK-LABEL: @nested64 #[no_mangle] pub fn nested64(a: Align64, b: i32, c: i32, d: i8) -> Nested64 { diff --git a/src/test/codegen/issue-32364.rs b/src/test/codegen/issue-32364.rs index 401253a315fb..8feb10b57577 100644 --- a/src/test/codegen/issue-32364.rs +++ b/src/test/codegen/issue-32364.rs @@ -8,8 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-arm -// ignore-aarch64 +// Test that `extern "stdcall"` is properly translated. + +// only-x86 // compile-flags: -C no-prepopulate-passes diff --git a/src/test/debuginfo/nil-enum.rs b/src/test/debuginfo/nil-enum.rs index ab9c7e2dd275..94377421c0b0 100644 --- a/src/test/debuginfo/nil-enum.rs +++ b/src/test/debuginfo/nil-enum.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// NOTE Instantiating an empty enum is UB. This test may break in the future. - // LLDB can't handle zero-sized values // ignore-lldb @@ -27,11 +25,8 @@ #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] -#![feature(maybe_uninit)] #![omit_gdb_pretty_printer_section] -use std::mem::MaybeUninit; - enum ANilEnum {} enum AnotherNilEnum {} @@ -40,8 +35,8 @@ enum AnotherNilEnum {} // The error from gdbr is expected since nil enums are not supposed to exist. fn main() { unsafe { - let first: ANilEnum = MaybeUninit::uninitialized().into_inner(); - let second: AnotherNilEnum = MaybeUninit::uninitialized().into_inner(); + let first: ANilEnum = ::std::mem::zeroed(); + let second: AnotherNilEnum = ::std::mem::zeroed(); zzz(); // #break } diff --git a/src/test/pretty/issue_12590_a.rs b/src/test/pretty/issue_12590_a.rs new file mode 100644 index 000000000000..0087c3c45589 --- /dev/null +++ b/src/test/pretty/issue_12590_a.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// pp-exact + +// The next line should not be expanded + +mod issue_12590_b; + +fn main() { } diff --git a/src/test/pretty/issue_12590_b.rs b/src/test/pretty/issue_12590_b.rs new file mode 100644 index 000000000000..ebb6310b0476 --- /dev/null +++ b/src/test/pretty/issue_12590_b.rs @@ -0,0 +1,14 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Second part of two file test +fn b() { } + +fn main() { } diff --git a/src/test/codegen/box-maybe-uninit.rs b/src/test/pretty/issue_12590_c.pp similarity index 50% rename from src/test/codegen/box-maybe-uninit.rs rename to src/test/pretty/issue_12590_c.pp index 168e1a3eba0c..7e057406d830 100644 --- a/src/test/codegen/box-maybe-uninit.rs +++ b/src/test/pretty/issue_12590_c.pp @@ -1,4 +1,10 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +#![feature(prelude_import)] +#![no_std] +#[prelude_import] +use ::std::prelude::v1::*; +#[macro_use] +extern crate std; +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,16 +14,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -O -#![crate_type="lib"] -#![feature(maybe_uninit)] +// pretty-compare-only +// pretty-mode:expanded +// pp-exact:issue_12590_c.pp -use std::mem::MaybeUninit; +// The next line should be expanded -// Boxing a `MaybeUninit` value should not copy junk from the stack -#[no_mangle] -pub fn box_uninitialized() -> Box> { - // CHECK-LABEL: @box_uninitialized - // CHECK-NOT: store - Box::new(MaybeUninit::uninitialized()) +mod issue_12590_b { + + fn b() { } + fn main() { } } +fn main() { } diff --git a/src/test/pretty/issue_12590_c.rs b/src/test/pretty/issue_12590_c.rs new file mode 100644 index 000000000000..e3db870ae4f4 --- /dev/null +++ b/src/test/pretty/issue_12590_c.rs @@ -0,0 +1,19 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// pretty-compare-only +// pretty-mode:expanded +// pp-exact:issue_12590_c.pp + +// The next line should be expanded + +mod issue_12590_b; + +fn main() { } diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile new file mode 100644 index 000000000000..c2f643ce24c4 --- /dev/null +++ b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile @@ -0,0 +1,31 @@ +-include ../tools.mk + +# 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 diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs b/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs new file mode 100644 index 000000000000..6c81b63963a1 --- /dev/null +++ b/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs @@ -0,0 +1,13 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +pub fn foo() {} diff --git a/src/test/ui/run-pass/allocator/auxiliary/custom-as-global.rs b/src/test/run-pass/allocator/auxiliary/custom-as-global.rs similarity index 100% rename from src/test/ui/run-pass/allocator/auxiliary/custom-as-global.rs rename to src/test/run-pass/allocator/auxiliary/custom-as-global.rs diff --git a/src/test/ui/run-pass/allocator/auxiliary/custom.rs b/src/test/run-pass/allocator/auxiliary/custom.rs similarity index 100% rename from src/test/ui/run-pass/allocator/auxiliary/custom.rs rename to src/test/run-pass/allocator/auxiliary/custom.rs diff --git a/src/test/ui/run-pass/allocator/auxiliary/helper.rs b/src/test/run-pass/allocator/auxiliary/helper.rs similarity index 100% rename from src/test/ui/run-pass/allocator/auxiliary/helper.rs rename to src/test/run-pass/allocator/auxiliary/helper.rs diff --git a/src/test/ui/run-pass/allocator/custom.rs b/src/test/run-pass/allocator/custom.rs similarity index 100% rename from src/test/ui/run-pass/allocator/custom.rs rename to src/test/run-pass/allocator/custom.rs diff --git a/src/test/ui/run-pass/allocator/xcrate-use.rs b/src/test/run-pass/allocator/xcrate-use.rs similarity index 100% rename from src/test/ui/run-pass/allocator/xcrate-use.rs rename to src/test/run-pass/allocator/xcrate-use.rs diff --git a/src/test/ui/run-pass/allocator/xcrate-use2.rs b/src/test/run-pass/allocator/xcrate-use2.rs similarity index 100% rename from src/test/ui/run-pass/allocator/xcrate-use2.rs rename to src/test/run-pass/allocator/xcrate-use2.rs diff --git a/src/test/ui/run-pass/array-slice-vec/arr_cycle.rs b/src/test/run-pass/array-slice-vec/arr_cycle.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/arr_cycle.rs rename to src/test/run-pass/array-slice-vec/arr_cycle.rs diff --git a/src/test/ui/run-pass/array-slice-vec/array_const_index-1.rs b/src/test/run-pass/array-slice-vec/array_const_index-1.rs similarity index 97% rename from src/test/ui/run-pass/array-slice-vec/array_const_index-1.rs rename to src/test/run-pass/array-slice-vec/array_const_index-1.rs index c026a47c4f9e..2bc8bf9796e8 100644 --- a/src/test/ui/run-pass/array-slice-vec/array_const_index-1.rs +++ b/src/test/run-pass/array-slice-vec/array_const_index-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(stable_features)] #![feature(const_indexing)] diff --git a/src/test/ui/run-pass/array-slice-vec/box-of-array-of-drop-1.rs b/src/test/run-pass/array-slice-vec/box-of-array-of-drop-1.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/box-of-array-of-drop-1.rs rename to src/test/run-pass/array-slice-vec/box-of-array-of-drop-1.rs diff --git a/src/test/ui/run-pass/array-slice-vec/box-of-array-of-drop-2.rs b/src/test/run-pass/array-slice-vec/box-of-array-of-drop-2.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/box-of-array-of-drop-2.rs rename to src/test/run-pass/array-slice-vec/box-of-array-of-drop-2.rs diff --git a/src/test/ui/run-pass/array-slice-vec/cast-in-array-size.rs b/src/test/run-pass/array-slice-vec/cast-in-array-size.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/cast-in-array-size.rs rename to src/test/run-pass/array-slice-vec/cast-in-array-size.rs diff --git a/src/test/ui/run-pass/array-slice-vec/check-static-mut-slices.rs b/src/test/run-pass/array-slice-vec/check-static-mut-slices.rs similarity index 97% rename from src/test/ui/run-pass/array-slice-vec/check-static-mut-slices.rs rename to src/test/run-pass/array-slice-vec/check-static-mut-slices.rs index 3d2fc8195eb2..998a1d9ee278 100644 --- a/src/test/ui/run-pass/array-slice-vec/check-static-mut-slices.rs +++ b/src/test/run-pass/array-slice-vec/check-static-mut-slices.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Checks that mutable static items can have mutable slices diff --git a/src/test/ui/run-pass/array-slice-vec/check-static-slice.rs b/src/test/run-pass/array-slice-vec/check-static-slice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/check-static-slice.rs rename to src/test/run-pass/array-slice-vec/check-static-slice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/copy-out-of-array-1.rs b/src/test/run-pass/array-slice-vec/copy-out-of-array-1.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/copy-out-of-array-1.rs rename to src/test/run-pass/array-slice-vec/copy-out-of-array-1.rs diff --git a/src/test/ui/run-pass/array-slice-vec/destructure-array-1.rs b/src/test/run-pass/array-slice-vec/destructure-array-1.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/destructure-array-1.rs rename to src/test/run-pass/array-slice-vec/destructure-array-1.rs diff --git a/src/test/ui/run-pass/array-slice-vec/empty-mutable-vec.rs b/src/test/run-pass/array-slice-vec/empty-mutable-vec.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/empty-mutable-vec.rs rename to src/test/run-pass/array-slice-vec/empty-mutable-vec.rs diff --git a/src/test/ui/run-pass/array-slice-vec/estr-slice.rs b/src/test/run-pass/array-slice-vec/estr-slice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/estr-slice.rs rename to src/test/run-pass/array-slice-vec/estr-slice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/evec-slice.rs b/src/test/run-pass/array-slice-vec/evec-slice.rs similarity index 97% rename from src/test/ui/run-pass/array-slice-vec/evec-slice.rs rename to src/test/run-pass/array-slice-vec/evec-slice.rs index 7f54801910b7..b1a55a04a249 100644 --- a/src/test/ui/run-pass/array-slice-vec/evec-slice.rs +++ b/src/test/run-pass/array-slice-vec/evec-slice.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] pub fn main() { let x : &[isize] = &[1,2,3,4,5]; diff --git a/src/test/ui/run-pass/array-slice-vec/fixed_length_copy.rs b/src/test/run-pass/array-slice-vec/fixed_length_copy.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/fixed_length_copy.rs rename to src/test/run-pass/array-slice-vec/fixed_length_copy.rs diff --git a/src/test/ui/run-pass/array-slice-vec/huge-largest-array.rs b/src/test/run-pass/array-slice-vec/huge-largest-array.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/huge-largest-array.rs rename to src/test/run-pass/array-slice-vec/huge-largest-array.rs diff --git a/src/test/ui/run-pass/array-slice-vec/ivec-pass-by-value.rs b/src/test/run-pass/array-slice-vec/ivec-pass-by-value.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/ivec-pass-by-value.rs rename to src/test/run-pass/array-slice-vec/ivec-pass-by-value.rs diff --git a/src/test/ui/run-pass/array-slice-vec/mutability-inherits-through-fixed-length-vec.rs b/src/test/run-pass/array-slice-vec/mutability-inherits-through-fixed-length-vec.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/mutability-inherits-through-fixed-length-vec.rs rename to src/test/run-pass/array-slice-vec/mutability-inherits-through-fixed-length-vec.rs diff --git a/src/test/ui/run-pass/array-slice-vec/mutable-alias-vec.rs b/src/test/run-pass/array-slice-vec/mutable-alias-vec.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/mutable-alias-vec.rs rename to src/test/run-pass/array-slice-vec/mutable-alias-vec.rs diff --git a/src/test/ui/run-pass/array-slice-vec/nested-vec-1.rs b/src/test/run-pass/array-slice-vec/nested-vec-1.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/nested-vec-1.rs rename to src/test/run-pass/array-slice-vec/nested-vec-1.rs diff --git a/src/test/ui/run-pass/array-slice-vec/nested-vec-2.rs b/src/test/run-pass/array-slice-vec/nested-vec-2.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/nested-vec-2.rs rename to src/test/run-pass/array-slice-vec/nested-vec-2.rs diff --git a/src/test/ui/run-pass/array-slice-vec/nested-vec-3.rs b/src/test/run-pass/array-slice-vec/nested-vec-3.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/nested-vec-3.rs rename to src/test/run-pass/array-slice-vec/nested-vec-3.rs diff --git a/src/test/ui/run-pass/array-slice-vec/new-style-fixed-length-vec.rs b/src/test/run-pass/array-slice-vec/new-style-fixed-length-vec.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/new-style-fixed-length-vec.rs rename to src/test/run-pass/array-slice-vec/new-style-fixed-length-vec.rs diff --git a/src/test/ui/run-pass/array-slice-vec/rcvr-borrowed-to-slice.rs b/src/test/run-pass/array-slice-vec/rcvr-borrowed-to-slice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/rcvr-borrowed-to-slice.rs rename to src/test/run-pass/array-slice-vec/rcvr-borrowed-to-slice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/repeated-vector-syntax.rs b/src/test/run-pass/array-slice-vec/repeated-vector-syntax.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/repeated-vector-syntax.rs rename to src/test/run-pass/array-slice-vec/repeated-vector-syntax.rs diff --git a/src/test/ui/run-pass/array-slice-vec/show-boxed-slice.rs b/src/test/run-pass/array-slice-vec/show-boxed-slice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/show-boxed-slice.rs rename to src/test/run-pass/array-slice-vec/show-boxed-slice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/slice-2.rs b/src/test/run-pass/array-slice-vec/slice-2.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/slice-2.rs rename to src/test/run-pass/array-slice-vec/slice-2.rs diff --git a/src/test/ui/run-pass/array-slice-vec/slice-of-zero-size-elements.rs b/src/test/run-pass/array-slice-vec/slice-of-zero-size-elements.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/slice-of-zero-size-elements.rs rename to src/test/run-pass/array-slice-vec/slice-of-zero-size-elements.rs diff --git a/src/test/ui/run-pass/array-slice-vec/slice-panic-1.rs b/src/test/run-pass/array-slice-vec/slice-panic-1.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/slice-panic-1.rs rename to src/test/run-pass/array-slice-vec/slice-panic-1.rs diff --git a/src/test/ui/run-pass/array-slice-vec/slice-panic-2.rs b/src/test/run-pass/array-slice-vec/slice-panic-2.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/slice-panic-2.rs rename to src/test/run-pass/array-slice-vec/slice-panic-2.rs diff --git a/src/test/ui/run-pass/array-slice-vec/slice.rs b/src/test/run-pass/array-slice-vec/slice.rs similarity index 98% rename from src/test/ui/run-pass/array-slice-vec/slice.rs rename to src/test/run-pass/array-slice-vec/slice.rs index 6c43d8832302..b85cb97b6baf 100644 --- a/src/test/ui/run-pass/array-slice-vec/slice.rs +++ b/src/test/run-pass/array-slice-vec/slice.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test slicing sugar. diff --git a/src/test/ui/run-pass/array-slice-vec/slice_binary_search.rs b/src/test/run-pass/array-slice-vec/slice_binary_search.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/slice_binary_search.rs rename to src/test/run-pass/array-slice-vec/slice_binary_search.rs diff --git a/src/test/ui/run-pass/array-slice-vec/variance-vec-covariant.rs b/src/test/run-pass/array-slice-vec/variance-vec-covariant.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/variance-vec-covariant.rs rename to src/test/run-pass/array-slice-vec/variance-vec-covariant.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-concat.rs b/src/test/run-pass/array-slice-vec/vec-concat.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-concat.rs rename to src/test/run-pass/array-slice-vec/vec-concat.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-dst.rs b/src/test/run-pass/array-slice-vec/vec-dst.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-dst.rs rename to src/test/run-pass/array-slice-vec/vec-dst.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-fixed-length.rs b/src/test/run-pass/array-slice-vec/vec-fixed-length.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-fixed-length.rs rename to src/test/run-pass/array-slice-vec/vec-fixed-length.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-growth.rs b/src/test/run-pass/array-slice-vec/vec-growth.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-growth.rs rename to src/test/run-pass/array-slice-vec/vec-growth.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-late-init.rs b/src/test/run-pass/array-slice-vec/vec-late-init.rs similarity index 96% rename from src/test/ui/run-pass/array-slice-vec/vec-late-init.rs rename to src/test/run-pass/array-slice-vec/vec-late-init.rs index dc7241a0e05c..234d63672d94 100644 --- a/src/test/ui/run-pass/array-slice-vec/vec-late-init.rs +++ b/src/test/run-pass/array-slice-vec/vec-late-init.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] pub fn main() { diff --git a/src/test/ui/run-pass/array-slice-vec/vec-macro-no-std.rs b/src/test/run-pass/array-slice-vec/vec-macro-no-std.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-macro-no-std.rs rename to src/test/run-pass/array-slice-vec/vec-macro-no-std.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-macro-repeat.rs b/src/test/run-pass/array-slice-vec/vec-macro-repeat.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-macro-repeat.rs rename to src/test/run-pass/array-slice-vec/vec-macro-repeat.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-macro-rvalue-scope.rs b/src/test/run-pass/array-slice-vec/vec-macro-rvalue-scope.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-macro-rvalue-scope.rs rename to src/test/run-pass/array-slice-vec/vec-macro-rvalue-scope.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-macro-with-brackets.rs b/src/test/run-pass/array-slice-vec/vec-macro-with-brackets.rs similarity index 96% rename from src/test/ui/run-pass/array-slice-vec/vec-macro-with-brackets.rs rename to src/test/run-pass/array-slice-vec/vec-macro-with-brackets.rs index b5d1459300ae..aa7d96a5e5a2 100644 --- a/src/test/ui/run-pass/array-slice-vec/vec-macro-with-brackets.rs +++ b/src/test/run-pass/array-slice-vec/vec-macro-with-brackets.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/array-slice-vec/vec-macro-with-trailing-comma.rs b/src/test/run-pass/array-slice-vec/vec-macro-with-trailing-comma.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-macro-with-trailing-comma.rs rename to src/test/run-pass/array-slice-vec/vec-macro-with-trailing-comma.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-matching-autoslice.rs b/src/test/run-pass/array-slice-vec/vec-matching-autoslice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-matching-autoslice.rs rename to src/test/run-pass/array-slice-vec/vec-matching-autoslice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-matching-fixed.rs b/src/test/run-pass/array-slice-vec/vec-matching-fixed.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-matching-fixed.rs rename to src/test/run-pass/array-slice-vec/vec-matching-fixed.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-matching-fold.rs b/src/test/run-pass/array-slice-vec/vec-matching-fold.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-matching-fold.rs rename to src/test/run-pass/array-slice-vec/vec-matching-fold.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs b/src/test/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs similarity index 96% rename from src/test/ui/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs rename to src/test/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs index e727e56c0f8e..3d4a84aa5c3c 100644 --- a/src/test/ui/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/run-pass/array-slice-vec/vec-matching-legal-tail-element-borrow.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![feature(slice_patterns)] diff --git a/src/test/ui/run-pass/array-slice-vec/vec-matching.rs b/src/test/run-pass/array-slice-vec/vec-matching.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-matching.rs rename to src/test/run-pass/array-slice-vec/vec-matching.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-push.rs b/src/test/run-pass/array-slice-vec/vec-push.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-push.rs rename to src/test/run-pass/array-slice-vec/vec-push.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-repeat-with-cast.rs b/src/test/run-pass/array-slice-vec/vec-repeat-with-cast.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-repeat-with-cast.rs rename to src/test/run-pass/array-slice-vec/vec-repeat-with-cast.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-slice-drop.rs b/src/test/run-pass/array-slice-vec/vec-slice-drop.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-slice-drop.rs rename to src/test/run-pass/array-slice-vec/vec-slice-drop.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-slice.rs b/src/test/run-pass/array-slice-vec/vec-slice.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-slice.rs rename to src/test/run-pass/array-slice-vec/vec-slice.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-tail-matching.rs b/src/test/run-pass/array-slice-vec/vec-tail-matching.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-tail-matching.rs rename to src/test/run-pass/array-slice-vec/vec-tail-matching.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec-to_str.rs b/src/test/run-pass/array-slice-vec/vec-to_str.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec-to_str.rs rename to src/test/run-pass/array-slice-vec/vec-to_str.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec.rs b/src/test/run-pass/array-slice-vec/vec.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec.rs rename to src/test/run-pass/array-slice-vec/vec.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec_cycle.rs b/src/test/run-pass/array-slice-vec/vec_cycle.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec_cycle.rs rename to src/test/run-pass/array-slice-vec/vec_cycle.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vec_cycle_wrapped.rs b/src/test/run-pass/array-slice-vec/vec_cycle_wrapped.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vec_cycle_wrapped.rs rename to src/test/run-pass/array-slice-vec/vec_cycle_wrapped.rs diff --git a/src/test/ui/run-pass/array-slice-vec/vector-no-ann-2.rs b/src/test/run-pass/array-slice-vec/vector-no-ann-2.rs similarity index 100% rename from src/test/ui/run-pass/array-slice-vec/vector-no-ann-2.rs rename to src/test/run-pass/array-slice-vec/vector-no-ann-2.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-const-eval.rs b/src/test/run-pass/associated-consts/associated-const-const-eval.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-const-eval.rs rename to src/test/run-pass/associated-consts/associated-const-const-eval.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-cross-crate-const-eval.rs b/src/test/run-pass/associated-consts/associated-const-cross-crate-const-eval.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-cross-crate-const-eval.rs rename to src/test/run-pass/associated-consts/associated-const-cross-crate-const-eval.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-cross-crate-defaults.rs b/src/test/run-pass/associated-consts/associated-const-cross-crate-defaults.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-cross-crate-defaults.rs rename to src/test/run-pass/associated-consts/associated-const-cross-crate-defaults.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-cross-crate.rs b/src/test/run-pass/associated-consts/associated-const-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-cross-crate.rs rename to src/test/run-pass/associated-consts/associated-const-cross-crate.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-in-global-const.rs b/src/test/run-pass/associated-consts/associated-const-in-global-const.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-in-global-const.rs rename to src/test/run-pass/associated-consts/associated-const-in-global-const.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-inherent-impl.rs b/src/test/run-pass/associated-consts/associated-const-inherent-impl.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-inherent-impl.rs rename to src/test/run-pass/associated-consts/associated-const-inherent-impl.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-marks-live-code.rs b/src/test/run-pass/associated-consts/associated-const-marks-live-code.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-marks-live-code.rs rename to src/test/run-pass/associated-consts/associated-const-marks-live-code.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-match-patterns.rs b/src/test/run-pass/associated-consts/associated-const-match-patterns.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-match-patterns.rs rename to src/test/run-pass/associated-consts/associated-const-match-patterns.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-outer-ty-refs.rs b/src/test/run-pass/associated-consts/associated-const-outer-ty-refs.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-outer-ty-refs.rs rename to src/test/run-pass/associated-consts/associated-const-outer-ty-refs.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-overwrite-default.rs b/src/test/run-pass/associated-consts/associated-const-overwrite-default.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-overwrite-default.rs rename to src/test/run-pass/associated-consts/associated-const-overwrite-default.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-public-impl.rs b/src/test/run-pass/associated-consts/associated-const-public-impl.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-public-impl.rs rename to src/test/run-pass/associated-consts/associated-const-public-impl.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-range-match-patterns.rs b/src/test/run-pass/associated-consts/associated-const-range-match-patterns.rs similarity index 97% rename from src/test/ui/run-pass/associated-consts/associated-const-range-match-patterns.rs rename to src/test/run-pass/associated-consts/associated-const-range-match-patterns.rs index eeff27753235..b425d759b03f 100644 --- a/src/test/ui/run-pass/associated-consts/associated-const-range-match-patterns.rs +++ b/src/test/run-pass/associated-consts/associated-const-range-match-patterns.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Foo; diff --git a/src/test/ui/run-pass/associated-consts/associated-const-resolution-order.rs b/src/test/run-pass/associated-consts/associated-const-resolution-order.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-resolution-order.rs rename to src/test/run-pass/associated-consts/associated-const-resolution-order.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-self-type.rs b/src/test/run-pass/associated-consts/associated-const-self-type.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-self-type.rs rename to src/test/run-pass/associated-consts/associated-const-self-type.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-type-parameters.rs b/src/test/run-pass/associated-consts/associated-const-type-parameters.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-type-parameters.rs rename to src/test/run-pass/associated-consts/associated-const-type-parameters.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-ufcs-infer-trait.rs b/src/test/run-pass/associated-consts/associated-const-ufcs-infer-trait.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-ufcs-infer-trait.rs rename to src/test/run-pass/associated-consts/associated-const-ufcs-infer-trait.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-use-default.rs b/src/test/run-pass/associated-consts/associated-const-use-default.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-use-default.rs rename to src/test/run-pass/associated-consts/associated-const-use-default.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const-use-impl-of-same-trait.rs b/src/test/run-pass/associated-consts/associated-const-use-impl-of-same-trait.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const-use-impl-of-same-trait.rs rename to src/test/run-pass/associated-consts/associated-const-use-impl-of-same-trait.rs diff --git a/src/test/ui/run-pass/associated-consts/associated-const.rs b/src/test/run-pass/associated-consts/associated-const.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/associated-const.rs rename to src/test/run-pass/associated-consts/associated-const.rs diff --git a/src/test/ui/run-pass/associated-consts/auxiliary/associated-const-cc-lib.rs b/src/test/run-pass/associated-consts/auxiliary/associated-const-cc-lib.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/auxiliary/associated-const-cc-lib.rs rename to src/test/run-pass/associated-consts/auxiliary/associated-const-cc-lib.rs diff --git a/src/test/ui/run-pass/associated-consts/auxiliary/empty-struct.rs b/src/test/run-pass/associated-consts/auxiliary/empty-struct.rs similarity index 100% rename from src/test/ui/run-pass/associated-consts/auxiliary/empty-struct.rs rename to src/test/run-pass/associated-consts/auxiliary/empty-struct.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-basic.rs b/src/test/run-pass/associated-types/associated-types-basic.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-basic.rs rename to src/test/run-pass/associated-types/associated-types-basic.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-binding-in-trait.rs b/src/test/run-pass/associated-types/associated-types-binding-in-trait.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-binding-in-trait.rs rename to src/test/run-pass/associated-types/associated-types-binding-in-trait.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-binding-in-where-clause.rs b/src/test/run-pass/associated-types/associated-types-binding-in-where-clause.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-binding-in-where-clause.rs rename to src/test/run-pass/associated-types/associated-types-binding-in-where-clause.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-bound.rs b/src/test/run-pass/associated-types/associated-types-bound.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-bound.rs rename to src/test/run-pass/associated-types/associated-types-bound.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-cc.rs b/src/test/run-pass/associated-types/associated-types-cc.rs similarity index 96% rename from src/test/ui/run-pass/associated-types/associated-types-cc.rs rename to src/test/run-pass/associated-types/associated-types-cc.rs index a8c7caa9361b..282e44ed42b6 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-cc.rs +++ b/src/test/run-pass/associated-types/associated-types-cc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // aux-build:associated-types-cc-lib.rs // Test that we are able to reference cross-crate traits that employ diff --git a/src/test/ui/run-pass/associated-types/associated-types-conditional-dispatch.rs b/src/test/run-pass/associated-types/associated-types-conditional-dispatch.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-conditional-dispatch.rs rename to src/test/run-pass/associated-types/associated-types-conditional-dispatch.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-constant-type.rs b/src/test/run-pass/associated-types/associated-types-constant-type.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-constant-type.rs rename to src/test/run-pass/associated-types/associated-types-constant-type.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-doubleendediterator-object.rs b/src/test/run-pass/associated-types/associated-types-doubleendediterator-object.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-doubleendediterator-object.rs rename to src/test/run-pass/associated-types/associated-types-doubleendediterator-object.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs b/src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs rename to src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs index e6175dc34ecc..53d25b23b480 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs +++ b/src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Check that we do not report ambiguities when equivalent predicates // (modulo bound lifetime names) appears in the environment // twice. Issue #21965. diff --git a/src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs b/src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs rename to src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs index 6836d2860b51..b04da14795fc 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs +++ b/src/test/run-pass/associated-types/associated-types-duplicate-binding-in-env.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Check that we do not report ambiguities when the same predicate // appears in the environment twice. Issue #21965. diff --git a/src/test/ui/run-pass/associated-types/associated-types-enum-field-named.rs b/src/test/run-pass/associated-types/associated-types-enum-field-named.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-enum-field-named.rs rename to src/test/run-pass/associated-types/associated-types-enum-field-named.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-enum-field-numbered.rs b/src/test/run-pass/associated-types/associated-types-enum-field-numbered.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-enum-field-numbered.rs rename to src/test/run-pass/associated-types/associated-types-enum-field-numbered.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-eq-obj.rs b/src/test/run-pass/associated-types/associated-types-eq-obj.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-eq-obj.rs rename to src/test/run-pass/associated-types/associated-types-eq-obj.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-impl-redirect.rs b/src/test/run-pass/associated-types/associated-types-impl-redirect.rs similarity index 95% rename from src/test/ui/run-pass/associated-types/associated-types-impl-redirect.rs rename to src/test/run-pass/associated-types/associated-types-impl-redirect.rs index aca767489258..fd2fade2f887 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types/associated-types-impl-redirect.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_imports)] // Test how resolving a projection interacts with inference. In this // case, we were eagerly unifying the type variable for the iterator // type with `I` from the where clause, ignoring the in-scope `impl` diff --git a/src/test/ui/run-pass/associated-types/associated-types-in-bound-type-arg.rs b/src/test/run-pass/associated-types/associated-types-in-bound-type-arg.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-in-bound-type-arg.rs rename to src/test/run-pass/associated-types/associated-types-in-bound-type-arg.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-in-default-method.rs b/src/test/run-pass/associated-types/associated-types-in-default-method.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-in-default-method.rs rename to src/test/run-pass/associated-types/associated-types-in-default-method.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-in-fn.rs b/src/test/run-pass/associated-types/associated-types-in-fn.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-in-fn.rs rename to src/test/run-pass/associated-types/associated-types-in-fn.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-in-impl-generics.rs b/src/test/run-pass/associated-types/associated-types-in-impl-generics.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-in-impl-generics.rs rename to src/test/run-pass/associated-types/associated-types-in-impl-generics.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-in-inherent-method.rs b/src/test/run-pass/associated-types/associated-types-in-inherent-method.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-in-inherent-method.rs rename to src/test/run-pass/associated-types/associated-types-in-inherent-method.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-issue-20220.rs b/src/test/run-pass/associated-types/associated-types-issue-20220.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-issue-20220.rs rename to src/test/run-pass/associated-types/associated-types-issue-20220.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-issue-20371.rs b/src/test/run-pass/associated-types/associated-types-issue-20371.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-issue-20371.rs rename to src/test/run-pass/associated-types/associated-types-issue-20371.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-issue-21212.rs b/src/test/run-pass/associated-types/associated-types-issue-21212.rs similarity index 96% rename from src/test/ui/run-pass/associated-types/associated-types-issue-21212.rs rename to src/test/run-pass/associated-types/associated-types-issue-21212.rs index 259661dc058c..c5baec7be00d 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-issue-21212.rs +++ b/src/test/run-pass/associated-types/associated-types-issue-21212.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Regression test for #21212: an overflow occurred during trait // checking where normalizing `Self::Input` led to normalizing the // where clauses in the environment which in turn required normalizing diff --git a/src/test/ui/run-pass/associated-types/associated-types-iterator-binding.rs b/src/test/run-pass/associated-types/associated-types-iterator-binding.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-iterator-binding.rs rename to src/test/run-pass/associated-types/associated-types-iterator-binding.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-method.rs b/src/test/run-pass/associated-types/associated-types-method.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-method.rs rename to src/test/run-pass/associated-types/associated-types-method.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-nested-projections.rs b/src/test/run-pass/associated-types/associated-types-nested-projections.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-nested-projections.rs rename to src/test/run-pass/associated-types/associated-types-nested-projections.rs index a877a3cfa9dd..af6f3da195e8 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-nested-projections.rs +++ b/src/test/run-pass/associated-types/associated-types-nested-projections.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we can resolve nested projection types. Issue #20666. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs rename to src/test/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs index d989e08e8083..4dd810d10565 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs +++ b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds-binding.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we normalize associated types that appear in a bound that // contains a binding. Issue #21664. diff --git a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs rename to src/test/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs index 3d3540bbf72b..d534051267d9 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs +++ b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds-ufcs.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we normalize associated types that appear in bounds; if // we didn't, the call to `self.split2()` fails to type check. diff --git a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds.rs b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds.rs rename to src/test/run-pass/associated-types/associated-types-normalize-in-bounds.rs index 79d23c3999e6..6651a0b53ac3 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-normalize-in-bounds.rs +++ b/src/test/run-pass/associated-types/associated-types-normalize-in-bounds.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we normalize associated types that appear in bounds; if // we didn't, the call to `self.split2()` fails to type check. diff --git a/src/test/ui/run-pass/associated-types/associated-types-normalize-unifield-struct.rs b/src/test/run-pass/associated-types/associated-types-normalize-unifield-struct.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-normalize-unifield-struct.rs rename to src/test/run-pass/associated-types/associated-types-normalize-unifield-struct.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-project-from-type-param-via-bound-in-where.rs b/src/test/run-pass/associated-types/associated-types-project-from-type-param-via-bound-in-where.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-project-from-type-param-via-bound-in-where.rs rename to src/test/run-pass/associated-types/associated-types-project-from-type-param-via-bound-in-where.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs b/src/test/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs rename to src/test/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs index 57c7f557ffaf..2f27cb1cd9ee 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs +++ b/src/test/run-pass/associated-types/associated-types-projection-bound-in-supertraits.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we correctly handle projection bounds appearing in the // supertrait list (and in conjunction with overloaded operators). In // this case, the `Result=Self` binding in the supertrait listing of diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-from-known-type-in-impl.rs b/src/test/run-pass/associated-types/associated-types-projection-from-known-type-in-impl.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-projection-from-known-type-in-impl.rs rename to src/test/run-pass/associated-types/associated-types-projection-from-known-type-in-impl.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-in-object-type.rs b/src/test/run-pass/associated-types/associated-types-projection-in-object-type.rs similarity index 96% rename from src/test/ui/run-pass/associated-types/associated-types-projection-in-object-type.rs rename to src/test/run-pass/associated-types/associated-types-projection-in-object-type.rs index 8b98325598c8..c0844e9076e3 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-projection-in-object-type.rs +++ b/src/test/run-pass/associated-types/associated-types-projection-in-object-type.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] // Corrected regression test for #20831. The original did not compile. // When fixed, it revealed another problem concerning projections that // appear in associated type bindings in object types, which were not diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-in-supertrait.rs b/src/test/run-pass/associated-types/associated-types-projection-in-supertrait.rs similarity index 98% rename from src/test/ui/run-pass/associated-types/associated-types-projection-in-supertrait.rs rename to src/test/run-pass/associated-types/associated-types-projection-in-supertrait.rs index 001faef7f481..23c9fb89f393 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-projection-in-supertrait.rs +++ b/src/test/run-pass/associated-types/associated-types-projection-in-supertrait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that we are handle to correctly handle a projection type // that appears in a supertrait bound. Issue #20559. diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-in-where-clause.rs b/src/test/run-pass/associated-types/associated-types-projection-in-where-clause.rs similarity index 94% rename from src/test/ui/run-pass/associated-types/associated-types-projection-in-where-clause.rs rename to src/test/run-pass/associated-types/associated-types-projection-in-where-clause.rs index c2379e0f0782..238f98086ceb 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-projection-in-where-clause.rs +++ b/src/test/run-pass/associated-types/associated-types-projection-in-where-clause.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test a where clause that uses a non-normalized projection type. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/associated-types/associated-types-projection-to-unrelated-trait.rs b/src/test/run-pass/associated-types/associated-types-projection-to-unrelated-trait.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-projection-to-unrelated-trait.rs rename to src/test/run-pass/associated-types/associated-types-projection-to-unrelated-trait.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs b/src/test/run-pass/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs rename to src/test/run-pass/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-ref-from-struct.rs b/src/test/run-pass/associated-types/associated-types-ref-from-struct.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-ref-from-struct.rs rename to src/test/run-pass/associated-types/associated-types-ref-from-struct.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-ref-in-struct-literal.rs b/src/test/run-pass/associated-types/associated-types-ref-in-struct-literal.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-ref-in-struct-literal.rs rename to src/test/run-pass/associated-types/associated-types-ref-in-struct-literal.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs b/src/test/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs rename to src/test/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs index b4038a21828c..40864835d2e4 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs +++ b/src/test/run-pass/associated-types/associated-types-region-erasure-issue-20582.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #20582. This test caused an ICE related to // inconsistent region erasure in codegen. diff --git a/src/test/ui/run-pass/associated-types/associated-types-resolve-lifetime.rs b/src/test/run-pass/associated-types/associated-types-resolve-lifetime.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-resolve-lifetime.rs rename to src/test/run-pass/associated-types/associated-types-resolve-lifetime.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-return.rs b/src/test/run-pass/associated-types/associated-types-return.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-return.rs rename to src/test/run-pass/associated-types/associated-types-return.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-simple.rs b/src/test/run-pass/associated-types/associated-types-simple.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-simple.rs rename to src/test/run-pass/associated-types/associated-types-simple.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-stream.rs b/src/test/run-pass/associated-types/associated-types-stream.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-stream.rs rename to src/test/run-pass/associated-types/associated-types-stream.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-struct-field-named.rs b/src/test/run-pass/associated-types/associated-types-struct-field-named.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-struct-field-named.rs rename to src/test/run-pass/associated-types/associated-types-struct-field-named.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-struct-field-numbered.rs b/src/test/run-pass/associated-types/associated-types-struct-field-numbered.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/associated-types-struct-field-numbered.rs rename to src/test/run-pass/associated-types/associated-types-struct-field-numbered.rs diff --git a/src/test/ui/run-pass/associated-types/associated-types-sugar-path.rs b/src/test/run-pass/associated-types/associated-types-sugar-path.rs similarity index 93% rename from src/test/ui/run-pass/associated-types/associated-types-sugar-path.rs rename to src/test/run-pass/associated-types/associated-types-sugar-path.rs index 3b148c5e1065..c3c76eb1313a 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-sugar-path.rs +++ b/src/test/run-pass/associated-types/associated-types-sugar-path.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +#![allow(unused_imports)] // Test paths to associated types using the type-parameter-only sugar. use std::ops::Deref; diff --git a/src/test/ui/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs similarity index 97% rename from src/test/ui/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs rename to src/test/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs index 5f24a44c14b5..5c03a6bbc027 100644 --- a/src/test/ui/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types/associated-types-where-clause-impl-ambiguity.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] // Test how resolving a projection interacts with inference. In this // case, we were eagerly unifying the type variable for the iterator // type with `I` from the where clause, ignoring the in-scope `impl` diff --git a/src/test/ui/run-pass/associated-types/auxiliary/associated-types-cc-lib.rs b/src/test/run-pass/associated-types/auxiliary/associated-types-cc-lib.rs similarity index 100% rename from src/test/ui/run-pass/associated-types/auxiliary/associated-types-cc-lib.rs rename to src/test/run-pass/associated-types/auxiliary/associated-types-cc-lib.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/auto-ref-bounded-ty-param.rs b/src/test/run-pass/autoref-autoderef/auto-ref-bounded-ty-param.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/auto-ref-bounded-ty-param.rs rename to src/test/run-pass/autoref-autoderef/auto-ref-bounded-ty-param.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/auto-ref-sliceable.rs b/src/test/run-pass/autoref-autoderef/auto-ref-sliceable.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/auto-ref-sliceable.rs rename to src/test/run-pass/autoref-autoderef/auto-ref-sliceable.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/auto-ref.rs b/src/test/run-pass/autoref-autoderef/auto-ref.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/auto-ref.rs rename to src/test/run-pass/autoref-autoderef/auto-ref.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs b/src/test/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs similarity index 96% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs rename to src/test/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs index 0ce3ef7fd7b3..8ab2bf2f9b89 100644 --- a/src/test/ui/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs +++ b/src/test/run-pass/autoref-autoderef/autoderef-and-borrow-method-receiver.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Foo { diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-method-on-trait.rs b/src/test/run-pass/autoref-autoderef/autoderef-method-on-trait.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-method-on-trait.rs rename to src/test/run-pass/autoref-autoderef/autoderef-method-on-trait.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-method-priority.rs b/src/test/run-pass/autoref-autoderef/autoderef-method-priority.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-method-priority.rs rename to src/test/run-pass/autoref-autoderef/autoderef-method-priority.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoref-autoderef/autoderef-method-twice-but-not-thrice.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-method-twice-but-not-thrice.rs rename to src/test/run-pass/autoref-autoderef/autoderef-method-twice-but-not-thrice.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-method-twice.rs b/src/test/run-pass/autoref-autoderef/autoderef-method-twice.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-method-twice.rs rename to src/test/run-pass/autoref-autoderef/autoderef-method-twice.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-method.rs b/src/test/run-pass/autoref-autoderef/autoderef-method.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-method.rs rename to src/test/run-pass/autoref-autoderef/autoderef-method.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoderef-privacy.rs b/src/test/run-pass/autoref-autoderef/autoderef-privacy.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoderef-privacy.rs rename to src/test/run-pass/autoref-autoderef/autoderef-privacy.rs diff --git a/src/test/ui/run-pass/autoref-autoderef/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-autoderef/autoref-intermediate-types-issue-3585.rs similarity index 100% rename from src/test/ui/run-pass/autoref-autoderef/autoref-intermediate-types-issue-3585.rs rename to src/test/run-pass/autoref-autoderef/autoref-intermediate-types-issue-3585.rs diff --git a/src/test/ui/run-pass/bench/issue-32062.rs b/src/test/run-pass/bench/issue-32062.rs similarity index 100% rename from src/test/ui/run-pass/bench/issue-32062.rs rename to src/test/run-pass/bench/issue-32062.rs diff --git a/src/test/ui/run-pass/binding/allow_irrefutable_let_patterns.rs b/src/test/run-pass/binding/allow_irrefutable_let_patterns.rs similarity index 100% rename from src/test/ui/run-pass/binding/allow_irrefutable_let_patterns.rs rename to src/test/run-pass/binding/allow_irrefutable_let_patterns.rs diff --git a/src/test/ui/run-pass/binding/bind-field-short-with-modifiers.rs b/src/test/run-pass/binding/bind-field-short-with-modifiers.rs similarity index 94% rename from src/test/ui/run-pass/binding/bind-field-short-with-modifiers.rs rename to src/test/run-pass/binding/bind-field-short-with-modifiers.rs index 24f037742708..59fe52f7b596 100644 --- a/src/test/ui/run-pass/binding/bind-field-short-with-modifiers.rs +++ b/src/test/run-pass/binding/bind-field-short-with-modifiers.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] #![allow(non_shorthand_field_patterns)] pub fn main() { diff --git a/src/test/ui/run-pass/binding/borrowed-ptr-pattern-2.rs b/src/test/run-pass/binding/borrowed-ptr-pattern-2.rs similarity index 100% rename from src/test/ui/run-pass/binding/borrowed-ptr-pattern-2.rs rename to src/test/run-pass/binding/borrowed-ptr-pattern-2.rs diff --git a/src/test/ui/run-pass/binding/borrowed-ptr-pattern-3.rs b/src/test/run-pass/binding/borrowed-ptr-pattern-3.rs similarity index 100% rename from src/test/ui/run-pass/binding/borrowed-ptr-pattern-3.rs rename to src/test/run-pass/binding/borrowed-ptr-pattern-3.rs diff --git a/src/test/ui/run-pass/binding/borrowed-ptr-pattern-infallible.rs b/src/test/run-pass/binding/borrowed-ptr-pattern-infallible.rs similarity index 100% rename from src/test/ui/run-pass/binding/borrowed-ptr-pattern-infallible.rs rename to src/test/run-pass/binding/borrowed-ptr-pattern-infallible.rs diff --git a/src/test/ui/run-pass/binding/borrowed-ptr-pattern-option.rs b/src/test/run-pass/binding/borrowed-ptr-pattern-option.rs similarity index 100% rename from src/test/ui/run-pass/binding/borrowed-ptr-pattern-option.rs rename to src/test/run-pass/binding/borrowed-ptr-pattern-option.rs diff --git a/src/test/ui/run-pass/binding/borrowed-ptr-pattern.rs b/src/test/run-pass/binding/borrowed-ptr-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/borrowed-ptr-pattern.rs rename to src/test/run-pass/binding/borrowed-ptr-pattern.rs diff --git a/src/test/ui/run-pass/binding/empty-types-in-patterns.rs b/src/test/run-pass/binding/empty-types-in-patterns.rs similarity index 100% rename from src/test/ui/run-pass/binding/empty-types-in-patterns.rs rename to src/test/run-pass/binding/empty-types-in-patterns.rs diff --git a/src/test/ui/run-pass/binding/exhaustive-bool-match-sanity.rs b/src/test/run-pass/binding/exhaustive-bool-match-sanity.rs similarity index 100% rename from src/test/ui/run-pass/binding/exhaustive-bool-match-sanity.rs rename to src/test/run-pass/binding/exhaustive-bool-match-sanity.rs diff --git a/src/test/ui/run-pass/binding/expr-match-generic-unique1.rs b/src/test/run-pass/binding/expr-match-generic-unique1.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-generic-unique1.rs rename to src/test/run-pass/binding/expr-match-generic-unique1.rs diff --git a/src/test/ui/run-pass/binding/expr-match-generic-unique2.rs b/src/test/run-pass/binding/expr-match-generic-unique2.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-generic-unique2.rs rename to src/test/run-pass/binding/expr-match-generic-unique2.rs diff --git a/src/test/ui/run-pass/binding/expr-match-generic.rs b/src/test/run-pass/binding/expr-match-generic.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-generic.rs rename to src/test/run-pass/binding/expr-match-generic.rs diff --git a/src/test/ui/run-pass/binding/expr-match-panic-all.rs b/src/test/run-pass/binding/expr-match-panic-all.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-panic-all.rs rename to src/test/run-pass/binding/expr-match-panic-all.rs diff --git a/src/test/ui/run-pass/binding/expr-match-panic.rs b/src/test/run-pass/binding/expr-match-panic.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-panic.rs rename to src/test/run-pass/binding/expr-match-panic.rs diff --git a/src/test/ui/run-pass/binding/expr-match-unique.rs b/src/test/run-pass/binding/expr-match-unique.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match-unique.rs rename to src/test/run-pass/binding/expr-match-unique.rs diff --git a/src/test/ui/run-pass/binding/expr-match.rs b/src/test/run-pass/binding/expr-match.rs similarity index 100% rename from src/test/ui/run-pass/binding/expr-match.rs rename to src/test/run-pass/binding/expr-match.rs diff --git a/src/test/ui/run-pass/binding/fat-arrow-match.rs b/src/test/run-pass/binding/fat-arrow-match.rs similarity index 97% rename from src/test/ui/run-pass/binding/fat-arrow-match.rs rename to src/test/run-pass/binding/fat-arrow-match.rs index c0e68f99ad0e..678485b324d9 100644 --- a/src/test/ui/run-pass/binding/fat-arrow-match.rs +++ b/src/test/run-pass/binding/fat-arrow-match.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] enum color { diff --git a/src/test/ui/run-pass/binding/fn-pattern-expected-type-2.rs b/src/test/run-pass/binding/fn-pattern-expected-type-2.rs similarity index 100% rename from src/test/ui/run-pass/binding/fn-pattern-expected-type-2.rs rename to src/test/run-pass/binding/fn-pattern-expected-type-2.rs diff --git a/src/test/ui/run-pass/binding/fn-pattern-expected-type.rs b/src/test/run-pass/binding/fn-pattern-expected-type.rs similarity index 100% rename from src/test/ui/run-pass/binding/fn-pattern-expected-type.rs rename to src/test/run-pass/binding/fn-pattern-expected-type.rs diff --git a/src/test/ui/run-pass/binding/func-arg-incomplete-pattern.rs b/src/test/run-pass/binding/func-arg-incomplete-pattern.rs similarity index 97% rename from src/test/ui/run-pass/binding/func-arg-incomplete-pattern.rs rename to src/test/run-pass/binding/func-arg-incomplete-pattern.rs index d766feeb72c9..bc994f0f7fa5 100644 --- a/src/test/ui/run-pass/binding/func-arg-incomplete-pattern.rs +++ b/src/test/run-pass/binding/func-arg-incomplete-pattern.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that we do not leak when the arg pattern must drop part of the // argument (in this case, the `y` field). diff --git a/src/test/ui/run-pass/binding/func-arg-ref-pattern.rs b/src/test/run-pass/binding/func-arg-ref-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/func-arg-ref-pattern.rs rename to src/test/run-pass/binding/func-arg-ref-pattern.rs diff --git a/src/test/ui/run-pass/binding/func-arg-wild-pattern.rs b/src/test/run-pass/binding/func-arg-wild-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/func-arg-wild-pattern.rs rename to src/test/run-pass/binding/func-arg-wild-pattern.rs diff --git a/src/test/ui/run-pass/binding/if-let.rs b/src/test/run-pass/binding/if-let.rs similarity index 98% rename from src/test/ui/run-pass/binding/if-let.rs rename to src/test/run-pass/binding/if-let.rs index 9147bf14cadb..933865342c42 100644 --- a/src/test/ui/run-pass/binding/if-let.rs +++ b/src/test/run-pass/binding/if-let.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub fn main() { let x = Some(3); diff --git a/src/test/ui/run-pass/binding/inconsistent-lifetime-mismatch.rs b/src/test/run-pass/binding/inconsistent-lifetime-mismatch.rs similarity index 96% rename from src/test/ui/run-pass/binding/inconsistent-lifetime-mismatch.rs rename to src/test/run-pass/binding/inconsistent-lifetime-mismatch.rs index 9e9fc8b42490..fd2764f84d7a 100644 --- a/src/test/ui/run-pass/binding/inconsistent-lifetime-mismatch.rs +++ b/src/test/run-pass/binding/inconsistent-lifetime-mismatch.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn foo(_: &[&str]) {} diff --git a/src/test/ui/run-pass/binding/inferred-suffix-in-pattern-range.rs b/src/test/run-pass/binding/inferred-suffix-in-pattern-range.rs similarity index 100% rename from src/test/ui/run-pass/binding/inferred-suffix-in-pattern-range.rs rename to src/test/run-pass/binding/inferred-suffix-in-pattern-range.rs diff --git a/src/test/ui/run-pass/binding/irrefutable-slice-patterns.rs b/src/test/run-pass/binding/irrefutable-slice-patterns.rs similarity index 100% rename from src/test/ui/run-pass/binding/irrefutable-slice-patterns.rs rename to src/test/run-pass/binding/irrefutable-slice-patterns.rs diff --git a/src/test/ui/run-pass/binding/let-assignability.rs b/src/test/run-pass/binding/let-assignability.rs similarity index 100% rename from src/test/ui/run-pass/binding/let-assignability.rs rename to src/test/run-pass/binding/let-assignability.rs diff --git a/src/test/ui/run-pass/binding/let-destruct-ref.rs b/src/test/run-pass/binding/let-destruct-ref.rs similarity index 100% rename from src/test/ui/run-pass/binding/let-destruct-ref.rs rename to src/test/run-pass/binding/let-destruct-ref.rs diff --git a/src/test/ui/run-pass/binding/let-var-hygiene.rs b/src/test/run-pass/binding/let-var-hygiene.rs similarity index 100% rename from src/test/ui/run-pass/binding/let-var-hygiene.rs rename to src/test/run-pass/binding/let-var-hygiene.rs diff --git a/src/test/ui/run-pass/binding/match-arm-statics.rs b/src/test/run-pass/binding/match-arm-statics.rs similarity index 99% rename from src/test/ui/run-pass/binding/match-arm-statics.rs rename to src/test/run-pass/binding/match-arm-statics.rs index c5111073ca8b..b6f4cb18d9ae 100644 --- a/src/test/ui/run-pass/binding/match-arm-statics.rs +++ b/src/test/run-pass/binding/match-arm-statics.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: -g #[derive(PartialEq, Eq)] diff --git a/src/test/ui/run-pass/binding/match-beginning-vert.rs b/src/test/run-pass/binding/match-beginning-vert.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-beginning-vert.rs rename to src/test/run-pass/binding/match-beginning-vert.rs diff --git a/src/test/ui/run-pass/binding/match-borrowed_str.rs b/src/test/run-pass/binding/match-borrowed_str.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-borrowed_str.rs rename to src/test/run-pass/binding/match-borrowed_str.rs diff --git a/src/test/ui/run-pass/binding/match-bot-2.rs b/src/test/run-pass/binding/match-bot-2.rs similarity index 95% rename from src/test/ui/run-pass/binding/match-bot-2.rs rename to src/test/run-pass/binding/match-bot-2.rs index 8f9a8d2cfcca..f25b423607bc 100644 --- a/src/test/ui/run-pass/binding/match-bot-2.rs +++ b/src/test/run-pass/binding/match-bot-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // n.b. This was only ever failing with optimization disabled. fn a() -> isize { match return 1 { 2 => 3, _ => panic!() } } diff --git a/src/test/ui/run-pass/binding/match-bot.rs b/src/test/run-pass/binding/match-bot.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-bot.rs rename to src/test/run-pass/binding/match-bot.rs diff --git a/src/test/ui/run-pass/binding/match-byte-array-patterns.rs b/src/test/run-pass/binding/match-byte-array-patterns.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-byte-array-patterns.rs rename to src/test/run-pass/binding/match-byte-array-patterns.rs diff --git a/src/test/ui/run-pass/binding/match-enum-struct-0.rs b/src/test/run-pass/binding/match-enum-struct-0.rs similarity index 96% rename from src/test/ui/run-pass/binding/match-enum-struct-0.rs rename to src/test/run-pass/binding/match-enum-struct-0.rs index 9ddf3b421d5e..bc364b04aecf 100644 --- a/src/test/ui/run-pass/binding/match-enum-struct-0.rs +++ b/src/test/run-pass/binding/match-enum-struct-0.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // regression test for issue #5625 diff --git a/src/test/ui/run-pass/binding/match-enum-struct-1.rs b/src/test/run-pass/binding/match-enum-struct-1.rs similarity index 97% rename from src/test/ui/run-pass/binding/match-enum-struct-1.rs rename to src/test/run-pass/binding/match-enum-struct-1.rs index 46d9c19bf849..71cacc2f6bf6 100644 --- a/src/test/ui/run-pass/binding/match-enum-struct-1.rs +++ b/src/test/run-pass/binding/match-enum-struct-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { Foo{f : isize}, diff --git a/src/test/ui/run-pass/binding/match-implicit-copy-unique.rs b/src/test/run-pass/binding/match-implicit-copy-unique.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-implicit-copy-unique.rs rename to src/test/run-pass/binding/match-implicit-copy-unique.rs diff --git a/src/test/ui/run-pass/binding/match-in-macro.rs b/src/test/run-pass/binding/match-in-macro.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-in-macro.rs rename to src/test/run-pass/binding/match-in-macro.rs diff --git a/src/test/ui/run-pass/binding/match-join.rs b/src/test/run-pass/binding/match-join.rs similarity index 97% rename from src/test/ui/run-pass/binding/match-join.rs rename to src/test/run-pass/binding/match-join.rs index 94ea8edd70f4..cd7cc87a40bf 100644 --- a/src/test/ui/run-pass/binding/match-join.rs +++ b/src/test/run-pass/binding/match-join.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] fn foo(y: Option) { let mut x: isize; let mut rs: Vec = Vec::new(); diff --git a/src/test/ui/run-pass/binding/match-larger-const.rs b/src/test/run-pass/binding/match-larger-const.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-larger-const.rs rename to src/test/run-pass/binding/match-larger-const.rs diff --git a/src/test/ui/run-pass/binding/match-naked-record-expr.rs b/src/test/run-pass/binding/match-naked-record-expr.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-naked-record-expr.rs rename to src/test/run-pass/binding/match-naked-record-expr.rs diff --git a/src/test/ui/run-pass/binding/match-naked-record.rs b/src/test/run-pass/binding/match-naked-record.rs similarity index 96% rename from src/test/ui/run-pass/binding/match-naked-record.rs rename to src/test/run-pass/binding/match-naked-record.rs index 550ace8b6495..9c4c36693b9c 100644 --- a/src/test/ui/run-pass/binding/match-naked-record.rs +++ b/src/test/run-pass/binding/match-naked-record.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct X { x: isize } diff --git a/src/test/ui/run-pass/binding/match-path.rs b/src/test/run-pass/binding/match-path.rs similarity index 97% rename from src/test/ui/run-pass/binding/match-path.rs rename to src/test/run-pass/binding/match-path.rs index 06d7095a9248..385713001a3f 100644 --- a/src/test/ui/run-pass/binding/match-path.rs +++ b/src/test/run-pass/binding/match-path.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/binding/match-pattern-bindings.rs b/src/test/run-pass/binding/match-pattern-bindings.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-pattern-bindings.rs rename to src/test/run-pass/binding/match-pattern-bindings.rs diff --git a/src/test/ui/run-pass/binding/match-pattern-lit.rs b/src/test/run-pass/binding/match-pattern-lit.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-pattern-lit.rs rename to src/test/run-pass/binding/match-pattern-lit.rs diff --git a/src/test/ui/run-pass/binding/match-pattern-no-type-params.rs b/src/test/run-pass/binding/match-pattern-no-type-params.rs similarity index 97% rename from src/test/ui/run-pass/binding/match-pattern-no-type-params.rs rename to src/test/run-pass/binding/match-pattern-no-type-params.rs index 2486fa782e0f..e42a24f20b94 100644 --- a/src/test/ui/run-pass/binding/match-pattern-no-type-params.rs +++ b/src/test/run-pass/binding/match-pattern-no-type-params.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] enum maybe { nothing, just(T), } diff --git a/src/test/ui/run-pass/binding/match-pattern-simple.rs b/src/test/run-pass/binding/match-pattern-simple.rs similarity index 96% rename from src/test/ui/run-pass/binding/match-pattern-simple.rs rename to src/test/run-pass/binding/match-pattern-simple.rs index d15256612692..3522ba71b6ab 100644 --- a/src/test/ui/run-pass/binding/match-pattern-simple.rs +++ b/src/test/run-pass/binding/match-pattern-simple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/binding/match-phi.rs b/src/test/run-pass/binding/match-phi.rs similarity index 94% rename from src/test/ui/run-pass/binding/match-phi.rs rename to src/test/run-pass/binding/match-phi.rs index 06a011c0fa27..43a55da573bd 100644 --- a/src/test/ui/run-pass/binding/match-phi.rs +++ b/src/test/run-pass/binding/match-phi.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] // pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] #![allow(unused_variables)] diff --git a/src/test/ui/run-pass/binding/match-pipe-binding.rs b/src/test/run-pass/binding/match-pipe-binding.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-pipe-binding.rs rename to src/test/run-pass/binding/match-pipe-binding.rs diff --git a/src/test/ui/run-pass/binding/match-range-infer.rs b/src/test/run-pass/binding/match-range-infer.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-range-infer.rs rename to src/test/run-pass/binding/match-range-infer.rs diff --git a/src/test/ui/run-pass/binding/match-range-static.rs b/src/test/run-pass/binding/match-range-static.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-range-static.rs rename to src/test/run-pass/binding/match-range-static.rs diff --git a/src/test/ui/run-pass/binding/match-range.rs b/src/test/run-pass/binding/match-range.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-range.rs rename to src/test/run-pass/binding/match-range.rs diff --git a/src/test/ui/run-pass/binding/match-reassign.rs b/src/test/run-pass/binding/match-reassign.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-reassign.rs rename to src/test/run-pass/binding/match-reassign.rs diff --git a/src/test/ui/run-pass/binding/match-ref-binding-in-guard-3256.rs b/src/test/run-pass/binding/match-ref-binding-in-guard-3256.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-ref-binding-in-guard-3256.rs rename to src/test/run-pass/binding/match-ref-binding-in-guard-3256.rs diff --git a/src/test/ui/run-pass/binding/match-ref-binding-mut-option.rs b/src/test/run-pass/binding/match-ref-binding-mut-option.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-ref-binding-mut-option.rs rename to src/test/run-pass/binding/match-ref-binding-mut-option.rs diff --git a/src/test/ui/run-pass/binding/match-ref-binding-mut.rs b/src/test/run-pass/binding/match-ref-binding-mut.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-ref-binding-mut.rs rename to src/test/run-pass/binding/match-ref-binding-mut.rs diff --git a/src/test/ui/run-pass/binding/match-ref-binding.rs b/src/test/run-pass/binding/match-ref-binding.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-ref-binding.rs rename to src/test/run-pass/binding/match-ref-binding.rs diff --git a/src/test/ui/run-pass/binding/match-ref-unsized.rs b/src/test/run-pass/binding/match-ref-unsized.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-ref-unsized.rs rename to src/test/run-pass/binding/match-ref-unsized.rs diff --git a/src/test/ui/run-pass/binding/match-static-const-rename.rs b/src/test/run-pass/binding/match-static-const-rename.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-static-const-rename.rs rename to src/test/run-pass/binding/match-static-const-rename.rs diff --git a/src/test/ui/run-pass/binding/match-str.rs b/src/test/run-pass/binding/match-str.rs similarity index 97% rename from src/test/ui/run-pass/binding/match-str.rs rename to src/test/run-pass/binding/match-str.rs index 0722a6f0b32e..7b051cfa4359 100644 --- a/src/test/ui/run-pass/binding/match-str.rs +++ b/src/test/run-pass/binding/match-str.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #53 #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/binding/match-struct-0.rs b/src/test/run-pass/binding/match-struct-0.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-struct-0.rs rename to src/test/run-pass/binding/match-struct-0.rs diff --git a/src/test/ui/run-pass/binding/match-tag.rs b/src/test/run-pass/binding/match-tag.rs similarity index 98% rename from src/test/ui/run-pass/binding/match-tag.rs rename to src/test/run-pass/binding/match-tag.rs index aeeb7dd4bc9e..ca7b7c70afbb 100644 --- a/src/test/ui/run-pass/binding/match-tag.rs +++ b/src/test/run-pass/binding/match-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/binding/match-unique-bind.rs b/src/test/run-pass/binding/match-unique-bind.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-unique-bind.rs rename to src/test/run-pass/binding/match-unique-bind.rs diff --git a/src/test/ui/run-pass/binding/match-unsized.rs b/src/test/run-pass/binding/match-unsized.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-unsized.rs rename to src/test/run-pass/binding/match-unsized.rs diff --git a/src/test/ui/run-pass/binding/match-value-binding-in-guard-3291.rs b/src/test/run-pass/binding/match-value-binding-in-guard-3291.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-value-binding-in-guard-3291.rs rename to src/test/run-pass/binding/match-value-binding-in-guard-3291.rs diff --git a/src/test/ui/run-pass/binding/match-var-hygiene.rs b/src/test/run-pass/binding/match-var-hygiene.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-var-hygiene.rs rename to src/test/run-pass/binding/match-var-hygiene.rs diff --git a/src/test/ui/run-pass/binding/match-vec-alternatives.rs b/src/test/run-pass/binding/match-vec-alternatives.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-vec-alternatives.rs rename to src/test/run-pass/binding/match-vec-alternatives.rs diff --git a/src/test/ui/run-pass/binding/match-vec-rvalue.rs b/src/test/run-pass/binding/match-vec-rvalue.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-vec-rvalue.rs rename to src/test/run-pass/binding/match-vec-rvalue.rs diff --git a/src/test/ui/run-pass/binding/match-with-ret-arm.rs b/src/test/run-pass/binding/match-with-ret-arm.rs similarity index 100% rename from src/test/ui/run-pass/binding/match-with-ret-arm.rs rename to src/test/run-pass/binding/match-with-ret-arm.rs diff --git a/src/test/ui/run-pass/binding/multi-let.rs b/src/test/run-pass/binding/multi-let.rs similarity index 100% rename from src/test/ui/run-pass/binding/multi-let.rs rename to src/test/run-pass/binding/multi-let.rs diff --git a/src/test/ui/run-pass/binding/mut-in-ident-patterns.rs b/src/test/run-pass/binding/mut-in-ident-patterns.rs similarity index 97% rename from src/test/ui/run-pass/binding/mut-in-ident-patterns.rs rename to src/test/run-pass/binding/mut-in-ident-patterns.rs index 1e28b77f2ce0..e9f143cfbc96 100644 --- a/src/test/ui/run-pass/binding/mut-in-ident-patterns.rs +++ b/src/test/run-pass/binding/mut-in-ident-patterns.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] #![allow(non_camel_case_types)] #![allow(non_shorthand_field_patterns)] diff --git a/src/test/ui/run-pass/binding/nested-exhaustive-match.rs b/src/test/run-pass/binding/nested-exhaustive-match.rs similarity index 97% rename from src/test/ui/run-pass/binding/nested-exhaustive-match.rs rename to src/test/run-pass/binding/nested-exhaustive-match.rs index 8456e63d4c7b..61bb0e8a4689 100644 --- a/src/test/ui/run-pass/binding/nested-exhaustive-match.rs +++ b/src/test/run-pass/binding/nested-exhaustive-match.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Foo { foo: bool, bar: Option, baz: isize } diff --git a/src/test/ui/run-pass/binding/nested-matchs.rs b/src/test/run-pass/binding/nested-matchs.rs similarity index 92% rename from src/test/ui/run-pass/binding/nested-matchs.rs rename to src/test/run-pass/binding/nested-matchs.rs index e1012f3b384c..0b37c495074e 100644 --- a/src/test/ui/run-pass/binding/nested-matchs.rs +++ b/src/test/run-pass/binding/nested-matchs.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // under NLL we get warning about `bar` below fn baz() -> ! { panic!(); } fn foo() { diff --git a/src/test/ui/run-pass/binding/nested-pattern.rs b/src/test/run-pass/binding/nested-pattern.rs similarity index 97% rename from src/test/ui/run-pass/binding/nested-pattern.rs rename to src/test/run-pass/binding/nested-pattern.rs index 5bf558a48712..96bdadc06247 100644 --- a/src/test/ui/run-pass/binding/nested-pattern.rs +++ b/src/test/run-pass/binding/nested-pattern.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // a bug was causing this to complain about leaked memory on exit diff --git a/src/test/ui/run-pass/binding/nil-pattern.rs b/src/test/run-pass/binding/nil-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/nil-pattern.rs rename to src/test/run-pass/binding/nil-pattern.rs diff --git a/src/test/ui/run-pass/binding/nullary-or-pattern.rs b/src/test/run-pass/binding/nullary-or-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/nullary-or-pattern.rs rename to src/test/run-pass/binding/nullary-or-pattern.rs diff --git a/src/test/ui/run-pass/binding/optional_comma_in_match_arm.rs b/src/test/run-pass/binding/optional_comma_in_match_arm.rs similarity index 98% rename from src/test/ui/run-pass/binding/optional_comma_in_match_arm.rs rename to src/test/run-pass/binding/optional_comma_in_match_arm.rs index 90ef3c2b7eaf..304a0323297e 100644 --- a/src/test/ui/run-pass/binding/optional_comma_in_match_arm.rs +++ b/src/test/run-pass/binding/optional_comma_in_match_arm.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_unsafe)] // ignore-pretty issue #37199 #![allow(while_true)] diff --git a/src/test/ui/run-pass/binding/or-pattern.rs b/src/test/run-pass/binding/or-pattern.rs similarity index 100% rename from src/test/ui/run-pass/binding/or-pattern.rs rename to src/test/run-pass/binding/or-pattern.rs diff --git a/src/test/ui/run-pass/binding/order-drop-with-match.rs b/src/test/run-pass/binding/order-drop-with-match.rs similarity index 100% rename from src/test/ui/run-pass/binding/order-drop-with-match.rs rename to src/test/run-pass/binding/order-drop-with-match.rs diff --git a/src/test/ui/run-pass/binding/pat-ranges.rs b/src/test/run-pass/binding/pat-ranges.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-ranges.rs rename to src/test/run-pass/binding/pat-ranges.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-1.rs b/src/test/run-pass/binding/pat-tuple-1.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-1.rs rename to src/test/run-pass/binding/pat-tuple-1.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-2.rs b/src/test/run-pass/binding/pat-tuple-2.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-2.rs rename to src/test/run-pass/binding/pat-tuple-2.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-3.rs b/src/test/run-pass/binding/pat-tuple-3.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-3.rs rename to src/test/run-pass/binding/pat-tuple-3.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-4.rs b/src/test/run-pass/binding/pat-tuple-4.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-4.rs rename to src/test/run-pass/binding/pat-tuple-4.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-5.rs b/src/test/run-pass/binding/pat-tuple-5.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-5.rs rename to src/test/run-pass/binding/pat-tuple-5.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-6.rs b/src/test/run-pass/binding/pat-tuple-6.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-6.rs rename to src/test/run-pass/binding/pat-tuple-6.rs diff --git a/src/test/ui/run-pass/binding/pat-tuple-7.rs b/src/test/run-pass/binding/pat-tuple-7.rs similarity index 100% rename from src/test/ui/run-pass/binding/pat-tuple-7.rs rename to src/test/run-pass/binding/pat-tuple-7.rs diff --git a/src/test/ui/run-pass/binding/pattern-bound-var-in-for-each.rs b/src/test/run-pass/binding/pattern-bound-var-in-for-each.rs similarity index 100% rename from src/test/ui/run-pass/binding/pattern-bound-var-in-for-each.rs rename to src/test/run-pass/binding/pattern-bound-var-in-for-each.rs diff --git a/src/test/ui/run-pass/binding/pattern-in-closure.rs b/src/test/run-pass/binding/pattern-in-closure.rs similarity index 100% rename from src/test/ui/run-pass/binding/pattern-in-closure.rs rename to src/test/run-pass/binding/pattern-in-closure.rs diff --git a/src/test/ui/run-pass/binding/range-inclusive-pattern-precedence.rs b/src/test/run-pass/binding/range-inclusive-pattern-precedence.rs similarity index 100% rename from src/test/ui/run-pass/binding/range-inclusive-pattern-precedence.rs rename to src/test/run-pass/binding/range-inclusive-pattern-precedence.rs diff --git a/src/test/ui/run-pass/binding/simple-generic-match.rs b/src/test/run-pass/binding/simple-generic-match.rs similarity index 100% rename from src/test/ui/run-pass/binding/simple-generic-match.rs rename to src/test/run-pass/binding/simple-generic-match.rs diff --git a/src/test/ui/run-pass/binding/use-uninit-match.rs b/src/test/run-pass/binding/use-uninit-match.rs similarity index 97% rename from src/test/ui/run-pass/binding/use-uninit-match.rs rename to src/test/run-pass/binding/use-uninit-match.rs index 1fc597b636ec..472045fcdb3f 100644 --- a/src/test/ui/run-pass/binding/use-uninit-match.rs +++ b/src/test/run-pass/binding/use-uninit-match.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/binding/use-uninit-match2.rs b/src/test/run-pass/binding/use-uninit-match2.rs similarity index 94% rename from src/test/ui/run-pass/binding/use-uninit-match2.rs rename to src/test/run-pass/binding/use-uninit-match2.rs index 8eb44fd76e1d..2f8384f9e846 100644 --- a/src/test/ui/run-pass/binding/use-uninit-match2.rs +++ b/src/test/run-pass/binding/use-uninit-match2.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/binding/zero_sized_subslice_match.rs b/src/test/run-pass/binding/zero_sized_subslice_match.rs similarity index 100% rename from src/test/ui/run-pass/binding/zero_sized_subslice_match.rs rename to src/test/run-pass/binding/zero_sized_subslice_match.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-assign-to-subfield.rs b/src/test/run-pass/borrowck/borrowck-assign-to-subfield.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-assign-to-subfield.rs rename to src/test/run-pass/borrowck/borrowck-assign-to-subfield.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-assignment-to-static-mut.rs b/src/test/run-pass/borrowck/borrowck-assignment-to-static-mut.rs similarity index 97% rename from src/test/ui/run-pass/borrowck/borrowck-assignment-to-static-mut.rs rename to src/test/run-pass/borrowck/borrowck-assignment-to-static-mut.rs index fa79ac84c865..ad16027c34d2 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-assignment-to-static-mut.rs +++ b/src/test/run-pass/borrowck/borrowck-assignment-to-static-mut.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test taken from #45641 (https://github.com/rust-lang/rust/issues/45641) // revisions: ast mir diff --git a/src/test/ui/run-pass/borrowck/borrowck-binding-mutbl.rs b/src/test/run-pass/borrowck/borrowck-binding-mutbl.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-binding-mutbl.rs rename to src/test/run-pass/borrowck/borrowck-binding-mutbl.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-borrow-from-expr-block.rs b/src/test/run-pass/borrowck/borrowck-borrow-from-expr-block.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-borrow-from-expr-block.rs rename to src/test/run-pass/borrowck/borrowck-borrow-from-expr-block.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs b/src/test/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs similarity index 92% rename from src/test/ui/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs rename to src/test/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs index 72634651d959..a3a634829234 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs +++ b/src/test/run-pass/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_variables)] // Test that freezing an `&mut` pointer while referent is // frozen is legal. // diff --git a/src/test/ui/run-pass/borrowck/borrowck-closures-two-imm.rs b/src/test/run-pass/borrowck/borrowck-closures-two-imm.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-closures-two-imm.rs rename to src/test/run-pass/borrowck/borrowck-closures-two-imm.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-field-sensitivity.rs b/src/test/run-pass/borrowck/borrowck-field-sensitivity.rs similarity index 99% rename from src/test/ui/run-pass/borrowck/borrowck-field-sensitivity.rs rename to src/test/run-pass/borrowck/borrowck-field-sensitivity.rs index a3d6f129f183..782054bb1b15 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-field-sensitivity.rs +++ b/src/test/run-pass/borrowck/borrowck-field-sensitivity.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/borrowck/borrowck-fixed-length-vecs.rs b/src/test/run-pass/borrowck/borrowck-fixed-length-vecs.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-fixed-length-vecs.rs rename to src/test/run-pass/borrowck/borrowck-fixed-length-vecs.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-freeze-frozen-mut.rs b/src/test/run-pass/borrowck/borrowck-freeze-frozen-mut.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-freeze-frozen-mut.rs rename to src/test/run-pass/borrowck/borrowck-freeze-frozen-mut.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-lend-args.rs b/src/test/run-pass/borrowck/borrowck-lend-args.rs similarity index 97% rename from src/test/ui/run-pass/borrowck/borrowck-lend-args.rs rename to src/test/run-pass/borrowck/borrowck-lend-args.rs index 4ec7e0a58983..3458ab91f3d4 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-lend-args.rs +++ b/src/test/run-pass/borrowck/borrowck-lend-args.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs b/src/test/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs similarity index 95% rename from src/test/ui/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs rename to src/test/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs index 3f81c2e5619e..ea47661a1fad 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs +++ b/src/test/run-pass/borrowck/borrowck-macro-interaction-issue-6304.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(unconditional_recursion)] // Check that we do not ICE when compiling this diff --git a/src/test/ui/run-pass/borrowck/borrowck-move-by-capture-ok.rs b/src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-move-by-capture-ok.rs rename to src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs b/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs similarity index 94% rename from src/test/ui/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs rename to src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs index 4650ce8d2c42..c51a615c9633 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs +++ b/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test case from #39963. #![feature(nll)] diff --git a/src/test/ui/run-pass/borrowck/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck/borrowck-mut-uniq.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-mut-uniq.rs rename to src/test/run-pass/borrowck/borrowck-mut-uniq.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs b/src/test/run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs rename to src/test/run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-pat-enum.rs b/src/test/run-pass/borrowck/borrowck-pat-enum.rs similarity index 98% rename from src/test/ui/run-pass/borrowck/borrowck-pat-enum.rs rename to src/test/run-pass/borrowck/borrowck-pat-enum.rs index 3b9c4aed03ec..5a184fd01798 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-pat-enum.rs +++ b/src/test/run-pass/borrowck/borrowck-pat-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-pretty issue #37199 fn match_ref(v: Option) -> isize { diff --git a/src/test/ui/run-pass/borrowck/borrowck-pat-reassign-no-binding.rs b/src/test/run-pass/borrowck/borrowck-pat-reassign-no-binding.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-pat-reassign-no-binding.rs rename to src/test/run-pass/borrowck/borrowck-pat-reassign-no-binding.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-rvalues-mutable.rs b/src/test/run-pass/borrowck/borrowck-rvalues-mutable.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-rvalues-mutable.rs rename to src/test/run-pass/borrowck/borrowck-rvalues-mutable.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-scope-of-deref-issue-4666.rs b/src/test/run-pass/borrowck/borrowck-scope-of-deref-issue-4666.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-scope-of-deref-issue-4666.rs rename to src/test/run-pass/borrowck/borrowck-scope-of-deref-issue-4666.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-slice-pattern-element-loan.rs b/src/test/run-pass/borrowck/borrowck-slice-pattern-element-loan.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-slice-pattern-element-loan.rs rename to src/test/run-pass/borrowck/borrowck-slice-pattern-element-loan.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-static-item-in-fn.rs b/src/test/run-pass/borrowck/borrowck-static-item-in-fn.rs similarity index 96% rename from src/test/ui/run-pass/borrowck/borrowck-static-item-in-fn.rs rename to src/test/run-pass/borrowck/borrowck-static-item-in-fn.rs index 809948d5423d..9bc2a64eea60 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-static-item-in-fn.rs +++ b/src/test/run-pass/borrowck/borrowck-static-item-in-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for issue #7740 // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/borrowck/borrowck-trait-lifetime.rs b/src/test/run-pass/borrowck/borrowck-trait-lifetime.rs similarity index 96% rename from src/test/ui/run-pass/borrowck/borrowck-trait-lifetime.rs rename to src/test/run-pass/borrowck/borrowck-trait-lifetime.rs index cf7a976628e8..78d25117ff21 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-trait-lifetime.rs +++ b/src/test/run-pass/borrowck/borrowck-trait-lifetime.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // This test verifies that casting from the same lifetime on a value // to the same lifetime on a trait succeeds. See issue #10766. diff --git a/src/test/ui/run-pass/borrowck/borrowck-uniq-via-ref.rs b/src/test/run-pass/borrowck/borrowck-uniq-via-ref.rs similarity index 98% rename from src/test/ui/run-pass/borrowck/borrowck-uniq-via-ref.rs rename to src/test/run-pass/borrowck/borrowck-uniq-via-ref.rs index f9b650e0e828..e9d7f6f3eb31 100644 --- a/src/test/ui/run-pass/borrowck/borrowck-uniq-via-ref.rs +++ b/src/test/run-pass/borrowck/borrowck-uniq-via-ref.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/borrowck/borrowck-univariant-enum.rs b/src/test/run-pass/borrowck/borrowck-univariant-enum.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-univariant-enum.rs rename to src/test/run-pass/borrowck/borrowck-univariant-enum.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-unsafe-static-mutable-borrows.rs b/src/test/run-pass/borrowck/borrowck-unsafe-static-mutable-borrows.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-unsafe-static-mutable-borrows.rs rename to src/test/run-pass/borrowck/borrowck-unsafe-static-mutable-borrows.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-unused-mut-locals.rs b/src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-unused-mut-locals.rs rename to src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs diff --git a/src/test/ui/run-pass/borrowck/borrowck-use-mut-borrow.rs b/src/test/run-pass/borrowck/borrowck-use-mut-borrow.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/borrowck-use-mut-borrow.rs rename to src/test/run-pass/borrowck/borrowck-use-mut-borrow.rs diff --git a/src/test/ui/run-pass/borrowck/two-phase-baseline.rs b/src/test/run-pass/borrowck/two-phase-baseline.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/two-phase-baseline.rs rename to src/test/run-pass/borrowck/two-phase-baseline.rs diff --git a/src/test/ui/run-pass/borrowck/two-phase-bin-ops.rs b/src/test/run-pass/borrowck/two-phase-bin-ops.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/two-phase-bin-ops.rs rename to src/test/run-pass/borrowck/two-phase-bin-ops.rs diff --git a/src/test/ui/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs b/src/test/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs similarity index 100% rename from src/test/ui/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs rename to src/test/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs diff --git a/src/test/ui/run-pass/cfg/auxiliary/cfg_inner_static.rs b/src/test/run-pass/cfg/auxiliary/cfg_inner_static.rs similarity index 100% rename from src/test/ui/run-pass/cfg/auxiliary/cfg_inner_static.rs rename to src/test/run-pass/cfg/auxiliary/cfg_inner_static.rs diff --git a/src/test/ui/run-pass/cfg/auxiliary/crate-attributes-using-cfg_attr.rs b/src/test/run-pass/cfg/auxiliary/crate-attributes-using-cfg_attr.rs similarity index 100% rename from src/test/ui/run-pass/cfg/auxiliary/crate-attributes-using-cfg_attr.rs rename to src/test/run-pass/cfg/auxiliary/crate-attributes-using-cfg_attr.rs diff --git a/src/test/ui/run-pass/cfg/cfg-attr-cfg.rs b/src/test/run-pass/cfg/cfg-attr-cfg.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-attr-cfg.rs rename to src/test/run-pass/cfg/cfg-attr-cfg.rs diff --git a/src/test/ui/run-pass/cfg/cfg-attr-crate.rs b/src/test/run-pass/cfg/cfg-attr-crate.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-attr-crate.rs rename to src/test/run-pass/cfg/cfg-attr-crate.rs diff --git a/src/test/ui/run-pass/cfg/cfg-family.rs b/src/test/run-pass/cfg/cfg-family.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-family.rs rename to src/test/run-pass/cfg/cfg-family.rs diff --git a/src/test/ui/run-pass/cfg/cfg-in-crate-1.rs b/src/test/run-pass/cfg/cfg-in-crate-1.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-in-crate-1.rs rename to src/test/run-pass/cfg/cfg-in-crate-1.rs diff --git a/src/test/ui/run-pass/cfg/cfg-macros-foo.rs b/src/test/run-pass/cfg/cfg-macros-foo.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-macros-foo.rs rename to src/test/run-pass/cfg/cfg-macros-foo.rs diff --git a/src/test/ui/run-pass/cfg/cfg-macros-notfoo.rs b/src/test/run-pass/cfg/cfg-macros-notfoo.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-macros-notfoo.rs rename to src/test/run-pass/cfg/cfg-macros-notfoo.rs diff --git a/src/test/ui/run-pass/cfg/cfg-match-arm.rs b/src/test/run-pass/cfg/cfg-match-arm.rs similarity index 97% rename from src/test/ui/run-pass/cfg/cfg-match-arm.rs rename to src/test/run-pass/cfg/cfg-match-arm.rs index 8443d59e8697..8a7271c38ce2 100644 --- a/src/test/ui/run-pass/cfg/cfg-match-arm.rs +++ b/src/test/run-pass/cfg/cfg-match-arm.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum Foo { diff --git a/src/test/ui/run-pass/cfg/cfg-target-family.rs b/src/test/run-pass/cfg/cfg-target-family.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-target-family.rs rename to src/test/run-pass/cfg/cfg-target-family.rs diff --git a/src/test/ui/run-pass/cfg/cfg-target-vendor.rs b/src/test/run-pass/cfg/cfg-target-vendor.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg-target-vendor.rs rename to src/test/run-pass/cfg/cfg-target-vendor.rs diff --git a/src/test/ui/run-pass/cfg/cfg_attr.rs b/src/test/run-pass/cfg/cfg_attr.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg_attr.rs rename to src/test/run-pass/cfg/cfg_attr.rs diff --git a/src/test/ui/run-pass/cfg/cfg_inner_static.rs b/src/test/run-pass/cfg/cfg_inner_static.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfg_inner_static.rs rename to src/test/run-pass/cfg/cfg_inner_static.rs diff --git a/src/test/ui/run-pass/cfg/cfg_stmt_expr.rs b/src/test/run-pass/cfg/cfg_stmt_expr.rs similarity index 96% rename from src/test/ui/run-pass/cfg/cfg_stmt_expr.rs rename to src/test/run-pass/cfg/cfg_stmt_expr.rs index 102ca22f0bd7..405cc402e598 100644 --- a/src/test/ui/run-pass/cfg/cfg_stmt_expr.rs +++ b/src/test/run-pass/cfg/cfg_stmt_expr.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_variables)] #![deny(non_snake_case)] #![feature(stmt_expr_attributes)] diff --git a/src/test/ui/run-pass/cfg/cfgs-on-items.rs b/src/test/run-pass/cfg/cfgs-on-items.rs similarity index 100% rename from src/test/ui/run-pass/cfg/cfgs-on-items.rs rename to src/test/run-pass/cfg/cfgs-on-items.rs diff --git a/src/test/ui/run-pass/cfg/conditional-compile-arch.rs b/src/test/run-pass/cfg/conditional-compile-arch.rs similarity index 100% rename from src/test/ui/run-pass/cfg/conditional-compile-arch.rs rename to src/test/run-pass/cfg/conditional-compile-arch.rs diff --git a/src/test/ui/run-pass/cfg/conditional-compile.rs b/src/test/run-pass/cfg/conditional-compile.rs similarity index 99% rename from src/test/ui/run-pass/cfg/conditional-compile.rs rename to src/test/run-pass/cfg/conditional-compile.rs index 203624624845..0328a62588c9 100644 --- a/src/test/ui/run-pass/cfg/conditional-compile.rs +++ b/src/test/run-pass/cfg/conditional-compile.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(improper_ctypes)] diff --git a/src/test/ui/run-pass/cfg/crate-attributes-using-cfg_attr.rs b/src/test/run-pass/cfg/crate-attributes-using-cfg_attr.rs similarity index 100% rename from src/test/ui/run-pass/cfg/crate-attributes-using-cfg_attr.rs rename to src/test/run-pass/cfg/crate-attributes-using-cfg_attr.rs diff --git a/src/test/ui/run-pass/coerce/coerce-expect-unsized.rs b/src/test/run-pass/coerce/coerce-expect-unsized.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-expect-unsized.rs rename to src/test/run-pass/coerce/coerce-expect-unsized.rs diff --git a/src/test/ui/run-pass/coerce/coerce-overloaded-autoderef.rs b/src/test/run-pass/coerce/coerce-overloaded-autoderef.rs similarity index 99% rename from src/test/ui/run-pass/coerce/coerce-overloaded-autoderef.rs rename to src/test/run-pass/coerce/coerce-overloaded-autoderef.rs index c6b9e61dae1c..9f3ef90f9d91 100644 --- a/src/test/ui/run-pass/coerce/coerce-overloaded-autoderef.rs +++ b/src/test/run-pass/coerce/coerce-overloaded-autoderef.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 use std::rc::Rc; diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs b/src/test/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs similarity index 97% rename from src/test/ui/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs rename to src/test/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs index be5e55afbc57..4c6510f9b9b2 100644 --- a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs +++ b/src/test/run-pass/coerce/coerce-reborrow-imm-ptr-arg.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn negate(x: &isize) -> isize { diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-ptr-rcvr.rs b/src/test/run-pass/coerce/coerce-reborrow-imm-ptr-rcvr.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-imm-ptr-rcvr.rs rename to src/test/run-pass/coerce/coerce-reborrow-imm-ptr-rcvr.rs diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs b/src/test/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs similarity index 97% rename from src/test/ui/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs rename to src/test/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs index f8849e6af866..3d61db475da4 100644 --- a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs +++ b/src/test/run-pass/coerce/coerce-reborrow-imm-vec-arg.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn sum(x: &[isize]) -> isize { diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-imm-vec-rcvr.rs b/src/test/run-pass/coerce/coerce-reborrow-imm-vec-rcvr.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-imm-vec-rcvr.rs rename to src/test/run-pass/coerce/coerce-reborrow-imm-vec-rcvr.rs diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-mut-ptr-arg.rs b/src/test/run-pass/coerce/coerce-reborrow-mut-ptr-arg.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-mut-ptr-arg.rs rename to src/test/run-pass/coerce/coerce-reborrow-mut-ptr-arg.rs diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-mut-ptr-rcvr.rs b/src/test/run-pass/coerce/coerce-reborrow-mut-ptr-rcvr.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-mut-ptr-rcvr.rs rename to src/test/run-pass/coerce/coerce-reborrow-mut-ptr-rcvr.rs diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-mut-vec-arg.rs b/src/test/run-pass/coerce/coerce-reborrow-mut-vec-arg.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-mut-vec-arg.rs rename to src/test/run-pass/coerce/coerce-reborrow-mut-vec-arg.rs diff --git a/src/test/ui/run-pass/coerce/coerce-reborrow-mut-vec-rcvr.rs b/src/test/run-pass/coerce/coerce-reborrow-mut-vec-rcvr.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-reborrow-mut-vec-rcvr.rs rename to src/test/run-pass/coerce/coerce-reborrow-mut-vec-rcvr.rs diff --git a/src/test/ui/run-pass/coerce/coerce-unify-return.rs b/src/test/run-pass/coerce/coerce-unify-return.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-unify-return.rs rename to src/test/run-pass/coerce/coerce-unify-return.rs diff --git a/src/test/ui/run-pass/coerce/coerce-unify.rs b/src/test/run-pass/coerce/coerce-unify.rs similarity index 100% rename from src/test/ui/run-pass/coerce/coerce-unify.rs rename to src/test/run-pass/coerce/coerce-unify.rs diff --git a/src/test/ui/run-pass/coerce/coerce-unsize-subtype.rs b/src/test/run-pass/coerce/coerce-unsize-subtype.rs similarity index 98% rename from src/test/ui/run-pass/coerce/coerce-unsize-subtype.rs rename to src/test/run-pass/coerce/coerce-unsize-subtype.rs index ab571a8b40dc..068b010da1ee 100644 --- a/src/test/ui/run-pass/coerce/coerce-unsize-subtype.rs +++ b/src/test/run-pass/coerce/coerce-unsize-subtype.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 use std::rc::Rc; diff --git a/src/test/ui/run-pass/coherence/auxiliary/coherence_copy_like_lib.rs b/src/test/run-pass/coherence/auxiliary/coherence_copy_like_lib.rs similarity index 100% rename from src/test/ui/run-pass/coherence/auxiliary/coherence_copy_like_lib.rs rename to src/test/run-pass/coherence/auxiliary/coherence_copy_like_lib.rs diff --git a/src/test/ui/run-pass/coherence/auxiliary/coherence_lib.rs b/src/test/run-pass/coherence/auxiliary/coherence_lib.rs similarity index 100% rename from src/test/ui/run-pass/coherence/auxiliary/coherence_lib.rs rename to src/test/run-pass/coherence/auxiliary/coherence_lib.rs diff --git a/src/test/ui/run-pass/coherence/coherence-bigint-int.rs b/src/test/run-pass/coherence/coherence-bigint-int.rs similarity index 100% rename from src/test/ui/run-pass/coherence/coherence-bigint-int.rs rename to src/test/run-pass/coherence/coherence-bigint-int.rs diff --git a/src/test/ui/run-pass/coherence/coherence-bigint-vecint.rs b/src/test/run-pass/coherence/coherence-bigint-vecint.rs similarity index 100% rename from src/test/ui/run-pass/coherence/coherence-bigint-vecint.rs rename to src/test/run-pass/coherence/coherence-bigint-vecint.rs diff --git a/src/test/ui/run-pass/coherence/coherence-blanket.rs b/src/test/run-pass/coherence/coherence-blanket.rs similarity index 96% rename from src/test/ui/run-pass/coherence/coherence-blanket.rs rename to src/test/run-pass/coherence/coherence-blanket.rs index fa09b13bf673..93bfdd2fdd21 100644 --- a/src/test/ui/run-pass/coherence/coherence-blanket.rs +++ b/src/test/run-pass/coherence/coherence-blanket.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:coherence_lib.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/coherence/coherence-covered-type-parameter.rs b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs similarity index 96% rename from src/test/ui/run-pass/coherence/coherence-covered-type-parameter.rs rename to src/test/run-pass/coherence/coherence-covered-type-parameter.rs index 3ddeb58dddc8..8cbafdf71774 100644 --- a/src/test/ui/run-pass/coherence/coherence-covered-type-parameter.rs +++ b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:coherence_lib.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/coherence/coherence-impl-in-fn.rs b/src/test/run-pass/coherence/coherence-impl-in-fn.rs similarity index 97% rename from src/test/ui/run-pass/coherence/coherence-impl-in-fn.rs rename to src/test/run-pass/coherence/coherence-impl-in-fn.rs index de7cb7664b64..b6915919acbb 100644 --- a/src/test/ui/run-pass/coherence/coherence-impl-in-fn.rs +++ b/src/test/run-pass/coherence/coherence-impl-in-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] pub fn main() { diff --git a/src/test/ui/run-pass/coherence/coherence-iterator-vec-any-elem.rs b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs similarity index 96% rename from src/test/ui/run-pass/coherence/coherence-iterator-vec-any-elem.rs rename to src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs index d446f0dca9ab..f56c827b55da 100644 --- a/src/test/ui/run-pass/coherence/coherence-iterator-vec-any-elem.rs +++ b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:coherence_lib.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/coherence/coherence-iterator-vec.rs b/src/test/run-pass/coherence/coherence-iterator-vec.rs similarity index 96% rename from src/test/ui/run-pass/coherence/coherence-iterator-vec.rs rename to src/test/run-pass/coherence/coherence-iterator-vec.rs index 38ad5b8115a7..16501553d9f5 100644 --- a/src/test/ui/run-pass/coherence/coherence-iterator-vec.rs +++ b/src/test/run-pass/coherence/coherence-iterator-vec.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:coherence_lib.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/coherence/coherence-multidispatch-tuple.rs b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs similarity index 97% rename from src/test/ui/run-pass/coherence/coherence-multidispatch-tuple.rs rename to src/test/run-pass/coherence/coherence-multidispatch-tuple.rs index ab04f946fa62..f6d711bd6cd3 100644 --- a/src/test/ui/run-pass/coherence/coherence-multidispatch-tuple.rs +++ b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // pretty-expanded FIXME #23616 use std::fmt::Debug; diff --git a/src/test/ui/run-pass/coherence/coherence-negative-impls-safe.rs b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs similarity index 96% rename from src/test/ui/run-pass/coherence/coherence-negative-impls-safe.rs rename to src/test/run-pass/coherence/coherence-negative-impls-safe.rs index 7984193862e4..50b3500ad8df 100644 --- a/src/test/ui/run-pass/coherence/coherence-negative-impls-safe.rs +++ b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(optin_builtin_traits)] diff --git a/src/test/ui/run-pass/coherence/coherence-rfc447-constrained.rs b/src/test/run-pass/coherence/coherence-rfc447-constrained.rs similarity index 100% rename from src/test/ui/run-pass/coherence/coherence-rfc447-constrained.rs rename to src/test/run-pass/coherence/coherence-rfc447-constrained.rs diff --git a/src/test/ui/run-pass/coherence/coherence-subtyping.rs b/src/test/run-pass/coherence/coherence-subtyping.rs similarity index 100% rename from src/test/ui/run-pass/coherence/coherence-subtyping.rs rename to src/test/run-pass/coherence/coherence-subtyping.rs diff --git a/src/test/ui/run-pass/coherence/coherence-where-clause.rs b/src/test/run-pass/coherence/coherence-where-clause.rs similarity index 100% rename from src/test/ui/run-pass/coherence/coherence-where-clause.rs rename to src/test/run-pass/coherence/coherence-where-clause.rs diff --git a/src/test/ui/run-pass/coherence/coherence_copy_like.rs b/src/test/run-pass/coherence/coherence_copy_like.rs similarity index 97% rename from src/test/ui/run-pass/coherence/coherence_copy_like.rs rename to src/test/run-pass/coherence/coherence_copy_like.rs index c6903d911f98..f637ac649088 100644 --- a/src/test/ui/run-pass/coherence/coherence_copy_like.rs +++ b/src/test/run-pass/coherence/coherence_copy_like.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that we are able to introduce a negative constraint that // `MyType: !MyTrait` along with other "fundamental" wrappers. diff --git a/src/test/ui/run-pass/consts/auxiliary/anon-extern-mod-cross-crate-1.rs b/src/test/run-pass/consts/auxiliary/anon-extern-mod-cross-crate-1.rs similarity index 100% rename from src/test/ui/run-pass/consts/auxiliary/anon-extern-mod-cross-crate-1.rs rename to src/test/run-pass/consts/auxiliary/anon-extern-mod-cross-crate-1.rs diff --git a/src/test/ui/run-pass/consts/auxiliary/cci_borrow_lib.rs b/src/test/run-pass/consts/auxiliary/cci_borrow_lib.rs similarity index 100% rename from src/test/ui/run-pass/consts/auxiliary/cci_borrow_lib.rs rename to src/test/run-pass/consts/auxiliary/cci_borrow_lib.rs diff --git a/src/test/ui/run-pass/consts/auxiliary/cci_const.rs b/src/test/run-pass/consts/auxiliary/cci_const.rs similarity index 100% rename from src/test/ui/run-pass/consts/auxiliary/cci_const.rs rename to src/test/run-pass/consts/auxiliary/cci_const.rs diff --git a/src/test/ui/run-pass/consts/auxiliary/cci_const_block.rs b/src/test/run-pass/consts/auxiliary/cci_const_block.rs similarity index 100% rename from src/test/ui/run-pass/consts/auxiliary/cci_const_block.rs rename to src/test/run-pass/consts/auxiliary/cci_const_block.rs diff --git a/src/test/ui/run-pass/consts/auxiliary/const_fn_lib.rs b/src/test/run-pass/consts/auxiliary/const_fn_lib.rs similarity index 100% rename from src/test/ui/run-pass/consts/auxiliary/const_fn_lib.rs rename to src/test/run-pass/consts/auxiliary/const_fn_lib.rs diff --git a/src/test/ui/run-pass/consts/const-adt-align-mismatch.rs b/src/test/run-pass/consts/const-adt-align-mismatch.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-adt-align-mismatch.rs rename to src/test/run-pass/consts/const-adt-align-mismatch.rs index 10875d5046ca..057da22e270d 100644 --- a/src/test/ui/run-pass/consts/const-adt-align-mismatch.rs +++ b/src/test/run-pass/consts/const-adt-align-mismatch.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(deprecated)] use std::mem; diff --git a/src/test/ui/run-pass/consts/const-autoderef.rs b/src/test/run-pass/consts/const-autoderef.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-autoderef.rs rename to src/test/run-pass/consts/const-autoderef.rs diff --git a/src/test/ui/run-pass/consts/const-big-enum.rs b/src/test/run-pass/consts/const-big-enum.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-big-enum.rs rename to src/test/run-pass/consts/const-big-enum.rs diff --git a/src/test/ui/run-pass/consts/const-binops.rs b/src/test/run-pass/consts/const-binops.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-binops.rs rename to src/test/run-pass/consts/const-binops.rs diff --git a/src/test/ui/run-pass/consts/const-bitshift-rhs-inference.rs b/src/test/run-pass/consts/const-bitshift-rhs-inference.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-bitshift-rhs-inference.rs rename to src/test/run-pass/consts/const-bitshift-rhs-inference.rs diff --git a/src/test/ui/run-pass/consts/const-block-cross-crate-fn.rs b/src/test/run-pass/consts/const-block-cross-crate-fn.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-block-cross-crate-fn.rs rename to src/test/run-pass/consts/const-block-cross-crate-fn.rs diff --git a/src/test/ui/run-pass/consts/const-block-item-macro-codegen.rs b/src/test/run-pass/consts/const-block-item-macro-codegen.rs similarity index 98% rename from src/test/ui/run-pass/consts/const-block-item-macro-codegen.rs rename to src/test/run-pass/consts/const-block-item-macro-codegen.rs index ab452e4fe468..7a0d0781a1f9 100644 --- a/src/test/ui/run-pass/consts/const-block-item-macro-codegen.rs +++ b/src/test/run-pass/consts/const-block-item-macro-codegen.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // General test that function items in static blocks // can be generated with a macro. diff --git a/src/test/ui/run-pass/consts/const-block-item.rs b/src/test/run-pass/consts/const-block-item.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-block-item.rs rename to src/test/run-pass/consts/const-block-item.rs index fe3483ae9f0d..83e50eba6dc6 100644 --- a/src/test/ui/run-pass/consts/const-block-item.rs +++ b/src/test/run-pass/consts/const-block-item.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] mod foo { pub trait Value { diff --git a/src/test/ui/run-pass/consts/const-block.rs b/src/test/run-pass/consts/const-block.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-block.rs rename to src/test/run-pass/consts/const-block.rs diff --git a/src/test/ui/run-pass/consts/const-bound.rs b/src/test/run-pass/consts/const-bound.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-bound.rs rename to src/test/run-pass/consts/const-bound.rs index a4ac766a740f..485b87b4604c 100644 --- a/src/test/ui/run-pass/consts/const-bound.rs +++ b/src/test/run-pass/consts/const-bound.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Make sure const bounds work on things, and test that a few types // are const. diff --git a/src/test/ui/run-pass/consts/const-byte-str-cast.rs b/src/test/run-pass/consts/const-byte-str-cast.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-byte-str-cast.rs rename to src/test/run-pass/consts/const-byte-str-cast.rs diff --git a/src/test/ui/run-pass/consts/const-cast-ptr-int.rs b/src/test/run-pass/consts/const-cast-ptr-int.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-cast-ptr-int.rs rename to src/test/run-pass/consts/const-cast-ptr-int.rs diff --git a/src/test/ui/run-pass/consts/const-cast.rs b/src/test/run-pass/consts/const-cast.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-cast.rs rename to src/test/run-pass/consts/const-cast.rs diff --git a/src/test/ui/run-pass/consts/const-const.rs b/src/test/run-pass/consts/const-const.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-const.rs rename to src/test/run-pass/consts/const-const.rs diff --git a/src/test/ui/run-pass/consts/const-contents.rs b/src/test/run-pass/consts/const-contents.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-contents.rs rename to src/test/run-pass/consts/const-contents.rs diff --git a/src/test/ui/run-pass/consts/const-cross-crate-const.rs b/src/test/run-pass/consts/const-cross-crate-const.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-cross-crate-const.rs rename to src/test/run-pass/consts/const-cross-crate-const.rs diff --git a/src/test/ui/run-pass/consts/const-cross-crate-extern.rs b/src/test/run-pass/consts/const-cross-crate-extern.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-cross-crate-extern.rs rename to src/test/run-pass/consts/const-cross-crate-extern.rs diff --git a/src/test/ui/run-pass/consts/const-deref.rs b/src/test/run-pass/consts/const-deref.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-deref.rs rename to src/test/run-pass/consts/const-deref.rs diff --git a/src/test/ui/run-pass/consts/const-endianess.rs b/src/test/run-pass/consts/const-endianess.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-endianess.rs rename to src/test/run-pass/consts/const-endianess.rs diff --git a/src/test/ui/run-pass/consts/const-enum-byref-self.rs b/src/test/run-pass/consts/const-enum-byref-self.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-enum-byref-self.rs rename to src/test/run-pass/consts/const-enum-byref-self.rs index 9656bc54eb24..203ceaddfaac 100644 --- a/src/test/ui/run-pass/consts/const-enum-byref-self.rs +++ b/src/test/run-pass/consts/const-enum-byref-self.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V, VV(isize) } static C: E = E::V; diff --git a/src/test/ui/run-pass/consts/const-enum-byref.rs b/src/test/run-pass/consts/const-enum-byref.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-byref.rs rename to src/test/run-pass/consts/const-enum-byref.rs index 1e418f66c13c..29fe20523f58 100644 --- a/src/test/ui/run-pass/consts/const-enum-byref.rs +++ b/src/test/run-pass/consts/const-enum-byref.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V, VV(isize) } static C: E = E::V; diff --git a/src/test/ui/run-pass/consts/const-enum-cast.rs b/src/test/run-pass/consts/const-enum-cast.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-enum-cast.rs rename to src/test/run-pass/consts/const-enum-cast.rs index 39602153c792..ea28ac365873 100644 --- a/src/test/ui/run-pass/consts/const-enum-cast.rs +++ b/src/test/run-pass/consts/const-enum-cast.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] enum A { A1, A2 } diff --git a/src/test/ui/run-pass/consts/const-enum-ptr.rs b/src/test/run-pass/consts/const-enum-ptr.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-ptr.rs rename to src/test/run-pass/consts/const-enum-ptr.rs index 78c784e4bb3f..bc27bff4b9a5 100644 --- a/src/test/ui/run-pass/consts/const-enum-ptr.rs +++ b/src/test/run-pass/consts/const-enum-ptr.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V0, V1(isize) } static C: &'static E = &E::V0; diff --git a/src/test/ui/run-pass/consts/const-enum-struct.rs b/src/test/run-pass/consts/const-enum-struct.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-enum-struct.rs rename to src/test/run-pass/consts/const-enum-struct.rs index 4a4ad9d89e6b..01ac27b5113a 100644 --- a/src/test/ui/run-pass/consts/const-enum-struct.rs +++ b/src/test/run-pass/consts/const-enum-struct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V16(u16), V32(u32) } struct S { a: E, b: u16, c: u16 } diff --git a/src/test/ui/run-pass/consts/const-enum-struct2.rs b/src/test/run-pass/consts/const-enum-struct2.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-struct2.rs rename to src/test/run-pass/consts/const-enum-struct2.rs index c37b06f83370..d4923238a784 100644 --- a/src/test/ui/run-pass/consts/const-enum-struct2.rs +++ b/src/test/run-pass/consts/const-enum-struct2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V0, V16(u16) } struct S { a: E, b: u16, c: u16 } diff --git a/src/test/ui/run-pass/consts/const-enum-structlike.rs b/src/test/run-pass/consts/const-enum-structlike.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-enum-structlike.rs rename to src/test/run-pass/consts/const-enum-structlike.rs index a6bac3c9e7d3..17fec9391169 100644 --- a/src/test/ui/run-pass/consts/const-enum-structlike.rs +++ b/src/test/run-pass/consts/const-enum-structlike.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { S0 { s: String }, diff --git a/src/test/ui/run-pass/consts/const-enum-tuple.rs b/src/test/run-pass/consts/const-enum-tuple.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-tuple.rs rename to src/test/run-pass/consts/const-enum-tuple.rs index 2f0dcdaf9b25..a318a16c325c 100644 --- a/src/test/ui/run-pass/consts/const-enum-tuple.rs +++ b/src/test/run-pass/consts/const-enum-tuple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V16(u16), V32(u32) } static C: (E, u16, u16) = (E::V16(0xDEAD), 0x600D, 0xBAD); diff --git a/src/test/ui/run-pass/consts/const-enum-tuple2.rs b/src/test/run-pass/consts/const-enum-tuple2.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-tuple2.rs rename to src/test/run-pass/consts/const-enum-tuple2.rs index 1db56e0e6f25..916e5c3796bb 100644 --- a/src/test/ui/run-pass/consts/const-enum-tuple2.rs +++ b/src/test/run-pass/consts/const-enum-tuple2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V0, V16(u16) } static C: (E, u16, u16) = (E::V0, 0x600D, 0xBAD); diff --git a/src/test/ui/run-pass/consts/const-enum-tuplestruct.rs b/src/test/run-pass/consts/const-enum-tuplestruct.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-tuplestruct.rs rename to src/test/run-pass/consts/const-enum-tuplestruct.rs index f37ff4d9c999..343c60140804 100644 --- a/src/test/ui/run-pass/consts/const-enum-tuplestruct.rs +++ b/src/test/run-pass/consts/const-enum-tuplestruct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V16(u16), V32(u32) } struct S(E, u16, u16); diff --git a/src/test/ui/run-pass/consts/const-enum-tuplestruct2.rs b/src/test/run-pass/consts/const-enum-tuplestruct2.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-enum-tuplestruct2.rs rename to src/test/run-pass/consts/const-enum-tuplestruct2.rs index 5d6a77dddb88..68bfdb56942e 100644 --- a/src/test/ui/run-pass/consts/const-enum-tuplestruct2.rs +++ b/src/test/run-pass/consts/const-enum-tuplestruct2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { V0, V16(u16) } struct S(E, u16, u16); diff --git a/src/test/ui/run-pass/consts/const-enum-vec-index.rs b/src/test/run-pass/consts/const-enum-vec-index.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-enum-vec-index.rs rename to src/test/run-pass/consts/const-enum-vec-index.rs diff --git a/src/test/ui/run-pass/consts/const-enum-vec-ptr.rs b/src/test/run-pass/consts/const-enum-vec-ptr.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-enum-vec-ptr.rs rename to src/test/run-pass/consts/const-enum-vec-ptr.rs diff --git a/src/test/ui/run-pass/consts/const-enum-vector.rs b/src/test/run-pass/consts/const-enum-vector.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-enum-vector.rs rename to src/test/run-pass/consts/const-enum-vector.rs diff --git a/src/test/ui/run-pass/consts/const-err.rs b/src/test/run-pass/consts/const-err.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-err.rs rename to src/test/run-pass/consts/const-err.rs index 2074ee3e9081..c23440f991a8 100644 --- a/src/test/ui/run-pass/consts/const-err.rs +++ b/src/test/run-pass/consts/const-err.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // check for const_err regressions #![deny(const_err)] diff --git a/src/test/ui/run-pass/consts/const-expr-in-fixed-length-vec.rs b/src/test/run-pass/consts/const-expr-in-fixed-length-vec.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-expr-in-fixed-length-vec.rs rename to src/test/run-pass/consts/const-expr-in-fixed-length-vec.rs diff --git a/src/test/ui/run-pass/consts/const-expr-in-vec-repeat.rs b/src/test/run-pass/consts/const-expr-in-vec-repeat.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-expr-in-vec-repeat.rs rename to src/test/run-pass/consts/const-expr-in-vec-repeat.rs diff --git a/src/test/ui/run-pass/consts/const-extern-function.rs b/src/test/run-pass/consts/const-extern-function.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-extern-function.rs rename to src/test/run-pass/consts/const-extern-function.rs diff --git a/src/test/ui/run-pass/consts/const-fields-and-indexing.rs b/src/test/run-pass/consts/const-fields-and-indexing.rs similarity index 98% rename from src/test/ui/run-pass/consts/const-fields-and-indexing.rs rename to src/test/run-pass/consts/const-fields-and-indexing.rs index c0ba4404f00a..639f13931144 100644 --- a/src/test/ui/run-pass/consts/const-fields-and-indexing.rs +++ b/src/test/run-pass/consts/const-fields-and-indexing.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] const x : [isize; 4] = [1,2,3,4]; diff --git a/src/test/ui/run-pass/consts/const-fn-const-eval.rs b/src/test/run-pass/consts/const-fn-const-eval.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-fn-const-eval.rs rename to src/test/run-pass/consts/const-fn-const-eval.rs index 897073cd6233..78276f17e57d 100644 --- a/src/test/ui/run-pass/consts/const-fn-const-eval.rs +++ b/src/test/run-pass/consts/const-fn-const-eval.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(min_const_fn)] const fn add(x: usize, y: usize) -> usize { diff --git a/src/test/ui/run-pass/consts/const-fn-feature-flags.rs b/src/test/run-pass/consts/const-fn-feature-flags.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-fn-feature-flags.rs rename to src/test/run-pass/consts/const-fn-feature-flags.rs diff --git a/src/test/ui/run-pass/consts/const-fn-method.rs b/src/test/run-pass/consts/const-fn-method.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-fn-method.rs rename to src/test/run-pass/consts/const-fn-method.rs diff --git a/src/test/ui/run-pass/consts/const-fn-nested.rs b/src/test/run-pass/consts/const-fn-nested.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-fn-nested.rs rename to src/test/run-pass/consts/const-fn-nested.rs diff --git a/src/test/ui/run-pass/consts/const-fn-stability-calls.rs b/src/test/run-pass/consts/const-fn-stability-calls.rs similarity index 94% rename from src/test/ui/run-pass/consts/const-fn-stability-calls.rs rename to src/test/run-pass/consts/const-fn-stability-calls.rs index b520ebab17c2..7c6b2df0cde9 100644 --- a/src/test/ui/run-pass/consts/const-fn-stability-calls.rs +++ b/src/test/run-pass/consts/const-fn-stability-calls.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test use of const fn from another crate without a feature gate. // aux-build:const_fn_lib.rs diff --git a/src/test/ui/run-pass/consts/const-fn-val.rs b/src/test/run-pass/consts/const-fn-val.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-fn-val.rs rename to src/test/run-pass/consts/const-fn-val.rs diff --git a/src/test/ui/run-pass/consts/const-fn.rs b/src/test/run-pass/consts/const-fn.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-fn.rs rename to src/test/run-pass/consts/const-fn.rs diff --git a/src/test/ui/run-pass/consts/const-index-feature-gate.rs b/src/test/run-pass/consts/const-index-feature-gate.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-index-feature-gate.rs rename to src/test/run-pass/consts/const-index-feature-gate.rs index 3e26ea9dcae8..83ebaff3249b 100644 --- a/src/test/ui/run-pass/consts/const-index-feature-gate.rs +++ b/src/test/run-pass/consts/const-index-feature-gate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] const ARR: [usize; 1] = [2]; const ARR2: [i32; ARR[0]] = [5, 6]; diff --git a/src/test/ui/run-pass/consts/const-meth-pattern.rs b/src/test/run-pass/consts/const-meth-pattern.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-meth-pattern.rs rename to src/test/run-pass/consts/const-meth-pattern.rs diff --git a/src/test/ui/run-pass/consts/const-negation.rs b/src/test/run-pass/consts/const-negation.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-negation.rs rename to src/test/run-pass/consts/const-negation.rs diff --git a/src/test/ui/run-pass/consts/const-negative.rs b/src/test/run-pass/consts/const-negative.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-negative.rs rename to src/test/run-pass/consts/const-negative.rs diff --git a/src/test/ui/run-pass/consts/const-nullary-enum.rs b/src/test/run-pass/consts/const-nullary-enum.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-nullary-enum.rs rename to src/test/run-pass/consts/const-nullary-enum.rs index d1e359eab4e4..289717724c91 100644 --- a/src/test/ui/run-pass/consts/const-nullary-enum.rs +++ b/src/test/run-pass/consts/const-nullary-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Foo { Bar, diff --git a/src/test/ui/run-pass/consts/const-nullary-univariant-enum.rs b/src/test/run-pass/consts/const-nullary-univariant-enum.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-nullary-univariant-enum.rs rename to src/test/run-pass/consts/const-nullary-univariant-enum.rs diff --git a/src/test/ui/run-pass/consts/const-pattern-variant.rs b/src/test/run-pass/consts/const-pattern-variant.rs similarity index 96% rename from src/test/ui/run-pass/consts/const-pattern-variant.rs rename to src/test/run-pass/consts/const-pattern-variant.rs index 95e0a5a62e32..b0e91e616a08 100644 --- a/src/test/ui/run-pass/consts/const-pattern-variant.rs +++ b/src/test/run-pass/consts/const-pattern-variant.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_patterns)] #![feature(min_const_fn)] #[derive(PartialEq, Eq)] diff --git a/src/test/ui/run-pass/consts/const-rec-and-tup.rs b/src/test/run-pass/consts/const-rec-and-tup.rs similarity index 98% rename from src/test/ui/run-pass/consts/const-rec-and-tup.rs rename to src/test/run-pass/consts/const-rec-and-tup.rs index 15f74d23b6db..768aab29c1f0 100644 --- a/src/test/ui/run-pass/consts/const-rec-and-tup.rs +++ b/src/test/run-pass/consts/const-rec-and-tup.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] #![allow(overflowing_literals)] diff --git a/src/test/ui/run-pass/consts/const-region-ptrs-noncopy.rs b/src/test/run-pass/consts/const-region-ptrs-noncopy.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-region-ptrs-noncopy.rs rename to src/test/run-pass/consts/const-region-ptrs-noncopy.rs index fdbebc479900..96db2c884310 100644 --- a/src/test/ui/run-pass/consts/const-region-ptrs-noncopy.rs +++ b/src/test/run-pass/consts/const-region-ptrs-noncopy.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] type Big = [u64; 8]; diff --git a/src/test/ui/run-pass/consts/const-region-ptrs.rs b/src/test/run-pass/consts/const-region-ptrs.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-region-ptrs.rs rename to src/test/run-pass/consts/const-region-ptrs.rs diff --git a/src/test/ui/run-pass/consts/const-repeated-values.rs b/src/test/run-pass/consts/const-repeated-values.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-repeated-values.rs rename to src/test/run-pass/consts/const-repeated-values.rs diff --git a/src/test/ui/run-pass/consts/const-size_of-align_of.rs b/src/test/run-pass/consts/const-size_of-align_of.rs similarity index 98% rename from src/test/ui/run-pass/consts/const-size_of-align_of.rs rename to src/test/run-pass/consts/const-size_of-align_of.rs index 289c61ea9faa..6732e4f14c88 100644 --- a/src/test/ui/run-pass/consts/const-size_of-align_of.rs +++ b/src/test/run-pass/consts/const-size_of-align_of.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(min_const_fn)] use std::mem; diff --git a/src/test/ui/run-pass/consts/const-str-ptr.rs b/src/test/run-pass/consts/const-str-ptr.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-str-ptr.rs rename to src/test/run-pass/consts/const-str-ptr.rs index 594828118293..91ff3daa94ff 100644 --- a/src/test/ui/run-pass/consts/const-str-ptr.rs +++ b/src/test/run-pass/consts/const-str-ptr.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] use std::{str, string}; const A: [u8; 2] = ['h' as u8, 'i' as u8]; diff --git a/src/test/ui/run-pass/consts/const-struct-offsets.rs b/src/test/run-pass/consts/const-struct-offsets.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-struct-offsets.rs rename to src/test/run-pass/consts/const-struct-offsets.rs index ec77b59e09d0..a968e8aa3972 100644 --- a/src/test/ui/run-pass/consts/const-struct-offsets.rs +++ b/src/test/run-pass/consts/const-struct-offsets.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] diff --git a/src/test/ui/run-pass/consts/const-struct.rs b/src/test/run-pass/consts/const-struct.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-struct.rs rename to src/test/run-pass/consts/const-struct.rs diff --git a/src/test/ui/run-pass/consts/const-trait-to-trait.rs b/src/test/run-pass/consts/const-trait-to-trait.rs similarity index 95% rename from src/test/ui/run-pass/consts/const-trait-to-trait.rs rename to src/test/run-pass/consts/const-trait-to-trait.rs index 6b7e4972536f..fddfedec393e 100644 --- a/src/test/ui/run-pass/consts/const-trait-to-trait.rs +++ b/src/test/run-pass/consts/const-trait-to-trait.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Issue #24644 - block causes a &Trait -> &Trait coercion: trait Trait {} diff --git a/src/test/ui/run-pass/consts/const-tuple-struct.rs b/src/test/run-pass/consts/const-tuple-struct.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-tuple-struct.rs rename to src/test/run-pass/consts/const-tuple-struct.rs diff --git a/src/test/ui/run-pass/consts/const-typeid-of.rs b/src/test/run-pass/consts/const-typeid-of.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-typeid-of.rs rename to src/test/run-pass/consts/const-typeid-of.rs diff --git a/src/test/ui/run-pass/consts/const-unit-struct.rs b/src/test/run-pass/consts/const-unit-struct.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-unit-struct.rs rename to src/test/run-pass/consts/const-unit-struct.rs diff --git a/src/test/ui/run-pass/consts/const-unsafe-fn.rs b/src/test/run-pass/consts/const-unsafe-fn.rs similarity index 97% rename from src/test/ui/run-pass/consts/const-unsafe-fn.rs rename to src/test/run-pass/consts/const-unsafe-fn.rs index 6e05b0ac4d89..cb60b2fdf076 100644 --- a/src/test/ui/run-pass/consts/const-unsafe-fn.rs +++ b/src/test/run-pass/consts/const-unsafe-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // A quick test of 'unsafe const fn' functionality #![feature(min_const_fn)] diff --git a/src/test/ui/run-pass/consts/const-vec-of-fns.rs b/src/test/run-pass/consts/const-vec-of-fns.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-vec-of-fns.rs rename to src/test/run-pass/consts/const-vec-of-fns.rs diff --git a/src/test/ui/run-pass/consts/const-vec-syntax.rs b/src/test/run-pass/consts/const-vec-syntax.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-vec-syntax.rs rename to src/test/run-pass/consts/const-vec-syntax.rs diff --git a/src/test/ui/run-pass/consts/const-vecs-and-slices.rs b/src/test/run-pass/consts/const-vecs-and-slices.rs similarity index 100% rename from src/test/ui/run-pass/consts/const-vecs-and-slices.rs rename to src/test/run-pass/consts/const-vecs-and-slices.rs diff --git a/src/test/ui/run-pass/consts/const.rs b/src/test/run-pass/consts/const.rs similarity index 100% rename from src/test/ui/run-pass/consts/const.rs rename to src/test/run-pass/consts/const.rs diff --git a/src/test/ui/run-pass/consts/consts-in-patterns.rs b/src/test/run-pass/consts/consts-in-patterns.rs similarity index 100% rename from src/test/ui/run-pass/consts/consts-in-patterns.rs rename to src/test/run-pass/consts/consts-in-patterns.rs diff --git a/src/test/ui/run-pass/cross-crate/anon-extern-mod-cross-crate-2.rs b/src/test/run-pass/cross-crate/anon-extern-mod-cross-crate-2.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/anon-extern-mod-cross-crate-2.rs rename to src/test/run-pass/cross-crate/anon-extern-mod-cross-crate-2.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/anon-extern-mod-cross-crate-1.rs b/src/test/run-pass/cross-crate/auxiliary/anon-extern-mod-cross-crate-1.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/anon-extern-mod-cross-crate-1.rs rename to src/test/run-pass/cross-crate/auxiliary/anon-extern-mod-cross-crate-1.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/anon_trait_static_method_lib.rs b/src/test/run-pass/cross-crate/auxiliary/anon_trait_static_method_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/anon_trait_static_method_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/anon_trait_static_method_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_borrow_lib.rs b/src/test/run-pass/cross-crate/auxiliary/cci_borrow_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_borrow_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_borrow_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_capture_clause.rs b/src/test/run-pass/cross-crate/auxiliary/cci_capture_clause.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_capture_clause.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_capture_clause.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_const.rs b/src/test/run-pass/cross-crate/auxiliary/cci_const.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_const.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_const.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_impl_lib.rs b/src/test/run-pass/cross-crate/auxiliary/cci_impl_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_impl_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_impl_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_iter_lib.rs b/src/test/run-pass/cross-crate/auxiliary/cci_iter_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_iter_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_iter_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_nested_lib.rs b/src/test/run-pass/cross-crate/auxiliary/cci_nested_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_nested_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_nested_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/cci_no_inline_lib.rs b/src/test/run-pass/cross-crate/auxiliary/cci_no_inline_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/cci_no_inline_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/cci_no_inline_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/moves_based_on_type_lib.rs b/src/test/run-pass/cross-crate/auxiliary/moves_based_on_type_lib.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/moves_based_on_type_lib.rs rename to src/test/run-pass/cross-crate/auxiliary/moves_based_on_type_lib.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/newtype_struct_xc.rs b/src/test/run-pass/cross-crate/auxiliary/newtype_struct_xc.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/newtype_struct_xc.rs rename to src/test/run-pass/cross-crate/auxiliary/newtype_struct_xc.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/pub_static_array.rs b/src/test/run-pass/cross-crate/auxiliary/pub_static_array.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/pub_static_array.rs rename to src/test/run-pass/cross-crate/auxiliary/pub_static_array.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/reexported_static_methods.rs b/src/test/run-pass/cross-crate/auxiliary/reexported_static_methods.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/reexported_static_methods.rs rename to src/test/run-pass/cross-crate/auxiliary/reexported_static_methods.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate-trait-lifetime-param.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate-trait-lifetime-param.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate-trait-lifetime-param.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate-trait-lifetime-param.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate_address_insignificant.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate_address_insignificant.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate_address_insignificant.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate_address_insignificant.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate_associated_type_defaults.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate_associated_type_defaults.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate_associated_type_defaults.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate_associated_type_defaults.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate_static_addresses.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate_static_addresses.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate_static_addresses.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate_static_addresses.rs diff --git a/src/test/ui/run-pass/cross-crate/auxiliary/xcrate_unit_struct.rs b/src/test/run-pass/cross-crate/auxiliary/xcrate_unit_struct.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/auxiliary/xcrate_unit_struct.rs rename to src/test/run-pass/cross-crate/auxiliary/xcrate_unit_struct.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_borrow.rs b/src/test/run-pass/cross-crate/cci_borrow.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_borrow.rs rename to src/test/run-pass/cross-crate/cci_borrow.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_capture_clause.rs b/src/test/run-pass/cross-crate/cci_capture_clause.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_capture_clause.rs rename to src/test/run-pass/cross-crate/cci_capture_clause.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_impl_exe.rs b/src/test/run-pass/cross-crate/cci_impl_exe.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_impl_exe.rs rename to src/test/run-pass/cross-crate/cci_impl_exe.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_iter_exe.rs b/src/test/run-pass/cross-crate/cci_iter_exe.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_iter_exe.rs rename to src/test/run-pass/cross-crate/cci_iter_exe.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_nested_exe.rs b/src/test/run-pass/cross-crate/cci_nested_exe.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_nested_exe.rs rename to src/test/run-pass/cross-crate/cci_nested_exe.rs diff --git a/src/test/ui/run-pass/cross-crate/cci_no_inline_exe.rs b/src/test/run-pass/cross-crate/cci_no_inline_exe.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cci_no_inline_exe.rs rename to src/test/run-pass/cross-crate/cci_no_inline_exe.rs diff --git a/src/test/ui/run-pass/cross-crate/cross-crate-const-pat.rs b/src/test/run-pass/cross-crate/cross-crate-const-pat.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cross-crate-const-pat.rs rename to src/test/run-pass/cross-crate/cross-crate-const-pat.rs diff --git a/src/test/ui/run-pass/cross-crate/cross-crate-newtype-struct-pat.rs b/src/test/run-pass/cross-crate/cross-crate-newtype-struct-pat.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/cross-crate-newtype-struct-pat.rs rename to src/test/run-pass/cross-crate/cross-crate-newtype-struct-pat.rs diff --git a/src/test/ui/run-pass/cross-crate/moves-based-on-type-cross-crate.rs b/src/test/run-pass/cross-crate/moves-based-on-type-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/moves-based-on-type-cross-crate.rs rename to src/test/run-pass/cross-crate/moves-based-on-type-cross-crate.rs diff --git a/src/test/ui/run-pass/cross-crate/reexported-static-methods-cross-crate.rs b/src/test/run-pass/cross-crate/reexported-static-methods-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/reexported-static-methods-cross-crate.rs rename to src/test/run-pass/cross-crate/reexported-static-methods-cross-crate.rs diff --git a/src/test/ui/run-pass/cross-crate/static-array-across-crate.rs b/src/test/run-pass/cross-crate/static-array-across-crate.rs similarity index 97% rename from src/test/ui/run-pass/cross-crate/static-array-across-crate.rs rename to src/test/run-pass/cross-crate/static-array-across-crate.rs index c21be4ce47c7..b921ce01cfd2 100644 --- a/src/test/ui/run-pass/cross-crate/static-array-across-crate.rs +++ b/src/test/run-pass/cross-crate/static-array-across-crate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:pub_static_array.rs extern crate pub_static_array as array; diff --git a/src/test/ui/run-pass/cross-crate/xcrate-address-insignificant.rs b/src/test/run-pass/cross-crate/xcrate-address-insignificant.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/xcrate-address-insignificant.rs rename to src/test/run-pass/cross-crate/xcrate-address-insignificant.rs diff --git a/src/test/ui/run-pass/cross-crate/xcrate-associated-type-defaults.rs b/src/test/run-pass/cross-crate/xcrate-associated-type-defaults.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/xcrate-associated-type-defaults.rs rename to src/test/run-pass/cross-crate/xcrate-associated-type-defaults.rs diff --git a/src/test/ui/run-pass/cross-crate/xcrate-static-addresses.rs b/src/test/run-pass/cross-crate/xcrate-static-addresses.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/xcrate-static-addresses.rs rename to src/test/run-pass/cross-crate/xcrate-static-addresses.rs diff --git a/src/test/ui/run-pass/cross-crate/xcrate-trait-lifetime-param.rs b/src/test/run-pass/cross-crate/xcrate-trait-lifetime-param.rs similarity index 97% rename from src/test/ui/run-pass/cross-crate/xcrate-trait-lifetime-param.rs rename to src/test/run-pass/cross-crate/xcrate-trait-lifetime-param.rs index 467ee2cedb9f..70a6a052af95 100644 --- a/src/test/ui/run-pass/cross-crate/xcrate-trait-lifetime-param.rs +++ b/src/test/run-pass/cross-crate/xcrate-trait-lifetime-param.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:xcrate-trait-lifetime-param.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/cross-crate/xcrate-unit-struct.rs b/src/test/run-pass/cross-crate/xcrate-unit-struct.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/xcrate-unit-struct.rs rename to src/test/run-pass/cross-crate/xcrate-unit-struct.rs diff --git a/src/test/ui/run-pass/cross-crate/xcrate_generic_fn_nested_return.rs b/src/test/run-pass/cross-crate/xcrate_generic_fn_nested_return.rs similarity index 100% rename from src/test/ui/run-pass/cross-crate/xcrate_generic_fn_nested_return.rs rename to src/test/run-pass/cross-crate/xcrate_generic_fn_nested_return.rs diff --git a/src/test/ui/run-pass/ctfe/assoc-const.rs b/src/test/run-pass/ctfe/assoc-const.rs similarity index 96% rename from src/test/ui/run-pass/ctfe/assoc-const.rs rename to src/test/run-pass/ctfe/assoc-const.rs index cead17439261..835365820d7f 100644 --- a/src/test/ui/run-pass/ctfe/assoc-const.rs +++ b/src/test/run-pass/ctfe/assoc-const.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] trait Nat { const VALUE: usize; diff --git a/src/test/ui/run-pass/ctfe/bswap-const.rs b/src/test/run-pass/ctfe/bswap-const.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/bswap-const.rs rename to src/test/run-pass/ctfe/bswap-const.rs diff --git a/src/test/ui/run-pass/ctfe/chained-constants-stackoverflow.rs b/src/test/run-pass/ctfe/chained-constants-stackoverflow.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/chained-constants-stackoverflow.rs rename to src/test/run-pass/ctfe/chained-constants-stackoverflow.rs diff --git a/src/test/ui/run-pass/ctfe/const-block-non-item-statement-3.rs b/src/test/run-pass/ctfe/const-block-non-item-statement-3.rs similarity index 96% rename from src/test/ui/run-pass/ctfe/const-block-non-item-statement-3.rs rename to src/test/run-pass/ctfe/const-block-non-item-statement-3.rs index 09590d5f1977..0fcf9a5acbdb 100644 --- a/src/test/ui/run-pass/ctfe/const-block-non-item-statement-3.rs +++ b/src/test/run-pass/ctfe/const-block-non-item-statement-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(const_let)] diff --git a/src/test/ui/run-pass/ctfe/const-block-non-item-statement.rs b/src/test/run-pass/ctfe/const-block-non-item-statement.rs similarity index 96% rename from src/test/ui/run-pass/ctfe/const-block-non-item-statement.rs rename to src/test/run-pass/ctfe/const-block-non-item-statement.rs index 5490bd4d3ad8..b7ed8af35d4c 100644 --- a/src/test/ui/run-pass/ctfe/const-block-non-item-statement.rs +++ b/src/test/run-pass/ctfe/const-block-non-item-statement.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(const_let)] diff --git a/src/test/ui/run-pass/ctfe/const-fn-destructuring-arg.rs b/src/test/run-pass/ctfe/const-fn-destructuring-arg.rs similarity index 97% rename from src/test/ui/run-pass/ctfe/const-fn-destructuring-arg.rs rename to src/test/run-pass/ctfe/const-fn-destructuring-arg.rs index 323232acc675..88f0d0714f9a 100644 --- a/src/test/ui/run-pass/ctfe/const-fn-destructuring-arg.rs +++ b/src/test/run-pass/ctfe/const-fn-destructuring-arg.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // test that certain things are disallowed in constant functions diff --git a/src/test/ui/run-pass/ctfe/deref_in_pattern.rs b/src/test/run-pass/ctfe/deref_in_pattern.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/deref_in_pattern.rs rename to src/test/run-pass/ctfe/deref_in_pattern.rs diff --git a/src/test/ui/run-pass/ctfe/ice-48279.rs b/src/test/run-pass/ctfe/ice-48279.rs similarity index 95% rename from src/test/ui/run-pass/ctfe/ice-48279.rs rename to src/test/run-pass/ctfe/ice-48279.rs index 34b7b56f274a..40fdcda355fa 100644 --- a/src/test/ui/run-pass/ctfe/ice-48279.rs +++ b/src/test/run-pass/ctfe/ice-48279.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_unsafe)] // https://github.com/rust-lang/rust/issues/48279 diff --git a/src/test/ui/run-pass/ctfe/issue-37550.rs b/src/test/run-pass/ctfe/issue-37550.rs similarity index 92% rename from src/test/ui/run-pass/ctfe/issue-37550.rs rename to src/test/run-pass/ctfe/issue-37550.rs index 21c4ec2c09ec..54e0e83efed3 100644 --- a/src/test/ui/run-pass/ctfe/issue-37550.rs +++ b/src/test/run-pass/ctfe/issue-37550.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![feature(const_fn, const_let)] diff --git a/src/test/ui/run-pass/ctfe/issue-broken-mir.rs b/src/test/run-pass/ctfe/issue-broken-mir.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/issue-broken-mir.rs rename to src/test/run-pass/ctfe/issue-broken-mir.rs diff --git a/src/test/ui/run-pass/ctfe/locals-in-const-fn.rs b/src/test/run-pass/ctfe/locals-in-const-fn.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/locals-in-const-fn.rs rename to src/test/run-pass/ctfe/locals-in-const-fn.rs diff --git a/src/test/ui/run-pass/ctfe/match-const-fn-structs.rs b/src/test/run-pass/ctfe/match-const-fn-structs.rs similarity index 96% rename from src/test/ui/run-pass/ctfe/match-const-fn-structs.rs rename to src/test/run-pass/ctfe/match-const-fn-structs.rs index 6c829f142dd0..1c6d72d530f0 100644 --- a/src/test/ui/run-pass/ctfe/match-const-fn-structs.rs +++ b/src/test/run-pass/ctfe/match-const-fn-structs.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // https://github.com/rust-lang/rust/issues/46114 diff --git a/src/test/ui/run-pass/ctfe/mozjs-error.rs b/src/test/run-pass/ctfe/mozjs-error.rs similarity index 98% rename from src/test/ui/run-pass/ctfe/mozjs-error.rs rename to src/test/run-pass/ctfe/mozjs-error.rs index ea200ba738fb..f79fbe72bdf9 100644 --- a/src/test/ui/run-pass/ctfe/mozjs-error.rs +++ b/src/test/run-pass/ctfe/mozjs-error.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] struct CustomAutoRooterVFTable { diff --git a/src/test/ui/run-pass/ctfe/non-scalar-cast.rs b/src/test/run-pass/ctfe/non-scalar-cast.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/non-scalar-cast.rs rename to src/test/run-pass/ctfe/non-scalar-cast.rs diff --git a/src/test/ui/run-pass/ctfe/promotion.rs b/src/test/run-pass/ctfe/promotion.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/promotion.rs rename to src/test/run-pass/ctfe/promotion.rs diff --git a/src/test/ui/run-pass/ctfe/references.rs b/src/test/run-pass/ctfe/references.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/references.rs rename to src/test/run-pass/ctfe/references.rs diff --git a/src/test/ui/run-pass/ctfe/repeat_match.rs b/src/test/run-pass/ctfe/repeat_match.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/repeat_match.rs rename to src/test/run-pass/ctfe/repeat_match.rs diff --git a/src/test/ui/run-pass/ctfe/return-in-const-fn.rs b/src/test/run-pass/ctfe/return-in-const-fn.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/return-in-const-fn.rs rename to src/test/run-pass/ctfe/return-in-const-fn.rs diff --git a/src/test/ui/run-pass/ctfe/signed_enum_discr.rs b/src/test/run-pass/ctfe/signed_enum_discr.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/signed_enum_discr.rs rename to src/test/run-pass/ctfe/signed_enum_discr.rs diff --git a/src/test/ui/run-pass/ctfe/transmute-const.rs b/src/test/run-pass/ctfe/transmute-const.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/transmute-const.rs rename to src/test/run-pass/ctfe/transmute-const.rs diff --git a/src/test/ui/run-pass/ctfe/tuple-struct-constructors.rs b/src/test/run-pass/ctfe/tuple-struct-constructors.rs similarity index 100% rename from src/test/ui/run-pass/ctfe/tuple-struct-constructors.rs rename to src/test/run-pass/ctfe/tuple-struct-constructors.rs diff --git a/src/test/ui/run-pass/deriving/auxiliary/derive-no-std.rs b/src/test/run-pass/deriving/auxiliary/derive-no-std.rs similarity index 100% rename from src/test/ui/run-pass/deriving/auxiliary/derive-no-std.rs rename to src/test/run-pass/deriving/auxiliary/derive-no-std.rs diff --git a/src/test/ui/run-pass/deriving/derive-no-std.rs b/src/test/run-pass/deriving/derive-no-std.rs similarity index 100% rename from src/test/ui/run-pass/deriving/derive-no-std.rs rename to src/test/run-pass/deriving/derive-no-std.rs diff --git a/src/test/ui/run-pass/deriving/derive-partialord-correctness.rs b/src/test/run-pass/deriving/derive-partialord-correctness.rs similarity index 100% rename from src/test/ui/run-pass/deriving/derive-partialord-correctness.rs rename to src/test/run-pass/deriving/derive-partialord-correctness.rs diff --git a/src/test/ui/run-pass/deriving/deriving-associated-types.rs b/src/test/run-pass/deriving/deriving-associated-types.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-associated-types.rs rename to src/test/run-pass/deriving/deriving-associated-types.rs diff --git a/src/test/ui/run-pass/deriving/deriving-bounds.rs b/src/test/run-pass/deriving/deriving-bounds.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-bounds.rs rename to src/test/run-pass/deriving/deriving-bounds.rs diff --git a/src/test/ui/run-pass/deriving/deriving-clone-array.rs b/src/test/run-pass/deriving/deriving-clone-array.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-clone-array.rs rename to src/test/run-pass/deriving/deriving-clone-array.rs index 2d3be810def9..916488fcbe9d 100644 --- a/src/test/ui/run-pass/deriving/deriving-clone-array.rs +++ b/src/test/run-pass/deriving/deriving-clone-array.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // test for issue #30244 #[derive(Copy, Clone)] diff --git a/src/test/ui/run-pass/deriving/deriving-clone-enum.rs b/src/test/run-pass/deriving/deriving-clone-enum.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-clone-enum.rs rename to src/test/run-pass/deriving/deriving-clone-enum.rs index cf924e0ff5ed..09a0a6fdeae1 100644 --- a/src/test/ui/run-pass/deriving/deriving-clone-enum.rs +++ b/src/test/run-pass/deriving/deriving-clone-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #[derive(Clone)] diff --git a/src/test/ui/run-pass/deriving/deriving-clone-generic-enum.rs b/src/test/run-pass/deriving/deriving-clone-generic-enum.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-clone-generic-enum.rs rename to src/test/run-pass/deriving/deriving-clone-generic-enum.rs index 2b1ace396a74..74258411d7fd 100644 --- a/src/test/ui/run-pass/deriving/deriving-clone-generic-enum.rs +++ b/src/test/run-pass/deriving/deriving-clone-generic-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #[derive(Clone)] diff --git a/src/test/ui/run-pass/deriving/deriving-clone-generic-struct.rs b/src/test/run-pass/deriving/deriving-clone-generic-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-clone-generic-struct.rs rename to src/test/run-pass/deriving/deriving-clone-generic-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-clone-generic-tuple-struct.rs b/src/test/run-pass/deriving/deriving-clone-generic-tuple-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-clone-generic-tuple-struct.rs rename to src/test/run-pass/deriving/deriving-clone-generic-tuple-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-clone-struct.rs b/src/test/run-pass/deriving/deriving-clone-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-clone-struct.rs rename to src/test/run-pass/deriving/deriving-clone-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-clone-tuple-struct.rs b/src/test/run-pass/deriving/deriving-clone-tuple-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-clone-tuple-struct.rs rename to src/test/run-pass/deriving/deriving-clone-tuple-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-cmp-generic-enum.rs b/src/test/run-pass/deriving/deriving-cmp-generic-enum.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-cmp-generic-enum.rs rename to src/test/run-pass/deriving/deriving-cmp-generic-enum.rs diff --git a/src/test/ui/run-pass/deriving/deriving-cmp-generic-struct-enum.rs b/src/test/run-pass/deriving/deriving-cmp-generic-struct-enum.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-cmp-generic-struct-enum.rs rename to src/test/run-pass/deriving/deriving-cmp-generic-struct-enum.rs diff --git a/src/test/ui/run-pass/deriving/deriving-cmp-generic-struct.rs b/src/test/run-pass/deriving/deriving-cmp-generic-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-cmp-generic-struct.rs rename to src/test/run-pass/deriving/deriving-cmp-generic-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-cmp-generic-tuple-struct.rs b/src/test/run-pass/deriving/deriving-cmp-generic-tuple-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-cmp-generic-tuple-struct.rs rename to src/test/run-pass/deriving/deriving-cmp-generic-tuple-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-cmp-shortcircuit.rs b/src/test/run-pass/deriving/deriving-cmp-shortcircuit.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-cmp-shortcircuit.rs rename to src/test/run-pass/deriving/deriving-cmp-shortcircuit.rs diff --git a/src/test/ui/run-pass/deriving/deriving-copyclone.rs b/src/test/run-pass/deriving/deriving-copyclone.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-copyclone.rs rename to src/test/run-pass/deriving/deriving-copyclone.rs diff --git a/src/test/ui/run-pass/deriving/deriving-default-box.rs b/src/test/run-pass/deriving/deriving-default-box.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-default-box.rs rename to src/test/run-pass/deriving/deriving-default-box.rs diff --git a/src/test/ui/run-pass/deriving/deriving-enum-single-variant.rs b/src/test/run-pass/deriving/deriving-enum-single-variant.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-enum-single-variant.rs rename to src/test/run-pass/deriving/deriving-enum-single-variant.rs diff --git a/src/test/ui/run-pass/deriving/deriving-eq-ord-boxed-slice.rs b/src/test/run-pass/deriving/deriving-eq-ord-boxed-slice.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-eq-ord-boxed-slice.rs rename to src/test/run-pass/deriving/deriving-eq-ord-boxed-slice.rs diff --git a/src/test/ui/run-pass/deriving/deriving-hash.rs b/src/test/run-pass/deriving/deriving-hash.rs similarity index 97% rename from src/test/ui/run-pass/deriving/deriving-hash.rs rename to src/test/run-pass/deriving/deriving-hash.rs index aec8a7075a51..e149e0e1e0ea 100644 --- a/src/test/ui/run-pass/deriving/deriving-hash.rs +++ b/src/test/run-pass/deriving/deriving-hash.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] #![allow(deprecated)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/deriving/deriving-in-fn.rs b/src/test/run-pass/deriving/deriving-in-fn.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-in-fn.rs rename to src/test/run-pass/deriving/deriving-in-fn.rs diff --git a/src/test/ui/run-pass/deriving/deriving-in-macro.rs b/src/test/run-pass/deriving/deriving-in-macro.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-in-macro.rs rename to src/test/run-pass/deriving/deriving-in-macro.rs diff --git a/src/test/ui/run-pass/deriving/deriving-meta-multiple.rs b/src/test/run-pass/deriving/deriving-meta-multiple.rs similarity index 95% rename from src/test/ui/run-pass/deriving/deriving-meta-multiple.rs rename to src/test/run-pass/deriving/deriving-meta-multiple.rs index 33f98a74b142..326a95bdf027 100644 --- a/src/test/ui/run-pass/deriving/deriving-meta-multiple.rs +++ b/src/test/run-pass/deriving/deriving-meta-multiple.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_imports)] // pretty-expanded FIXME #23616 #![allow(deprecated)] diff --git a/src/test/ui/run-pass/deriving/deriving-meta.rs b/src/test/run-pass/deriving/deriving-meta.rs similarity index 94% rename from src/test/ui/run-pass/deriving/deriving-meta.rs rename to src/test/run-pass/deriving/deriving-meta.rs index 309cd5aed1db..cf016f3e0c68 100644 --- a/src/test/ui/run-pass/deriving/deriving-meta.rs +++ b/src/test/run-pass/deriving/deriving-meta.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_imports)] // pretty-expanded FIXME #23616 #![allow(deprecated)] diff --git a/src/test/ui/run-pass/deriving/deriving-self-lifetime-totalord-totaleq.rs b/src/test/run-pass/deriving/deriving-self-lifetime-totalord-totaleq.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-self-lifetime-totalord-totaleq.rs rename to src/test/run-pass/deriving/deriving-self-lifetime-totalord-totaleq.rs diff --git a/src/test/ui/run-pass/deriving/deriving-show-2.rs b/src/test/run-pass/deriving/deriving-show-2.rs similarity index 98% rename from src/test/ui/run-pass/deriving/deriving-show-2.rs rename to src/test/run-pass/deriving/deriving-show-2.rs index 3a1f40239c85..d5f2535cb706 100644 --- a/src/test/ui/run-pass/deriving/deriving-show-2.rs +++ b/src/test/run-pass/deriving/deriving-show-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::fmt; #[derive(Debug)] diff --git a/src/test/ui/run-pass/deriving/deriving-show.rs b/src/test/run-pass/deriving/deriving-show.rs similarity index 98% rename from src/test/ui/run-pass/deriving/deriving-show.rs rename to src/test/run-pass/deriving/deriving-show.rs index f19b014067d6..000cbe9fa090 100644 --- a/src/test/ui/run-pass/deriving/deriving-show.rs +++ b/src/test/run-pass/deriving/deriving-show.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug)] struct Unit; diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-c-enum.rs b/src/test/run-pass/deriving/deriving-via-extension-c-enum.rs similarity index 97% rename from src/test/ui/run-pass/deriving/deriving-via-extension-c-enum.rs rename to src/test/run-pass/deriving/deriving-via-extension-c-enum.rs index 445545aaa0f2..a3d4e179731a 100644 --- a/src/test/ui/run-pass/deriving/deriving-via-extension-c-enum.rs +++ b/src/test/run-pass/deriving/deriving-via-extension-c-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(PartialEq, Debug)] enum Foo { Bar, diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-enum.rs b/src/test/run-pass/deriving/deriving-via-extension-enum.rs similarity index 97% rename from src/test/ui/run-pass/deriving/deriving-via-extension-enum.rs rename to src/test/run-pass/deriving/deriving-via-extension-enum.rs index 5b00f11a901b..8afce9a9e475 100644 --- a/src/test/ui/run-pass/deriving/deriving-via-extension-enum.rs +++ b/src/test/run-pass/deriving/deriving-via-extension-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(PartialEq, Debug)] enum Foo { Bar(isize, isize), diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-hash-enum.rs b/src/test/run-pass/deriving/deriving-via-extension-hash-enum.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-via-extension-hash-enum.rs rename to src/test/run-pass/deriving/deriving-via-extension-hash-enum.rs index fe2716396d8b..be44fc4d0576 100644 --- a/src/test/ui/run-pass/deriving/deriving-via-extension-hash-enum.rs +++ b/src/test/run-pass/deriving/deriving-via-extension-hash-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Hash)] enum Foo { Bar(isize, char), diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-hash-struct.rs b/src/test/run-pass/deriving/deriving-via-extension-hash-struct.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-via-extension-hash-struct.rs rename to src/test/run-pass/deriving/deriving-via-extension-hash-struct.rs index 2178673cac81..17133f696750 100644 --- a/src/test/ui/run-pass/deriving/deriving-via-extension-hash-struct.rs +++ b/src/test/run-pass/deriving/deriving-via-extension-hash-struct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #[derive(Hash)] diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-struct-empty.rs b/src/test/run-pass/deriving/deriving-via-extension-struct-empty.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-via-extension-struct-empty.rs rename to src/test/run-pass/deriving/deriving-via-extension-struct-empty.rs diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs b/src/test/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs similarity index 96% rename from src/test/ui/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs rename to src/test/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs index 67a1472e8838..babe99b3c56e 100644 --- a/src/test/ui/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs +++ b/src/test/run-pass/deriving/deriving-via-extension-struct-like-enum-variant.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(PartialEq, Debug)] enum S { X { x: isize, y: isize }, diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-struct-tuple.rs b/src/test/run-pass/deriving/deriving-via-extension-struct-tuple.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-via-extension-struct-tuple.rs rename to src/test/run-pass/deriving/deriving-via-extension-struct-tuple.rs diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-struct.rs b/src/test/run-pass/deriving/deriving-via-extension-struct.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-via-extension-struct.rs rename to src/test/run-pass/deriving/deriving-via-extension-struct.rs diff --git a/src/test/ui/run-pass/deriving/deriving-via-extension-type-params.rs b/src/test/run-pass/deriving/deriving-via-extension-type-params.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-via-extension-type-params.rs rename to src/test/run-pass/deriving/deriving-via-extension-type-params.rs diff --git a/src/test/ui/run-pass/deriving/deriving-with-repr-packed.rs b/src/test/run-pass/deriving/deriving-with-repr-packed.rs similarity index 100% rename from src/test/ui/run-pass/deriving/deriving-with-repr-packed.rs rename to src/test/run-pass/deriving/deriving-with-repr-packed.rs diff --git a/src/test/ui/run-pass/drop/auxiliary/dropck_eyepatch_extern_crate.rs b/src/test/run-pass/drop/auxiliary/dropck_eyepatch_extern_crate.rs similarity index 100% rename from src/test/ui/run-pass/drop/auxiliary/dropck_eyepatch_extern_crate.rs rename to src/test/run-pass/drop/auxiliary/dropck_eyepatch_extern_crate.rs diff --git a/src/test/ui/run-pass/drop/drop-on-empty-block-exit.rs b/src/test/run-pass/drop/drop-on-empty-block-exit.rs similarity index 100% rename from src/test/ui/run-pass/drop/drop-on-empty-block-exit.rs rename to src/test/run-pass/drop/drop-on-empty-block-exit.rs diff --git a/src/test/ui/run-pass/drop/drop-on-ret.rs b/src/test/run-pass/drop/drop-on-ret.rs similarity index 100% rename from src/test/ui/run-pass/drop/drop-on-ret.rs rename to src/test/run-pass/drop/drop-on-ret.rs diff --git a/src/test/ui/run-pass/drop/drop-struct-as-object.rs b/src/test/run-pass/drop/drop-struct-as-object.rs similarity index 97% rename from src/test/ui/run-pass/drop/drop-struct-as-object.rs rename to src/test/run-pass/drop/drop-struct-as-object.rs index 97ec423643c1..b171c1c3a06d 100644 --- a/src/test/ui/run-pass/drop/drop-struct-as-object.rs +++ b/src/test/run-pass/drop/drop-struct-as-object.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(non_upper_case_globals)] // Test that destructor on a struct runs successfully after the struct diff --git a/src/test/ui/run-pass/drop/drop-trait-enum.rs b/src/test/run-pass/drop/drop-trait-enum.rs similarity index 97% rename from src/test/ui/run-pass/drop/drop-trait-enum.rs rename to src/test/run-pass/drop/drop-trait-enum.rs index 4d3cf2bd0533..a34e922a6065 100644 --- a/src/test/ui/run-pass/drop/drop-trait-enum.rs +++ b/src/test/run-pass/drop/drop-trait-enum.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] +#![allow(unused_variables)] // ignore-emscripten no threads support #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/drop/drop-trait-generic.rs b/src/test/run-pass/drop/drop-trait-generic.rs similarity index 96% rename from src/test/ui/run-pass/drop/drop-trait-generic.rs rename to src/test/run-pass/drop/drop-trait-generic.rs index c09482a45409..fc1c0baf4b4b 100644 --- a/src/test/ui/run-pass/drop/drop-trait-generic.rs +++ b/src/test/run-pass/drop/drop-trait-generic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S { x: T } diff --git a/src/test/ui/run-pass/drop/drop-trait.rs b/src/test/run-pass/drop/drop-trait.rs similarity index 96% rename from src/test/ui/run-pass/drop/drop-trait.rs rename to src/test/run-pass/drop/drop-trait.rs index 2e867ac0fc09..61ce68037ce5 100644 --- a/src/test/ui/run-pass/drop/drop-trait.rs +++ b/src/test/run-pass/drop/drop-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Foo { x: isize } diff --git a/src/test/ui/run-pass/drop/drop-uninhabited-enum.rs b/src/test/run-pass/drop/drop-uninhabited-enum.rs similarity index 92% rename from src/test/ui/run-pass/drop/drop-uninhabited-enum.rs rename to src/test/run-pass/drop/drop-uninhabited-enum.rs index 6fb0abd96439..6ff17a33d4a4 100644 --- a/src/test/ui/run-pass/drop/drop-uninhabited-enum.rs +++ b/src/test/run-pass/drop/drop-uninhabited-enum.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 enum Foo { } diff --git a/src/test/ui/run-pass/drop/drop-with-type-ascription-1.rs b/src/test/run-pass/drop/drop-with-type-ascription-1.rs similarity index 100% rename from src/test/ui/run-pass/drop/drop-with-type-ascription-1.rs rename to src/test/run-pass/drop/drop-with-type-ascription-1.rs diff --git a/src/test/ui/run-pass/drop/drop-with-type-ascription-2.rs b/src/test/run-pass/drop/drop-with-type-ascription-2.rs similarity index 100% rename from src/test/ui/run-pass/drop/drop-with-type-ascription-2.rs rename to src/test/run-pass/drop/drop-with-type-ascription-2.rs diff --git a/src/test/ui/run-pass/drop/dropck-eyepatch-extern-crate.rs b/src/test/run-pass/drop/dropck-eyepatch-extern-crate.rs similarity index 100% rename from src/test/ui/run-pass/drop/dropck-eyepatch-extern-crate.rs rename to src/test/run-pass/drop/dropck-eyepatch-extern-crate.rs diff --git a/src/test/ui/run-pass/drop/dropck-eyepatch-reorder.rs b/src/test/run-pass/drop/dropck-eyepatch-reorder.rs similarity index 100% rename from src/test/ui/run-pass/drop/dropck-eyepatch-reorder.rs rename to src/test/run-pass/drop/dropck-eyepatch-reorder.rs diff --git a/src/test/ui/run-pass/drop/dropck-eyepatch.rs b/src/test/run-pass/drop/dropck-eyepatch.rs similarity index 100% rename from src/test/ui/run-pass/drop/dropck-eyepatch.rs rename to src/test/run-pass/drop/dropck-eyepatch.rs diff --git a/src/test/ui/run-pass/drop/dropck_legal_cycles.rs b/src/test/run-pass/drop/dropck_legal_cycles.rs similarity index 100% rename from src/test/ui/run-pass/drop/dropck_legal_cycles.rs rename to src/test/run-pass/drop/dropck_legal_cycles.rs diff --git a/src/test/ui/run-pass/drop/dynamic-drop.rs b/src/test/run-pass/drop/dynamic-drop.rs similarity index 99% rename from src/test/ui/run-pass/drop/dynamic-drop.rs rename to src/test/run-pass/drop/dynamic-drop.rs index de10c9f2403c..8fecaa2a109a 100644 --- a/src/test/ui/run-pass/drop/dynamic-drop.rs +++ b/src/test/run-pass/drop/dynamic-drop.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] // revisions:lexical nll #![cfg_attr(nll, feature(nll))] diff --git a/src/test/ui/run-pass/drop/no-drop-flag-size.rs b/src/test/run-pass/drop/no-drop-flag-size.rs similarity index 96% rename from src/test/ui/run-pass/drop/no-drop-flag-size.rs rename to src/test/run-pass/drop/no-drop-flag-size.rs index abaaf7d701ea..a8fa202e3b5e 100644 --- a/src/test/ui/run-pass/drop/no-drop-flag-size.rs +++ b/src/test/run-pass/drop/no-drop-flag-size.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem::size_of; struct Test { diff --git a/src/test/ui/run-pass/drop/nondrop-cycle.rs b/src/test/run-pass/drop/nondrop-cycle.rs similarity index 100% rename from src/test/ui/run-pass/drop/nondrop-cycle.rs rename to src/test/run-pass/drop/nondrop-cycle.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-coerce-custom.rs b/src/test/run-pass/dynamically-sized-types/dst-coerce-custom.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-coerce-custom.rs rename to src/test/run-pass/dynamically-sized-types/dst-coerce-custom.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-coerce-rc.rs b/src/test/run-pass/dynamically-sized-types/dst-coerce-rc.rs similarity index 97% rename from src/test/ui/run-pass/dynamically-sized-types/dst-coerce-rc.rs rename to src/test/run-pass/dynamically-sized-types/dst-coerce-rc.rs index fb7b2bc8bf7f..64ec31433561 100644 --- a/src/test/ui/run-pass/dynamically-sized-types/dst-coerce-rc.rs +++ b/src/test/run-pass/dynamically-sized-types/dst-coerce-rc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(stable_features)] // Test a very simple custom DST coercion. diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-coercions.rs b/src/test/run-pass/dynamically-sized-types/dst-coercions.rs similarity index 97% rename from src/test/ui/run-pass/dynamically-sized-types/dst-coercions.rs rename to src/test/run-pass/dynamically-sized-types/dst-coercions.rs index 21170403d43c..10a59599b40e 100644 --- a/src/test/ui/run-pass/dynamically-sized-types/dst-coercions.rs +++ b/src/test/run-pass/dynamically-sized-types/dst-coercions.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test coercions involving DST and/or raw pointers // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-deref-mut.rs b/src/test/run-pass/dynamically-sized-types/dst-deref-mut.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-deref-mut.rs rename to src/test/run-pass/dynamically-sized-types/dst-deref-mut.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-deref.rs b/src/test/run-pass/dynamically-sized-types/dst-deref.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-deref.rs rename to src/test/run-pass/dynamically-sized-types/dst-deref.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-field-align.rs b/src/test/run-pass/dynamically-sized-types/dst-field-align.rs similarity index 98% rename from src/test/ui/run-pass/dynamically-sized-types/dst-field-align.rs rename to src/test/run-pass/dynamically-sized-types/dst-field-align.rs index 1537050593c4..84f023371109 100644 --- a/src/test/ui/run-pass/dynamically-sized-types/dst-field-align.rs +++ b/src/test/run-pass/dynamically-sized-types/dst-field-align.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Foo { a: u16, b: T diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-index.rs b/src/test/run-pass/dynamically-sized-types/dst-index.rs similarity index 97% rename from src/test/ui/run-pass/dynamically-sized-types/dst-index.rs rename to src/test/run-pass/dynamically-sized-types/dst-index.rs index 56323816b4c3..7dd5c1937958 100644 --- a/src/test/ui/run-pass/dynamically-sized-types/dst-index.rs +++ b/src/test/run-pass/dynamically-sized-types/dst-index.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that overloaded index expressions with DST result types // work and don't ICE. diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-irrefutable-bind.rs b/src/test/run-pass/dynamically-sized-types/dst-irrefutable-bind.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-irrefutable-bind.rs rename to src/test/run-pass/dynamically-sized-types/dst-irrefutable-bind.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-raw.rs b/src/test/run-pass/dynamically-sized-types/dst-raw.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-raw.rs rename to src/test/run-pass/dynamically-sized-types/dst-raw.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-struct-sole.rs b/src/test/run-pass/dynamically-sized-types/dst-struct-sole.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-struct-sole.rs rename to src/test/run-pass/dynamically-sized-types/dst-struct-sole.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-struct.rs b/src/test/run-pass/dynamically-sized-types/dst-struct.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-struct.rs rename to src/test/run-pass/dynamically-sized-types/dst-struct.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-trait-tuple.rs b/src/test/run-pass/dynamically-sized-types/dst-trait-tuple.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-trait-tuple.rs rename to src/test/run-pass/dynamically-sized-types/dst-trait-tuple.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-trait.rs b/src/test/run-pass/dynamically-sized-types/dst-trait.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-trait.rs rename to src/test/run-pass/dynamically-sized-types/dst-trait.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-tuple-sole.rs b/src/test/run-pass/dynamically-sized-types/dst-tuple-sole.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-tuple-sole.rs rename to src/test/run-pass/dynamically-sized-types/dst-tuple-sole.rs diff --git a/src/test/ui/run-pass/dynamically-sized-types/dst-tuple.rs b/src/test/run-pass/dynamically-sized-types/dst-tuple.rs similarity index 100% rename from src/test/ui/run-pass/dynamically-sized-types/dst-tuple.rs rename to src/test/run-pass/dynamically-sized-types/dst-tuple.rs diff --git a/src/test/ui/run-pass/extern/auxiliary/extern-crosscrate-source.rs b/src/test/run-pass/extern/auxiliary/extern-crosscrate-source.rs similarity index 100% rename from src/test/ui/run-pass/extern/auxiliary/extern-crosscrate-source.rs rename to src/test/run-pass/extern/auxiliary/extern-crosscrate-source.rs diff --git a/src/test/ui/run-pass/extern/auxiliary/extern-take-value.rs b/src/test/run-pass/extern/auxiliary/extern-take-value.rs similarity index 100% rename from src/test/ui/run-pass/extern/auxiliary/extern-take-value.rs rename to src/test/run-pass/extern/auxiliary/extern-take-value.rs diff --git a/src/test/ui/run-pass/extern/auxiliary/extern_calling_convention.rs b/src/test/run-pass/extern/auxiliary/extern_calling_convention.rs similarity index 100% rename from src/test/ui/run-pass/extern/auxiliary/extern_calling_convention.rs rename to src/test/run-pass/extern/auxiliary/extern_calling_convention.rs diff --git a/src/test/ui/run-pass/extern/auxiliary/extern_mod_ordering_lib.rs b/src/test/run-pass/extern/auxiliary/extern_mod_ordering_lib.rs similarity index 100% rename from src/test/ui/run-pass/extern/auxiliary/extern_mod_ordering_lib.rs rename to src/test/run-pass/extern/auxiliary/extern_mod_ordering_lib.rs diff --git a/src/test/ui/run-pass/extern/auxiliary/fat_drop.rs b/src/test/run-pass/extern/auxiliary/fat_drop.rs similarity index 100% rename from src/test/ui/run-pass/extern/auxiliary/fat_drop.rs rename to src/test/run-pass/extern/auxiliary/fat_drop.rs diff --git a/src/test/ui/run-pass/extern/extern-1.rs b/src/test/run-pass/extern/extern-1.rs similarity index 96% rename from src/test/ui/run-pass/extern/extern-1.rs rename to src/test/run-pass/extern/extern-1.rs index c3168aaf869b..f468da4a449d 100644 --- a/src/test/ui/run-pass/extern/extern-1.rs +++ b/src/test/run-pass/extern/extern-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 extern fn f() { diff --git a/src/test/ui/run-pass/extern/extern-call-deep.rs b/src/test/run-pass/extern/extern-call-deep.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-call-deep.rs rename to src/test/run-pass/extern/extern-call-deep.rs diff --git a/src/test/ui/run-pass/extern/extern-call-deep2.rs b/src/test/run-pass/extern/extern-call-deep2.rs similarity index 98% rename from src/test/ui/run-pass/extern/extern-call-deep2.rs rename to src/test/run-pass/extern/extern-call-deep2.rs index e11e73a2b0fa..28157c5a8d5e 100644 --- a/src/test/ui/run-pass/extern/extern-call-deep2.rs +++ b/src/test/run-pass/extern/extern-call-deep2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support #![feature(libc)] diff --git a/src/test/ui/run-pass/extern/extern-call-direct.rs b/src/test/run-pass/extern/extern-call-direct.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-call-direct.rs rename to src/test/run-pass/extern/extern-call-direct.rs diff --git a/src/test/ui/run-pass/extern/extern-call-indirect.rs b/src/test/run-pass/extern/extern-call-indirect.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-call-indirect.rs rename to src/test/run-pass/extern/extern-call-indirect.rs diff --git a/src/test/ui/run-pass/extern/extern-call-scrub.rs b/src/test/run-pass/extern/extern-call-scrub.rs similarity index 98% rename from src/test/ui/run-pass/extern/extern-call-scrub.rs rename to src/test/run-pass/extern/extern-call-scrub.rs index 1e564e668713..ea18069fa32f 100644 --- a/src/test/ui/run-pass/extern/extern-call-scrub.rs +++ b/src/test/run-pass/extern/extern-call-scrub.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // This time we're testing repeatedly going up and down both stacks to // make sure the stack pointers are maintained properly in both // directions diff --git a/src/test/ui/run-pass/extern/extern-calling-convention-test.rs b/src/test/run-pass/extern/extern-calling-convention-test.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-calling-convention-test.rs rename to src/test/run-pass/extern/extern-calling-convention-test.rs diff --git a/src/test/ui/run-pass/extern/extern-compare-with-return-type.rs b/src/test/run-pass/extern/extern-compare-with-return-type.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-compare-with-return-type.rs rename to src/test/run-pass/extern/extern-compare-with-return-type.rs diff --git a/src/test/ui/run-pass/extern/extern-crosscrate.rs b/src/test/run-pass/extern/extern-crosscrate.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-crosscrate.rs rename to src/test/run-pass/extern/extern-crosscrate.rs diff --git a/src/test/ui/run-pass/extern/extern-foreign-crate.rs b/src/test/run-pass/extern/extern-foreign-crate.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-foreign-crate.rs rename to src/test/run-pass/extern/extern-foreign-crate.rs diff --git a/src/test/ui/run-pass/extern/extern-methods.rs b/src/test/run-pass/extern/extern-methods.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-methods.rs rename to src/test/run-pass/extern/extern-methods.rs diff --git a/src/test/ui/run-pass/extern/extern-mod-abi.rs b/src/test/run-pass/extern/extern-mod-abi.rs similarity index 96% rename from src/test/ui/run-pass/extern/extern-mod-abi.rs rename to src/test/run-pass/extern/extern-mod-abi.rs index fcff3ed251eb..51b2498b6c76 100644 --- a/src/test/ui/run-pass/extern/extern-mod-abi.rs +++ b/src/test/run-pass/extern/extern-mod-abi.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 extern "C" { diff --git a/src/test/ui/run-pass/extern/extern-mod-ordering-exe.rs b/src/test/run-pass/extern/extern-mod-ordering-exe.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-mod-ordering-exe.rs rename to src/test/run-pass/extern/extern-mod-ordering-exe.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-TwoU16s.rs b/src/test/run-pass/extern/extern-pass-TwoU16s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-TwoU16s.rs rename to src/test/run-pass/extern/extern-pass-TwoU16s.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-TwoU32s.rs b/src/test/run-pass/extern/extern-pass-TwoU32s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-TwoU32s.rs rename to src/test/run-pass/extern/extern-pass-TwoU32s.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-TwoU64s.rs b/src/test/run-pass/extern/extern-pass-TwoU64s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-TwoU64s.rs rename to src/test/run-pass/extern/extern-pass-TwoU64s.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-TwoU8s.rs b/src/test/run-pass/extern/extern-pass-TwoU8s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-TwoU8s.rs rename to src/test/run-pass/extern/extern-pass-TwoU8s.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-char.rs b/src/test/run-pass/extern/extern-pass-char.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-char.rs rename to src/test/run-pass/extern/extern-pass-char.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-double.rs b/src/test/run-pass/extern/extern-pass-double.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-double.rs rename to src/test/run-pass/extern/extern-pass-double.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-empty.rs b/src/test/run-pass/extern/extern-pass-empty.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-empty.rs rename to src/test/run-pass/extern/extern-pass-empty.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-u32.rs b/src/test/run-pass/extern/extern-pass-u32.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-u32.rs rename to src/test/run-pass/extern/extern-pass-u32.rs diff --git a/src/test/ui/run-pass/extern/extern-pass-u64.rs b/src/test/run-pass/extern/extern-pass-u64.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pass-u64.rs rename to src/test/run-pass/extern/extern-pass-u64.rs diff --git a/src/test/ui/run-pass/extern/extern-prelude-core.rs b/src/test/run-pass/extern/extern-prelude-core.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-prelude-core.rs rename to src/test/run-pass/extern/extern-prelude-core.rs diff --git a/src/test/ui/run-pass/extern/extern-prelude-core.stderr b/src/test/run-pass/extern/extern-prelude-core.stderr similarity index 100% rename from src/test/ui/run-pass/extern/extern-prelude-core.stderr rename to src/test/run-pass/extern/extern-prelude-core.stderr diff --git a/src/test/ui/run-pass/extern/extern-prelude-no-speculative.rs b/src/test/run-pass/extern/extern-prelude-no-speculative.rs similarity index 96% rename from src/test/ui/run-pass/extern/extern-prelude-no-speculative.rs rename to src/test/run-pass/extern/extern-prelude-no-speculative.rs index 8d4219ccf44e..6ca1815a1917 100644 --- a/src/test/ui/run-pass/extern/extern-prelude-no-speculative.rs +++ b/src/test/run-pass/extern/extern-prelude-no-speculative.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // compile-flags: --extern LooksLikeExternCrate=/path/to/nowhere mod m { diff --git a/src/test/ui/run-pass/extern/extern-prelude-std.rs b/src/test/run-pass/extern/extern-prelude-std.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-prelude-std.rs rename to src/test/run-pass/extern/extern-prelude-std.rs diff --git a/src/test/ui/run-pass/extern/extern-prelude-std.stderr b/src/test/run-pass/extern/extern-prelude-std.stderr similarity index 100% rename from src/test/ui/run-pass/extern/extern-prelude-std.stderr rename to src/test/run-pass/extern/extern-prelude-std.stderr diff --git a/src/test/ui/run-pass/extern/extern-pub.rs b/src/test/run-pass/extern/extern-pub.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-pub.rs rename to src/test/run-pass/extern/extern-pub.rs diff --git a/src/test/ui/run-pass/extern/extern-return-TwoU16s.rs b/src/test/run-pass/extern/extern-return-TwoU16s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-return-TwoU16s.rs rename to src/test/run-pass/extern/extern-return-TwoU16s.rs diff --git a/src/test/ui/run-pass/extern/extern-return-TwoU32s.rs b/src/test/run-pass/extern/extern-return-TwoU32s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-return-TwoU32s.rs rename to src/test/run-pass/extern/extern-return-TwoU32s.rs diff --git a/src/test/ui/run-pass/extern/extern-return-TwoU64s.rs b/src/test/run-pass/extern/extern-return-TwoU64s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-return-TwoU64s.rs rename to src/test/run-pass/extern/extern-return-TwoU64s.rs diff --git a/src/test/ui/run-pass/extern/extern-return-TwoU8s.rs b/src/test/run-pass/extern/extern-return-TwoU8s.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-return-TwoU8s.rs rename to src/test/run-pass/extern/extern-return-TwoU8s.rs diff --git a/src/test/ui/run-pass/extern/extern-rust.rs b/src/test/run-pass/extern/extern-rust.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-rust.rs rename to src/test/run-pass/extern/extern-rust.rs diff --git a/src/test/ui/run-pass/extern/extern-take-value.rs b/src/test/run-pass/extern/extern-take-value.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-take-value.rs rename to src/test/run-pass/extern/extern-take-value.rs diff --git a/src/test/ui/run-pass/extern/extern-thiscall.rs b/src/test/run-pass/extern/extern-thiscall.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-thiscall.rs rename to src/test/run-pass/extern/extern-thiscall.rs diff --git a/src/test/ui/run-pass/extern/extern-types-inherent-impl.rs b/src/test/run-pass/extern/extern-types-inherent-impl.rs similarity index 96% rename from src/test/ui/run-pass/extern/extern-types-inherent-impl.rs rename to src/test/run-pass/extern/extern-types-inherent-impl.rs index efe55442e0b9..955a756ebdc8 100644 --- a/src/test/ui/run-pass/extern/extern-types-inherent-impl.rs +++ b/src/test/run-pass/extern/extern-types-inherent-impl.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that inherent impls can be defined for extern types. #![feature(extern_types)] diff --git a/src/test/ui/run-pass/extern/extern-types-manual-sync-send.rs b/src/test/run-pass/extern/extern-types-manual-sync-send.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-types-manual-sync-send.rs rename to src/test/run-pass/extern/extern-types-manual-sync-send.rs diff --git a/src/test/ui/run-pass/extern/extern-types-pointer-cast.rs b/src/test/run-pass/extern/extern-types-pointer-cast.rs similarity index 98% rename from src/test/ui/run-pass/extern/extern-types-pointer-cast.rs rename to src/test/run-pass/extern/extern-types-pointer-cast.rs index 7905c7ba0028..5110bd42690c 100644 --- a/src/test/ui/run-pass/extern/extern-types-pointer-cast.rs +++ b/src/test/run-pass/extern/extern-types-pointer-cast.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that pointers to extern types can be cast from/to usize, // despite being !Sized. diff --git a/src/test/ui/run-pass/extern/extern-types-size_of_val.rs b/src/test/run-pass/extern/extern-types-size_of_val.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-types-size_of_val.rs rename to src/test/run-pass/extern/extern-types-size_of_val.rs diff --git a/src/test/ui/run-pass/extern/extern-types-thin-pointer.rs b/src/test/run-pass/extern/extern-types-thin-pointer.rs similarity index 98% rename from src/test/ui/run-pass/extern/extern-types-thin-pointer.rs rename to src/test/run-pass/extern/extern-types-thin-pointer.rs index 08fbadf3d2bd..9a535fd1931b 100644 --- a/src/test/ui/run-pass/extern/extern-types-thin-pointer.rs +++ b/src/test/run-pass/extern/extern-types-thin-pointer.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that pointers and references to extern types are thin, ie they have the same size and // alignment as a pointer to (). diff --git a/src/test/ui/run-pass/extern/extern-types-trait-impl.rs b/src/test/run-pass/extern/extern-types-trait-impl.rs similarity index 97% rename from src/test/ui/run-pass/extern/extern-types-trait-impl.rs rename to src/test/run-pass/extern/extern-types-trait-impl.rs index b8eb4b6a98b3..d427e6675732 100644 --- a/src/test/ui/run-pass/extern/extern-types-trait-impl.rs +++ b/src/test/run-pass/extern/extern-types-trait-impl.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that traits can be implemented for extern types. #![feature(extern_types)] diff --git a/src/test/ui/run-pass/extern/extern-vectorcall.rs b/src/test/run-pass/extern/extern-vectorcall.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern-vectorcall.rs rename to src/test/run-pass/extern/extern-vectorcall.rs diff --git a/src/test/ui/run-pass/extern/extern_fat_drop.rs b/src/test/run-pass/extern/extern_fat_drop.rs similarity index 100% rename from src/test/ui/run-pass/extern/extern_fat_drop.rs rename to src/test/run-pass/extern/extern_fat_drop.rs diff --git a/src/test/ui/run-pass/for-loop-while/auto-loop.rs b/src/test/run-pass/for-loop-while/auto-loop.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/auto-loop.rs rename to src/test/run-pass/for-loop-while/auto-loop.rs diff --git a/src/test/ui/run-pass/for-loop-while/break-value.rs b/src/test/run-pass/for-loop-while/break-value.rs similarity index 95% rename from src/test/ui/run-pass/for-loop-while/break-value.rs rename to src/test/run-pass/for-loop-while/break-value.rs index c77e9a209dd6..8811d313994d 100644 --- a/src/test/ui/run-pass/for-loop-while/break-value.rs +++ b/src/test/run-pass/for-loop-while/break-value.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // pretty-expanded FIXME #23616 fn int_id(x: isize) -> isize { return x; } diff --git a/src/test/ui/run-pass/for-loop-while/break.rs b/src/test/run-pass/for-loop-while/break.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/break.rs rename to src/test/run-pass/for-loop-while/break.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-destruct.rs b/src/test/run-pass/for-loop-while/for-destruct.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-destruct.rs rename to src/test/run-pass/for-loop-while/for-destruct.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-goofiness.rs b/src/test/run-pass/for-loop-while/for-loop-goofiness.rs similarity index 96% rename from src/test/ui/run-pass/for-loop-while/for-loop-goofiness.rs rename to src/test/run-pass/for-loop-while/for-loop-goofiness.rs index ade51c4abbc2..bcc5ad7b7ad7 100644 --- a/src/test/ui/run-pass/for-loop-while/for-loop-goofiness.rs +++ b/src/test/run-pass/for-loop-while/for-loop-goofiness.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum BogusOption { None, diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-has-unit-body.rs b/src/test/run-pass/for-loop-while/for-loop-has-unit-body.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-has-unit-body.rs rename to src/test/run-pass/for-loop-while/for-loop-has-unit-body.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-into-iterator.rs b/src/test/run-pass/for-loop-while/for-loop-into-iterator.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-into-iterator.rs rename to src/test/run-pass/for-loop-while/for-loop-into-iterator.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-lifetime-of-unbound-values.rs b/src/test/run-pass/for-loop-while/for-loop-lifetime-of-unbound-values.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-lifetime-of-unbound-values.rs rename to src/test/run-pass/for-loop-while/for-loop-lifetime-of-unbound-values.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-macro.rs b/src/test/run-pass/for-loop-while/for-loop-macro.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-macro.rs rename to src/test/run-pass/for-loop-while/for-loop-macro.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-mut-ref-element.rs b/src/test/run-pass/for-loop-while/for-loop-mut-ref-element.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-mut-ref-element.rs rename to src/test/run-pass/for-loop-while/for-loop-mut-ref-element.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-no-std.rs b/src/test/run-pass/for-loop-while/for-loop-no-std.rs similarity index 96% rename from src/test/ui/run-pass/for-loop-while/for-loop-no-std.rs rename to src/test/run-pass/for-loop-while/for-loop-no-std.rs index dc03a500f8c4..c91cd115dfb4 100644 --- a/src/test/ui/run-pass/for-loop-while/for-loop-no-std.rs +++ b/src/test/run-pass/for-loop-while/for-loop-no-std.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![feature(lang_items, start, alloc)] #![no_std] diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-panic.rs b/src/test/run-pass/for-loop-while/for-loop-panic.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-panic.rs rename to src/test/run-pass/for-loop-while/for-loop-panic.rs diff --git a/src/test/ui/run-pass/for-loop-while/for-loop-unconstrained-element-type-i32-fallback.rs b/src/test/run-pass/for-loop-while/for-loop-unconstrained-element-type-i32-fallback.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/for-loop-unconstrained-element-type-i32-fallback.rs rename to src/test/run-pass/for-loop-while/for-loop-unconstrained-element-type-i32-fallback.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators-break.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators-break.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators-break.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators-break.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators-hashmap-break-restart.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators-hashmap-break-restart.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators-hashmap-break-restart.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators-hashmap-break-restart.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators-hashmap.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators-hashmap.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators-hashmap.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators-hashmap.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators-loop.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators-loop.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators-loop.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators-loop.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators-nested.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators-nested.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators-nested.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators-nested.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-external-iterators.rs b/src/test/run-pass/for-loop-while/foreach-external-iterators.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-external-iterators.rs rename to src/test/run-pass/for-loop-while/foreach-external-iterators.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-nested.rs b/src/test/run-pass/for-loop-while/foreach-nested.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-nested.rs rename to src/test/run-pass/for-loop-while/foreach-nested.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-put-structured.rs b/src/test/run-pass/for-loop-while/foreach-put-structured.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-put-structured.rs rename to src/test/run-pass/for-loop-while/foreach-put-structured.rs diff --git a/src/test/ui/run-pass/for-loop-while/foreach-simple-outer-slot.rs b/src/test/run-pass/for-loop-while/foreach-simple-outer-slot.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/foreach-simple-outer-slot.rs rename to src/test/run-pass/for-loop-while/foreach-simple-outer-slot.rs diff --git a/src/test/ui/run-pass/for-loop-while/label_break_value.rs b/src/test/run-pass/for-loop-while/label_break_value.rs similarity index 98% rename from src/test/ui/run-pass/for-loop-while/label_break_value.rs rename to src/test/run-pass/for-loop-while/label_break_value.rs index 831b23b03c32..687253baa654 100644 --- a/src/test/ui/run-pass/for-loop-while/label_break_value.rs +++ b/src/test/run-pass/for-loop-while/label_break_value.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] #![feature(label_break_value)] // Test control flow to follow label_break_value semantics diff --git a/src/test/ui/run-pass/for-loop-while/labeled-break.rs b/src/test/run-pass/for-loop-while/labeled-break.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/labeled-break.rs rename to src/test/run-pass/for-loop-while/labeled-break.rs diff --git a/src/test/ui/run-pass/for-loop-while/linear-for-loop.rs b/src/test/run-pass/for-loop-while/linear-for-loop.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/linear-for-loop.rs rename to src/test/run-pass/for-loop-while/linear-for-loop.rs diff --git a/src/test/ui/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs b/src/test/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs similarity index 93% rename from src/test/ui/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs rename to src/test/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs index fd0b234c7b32..57d846d6557b 100644 --- a/src/test/ui/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs +++ b/src/test/run-pass/for-loop-while/liveness-assign-imm-local-after-loop.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] // pretty-expanded FIXME #23616 #![allow(unreachable_code)] diff --git a/src/test/ui/run-pass/for-loop-while/liveness-loop-break.rs b/src/test/run-pass/for-loop-while/liveness-loop-break.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/liveness-loop-break.rs rename to src/test/run-pass/for-loop-while/liveness-loop-break.rs diff --git a/src/test/ui/run-pass/for-loop-while/liveness-move-in-loop.rs b/src/test/run-pass/for-loop-while/liveness-move-in-loop.rs similarity index 97% rename from src/test/ui/run-pass/for-loop-while/liveness-move-in-loop.rs rename to src/test/run-pass/for-loop-while/liveness-move-in-loop.rs index b5da1c1e2216..4b148eba9d9a 100644 --- a/src/test/ui/run-pass/for-loop-while/liveness-move-in-loop.rs +++ b/src/test/run-pass/for-loop-while/liveness-move-in-loop.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/for-loop-while/loop-break-cont-1.rs b/src/test/run-pass/for-loop-while/loop-break-cont-1.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-break-cont-1.rs rename to src/test/run-pass/for-loop-while/loop-break-cont-1.rs diff --git a/src/test/ui/run-pass/for-loop-while/loop-break-cont.rs b/src/test/run-pass/for-loop-while/loop-break-cont.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-break-cont.rs rename to src/test/run-pass/for-loop-while/loop-break-cont.rs diff --git a/src/test/ui/run-pass/for-loop-while/loop-break-value.rs b/src/test/run-pass/for-loop-while/loop-break-value.rs similarity index 99% rename from src/test/ui/run-pass/for-loop-while/loop-break-value.rs rename to src/test/run-pass/for-loop-while/loop-break-value.rs index 9f23b4e93e68..2038df4e2a4d 100644 --- a/src/test/ui/run-pass/for-loop-while/loop-break-value.rs +++ b/src/test/run-pass/for-loop-while/loop-break-value.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] #![feature(never_type)] #[allow(unused)] diff --git a/src/test/ui/run-pass/for-loop-while/loop-diverges.rs b/src/test/run-pass/for-loop-while/loop-diverges.rs similarity index 96% rename from src/test/ui/run-pass/for-loop-while/loop-diverges.rs rename to src/test/run-pass/for-loop-while/loop-diverges.rs index 86ff4c054387..47e5e71c6236 100644 --- a/src/test/ui/run-pass/for-loop-while/loop-diverges.rs +++ b/src/test/run-pass/for-loop-while/loop-diverges.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_parens)] // pretty-expanded FIXME #23616 /* Make sure a loop{} can be the tailexpr in the body diff --git a/src/test/ui/run-pass/for-loop-while/loop-label-shadowing.rs b/src/test/run-pass/for-loop-while/loop-label-shadowing.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-label-shadowing.rs rename to src/test/run-pass/for-loop-while/loop-label-shadowing.rs diff --git a/src/test/ui/run-pass/for-loop-while/loop-labeled-break-value.rs b/src/test/run-pass/for-loop-while/loop-labeled-break-value.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-labeled-break-value.rs rename to src/test/run-pass/for-loop-while/loop-labeled-break-value.rs diff --git a/src/test/ui/run-pass/for-loop-while/loop-no-reinit-needed-post-bot.rs b/src/test/run-pass/for-loop-while/loop-no-reinit-needed-post-bot.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-no-reinit-needed-post-bot.rs rename to src/test/run-pass/for-loop-while/loop-no-reinit-needed-post-bot.rs diff --git a/src/test/ui/run-pass/for-loop-while/loop-scope.rs b/src/test/run-pass/for-loop-while/loop-scope.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/loop-scope.rs rename to src/test/run-pass/for-loop-while/loop-scope.rs diff --git a/src/test/ui/run-pass/for-loop-while/while-cont.rs b/src/test/run-pass/for-loop-while/while-cont.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while-cont.rs rename to src/test/run-pass/for-loop-while/while-cont.rs diff --git a/src/test/ui/run-pass/for-loop-while/while-flow-graph.rs b/src/test/run-pass/for-loop-while/while-flow-graph.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while-flow-graph.rs rename to src/test/run-pass/for-loop-while/while-flow-graph.rs diff --git a/src/test/ui/run-pass/for-loop-while/while-label.rs b/src/test/run-pass/for-loop-while/while-label.rs similarity index 96% rename from src/test/ui/run-pass/for-loop-while/while-label.rs rename to src/test/run-pass/for-loop-while/while-label.rs index da0cf295ba0f..218aea5ee1da 100644 --- a/src/test/ui/run-pass/for-loop-while/while-label.rs +++ b/src/test/run-pass/for-loop-while/while-label.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] pub fn main() { diff --git a/src/test/ui/run-pass/for-loop-while/while-let.rs b/src/test/run-pass/for-loop-while/while-let.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while-let.rs rename to src/test/run-pass/for-loop-while/while-let.rs diff --git a/src/test/ui/run-pass/for-loop-while/while-loop-constraints-2.rs b/src/test/run-pass/for-loop-while/while-loop-constraints-2.rs similarity index 96% rename from src/test/ui/run-pass/for-loop-while/while-loop-constraints-2.rs rename to src/test/run-pass/for-loop-while/while-loop-constraints-2.rs index 802f7be543ac..2cdf273f3e33 100644 --- a/src/test/ui/run-pass/for-loop-while/while-loop-constraints-2.rs +++ b/src/test/run-pass/for-loop-while/while-loop-constraints-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] #![allow(unused_variables)] pub fn main() { diff --git a/src/test/ui/run-pass/for-loop-while/while-prelude-drop.rs b/src/test/run-pass/for-loop-while/while-prelude-drop.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while-prelude-drop.rs rename to src/test/run-pass/for-loop-while/while-prelude-drop.rs diff --git a/src/test/ui/run-pass/for-loop-while/while-with-break.rs b/src/test/run-pass/for-loop-while/while-with-break.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while-with-break.rs rename to src/test/run-pass/for-loop-while/while-with-break.rs diff --git a/src/test/ui/run-pass/for-loop-while/while.rs b/src/test/run-pass/for-loop-while/while.rs similarity index 100% rename from src/test/ui/run-pass/for-loop-while/while.rs rename to src/test/run-pass/for-loop-while/while.rs diff --git a/src/test/ui/run-pass/foreign/auxiliary/fn-abi.rs b/src/test/run-pass/foreign/auxiliary/fn-abi.rs similarity index 100% rename from src/test/ui/run-pass/foreign/auxiliary/fn-abi.rs rename to src/test/run-pass/foreign/auxiliary/fn-abi.rs diff --git a/src/test/ui/run-pass/foreign/auxiliary/foreign_lib.rs b/src/test/run-pass/foreign/auxiliary/foreign_lib.rs similarity index 100% rename from src/test/ui/run-pass/foreign/auxiliary/foreign_lib.rs rename to src/test/run-pass/foreign/auxiliary/foreign_lib.rs diff --git a/src/test/ui/run-pass/foreign/foreign-call-no-runtime.rs b/src/test/run-pass/foreign/foreign-call-no-runtime.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-call-no-runtime.rs rename to src/test/run-pass/foreign/foreign-call-no-runtime.rs diff --git a/src/test/ui/run-pass/foreign/foreign-dupe.rs b/src/test/run-pass/foreign/foreign-dupe.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-dupe.rs rename to src/test/run-pass/foreign/foreign-dupe.rs diff --git a/src/test/ui/run-pass/foreign/foreign-fn-linkname.rs b/src/test/run-pass/foreign/foreign-fn-linkname.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-fn-linkname.rs rename to src/test/run-pass/foreign/foreign-fn-linkname.rs diff --git a/src/test/ui/run-pass/foreign/foreign-fn-with-byval.rs b/src/test/run-pass/foreign/foreign-fn-with-byval.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-fn-with-byval.rs rename to src/test/run-pass/foreign/foreign-fn-with-byval.rs diff --git a/src/test/ui/run-pass/foreign/foreign-int-types.rs b/src/test/run-pass/foreign/foreign-int-types.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-int-types.rs rename to src/test/run-pass/foreign/foreign-int-types.rs diff --git a/src/test/ui/run-pass/foreign/foreign-mod-src/compiletest-ignore-dir b/src/test/run-pass/foreign/foreign-mod-src/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-mod-src/compiletest-ignore-dir rename to src/test/run-pass/foreign/foreign-mod-src/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/foreign/foreign-mod-src/inner.rs b/src/test/run-pass/foreign/foreign-mod-src/inner.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-mod-src/inner.rs rename to src/test/run-pass/foreign/foreign-mod-src/inner.rs diff --git a/src/test/ui/run-pass/foreign/foreign-mod-unused-const.rs b/src/test/run-pass/foreign/foreign-mod-unused-const.rs similarity index 96% rename from src/test/ui/run-pass/foreign/foreign-mod-unused-const.rs rename to src/test/run-pass/foreign/foreign-mod-unused-const.rs index 61d537c692ce..6b7b6d619dee 100644 --- a/src/test/ui/run-pass/foreign/foreign-mod-unused-const.rs +++ b/src/test/run-pass/foreign/foreign-mod-unused-const.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod foo { diff --git a/src/test/ui/run-pass/foreign/foreign-no-abi.rs b/src/test/run-pass/foreign/foreign-no-abi.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-no-abi.rs rename to src/test/run-pass/foreign/foreign-no-abi.rs diff --git a/src/test/ui/run-pass/foreign/foreign-src/compiletest-ignore-dir b/src/test/run-pass/foreign/foreign-src/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-src/compiletest-ignore-dir rename to src/test/run-pass/foreign/foreign-src/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/foreign/foreign-src/foreign.rs b/src/test/run-pass/foreign/foreign-src/foreign.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-src/foreign.rs rename to src/test/run-pass/foreign/foreign-src/foreign.rs diff --git a/src/test/ui/run-pass/foreign/foreign-truncated-arguments.rs b/src/test/run-pass/foreign/foreign-truncated-arguments.rs similarity index 100% rename from src/test/ui/run-pass/foreign/foreign-truncated-arguments.rs rename to src/test/run-pass/foreign/foreign-truncated-arguments.rs diff --git a/src/test/ui/run-pass/foreign/foreign2.rs b/src/test/run-pass/foreign/foreign2.rs similarity index 97% rename from src/test/ui/run-pass/foreign/foreign2.rs rename to src/test/run-pass/foreign/foreign2.rs index 307e6b182e7a..bd6c8e6b53d6 100644 --- a/src/test/ui/run-pass/foreign/foreign2.rs +++ b/src/test/run-pass/foreign/foreign2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-wasm32-bare no libc to test ffi with // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/functions-closures/auxiliary/fn-abi.rs b/src/test/run-pass/functions-closures/auxiliary/fn-abi.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/auxiliary/fn-abi.rs rename to src/test/run-pass/functions-closures/auxiliary/fn-abi.rs diff --git a/src/test/ui/run-pass/functions-closures/call-closure-from-overloaded-op.rs b/src/test/run-pass/functions-closures/call-closure-from-overloaded-op.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/call-closure-from-overloaded-op.rs rename to src/test/run-pass/functions-closures/call-closure-from-overloaded-op.rs diff --git a/src/test/ui/run-pass/functions-closures/capture-clauses-boxed-closures.rs b/src/test/run-pass/functions-closures/capture-clauses-boxed-closures.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/capture-clauses-boxed-closures.rs rename to src/test/run-pass/functions-closures/capture-clauses-boxed-closures.rs diff --git a/src/test/ui/run-pass/functions-closures/capture-clauses-unboxed-closures.rs b/src/test/run-pass/functions-closures/capture-clauses-unboxed-closures.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/capture-clauses-unboxed-closures.rs rename to src/test/run-pass/functions-closures/capture-clauses-unboxed-closures.rs diff --git a/src/test/ui/run-pass/functions-closures/clone-closure.rs b/src/test/run-pass/functions-closures/clone-closure.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/clone-closure.rs rename to src/test/run-pass/functions-closures/clone-closure.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-bounds-can-capture-chan.rs b/src/test/run-pass/functions-closures/closure-bounds-can-capture-chan.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-bounds-can-capture-chan.rs rename to src/test/run-pass/functions-closures/closure-bounds-can-capture-chan.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-expected-type/README.md b/src/test/run-pass/functions-closures/closure-expected-type/README.md similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-expected-type/README.md rename to src/test/run-pass/functions-closures/closure-expected-type/README.md diff --git a/src/test/ui/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs b/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs similarity index 94% rename from src/test/ui/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs rename to src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs index a58b9ba567b6..af71c95dc676 100644 --- a/src/test/ui/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs +++ b/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] fn with_closure(_: F) where F: FnOnce(Vec, A) { diff --git a/src/test/ui/run-pass/functions-closures/closure-expected-type/issue-38714.rs b/src/test/run-pass/functions-closures/closure-expected-type/issue-38714.rs similarity index 94% rename from src/test/ui/run-pass/functions-closures/closure-expected-type/issue-38714.rs rename to src/test/run-pass/functions-closures/closure-expected-type/issue-38714.rs index 3304b2e2600d..2ed3663bb578 100644 --- a/src/test/ui/run-pass/functions-closures/closure-expected-type/issue-38714.rs +++ b/src/test/run-pass/functions-closures/closure-expected-type/issue-38714.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] struct UsizeRef<'a> { a: &'a usize } diff --git a/src/test/ui/run-pass/functions-closures/closure-expected-type/supply-just-return-type.rs b/src/test/run-pass/functions-closures/closure-expected-type/supply-just-return-type.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-expected-type/supply-just-return-type.rs rename to src/test/run-pass/functions-closures/closure-expected-type/supply-just-return-type.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-expected-type/supply-nothing.rs b/src/test/run-pass/functions-closures/closure-expected-type/supply-nothing.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-expected-type/supply-nothing.rs rename to src/test/run-pass/functions-closures/closure-expected-type/supply-nothing.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-immediate.rs b/src/test/run-pass/functions-closures/closure-immediate.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-immediate.rs rename to src/test/run-pass/functions-closures/closure-immediate.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-inference.rs b/src/test/run-pass/functions-closures/closure-inference.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-inference.rs rename to src/test/run-pass/functions-closures/closure-inference.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-inference2.rs b/src/test/run-pass/functions-closures/closure-inference2.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-inference2.rs rename to src/test/run-pass/functions-closures/closure-inference2.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-reform.rs b/src/test/run-pass/functions-closures/closure-reform.rs similarity index 98% rename from src/test/ui/run-pass/functions-closures/closure-reform.rs rename to src/test/run-pass/functions-closures/closure-reform.rs index 52e0e56026bb..95a9438300d9 100644 --- a/src/test/ui/run-pass/functions-closures/closure-reform.rs +++ b/src/test/run-pass/functions-closures/closure-reform.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ diff --git a/src/test/ui/run-pass/functions-closures/closure-returning-closure.rs b/src/test/run-pass/functions-closures/closure-returning-closure.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-returning-closure.rs rename to src/test/run-pass/functions-closures/closure-returning-closure.rs diff --git a/src/test/ui/run-pass/functions-closures/closure-to-fn-coercion.rs b/src/test/run-pass/functions-closures/closure-to-fn-coercion.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/closure-to-fn-coercion.rs rename to src/test/run-pass/functions-closures/closure-to-fn-coercion.rs diff --git a/src/test/ui/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs b/src/test/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs similarity index 95% rename from src/test/ui/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs rename to src/test/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs index e2e2b3251779..747afc133016 100644 --- a/src/test/ui/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs +++ b/src/test/run-pass/functions-closures/closure_to_fn_coercion-expected-types.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Ensure that we deduce expected argument types when a `fn()` type is expected (#41755) fn foo(f: fn(Vec) -> usize) { } diff --git a/src/test/ui/run-pass/functions-closures/copy-closure.rs b/src/test/run-pass/functions-closures/copy-closure.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/copy-closure.rs rename to src/test/run-pass/functions-closures/copy-closure.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-abi.rs b/src/test/run-pass/functions-closures/fn-abi.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-abi.rs rename to src/test/run-pass/functions-closures/fn-abi.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-bare-assign.rs b/src/test/run-pass/functions-closures/fn-bare-assign.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-bare-assign.rs rename to src/test/run-pass/functions-closures/fn-bare-assign.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-bare-coerce-to-block.rs b/src/test/run-pass/functions-closures/fn-bare-coerce-to-block.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-bare-coerce-to-block.rs rename to src/test/run-pass/functions-closures/fn-bare-coerce-to-block.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-bare-item.rs b/src/test/run-pass/functions-closures/fn-bare-item.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-bare-item.rs rename to src/test/run-pass/functions-closures/fn-bare-item.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-bare-size.rs b/src/test/run-pass/functions-closures/fn-bare-size.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-bare-size.rs rename to src/test/run-pass/functions-closures/fn-bare-size.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-bare-spawn.rs b/src/test/run-pass/functions-closures/fn-bare-spawn.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-bare-spawn.rs rename to src/test/run-pass/functions-closures/fn-bare-spawn.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-coerce-field.rs b/src/test/run-pass/functions-closures/fn-coerce-field.rs similarity index 96% rename from src/test/ui/run-pass/functions-closures/fn-coerce-field.rs rename to src/test/run-pass/functions-closures/fn-coerce-field.rs index 5845af6b60d4..166f05368be6 100644 --- a/src/test/ui/run-pass/functions-closures/fn-coerce-field.rs +++ b/src/test/run-pass/functions-closures/fn-coerce-field.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/functions-closures/fn-item-type-cast.rs b/src/test/run-pass/functions-closures/fn-item-type-cast.rs similarity index 94% rename from src/test/ui/run-pass/functions-closures/fn-item-type-cast.rs rename to src/test/run-pass/functions-closures/fn-item-type-cast.rs index 0c032bd79fd7..02b05513ad7d 100644 --- a/src/test/ui/run-pass/functions-closures/fn-item-type-cast.rs +++ b/src/test/run-pass/functions-closures/fn-item-type-cast.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test explicit coercions from a fn item type to a fn pointer type. diff --git a/src/test/ui/run-pass/functions-closures/fn-item-type-coerce.rs b/src/test/run-pass/functions-closures/fn-item-type-coerce.rs similarity index 96% rename from src/test/ui/run-pass/functions-closures/fn-item-type-coerce.rs rename to src/test/run-pass/functions-closures/fn-item-type-coerce.rs index 3b0cd1ec1e58..ad931a836b8f 100644 --- a/src/test/ui/run-pass/functions-closures/fn-item-type-coerce.rs +++ b/src/test/run-pass/functions-closures/fn-item-type-coerce.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test implicit coercions from a fn item type to a fn pointer type. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/functions-closures/fn-item-type-zero-sized.rs b/src/test/run-pass/functions-closures/fn-item-type-zero-sized.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-item-type-zero-sized.rs rename to src/test/run-pass/functions-closures/fn-item-type-zero-sized.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-lval.rs b/src/test/run-pass/functions-closures/fn-lval.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-lval.rs rename to src/test/run-pass/functions-closures/fn-lval.rs diff --git a/src/test/ui/run-pass/functions-closures/fn-type-infer.rs b/src/test/run-pass/functions-closures/fn-type-infer.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/fn-type-infer.rs rename to src/test/run-pass/functions-closures/fn-type-infer.rs diff --git a/src/test/ui/run-pass/functions-closures/implied-bounds-closure-arg-outlives.rs b/src/test/run-pass/functions-closures/implied-bounds-closure-arg-outlives.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/implied-bounds-closure-arg-outlives.rs rename to src/test/run-pass/functions-closures/implied-bounds-closure-arg-outlives.rs diff --git a/src/test/ui/run-pass/functions-closures/nullable-pointer-opt-closures.rs b/src/test/run-pass/functions-closures/nullable-pointer-opt-closures.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/nullable-pointer-opt-closures.rs rename to src/test/run-pass/functions-closures/nullable-pointer-opt-closures.rs diff --git a/src/test/ui/run-pass/functions-closures/parallel-codegen-closures.rs b/src/test/run-pass/functions-closures/parallel-codegen-closures.rs similarity index 95% rename from src/test/ui/run-pass/functions-closures/parallel-codegen-closures.rs rename to src/test/run-pass/functions-closures/parallel-codegen-closures.rs index 0b8604f66f9b..95592993cb61 100644 --- a/src/test/ui/run-pass/functions-closures/parallel-codegen-closures.rs +++ b/src/test/run-pass/functions-closures/parallel-codegen-closures.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(stable_features)] // Tests parallel codegen - this can fail if the symbol for the anonymous diff --git a/src/test/ui/run-pass/functions-closures/return-from-closure.rs b/src/test/run-pass/functions-closures/return-from-closure.rs similarity index 100% rename from src/test/ui/run-pass/functions-closures/return-from-closure.rs rename to src/test/run-pass/functions-closures/return-from-closure.rs diff --git a/src/test/ui/run-pass/generator/auxiliary/xcrate-reachable.rs b/src/test/run-pass/generator/auxiliary/xcrate-reachable.rs similarity index 100% rename from src/test/ui/run-pass/generator/auxiliary/xcrate-reachable.rs rename to src/test/run-pass/generator/auxiliary/xcrate-reachable.rs diff --git a/src/test/ui/run-pass/generator/auxiliary/xcrate.rs b/src/test/run-pass/generator/auxiliary/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/generator/auxiliary/xcrate.rs rename to src/test/run-pass/generator/auxiliary/xcrate.rs diff --git a/src/test/ui/run-pass/generator/borrow-in-tail-expr.rs b/src/test/run-pass/generator/borrow-in-tail-expr.rs similarity index 100% rename from src/test/ui/run-pass/generator/borrow-in-tail-expr.rs rename to src/test/run-pass/generator/borrow-in-tail-expr.rs diff --git a/src/test/ui/run-pass/generator/conditional-drop.rs b/src/test/run-pass/generator/conditional-drop.rs similarity index 100% rename from src/test/ui/run-pass/generator/conditional-drop.rs rename to src/test/run-pass/generator/conditional-drop.rs diff --git a/src/test/ui/run-pass/generator/control-flow.rs b/src/test/run-pass/generator/control-flow.rs similarity index 100% rename from src/test/ui/run-pass/generator/control-flow.rs rename to src/test/run-pass/generator/control-flow.rs diff --git a/src/test/ui/run-pass/generator/drop-env.rs b/src/test/run-pass/generator/drop-env.rs similarity index 100% rename from src/test/ui/run-pass/generator/drop-env.rs rename to src/test/run-pass/generator/drop-env.rs diff --git a/src/test/ui/run-pass/generator/issue-44197.rs b/src/test/run-pass/generator/issue-44197.rs similarity index 100% rename from src/test/ui/run-pass/generator/issue-44197.rs rename to src/test/run-pass/generator/issue-44197.rs diff --git a/src/test/ui/run-pass/generator/issue-52398.rs b/src/test/run-pass/generator/issue-52398.rs similarity index 97% rename from src/test/ui/run-pass/generator/issue-52398.rs rename to src/test/run-pass/generator/issue-52398.rs index 9ed65a0eee06..ff4d3e881f04 100644 --- a/src/test/ui/run-pass/generator/issue-52398.rs +++ b/src/test/run-pass/generator/issue-52398.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![feature(generators)] diff --git a/src/test/ui/run-pass/generator/iterator-count.rs b/src/test/run-pass/generator/iterator-count.rs similarity index 100% rename from src/test/ui/run-pass/generator/iterator-count.rs rename to src/test/run-pass/generator/iterator-count.rs diff --git a/src/test/ui/run-pass/generator/live-upvar-across-yield.rs b/src/test/run-pass/generator/live-upvar-across-yield.rs similarity index 100% rename from src/test/ui/run-pass/generator/live-upvar-across-yield.rs rename to src/test/run-pass/generator/live-upvar-across-yield.rs diff --git a/src/test/ui/run-pass/generator/match-bindings.rs b/src/test/run-pass/generator/match-bindings.rs similarity index 97% rename from src/test/ui/run-pass/generator/match-bindings.rs rename to src/test/run-pass/generator/match-bindings.rs index 10d8bb8c9a7e..25230df1749c 100644 --- a/src/test/ui/run-pass/generator/match-bindings.rs +++ b/src/test/run-pass/generator/match-bindings.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(generators)] diff --git a/src/test/ui/run-pass/generator/nested_generators.rs b/src/test/run-pass/generator/nested_generators.rs similarity index 100% rename from src/test/ui/run-pass/generator/nested_generators.rs rename to src/test/run-pass/generator/nested_generators.rs diff --git a/src/test/ui/run-pass/generator/panic-drops.rs b/src/test/run-pass/generator/panic-drops.rs similarity index 100% rename from src/test/ui/run-pass/generator/panic-drops.rs rename to src/test/run-pass/generator/panic-drops.rs diff --git a/src/test/ui/run-pass/generator/panic-safe.rs b/src/test/run-pass/generator/panic-safe.rs similarity index 100% rename from src/test/ui/run-pass/generator/panic-safe.rs rename to src/test/run-pass/generator/panic-safe.rs diff --git a/src/test/ui/run-pass/generator/reborrow-mut-upvar.rs b/src/test/run-pass/generator/reborrow-mut-upvar.rs similarity index 100% rename from src/test/ui/run-pass/generator/reborrow-mut-upvar.rs rename to src/test/run-pass/generator/reborrow-mut-upvar.rs diff --git a/src/test/ui/run-pass/generator/resume-after-return.rs b/src/test/run-pass/generator/resume-after-return.rs similarity index 100% rename from src/test/ui/run-pass/generator/resume-after-return.rs rename to src/test/run-pass/generator/resume-after-return.rs diff --git a/src/test/ui/run-pass/generator/smoke.rs b/src/test/run-pass/generator/smoke.rs similarity index 100% rename from src/test/ui/run-pass/generator/smoke.rs rename to src/test/run-pass/generator/smoke.rs diff --git a/src/test/ui/run-pass/generator/static-generators.rs b/src/test/run-pass/generator/static-generators.rs similarity index 100% rename from src/test/ui/run-pass/generator/static-generators.rs rename to src/test/run-pass/generator/static-generators.rs diff --git a/src/test/ui/run-pass/generator/too-live-local-in-immovable-gen.rs b/src/test/run-pass/generator/too-live-local-in-immovable-gen.rs similarity index 97% rename from src/test/ui/run-pass/generator/too-live-local-in-immovable-gen.rs rename to src/test/run-pass/generator/too-live-local-in-immovable-gen.rs index 81a5f571202f..655ed20ac1f1 100644 --- a/src/test/ui/run-pass/generator/too-live-local-in-immovable-gen.rs +++ b/src/test/run-pass/generator/too-live-local-in-immovable-gen.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_unsafe)] #![feature(generators)] diff --git a/src/test/ui/run-pass/generator/xcrate-reachable.rs b/src/test/run-pass/generator/xcrate-reachable.rs similarity index 100% rename from src/test/ui/run-pass/generator/xcrate-reachable.rs rename to src/test/run-pass/generator/xcrate-reachable.rs diff --git a/src/test/ui/run-pass/generator/xcrate.rs b/src/test/run-pass/generator/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/generator/xcrate.rs rename to src/test/run-pass/generator/xcrate.rs diff --git a/src/test/ui/run-pass/generator/yield-in-args-rev.rs b/src/test/run-pass/generator/yield-in-args-rev.rs similarity index 97% rename from src/test/ui/run-pass/generator/yield-in-args-rev.rs rename to src/test/run-pass/generator/yield-in-args-rev.rs index 3048b1225d31..d74885495abb 100644 --- a/src/test/ui/run-pass/generator/yield-in-args-rev.rs +++ b/src/test/run-pass/generator/yield-in-args-rev.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that a borrow that occurs after a yield in the same // argument list is not treated as live across the yield by diff --git a/src/test/ui/run-pass/generator/yield-in-box.rs b/src/test/run-pass/generator/yield-in-box.rs similarity index 100% rename from src/test/ui/run-pass/generator/yield-in-box.rs rename to src/test/run-pass/generator/yield-in-box.rs diff --git a/src/test/ui/run-pass/generator/yield-in-initializer.rs b/src/test/run-pass/generator/yield-in-initializer.rs similarity index 100% rename from src/test/ui/run-pass/generator/yield-in-initializer.rs rename to src/test/run-pass/generator/yield-in-initializer.rs diff --git a/src/test/ui/run-pass/generator/yield-subtype.rs b/src/test/run-pass/generator/yield-subtype.rs similarity index 94% rename from src/test/ui/run-pass/generator/yield-subtype.rs rename to src/test/run-pass/generator/yield-subtype.rs index 62d3a59ab788..82804b253a7a 100644 --- a/src/test/ui/run-pass/generator/yield-subtype.rs +++ b/src/test/run-pass/generator/yield-subtype.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(dead_code)] // revisions:lexical nll //[nll]compile-flags: -Z disable-nll-user-type-assert diff --git a/src/test/ui/run-pass/generics/auxiliary/default_type_params_xc.rs b/src/test/run-pass/generics/auxiliary/default_type_params_xc.rs similarity index 100% rename from src/test/ui/run-pass/generics/auxiliary/default_type_params_xc.rs rename to src/test/run-pass/generics/auxiliary/default_type_params_xc.rs diff --git a/src/test/ui/run-pass/generics/generic-alias-unique.rs b/src/test/run-pass/generics/generic-alias-unique.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-alias-unique.rs rename to src/test/run-pass/generics/generic-alias-unique.rs diff --git a/src/test/ui/run-pass/generics/generic-default-type-params-cross-crate.rs b/src/test/run-pass/generics/generic-default-type-params-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-default-type-params-cross-crate.rs rename to src/test/run-pass/generics/generic-default-type-params-cross-crate.rs diff --git a/src/test/ui/run-pass/generics/generic-default-type-params.rs b/src/test/run-pass/generics/generic-default-type-params.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-default-type-params.rs rename to src/test/run-pass/generics/generic-default-type-params.rs diff --git a/src/test/ui/run-pass/generics/generic-derived-type.rs b/src/test/run-pass/generics/generic-derived-type.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-derived-type.rs rename to src/test/run-pass/generics/generic-derived-type.rs diff --git a/src/test/ui/run-pass/generics/generic-exterior-unique.rs b/src/test/run-pass/generics/generic-exterior-unique.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-exterior-unique.rs rename to src/test/run-pass/generics/generic-exterior-unique.rs diff --git a/src/test/ui/run-pass/generics/generic-extern-mangle.rs b/src/test/run-pass/generics/generic-extern-mangle.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-extern-mangle.rs rename to src/test/run-pass/generics/generic-extern-mangle.rs diff --git a/src/test/ui/run-pass/generics/generic-fn-infer.rs b/src/test/run-pass/generics/generic-fn-infer.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-fn-infer.rs rename to src/test/run-pass/generics/generic-fn-infer.rs diff --git a/src/test/ui/run-pass/generics/generic-fn-twice.rs b/src/test/run-pass/generics/generic-fn-twice.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-fn-twice.rs rename to src/test/run-pass/generics/generic-fn-twice.rs diff --git a/src/test/ui/run-pass/generics/generic-fn-unique.rs b/src/test/run-pass/generics/generic-fn-unique.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-fn-unique.rs rename to src/test/run-pass/generics/generic-fn-unique.rs diff --git a/src/test/ui/run-pass/generics/generic-fn.rs b/src/test/run-pass/generics/generic-fn.rs similarity index 95% rename from src/test/ui/run-pass/generics/generic-fn.rs rename to src/test/run-pass/generics/generic-fn.rs index ae26ea1b155f..4cb663bc9eeb 100644 --- a/src/test/ui/run-pass/generics/generic-fn.rs +++ b/src/test/run-pass/generics/generic-fn.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] fn id(x: T) -> T { return x; } diff --git a/src/test/ui/run-pass/generics/generic-ivec-leak.rs b/src/test/run-pass/generics/generic-ivec-leak.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-ivec-leak.rs rename to src/test/run-pass/generics/generic-ivec-leak.rs diff --git a/src/test/ui/run-pass/generics/generic-newtype-struct.rs b/src/test/run-pass/generics/generic-newtype-struct.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-newtype-struct.rs rename to src/test/run-pass/generics/generic-newtype-struct.rs diff --git a/src/test/ui/run-pass/generics/generic-object.rs b/src/test/run-pass/generics/generic-object.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-object.rs rename to src/test/run-pass/generics/generic-object.rs diff --git a/src/test/ui/run-pass/generics/generic-recursive-tag.rs b/src/test/run-pass/generics/generic-recursive-tag.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-recursive-tag.rs rename to src/test/run-pass/generics/generic-recursive-tag.rs diff --git a/src/test/ui/run-pass/generics/generic-static-methods.rs b/src/test/run-pass/generics/generic-static-methods.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-static-methods.rs rename to src/test/run-pass/generics/generic-static-methods.rs diff --git a/src/test/ui/run-pass/generics/generic-tag-corruption.rs b/src/test/run-pass/generics/generic-tag-corruption.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-tag-corruption.rs rename to src/test/run-pass/generics/generic-tag-corruption.rs diff --git a/src/test/ui/run-pass/generics/generic-tag-local.rs b/src/test/run-pass/generics/generic-tag-local.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-tag-local.rs rename to src/test/run-pass/generics/generic-tag-local.rs diff --git a/src/test/ui/run-pass/generics/generic-tag-match.rs b/src/test/run-pass/generics/generic-tag-match.rs similarity index 96% rename from src/test/ui/run-pass/generics/generic-tag-match.rs rename to src/test/run-pass/generics/generic-tag-match.rs index 7f0bfe8ba314..798d5dcee2ed 100644 --- a/src/test/ui/run-pass/generics/generic-tag-match.rs +++ b/src/test/run-pass/generics/generic-tag-match.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] #![allow(non_camel_case_types)] enum foo { arm(T), } diff --git a/src/test/ui/run-pass/generics/generic-tag-values.rs b/src/test/run-pass/generics/generic-tag-values.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-tag-values.rs rename to src/test/run-pass/generics/generic-tag-values.rs diff --git a/src/test/ui/run-pass/generics/generic-tag.rs b/src/test/run-pass/generics/generic-tag.rs similarity index 96% rename from src/test/ui/run-pass/generics/generic-tag.rs rename to src/test/run-pass/generics/generic-tag.rs index 54a006a163e5..bc7af903b321 100644 --- a/src/test/ui/run-pass/generics/generic-tag.rs +++ b/src/test/run-pass/generics/generic-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/generics/generic-temporary.rs b/src/test/run-pass/generics/generic-temporary.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-temporary.rs rename to src/test/run-pass/generics/generic-temporary.rs diff --git a/src/test/ui/run-pass/generics/generic-tup.rs b/src/test/run-pass/generics/generic-tup.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-tup.rs rename to src/test/run-pass/generics/generic-tup.rs diff --git a/src/test/ui/run-pass/generics/generic-type-synonym.rs b/src/test/run-pass/generics/generic-type-synonym.rs similarity index 96% rename from src/test/ui/run-pass/generics/generic-type-synonym.rs rename to src/test/run-pass/generics/generic-type-synonym.rs index 518480301b95..ccea523c69cd 100644 --- a/src/test/ui/run-pass/generics/generic-type-synonym.rs +++ b/src/test/run-pass/generics/generic-type-synonym.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/generics/generic-type.rs b/src/test/run-pass/generics/generic-type.rs similarity index 100% rename from src/test/ui/run-pass/generics/generic-type.rs rename to src/test/run-pass/generics/generic-type.rs diff --git a/src/test/ui/run-pass/generics/generic-unique.rs b/src/test/run-pass/generics/generic-unique.rs similarity index 97% rename from src/test/ui/run-pass/generics/generic-unique.rs rename to src/test/run-pass/generics/generic-unique.rs index c21a0be3d39c..182f516a3c8a 100644 --- a/src/test/ui/run-pass/generics/generic-unique.rs +++ b/src/test/run-pass/generics/generic-unique.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct Triple { x: T, y: T, z: T } diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs similarity index 95% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs index 641912269a16..7d13e64de2fa 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that we handle binder levels in object types correctly. // Initially, the reference to `'tcx` in the object type // `&Typer<'tcx>` was getting an incorrect binder level, yielding diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs similarity index 97% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs index 19c7c8c489ae..8856c08bee72 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Typer<'tcx> { diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-fn-like-trait.rs diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-opt-in-copy.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-opt-in-copy.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-opt-in-copy.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-opt-in-copy.rs diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-parse.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-parse.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-parse.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-parse.rs diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs similarity index 94% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs index 32abdde39ab3..337935ad7f09 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 // Test that `F : Fn(isize) -> isize + Send` is interpreted as two diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs similarity index 97% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs index 5d29115d35e7..4b85b2b4077d 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 // Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) + diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs similarity index 97% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs index 3f940cd4cd78..cbdead794a99 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // A basic test of using a higher-ranked trait bound. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs similarity index 98% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs index 2274fdc5684a..c9c3dd331368 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that `&PrinterSupport`, which is really short for `&'a // PrinterSupport<'b>`, gets properly expanded when it appears in a // closure type. This used to result in messed up De Bruijn indices. diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs similarity index 96% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs index f36533629cdb..1d54594964c8 100644 --- a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs +++ b/src/test/run-pass/higher-rank-trait-bounds/hrtb-type-outlives.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test what happens when a HR obligation is applied to an impl with // "outlives" bounds. Currently we're pretty conservative here; this // will probably improve in time. diff --git a/src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs b/src/test/run-pass/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs similarity index 100% rename from src/test/ui/run-pass/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs rename to src/test/run-pass/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs diff --git a/src/test/ui/run-pass/hygiene/auxiliary/legacy_interaction.rs b/src/test/run-pass/hygiene/auxiliary/legacy_interaction.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/auxiliary/legacy_interaction.rs rename to src/test/run-pass/hygiene/auxiliary/legacy_interaction.rs diff --git a/src/test/ui/run-pass/hygiene/auxiliary/my_crate.rs b/src/test/run-pass/hygiene/auxiliary/my_crate.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/auxiliary/my_crate.rs rename to src/test/run-pass/hygiene/auxiliary/my_crate.rs diff --git a/src/test/ui/run-pass/hygiene/auxiliary/unhygienic_example.rs b/src/test/run-pass/hygiene/auxiliary/unhygienic_example.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/auxiliary/unhygienic_example.rs rename to src/test/run-pass/hygiene/auxiliary/unhygienic_example.rs diff --git a/src/test/ui/run-pass/hygiene/auxiliary/xcrate.rs b/src/test/run-pass/hygiene/auxiliary/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/auxiliary/xcrate.rs rename to src/test/run-pass/hygiene/auxiliary/xcrate.rs diff --git a/src/test/ui/run-pass/hygiene/hygiene-dodging-1.rs b/src/test/run-pass/hygiene/hygiene-dodging-1.rs similarity index 96% rename from src/test/ui/run-pass/hygiene/hygiene-dodging-1.rs rename to src/test/run-pass/hygiene/hygiene-dodging-1.rs index bbb46d85d18d..8c3e8d221f34 100644 --- a/src/test/ui/run-pass/hygiene/hygiene-dodging-1.rs +++ b/src/test/run-pass/hygiene/hygiene-dodging-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] mod x { pub fn g() -> usize {14} diff --git a/src/test/ui/run-pass/hygiene/hygiene.rs b/src/test/run-pass/hygiene/hygiene.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/hygiene.rs rename to src/test/run-pass/hygiene/hygiene.rs diff --git a/src/test/ui/run-pass/hygiene/hygienic-labels-in-let.rs b/src/test/run-pass/hygiene/hygienic-labels-in-let.rs similarity index 98% rename from src/test/ui/run-pass/hygiene/hygienic-labels-in-let.rs rename to src/test/run-pass/hygiene/hygienic-labels-in-let.rs index d68809a1c6e6..892be9695cc1 100644 --- a/src/test/ui/run-pass/hygiene/hygienic-labels-in-let.rs +++ b/src/test/run-pass/hygiene/hygienic-labels-in-let.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] + // Test that labels injected by macros do not break hygiene. This // checks cases where the macros invocations are under the rhs of a // let statement. diff --git a/src/test/ui/run-pass/hygiene/hygienic-labels-in-let.stderr b/src/test/run-pass/hygiene/hygienic-labels-in-let.stderr similarity index 87% rename from src/test/ui/run-pass/hygiene/hygienic-labels-in-let.stderr rename to src/test/run-pass/hygiene/hygienic-labels-in-let.stderr index d96b99746a74..e31c1484399f 100644 --- a/src/test/ui/run-pass/hygiene/hygienic-labels-in-let.stderr +++ b/src/test/run-pass/hygiene/hygienic-labels-in-let.stderr @@ -1,5 +1,5 @@ warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:23:9 + --> $DIR/hygienic-labels-in-let.rs:25:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -11,7 +11,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:55:9 + --> $DIR/hygienic-labels-in-let.rs:57:9 | LL | 'x: loop { | -- first declared here @@ -20,7 +20,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:55:9 + --> $DIR/hygienic-labels-in-let.rs:57:9 | LL | 'x: loop { $e } | -- first declared here @@ -29,7 +29,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:23:9 + --> $DIR/hygienic-labels-in-let.rs:25:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -41,7 +41,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:23:9 + --> $DIR/hygienic-labels-in-let.rs:25:9 | LL | 'x: loop { $e } | ^^ @@ -53,7 +53,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:23:9 + --> $DIR/hygienic-labels-in-let.rs:25:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -65,7 +65,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:65:9 + --> $DIR/hygienic-labels-in-let.rs:67:9 | LL | 'x: loop { | -- first declared here @@ -74,7 +74,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:65:9 + --> $DIR/hygienic-labels-in-let.rs:67:9 | LL | 'x: loop { $e } | -- first declared here @@ -83,7 +83,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:65:9 + --> $DIR/hygienic-labels-in-let.rs:67:9 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -92,7 +92,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:65:9 + --> $DIR/hygienic-labels-in-let.rs:67:9 | LL | 'x: loop { $e } | -- first declared here @@ -101,7 +101,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:30:9 + --> $DIR/hygienic-labels-in-let.rs:32:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -113,7 +113,7 @@ LL | while_true!(break 'x); | ---------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:30:9 + --> $DIR/hygienic-labels-in-let.rs:32:9 | LL | 'x: loop { $e } | -- first declared here @@ -125,7 +125,7 @@ LL | while_true!(break 'x); | ---------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:30:9 + --> $DIR/hygienic-labels-in-let.rs:32:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -137,7 +137,7 @@ LL | while_true!(break 'x); | ---------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:30:9 + --> $DIR/hygienic-labels-in-let.rs:32:9 | LL | 'x: loop { $e } | -- first declared here @@ -149,7 +149,7 @@ LL | while_true!(break 'x); | ---------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:30:9 + --> $DIR/hygienic-labels-in-let.rs:32:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -161,7 +161,7 @@ LL | while_true!(break 'x); | ---------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: loop { | -- first declared here @@ -170,7 +170,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: loop { $e } | -- first declared here @@ -179,7 +179,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -188,7 +188,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: loop { $e } | -- first declared here @@ -197,7 +197,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -206,7 +206,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:75:9 + --> $DIR/hygienic-labels-in-let.rs:77:9 | LL | 'x: while 1 + 1 == 2 { $e } | -- first declared here @@ -215,7 +215,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -227,7 +227,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: loop { $e } | -- first declared here @@ -239,7 +239,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -251,7 +251,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: loop { $e } | -- first declared here @@ -263,7 +263,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -275,7 +275,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: while 1 + 1 == 2 { $e } | -- first declared here @@ -287,7 +287,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels-in-let.rs:37:9 + --> $DIR/hygienic-labels-in-let.rs:39:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope diff --git a/src/test/ui/run-pass/hygiene/hygienic-labels.rs b/src/test/run-pass/hygiene/hygienic-labels.rs similarity index 98% rename from src/test/ui/run-pass/hygiene/hygienic-labels.rs rename to src/test/run-pass/hygiene/hygienic-labels.rs index 723ffb30b7f8..e69f9cd1a86c 100644 --- a/src/test/ui/run-pass/hygiene/hygienic-labels.rs +++ b/src/test/run-pass/hygiene/hygienic-labels.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // Test that labels injected by macros do not break hygiene. // Issue #24278: The label/lifetime shadowing checker from #24162 diff --git a/src/test/ui/run-pass/hygiene/hygienic-labels.stderr b/src/test/run-pass/hygiene/hygienic-labels.stderr similarity index 88% rename from src/test/ui/run-pass/hygiene/hygienic-labels.stderr rename to src/test/run-pass/hygiene/hygienic-labels.stderr index 45c0cacde9a0..7bd2886159e9 100644 --- a/src/test/ui/run-pass/hygiene/hygienic-labels.stderr +++ b/src/test/run-pass/hygiene/hygienic-labels.stderr @@ -1,5 +1,5 @@ warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:21:9 + --> $DIR/hygienic-labels.rs:22:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -11,7 +11,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:46:5 + --> $DIR/hygienic-labels.rs:47:5 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -20,7 +20,7 @@ LL | 'x: loop { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:46:5 + --> $DIR/hygienic-labels.rs:47:5 | LL | 'x: loop { $e } | -- first declared here @@ -29,7 +29,7 @@ LL | 'x: loop { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:21:9 + --> $DIR/hygienic-labels.rs:22:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -41,7 +41,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:21:9 + --> $DIR/hygienic-labels.rs:22:9 | LL | 'x: loop { $e } | ^^ @@ -53,7 +53,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:21:9 + --> $DIR/hygienic-labels.rs:22:9 | LL | 'x: loop { $e } | ^^ lifetime 'x already in scope @@ -65,7 +65,7 @@ LL | loop_x!(break 'x); | ------------------ in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:52:5 + --> $DIR/hygienic-labels.rs:53:5 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -74,7 +74,7 @@ LL | 'x: while 1 + 1 == 2 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:52:5 + --> $DIR/hygienic-labels.rs:53:5 | LL | 'x: loop { $e } | -- first declared here @@ -83,7 +83,7 @@ LL | 'x: while 1 + 1 == 2 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:52:5 + --> $DIR/hygienic-labels.rs:53:5 | LL | 'x: loop { | -- first declared here @@ -92,7 +92,7 @@ LL | 'x: while 1 + 1 == 2 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:52:5 + --> $DIR/hygienic-labels.rs:53:5 | LL | 'x: loop { $e } | -- first declared here @@ -101,7 +101,7 @@ LL | 'x: while 1 + 1 == 2 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:35:9 + --> $DIR/hygienic-labels.rs:36:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -113,7 +113,7 @@ LL | while_x!(break 'x); | ------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:35:9 + --> $DIR/hygienic-labels.rs:36:9 | LL | 'x: loop { $e } | -- first declared here @@ -125,7 +125,7 @@ LL | while_x!(break 'x); | ------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:35:9 + --> $DIR/hygienic-labels.rs:36:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -137,7 +137,7 @@ LL | while_x!(break 'x); | ------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:35:9 + --> $DIR/hygienic-labels.rs:36:9 | LL | 'x: loop { $e } | -- first declared here @@ -149,7 +149,7 @@ LL | while_x!(break 'x); | ------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:35:9 + --> $DIR/hygienic-labels.rs:36:9 | LL | 'x: while 1 + 1 == 2 { $e } | ^^ lifetime 'x already in scope @@ -160,7 +160,7 @@ LL | while_x!(break 'x); | ------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: for _ in 0..1 { | -- first declared here @@ -169,7 +169,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: loop { $e } | -- first declared here @@ -178,7 +178,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: loop { | -- first declared here @@ -187,7 +187,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: loop { $e } | -- first declared here @@ -196,7 +196,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: while 1 + 1 == 2 { | -- first declared here @@ -205,7 +205,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:57:5 + --> $DIR/hygienic-labels.rs:58:5 | LL | 'x: while 1 + 1 == 2 { $e } | -- first declared here @@ -214,7 +214,7 @@ LL | 'x: for _ in 0..1 { | ^^ lifetime 'x already in scope warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -226,7 +226,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: loop { $e } | -- first declared here @@ -238,7 +238,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -250,7 +250,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: loop { $e } | -- first declared here @@ -262,7 +262,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -274,7 +274,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope @@ -286,7 +286,7 @@ LL | run_once!(continue 'x); | ----------------------- in this macro invocation warning: label name `'x` shadows a label name that is already in scope - --> $DIR/hygienic-labels.rs:28:9 + --> $DIR/hygienic-labels.rs:29:9 | LL | 'x: for _ in 0..1 { $e } | ^^ lifetime 'x already in scope diff --git a/src/test/ui/run-pass/hygiene/issue-44128.rs b/src/test/run-pass/hygiene/issue-44128.rs similarity index 96% rename from src/test/ui/run-pass/hygiene/issue-44128.rs rename to src/test/run-pass/hygiene/issue-44128.rs index 879cd851434d..db9e0de2e9a5 100644 --- a/src/test/ui/run-pass/hygiene/issue-44128.rs +++ b/src/test/run-pass/hygiene/issue-44128.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] #![feature(decl_macro)] pub macro create_struct($a:ident) { diff --git a/src/test/ui/run-pass/hygiene/issue-47311.rs b/src/test/run-pass/hygiene/issue-47311.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/issue-47311.rs rename to src/test/run-pass/hygiene/issue-47311.rs diff --git a/src/test/ui/run-pass/hygiene/issue-47312.rs b/src/test/run-pass/hygiene/issue-47312.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/issue-47312.rs rename to src/test/run-pass/hygiene/issue-47312.rs diff --git a/src/test/ui/run-pass/hygiene/items.rs b/src/test/run-pass/hygiene/items.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/items.rs rename to src/test/run-pass/hygiene/items.rs diff --git a/src/test/ui/run-pass/hygiene/legacy_interaction.rs b/src/test/run-pass/hygiene/legacy_interaction.rs similarity index 98% rename from src/test/ui/run-pass/hygiene/legacy_interaction.rs rename to src/test/run-pass/hygiene/legacy_interaction.rs index d0845b5802bc..72370396ebba 100644 --- a/src/test/ui/run-pass/hygiene/legacy_interaction.rs +++ b/src/test/run-pass/hygiene/legacy_interaction.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-pretty pretty-printing is unhygienic // aux-build:legacy_interaction.rs diff --git a/src/test/ui/run-pass/hygiene/lexical.rs b/src/test/run-pass/hygiene/lexical.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/lexical.rs rename to src/test/run-pass/hygiene/lexical.rs diff --git a/src/test/ui/run-pass/hygiene/specialization.rs b/src/test/run-pass/hygiene/specialization.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/specialization.rs rename to src/test/run-pass/hygiene/specialization.rs diff --git a/src/test/ui/run-pass/hygiene/trait_items.rs b/src/test/run-pass/hygiene/trait_items.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/trait_items.rs rename to src/test/run-pass/hygiene/trait_items.rs diff --git a/src/test/ui/run-pass/hygiene/ty_params.rs b/src/test/run-pass/hygiene/ty_params.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/ty_params.rs rename to src/test/run-pass/hygiene/ty_params.rs diff --git a/src/test/ui/run-pass/hygiene/wrap_unhygienic_example.rs b/src/test/run-pass/hygiene/wrap_unhygienic_example.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/wrap_unhygienic_example.rs rename to src/test/run-pass/hygiene/wrap_unhygienic_example.rs diff --git a/src/test/ui/run-pass/hygiene/xcrate.rs b/src/test/run-pass/hygiene/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/hygiene/xcrate.rs rename to src/test/run-pass/hygiene/xcrate.rs diff --git a/src/test/ui/run-pass/impl-trait/auto-trait-leak.rs b/src/test/run-pass/impl-trait/auto-trait-leak.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/auto-trait-leak.rs rename to src/test/run-pass/impl-trait/auto-trait-leak.rs diff --git a/src/test/ui/run-pass/impl-trait/auxiliary/xcrate.rs b/src/test/run-pass/impl-trait/auxiliary/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/auxiliary/xcrate.rs rename to src/test/run-pass/impl-trait/auxiliary/xcrate.rs diff --git a/src/test/ui/run-pass/impl-trait/bounds_regression.rs b/src/test/run-pass/impl-trait/bounds_regression.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/bounds_regression.rs rename to src/test/run-pass/impl-trait/bounds_regression.rs diff --git a/src/test/ui/run-pass/impl-trait/equality.rs b/src/test/run-pass/impl-trait/equality.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/equality.rs rename to src/test/run-pass/impl-trait/equality.rs diff --git a/src/test/ui/run-pass/impl-trait/example-calendar.rs b/src/test/run-pass/impl-trait/example-calendar.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/example-calendar.rs rename to src/test/run-pass/impl-trait/example-calendar.rs diff --git a/src/test/ui/run-pass/impl-trait/example-st.rs b/src/test/run-pass/impl-trait/example-st.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/example-st.rs rename to src/test/run-pass/impl-trait/example-st.rs diff --git a/src/test/ui/run-pass/impl-trait/existential-minimal.rs b/src/test/run-pass/impl-trait/existential-minimal.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/existential-minimal.rs rename to src/test/run-pass/impl-trait/existential-minimal.rs diff --git a/src/test/ui/run-pass/impl-trait/issue-42479.rs b/src/test/run-pass/impl-trait/issue-42479.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/issue-42479.rs rename to src/test/run-pass/impl-trait/issue-42479.rs diff --git a/src/test/ui/run-pass/impl-trait/issue-49376.rs b/src/test/run-pass/impl-trait/issue-49376.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/issue-49376.rs rename to src/test/run-pass/impl-trait/issue-49376.rs diff --git a/src/test/ui/run-pass/impl-trait/lifetimes.rs b/src/test/run-pass/impl-trait/lifetimes.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/lifetimes.rs rename to src/test/run-pass/impl-trait/lifetimes.rs diff --git a/src/test/ui/run-pass/impl-trait/nesting.rs b/src/test/run-pass/impl-trait/nesting.rs similarity index 97% rename from src/test/ui/run-pass/impl-trait/nesting.rs rename to src/test/run-pass/impl-trait/nesting.rs index f721ace0afe8..3bb081181ffd 100644 --- a/src/test/ui/run-pass/impl-trait/nesting.rs +++ b/src/test/run-pass/impl-trait/nesting.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn foo(t: T) -> impl Into<[T; { const FOO: usize = 1; FOO }]> { [t] diff --git a/src/test/ui/run-pass/impl-trait/universal_hrtb_anon.rs b/src/test/run-pass/impl-trait/universal_hrtb_anon.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_hrtb_anon.rs rename to src/test/run-pass/impl-trait/universal_hrtb_anon.rs diff --git a/src/test/ui/run-pass/impl-trait/universal_hrtb_named.rs b/src/test/run-pass/impl-trait/universal_hrtb_named.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_hrtb_named.rs rename to src/test/run-pass/impl-trait/universal_hrtb_named.rs diff --git a/src/test/ui/run-pass/impl-trait/universal_in_adt_in_parameters.rs b/src/test/run-pass/impl-trait/universal_in_adt_in_parameters.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_in_adt_in_parameters.rs rename to src/test/run-pass/impl-trait/universal_in_adt_in_parameters.rs diff --git a/src/test/ui/run-pass/impl-trait/universal_in_impl_trait_in_parameters.rs b/src/test/run-pass/impl-trait/universal_in_impl_trait_in_parameters.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_in_impl_trait_in_parameters.rs rename to src/test/run-pass/impl-trait/universal_in_impl_trait_in_parameters.rs diff --git a/src/test/ui/run-pass/impl-trait/universal_in_trait_defn_parameters.rs b/src/test/run-pass/impl-trait/universal_in_trait_defn_parameters.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_in_trait_defn_parameters.rs rename to src/test/run-pass/impl-trait/universal_in_trait_defn_parameters.rs diff --git a/src/test/ui/run-pass/impl-trait/universal_multiple_bounds.rs b/src/test/run-pass/impl-trait/universal_multiple_bounds.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/universal_multiple_bounds.rs rename to src/test/run-pass/impl-trait/universal_multiple_bounds.rs diff --git a/src/test/ui/run-pass/impl-trait/xcrate.rs b/src/test/run-pass/impl-trait/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/xcrate.rs rename to src/test/run-pass/impl-trait/xcrate.rs diff --git a/src/test/ui/run-pass/impl-trait/xcrate_simple.rs b/src/test/run-pass/impl-trait/xcrate_simple.rs similarity index 100% rename from src/test/ui/run-pass/impl-trait/xcrate_simple.rs rename to src/test/run-pass/impl-trait/xcrate_simple.rs diff --git a/src/test/ui/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans.rs b/src/test/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans.rs rename to src/test/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans.rs diff --git a/src/test/ui/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans_macros.rs b/src/test/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans_macros.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans_macros.rs rename to src/test/run-pass/imports/import-crate-with-invalid-spans/auxiliary/crate_with_invalid_spans_macros.rs diff --git a/src/test/ui/run-pass/imports/import-crate-with-invalid-spans/main.rs b/src/test/run-pass/imports/import-crate-with-invalid-spans/main.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-crate-with-invalid-spans/main.rs rename to src/test/run-pass/imports/import-crate-with-invalid-spans/main.rs diff --git a/src/test/ui/run-pass/imports/import-from.rs b/src/test/run-pass/imports/import-from.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-from.rs rename to src/test/run-pass/imports/import-from.rs diff --git a/src/test/ui/run-pass/imports/import-glob-0.rs b/src/test/run-pass/imports/import-glob-0.rs similarity index 98% rename from src/test/ui/run-pass/imports/import-glob-0.rs rename to src/test/run-pass/imports/import-glob-0.rs index f72fb1f0b135..731a716d4a5b 100644 --- a/src/test/ui/run-pass/imports/import-glob-0.rs +++ b/src/test/run-pass/imports/import-glob-0.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use module_of_many_things::*; use dug::too::greedily::and::too::deep::*; diff --git a/src/test/ui/run-pass/imports/import-glob-1.rs b/src/test/run-pass/imports/import-glob-1.rs similarity index 95% rename from src/test/ui/run-pass/imports/import-glob-1.rs rename to src/test/run-pass/imports/import-glob-1.rs index b1f40d749178..c4e50c172645 100644 --- a/src/test/ui/run-pass/imports/import-glob-1.rs +++ b/src/test/run-pass/imports/import-glob-1.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] // This should resolve fine. Prior to fix, the last import // was being tried too early, and marked as unrsolved before // the glob import had a chance to be resolved. diff --git a/src/test/ui/run-pass/imports/import-glob-crate.rs b/src/test/run-pass/imports/import-glob-crate.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-glob-crate.rs rename to src/test/run-pass/imports/import-glob-crate.rs diff --git a/src/test/ui/run-pass/imports/import-in-block.rs b/src/test/run-pass/imports/import-in-block.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-in-block.rs rename to src/test/run-pass/imports/import-in-block.rs diff --git a/src/test/ui/run-pass/imports/import-prefix-macro.rs b/src/test/run-pass/imports/import-prefix-macro.rs similarity index 96% rename from src/test/ui/run-pass/imports/import-prefix-macro.rs rename to src/test/run-pass/imports/import-prefix-macro.rs index ceb662c6e3d0..5768029ef8cd 100644 --- a/src/test/ui/run-pass/imports/import-prefix-macro.rs +++ b/src/test/run-pass/imports/import-prefix-macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] mod a { pub mod b { pub mod c { diff --git a/src/test/ui/run-pass/imports/import-rename.rs b/src/test/run-pass/imports/import-rename.rs similarity index 96% rename from src/test/ui/run-pass/imports/import-rename.rs rename to src/test/run-pass/imports/import-rename.rs index 8d4757f0a477..082e8321e18a 100644 --- a/src/test/ui/run-pass/imports/import-rename.rs +++ b/src/test/run-pass/imports/import-rename.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use foo::{x, y as fooy}; use Maybe::{Yes as MaybeYes}; diff --git a/src/test/ui/run-pass/imports/import-trailing-comma.rs b/src/test/run-pass/imports/import-trailing-comma.rs similarity index 100% rename from src/test/ui/run-pass/imports/import-trailing-comma.rs rename to src/test/run-pass/imports/import-trailing-comma.rs diff --git a/src/test/ui/run-pass/imports/import.rs b/src/test/run-pass/imports/import.rs similarity index 100% rename from src/test/ui/run-pass/imports/import.rs rename to src/test/run-pass/imports/import.rs diff --git a/src/test/ui/run-pass/imports/import2.rs b/src/test/run-pass/imports/import2.rs similarity index 100% rename from src/test/ui/run-pass/imports/import2.rs rename to src/test/run-pass/imports/import2.rs diff --git a/src/test/ui/run-pass/imports/import3.rs b/src/test/run-pass/imports/import3.rs similarity index 100% rename from src/test/ui/run-pass/imports/import3.rs rename to src/test/run-pass/imports/import3.rs diff --git a/src/test/ui/run-pass/imports/import4.rs b/src/test/run-pass/imports/import4.rs similarity index 100% rename from src/test/ui/run-pass/imports/import4.rs rename to src/test/run-pass/imports/import4.rs diff --git a/src/test/ui/run-pass/imports/import5.rs b/src/test/run-pass/imports/import5.rs similarity index 100% rename from src/test/ui/run-pass/imports/import5.rs rename to src/test/run-pass/imports/import5.rs diff --git a/src/test/ui/run-pass/imports/import6.rs b/src/test/run-pass/imports/import6.rs similarity index 100% rename from src/test/ui/run-pass/imports/import6.rs rename to src/test/run-pass/imports/import6.rs diff --git a/src/test/ui/run-pass/imports/import7.rs b/src/test/run-pass/imports/import7.rs similarity index 100% rename from src/test/ui/run-pass/imports/import7.rs rename to src/test/run-pass/imports/import7.rs diff --git a/src/test/ui/run-pass/imports/import8.rs b/src/test/run-pass/imports/import8.rs similarity index 100% rename from src/test/ui/run-pass/imports/import8.rs rename to src/test/run-pass/imports/import8.rs diff --git a/src/test/ui/run-pass/imports/imports.rs b/src/test/run-pass/imports/imports.rs similarity index 100% rename from src/test/ui/run-pass/imports/imports.rs rename to src/test/run-pass/imports/imports.rs diff --git a/src/test/ui/run-pass/intrinsics/auxiliary/cci_intrinsic.rs b/src/test/run-pass/intrinsics/auxiliary/cci_intrinsic.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/auxiliary/cci_intrinsic.rs rename to src/test/run-pass/intrinsics/auxiliary/cci_intrinsic.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-alignment.rs b/src/test/run-pass/intrinsics/intrinsic-alignment.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-alignment.rs rename to src/test/run-pass/intrinsics/intrinsic-alignment.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-assume.rs b/src/test/run-pass/intrinsics/intrinsic-assume.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-assume.rs rename to src/test/run-pass/intrinsics/intrinsic-assume.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-atomics-cc.rs b/src/test/run-pass/intrinsics/intrinsic-atomics-cc.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-atomics-cc.rs rename to src/test/run-pass/intrinsics/intrinsic-atomics-cc.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-atomics.rs b/src/test/run-pass/intrinsics/intrinsic-atomics.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-atomics.rs rename to src/test/run-pass/intrinsics/intrinsic-atomics.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-move-val-cleanups.rs b/src/test/run-pass/intrinsics/intrinsic-move-val-cleanups.rs similarity index 99% rename from src/test/ui/run-pass/intrinsics/intrinsic-move-val-cleanups.rs rename to src/test/run-pass/intrinsics/intrinsic-move-val-cleanups.rs index 5b04daeb3320..0f8088c8969f 100644 --- a/src/test/ui/run-pass/intrinsics/intrinsic-move-val-cleanups.rs +++ b/src/test/run-pass/intrinsics/intrinsic-move-val-cleanups.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_unsafe)] +#![allow(unreachable_code)] // ignore-emscripten no threads support #![allow(stable_features)] diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-move-val.rs b/src/test/run-pass/intrinsics/intrinsic-move-val.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-move-val.rs rename to src/test/run-pass/intrinsics/intrinsic-move-val.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-uninit.rs b/src/test/run-pass/intrinsics/intrinsic-uninit.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-uninit.rs rename to src/test/run-pass/intrinsics/intrinsic-uninit.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsic-unreachable.rs b/src/test/run-pass/intrinsics/intrinsic-unreachable.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsic-unreachable.rs rename to src/test/run-pass/intrinsics/intrinsic-unreachable.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsics-integer.rs b/src/test/run-pass/intrinsics/intrinsics-integer.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsics-integer.rs rename to src/test/run-pass/intrinsics/intrinsics-integer.rs diff --git a/src/test/ui/run-pass/intrinsics/intrinsics-math.rs b/src/test/run-pass/intrinsics/intrinsics-math.rs similarity index 100% rename from src/test/ui/run-pass/intrinsics/intrinsics-math.rs rename to src/test/run-pass/intrinsics/intrinsics-math.rs diff --git a/src/test/ui/run-pass/issues/.gitattributes b/src/test/run-pass/issues/.gitattributes similarity index 100% rename from src/test/ui/run-pass/issues/.gitattributes rename to src/test/run-pass/issues/.gitattributes diff --git a/src/test/ui/run-pass/issues/auxiliary/cgu_test.rs b/src/test/run-pass/issues/auxiliary/cgu_test.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/cgu_test.rs rename to src/test/run-pass/issues/auxiliary/cgu_test.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/cgu_test_a.rs b/src/test/run-pass/issues/auxiliary/cgu_test_a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/cgu_test_a.rs rename to src/test/run-pass/issues/auxiliary/cgu_test_a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/cgu_test_b.rs b/src/test/run-pass/issues/auxiliary/cgu_test_b.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/cgu_test_b.rs rename to src/test/run-pass/issues/auxiliary/cgu_test_b.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/i8.rs b/src/test/run-pass/issues/auxiliary/i8.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/i8.rs rename to src/test/run-pass/issues/auxiliary/i8.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/iss.rs b/src/test/run-pass/issues/auxiliary/iss.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/iss.rs rename to src/test/run-pass/issues/auxiliary/iss.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-10028.rs b/src/test/run-pass/issues/auxiliary/issue-10028.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-10028.rs rename to src/test/run-pass/issues/auxiliary/issue-10028.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11224.rs b/src/test/run-pass/issues/auxiliary/issue-11224.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11224.rs rename to src/test/run-pass/issues/auxiliary/issue-11224.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11225-1.rs b/src/test/run-pass/issues/auxiliary/issue-11225-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11225-1.rs rename to src/test/run-pass/issues/auxiliary/issue-11225-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11225-2.rs b/src/test/run-pass/issues/auxiliary/issue-11225-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11225-2.rs rename to src/test/run-pass/issues/auxiliary/issue-11225-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11225-3.rs b/src/test/run-pass/issues/auxiliary/issue-11225-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11225-3.rs rename to src/test/run-pass/issues/auxiliary/issue-11225-3.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11508.rs b/src/test/run-pass/issues/auxiliary/issue-11508.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11508.rs rename to src/test/run-pass/issues/auxiliary/issue-11508.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-11529.rs b/src/test/run-pass/issues/auxiliary/issue-11529.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-11529.rs rename to src/test/run-pass/issues/auxiliary/issue-11529.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-12133-dylib.rs b/src/test/run-pass/issues/auxiliary/issue-12133-dylib.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-12133-dylib.rs rename to src/test/run-pass/issues/auxiliary/issue-12133-dylib.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-12133-dylib2.rs b/src/test/run-pass/issues/auxiliary/issue-12133-dylib2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-12133-dylib2.rs rename to src/test/run-pass/issues/auxiliary/issue-12133-dylib2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-12133-rlib.rs b/src/test/run-pass/issues/auxiliary/issue-12133-rlib.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-12133-rlib.rs rename to src/test/run-pass/issues/auxiliary/issue-12133-rlib.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-12660-aux.rs b/src/test/run-pass/issues/auxiliary/issue-12660-aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-12660-aux.rs rename to src/test/run-pass/issues/auxiliary/issue-12660-aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-13620-1.rs b/src/test/run-pass/issues/auxiliary/issue-13620-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-13620-1.rs rename to src/test/run-pass/issues/auxiliary/issue-13620-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-13620-2.rs b/src/test/run-pass/issues/auxiliary/issue-13620-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-13620-2.rs rename to src/test/run-pass/issues/auxiliary/issue-13620-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-13872-1.rs b/src/test/run-pass/issues/auxiliary/issue-13872-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-13872-1.rs rename to src/test/run-pass/issues/auxiliary/issue-13872-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-13872-2.rs b/src/test/run-pass/issues/auxiliary/issue-13872-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-13872-2.rs rename to src/test/run-pass/issues/auxiliary/issue-13872-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-13872-3.rs b/src/test/run-pass/issues/auxiliary/issue-13872-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-13872-3.rs rename to src/test/run-pass/issues/auxiliary/issue-13872-3.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-14344-1.rs b/src/test/run-pass/issues/auxiliary/issue-14344-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-14344-1.rs rename to src/test/run-pass/issues/auxiliary/issue-14344-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-14344-2.rs b/src/test/run-pass/issues/auxiliary/issue-14344-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-14344-2.rs rename to src/test/run-pass/issues/auxiliary/issue-14344-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-14421.rs b/src/test/run-pass/issues/auxiliary/issue-14421.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-14421.rs rename to src/test/run-pass/issues/auxiliary/issue-14421.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-14422.rs b/src/test/run-pass/issues/auxiliary/issue-14422.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-14422.rs rename to src/test/run-pass/issues/auxiliary/issue-14422.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-15562.rs b/src/test/run-pass/issues/auxiliary/issue-15562.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-15562.rs rename to src/test/run-pass/issues/auxiliary/issue-15562.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-16643.rs b/src/test/run-pass/issues/auxiliary/issue-16643.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-16643.rs rename to src/test/run-pass/issues/auxiliary/issue-16643.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-17662.rs b/src/test/run-pass/issues/auxiliary/issue-17662.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-17662.rs rename to src/test/run-pass/issues/auxiliary/issue-17662.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-17718-aux.rs b/src/test/run-pass/issues/auxiliary/issue-17718-aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-17718-aux.rs rename to src/test/run-pass/issues/auxiliary/issue-17718-aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-18501.rs b/src/test/run-pass/issues/auxiliary/issue-18501.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-18501.rs rename to src/test/run-pass/issues/auxiliary/issue-18501.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-18514.rs b/src/test/run-pass/issues/auxiliary/issue-18514.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-18514.rs rename to src/test/run-pass/issues/auxiliary/issue-18514.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-18711.rs b/src/test/run-pass/issues/auxiliary/issue-18711.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-18711.rs rename to src/test/run-pass/issues/auxiliary/issue-18711.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-18913-1.rs b/src/test/run-pass/issues/auxiliary/issue-18913-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-18913-1.rs rename to src/test/run-pass/issues/auxiliary/issue-18913-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-18913-2.rs b/src/test/run-pass/issues/auxiliary/issue-18913-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-18913-2.rs rename to src/test/run-pass/issues/auxiliary/issue-18913-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-19340-1.rs b/src/test/run-pass/issues/auxiliary/issue-19340-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-19340-1.rs rename to src/test/run-pass/issues/auxiliary/issue-19340-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-2380.rs b/src/test/run-pass/issues/auxiliary/issue-2380.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-2380.rs rename to src/test/run-pass/issues/auxiliary/issue-2380.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-2414-a.rs b/src/test/run-pass/issues/auxiliary/issue-2414-a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-2414-a.rs rename to src/test/run-pass/issues/auxiliary/issue-2414-a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-2414-b.rs b/src/test/run-pass/issues/auxiliary/issue-2414-b.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-2414-b.rs rename to src/test/run-pass/issues/auxiliary/issue-2414-b.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-25185-1.rs b/src/test/run-pass/issues/auxiliary/issue-25185-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-25185-1.rs rename to src/test/run-pass/issues/auxiliary/issue-25185-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-25185-2.rs b/src/test/run-pass/issues/auxiliary/issue-25185-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-25185-2.rs rename to src/test/run-pass/issues/auxiliary/issue-25185-2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-2526.rs b/src/test/run-pass/issues/auxiliary/issue-2526.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-2526.rs rename to src/test/run-pass/issues/auxiliary/issue-2526.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-25467.rs b/src/test/run-pass/issues/auxiliary/issue-25467.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-25467.rs rename to src/test/run-pass/issues/auxiliary/issue-25467.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-2631-a.rs b/src/test/run-pass/issues/auxiliary/issue-2631-a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-2631-a.rs rename to src/test/run-pass/issues/auxiliary/issue-2631-a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-29485.rs b/src/test/run-pass/issues/auxiliary/issue-29485.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-29485.rs rename to src/test/run-pass/issues/auxiliary/issue-29485.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-3012-1.rs b/src/test/run-pass/issues/auxiliary/issue-3012-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-3012-1.rs rename to src/test/run-pass/issues/auxiliary/issue-3012-1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-36954.rs b/src/test/run-pass/issues/auxiliary/issue-36954.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-36954.rs rename to src/test/run-pass/issues/auxiliary/issue-36954.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-41394.rs b/src/test/run-pass/issues/auxiliary/issue-41394.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-41394.rs rename to src/test/run-pass/issues/auxiliary/issue-41394.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-4208-cc.rs b/src/test/run-pass/issues/auxiliary/issue-4208-cc.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-4208-cc.rs rename to src/test/run-pass/issues/auxiliary/issue-4208-cc.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-4545.rs b/src/test/run-pass/issues/auxiliary/issue-4545.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-4545.rs rename to src/test/run-pass/issues/auxiliary/issue-4545.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-48984-aux.rs b/src/test/run-pass/issues/auxiliary/issue-48984-aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-48984-aux.rs rename to src/test/run-pass/issues/auxiliary/issue-48984-aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-5518.rs b/src/test/run-pass/issues/auxiliary/issue-5518.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-5518.rs rename to src/test/run-pass/issues/auxiliary/issue-5518.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-5521.rs b/src/test/run-pass/issues/auxiliary/issue-5521.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-5521.rs rename to src/test/run-pass/issues/auxiliary/issue-5521.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-7178.rs b/src/test/run-pass/issues/auxiliary/issue-7178.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-7178.rs rename to src/test/run-pass/issues/auxiliary/issue-7178.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-7899.rs b/src/test/run-pass/issues/auxiliary/issue-7899.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-7899.rs rename to src/test/run-pass/issues/auxiliary/issue-7899.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-8044.rs b/src/test/run-pass/issues/auxiliary/issue-8044.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-8044.rs rename to src/test/run-pass/issues/auxiliary/issue-8044.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-8259.rs b/src/test/run-pass/issues/auxiliary/issue-8259.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-8259.rs rename to src/test/run-pass/issues/auxiliary/issue-8259.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-9906.rs b/src/test/run-pass/issues/auxiliary/issue-9906.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-9906.rs rename to src/test/run-pass/issues/auxiliary/issue-9906.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue-9968.rs b/src/test/run-pass/issues/auxiliary/issue-9968.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue-9968.rs rename to src/test/run-pass/issues/auxiliary/issue-9968.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue13507.rs b/src/test/run-pass/issues/auxiliary/issue13507.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue13507.rs rename to src/test/run-pass/issues/auxiliary/issue13507.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue2170lib.rs b/src/test/run-pass/issues/auxiliary/issue2170lib.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue2170lib.rs rename to src/test/run-pass/issues/auxiliary/issue2170lib.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue34796aux.rs b/src/test/run-pass/issues/auxiliary/issue34796aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue34796aux.rs rename to src/test/run-pass/issues/auxiliary/issue34796aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_10031_aux.rs b/src/test/run-pass/issues/auxiliary/issue_10031_aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_10031_aux.rs rename to src/test/run-pass/issues/auxiliary/issue_10031_aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_12612_1.rs b/src/test/run-pass/issues/auxiliary/issue_12612_1.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_12612_1.rs rename to src/test/run-pass/issues/auxiliary/issue_12612_1.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_12612_2.rs b/src/test/run-pass/issues/auxiliary/issue_12612_2.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_12612_2.rs rename to src/test/run-pass/issues/auxiliary/issue_12612_2.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_19293.rs b/src/test/run-pass/issues/auxiliary/issue_19293.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_19293.rs rename to src/test/run-pass/issues/auxiliary/issue_19293.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_20389.rs b/src/test/run-pass/issues/auxiliary/issue_20389.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_20389.rs rename to src/test/run-pass/issues/auxiliary/issue_20389.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_2316_a.rs b/src/test/run-pass/issues/auxiliary/issue_2316_a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_2316_a.rs rename to src/test/run-pass/issues/auxiliary/issue_2316_a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_2316_b.rs b/src/test/run-pass/issues/auxiliary/issue_2316_b.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_2316_b.rs rename to src/test/run-pass/issues/auxiliary/issue_2316_b.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_2472_b.rs b/src/test/run-pass/issues/auxiliary/issue_2472_b.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_2472_b.rs rename to src/test/run-pass/issues/auxiliary/issue_2472_b.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_2723_a.rs b/src/test/run-pass/issues/auxiliary/issue_2723_a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_2723_a.rs rename to src/test/run-pass/issues/auxiliary/issue_2723_a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_3136_a.rc b/src/test/run-pass/issues/auxiliary/issue_3136_a.rc similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_3136_a.rc rename to src/test/run-pass/issues/auxiliary/issue_3136_a.rc diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_3136_a.rs b/src/test/run-pass/issues/auxiliary/issue_3136_a.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_3136_a.rs rename to src/test/run-pass/issues/auxiliary/issue_3136_a.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_38190.rs b/src/test/run-pass/issues/auxiliary/issue_38190.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_38190.rs rename to src/test/run-pass/issues/auxiliary/issue_38190.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_38226_aux.rs b/src/test/run-pass/issues/auxiliary/issue_38226_aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_38226_aux.rs rename to src/test/run-pass/issues/auxiliary/issue_38226_aux.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_38715-modern.rs b/src/test/run-pass/issues/auxiliary/issue_38715-modern.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_38715-modern.rs rename to src/test/run-pass/issues/auxiliary/issue_38715-modern.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_38715.rs b/src/test/run-pass/issues/auxiliary/issue_38715.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_38715.rs rename to src/test/run-pass/issues/auxiliary/issue_38715.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_3979_traits.rs b/src/test/run-pass/issues/auxiliary/issue_3979_traits.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_3979_traits.rs rename to src/test/run-pass/issues/auxiliary/issue_3979_traits.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_39823.rs b/src/test/run-pass/issues/auxiliary/issue_39823.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_39823.rs rename to src/test/run-pass/issues/auxiliary/issue_39823.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_40469.rs b/src/test/run-pass/issues/auxiliary/issue_40469.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_40469.rs rename to src/test/run-pass/issues/auxiliary/issue_40469.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_41053.rs b/src/test/run-pass/issues/auxiliary/issue_41053.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_41053.rs rename to src/test/run-pass/issues/auxiliary/issue_41053.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_42007_s.rs b/src/test/run-pass/issues/auxiliary/issue_42007_s.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_42007_s.rs rename to src/test/run-pass/issues/auxiliary/issue_42007_s.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_8401.rs b/src/test/run-pass/issues/auxiliary/issue_8401.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_8401.rs rename to src/test/run-pass/issues/auxiliary/issue_8401.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_9123.rs b/src/test/run-pass/issues/auxiliary/issue_9123.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_9123.rs rename to src/test/run-pass/issues/auxiliary/issue_9123.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_9155.rs b/src/test/run-pass/issues/auxiliary/issue_9155.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_9155.rs rename to src/test/run-pass/issues/auxiliary/issue_9155.rs diff --git a/src/test/ui/run-pass/issues/auxiliary/issue_9188.rs b/src/test/run-pass/issues/auxiliary/issue_9188.rs similarity index 100% rename from src/test/ui/run-pass/issues/auxiliary/issue_9188.rs rename to src/test/run-pass/issues/auxiliary/issue_9188.rs diff --git a/src/test/ui/run-pass/issues/issue-10025.rs b/src/test/run-pass/issues/issue-10025.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-10025.rs rename to src/test/run-pass/issues/issue-10025.rs index bd286bca9384..109663ac8aea 100644 --- a/src/test/ui/run-pass/issues/issue-10025.rs +++ b/src/test/run-pass/issues/issue-10025.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 unsafe extern fn foo() {} diff --git a/src/test/ui/run-pass/issues/issue-10028.rs b/src/test/run-pass/issues/issue-10028.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-10028.rs rename to src/test/run-pass/issues/issue-10028.rs index b89ecb0b9df4..2f7cbcde803b 100644 --- a/src/test/ui/run-pass/issues/issue-10028.rs +++ b/src/test/run-pass/issues/issue-10028.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue-10028.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-10031.rs b/src/test/run-pass/issues/issue-10031.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10031.rs rename to src/test/run-pass/issues/issue-10031.rs diff --git a/src/test/ui/run-pass/issues/issue-10228.rs b/src/test/run-pass/issues/issue-10228.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-10228.rs rename to src/test/run-pass/issues/issue-10228.rs index 7ed8f5be936a..940b478c615d 100644 --- a/src/test/ui/run-pass/issues/issue-10228.rs +++ b/src/test/run-pass/issues/issue-10228.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 enum StdioContainer { diff --git a/src/test/ui/run-pass/issues/issue-10392.rs b/src/test/run-pass/issues/issue-10392.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-10392.rs rename to src/test/run-pass/issues/issue-10392.rs index 65c88f445c29..8042797f778e 100644 --- a/src/test/ui/run-pass/issues/issue-10392.rs +++ b/src/test/run-pass/issues/issue-10392.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] struct A { foo: isize } struct B { a: isize, b: isize, c: isize } diff --git a/src/test/ui/run-pass/issues/issue-10396.rs b/src/test/run-pass/issues/issue-10396.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-10396.rs rename to src/test/run-pass/issues/issue-10396.rs index f0b3b276fcf3..5b7bfe1a02ec 100644 --- a/src/test/ui/run-pass/issues/issue-10396.rs +++ b/src/test/run-pass/issues/issue-10396.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug)] enum Foo<'s> { V(&'s str) diff --git a/src/test/ui/run-pass/issues/issue-10436.rs b/src/test/run-pass/issues/issue-10436.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10436.rs rename to src/test/run-pass/issues/issue-10436.rs diff --git a/src/test/ui/run-pass/issues/issue-10456.rs b/src/test/run-pass/issues/issue-10456.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10456.rs rename to src/test/run-pass/issues/issue-10456.rs diff --git a/src/test/ui/run-pass/issues/issue-10626.rs b/src/test/run-pass/issues/issue-10626.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10626.rs rename to src/test/run-pass/issues/issue-10626.rs diff --git a/src/test/ui/run-pass/issues/issue-10638.rs b/src/test/run-pass/issues/issue-10638.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10638.rs rename to src/test/run-pass/issues/issue-10638.rs diff --git a/src/test/ui/run-pass/issues/issue-10682.rs b/src/test/run-pass/issues/issue-10682.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10682.rs rename to src/test/run-pass/issues/issue-10682.rs diff --git a/src/test/ui/run-pass/issues/issue-10683.rs b/src/test/run-pass/issues/issue-10683.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10683.rs rename to src/test/run-pass/issues/issue-10683.rs diff --git a/src/test/ui/run-pass/issues/issue-10718.rs b/src/test/run-pass/issues/issue-10718.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10718.rs rename to src/test/run-pass/issues/issue-10718.rs diff --git a/src/test/ui/run-pass/issues/issue-10734.rs b/src/test/run-pass/issues/issue-10734.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10734.rs rename to src/test/run-pass/issues/issue-10734.rs diff --git a/src/test/ui/run-pass/issues/issue-10763.rs b/src/test/run-pass/issues/issue-10763.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-10763.rs rename to src/test/run-pass/issues/issue-10763.rs index 9f03cd34114f..705cc3fad132 100644 --- a/src/test/ui/run-pass/issues/issue-10763.rs +++ b/src/test/run-pass/issues/issue-10763.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 extern "Rust" fn foo() {} diff --git a/src/test/ui/run-pass/issues/issue-10764.rs b/src/test/run-pass/issues/issue-10764.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10764.rs rename to src/test/run-pass/issues/issue-10764.rs diff --git a/src/test/ui/run-pass/issues/issue-10767.rs b/src/test/run-pass/issues/issue-10767.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10767.rs rename to src/test/run-pass/issues/issue-10767.rs diff --git a/src/test/ui/run-pass/issues/issue-10802.rs b/src/test/run-pass/issues/issue-10802.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-10802.rs rename to src/test/run-pass/issues/issue-10802.rs index 3967ee445838..bd5d7059c213 100644 --- a/src/test/ui/run-pass/issues/issue-10802.rs +++ b/src/test/run-pass/issues/issue-10802.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct DroppableStruct; diff --git a/src/test/ui/run-pass/issues/issue-10806.rs b/src/test/run-pass/issues/issue-10806.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-10806.rs rename to src/test/run-pass/issues/issue-10806.rs index 3cfbd7039540..6dfa0ecc2918 100644 --- a/src/test/ui/run-pass/issues/issue-10806.rs +++ b/src/test/run-pass/issues/issue-10806.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-10853.rs b/src/test/run-pass/issues/issue-10853.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-10853.rs rename to src/test/run-pass/issues/issue-10853.rs diff --git a/src/test/ui/run-pass/issues/issue-10902.rs b/src/test/run-pass/issues/issue-10902.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-10902.rs rename to src/test/run-pass/issues/issue-10902.rs index f27b4576d033..df9dc0b63d9c 100644 --- a/src/test/ui/run-pass/issues/issue-10902.rs +++ b/src/test/run-pass/issues/issue-10902.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub mod two_tuple { diff --git a/src/test/ui/run-pass/issues/issue-11047.rs b/src/test/run-pass/issues/issue-11047.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11047.rs rename to src/test/run-pass/issues/issue-11047.rs diff --git a/src/test/ui/run-pass/issues/issue-11085.rs b/src/test/run-pass/issues/issue-11085.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-11085.rs rename to src/test/run-pass/issues/issue-11085.rs index 76a047e2a207..50c87575773e 100644 --- a/src/test/ui/run-pass/issues/issue-11085.rs +++ b/src/test/run-pass/issues/issue-11085.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: --cfg foo // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-1112.rs b/src/test/run-pass/issues/issue-1112.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-1112.rs rename to src/test/run-pass/issues/issue-1112.rs index ee1711b13333..4283ae0fafbb 100644 --- a/src/test/ui/run-pass/issues/issue-1112.rs +++ b/src/test/run-pass/issues/issue-1112.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #1112 // Alignment of interior pointers to dynamic-size types diff --git a/src/test/ui/run-pass/issues/issue-11205.rs b/src/test/run-pass/issues/issue-11205.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11205.rs rename to src/test/run-pass/issues/issue-11205.rs diff --git a/src/test/ui/run-pass/issues/issue-11224.rs b/src/test/run-pass/issues/issue-11224.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11224.rs rename to src/test/run-pass/issues/issue-11224.rs diff --git a/src/test/ui/run-pass/issues/issue-11225-1.rs b/src/test/run-pass/issues/issue-11225-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11225-1.rs rename to src/test/run-pass/issues/issue-11225-1.rs diff --git a/src/test/ui/run-pass/issues/issue-11225-2.rs b/src/test/run-pass/issues/issue-11225-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11225-2.rs rename to src/test/run-pass/issues/issue-11225-2.rs diff --git a/src/test/ui/run-pass/issues/issue-11225-3.rs b/src/test/run-pass/issues/issue-11225-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11225-3.rs rename to src/test/run-pass/issues/issue-11225-3.rs diff --git a/src/test/ui/run-pass/issues/issue-11267.rs b/src/test/run-pass/issues/issue-11267.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11267.rs rename to src/test/run-pass/issues/issue-11267.rs diff --git a/src/test/ui/run-pass/issues/issue-11382.rs b/src/test/run-pass/issues/issue-11382.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11382.rs rename to src/test/run-pass/issues/issue-11382.rs diff --git a/src/test/ui/run-pass/issues/issue-11384.rs b/src/test/run-pass/issues/issue-11384.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11384.rs rename to src/test/run-pass/issues/issue-11384.rs diff --git a/src/test/ui/run-pass/issues/issue-11508.rs b/src/test/run-pass/issues/issue-11508.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11508.rs rename to src/test/run-pass/issues/issue-11508.rs diff --git a/src/test/ui/run-pass/issues/issue-11529.rs b/src/test/run-pass/issues/issue-11529.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11529.rs rename to src/test/run-pass/issues/issue-11529.rs diff --git a/src/test/ui/run-pass/issues/issue-11552.rs b/src/test/run-pass/issues/issue-11552.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11552.rs rename to src/test/run-pass/issues/issue-11552.rs diff --git a/src/test/ui/run-pass/issues/issue-11577.rs b/src/test/run-pass/issues/issue-11577.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11577.rs rename to src/test/run-pass/issues/issue-11577.rs diff --git a/src/test/ui/run-pass/issues/issue-11592.rs b/src/test/run-pass/issues/issue-11592.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11592.rs rename to src/test/run-pass/issues/issue-11592.rs diff --git a/src/test/ui/run-pass/issues/issue-11612.rs b/src/test/run-pass/issues/issue-11612.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-11612.rs rename to src/test/run-pass/issues/issue-11612.rs index 763e538fb8f5..ba17a02dd387 100644 --- a/src/test/ui/run-pass/issues/issue-11612.rs +++ b/src/test/run-pass/issues/issue-11612.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // #11612 // We weren't updating the auto adjustments with all the resolved // type information after type check. diff --git a/src/test/ui/run-pass/issues/issue-11677.rs b/src/test/run-pass/issues/issue-11677.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-11677.rs rename to src/test/run-pass/issues/issue-11677.rs index a4d4feb4f8ac..d9bc76f9b033 100644 --- a/src/test/ui/run-pass/issues/issue-11677.rs +++ b/src/test/run-pass/issues/issue-11677.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(dead_code)] diff --git a/src/test/ui/run-pass/issues/issue-11709.rs b/src/test/run-pass/issues/issue-11709.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-11709.rs rename to src/test/run-pass/issues/issue-11709.rs index ffd6f1dfb55b..7f1669abe1cd 100644 --- a/src/test/ui/run-pass/issues/issue-11709.rs +++ b/src/test/run-pass/issues/issue-11709.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-pretty issue #37199 // Don't panic on blocks without results diff --git a/src/test/ui/run-pass/issues/issue-11820.rs b/src/test/run-pass/issues/issue-11820.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11820.rs rename to src/test/run-pass/issues/issue-11820.rs diff --git a/src/test/ui/run-pass/issues/issue-11869.rs b/src/test/run-pass/issues/issue-11869.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-11869.rs rename to src/test/run-pass/issues/issue-11869.rs index be20f7a0feca..b3543f726daa 100644 --- a/src/test/ui/run-pass/issues/issue-11869.rs +++ b/src/test/run-pass/issues/issue-11869.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct A { diff --git a/src/test/ui/run-pass/issues/issue-11940.rs b/src/test/run-pass/issues/issue-11940.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11940.rs rename to src/test/run-pass/issues/issue-11940.rs diff --git a/src/test/ui/run-pass/issues/issue-11958.rs b/src/test/run-pass/issues/issue-11958.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-11958.rs rename to src/test/run-pass/issues/issue-11958.rs diff --git a/src/test/ui/run-pass/issues/issue-12033.rs b/src/test/run-pass/issues/issue-12033.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12033.rs rename to src/test/run-pass/issues/issue-12033.rs diff --git a/src/test/ui/run-pass/issues/issue-12133-1.rs b/src/test/run-pass/issues/issue-12133-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12133-1.rs rename to src/test/run-pass/issues/issue-12133-1.rs diff --git a/src/test/ui/run-pass/issues/issue-12133-2.rs b/src/test/run-pass/issues/issue-12133-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12133-2.rs rename to src/test/run-pass/issues/issue-12133-2.rs diff --git a/src/test/ui/run-pass/issues/issue-12133-3.rs b/src/test/run-pass/issues/issue-12133-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12133-3.rs rename to src/test/run-pass/issues/issue-12133-3.rs diff --git a/src/test/ui/run-pass/issues/issue-12285.rs b/src/test/run-pass/issues/issue-12285.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12285.rs rename to src/test/run-pass/issues/issue-12285.rs diff --git a/src/test/ui/run-pass/issues/issue-1251.rs b/src/test/run-pass/issues/issue-1251.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-1251.rs rename to src/test/run-pass/issues/issue-1251.rs index a7bc8718003e..f9d48b8c835a 100644 --- a/src/test/ui/run-pass/issues/issue-1251.rs +++ b/src/test/run-pass/issues/issue-1251.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] +#![allow(dead_code)] // pretty-expanded FIXME #23616 // ignore-wasm32-bare no libc to test ffi with diff --git a/src/test/ui/run-pass/issues/issue-1257.rs b/src/test/run-pass/issues/issue-1257.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-1257.rs rename to src/test/run-pass/issues/issue-1257.rs diff --git a/src/test/ui/run-pass/issues/issue-12582.rs b/src/test/run-pass/issues/issue-12582.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12582.rs rename to src/test/run-pass/issues/issue-12582.rs diff --git a/src/test/ui/run-pass/issues/issue-12612.rs b/src/test/run-pass/issues/issue-12612.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-12612.rs rename to src/test/run-pass/issues/issue-12612.rs index dd9c9abaf65f..d9b563be2c0c 100644 --- a/src/test/ui/run-pass/issues/issue-12612.rs +++ b/src/test/run-pass/issues/issue-12612.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:issue_12612_1.rs // aux-build:issue_12612_2.rs diff --git a/src/test/ui/run-pass/issues/issue-12660.rs b/src/test/run-pass/issues/issue-12660.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12660.rs rename to src/test/run-pass/issues/issue-12660.rs diff --git a/src/test/ui/run-pass/issues/issue-12677.rs b/src/test/run-pass/issues/issue-12677.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12677.rs rename to src/test/run-pass/issues/issue-12677.rs diff --git a/src/test/ui/run-pass/issues/issue-12699.rs b/src/test/run-pass/issues/issue-12699.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12699.rs rename to src/test/run-pass/issues/issue-12699.rs diff --git a/src/test/ui/run-pass/issues/issue-12729.rs b/src/test/run-pass/issues/issue-12729.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-12729.rs rename to src/test/run-pass/issues/issue-12729.rs index f75090c4223a..efcc05cc1964 100644 --- a/src/test/ui/run-pass/issues/issue-12729.rs +++ b/src/test/run-pass/issues/issue-12729.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub struct Foo; diff --git a/src/test/ui/run-pass/issues/issue-12744.rs b/src/test/run-pass/issues/issue-12744.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12744.rs rename to src/test/run-pass/issues/issue-12744.rs diff --git a/src/test/ui/run-pass/issues/issue-12860.rs b/src/test/run-pass/issues/issue-12860.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-12860.rs rename to src/test/run-pass/issues/issue-12860.rs diff --git a/src/test/ui/run-pass/issues/issue-12909.rs b/src/test/run-pass/issues/issue-12909.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-12909.rs rename to src/test/run-pass/issues/issue-12909.rs index d4db01a5e582..4070464ba3a8 100644 --- a/src/test/ui/run-pass/issues/issue-12909.rs +++ b/src/test/run-pass/issues/issue-12909.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 use std::collections::HashMap; diff --git a/src/test/ui/run-pass/issues/issue-13027.rs b/src/test/run-pass/issues/issue-13027.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13027.rs rename to src/test/run-pass/issues/issue-13027.rs diff --git a/src/test/ui/run-pass/issues/issue-13105.rs b/src/test/run-pass/issues/issue-13105.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13105.rs rename to src/test/run-pass/issues/issue-13105.rs diff --git a/src/test/ui/run-pass/issues/issue-13167.rs b/src/test/run-pass/issues/issue-13167.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13167.rs rename to src/test/run-pass/issues/issue-13167.rs diff --git a/src/test/ui/run-pass/issues/issue-13204.rs b/src/test/run-pass/issues/issue-13204.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13204.rs rename to src/test/run-pass/issues/issue-13204.rs index 4aa2c49b428a..0d5a7e071387 100644 --- a/src/test/ui/run-pass/issues/issue-13204.rs +++ b/src/test/run-pass/issues/issue-13204.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // Test that when instantiating trait default methods, typeck handles // lifetime parameters defined on the method bound correctly. diff --git a/src/test/ui/run-pass/issues/issue-13214.rs b/src/test/run-pass/issues/issue-13214.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13214.rs rename to src/test/run-pass/issues/issue-13214.rs index 634cbbb0417d..1c119bb634df 100644 --- a/src/test/ui/run-pass/issues/issue-13214.rs +++ b/src/test/run-pass/issues/issue-13214.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // defining static with struct that contains enum // with &'static str variant used to cause ICE diff --git a/src/test/ui/run-pass/issues/issue-13259-windows-tcb-trash.rs b/src/test/run-pass/issues/issue-13259-windows-tcb-trash.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13259-windows-tcb-trash.rs rename to src/test/run-pass/issues/issue-13259-windows-tcb-trash.rs diff --git a/src/test/ui/run-pass/issues/issue-13264.rs b/src/test/run-pass/issues/issue-13264.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13264.rs rename to src/test/run-pass/issues/issue-13264.rs diff --git a/src/test/ui/run-pass/issues/issue-13304.rs b/src/test/run-pass/issues/issue-13304.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-13304.rs rename to src/test/run-pass/issues/issue-13304.rs index 117cb0bbe16e..a2a30b26d47d 100644 --- a/src/test/ui/run-pass/issues/issue-13304.rs +++ b/src/test/run-pass/issues/issue-13304.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // ignore-cloudabi no processes // ignore-emscripten no processes diff --git a/src/test/ui/run-pass/issues/issue-13323.rs b/src/test/run-pass/issues/issue-13323.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13323.rs rename to src/test/run-pass/issues/issue-13323.rs diff --git a/src/test/ui/run-pass/issues/issue-13405.rs b/src/test/run-pass/issues/issue-13405.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-13405.rs rename to src/test/run-pass/issues/issue-13405.rs index 3b9fdf84b5d0..a8ca38838d19 100644 --- a/src/test/ui/run-pass/issues/issue-13405.rs +++ b/src/test/run-pass/issues/issue-13405.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 struct Foo<'a> { diff --git a/src/test/ui/run-pass/issues/issue-13434.rs b/src/test/run-pass/issues/issue-13434.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13434.rs rename to src/test/run-pass/issues/issue-13434.rs diff --git a/src/test/ui/run-pass/issues/issue-13494.rs b/src/test/run-pass/issues/issue-13494.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13494.rs rename to src/test/run-pass/issues/issue-13494.rs index 553f3a7fec96..0750a4c89593 100644 --- a/src/test/ui/run-pass/issues/issue-13494.rs +++ b/src/test/run-pass/issues/issue-13494.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support // This test may not always fail, but it can be flaky if the race it used to diff --git a/src/test/ui/run-pass/issues/issue-13507-2.rs b/src/test/run-pass/issues/issue-13507-2.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-13507-2.rs rename to src/test/run-pass/issues/issue-13507-2.rs index 894cd7ac0117..a189b8f1688b 100644 --- a/src/test/ui/run-pass/issues/issue-13507-2.rs +++ b/src/test/run-pass/issues/issue-13507-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:issue13507.rs extern crate issue13507; diff --git a/src/test/ui/run-pass/issues/issue-13620.rs b/src/test/run-pass/issues/issue-13620.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13620.rs rename to src/test/run-pass/issues/issue-13620.rs diff --git a/src/test/ui/run-pass/issues/issue-13655.rs b/src/test/run-pass/issues/issue-13655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13655.rs rename to src/test/run-pass/issues/issue-13655.rs diff --git a/src/test/ui/run-pass/issues/issue-13665.rs b/src/test/run-pass/issues/issue-13665.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13665.rs rename to src/test/run-pass/issues/issue-13665.rs diff --git a/src/test/ui/run-pass/issues/issue-13703.rs b/src/test/run-pass/issues/issue-13703.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13703.rs rename to src/test/run-pass/issues/issue-13703.rs diff --git a/src/test/ui/run-pass/issues/issue-13763.rs b/src/test/run-pass/issues/issue-13763.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13763.rs rename to src/test/run-pass/issues/issue-13763.rs index 0b27e2fab31e..7b335d31238f 100644 --- a/src/test/ui/run-pass/issues/issue-13763.rs +++ b/src/test/run-pass/issues/issue-13763.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod u8 { diff --git a/src/test/ui/run-pass/issues/issue-13775.rs b/src/test/run-pass/issues/issue-13775.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13775.rs rename to src/test/run-pass/issues/issue-13775.rs diff --git a/src/test/ui/run-pass/issues/issue-13808.rs b/src/test/run-pass/issues/issue-13808.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-13808.rs rename to src/test/run-pass/issues/issue-13808.rs index 2d6b78c6b07a..e759ef1c5b41 100644 --- a/src/test/ui/run-pass/issues/issue-13808.rs +++ b/src/test/run-pass/issues/issue-13808.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 struct Foo<'a> { diff --git a/src/test/ui/run-pass/issues/issue-13837.rs b/src/test/run-pass/issues/issue-13837.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13837.rs rename to src/test/run-pass/issues/issue-13837.rs index eaa17499850c..98a86748851a 100644 --- a/src/test/ui/run-pass/issues/issue-13837.rs +++ b/src/test/run-pass/issues/issue-13837.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct TestStruct { diff --git a/src/test/ui/run-pass/issues/issue-13867.rs b/src/test/run-pass/issues/issue-13867.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13867.rs rename to src/test/run-pass/issues/issue-13867.rs diff --git a/src/test/ui/run-pass/issues/issue-13872.rs b/src/test/run-pass/issues/issue-13872.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-13872.rs rename to src/test/run-pass/issues/issue-13872.rs diff --git a/src/test/ui/run-pass/issues/issue-13902.rs b/src/test/run-pass/issues/issue-13902.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-13902.rs rename to src/test/run-pass/issues/issue-13902.rs index 87413be05e57..4f0ab3c55f24 100644 --- a/src/test/ui/run-pass/issues/issue-13902.rs +++ b/src/test/run-pass/issues/issue-13902.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] const JSVAL_TAG_CLEAR: u32 = 0xFFFFFF80; diff --git a/src/test/ui/run-pass/issues/issue-14082.rs b/src/test/run-pass/issues/issue-14082.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14082.rs rename to src/test/run-pass/issues/issue-14082.rs diff --git a/src/test/ui/run-pass/issues/issue-14229.rs b/src/test/run-pass/issues/issue-14229.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14229.rs rename to src/test/run-pass/issues/issue-14229.rs diff --git a/src/test/ui/run-pass/issues/issue-14254.rs b/src/test/run-pass/issues/issue-14254.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14254.rs rename to src/test/run-pass/issues/issue-14254.rs diff --git a/src/test/ui/run-pass/issues/issue-14308.rs b/src/test/run-pass/issues/issue-14308.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14308.rs rename to src/test/run-pass/issues/issue-14308.rs diff --git a/src/test/ui/run-pass/issues/issue-14330.rs b/src/test/run-pass/issues/issue-14330.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-14330.rs rename to src/test/run-pass/issues/issue-14330.rs index d50dc64f4374..fe54c1cf05c8 100644 --- a/src/test/ui/run-pass/issues/issue-14330.rs +++ b/src/test/run-pass/issues/issue-14330.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // pretty-expanded FIXME #23616 #[macro_use] extern crate std as std2; diff --git a/src/test/ui/run-pass/issues/issue-14344.rs b/src/test/run-pass/issues/issue-14344.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14344.rs rename to src/test/run-pass/issues/issue-14344.rs diff --git a/src/test/ui/run-pass/issues/issue-14382.rs b/src/test/run-pass/issues/issue-14382.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14382.rs rename to src/test/run-pass/issues/issue-14382.rs diff --git a/src/test/ui/run-pass/issues/issue-14393.rs b/src/test/run-pass/issues/issue-14393.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14393.rs rename to src/test/run-pass/issues/issue-14393.rs diff --git a/src/test/ui/run-pass/issues/issue-14399.rs b/src/test/run-pass/issues/issue-14399.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14399.rs rename to src/test/run-pass/issues/issue-14399.rs diff --git a/src/test/ui/run-pass/issues/issue-14421.rs b/src/test/run-pass/issues/issue-14421.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14421.rs rename to src/test/run-pass/issues/issue-14421.rs diff --git a/src/test/ui/run-pass/issues/issue-14422.rs b/src/test/run-pass/issues/issue-14422.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14422.rs rename to src/test/run-pass/issues/issue-14422.rs diff --git a/src/test/ui/run-pass/issues/issue-14456.rs b/src/test/run-pass/issues/issue-14456.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-14456.rs rename to src/test/run-pass/issues/issue-14456.rs index 27eb0ebcbfe9..cfd037e31f68 100644 --- a/src/test/ui/run-pass/issues/issue-14456.rs +++ b/src/test/run-pass/issues/issue-14456.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // ignore-cloudabi no processes // ignore-emscripten no processes diff --git a/src/test/ui/run-pass/issues/issue-1451.rs b/src/test/run-pass/issues/issue-1451.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-1451.rs rename to src/test/run-pass/issues/issue-1451.rs index fb344c3b4b78..7cdc54fa59f5 100644 --- a/src/test/ui/run-pass/issues/issue-1451.rs +++ b/src/test/run-pass/issues/issue-1451.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_snake_case)] #![allow(unused_variables)] diff --git a/src/test/ui/run-pass/issues/issue-14589.rs b/src/test/run-pass/issues/issue-14589.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14589.rs rename to src/test/run-pass/issues/issue-14589.rs diff --git a/src/test/ui/run-pass/issues/issue-1460.rs b/src/test/run-pass/issues/issue-1460.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-1460.rs rename to src/test/run-pass/issues/issue-1460.rs diff --git a/src/test/ui/run-pass/issues/issue-14821.rs b/src/test/run-pass/issues/issue-14821.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-14821.rs rename to src/test/run-pass/issues/issue-14821.rs index c01ffb7d6b14..69291afb92f2 100644 --- a/src/test/ui/run-pass/issues/issue-14821.rs +++ b/src/test/run-pass/issues/issue-14821.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] trait SomeTrait {} struct Meow; impl SomeTrait for Meow {} diff --git a/src/test/ui/run-pass/issues/issue-14837.rs b/src/test/run-pass/issues/issue-14837.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14837.rs rename to src/test/run-pass/issues/issue-14837.rs diff --git a/src/test/ui/run-pass/issues/issue-14865.rs b/src/test/run-pass/issues/issue-14865.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-14865.rs rename to src/test/run-pass/issues/issue-14865.rs index 4e278c66886b..94da75cdc05f 100644 --- a/src/test/ui/run-pass/issues/issue-14865.rs +++ b/src/test/run-pass/issues/issue-14865.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum X { Foo(usize), diff --git a/src/test/ui/run-pass/issues/issue-14875.rs b/src/test/run-pass/issues/issue-14875.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14875.rs rename to src/test/run-pass/issues/issue-14875.rs diff --git a/src/test/ui/run-pass/issues/issue-14901.rs b/src/test/run-pass/issues/issue-14901.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14901.rs rename to src/test/run-pass/issues/issue-14901.rs diff --git a/src/test/ui/run-pass/issues/issue-14919.rs b/src/test/run-pass/issues/issue-14919.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-14919.rs rename to src/test/run-pass/issues/issue-14919.rs index a9768661256f..dd02e513287a 100644 --- a/src/test/ui/run-pass/issues/issue-14919.rs +++ b/src/test/run-pass/issues/issue-14919.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Matcher { diff --git a/src/test/ui/run-pass/issues/issue-14933.rs b/src/test/run-pass/issues/issue-14933.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14933.rs rename to src/test/run-pass/issues/issue-14933.rs diff --git a/src/test/ui/run-pass/issues/issue-14936.rs b/src/test/run-pass/issues/issue-14936.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-14936.rs rename to src/test/run-pass/issues/issue-14936.rs index 3786b0408ad5..4249a83e3c22 100644 --- a/src/test/ui/run-pass/issues/issue-14936.rs +++ b/src/test/run-pass/issues/issue-14936.rs @@ -9,7 +9,8 @@ // except according to those terms. // run-pass - +#![allow(unused_macros)] +#![allow(dead_code)] #![feature(asm)] type History = Vec<&'static str>; diff --git a/src/test/ui/run-pass/issues/issue-14940.rs b/src/test/run-pass/issues/issue-14940.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14940.rs rename to src/test/run-pass/issues/issue-14940.rs diff --git a/src/test/ui/run-pass/issues/issue-14958.rs b/src/test/run-pass/issues/issue-14958.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14958.rs rename to src/test/run-pass/issues/issue-14958.rs diff --git a/src/test/ui/run-pass/issues/issue-14959.rs b/src/test/run-pass/issues/issue-14959.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-14959.rs rename to src/test/run-pass/issues/issue-14959.rs diff --git a/src/test/ui/run-pass/issues/issue-15043.rs b/src/test/run-pass/issues/issue-15043.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15043.rs rename to src/test/run-pass/issues/issue-15043.rs diff --git a/src/test/ui/run-pass/issues/issue-15063.rs b/src/test/run-pass/issues/issue-15063.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-15063.rs rename to src/test/run-pass/issues/issue-15063.rs index 863dde1fc5e5..c8cbc120251f 100644 --- a/src/test/ui/run-pass/issues/issue-15063.rs +++ b/src/test/run-pass/issues/issue-15063.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] enum Two { A, B} impl Drop for Two { fn drop(&mut self) { diff --git a/src/test/ui/run-pass/issues/issue-15080.rs b/src/test/run-pass/issues/issue-15080.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15080.rs rename to src/test/run-pass/issues/issue-15080.rs diff --git a/src/test/ui/run-pass/issues/issue-15104.rs b/src/test/run-pass/issues/issue-15104.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15104.rs rename to src/test/run-pass/issues/issue-15104.rs diff --git a/src/test/ui/run-pass/issues/issue-15108.rs b/src/test/run-pass/issues/issue-15108.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15108.rs rename to src/test/run-pass/issues/issue-15108.rs diff --git a/src/test/ui/run-pass/issues/issue-15129.rs b/src/test/run-pass/issues/issue-15129.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15129.rs rename to src/test/run-pass/issues/issue-15129.rs diff --git a/src/test/ui/run-pass/issues/issue-15155.rs b/src/test/run-pass/issues/issue-15155.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15155.rs rename to src/test/run-pass/issues/issue-15155.rs diff --git a/src/test/ui/run-pass/issues/issue-15189.rs b/src/test/run-pass/issues/issue-15189.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15189.rs rename to src/test/run-pass/issues/issue-15189.rs diff --git a/src/test/ui/run-pass/issues/issue-15221.rs b/src/test/run-pass/issues/issue-15221.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-15221.rs rename to src/test/run-pass/issues/issue-15221.rs index 25e163e3958a..375cb5e14e55 100644 --- a/src/test/ui/run-pass/issues/issue-15221.rs +++ b/src/test/run-pass/issues/issue-15221.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(path_statements)] // pretty-expanded FIXME #23616 macro_rules! inner { diff --git a/src/test/ui/run-pass/issues/issue-15261.rs b/src/test/run-pass/issues/issue-15261.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-15261.rs rename to src/test/run-pass/issues/issue-15261.rs index b715a388d105..263f9b0bd4b2 100644 --- a/src/test/ui/run-pass/issues/issue-15261.rs +++ b/src/test/run-pass/issues/issue-15261.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-15444.rs b/src/test/run-pass/issues/issue-15444.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15444.rs rename to src/test/run-pass/issues/issue-15444.rs diff --git a/src/test/ui/run-pass/issues/issue-15487.rs b/src/test/run-pass/issues/issue-15487.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-15487.rs rename to src/test/run-pass/issues/issue-15487.rs index de4de14ca33c..48bcf2183f09 100644 --- a/src/test/ui/run-pass/issues/issue-15487.rs +++ b/src/test/run-pass/issues/issue-15487.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] // ignore-windows // ignore-wasm32-bare no libs to link diff --git a/src/test/ui/run-pass/issues/issue-15523-big.rs b/src/test/run-pass/issues/issue-15523-big.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15523-big.rs rename to src/test/run-pass/issues/issue-15523-big.rs diff --git a/src/test/ui/run-pass/issues/issue-15523.rs b/src/test/run-pass/issues/issue-15523.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15523.rs rename to src/test/run-pass/issues/issue-15523.rs diff --git a/src/test/ui/run-pass/issues/issue-15562.rs b/src/test/run-pass/issues/issue-15562.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15562.rs rename to src/test/run-pass/issues/issue-15562.rs diff --git a/src/test/ui/run-pass/issues/issue-15571.rs b/src/test/run-pass/issues/issue-15571.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15571.rs rename to src/test/run-pass/issues/issue-15571.rs diff --git a/src/test/ui/run-pass/issues/issue-15673.rs b/src/test/run-pass/issues/issue-15673.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15673.rs rename to src/test/run-pass/issues/issue-15673.rs diff --git a/src/test/ui/run-pass/issues/issue-15689-1.rs b/src/test/run-pass/issues/issue-15689-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15689-1.rs rename to src/test/run-pass/issues/issue-15689-1.rs diff --git a/src/test/ui/run-pass/issues/issue-15689-2.rs b/src/test/run-pass/issues/issue-15689-2.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-15689-2.rs rename to src/test/run-pass/issues/issue-15689-2.rs index 7b4d1e3e3e2b..dedc66336e7b 100644 --- a/src/test/ui/run-pass/issues/issue-15689-2.rs +++ b/src/test/run-pass/issues/issue-15689-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #[derive(Clone)] diff --git a/src/test/ui/run-pass/issues/issue-15730.rs b/src/test/run-pass/issues/issue-15730.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-15730.rs rename to src/test/run-pass/issues/issue-15730.rs index c2f5f9f2e60a..b5a0715bae6b 100644 --- a/src/test/ui/run-pass/issues/issue-15730.rs +++ b/src/test/run-pass/issues/issue-15730.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 fn main() { diff --git a/src/test/ui/run-pass/issues/issue-15734.rs b/src/test/run-pass/issues/issue-15734.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15734.rs rename to src/test/run-pass/issues/issue-15734.rs diff --git a/src/test/ui/run-pass/issues/issue-15735.rs b/src/test/run-pass/issues/issue-15735.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-15735.rs rename to src/test/run-pass/issues/issue-15735.rs index 9e95b173e894..5ac47bd68bcf 100644 --- a/src/test/ui/run-pass/issues/issue-15735.rs +++ b/src/test/run-pass/issues/issue-15735.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct A<'a> { a: &'a i32, b: &'a i32, diff --git a/src/test/ui/run-pass/issues/issue-15763.rs b/src/test/run-pass/issues/issue-15763.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-15763.rs rename to src/test/run-pass/issues/issue-15763.rs index f241efa74d3e..a8aba30a37f4 100644 --- a/src/test/ui/run-pass/issues/issue-15763.rs +++ b/src/test/run-pass/issues/issue-15763.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] #![feature(box_syntax)] #[derive(PartialEq, Debug)] diff --git a/src/test/ui/run-pass/issues/issue-15774.rs b/src/test/run-pass/issues/issue-15774.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15774.rs rename to src/test/run-pass/issues/issue-15774.rs diff --git a/src/test/ui/run-pass/issues/issue-15793.rs b/src/test/run-pass/issues/issue-15793.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-15793.rs rename to src/test/run-pass/issues/issue-15793.rs index 97f4c0095ec8..9c5bea1a53ec 100644 --- a/src/test/ui/run-pass/issues/issue-15793.rs +++ b/src/test/run-pass/issues/issue-15793.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum NestedEnum { First, diff --git a/src/test/ui/run-pass/issues/issue-15858.rs b/src/test/run-pass/issues/issue-15858.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15858.rs rename to src/test/run-pass/issues/issue-15858.rs diff --git a/src/test/ui/run-pass/issues/issue-15881-model-lexer-dotdotdot.rs b/src/test/run-pass/issues/issue-15881-model-lexer-dotdotdot.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-15881-model-lexer-dotdotdot.rs rename to src/test/run-pass/issues/issue-15881-model-lexer-dotdotdot.rs diff --git a/src/test/ui/run-pass/issues/issue-16151.rs b/src/test/run-pass/issues/issue-16151.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16151.rs rename to src/test/run-pass/issues/issue-16151.rs diff --git a/src/test/ui/run-pass/issues/issue-16256.rs b/src/test/run-pass/issues/issue-16256.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16256.rs rename to src/test/run-pass/issues/issue-16256.rs diff --git a/src/test/ui/run-pass/issues/issue-16272.rs b/src/test/run-pass/issues/issue-16272.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16272.rs rename to src/test/run-pass/issues/issue-16272.rs diff --git a/src/test/ui/run-pass/issues/issue-16278.rs b/src/test/run-pass/issues/issue-16278.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16278.rs rename to src/test/run-pass/issues/issue-16278.rs diff --git a/src/test/ui/run-pass/issues/issue-16441.rs b/src/test/run-pass/issues/issue-16441.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-16441.rs rename to src/test/run-pass/issues/issue-16441.rs index 5a0ea2adc639..cabed87edda2 100644 --- a/src/test/ui/run-pass/issues/issue-16441.rs +++ b/src/test/run-pass/issues/issue-16441.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Empty; diff --git a/src/test/ui/run-pass/issues/issue-16452.rs b/src/test/run-pass/issues/issue-16452.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-16452.rs rename to src/test/run-pass/issues/issue-16452.rs index 2b78582b577d..10c9f316b890 100644 --- a/src/test/ui/run-pass/issues/issue-16452.rs +++ b/src/test/run-pass/issues/issue-16452.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn main() { diff --git a/src/test/ui/run-pass/issues/issue-16492.rs b/src/test/run-pass/issues/issue-16492.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16492.rs rename to src/test/run-pass/issues/issue-16492.rs diff --git a/src/test/ui/run-pass/issues/issue-16530.rs b/src/test/run-pass/issues/issue-16530.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16530.rs rename to src/test/run-pass/issues/issue-16530.rs diff --git a/src/test/ui/run-pass/issues/issue-16560.rs b/src/test/run-pass/issues/issue-16560.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-16560.rs rename to src/test/run-pass/issues/issue-16560.rs index 50009f4f6ea1..795b1efeeeba 100644 --- a/src/test/ui/run-pass/issues/issue-16560.rs +++ b/src/test/run-pass/issues/issue-16560.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/issues/issue-16596.rs b/src/test/run-pass/issues/issue-16596.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-16596.rs rename to src/test/run-pass/issues/issue-16596.rs index cdbc3daf4ab1..d9583809a89f 100644 --- a/src/test/ui/run-pass/issues/issue-16596.rs +++ b/src/test/run-pass/issues/issue-16596.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait MatrixRow { fn dummy(&self) { }} diff --git a/src/test/ui/run-pass/issues/issue-16597-empty.rs b/src/test/run-pass/issues/issue-16597-empty.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16597-empty.rs rename to src/test/run-pass/issues/issue-16597-empty.rs diff --git a/src/test/ui/run-pass/issues/issue-16597.rs b/src/test/run-pass/issues/issue-16597.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-16597.rs rename to src/test/run-pass/issues/issue-16597.rs index 6b437eb65aac..61b828142109 100644 --- a/src/test/ui/run-pass/issues/issue-16597.rs +++ b/src/test/run-pass/issues/issue-16597.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // compile-flags:--test mod tests { diff --git a/src/test/ui/run-pass/issues/issue-1660.rs b/src/test/run-pass/issues/issue-1660.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-1660.rs rename to src/test/run-pass/issues/issue-1660.rs diff --git a/src/test/ui/run-pass/issues/issue-16602-1.rs b/src/test/run-pass/issues/issue-16602-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16602-1.rs rename to src/test/run-pass/issues/issue-16602-1.rs diff --git a/src/test/ui/run-pass/issues/issue-16602-2.rs b/src/test/run-pass/issues/issue-16602-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16602-2.rs rename to src/test/run-pass/issues/issue-16602-2.rs diff --git a/src/test/ui/run-pass/issues/issue-16602-3.rs b/src/test/run-pass/issues/issue-16602-3.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-16602-3.rs rename to src/test/run-pass/issues/issue-16602-3.rs index 5346851f0f28..bc4cbcbd3294 100644 --- a/src/test/ui/run-pass/issues/issue-16602-3.rs +++ b/src/test/run-pass/issues/issue-16602-3.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] +#![allow(unused_assignments)] #[derive(Debug)] enum Foo { Bar(u32, u32), diff --git a/src/test/ui/run-pass/issues/issue-16643.rs b/src/test/run-pass/issues/issue-16643.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16643.rs rename to src/test/run-pass/issues/issue-16643.rs diff --git a/src/test/ui/run-pass/issues/issue-16648.rs b/src/test/run-pass/issues/issue-16648.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16648.rs rename to src/test/run-pass/issues/issue-16648.rs diff --git a/src/test/ui/run-pass/issues/issue-16668.rs b/src/test/run-pass/issues/issue-16668.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-16668.rs rename to src/test/run-pass/issues/issue-16668.rs index 08f696cfcf4b..fdb49c689843 100644 --- a/src/test/ui/run-pass/issues/issue-16668.rs +++ b/src/test/run-pass/issues/issue-16668.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Parser<'a, I, O> { parse: Box Result + 'a> } diff --git a/src/test/ui/run-pass/issues/issue-16671.rs b/src/test/run-pass/issues/issue-16671.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16671.rs rename to src/test/run-pass/issues/issue-16671.rs diff --git a/src/test/ui/run-pass/issues/issue-16739.rs b/src/test/run-pass/issues/issue-16739.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16739.rs rename to src/test/run-pass/issues/issue-16739.rs diff --git a/src/test/ui/run-pass/issues/issue-16745.rs b/src/test/run-pass/issues/issue-16745.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16745.rs rename to src/test/run-pass/issues/issue-16745.rs diff --git a/src/test/ui/run-pass/issues/issue-16774.rs b/src/test/run-pass/issues/issue-16774.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16774.rs rename to src/test/run-pass/issues/issue-16774.rs diff --git a/src/test/ui/run-pass/issues/issue-16783.rs b/src/test/run-pass/issues/issue-16783.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-16783.rs rename to src/test/run-pass/issues/issue-16783.rs index bafeb9716c51..3f1d07b88ec2 100644 --- a/src/test/ui/run-pass/issues/issue-16783.rs +++ b/src/test/run-pass/issues/issue-16783.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 pub fn main() { diff --git a/src/test/ui/run-pass/issues/issue-16819.rs b/src/test/run-pass/issues/issue-16819.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-16819.rs rename to src/test/run-pass/issues/issue-16819.rs index 498abc1c7337..dab126ccc429 100644 --- a/src/test/ui/run-pass/issues/issue-16819.rs +++ b/src/test/run-pass/issues/issue-16819.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // `#[cfg]` on struct field permits empty unusable struct struct S { diff --git a/src/test/ui/run-pass/issues/issue-16922.rs b/src/test/run-pass/issues/issue-16922.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-16922.rs rename to src/test/run-pass/issues/issue-16922.rs diff --git a/src/test/ui/run-pass/issues/issue-1696.rs b/src/test/run-pass/issues/issue-1696.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-1696.rs rename to src/test/run-pass/issues/issue-1696.rs diff --git a/src/test/ui/run-pass/issues/issue-1701.rs b/src/test/run-pass/issues/issue-1701.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-1701.rs rename to src/test/run-pass/issues/issue-1701.rs index 433fd4c1af3f..90b71d5dfe28 100644 --- a/src/test/ui/run-pass/issues/issue-1701.rs +++ b/src/test/run-pass/issues/issue-1701.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/issues/issue-17068.rs b/src/test/run-pass/issues/issue-17068.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17068.rs rename to src/test/run-pass/issues/issue-17068.rs diff --git a/src/test/ui/run-pass/issues/issue-17074.rs b/src/test/run-pass/issues/issue-17074.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-17074.rs rename to src/test/run-pass/issues/issue-17074.rs index 063cf7b0a03b..1f45e01203f7 100644 --- a/src/test/ui/run-pass/issues/issue-17074.rs +++ b/src/test/run-pass/issues/issue-17074.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] static X2: u64 = !0 as u16 as u64; static Y2: u64 = !0 as u32 as u64; diff --git a/src/test/ui/run-pass/issues/issue-17121.rs b/src/test/run-pass/issues/issue-17121.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-17121.rs rename to src/test/run-pass/issues/issue-17121.rs index 8da01966959e..fafcdde2bbe3 100644 --- a/src/test/ui/run-pass/issues/issue-17121.rs +++ b/src/test/run-pass/issues/issue-17121.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 // ignore-cloudabi no std::fs diff --git a/src/test/ui/run-pass/issues/issue-17170.rs b/src/test/run-pass/issues/issue-17170.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17170.rs rename to src/test/run-pass/issues/issue-17170.rs diff --git a/src/test/ui/run-pass/issues/issue-17216.rs b/src/test/run-pass/issues/issue-17216.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-17216.rs rename to src/test/run-pass/issues/issue-17216.rs index dc2848cc1908..c27eb74c90f5 100644 --- a/src/test/ui/run-pass/issues/issue-17216.rs +++ b/src/test/run-pass/issues/issue-17216.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] struct Leak<'a> { dropped: &'a mut bool } diff --git a/src/test/ui/run-pass/issues/issue-17233.rs b/src/test/run-pass/issues/issue-17233.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17233.rs rename to src/test/run-pass/issues/issue-17233.rs diff --git a/src/test/ui/run-pass/issues/issue-17302.rs b/src/test/run-pass/issues/issue-17302.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17302.rs rename to src/test/run-pass/issues/issue-17302.rs diff --git a/src/test/ui/run-pass/issues/issue-17322.rs b/src/test/run-pass/issues/issue-17322.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17322.rs rename to src/test/run-pass/issues/issue-17322.rs diff --git a/src/test/ui/run-pass/issues/issue-17336.rs b/src/test/run-pass/issues/issue-17336.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-17336.rs rename to src/test/run-pass/issues/issue-17336.rs index aea2b67a92fb..b1a77d73aa47 100644 --- a/src/test/ui/run-pass/issues/issue-17336.rs +++ b/src/test/run-pass/issues/issue-17336.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] #[allow(dead_code)] fn check(a: &str) { let x = a as *const str; diff --git a/src/test/ui/run-pass/issues/issue-17351.rs b/src/test/run-pass/issues/issue-17351.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17351.rs rename to src/test/run-pass/issues/issue-17351.rs diff --git a/src/test/ui/run-pass/issues/issue-17361.rs b/src/test/run-pass/issues/issue-17361.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17361.rs rename to src/test/run-pass/issues/issue-17361.rs diff --git a/src/test/ui/run-pass/issues/issue-17450.rs b/src/test/run-pass/issues/issue-17450.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17450.rs rename to src/test/run-pass/issues/issue-17450.rs diff --git a/src/test/ui/run-pass/issues/issue-17503.rs b/src/test/run-pass/issues/issue-17503.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17503.rs rename to src/test/run-pass/issues/issue-17503.rs diff --git a/src/test/ui/run-pass/issues/issue-17662.rs b/src/test/run-pass/issues/issue-17662.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17662.rs rename to src/test/run-pass/issues/issue-17662.rs diff --git a/src/test/ui/run-pass/issues/issue-17718-borrow-interior.rs b/src/test/run-pass/issues/issue-17718-borrow-interior.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-17718-borrow-interior.rs rename to src/test/run-pass/issues/issue-17718-borrow-interior.rs index 505aefdd1c7c..51f617340da5 100644 --- a/src/test/ui/run-pass/issues/issue-17718-borrow-interior.rs +++ b/src/test/run-pass/issues/issue-17718-borrow-interior.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S { a: usize } static A: S = S { a: 3 }; diff --git a/src/test/ui/run-pass/issues/issue-17718-const-destructors.rs b/src/test/run-pass/issues/issue-17718-const-destructors.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-17718-const-destructors.rs rename to src/test/run-pass/issues/issue-17718-const-destructors.rs index 6f8fbbd9f789..16f9cea82fa1 100644 --- a/src/test/ui/run-pass/issues/issue-17718-const-destructors.rs +++ b/src/test/run-pass/issues/issue-17718-const-destructors.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct A; impl Drop for A { fn drop(&mut self) {} diff --git a/src/test/ui/run-pass/issues/issue-17718-parse-const.rs b/src/test/run-pass/issues/issue-17718-parse-const.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17718-parse-const.rs rename to src/test/run-pass/issues/issue-17718-parse-const.rs diff --git a/src/test/ui/run-pass/issues/issue-17718-static-unsafe-interior.rs b/src/test/run-pass/issues/issue-17718-static-unsafe-interior.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-17718-static-unsafe-interior.rs rename to src/test/run-pass/issues/issue-17718-static-unsafe-interior.rs index 2ac6a9013585..f6a2f0997531 100644 --- a/src/test/ui/run-pass/issues/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issues/issue-17718-static-unsafe-interior.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +#![allow(unused_imports)] // pretty-expanded FIXME #23616 use std::marker; diff --git a/src/test/ui/run-pass/issues/issue-17718.rs b/src/test/run-pass/issues/issue-17718.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-17718.rs rename to src/test/run-pass/issues/issue-17718.rs index c332d0b586d3..33e69824dfcb 100644 --- a/src/test/ui/run-pass/issues/issue-17718.rs +++ b/src/test/run-pass/issues/issue-17718.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue-17718-aux.rs extern crate issue_17718_aux as other; diff --git a/src/test/ui/run-pass/issues/issue-17732.rs b/src/test/run-pass/issues/issue-17732.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-17732.rs rename to src/test/run-pass/issues/issue-17732.rs index e69d8fabe868..c0ab42b4264b 100644 --- a/src/test/ui/run-pass/issues/issue-17732.rs +++ b/src/test/run-pass/issues/issue-17732.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Person { diff --git a/src/test/ui/run-pass/issues/issue-17734.rs b/src/test/run-pass/issues/issue-17734.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17734.rs rename to src/test/run-pass/issues/issue-17734.rs diff --git a/src/test/ui/run-pass/issues/issue-17746.rs b/src/test/run-pass/issues/issue-17746.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-17746.rs rename to src/test/run-pass/issues/issue-17746.rs index 7e88068419e8..0cdefc290a86 100644 --- a/src/test/ui/run-pass/issues/issue-17746.rs +++ b/src/test/run-pass/issues/issue-17746.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #17746 fn main() {} diff --git a/src/test/ui/run-pass/issues/issue-17756.rs b/src/test/run-pass/issues/issue-17756.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-17756.rs rename to src/test/run-pass/issues/issue-17756.rs index 8c3f6b935888..7b8fa866fffd 100644 --- a/src/test/ui/run-pass/issues/issue-17756.rs +++ b/src/test/run-pass/issues/issue-17756.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(non_upper_case_globals)] const count : usize = 2 as usize; diff --git a/src/test/ui/run-pass/issues/issue-17771.rs b/src/test/run-pass/issues/issue-17771.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-17771.rs rename to src/test/run-pass/issues/issue-17771.rs index ccea8846b086..ed5acf5e1bb8 100644 --- a/src/test/ui/run-pass/issues/issue-17771.rs +++ b/src/test/run-pass/issues/issue-17771.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Aaa { fn dummy(&self) { } } diff --git a/src/test/ui/run-pass/issues/issue-17816.rs b/src/test/run-pass/issues/issue-17816.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-17816.rs rename to src/test/run-pass/issues/issue-17816.rs index 0f96035b2745..ddeac242f78e 100644 --- a/src/test/ui/run-pass/issues/issue-17816.rs +++ b/src/test/run-pass/issues/issue-17816.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::marker::PhantomData; fn main() { diff --git a/src/test/ui/run-pass/issues/issue-17877.rs b/src/test/run-pass/issues/issue-17877.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17877.rs rename to src/test/run-pass/issues/issue-17877.rs diff --git a/src/test/ui/run-pass/issues/issue-17897.rs b/src/test/run-pass/issues/issue-17897.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-17897.rs rename to src/test/run-pass/issues/issue-17897.rs diff --git a/src/test/ui/run-pass/issues/issue-17904.rs b/src/test/run-pass/issues/issue-17904.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-17904.rs rename to src/test/run-pass/issues/issue-17904.rs index 2a86611a196d..9b76c9fca2ae 100644 --- a/src/test/ui/run-pass/issues/issue-17904.rs +++ b/src/test/run-pass/issues/issue-17904.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that we can parse where clauses on various forms of tuple // structs. diff --git a/src/test/ui/run-pass/issues/issue-18060.rs b/src/test/run-pass/issues/issue-18060.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18060.rs rename to src/test/run-pass/issues/issue-18060.rs diff --git a/src/test/ui/run-pass/issues/issue-18075.rs b/src/test/run-pass/issues/issue-18075.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18075.rs rename to src/test/run-pass/issues/issue-18075.rs diff --git a/src/test/ui/run-pass/issues/issue-18083.rs b/src/test/run-pass/issues/issue-18083.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-18083.rs rename to src/test/run-pass/issues/issue-18083.rs index 152cba82222c..9118ad28493d 100644 --- a/src/test/ui/run-pass/issues/issue-18083.rs +++ b/src/test/run-pass/issues/issue-18083.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] // These crossed imports should resolve fine, and not block on // each other and be reported as unresolved. diff --git a/src/test/ui/run-pass/issues/issue-18088.rs b/src/test/run-pass/issues/issue-18088.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18088.rs rename to src/test/run-pass/issues/issue-18088.rs diff --git a/src/test/ui/run-pass/issues/issue-18110.rs b/src/test/run-pass/issues/issue-18110.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-18110.rs rename to src/test/run-pass/issues/issue-18110.rs index d6733050216d..6d80e2664dc6 100644 --- a/src/test/ui/run-pass/issues/issue-18110.rs +++ b/src/test/run-pass/issues/issue-18110.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // pretty-expanded FIXME #23616 fn main() { diff --git a/src/test/ui/run-pass/issues/issue-18173.rs b/src/test/run-pass/issues/issue-18173.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18173.rs rename to src/test/run-pass/issues/issue-18173.rs diff --git a/src/test/ui/run-pass/issues/issue-18188.rs b/src/test/run-pass/issues/issue-18188.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18188.rs rename to src/test/run-pass/issues/issue-18188.rs diff --git a/src/test/ui/run-pass/issues/issue-1821.rs b/src/test/run-pass/issues/issue-1821.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-1821.rs rename to src/test/run-pass/issues/issue-1821.rs index 27c225a1916a..d37b6df6e34a 100644 --- a/src/test/ui/run-pass/issues/issue-1821.rs +++ b/src/test/run-pass/issues/issue-1821.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // Issue #1821 - Don't recurse trying to typecheck this diff --git a/src/test/ui/run-pass/issues/issue-18232.rs b/src/test/run-pass/issues/issue-18232.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18232.rs rename to src/test/run-pass/issues/issue-18232.rs diff --git a/src/test/ui/run-pass/issues/issue-18352.rs b/src/test/run-pass/issues/issue-18352.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18352.rs rename to src/test/run-pass/issues/issue-18352.rs diff --git a/src/test/ui/run-pass/issues/issue-18353.rs b/src/test/run-pass/issues/issue-18353.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-18353.rs rename to src/test/run-pass/issues/issue-18353.rs index 279ee89a4920..a3e7552691bf 100644 --- a/src/test/ui/run-pass/issues/issue-18353.rs +++ b/src/test/run-pass/issues/issue-18353.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that wrapping an unsized struct in an enum which gets optimised does // not ICE. diff --git a/src/test/ui/run-pass/issues/issue-18412.rs b/src/test/run-pass/issues/issue-18412.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18412.rs rename to src/test/run-pass/issues/issue-18412.rs diff --git a/src/test/ui/run-pass/issues/issue-18425.rs b/src/test/run-pass/issues/issue-18425.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18425.rs rename to src/test/run-pass/issues/issue-18425.rs diff --git a/src/test/ui/run-pass/issues/issue-18446.rs b/src/test/run-pass/issues/issue-18446.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-18446.rs rename to src/test/run-pass/issues/issue-18446.rs index 0758ceb0954e..09f3e451ad13 100644 --- a/src/test/ui/run-pass/issues/issue-18446.rs +++ b/src/test/run-pass/issues/issue-18446.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that methods in trait impls should override default methods. trait T { diff --git a/src/test/ui/run-pass/issues/issue-18464.rs b/src/test/run-pass/issues/issue-18464.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18464.rs rename to src/test/run-pass/issues/issue-18464.rs diff --git a/src/test/ui/run-pass/issues/issue-18501.rs b/src/test/run-pass/issues/issue-18501.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18501.rs rename to src/test/run-pass/issues/issue-18501.rs diff --git a/src/test/ui/run-pass/issues/issue-18514.rs b/src/test/run-pass/issues/issue-18514.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18514.rs rename to src/test/run-pass/issues/issue-18514.rs diff --git a/src/test/ui/run-pass/issues/issue-18539.rs b/src/test/run-pass/issues/issue-18539.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18539.rs rename to src/test/run-pass/issues/issue-18539.rs diff --git a/src/test/ui/run-pass/issues/issue-18652.rs b/src/test/run-pass/issues/issue-18652.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18652.rs rename to src/test/run-pass/issues/issue-18652.rs diff --git a/src/test/ui/run-pass/issues/issue-18655.rs b/src/test/run-pass/issues/issue-18655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18655.rs rename to src/test/run-pass/issues/issue-18655.rs diff --git a/src/test/ui/run-pass/issues/issue-1866.rs b/src/test/run-pass/issues/issue-1866.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-1866.rs rename to src/test/run-pass/issues/issue-1866.rs index cf4a0ddea987..f27d8032dd66 100644 --- a/src/test/ui/run-pass/issues/issue-1866.rs +++ b/src/test/run-pass/issues/issue-1866.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-18661.rs b/src/test/run-pass/issues/issue-18661.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18661.rs rename to src/test/run-pass/issues/issue-18661.rs diff --git a/src/test/ui/run-pass/issues/issue-18685.rs b/src/test/run-pass/issues/issue-18685.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18685.rs rename to src/test/run-pass/issues/issue-18685.rs diff --git a/src/test/ui/run-pass/issues/issue-18711.rs b/src/test/run-pass/issues/issue-18711.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18711.rs rename to src/test/run-pass/issues/issue-18711.rs diff --git a/src/test/ui/run-pass/issues/issue-18738.rs b/src/test/run-pass/issues/issue-18738.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-18738.rs rename to src/test/run-pass/issues/issue-18738.rs index f586552dcb36..8ed663cbbd6f 100644 --- a/src/test/ui/run-pass/issues/issue-18738.rs +++ b/src/test/run-pass/issues/issue-18738.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Eq, PartialEq, PartialOrd, Ord)] enum Test<'a> { Int(&'a isize), diff --git a/src/test/ui/run-pass/issues/issue-18767.rs b/src/test/run-pass/issues/issue-18767.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18767.rs rename to src/test/run-pass/issues/issue-18767.rs diff --git a/src/test/ui/run-pass/issues/issue-18804/auxiliary/lib.rs b/src/test/run-pass/issues/issue-18804/auxiliary/lib.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18804/auxiliary/lib.rs rename to src/test/run-pass/issues/issue-18804/auxiliary/lib.rs diff --git a/src/test/ui/run-pass/issues/issue-18804/main.rs b/src/test/run-pass/issues/issue-18804/main.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18804/main.rs rename to src/test/run-pass/issues/issue-18804/main.rs diff --git a/src/test/ui/run-pass/issues/issue-18809.rs b/src/test/run-pass/issues/issue-18809.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18809.rs rename to src/test/run-pass/issues/issue-18809.rs diff --git a/src/test/ui/run-pass/issues/issue-18845.rs b/src/test/run-pass/issues/issue-18845.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18845.rs rename to src/test/run-pass/issues/issue-18845.rs diff --git a/src/test/ui/run-pass/issues/issue-18859.rs b/src/test/run-pass/issues/issue-18859.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18859.rs rename to src/test/run-pass/issues/issue-18859.rs diff --git a/src/test/ui/run-pass/issues/issue-18906.rs b/src/test/run-pass/issues/issue-18906.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-18906.rs rename to src/test/run-pass/issues/issue-18906.rs index 08a39350c578..4f771752c865 100644 --- a/src/test/ui/run-pass/issues/issue-18906.rs +++ b/src/test/run-pass/issues/issue-18906.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub trait Borrow { diff --git a/src/test/ui/run-pass/issues/issue-18913.rs b/src/test/run-pass/issues/issue-18913.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18913.rs rename to src/test/run-pass/issues/issue-18913.rs diff --git a/src/test/ui/run-pass/issues/issue-18937-1.rs b/src/test/run-pass/issues/issue-18937-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-18937-1.rs rename to src/test/run-pass/issues/issue-18937-1.rs diff --git a/src/test/ui/run-pass/issues/issue-18988.rs b/src/test/run-pass/issues/issue-18988.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-18988.rs rename to src/test/run-pass/issues/issue-18988.rs index 422a0f7d7d65..691d41174303 100644 --- a/src/test/ui/run-pass/issues/issue-18988.rs +++ b/src/test/run-pass/issues/issue-18988.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub trait Foo : Send { } pub struct MyFoo { diff --git a/src/test/ui/run-pass/issues/issue-19001.rs b/src/test/run-pass/issues/issue-19001.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19001.rs rename to src/test/run-pass/issues/issue-19001.rs index 4407cbf501e6..e4460d33b9e0 100644 --- a/src/test/ui/run-pass/issues/issue-19001.rs +++ b/src/test/run-pass/issues/issue-19001.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // check that we handle recursive arrays correctly in `type_of` struct Loopy { diff --git a/src/test/ui/run-pass/issues/issue-19037.rs b/src/test/run-pass/issues/issue-19037.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-19037.rs rename to src/test/run-pass/issues/issue-19037.rs index eb3c265617ba..350c17415dac 100644 --- a/src/test/ui/run-pass/issues/issue-19037.rs +++ b/src/test/run-pass/issues/issue-19037.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Str([u8]); diff --git a/src/test/ui/run-pass/issues/issue-19081.rs b/src/test/run-pass/issues/issue-19081.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19081.rs rename to src/test/run-pass/issues/issue-19081.rs diff --git a/src/test/ui/run-pass/issues/issue-19097.rs b/src/test/run-pass/issues/issue-19097.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19097.rs rename to src/test/run-pass/issues/issue-19097.rs index d3415c34791a..1ad7f524be46 100644 --- a/src/test/ui/run-pass/issues/issue-19097.rs +++ b/src/test/run-pass/issues/issue-19097.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // regression test for #19097 struct Foo(T); diff --git a/src/test/ui/run-pass/issues/issue-19098.rs b/src/test/run-pass/issues/issue-19098.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19098.rs rename to src/test/run-pass/issues/issue-19098.rs diff --git a/src/test/ui/run-pass/issues/issue-19102.rs b/src/test/run-pass/issues/issue-19102.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-19102.rs rename to src/test/run-pass/issues/issue-19102.rs index eecc9db486e2..c26dca255b99 100644 --- a/src/test/ui/run-pass/issues/issue-19102.rs +++ b/src/test/run-pass/issues/issue-19102.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![deny(unused_qualifications)] use self::A::B; diff --git a/src/test/ui/run-pass/issues/issue-19127.rs b/src/test/run-pass/issues/issue-19127.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-19127.rs rename to src/test/run-pass/issues/issue-19127.rs index 3290b179864e..9826b1b08d25 100644 --- a/src/test/ui/run-pass/issues/issue-19127.rs +++ b/src/test/run-pass/issues/issue-19127.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 fn foo T>(f: F) {} diff --git a/src/test/ui/run-pass/issues/issue-19129-1.rs b/src/test/run-pass/issues/issue-19129-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19129-1.rs rename to src/test/run-pass/issues/issue-19129-1.rs diff --git a/src/test/ui/run-pass/issues/issue-19129-2.rs b/src/test/run-pass/issues/issue-19129-2.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-19129-2.rs rename to src/test/run-pass/issues/issue-19129-2.rs index 4999ee1287c4..8d43ece36802 100644 --- a/src/test/ui/run-pass/issues/issue-19129-2.rs +++ b/src/test/run-pass/issues/issue-19129-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 trait Trait { diff --git a/src/test/ui/run-pass/issues/issue-19135.rs b/src/test/run-pass/issues/issue-19135.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19135.rs rename to src/test/run-pass/issues/issue-19135.rs diff --git a/src/test/ui/run-pass/issues/issue-19244.rs b/src/test/run-pass/issues/issue-19244.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19244.rs rename to src/test/run-pass/issues/issue-19244.rs diff --git a/src/test/ui/run-pass/issues/issue-19293.rs b/src/test/run-pass/issues/issue-19293.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19293.rs rename to src/test/run-pass/issues/issue-19293.rs diff --git a/src/test/ui/run-pass/issues/issue-19340-1.rs b/src/test/run-pass/issues/issue-19340-1.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19340-1.rs rename to src/test/run-pass/issues/issue-19340-1.rs index 53531fcad875..62c39d0ff3d7 100644 --- a/src/test/ui/run-pass/issues/issue-19340-1.rs +++ b/src/test/run-pass/issues/issue-19340-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // aux-build:issue-19340-1.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-19340-2.rs b/src/test/run-pass/issues/issue-19340-2.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19340-2.rs rename to src/test/run-pass/issues/issue-19340-2.rs index a1b68e87626a..3f86c7c9180b 100644 --- a/src/test/ui/run-pass/issues/issue-19340-2.rs +++ b/src/test/run-pass/issues/issue-19340-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 enum Homura { diff --git a/src/test/ui/run-pass/issues/issue-19358.rs b/src/test/run-pass/issues/issue-19358.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19358.rs rename to src/test/run-pass/issues/issue-19358.rs diff --git a/src/test/ui/run-pass/issues/issue-19367.rs b/src/test/run-pass/issues/issue-19367.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19367.rs rename to src/test/run-pass/issues/issue-19367.rs diff --git a/src/test/ui/run-pass/issues/issue-19398.rs b/src/test/run-pass/issues/issue-19398.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19398.rs rename to src/test/run-pass/issues/issue-19398.rs diff --git a/src/test/ui/run-pass/issues/issue-19404.rs b/src/test/run-pass/issues/issue-19404.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-19404.rs rename to src/test/run-pass/issues/issue-19404.rs index 3a5ce65aef8e..3f8aad4e0b14 100644 --- a/src/test/ui/run-pass/issues/issue-19404.rs +++ b/src/test/run-pass/issues/issue-19404.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] use std::any::TypeId; use std::rc::Rc; diff --git a/src/test/ui/run-pass/issues/issue-19479.rs b/src/test/run-pass/issues/issue-19479.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19479.rs rename to src/test/run-pass/issues/issue-19479.rs diff --git a/src/test/ui/run-pass/issues/issue-19499.rs b/src/test/run-pass/issues/issue-19499.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-19499.rs rename to src/test/run-pass/issues/issue-19499.rs index 5fb209b2dfe4..efdcce17f5f7 100644 --- a/src/test/ui/run-pass/issues/issue-19499.rs +++ b/src/test/run-pass/issues/issue-19499.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(path_statements)] +#![allow(unused_variables)] // Regression test for issue #19499. Due to incorrect caching of trait // results for closures with upvars whose types were not fully // computed, this rather bizarre little program (along with many more diff --git a/src/test/ui/run-pass/issues/issue-19631.rs b/src/test/run-pass/issues/issue-19631.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19631.rs rename to src/test/run-pass/issues/issue-19631.rs index 12804983ee45..604e3d608741 100644 --- a/src/test/ui/run-pass/issues/issue-19631.rs +++ b/src/test/run-pass/issues/issue-19631.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait PoolManager { diff --git a/src/test/ui/run-pass/issues/issue-19632.rs b/src/test/run-pass/issues/issue-19632.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19632.rs rename to src/test/run-pass/issues/issue-19632.rs index 801d5947f92c..5784886e94c9 100644 --- a/src/test/ui/run-pass/issues/issue-19632.rs +++ b/src/test/run-pass/issues/issue-19632.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait PoolManager { diff --git a/src/test/ui/run-pass/issues/issue-1974.rs b/src/test/run-pass/issues/issue-1974.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-1974.rs rename to src/test/run-pass/issues/issue-1974.rs diff --git a/src/test/ui/run-pass/issues/issue-19811-escape-unicode.rs b/src/test/run-pass/issues/issue-19811-escape-unicode.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19811-escape-unicode.rs rename to src/test/run-pass/issues/issue-19811-escape-unicode.rs diff --git a/src/test/ui/run-pass/issues/issue-19850.rs b/src/test/run-pass/issues/issue-19850.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-19850.rs rename to src/test/run-pass/issues/issue-19850.rs index fa837f57edef..f5b1697528f0 100644 --- a/src/test/ui/run-pass/issues/issue-19850.rs +++ b/src/test/run-pass/issues/issue-19850.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that `::Output` and `Self::Output` are accepted as type annotations in let // bindings diff --git a/src/test/ui/run-pass/issues/issue-19982.rs b/src/test/run-pass/issues/issue-19982.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-19982.rs rename to src/test/run-pass/issues/issue-19982.rs diff --git a/src/test/ui/run-pass/issues/issue-20009.rs b/src/test/run-pass/issues/issue-20009.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20009.rs rename to src/test/run-pass/issues/issue-20009.rs diff --git a/src/test/ui/run-pass/issues/issue-20055-box-trait.rs b/src/test/run-pass/issues/issue-20055-box-trait.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20055-box-trait.rs rename to src/test/run-pass/issues/issue-20055-box-trait.rs diff --git a/src/test/ui/run-pass/issues/issue-20055-box-unsized-array.rs b/src/test/run-pass/issues/issue-20055-box-unsized-array.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20055-box-unsized-array.rs rename to src/test/run-pass/issues/issue-20055-box-unsized-array.rs diff --git a/src/test/ui/run-pass/issues/issue-20091.rs b/src/test/run-pass/issues/issue-20091.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20091.rs rename to src/test/run-pass/issues/issue-20091.rs diff --git a/src/test/ui/run-pass/issues/issue-20174.rs b/src/test/run-pass/issues/issue-20174.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20174.rs rename to src/test/run-pass/issues/issue-20174.rs diff --git a/src/test/ui/run-pass/issues/issue-20186.rs b/src/test/run-pass/issues/issue-20186.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-20186.rs rename to src/test/run-pass/issues/issue-20186.rs index 0f42d8b1caae..16ac2babd427 100644 --- a/src/test/ui/run-pass/issues/issue-20186.rs +++ b/src/test/run-pass/issues/issue-20186.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] struct Foo; impl Foo { diff --git a/src/test/ui/run-pass/issues/issue-20313.rs b/src/test/run-pass/issues/issue-20313.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-20313.rs rename to src/test/run-pass/issues/issue-20313.rs index 9e6561369b8b..bc87372e14fe 100644 --- a/src/test/ui/run-pass/issues/issue-20313.rs +++ b/src/test/run-pass/issues/issue-20313.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(link_llvm_intrinsics)] diff --git a/src/test/ui/run-pass/issues/issue-20343.rs b/src/test/run-pass/issues/issue-20343.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-20343.rs rename to src/test/run-pass/issues/issue-20343.rs index 62506e1c49df..0173b0b2f9cf 100644 --- a/src/test/ui/run-pass/issues/issue-20343.rs +++ b/src/test/run-pass/issues/issue-20343.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Regression test for Issue #20343. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-20389.rs b/src/test/run-pass/issues/issue-20389.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-20389.rs rename to src/test/run-pass/issues/issue-20389.rs index 21cd3a55268a..02d444f414c1 100644 --- a/src/test/ui/run-pass/issues/issue-20389.rs +++ b/src/test/run-pass/issues/issue-20389.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue_20389.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-20396.rs b/src/test/run-pass/issues/issue-20396.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20396.rs rename to src/test/run-pass/issues/issue-20396.rs diff --git a/src/test/ui/run-pass/issues/issue-20414.rs b/src/test/run-pass/issues/issue-20414.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-20414.rs rename to src/test/run-pass/issues/issue-20414.rs index 2e2449933c08..f42ba1ff3036 100644 --- a/src/test/ui/run-pass/issues/issue-20414.rs +++ b/src/test/run-pass/issues/issue-20414.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Trait { diff --git a/src/test/ui/run-pass/issues/issue-20427.rs b/src/test/run-pass/issues/issue-20427.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-20427.rs rename to src/test/run-pass/issues/issue-20427.rs index b03c489e2521..86d94ad85b38 100644 --- a/src/test/ui/run-pass/issues/issue-20427.rs +++ b/src/test/run-pass/issues/issue-20427.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +#![allow(unused_imports)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/issues/issue-20454.rs b/src/test/run-pass/issues/issue-20454.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-20454.rs rename to src/test/run-pass/issues/issue-20454.rs index 41cc94909a00..e00ddf4905fd 100644 --- a/src/test/ui/run-pass/issues/issue-20454.rs +++ b/src/test/run-pass/issues/issue-20454.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] use std::thread; fn _foo() { diff --git a/src/test/ui/run-pass/issues/issue-20544.rs b/src/test/run-pass/issues/issue-20544.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20544.rs rename to src/test/run-pass/issues/issue-20544.rs diff --git a/src/test/ui/run-pass/issues/issue-20575.rs b/src/test/run-pass/issues/issue-20575.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20575.rs rename to src/test/run-pass/issues/issue-20575.rs diff --git a/src/test/ui/run-pass/issues/issue-20616.rs b/src/test/run-pass/issues/issue-20616.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-20616.rs rename to src/test/run-pass/issues/issue-20616.rs index c28d21236692..fa72cf3e76f4 100644 --- a/src/test/ui/run-pass/issues/issue-20616.rs +++ b/src/test/run-pass/issues/issue-20616.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] type MyType<'a, T> = &'a T; // combine lifetime bounds and type arguments in usual way diff --git a/src/test/ui/run-pass/issues/issue-2063-resource.rs b/src/test/run-pass/issues/issue-2063-resource.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2063-resource.rs rename to src/test/run-pass/issues/issue-2063-resource.rs index 12e9b481dc1f..6e30c1320400 100644 --- a/src/test/ui/run-pass/issues/issue-2063-resource.rs +++ b/src/test/run-pass/issues/issue-2063-resource.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // test that autoderef of a type like this does not // cause compiler to loop. Note that no instances // of such a type could ever be constructed. diff --git a/src/test/ui/run-pass/issues/issue-2063.rs b/src/test/run-pass/issues/issue-2063.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2063.rs rename to src/test/run-pass/issues/issue-2063.rs diff --git a/src/test/ui/run-pass/issues/issue-20644.rs b/src/test/run-pass/issues/issue-20644.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-20644.rs rename to src/test/run-pass/issues/issue-20644.rs index 728e2be3d23b..c53565262e81 100644 --- a/src/test/ui/run-pass/issues/issue-20644.rs +++ b/src/test/run-pass/issues/issue-20644.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] #![allow(stable_features)] // A reduced version of the rustbook ice. The problem this encountered diff --git a/src/test/ui/run-pass/issues/issue-20676.rs b/src/test/run-pass/issues/issue-20676.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20676.rs rename to src/test/run-pass/issues/issue-20676.rs diff --git a/src/test/ui/run-pass/issues/issue-2074.rs b/src/test/run-pass/issues/issue-2074.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2074.rs rename to src/test/run-pass/issues/issue-2074.rs diff --git a/src/test/ui/run-pass/issues/issue-20763-1.rs b/src/test/run-pass/issues/issue-20763-1.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-20763-1.rs rename to src/test/run-pass/issues/issue-20763-1.rs index 0afcc1bd9661..df85f615cd2a 100644 --- a/src/test/ui/run-pass/issues/issue-20763-1.rs +++ b/src/test/run-pass/issues/issue-20763-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait T0 { diff --git a/src/test/ui/run-pass/issues/issue-20763-2.rs b/src/test/run-pass/issues/issue-20763-2.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-20763-2.rs rename to src/test/run-pass/issues/issue-20763-2.rs index 4b25d4f05def..489b87ce90f8 100644 --- a/src/test/ui/run-pass/issues/issue-20763-2.rs +++ b/src/test/run-pass/issues/issue-20763-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait T0 { diff --git a/src/test/ui/run-pass/issues/issue-20797.rs b/src/test/run-pass/issues/issue-20797.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20797.rs rename to src/test/run-pass/issues/issue-20797.rs diff --git a/src/test/ui/run-pass/issues/issue-20803.rs b/src/test/run-pass/issues/issue-20803.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20803.rs rename to src/test/run-pass/issues/issue-20803.rs diff --git a/src/test/ui/run-pass/issues/issue-20823.rs b/src/test/run-pass/issues/issue-20823.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20823.rs rename to src/test/run-pass/issues/issue-20823.rs diff --git a/src/test/ui/run-pass/issues/issue-20825.rs b/src/test/run-pass/issues/issue-20825.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20825.rs rename to src/test/run-pass/issues/issue-20825.rs diff --git a/src/test/ui/run-pass/issues/issue-20847.rs b/src/test/run-pass/issues/issue-20847.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-20847.rs rename to src/test/run-pass/issues/issue-20847.rs diff --git a/src/test/ui/run-pass/issues/issue-20953.rs b/src/test/run-pass/issues/issue-20953.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-20953.rs rename to src/test/run-pass/issues/issue-20953.rs index e3dc286df347..e2200c0d39bb 100644 --- a/src/test/ui/run-pass/issues/issue-20953.rs +++ b/src/test/run-pass/issues/issue-20953.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] fn main() { let mut shrinker: Box> = Box::new(vec![1].into_iter()); println!("{:?}", shrinker.next()); diff --git a/src/test/ui/run-pass/issues/issue-21033.rs b/src/test/run-pass/issues/issue-21033.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-21033.rs rename to src/test/run-pass/issues/issue-21033.rs index f96d2db30d3a..20357ecd63a8 100644 --- a/src/test/ui/run-pass/issues/issue-21033.rs +++ b/src/test/run-pass/issues/issue-21033.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 #![feature(box_patterns)] diff --git a/src/test/ui/run-pass/issues/issue-21058.rs b/src/test/run-pass/issues/issue-21058.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-21058.rs rename to src/test/run-pass/issues/issue-21058.rs index 318abfe691ed..e2ad0ba5bb2d 100644 --- a/src/test/ui/run-pass/issues/issue-21058.rs +++ b/src/test/run-pass/issues/issue-21058.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(core_intrinsics)] struct NT(str); diff --git a/src/test/ui/run-pass/issues/issue-21140.rs b/src/test/run-pass/issues/issue-21140.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21140.rs rename to src/test/run-pass/issues/issue-21140.rs diff --git a/src/test/ui/run-pass/issues/issue-21174.rs b/src/test/run-pass/issues/issue-21174.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-21174.rs rename to src/test/run-pass/issues/issue-21174.rs index 3af5e5323a65..f387b93d8f92 100644 --- a/src/test/ui/run-pass/issues/issue-21174.rs +++ b/src/test/run-pass/issues/issue-21174.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] trait Trait<'a> { type A; type B; diff --git a/src/test/ui/run-pass/issues/issue-21245.rs b/src/test/run-pass/issues/issue-21245.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-21245.rs rename to src/test/run-pass/issues/issue-21245.rs index 6bc14489d959..234d70e4dd01 100644 --- a/src/test/ui/run-pass/issues/issue-21245.rs +++ b/src/test/run-pass/issues/issue-21245.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for issue #21245. Check that we are able to infer // the types in these examples correctly. It used to be that // insufficient type propagation caused the type of the iterator to be diff --git a/src/test/ui/run-pass/issues/issue-21291.rs b/src/test/run-pass/issues/issue-21291.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21291.rs rename to src/test/run-pass/issues/issue-21291.rs diff --git a/src/test/ui/run-pass/issues/issue-21306.rs b/src/test/run-pass/issues/issue-21306.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21306.rs rename to src/test/run-pass/issues/issue-21306.rs diff --git a/src/test/ui/run-pass/issues/issue-21361.rs b/src/test/run-pass/issues/issue-21361.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21361.rs rename to src/test/run-pass/issues/issue-21361.rs diff --git a/src/test/ui/run-pass/issues/issue-21363.rs b/src/test/run-pass/issues/issue-21363.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21363.rs rename to src/test/run-pass/issues/issue-21363.rs diff --git a/src/test/ui/run-pass/issues/issue-21384.rs b/src/test/run-pass/issues/issue-21384.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21384.rs rename to src/test/run-pass/issues/issue-21384.rs diff --git a/src/test/ui/run-pass/issues/issue-21400.rs b/src/test/run-pass/issues/issue-21400.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21400.rs rename to src/test/run-pass/issues/issue-21400.rs diff --git a/src/test/ui/run-pass/issues/issue-21402.rs b/src/test/run-pass/issues/issue-21402.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-21402.rs rename to src/test/run-pass/issues/issue-21402.rs index 210ba0711b40..041547a5728f 100644 --- a/src/test/ui/run-pass/issues/issue-21402.rs +++ b/src/test/run-pass/issues/issue-21402.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #[derive(Hash)] diff --git a/src/test/ui/run-pass/issues/issue-21475.rs b/src/test/run-pass/issues/issue-21475.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-21475.rs rename to src/test/run-pass/issues/issue-21475.rs index 883d6d215bd2..cdfdad3848d5 100644 --- a/src/test/ui/run-pass/issues/issue-21475.rs +++ b/src/test/run-pass/issues/issue-21475.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // pretty-expanded FIXME #23616 use m::{START, END}; diff --git a/src/test/ui/run-pass/issues/issue-21486.rs b/src/test/run-pass/issues/issue-21486.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-21486.rs rename to src/test/run-pass/issues/issue-21486.rs index faf9b42a0e8b..5e5768937113 100644 --- a/src/test/ui/run-pass/issues/issue-21486.rs +++ b/src/test/run-pass/issues/issue-21486.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // Issue #21486: Make sure that all structures are dropped, even when // created via FRU and control-flow breaks in the middle of // construction. diff --git a/src/test/ui/run-pass/issues/issue-21520.rs b/src/test/run-pass/issues/issue-21520.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-21520.rs rename to src/test/run-pass/issues/issue-21520.rs index 71eb229ef00b..33d79b661629 100644 --- a/src/test/ui/run-pass/issues/issue-21520.rs +++ b/src/test/run-pass/issues/issue-21520.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that the requirement (in `Bar`) that `T::Bar : 'static` does // not wind up propagating to `T`. diff --git a/src/test/ui/run-pass/issues/issue-21562.rs b/src/test/run-pass/issues/issue-21562.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-21562.rs rename to src/test/run-pass/issues/issue-21562.rs index 6b876df9d04b..4e90ed7c4473 100644 --- a/src/test/ui/run-pass/issues/issue-21562.rs +++ b/src/test/run-pass/issues/issue-21562.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] extern crate core; diff --git a/src/test/ui/run-pass/issues/issue-21622.rs b/src/test/run-pass/issues/issue-21622.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-21622.rs rename to src/test/run-pass/issues/issue-21622.rs index e7289e5d162c..16db178452e7 100644 --- a/src/test/ui/run-pass/issues/issue-21622.rs +++ b/src/test/run-pass/issues/issue-21622.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] struct Index; diff --git a/src/test/ui/run-pass/issues/issue-21634.rs b/src/test/run-pass/issues/issue-21634.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21634.rs rename to src/test/run-pass/issues/issue-21634.rs diff --git a/src/test/ui/run-pass/issues/issue-21655.rs b/src/test/run-pass/issues/issue-21655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21655.rs rename to src/test/run-pass/issues/issue-21655.rs diff --git a/src/test/ui/run-pass/issues/issue-21721.rs b/src/test/run-pass/issues/issue-21721.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21721.rs rename to src/test/run-pass/issues/issue-21721.rs diff --git a/src/test/ui/run-pass/issues/issue-21726.rs b/src/test/run-pass/issues/issue-21726.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-21726.rs rename to src/test/run-pass/issues/issue-21726.rs index 49369759929d..ffdff9aa2baf 100644 --- a/src/test/ui/run-pass/issues/issue-21726.rs +++ b/src/test/run-pass/issues/issue-21726.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #21726: an issue arose around the rules for // subtyping of projection types that resulted in an unconstrained // region, yielding region inference failures. diff --git a/src/test/ui/run-pass/issues/issue-21891.rs b/src/test/run-pass/issues/issue-21891.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-21891.rs rename to src/test/run-pass/issues/issue-21891.rs index 1e577ba7303d..90a496617b0c 100644 --- a/src/test/ui/run-pass/issues/issue-21891.rs +++ b/src/test/run-pass/issues/issue-21891.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-2190-1.rs b/src/test/run-pass/issues/issue-2190-1.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2190-1.rs rename to src/test/run-pass/issues/issue-2190-1.rs index 2d7a7382f0b4..c77407a6bb1f 100644 --- a/src/test/ui/run-pass/issues/issue-2190-1.rs +++ b/src/test/run-pass/issues/issue-2190-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] #![allow(non_upper_case_globals)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-21909.rs b/src/test/run-pass/issues/issue-21909.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21909.rs rename to src/test/run-pass/issues/issue-21909.rs diff --git a/src/test/ui/run-pass/issues/issue-21922.rs b/src/test/run-pass/issues/issue-21922.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-21922.rs rename to src/test/run-pass/issues/issue-21922.rs diff --git a/src/test/ui/run-pass/issues/issue-22008.rs b/src/test/run-pass/issues/issue-22008.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22008.rs rename to src/test/run-pass/issues/issue-22008.rs diff --git a/src/test/ui/run-pass/issues/issue-22036.rs b/src/test/run-pass/issues/issue-22036.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22036.rs rename to src/test/run-pass/issues/issue-22036.rs diff --git a/src/test/ui/run-pass/issues/issue-22066.rs b/src/test/run-pass/issues/issue-22066.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22066.rs rename to src/test/run-pass/issues/issue-22066.rs diff --git a/src/test/ui/run-pass/issues/issue-2214.rs b/src/test/run-pass/issues/issue-2214.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2214.rs rename to src/test/run-pass/issues/issue-2214.rs diff --git a/src/test/ui/run-pass/issues/issue-2216.rs b/src/test/run-pass/issues/issue-2216.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2216.rs rename to src/test/run-pass/issues/issue-2216.rs index 9283cd93fa37..42cd3c0488bb 100644 --- a/src/test/ui/run-pass/issues/issue-2216.rs +++ b/src/test/run-pass/issues/issue-2216.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] pub fn main() { let mut x = 0; diff --git a/src/test/ui/run-pass/issues/issue-22258.rs b/src/test/run-pass/issues/issue-22258.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22258.rs rename to src/test/run-pass/issues/issue-22258.rs diff --git a/src/test/ui/run-pass/issues/issue-22346.rs b/src/test/run-pass/issues/issue-22346.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-22346.rs rename to src/test/run-pass/issues/issue-22346.rs index 6689b6081ec4..0b58591cd62b 100644 --- a/src/test/ui/run-pass/issues/issue-22346.rs +++ b/src/test/run-pass/issues/issue-22346.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 // This used to cause an ICE because the retslot for the "return" had the wrong type diff --git a/src/test/ui/run-pass/issues/issue-22356.rs b/src/test/run-pass/issues/issue-22356.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22356.rs rename to src/test/run-pass/issues/issue-22356.rs diff --git a/src/test/ui/run-pass/issues/issue-22375.rs b/src/test/run-pass/issues/issue-22375.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22375.rs rename to src/test/run-pass/issues/issue-22375.rs diff --git a/src/test/ui/run-pass/issues/issue-22403.rs b/src/test/run-pass/issues/issue-22403.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22403.rs rename to src/test/run-pass/issues/issue-22403.rs diff --git a/src/test/ui/run-pass/issues/issue-22426.rs b/src/test/run-pass/issues/issue-22426.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22426.rs rename to src/test/run-pass/issues/issue-22426.rs diff --git a/src/test/ui/run-pass/issues/issue-22463.rs b/src/test/run-pass/issues/issue-22463.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22463.rs rename to src/test/run-pass/issues/issue-22463.rs diff --git a/src/test/ui/run-pass/issues/issue-22471.rs b/src/test/run-pass/issues/issue-22471.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-22471.rs rename to src/test/run-pass/issues/issue-22471.rs index 87b4bc1734b5..b93f1f354c61 100644 --- a/src/test/ui/run-pass/issues/issue-22471.rs +++ b/src/test/run-pass/issues/issue-22471.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(type_alias_bounds)] type Foo where T: Copy = Box; diff --git a/src/test/ui/run-pass/issues/issue-22536-copy-mustnt-zero.rs b/src/test/run-pass/issues/issue-22536-copy-mustnt-zero.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22536-copy-mustnt-zero.rs rename to src/test/run-pass/issues/issue-22536-copy-mustnt-zero.rs diff --git a/src/test/ui/run-pass/issues/issue-22546.rs b/src/test/run-pass/issues/issue-22546.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-22546.rs rename to src/test/run-pass/issues/issue-22546.rs index 28aaae1d8cc7..4f165877afc0 100644 --- a/src/test/ui/run-pass/issues/issue-22546.rs +++ b/src/test/run-pass/issues/issue-22546.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Parsing patterns with paths with type parameters (issue #22544) use std::default::Default; diff --git a/src/test/ui/run-pass/issues/issue-22577.rs b/src/test/run-pass/issues/issue-22577.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-22577.rs rename to src/test/run-pass/issues/issue-22577.rs index 774416c92519..c78f308f6b89 100644 --- a/src/test/ui/run-pass/issues/issue-22577.rs +++ b/src/test/run-pass/issues/issue-22577.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 // ignore-cloudabi no std::fs diff --git a/src/test/ui/run-pass/issues/issue-22629.rs b/src/test/run-pass/issues/issue-22629.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-22629.rs rename to src/test/run-pass/issues/issue-22629.rs index 9254a0807942..9b9918d8aadb 100644 --- a/src/test/ui/run-pass/issues/issue-22629.rs +++ b/src/test/run-pass/issues/issue-22629.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. diff --git a/src/test/ui/run-pass/issues/issue-22777.rs b/src/test/run-pass/issues/issue-22777.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22777.rs rename to src/test/run-pass/issues/issue-22777.rs diff --git a/src/test/ui/run-pass/issues/issue-22781.rs b/src/test/run-pass/issues/issue-22781.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-22781.rs rename to src/test/run-pass/issues/issue-22781.rs index af95b6e1d1a2..8849b505e4b0 100644 --- a/src/test/ui/run-pass/issues/issue-22781.rs +++ b/src/test/run-pass/issues/issue-22781.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::collections::HashMap; use std::collections::hash_map::Entry::Vacant; diff --git a/src/test/ui/run-pass/issues/issue-22814.rs b/src/test/run-pass/issues/issue-22814.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22814.rs rename to src/test/run-pass/issues/issue-22814.rs diff --git a/src/test/ui/run-pass/issues/issue-22828.rs b/src/test/run-pass/issues/issue-22828.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-22828.rs rename to src/test/run-pass/issues/issue-22828.rs index cc92f0809368..cdbd1deb0013 100644 --- a/src/test/ui/run-pass/issues/issue-22828.rs +++ b/src/test/run-pass/issues/issue-22828.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. diff --git a/src/test/ui/run-pass/issues/issue-2284.rs b/src/test/run-pass/issues/issue-2284.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2284.rs rename to src/test/run-pass/issues/issue-2284.rs index 77d1d6e0aa24..feb752411b13 100644 --- a/src/test/ui/run-pass/issues/issue-2284.rs +++ b/src/test/run-pass/issues/issue-2284.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait Send { diff --git a/src/test/ui/run-pass/issues/issue-22864-1.rs b/src/test/run-pass/issues/issue-22864-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22864-1.rs rename to src/test/run-pass/issues/issue-22864-1.rs diff --git a/src/test/ui/run-pass/issues/issue-22864-2.rs b/src/test/run-pass/issues/issue-22864-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22864-2.rs rename to src/test/run-pass/issues/issue-22864-2.rs diff --git a/src/test/ui/run-pass/issues/issue-2288.rs b/src/test/run-pass/issues/issue-2288.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2288.rs rename to src/test/run-pass/issues/issue-2288.rs diff --git a/src/test/ui/run-pass/issues/issue-22894.rs b/src/test/run-pass/issues/issue-22894.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22894.rs rename to src/test/run-pass/issues/issue-22894.rs diff --git a/src/test/ui/run-pass/issues/issue-22992-2.rs b/src/test/run-pass/issues/issue-22992-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22992-2.rs rename to src/test/run-pass/issues/issue-22992-2.rs diff --git a/src/test/ui/run-pass/issues/issue-22992.rs b/src/test/run-pass/issues/issue-22992.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-22992.rs rename to src/test/run-pass/issues/issue-22992.rs diff --git a/src/test/ui/run-pass/issues/issue-23036.rs b/src/test/run-pass/issues/issue-23036.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23036.rs rename to src/test/run-pass/issues/issue-23036.rs diff --git a/src/test/ui/run-pass/issues/issue-2311-2.rs b/src/test/run-pass/issues/issue-2311-2.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2311-2.rs rename to src/test/run-pass/issues/issue-2311-2.rs index 8cfd941cca8d..493ff6f01cbe 100644 --- a/src/test/ui/run-pass/issues/issue-2311-2.rs +++ b/src/test/run-pass/issues/issue-2311-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/issues/issue-2311.rs b/src/test/run-pass/issues/issue-2311.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2311.rs rename to src/test/run-pass/issues/issue-2311.rs diff --git a/src/test/ui/run-pass/issues/issue-2312.rs b/src/test/run-pass/issues/issue-2312.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2312.rs rename to src/test/run-pass/issues/issue-2312.rs index 33a033ef37fe..9975f8a5aa72 100644 --- a/src/test/ui/run-pass/issues/issue-2312.rs +++ b/src/test/run-pass/issues/issue-2312.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // Testing that the B's are resolved diff --git a/src/test/ui/run-pass/issues/issue-2316-c.rs b/src/test/run-pass/issues/issue-2316-c.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2316-c.rs rename to src/test/run-pass/issues/issue-2316-c.rs diff --git a/src/test/ui/run-pass/issues/issue-23208.rs b/src/test/run-pass/issues/issue-23208.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23208.rs rename to src/test/run-pass/issues/issue-23208.rs diff --git a/src/test/ui/run-pass/issues/issue-23261.rs b/src/test/run-pass/issues/issue-23261.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23261.rs rename to src/test/run-pass/issues/issue-23261.rs diff --git a/src/test/ui/run-pass/issues/issue-23304-1.rs b/src/test/run-pass/issues/issue-23304-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23304-1.rs rename to src/test/run-pass/issues/issue-23304-1.rs diff --git a/src/test/ui/run-pass/issues/issue-23304-2.rs b/src/test/run-pass/issues/issue-23304-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23304-2.rs rename to src/test/run-pass/issues/issue-23304-2.rs diff --git a/src/test/ui/run-pass/issues/issue-23311.rs b/src/test/run-pass/issues/issue-23311.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23311.rs rename to src/test/run-pass/issues/issue-23311.rs diff --git a/src/test/ui/run-pass/issues/issue-23336.rs b/src/test/run-pass/issues/issue-23336.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23336.rs rename to src/test/run-pass/issues/issue-23336.rs diff --git a/src/test/ui/run-pass/issues/issue-23338-ensure-param-drop-order.rs b/src/test/run-pass/issues/issue-23338-ensure-param-drop-order.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23338-ensure-param-drop-order.rs rename to src/test/run-pass/issues/issue-23338-ensure-param-drop-order.rs diff --git a/src/test/ui/run-pass/issues/issue-23338-params-outlive-temps-of-body.rs b/src/test/run-pass/issues/issue-23338-params-outlive-temps-of-body.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23338-params-outlive-temps-of-body.rs rename to src/test/run-pass/issues/issue-23338-params-outlive-temps-of-body.rs diff --git a/src/test/ui/run-pass/issues/issue-23406.rs b/src/test/run-pass/issues/issue-23406.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-23406.rs rename to src/test/run-pass/issues/issue-23406.rs index fb44e2d92702..771f62a6323f 100644 --- a/src/test/ui/run-pass/issues/issue-23406.rs +++ b/src/test/run-pass/issues/issue-23406.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Inner { type T; } diff --git a/src/test/ui/run-pass/issues/issue-23433.rs b/src/test/run-pass/issues/issue-23433.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23433.rs rename to src/test/run-pass/issues/issue-23433.rs diff --git a/src/test/ui/run-pass/issues/issue-23442.rs b/src/test/run-pass/issues/issue-23442.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-23442.rs rename to src/test/run-pass/issues/issue-23442.rs index 9f39b30f1078..1b31516be17f 100644 --- a/src/test/ui/run-pass/issues/issue-23442.rs +++ b/src/test/run-pass/issues/issue-23442.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::marker::PhantomData; pub struct UnionedKeys<'a,K> diff --git a/src/test/ui/run-pass/issues/issue-23477.rs b/src/test/run-pass/issues/issue-23477.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23477.rs rename to src/test/run-pass/issues/issue-23477.rs diff --git a/src/test/ui/run-pass/issues/issue-23485.rs b/src/test/run-pass/issues/issue-23485.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-23485.rs rename to src/test/run-pass/issues/issue-23485.rs index 42ccf5995ac1..0699dc13c153 100644 --- a/src/test/ui/run-pass/issues/issue-23485.rs +++ b/src/test/run-pass/issues/issue-23485.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Test for an ICE that occurred when a default method implementation // was applied to a type that did not meet the prerequisites. The // problem occurred specifically because normalizing diff --git a/src/test/ui/run-pass/issues/issue-23491.rs b/src/test/run-pass/issues/issue-23491.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-23491.rs rename to src/test/run-pass/issues/issue-23491.rs index a6e06050c0e4..54f66d34f391 100644 --- a/src/test/ui/run-pass/issues/issue-23491.rs +++ b/src/test/run-pass/issues/issue-23491.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![feature(box_syntax)] struct Node(T); diff --git a/src/test/ui/run-pass/issues/issue-23550.rs b/src/test/run-pass/issues/issue-23550.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23550.rs rename to src/test/run-pass/issues/issue-23550.rs diff --git a/src/test/ui/run-pass/issues/issue-23611-enum-swap-in-drop.rs b/src/test/run-pass/issues/issue-23611-enum-swap-in-drop.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23611-enum-swap-in-drop.rs rename to src/test/run-pass/issues/issue-23611-enum-swap-in-drop.rs diff --git a/src/test/ui/run-pass/issues/issue-23649-1.rs b/src/test/run-pass/issues/issue-23649-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23649-1.rs rename to src/test/run-pass/issues/issue-23649-1.rs diff --git a/src/test/ui/run-pass/issues/issue-23649-2.rs b/src/test/run-pass/issues/issue-23649-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23649-2.rs rename to src/test/run-pass/issues/issue-23649-2.rs diff --git a/src/test/ui/run-pass/issues/issue-23649-3.rs b/src/test/run-pass/issues/issue-23649-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23649-3.rs rename to src/test/run-pass/issues/issue-23649-3.rs diff --git a/src/test/ui/run-pass/issues/issue-23699.rs b/src/test/run-pass/issues/issue-23699.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-23699.rs rename to src/test/run-pass/issues/issue-23699.rs index a33d1039267b..747fc172023b 100644 --- a/src/test/ui/run-pass/issues/issue-23699.rs +++ b/src/test/run-pass/issues/issue-23699.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] fn gimme_a_raw_pointer(_: *const T) { } fn test(t: T) { } diff --git a/src/test/ui/run-pass/issues/issue-23781.rs b/src/test/run-pass/issues/issue-23781.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23781.rs rename to src/test/run-pass/issues/issue-23781.rs diff --git a/src/test/ui/run-pass/issues/issue-2380-b.rs b/src/test/run-pass/issues/issue-2380-b.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2380-b.rs rename to src/test/run-pass/issues/issue-2380-b.rs diff --git a/src/test/ui/run-pass/issues/issue-23808.rs b/src/test/run-pass/issues/issue-23808.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23808.rs rename to src/test/run-pass/issues/issue-23808.rs diff --git a/src/test/ui/run-pass/issues/issue-23825.rs b/src/test/run-pass/issues/issue-23825.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23825.rs rename to src/test/run-pass/issues/issue-23825.rs diff --git a/src/test/ui/run-pass/issues/issue-2383.rs b/src/test/run-pass/issues/issue-2383.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2383.rs rename to src/test/run-pass/issues/issue-2383.rs diff --git a/src/test/ui/run-pass/issues/issue-23833.rs b/src/test/run-pass/issues/issue-23833.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-23833.rs rename to src/test/run-pass/issues/issue-23833.rs index eeb7db925dae..b790f721a3bc 100644 --- a/src/test/ui/run-pass/issues/issue-23833.rs +++ b/src/test/run-pass/issues/issue-23833.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] use std::fmt; use std::{i8, i16, i32, i64, isize}; use std::{u8, u16, u32, u64, usize}; diff --git a/src/test/ui/run-pass/issues/issue-23891.rs b/src/test/run-pass/issues/issue-23891.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23891.rs rename to src/test/run-pass/issues/issue-23891.rs diff --git a/src/test/ui/run-pass/issues/issue-23898.rs b/src/test/run-pass/issues/issue-23898.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23898.rs rename to src/test/run-pass/issues/issue-23898.rs diff --git a/src/test/ui/run-pass/issues/issue-23958.rs b/src/test/run-pass/issues/issue-23958.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23958.rs rename to src/test/run-pass/issues/issue-23958.rs diff --git a/src/test/ui/run-pass/issues/issue-23968-const-not-overflow.rs b/src/test/run-pass/issues/issue-23968-const-not-overflow.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23968-const-not-overflow.rs rename to src/test/run-pass/issues/issue-23968-const-not-overflow.rs diff --git a/src/test/ui/run-pass/issues/issue-23992.rs b/src/test/run-pass/issues/issue-23992.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-23992.rs rename to src/test/run-pass/issues/issue-23992.rs diff --git a/src/test/ui/run-pass/issues/issue-24085.rs b/src/test/run-pass/issues/issue-24085.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-24085.rs rename to src/test/run-pass/issues/issue-24085.rs index 6d8cacf8b290..06350a80730a 100644 --- a/src/test/ui/run-pass/issues/issue-24085.rs +++ b/src/test/run-pass/issues/issue-24085.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #24085. Errors were occurring in region // inference due to the requirement that `'a:b'`, which was getting // incorrectly codegened in connection with the closure below. diff --git a/src/test/ui/run-pass/issues/issue-24086.rs b/src/test/run-pass/issues/issue-24086.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-24086.rs rename to src/test/run-pass/issues/issue-24086.rs index 632afc006887..1d86c4201b51 100644 --- a/src/test/ui/run-pass/issues/issue-24086.rs +++ b/src/test/run-pass/issues/issue-24086.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_variables)] pub struct Registry<'a> { listener: &'a mut (), } diff --git a/src/test/ui/run-pass/issues/issue-2414-c.rs b/src/test/run-pass/issues/issue-2414-c.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2414-c.rs rename to src/test/run-pass/issues/issue-2414-c.rs diff --git a/src/test/ui/run-pass/issues/issue-24161.rs b/src/test/run-pass/issues/issue-24161.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-24161.rs rename to src/test/run-pass/issues/issue-24161.rs index 1ac5d1237a7d..8bb88be7c562 100644 --- a/src/test/ui/run-pass/issues/issue-24161.rs +++ b/src/test/run-pass/issues/issue-24161.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Copy,Clone)] struct Functions { a: fn(u32) -> u32, diff --git a/src/test/ui/run-pass/issues/issue-24227.rs b/src/test/run-pass/issues/issue-24227.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24227.rs rename to src/test/run-pass/issues/issue-24227.rs diff --git a/src/test/ui/run-pass/issues/issue-2428.rs b/src/test/run-pass/issues/issue-2428.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2428.rs rename to src/test/run-pass/issues/issue-2428.rs diff --git a/src/test/ui/run-pass/issues/issue-24308.rs b/src/test/run-pass/issues/issue-24308.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24308.rs rename to src/test/run-pass/issues/issue-24308.rs diff --git a/src/test/ui/run-pass/issues/issue-24313.rs b/src/test/run-pass/issues/issue-24313.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24313.rs rename to src/test/run-pass/issues/issue-24313.rs diff --git a/src/test/ui/run-pass/issues/issue-24353.rs b/src/test/run-pass/issues/issue-24353.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-24353.rs rename to src/test/run-pass/issues/issue-24353.rs index f4b0e6814e83..753905c2b2f6 100644 --- a/src/test/ui/run-pass/issues/issue-24353.rs +++ b/src/test/run-pass/issues/issue-24353.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] fn main() { return (); diff --git a/src/test/ui/run-pass/issues/issue-24389.rs b/src/test/run-pass/issues/issue-24389.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24389.rs rename to src/test/run-pass/issues/issue-24389.rs diff --git a/src/test/ui/run-pass/issues/issue-24434.rs b/src/test/run-pass/issues/issue-24434.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-24434.rs rename to src/test/run-pass/issues/issue-24434.rs index a4f22e3c79a2..7fdd6f8ee8be 100644 --- a/src/test/ui/run-pass/issues/issue-24434.rs +++ b/src/test/run-pass/issues/issue-24434.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] // compile-flags:--cfg set1 #![cfg_attr(set1, feature(custom_attribute))] diff --git a/src/test/ui/run-pass/issues/issue-2445-b.rs b/src/test/run-pass/issues/issue-2445-b.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2445-b.rs rename to src/test/run-pass/issues/issue-2445-b.rs index 144861dc94ef..b9e773a5d4fd 100644 --- a/src/test/ui/run-pass/issues/issue-2445-b.rs +++ b/src/test/run-pass/issues/issue-2445-b.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-2445.rs b/src/test/run-pass/issues/issue-2445.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2445.rs rename to src/test/run-pass/issues/issue-2445.rs index 1d368e908ed5..95782e83ffb6 100644 --- a/src/test/ui/run-pass/issues/issue-2445.rs +++ b/src/test/run-pass/issues/issue-2445.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-24533.rs b/src/test/run-pass/issues/issue-24533.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-24533.rs rename to src/test/run-pass/issues/issue-24533.rs index 316773e89157..d2104cacd0c2 100644 --- a/src/test/ui/run-pass/issues/issue-24533.rs +++ b/src/test/run-pass/issues/issue-24533.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] use std::slice::Iter; use std::io::{Error, ErrorKind, Result}; use std::vec::*; diff --git a/src/test/ui/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs b/src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs rename to src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs diff --git a/src/test/ui/run-pass/issues/issue-24589.rs b/src/test/run-pass/issues/issue-24589.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24589.rs rename to src/test/run-pass/issues/issue-24589.rs diff --git a/src/test/ui/run-pass/issues/issue-2463.rs b/src/test/run-pass/issues/issue-2463.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2463.rs rename to src/test/run-pass/issues/issue-2463.rs index 1c655f87435f..8a1b6e45e729 100644 --- a/src/test/ui/run-pass/issues/issue-2463.rs +++ b/src/test/run-pass/issues/issue-2463.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Pair { f: isize, g: isize } diff --git a/src/test/ui/run-pass/issues/issue-2472.rs b/src/test/run-pass/issues/issue-2472.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2472.rs rename to src/test/run-pass/issues/issue-2472.rs diff --git a/src/test/ui/run-pass/issues/issue-24779.rs b/src/test/run-pass/issues/issue-24779.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24779.rs rename to src/test/run-pass/issues/issue-24779.rs diff --git a/src/test/ui/run-pass/issues/issue-24805-dropck-itemless.rs b/src/test/run-pass/issues/issue-24805-dropck-itemless.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24805-dropck-itemless.rs rename to src/test/run-pass/issues/issue-24805-dropck-itemless.rs diff --git a/src/test/ui/run-pass/issues/issue-2487-a.rs b/src/test/run-pass/issues/issue-2487-a.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2487-a.rs rename to src/test/run-pass/issues/issue-2487-a.rs index ee0ee1060767..6bd1757f64ce 100644 --- a/src/test/ui/run-pass/issues/issue-2487-a.rs +++ b/src/test/run-pass/issues/issue-2487-a.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-24945-repeat-dash-opts.rs b/src/test/run-pass/issues/issue-24945-repeat-dash-opts.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24945-repeat-dash-opts.rs rename to src/test/run-pass/issues/issue-24945-repeat-dash-opts.rs diff --git a/src/test/ui/run-pass/issues/issue-24947.rs b/src/test/run-pass/issues/issue-24947.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24947.rs rename to src/test/run-pass/issues/issue-24947.rs diff --git a/src/test/ui/run-pass/issues/issue-24954.rs b/src/test/run-pass/issues/issue-24954.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-24954.rs rename to src/test/run-pass/issues/issue-24954.rs diff --git a/src/test/ui/run-pass/issues/issue-2502.rs b/src/test/run-pass/issues/issue-2502.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2502.rs rename to src/test/run-pass/issues/issue-2502.rs index d06f99910a04..938a8e290444 100644 --- a/src/test/ui/run-pass/issues/issue-2502.rs +++ b/src/test/run-pass/issues/issue-2502.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/issues/issue-25089.rs b/src/test/run-pass/issues/issue-25089.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25089.rs rename to src/test/run-pass/issues/issue-25089.rs diff --git a/src/test/ui/run-pass/issues/issue-25145.rs b/src/test/run-pass/issues/issue-25145.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25145.rs rename to src/test/run-pass/issues/issue-25145.rs diff --git a/src/test/ui/run-pass/issues/issue-25180.rs b/src/test/run-pass/issues/issue-25180.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-25180.rs rename to src/test/run-pass/issues/issue-25180.rs index edfa369ed462..04a28fb8f0a2 100644 --- a/src/test/ui/run-pass/issues/issue-25180.rs +++ b/src/test/run-pass/issues/issue-25180.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] const x: &'static Fn() = &|| println!("ICE here"); diff --git a/src/test/ui/run-pass/issues/issue-25185.rs b/src/test/run-pass/issues/issue-25185.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25185.rs rename to src/test/run-pass/issues/issue-25185.rs diff --git a/src/test/ui/run-pass/issues/issue-2526-a.rs b/src/test/run-pass/issues/issue-2526-a.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2526-a.rs rename to src/test/run-pass/issues/issue-2526-a.rs diff --git a/src/test/ui/run-pass/issues/issue-25279.rs b/src/test/run-pass/issues/issue-25279.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25279.rs rename to src/test/run-pass/issues/issue-25279.rs diff --git a/src/test/ui/run-pass/issues/issue-25339.rs b/src/test/run-pass/issues/issue-25339.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-25339.rs rename to src/test/run-pass/issues/issue-25339.rs index 279a88653772..4551b38b5cd8 100644 --- a/src/test/ui/run-pass/issues/issue-25339.rs +++ b/src/test/run-pass/issues/issue-25339.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![feature(associated_type_defaults)] use std::marker::PhantomData; diff --git a/src/test/ui/run-pass/issues/issue-25343.rs b/src/test/run-pass/issues/issue-25343.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25343.rs rename to src/test/run-pass/issues/issue-25343.rs diff --git a/src/test/ui/run-pass/issues/issue-25394.rs b/src/test/run-pass/issues/issue-25394.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-25394.rs rename to src/test/run-pass/issues/issue-25394.rs index df1fe399a4a8..4e7b6242712b 100644 --- a/src/test/ui/run-pass/issues/issue-25394.rs +++ b/src/test/run-pass/issues/issue-25394.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug)] struct Row([T]); diff --git a/src/test/ui/run-pass/issues/issue-25467.rs b/src/test/run-pass/issues/issue-25467.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-25467.rs rename to src/test/run-pass/issues/issue-25467.rs index 37ce124e1321..0f078b214ed9 100644 --- a/src/test/ui/run-pass/issues/issue-25467.rs +++ b/src/test/run-pass/issues/issue-25467.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // aux-build:issue-25467.rs pub type Issue25467BarT = (); diff --git a/src/test/ui/run-pass/issues/issue-25497.rs b/src/test/run-pass/issues/issue-25497.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25497.rs rename to src/test/run-pass/issues/issue-25497.rs diff --git a/src/test/ui/run-pass/issues/issue-2550.rs b/src/test/run-pass/issues/issue-2550.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2550.rs rename to src/test/run-pass/issues/issue-2550.rs index 0552e97e642a..afe837509b95 100644 --- a/src/test/ui/run-pass/issues/issue-2550.rs +++ b/src/test/run-pass/issues/issue-2550.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-25515.rs b/src/test/run-pass/issues/issue-25515.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25515.rs rename to src/test/run-pass/issues/issue-25515.rs diff --git a/src/test/ui/run-pass/issues/issue-25549-multiple-drop.rs b/src/test/run-pass/issues/issue-25549-multiple-drop.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-25549-multiple-drop.rs rename to src/test/run-pass/issues/issue-25549-multiple-drop.rs index 24f44f2ecba9..ccb438a8c23f 100644 --- a/src/test/ui/run-pass/issues/issue-25549-multiple-drop.rs +++ b/src/test/run-pass/issues/issue-25549-multiple-drop.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] struct Foo<'r>(&'r mut i32); impl<'r> Drop for Foo<'r> { diff --git a/src/test/ui/run-pass/issues/issue-25679.rs b/src/test/run-pass/issues/issue-25679.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25679.rs rename to src/test/run-pass/issues/issue-25679.rs diff --git a/src/test/ui/run-pass/issues/issue-25693.rs b/src/test/run-pass/issues/issue-25693.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-25693.rs rename to src/test/run-pass/issues/issue-25693.rs index 86fe6c08147c..174fc8325981 100644 --- a/src/test/ui/run-pass/issues/issue-25693.rs +++ b/src/test/run-pass/issues/issue-25693.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] pub trait Parameters { type SelfRef; } struct RP<'a> { _marker: std::marker::PhantomData<&'a ()> } diff --git a/src/test/ui/run-pass/issues/issue-25700-1.rs b/src/test/run-pass/issues/issue-25700-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25700-1.rs rename to src/test/run-pass/issues/issue-25700-1.rs diff --git a/src/test/ui/run-pass/issues/issue-25700-2.rs b/src/test/run-pass/issues/issue-25700-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25700-2.rs rename to src/test/run-pass/issues/issue-25700-2.rs diff --git a/src/test/ui/run-pass/issues/issue-25746-bool-transmute.rs b/src/test/run-pass/issues/issue-25746-bool-transmute.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25746-bool-transmute.rs rename to src/test/run-pass/issues/issue-25746-bool-transmute.rs diff --git a/src/test/ui/run-pass/issues/issue-25757.rs b/src/test/run-pass/issues/issue-25757.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25757.rs rename to src/test/run-pass/issues/issue-25757.rs diff --git a/src/test/ui/run-pass/issues/issue-25810.rs b/src/test/run-pass/issues/issue-25810.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-25810.rs rename to src/test/run-pass/issues/issue-25810.rs diff --git a/src/test/ui/run-pass/issues/issue-25916.rs b/src/test/run-pass/issues/issue-25916.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-25916.rs rename to src/test/run-pass/issues/issue-25916.rs index cf8753119bf9..c71af4660fb0 100644 --- a/src/test/ui/run-pass/issues/issue-25916.rs +++ b/src/test/run-pass/issues/issue-25916.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] + fn main() { macro_rules! f { () => { 0 + 0 } diff --git a/src/test/ui/run-pass/issues/issue-26095.rs b/src/test/run-pass/issues/issue-26095.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-26095.rs rename to src/test/run-pass/issues/issue-26095.rs index 0c6bc7c4885f..cc7f7cdbab1f 100644 --- a/src/test/ui/run-pass/issues/issue-26095.rs +++ b/src/test/run-pass/issues/issue-26095.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/run-pass/issues/issue-2611-3.rs b/src/test/run-pass/issues/issue-2611-3.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2611-3.rs rename to src/test/run-pass/issues/issue-2611-3.rs index 4b66aa48a5bd..99fd1a727f55 100644 --- a/src/test/ui/run-pass/issues/issue-2611-3.rs +++ b/src/test/run-pass/issues/issue-2611-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Tests that impls are allowed to have looser, more permissive bounds // than the traits require. diff --git a/src/test/ui/run-pass/issues/issue-26127.rs b/src/test/run-pass/issues/issue-26127.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26127.rs rename to src/test/run-pass/issues/issue-26127.rs diff --git a/src/test/ui/run-pass/issues/issue-26205.rs b/src/test/run-pass/issues/issue-26205.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-26205.rs rename to src/test/run-pass/issues/issue-26205.rs index e015acfdc2a1..ce96c3dd5a2a 100644 --- a/src/test/ui/run-pass/issues/issue-26205.rs +++ b/src/test/run-pass/issues/issue-26205.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::ops::{Deref, DerefMut}; struct Foo; diff --git a/src/test/ui/run-pass/issues/issue-26251.rs b/src/test/run-pass/issues/issue-26251.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26251.rs rename to src/test/run-pass/issues/issue-26251.rs diff --git a/src/test/ui/run-pass/issues/issue-2631-b.rs b/src/test/run-pass/issues/issue-2631-b.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2631-b.rs rename to src/test/run-pass/issues/issue-2631-b.rs diff --git a/src/test/ui/run-pass/issues/issue-26322.rs b/src/test/run-pass/issues/issue-26322.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26322.rs rename to src/test/run-pass/issues/issue-26322.rs diff --git a/src/test/ui/run-pass/issues/issue-2633-2.rs b/src/test/run-pass/issues/issue-2633-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2633-2.rs rename to src/test/run-pass/issues/issue-2633-2.rs diff --git a/src/test/ui/run-pass/issues/issue-2633.rs b/src/test/run-pass/issues/issue-2633.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2633.rs rename to src/test/run-pass/issues/issue-2633.rs index c02c4e7b9d62..410339d37f1a 100644 --- a/src/test/ui/run-pass/issues/issue-2633.rs +++ b/src/test/run-pass/issues/issue-2633.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #[derive(Copy, Clone)] diff --git a/src/test/ui/run-pass/issues/issue-2642.rs b/src/test/run-pass/issues/issue-2642.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2642.rs rename to src/test/run-pass/issues/issue-2642.rs index c900fa7b42cd..94d8adfa3231 100644 --- a/src/test/ui/run-pass/issues/issue-2642.rs +++ b/src/test/run-pass/issues/issue-2642.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn f() { diff --git a/src/test/ui/run-pass/issues/issue-26468.rs b/src/test/run-pass/issues/issue-26468.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26468.rs rename to src/test/run-pass/issues/issue-26468.rs diff --git a/src/test/ui/run-pass/issues/issue-26484.rs b/src/test/run-pass/issues/issue-26484.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26484.rs rename to src/test/run-pass/issues/issue-26484.rs diff --git a/src/test/ui/run-pass/issues/issue-26641.rs b/src/test/run-pass/issues/issue-26641.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26641.rs rename to src/test/run-pass/issues/issue-26641.rs diff --git a/src/test/ui/run-pass/issues/issue-26646.rs b/src/test/run-pass/issues/issue-26646.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26646.rs rename to src/test/run-pass/issues/issue-26646.rs diff --git a/src/test/ui/run-pass/issues/issue-26655.rs b/src/test/run-pass/issues/issue-26655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26655.rs rename to src/test/run-pass/issues/issue-26655.rs diff --git a/src/test/ui/run-pass/issues/issue-26709.rs b/src/test/run-pass/issues/issue-26709.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26709.rs rename to src/test/run-pass/issues/issue-26709.rs diff --git a/src/test/ui/run-pass/issues/issue-26802.rs b/src/test/run-pass/issues/issue-26802.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26802.rs rename to src/test/run-pass/issues/issue-26802.rs diff --git a/src/test/ui/run-pass/issues/issue-26805.rs b/src/test/run-pass/issues/issue-26805.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26805.rs rename to src/test/run-pass/issues/issue-26805.rs diff --git a/src/test/ui/run-pass/issues/issue-26873-multifile.rs b/src/test/run-pass/issues/issue-26873-multifile.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-26873-multifile.rs rename to src/test/run-pass/issues/issue-26873-multifile.rs index c557c0698d5c..803ef06eba7b 100644 --- a/src/test/ui/run-pass/issues/issue-26873-multifile.rs +++ b/src/test/run-pass/issues/issue-26873-multifile.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] #![allow(non_snake_case)] // ignore-pretty issue #37195 diff --git a/src/test/ui/run-pass/issues/issue-26873-onefile.rs b/src/test/run-pass/issues/issue-26873-onefile.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-26873-onefile.rs rename to src/test/run-pass/issues/issue-26873-onefile.rs index 005491ecc589..c2f1c6cb1bff 100644 --- a/src/test/ui/run-pass/issues/issue-26873-onefile.rs +++ b/src/test/run-pass/issues/issue-26873-onefile.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_imports)] #![allow(non_snake_case)] mod A { diff --git a/src/test/ui/run-pass/issues/issue-26905.rs b/src/test/run-pass/issues/issue-26905.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26905.rs rename to src/test/run-pass/issues/issue-26905.rs diff --git a/src/test/ui/run-pass/issues/issue-26996.rs b/src/test/run-pass/issues/issue-26996.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-26996.rs rename to src/test/run-pass/issues/issue-26996.rs diff --git a/src/test/ui/run-pass/issues/issue-26997.rs b/src/test/run-pass/issues/issue-26997.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-26997.rs rename to src/test/run-pass/issues/issue-26997.rs index e6d0ef144313..03430e1ac687 100644 --- a/src/test/ui/run-pass/issues/issue-26997.rs +++ b/src/test/run-pass/issues/issue-26997.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub struct Foo { x: isize, y: isize diff --git a/src/test/ui/run-pass/issues/issue-27021.rs b/src/test/run-pass/issues/issue-27021.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27021.rs rename to src/test/run-pass/issues/issue-27021.rs diff --git a/src/test/ui/run-pass/issues/issue-27054-primitive-binary-ops.rs b/src/test/run-pass/issues/issue-27054-primitive-binary-ops.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27054-primitive-binary-ops.rs rename to src/test/run-pass/issues/issue-27054-primitive-binary-ops.rs diff --git a/src/test/ui/run-pass/issues/issue-27060.rs b/src/test/run-pass/issues/issue-27060.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-27060.rs rename to src/test/run-pass/issues/issue-27060.rs index 594edb3fd715..adf3179da4fc 100644 --- a/src/test/ui/run-pass/issues/issue-27060.rs +++ b/src/test/run-pass/issues/issue-27060.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[repr(packed)] pub struct Good { data: &'static u32, diff --git a/src/test/ui/run-pass/issues/issue-2708.rs b/src/test/run-pass/issues/issue-2708.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2708.rs rename to src/test/run-pass/issues/issue-2708.rs index 5fccdb0f1371..d760e8eef682 100644 --- a/src/test/ui/run-pass/issues/issue-2708.rs +++ b/src/test/run-pass/issues/issue-2708.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-27105.rs b/src/test/run-pass/issues/issue-27105.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27105.rs rename to src/test/run-pass/issues/issue-27105.rs diff --git a/src/test/ui/run-pass/issues/issue-2718.rs b/src/test/run-pass/issues/issue-2718.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-2718.rs rename to src/test/run-pass/issues/issue-2718.rs index 1c5e7c7333d3..4faf9216fcbe 100644 --- a/src/test/ui/run-pass/issues/issue-2718.rs +++ b/src/test/run-pass/issues/issue-2718.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_unsafe)] +#![allow(unused_imports)] #![allow(non_camel_case_types)] pub type Task = isize; diff --git a/src/test/ui/run-pass/issues/issue-2723-b.rs b/src/test/run-pass/issues/issue-2723-b.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2723-b.rs rename to src/test/run-pass/issues/issue-2723-b.rs diff --git a/src/test/ui/run-pass/issues/issue-27240.rs b/src/test/run-pass/issues/issue-27240.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-27240.rs rename to src/test/run-pass/issues/issue-27240.rs index 5e65a8084c34..07eb34e32ce0 100644 --- a/src/test/ui/run-pass/issues/issue-27240.rs +++ b/src/test/run-pass/issues/issue-27240.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] use std::fmt; struct NoisyDrop(T); impl Drop for NoisyDrop { diff --git a/src/test/ui/run-pass/issues/issue-27268.rs b/src/test/run-pass/issues/issue-27268.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27268.rs rename to src/test/run-pass/issues/issue-27268.rs diff --git a/src/test/ui/run-pass/issues/issue-27281.rs b/src/test/run-pass/issues/issue-27281.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27281.rs rename to src/test/run-pass/issues/issue-27281.rs diff --git a/src/test/ui/run-pass/issues/issue-27320.rs b/src/test/run-pass/issues/issue-27320.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27320.rs rename to src/test/run-pass/issues/issue-27320.rs diff --git a/src/test/ui/run-pass/issues/issue-2734.rs b/src/test/run-pass/issues/issue-2734.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2734.rs rename to src/test/run-pass/issues/issue-2734.rs index e3b1618c625e..68be15563499 100644 --- a/src/test/ui/run-pass/issues/issue-2734.rs +++ b/src/test/run-pass/issues/issue-2734.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-2735-2.rs b/src/test/run-pass/issues/issue-2735-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2735-2.rs rename to src/test/run-pass/issues/issue-2735-2.rs diff --git a/src/test/ui/run-pass/issues/issue-2735-3.rs b/src/test/run-pass/issues/issue-2735-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2735-3.rs rename to src/test/run-pass/issues/issue-2735-3.rs diff --git a/src/test/ui/run-pass/issues/issue-2735.rs b/src/test/run-pass/issues/issue-2735.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2735.rs rename to src/test/run-pass/issues/issue-2735.rs index b22051700d8c..8e5459ad9154 100644 --- a/src/test/ui/run-pass/issues/issue-2735.rs +++ b/src/test/run-pass/issues/issue-2735.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-27401-dropflag-reinit.rs b/src/test/run-pass/issues/issue-27401-dropflag-reinit.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27401-dropflag-reinit.rs rename to src/test/run-pass/issues/issue-27401-dropflag-reinit.rs diff --git a/src/test/ui/run-pass/issues/issue-2748-a.rs b/src/test/run-pass/issues/issue-2748-a.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2748-a.rs rename to src/test/run-pass/issues/issue-2748-a.rs index 9d84e2dccbcf..db7b46a4dc5a 100644 --- a/src/test/ui/run-pass/issues/issue-2748-a.rs +++ b/src/test/run-pass/issues/issue-2748-a.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-2748-b.rs b/src/test/run-pass/issues/issue-2748-b.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2748-b.rs rename to src/test/run-pass/issues/issue-2748-b.rs diff --git a/src/test/ui/run-pass/issues/issue-27583.rs b/src/test/run-pass/issues/issue-27583.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27583.rs rename to src/test/run-pass/issues/issue-27583.rs diff --git a/src/test/ui/run-pass/issues/issue-27639.rs b/src/test/run-pass/issues/issue-27639.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-27639.rs rename to src/test/run-pass/issues/issue-27639.rs index 81b1a2518fc2..7dcbe21b7e4a 100644 --- a/src/test/ui/run-pass/issues/issue-27639.rs +++ b/src/test/run-pass/issues/issue-27639.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] fn main() { diff --git a/src/test/ui/run-pass/issues/issue-27859.rs b/src/test/run-pass/issues/issue-27859.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27859.rs rename to src/test/run-pass/issues/issue-27859.rs diff --git a/src/test/ui/run-pass/issues/issue-27889.rs b/src/test/run-pass/issues/issue-27889.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-27889.rs rename to src/test/run-pass/issues/issue-27889.rs index a16bfeb8daad..82d178835e2d 100644 --- a/src/test/ui/run-pass/issues/issue-27889.rs +++ b/src/test/run-pass/issues/issue-27889.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] // Test that a field can have the same name in different variants // of an enum diff --git a/src/test/ui/run-pass/issues/issue-27890.rs b/src/test/run-pass/issues/issue-27890.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27890.rs rename to src/test/run-pass/issues/issue-27890.rs diff --git a/src/test/ui/run-pass/issues/issue-27901.rs b/src/test/run-pass/issues/issue-27901.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27901.rs rename to src/test/run-pass/issues/issue-27901.rs diff --git a/src/test/ui/run-pass/issues/issue-27997.rs b/src/test/run-pass/issues/issue-27997.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-27997.rs rename to src/test/run-pass/issues/issue-27997.rs diff --git a/src/test/ui/run-pass/issues/issue-2804-2.rs b/src/test/run-pass/issues/issue-2804-2.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2804-2.rs rename to src/test/run-pass/issues/issue-2804-2.rs index a080627c6868..3e64d78ba027 100644 --- a/src/test/ui/run-pass/issues/issue-2804-2.rs +++ b/src/test/run-pass/issues/issue-2804-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Minimized version of issue-2804.rs. Both check that callee IDs don't // clobber the previous node ID in a macro expr diff --git a/src/test/ui/run-pass/issues/issue-28181.rs b/src/test/run-pass/issues/issue-28181.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28181.rs rename to src/test/run-pass/issues/issue-28181.rs diff --git a/src/test/ui/run-pass/issues/issue-28279.rs b/src/test/run-pass/issues/issue-28279.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-28279.rs rename to src/test/run-pass/issues/issue-28279.rs index bc615c8f7e3f..bd5129a8ae4d 100644 --- a/src/test/ui/run-pass/issues/issue-28279.rs +++ b/src/test/run-pass/issues/issue-28279.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::rc::Rc; fn test1() -> Rc Fn(&'a usize) + 'static> { diff --git a/src/test/ui/run-pass/issues/issue-28550.rs b/src/test/run-pass/issues/issue-28550.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28550.rs rename to src/test/run-pass/issues/issue-28550.rs diff --git a/src/test/ui/run-pass/issues/issue-28561.rs b/src/test/run-pass/issues/issue-28561.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28561.rs rename to src/test/run-pass/issues/issue-28561.rs diff --git a/src/test/ui/run-pass/issues/issue-28600.rs b/src/test/run-pass/issues/issue-28600.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28600.rs rename to src/test/run-pass/issues/issue-28600.rs diff --git a/src/test/ui/run-pass/issues/issue-28676.rs b/src/test/run-pass/issues/issue-28676.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-28676.rs rename to src/test/run-pass/issues/issue-28676.rs index 978d2136334f..c571c4e23ce8 100644 --- a/src/test/ui/run-pass/issues/issue-28676.rs +++ b/src/test/run-pass/issues/issue-28676.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(improper_ctypes)] // ignore-wasm32-bare no libc to test ffi with diff --git a/src/test/ui/run-pass/issues/issue-28777.rs b/src/test/run-pass/issues/issue-28777.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28777.rs rename to src/test/run-pass/issues/issue-28777.rs diff --git a/src/test/ui/run-pass/issues/issue-28822.rs b/src/test/run-pass/issues/issue-28822.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-28822.rs rename to src/test/run-pass/issues/issue-28822.rs index 39e4a23e3cdd..1dda72129523 100644 --- a/src/test/ui/run-pass/issues/issue-28822.rs +++ b/src/test/run-pass/issues/issue-28822.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(min_const_fn)] fn main() {} diff --git a/src/test/ui/run-pass/issues/issue-28828.rs b/src/test/run-pass/issues/issue-28828.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28828.rs rename to src/test/run-pass/issues/issue-28828.rs diff --git a/src/test/ui/run-pass/issues/issue-28839.rs b/src/test/run-pass/issues/issue-28839.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28839.rs rename to src/test/run-pass/issues/issue-28839.rs diff --git a/src/test/ui/run-pass/issues/issue-28871.rs b/src/test/run-pass/issues/issue-28871.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28871.rs rename to src/test/run-pass/issues/issue-28871.rs diff --git a/src/test/ui/run-pass/issues/issue-28936.rs b/src/test/run-pass/issues/issue-28936.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28936.rs rename to src/test/run-pass/issues/issue-28936.rs diff --git a/src/test/ui/run-pass/issues/issue-2895.rs b/src/test/run-pass/issues/issue-2895.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2895.rs rename to src/test/run-pass/issues/issue-2895.rs index e52126e16f8d..9a1be5fef32d 100644 --- a/src/test/ui/run-pass/issues/issue-2895.rs +++ b/src/test/run-pass/issues/issue-2895.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem; diff --git a/src/test/ui/run-pass/issues/issue-28950.rs b/src/test/run-pass/issues/issue-28950.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28950.rs rename to src/test/run-pass/issues/issue-28950.rs diff --git a/src/test/ui/run-pass/issues/issue-28983.rs b/src/test/run-pass/issues/issue-28983.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28983.rs rename to src/test/run-pass/issues/issue-28983.rs diff --git a/src/test/ui/run-pass/issues/issue-28999.rs b/src/test/run-pass/issues/issue-28999.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-28999.rs rename to src/test/run-pass/issues/issue-28999.rs diff --git a/src/test/ui/run-pass/issues/issue-29030.rs b/src/test/run-pass/issues/issue-29030.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-29030.rs rename to src/test/run-pass/issues/issue-29030.rs index 51dbf58a77d3..9f4b2cffbbb1 100644 --- a/src/test/ui/run-pass/issues/issue-29030.rs +++ b/src/test/run-pass/issues/issue-29030.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug)] struct Message<'a, P: 'a = &'a [u8]> { header: &'a [u8], diff --git a/src/test/ui/run-pass/issues/issue-29037.rs b/src/test/run-pass/issues/issue-29037.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-29037.rs rename to src/test/run-pass/issues/issue-29037.rs index 2ee4446820bd..3148e61827ff 100644 --- a/src/test/ui/run-pass/issues/issue-29037.rs +++ b/src/test/run-pass/issues/issue-29037.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // This test ensures that each pointer type `P` is covariant in `X`. use std::rc::Rc; diff --git a/src/test/ui/run-pass/issues/issue-2904.rs b/src/test/run-pass/issues/issue-2904.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-2904.rs rename to src/test/run-pass/issues/issue-2904.rs index dcb8515c7768..ab40c2e0bbec 100644 --- a/src/test/ui/run-pass/issues/issue-2904.rs +++ b/src/test/run-pass/issues/issue-2904.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_mut)] #![allow(non_camel_case_types)] // Map representation diff --git a/src/test/ui/run-pass/issues/issue-29048.rs b/src/test/run-pass/issues/issue-29048.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29048.rs rename to src/test/run-pass/issues/issue-29048.rs diff --git a/src/test/ui/run-pass/issues/issue-29053.rs b/src/test/run-pass/issues/issue-29053.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29053.rs rename to src/test/run-pass/issues/issue-29053.rs diff --git a/src/test/ui/run-pass/issues/issue-29071-2.rs b/src/test/run-pass/issues/issue-29071-2.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-29071-2.rs rename to src/test/run-pass/issues/issue-29071-2.rs index f0025f25557c..84dbb40ea87f 100644 --- a/src/test/ui/run-pass/issues/issue-29071-2.rs +++ b/src/test/run-pass/issues/issue-29071-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn t1() -> u32 { let x; x = if true { [1, 2, 3] } else { [2, 3, 4] }[0]; diff --git a/src/test/ui/run-pass/issues/issue-29071.rs b/src/test/run-pass/issues/issue-29071.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-29071.rs rename to src/test/run-pass/issues/issue-29071.rs index 06570f41a533..1eab5a7bbdad 100644 --- a/src/test/ui/run-pass/issues/issue-29071.rs +++ b/src/test/run-pass/issues/issue-29071.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] fn ret() -> u32 { diff --git a/src/test/ui/run-pass/issues/issue-29092.rs b/src/test/run-pass/issues/issue-29092.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29092.rs rename to src/test/run-pass/issues/issue-29092.rs diff --git a/src/test/ui/run-pass/issues/issue-29147.rs b/src/test/run-pass/issues/issue-29147.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29147.rs rename to src/test/run-pass/issues/issue-29147.rs diff --git a/src/test/ui/run-pass/issues/issue-29166.rs b/src/test/run-pass/issues/issue-29166.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29166.rs rename to src/test/run-pass/issues/issue-29166.rs diff --git a/src/test/ui/run-pass/issues/issue-29227.rs b/src/test/run-pass/issues/issue-29227.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29227.rs rename to src/test/run-pass/issues/issue-29227.rs diff --git a/src/test/ui/run-pass/issues/issue-29276.rs b/src/test/run-pass/issues/issue-29276.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-29276.rs rename to src/test/run-pass/issues/issue-29276.rs index 6797dbc31c1c..9f2a0d6bc99b 100644 --- a/src/test/ui/run-pass/issues/issue-29276.rs +++ b/src/test/run-pass/issues/issue-29276.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S([u8; { struct Z; 0 }]); fn main() {} diff --git a/src/test/ui/run-pass/issues/issue-2935.rs b/src/test/run-pass/issues/issue-2935.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-2935.rs rename to src/test/run-pass/issues/issue-2935.rs index d2af83251819..6656914e4191 100644 --- a/src/test/ui/run-pass/issues/issue-2935.rs +++ b/src/test/run-pass/issues/issue-2935.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/issues/issue-2936.rs b/src/test/run-pass/issues/issue-2936.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2936.rs rename to src/test/run-pass/issues/issue-2936.rs diff --git a/src/test/ui/run-pass/issues/issue-29466.rs b/src/test/run-pass/issues/issue-29466.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-29466.rs rename to src/test/run-pass/issues/issue-29466.rs index 1c8fc88f8f2b..0aa4e6355d1e 100644 --- a/src/test/ui/run-pass/issues/issue-29466.rs +++ b/src/test/run-pass/issues/issue-29466.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] macro_rules! m( ($e1:expr => $e2:expr) => ({ $e1 }) ); diff --git a/src/test/ui/run-pass/issues/issue-29485.rs b/src/test/run-pass/issues/issue-29485.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-29485.rs rename to src/test/run-pass/issues/issue-29485.rs index 67725b02ded9..f3890f8d5215 100644 --- a/src/test/ui/run-pass/issues/issue-29485.rs +++ b/src/test/run-pass/issues/issue-29485.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] // aux-build:issue-29485.rs // ignore-emscripten no threads diff --git a/src/test/ui/run-pass/issues/issue-29488.rs b/src/test/run-pass/issues/issue-29488.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29488.rs rename to src/test/run-pass/issues/issue-29488.rs diff --git a/src/test/ui/run-pass/issues/issue-29516.rs b/src/test/run-pass/issues/issue-29516.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29516.rs rename to src/test/run-pass/issues/issue-29516.rs diff --git a/src/test/ui/run-pass/issues/issue-29522.rs b/src/test/run-pass/issues/issue-29522.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-29522.rs rename to src/test/run-pass/issues/issue-29522.rs index 9d5a12dadbea..75c01b2589e1 100644 --- a/src/test/ui/run-pass/issues/issue-29522.rs +++ b/src/test/run-pass/issues/issue-29522.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // check that we don't accidentally capture upvars just because their name // occurs in a path diff --git a/src/test/ui/run-pass/issues/issue-29540.rs b/src/test/run-pass/issues/issue-29540.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29540.rs rename to src/test/run-pass/issues/issue-29540.rs diff --git a/src/test/ui/run-pass/issues/issue-29663.rs b/src/test/run-pass/issues/issue-29663.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29663.rs rename to src/test/run-pass/issues/issue-29663.rs diff --git a/src/test/ui/run-pass/issues/issue-29668.rs b/src/test/run-pass/issues/issue-29668.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29668.rs rename to src/test/run-pass/issues/issue-29668.rs diff --git a/src/test/ui/run-pass/issues/issue-29710.rs b/src/test/run-pass/issues/issue-29710.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29710.rs rename to src/test/run-pass/issues/issue-29710.rs diff --git a/src/test/ui/run-pass/issues/issue-29740.rs b/src/test/run-pass/issues/issue-29740.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-29740.rs rename to src/test/run-pass/issues/issue-29740.rs index b0959e830093..3854ad38bdcd 100644 --- a/src/test/ui/run-pass/issues/issue-29740.rs +++ b/src/test/run-pass/issues/issue-29740.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #29740. Inefficient MIR matching algorithms // generated way too much code for this sort of case, leading to OOM. #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/issues/issue-29746.rs b/src/test/run-pass/issues/issue-29746.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29746.rs rename to src/test/run-pass/issues/issue-29746.rs diff --git a/src/test/ui/run-pass/issues/issue-29844.rs b/src/test/run-pass/issues/issue-29844.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29844.rs rename to src/test/run-pass/issues/issue-29844.rs diff --git a/src/test/ui/run-pass/issues/issue-2989.rs b/src/test/run-pass/issues/issue-2989.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-2989.rs rename to src/test/run-pass/issues/issue-2989.rs diff --git a/src/test/ui/run-pass/issues/issue-29914-2.rs b/src/test/run-pass/issues/issue-29914-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29914-2.rs rename to src/test/run-pass/issues/issue-29914-2.rs diff --git a/src/test/ui/run-pass/issues/issue-29914-3.rs b/src/test/run-pass/issues/issue-29914-3.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29914-3.rs rename to src/test/run-pass/issues/issue-29914-3.rs diff --git a/src/test/ui/run-pass/issues/issue-29914.rs b/src/test/run-pass/issues/issue-29914.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29914.rs rename to src/test/run-pass/issues/issue-29914.rs diff --git a/src/test/ui/run-pass/issues/issue-29927.rs b/src/test/run-pass/issues/issue-29927.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-29927.rs rename to src/test/run-pass/issues/issue-29927.rs index 4eab938609fc..863d9e74abb2 100644 --- a/src/test/ui/run-pass/issues/issue-29927.rs +++ b/src/test/run-pass/issues/issue-29927.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(min_const_fn)] struct A { field: usize, diff --git a/src/test/ui/run-pass/issues/issue-29948.rs b/src/test/run-pass/issues/issue-29948.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-29948.rs rename to src/test/run-pass/issues/issue-29948.rs diff --git a/src/test/ui/run-pass/issues/issue-30018-nopanic.rs b/src/test/run-pass/issues/issue-30018-nopanic.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-30018-nopanic.rs rename to src/test/run-pass/issues/issue-30018-nopanic.rs index bb94d4f8517a..dfbdf1fdeb4d 100644 --- a/src/test/ui/run-pass/issues/issue-30018-nopanic.rs +++ b/src/test/run-pass/issues/issue-30018-nopanic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // More thorough regression test for Issues #30018 and #30822. This // attempts to explore different ways that array element construction // (for both scratch arrays and non-scratch ones) interacts with diff --git a/src/test/ui/run-pass/issues/issue-30018-panic.rs b/src/test/run-pass/issues/issue-30018-panic.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30018-panic.rs rename to src/test/run-pass/issues/issue-30018-panic.rs diff --git a/src/test/ui/run-pass/issues/issue-30081.rs b/src/test/run-pass/issues/issue-30081.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30081.rs rename to src/test/run-pass/issues/issue-30081.rs diff --git a/src/test/ui/run-pass/issues/issue-3012-2.rs b/src/test/run-pass/issues/issue-3012-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3012-2.rs rename to src/test/run-pass/issues/issue-3012-2.rs diff --git a/src/test/ui/run-pass/issues/issue-30240.rs b/src/test/run-pass/issues/issue-30240.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30240.rs rename to src/test/run-pass/issues/issue-30240.rs diff --git a/src/test/ui/run-pass/issues/issue-3026.rs b/src/test/run-pass/issues/issue-3026.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3026.rs rename to src/test/run-pass/issues/issue-3026.rs diff --git a/src/test/ui/run-pass/issues/issue-3037.rs b/src/test/run-pass/issues/issue-3037.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-3037.rs rename to src/test/run-pass/issues/issue-3037.rs index ab2d5a5ae889..8ae7b64182d1 100644 --- a/src/test/ui/run-pass/issues/issue-3037.rs +++ b/src/test/run-pass/issues/issue-3037.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/issues/issue-30371.rs b/src/test/run-pass/issues/issue-30371.rs similarity index 88% rename from src/test/ui/run-pass/issues/issue-30371.rs rename to src/test/run-pass/issues/issue-30371.rs index f95d442c1b98..3877e231527d 100644 --- a/src/test/ui/run-pass/issues/issue-30371.rs +++ b/src/test/run-pass/issues/issue-30371.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] +#![allow(unused_mut)] // rust-lang/rust#54586 #![deny(unused_variables)] fn main() { diff --git a/src/test/ui/run-pass/issues/issue-30490.rs b/src/test/run-pass/issues/issue-30490.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30490.rs rename to src/test/run-pass/issues/issue-30490.rs diff --git a/src/test/ui/run-pass/issues/issue-3052.rs b/src/test/run-pass/issues/issue-3052.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3052.rs rename to src/test/run-pass/issues/issue-3052.rs index 6c2d3899bf37..612fd69a4998 100644 --- a/src/test/ui/run-pass/issues/issue-3052.rs +++ b/src/test/run-pass/issues/issue-3052.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 type Connection = Box) + 'static>; diff --git a/src/test/ui/run-pass/issues/issue-30530.rs b/src/test/run-pass/issues/issue-30530.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30530.rs rename to src/test/run-pass/issues/issue-30530.rs diff --git a/src/test/ui/run-pass/issues/issue-30615.rs b/src/test/run-pass/issues/issue-30615.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30615.rs rename to src/test/run-pass/issues/issue-30615.rs diff --git a/src/test/ui/run-pass/issues/issue-30756.rs b/src/test/run-pass/issues/issue-30756.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30756.rs rename to src/test/run-pass/issues/issue-30756.rs diff --git a/src/test/ui/run-pass/issues/issue-30891.rs b/src/test/run-pass/issues/issue-30891.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-30891.rs rename to src/test/run-pass/issues/issue-30891.rs diff --git a/src/test/ui/run-pass/issues/issue-3091.rs b/src/test/run-pass/issues/issue-3091.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3091.rs rename to src/test/run-pass/issues/issue-3091.rs diff --git a/src/test/ui/run-pass/issues/issue-3109.rs b/src/test/run-pass/issues/issue-3109.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3109.rs rename to src/test/run-pass/issues/issue-3109.rs diff --git a/src/test/ui/run-pass/issues/issue-3121.rs b/src/test/run-pass/issues/issue-3121.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3121.rs rename to src/test/run-pass/issues/issue-3121.rs index 9d70cf90d1cd..60b240500929 100644 --- a/src/test/ui/run-pass/issues/issue-3121.rs +++ b/src/test/run-pass/issues/issue-3121.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/issues/issue-31260.rs b/src/test/run-pass/issues/issue-31260.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-31260.rs rename to src/test/run-pass/issues/issue-31260.rs index 6b31a1ac996c..82d0d5b5ffbb 100644 --- a/src/test/ui/run-pass/issues/issue-31260.rs +++ b/src/test/run-pass/issues/issue-31260.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub struct Struct { pub field: K, } diff --git a/src/test/ui/run-pass/issues/issue-31267-additional.rs b/src/test/run-pass/issues/issue-31267-additional.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-31267-additional.rs rename to src/test/run-pass/issues/issue-31267-additional.rs diff --git a/src/test/ui/run-pass/issues/issue-31267.rs b/src/test/run-pass/issues/issue-31267.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-31267.rs rename to src/test/run-pass/issues/issue-31267.rs diff --git a/src/test/ui/run-pass/issues/issue-31299.rs b/src/test/run-pass/issues/issue-31299.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-31299.rs rename to src/test/run-pass/issues/issue-31299.rs diff --git a/src/test/ui/run-pass/issues/issue-3149.rs b/src/test/run-pass/issues/issue-3149.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3149.rs rename to src/test/run-pass/issues/issue-3149.rs index 324aec23ab08..4eb3378a089e 100644 --- a/src/test/ui/run-pass/issues/issue-3149.rs +++ b/src/test/run-pass/issues/issue-3149.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-31597.rs b/src/test/run-pass/issues/issue-31597.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-31597.rs rename to src/test/run-pass/issues/issue-31597.rs index 50aefb7d870f..f3995511b0fc 100644 --- a/src/test/ui/run-pass/issues/issue-31597.rs +++ b/src/test/run-pass/issues/issue-31597.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Make { type Out; diff --git a/src/test/ui/run-pass/issues/issue-31702.rs b/src/test/run-pass/issues/issue-31702.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-31702.rs rename to src/test/run-pass/issues/issue-31702.rs diff --git a/src/test/ui/run-pass/issues/issue-31776.rs b/src/test/run-pass/issues/issue-31776.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-31776.rs rename to src/test/run-pass/issues/issue-31776.rs index db866b86a2a9..7386303bef5d 100644 --- a/src/test/ui/run-pass/issues/issue-31776.rs +++ b/src/test/run-pass/issues/issue-31776.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Various scenarios in which `pub` is required in blocks struct S; diff --git a/src/test/ui/run-pass/issues/issue-32008.rs b/src/test/run-pass/issues/issue-32008.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-32008.rs rename to src/test/run-pass/issues/issue-32008.rs index 7fccf09bdaaf..a04b7af813be 100644 --- a/src/test/ui/run-pass/issues/issue-32008.rs +++ b/src/test/run-pass/issues/issue-32008.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Tests that binary operators allow subtyping on both the LHS and RHS, // and as such do not introduce unnecessarily strict lifetime constraints. diff --git a/src/test/ui/run-pass/issues/issue-3211.rs b/src/test/run-pass/issues/issue-3211.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3211.rs rename to src/test/run-pass/issues/issue-3211.rs diff --git a/src/test/ui/run-pass/issues/issue-3220.rs b/src/test/run-pass/issues/issue-3220.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3220.rs rename to src/test/run-pass/issues/issue-3220.rs index 2d32a08e37ba..3183df6a4f55 100644 --- a/src/test/ui/run-pass/issues/issue-3220.rs +++ b/src/test/run-pass/issues/issue-3220.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-32292.rs b/src/test/run-pass/issues/issue-32292.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32292.rs rename to src/test/run-pass/issues/issue-32292.rs diff --git a/src/test/ui/run-pass/issues/issue-32324.rs b/src/test/run-pass/issues/issue-32324.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32324.rs rename to src/test/run-pass/issues/issue-32324.rs diff --git a/src/test/ui/run-pass/issues/issue-32389.rs b/src/test/run-pass/issues/issue-32389.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32389.rs rename to src/test/run-pass/issues/issue-32389.rs diff --git a/src/test/ui/run-pass/issues/issue-32518.rs b/src/test/run-pass/issues/issue-32518.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32518.rs rename to src/test/run-pass/issues/issue-32518.rs diff --git a/src/test/ui/run-pass/issues/issue-32805.rs b/src/test/run-pass/issues/issue-32805.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32805.rs rename to src/test/run-pass/issues/issue-32805.rs diff --git a/src/test/ui/run-pass/issues/issue-3290.rs b/src/test/run-pass/issues/issue-3290.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3290.rs rename to src/test/run-pass/issues/issue-3290.rs diff --git a/src/test/ui/run-pass/issues/issue-32947.rs b/src/test/run-pass/issues/issue-32947.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-32947.rs rename to src/test/run-pass/issues/issue-32947.rs diff --git a/src/test/ui/run-pass/issues/issue-33096.rs b/src/test/run-pass/issues/issue-33096.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33096.rs rename to src/test/run-pass/issues/issue-33096.rs diff --git a/src/test/ui/run-pass/issues/issue-33185.rs b/src/test/run-pass/issues/issue-33185.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33185.rs rename to src/test/run-pass/issues/issue-33185.rs diff --git a/src/test/ui/run-pass/issues/issue-33187.rs b/src/test/run-pass/issues/issue-33187.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33187.rs rename to src/test/run-pass/issues/issue-33187.rs diff --git a/src/test/ui/run-pass/issues/issue-33202.rs b/src/test/run-pass/issues/issue-33202.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33202.rs rename to src/test/run-pass/issues/issue-33202.rs diff --git a/src/test/ui/run-pass/issues/issue-33264.rs b/src/test/run-pass/issues/issue-33264.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33264.rs rename to src/test/run-pass/issues/issue-33264.rs diff --git a/src/test/ui/run-pass/issues/issue-33287.rs b/src/test/run-pass/issues/issue-33287.rs similarity index 91% rename from src/test/ui/run-pass/issues/issue-33287.rs rename to src/test/run-pass/issues/issue-33287.rs index e99c53caa87d..31f44ffa34db 100644 --- a/src/test/ui/run-pass/issues/issue-33287.rs +++ b/src/test/run-pass/issues/issue-33287.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] const A: [u32; 1] = [0]; fn test() { diff --git a/src/test/ui/run-pass/issues/issue-333.rs b/src/test/run-pass/issues/issue-333.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-333.rs rename to src/test/run-pass/issues/issue-333.rs diff --git a/src/test/ui/run-pass/issues/issue-33387.rs b/src/test/run-pass/issues/issue-33387.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33387.rs rename to src/test/run-pass/issues/issue-33387.rs diff --git a/src/test/ui/run-pass/issues/issue-33461.rs b/src/test/run-pass/issues/issue-33461.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-33461.rs rename to src/test/run-pass/issues/issue-33461.rs index 17938a38474d..8f1665ba2081 100644 --- a/src/test/ui/run-pass/issues/issue-33461.rs +++ b/src/test/run-pass/issues/issue-33461.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::marker::PhantomData; struct TheType { diff --git a/src/test/ui/run-pass/issues/issue-33498.rs b/src/test/run-pass/issues/issue-33498.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-33498.rs rename to src/test/run-pass/issues/issue-33498.rs index e7e890830329..519db8a05af2 100644 --- a/src/test/ui/run-pass/issues/issue-33498.rs +++ b/src/test/run-pass/issues/issue-33498.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] pub fn main() { let x = (0, 2); diff --git a/src/test/ui/run-pass/issues/issue-33537.rs b/src/test/run-pass/issues/issue-33537.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33537.rs rename to src/test/run-pass/issues/issue-33537.rs diff --git a/src/test/ui/run-pass/issues/issue-33687.rs b/src/test/run-pass/issues/issue-33687.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33687.rs rename to src/test/run-pass/issues/issue-33687.rs diff --git a/src/test/ui/run-pass/issues/issue-33770.rs b/src/test/run-pass/issues/issue-33770.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33770.rs rename to src/test/run-pass/issues/issue-33770.rs diff --git a/src/test/ui/run-pass/issues/issue-3389.rs b/src/test/run-pass/issues/issue-3389.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3389.rs rename to src/test/run-pass/issues/issue-3389.rs index 7102bb469e4e..500de0f6c263 100644 --- a/src/test/ui/run-pass/issues/issue-3389.rs +++ b/src/test/run-pass/issues/issue-3389.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] struct trie_node { diff --git a/src/test/ui/run-pass/issues/issue-33903.rs b/src/test/run-pass/issues/issue-33903.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-33903.rs rename to src/test/run-pass/issues/issue-33903.rs index df2f5e3e7a0c..e521b594aa23 100644 --- a/src/test/ui/run-pass/issues/issue-33903.rs +++ b/src/test/run-pass/issues/issue-33903.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue 33903: // Built-in indexing should be used even when the index is not // trivially an integer diff --git a/src/test/ui/run-pass/issues/issue-33992.rs b/src/test/run-pass/issues/issue-33992.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-33992.rs rename to src/test/run-pass/issues/issue-33992.rs diff --git a/src/test/ui/run-pass/issues/issue-34053.rs b/src/test/run-pass/issues/issue-34053.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34053.rs rename to src/test/run-pass/issues/issue-34053.rs diff --git a/src/test/ui/run-pass/issues/issue-34074.rs b/src/test/run-pass/issues/issue-34074.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34074.rs rename to src/test/run-pass/issues/issue-34074.rs diff --git a/src/test/ui/run-pass/issues/issue-34194.rs b/src/test/run-pass/issues/issue-34194.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34194.rs rename to src/test/run-pass/issues/issue-34194.rs diff --git a/src/test/ui/run-pass/issues/issue-3424.rs b/src/test/run-pass/issues/issue-3424.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3424.rs rename to src/test/run-pass/issues/issue-3424.rs index 1e914eaee581..cf1b00226617 100644 --- a/src/test/ui/run-pass/issues/issue-3424.rs +++ b/src/test/run-pass/issues/issue-3424.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // rustc --test ignores2.rs && ./ignores2 diff --git a/src/test/ui/run-pass/issues/issue-3429.rs b/src/test/run-pass/issues/issue-3429.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3429.rs rename to src/test/run-pass/issues/issue-3429.rs diff --git a/src/test/ui/run-pass/issues/issue-34427.rs b/src/test/run-pass/issues/issue-34427.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34427.rs rename to src/test/run-pass/issues/issue-34427.rs diff --git a/src/test/ui/run-pass/issues/issue-3447.rs b/src/test/run-pass/issues/issue-3447.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3447.rs rename to src/test/run-pass/issues/issue-3447.rs index ff4642e47ebe..374dda090330 100644 --- a/src/test/ui/run-pass/issues/issue-3447.rs +++ b/src/test/run-pass/issues/issue-3447.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/issues/issue-34503.rs b/src/test/run-pass/issues/issue-34503.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34503.rs rename to src/test/run-pass/issues/issue-34503.rs diff --git a/src/test/ui/run-pass/issues/issue-34569.rs b/src/test/run-pass/issues/issue-34569.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34569.rs rename to src/test/run-pass/issues/issue-34569.rs diff --git a/src/test/ui/run-pass/issues/issue-34571.rs b/src/test/run-pass/issues/issue-34571.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34571.rs rename to src/test/run-pass/issues/issue-34571.rs diff --git a/src/test/ui/run-pass/issues/issue-34751.rs b/src/test/run-pass/issues/issue-34751.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-34751.rs rename to src/test/run-pass/issues/issue-34751.rs index 382212a19082..d4758b80e979 100644 --- a/src/test/ui/run-pass/issues/issue-34751.rs +++ b/src/test/run-pass/issues/issue-34751.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // #34751 ICE: 'rustc' panicked at 'assertion failed: !substs.has_regions_escaping_depth(0)' #[allow(dead_code)] diff --git a/src/test/ui/run-pass/issues/issue-34780.rs b/src/test/run-pass/issues/issue-34780.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34780.rs rename to src/test/run-pass/issues/issue-34780.rs diff --git a/src/test/ui/run-pass/issues/issue-34784.rs b/src/test/run-pass/issues/issue-34784.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-34784.rs rename to src/test/run-pass/issues/issue-34784.rs index 0a6a25c41d5e..fe257d57e980 100644 --- a/src/test/ui/run-pass/issues/issue-34784.rs +++ b/src/test/run-pass/issues/issue-34784.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] const C: *const u8 = &0; fn foo(x: *const u8) { diff --git a/src/test/ui/run-pass/issues/issue-34796.rs b/src/test/run-pass/issues/issue-34796.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-34796.rs rename to src/test/run-pass/issues/issue-34796.rs index ea9172ae4837..8de255086873 100644 --- a/src/test/ui/run-pass/issues/issue-34796.rs +++ b/src/test/run-pass/issues/issue-34796.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // This test case exposes conditions where the encoding of a trait object type // with projection predicates would differ between this crate and the upstream // crate, because the predicates were encoded in different order within each diff --git a/src/test/ui/run-pass/issues/issue-34798.rs b/src/test/run-pass/issues/issue-34798.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34798.rs rename to src/test/run-pass/issues/issue-34798.rs diff --git a/src/test/ui/run-pass/issues/issue-34932.rs b/src/test/run-pass/issues/issue-34932.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-34932.rs rename to src/test/run-pass/issues/issue-34932.rs diff --git a/src/test/ui/run-pass/issues/issue-3500.rs b/src/test/run-pass/issues/issue-3500.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3500.rs rename to src/test/run-pass/issues/issue-3500.rs diff --git a/src/test/ui/run-pass/issues/issue-35376.rs b/src/test/run-pass/issues/issue-35376.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-35376.rs rename to src/test/run-pass/issues/issue-35376.rs diff --git a/src/test/ui/run-pass/issues/issue-35423.rs b/src/test/run-pass/issues/issue-35423.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-35423.rs rename to src/test/run-pass/issues/issue-35423.rs diff --git a/src/test/ui/run-pass/issues/issue-35546.rs b/src/test/run-pass/issues/issue-35546.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-35546.rs rename to src/test/run-pass/issues/issue-35546.rs index 9c39941232f3..13d099081b05 100644 --- a/src/test/ui/run-pass/issues/issue-35546.rs +++ b/src/test/run-pass/issues/issue-35546.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #35546. Check that we are able to codegen // this. Before we had problems because of the drop glue signature // around dropping a trait object (specifically, when dropping the diff --git a/src/test/ui/run-pass/issues/issue-3556.rs b/src/test/run-pass/issues/issue-3556.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3556.rs rename to src/test/run-pass/issues/issue-3556.rs index b71d94adfeba..8b2cc17796fa 100644 --- a/src/test/ui/run-pass/issues/issue-3556.rs +++ b/src/test/run-pass/issues/issue-3556.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug)] enum Token { diff --git a/src/test/ui/run-pass/issues/issue-3559.rs b/src/test/run-pass/issues/issue-3559.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3559.rs rename to src/test/run-pass/issues/issue-3559.rs diff --git a/src/test/ui/run-pass/issues/issue-35600.rs b/src/test/run-pass/issues/issue-35600.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-35600.rs rename to src/test/run-pass/issues/issue-35600.rs index 1083aa808cb2..c9d9f9598f2e 100644 --- a/src/test/ui/run-pass/issues/issue-35600.rs +++ b/src/test/run-pass/issues/issue-35600.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] trait Foo { type bar; fn bar(); diff --git a/src/test/ui/run-pass/issues/issue-3563-2.rs b/src/test/run-pass/issues/issue-3563-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3563-2.rs rename to src/test/run-pass/issues/issue-3563-2.rs diff --git a/src/test/ui/run-pass/issues/issue-3563-3.rs b/src/test/run-pass/issues/issue-3563-3.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-3563-3.rs rename to src/test/run-pass/issues/issue-3563-3.rs index cd31abaca356..13d74be89d8e 100644 --- a/src/test/ui/run-pass/issues/issue-3563-3.rs +++ b/src/test/run-pass/issues/issue-3563-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(non_snake_case)] // ASCII art shape renderer. Demonstrates traits, impls, operator overloading, diff --git a/src/test/ui/run-pass/issues/issue-3574.rs b/src/test/run-pass/issues/issue-3574.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3574.rs rename to src/test/run-pass/issues/issue-3574.rs diff --git a/src/test/ui/run-pass/issues/issue-35815.rs b/src/test/run-pass/issues/issue-35815.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-35815.rs rename to src/test/run-pass/issues/issue-35815.rs index 62bd6aa37fd2..32b73de11189 100644 --- a/src/test/ui/run-pass/issues/issue-35815.rs +++ b/src/test/run-pass/issues/issue-35815.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem; struct Foo { diff --git a/src/test/ui/run-pass/issues/issue-36023.rs b/src/test/run-pass/issues/issue-36023.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-36023.rs rename to src/test/run-pass/issues/issue-36023.rs index a654a813edf0..54a36c6f1b33 100644 --- a/src/test/ui/run-pass/issues/issue-36023.rs +++ b/src/test/run-pass/issues/issue-36023.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::ops::Deref; fn main() { diff --git a/src/test/ui/run-pass/issues/issue-36036-associated-type-layout.rs b/src/test/run-pass/issues/issue-36036-associated-type-layout.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36036-associated-type-layout.rs rename to src/test/run-pass/issues/issue-36036-associated-type-layout.rs diff --git a/src/test/ui/run-pass/issues/issue-36053.rs b/src/test/run-pass/issues/issue-36053.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36053.rs rename to src/test/run-pass/issues/issue-36053.rs diff --git a/src/test/ui/run-pass/issues/issue-36075.rs b/src/test/run-pass/issues/issue-36075.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-36075.rs rename to src/test/run-pass/issues/issue-36075.rs index e11d35669f5f..4042bd197949 100644 --- a/src/test/ui/run-pass/issues/issue-36075.rs +++ b/src/test/run-pass/issues/issue-36075.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait DeclarationParser { type Declaration; } diff --git a/src/test/ui/run-pass/issues/issue-3609.rs b/src/test/run-pass/issues/issue-3609.rs similarity index 94% rename from src/test/ui/run-pass/issues/issue-3609.rs rename to src/test/run-pass/issues/issue-3609.rs index 384964188db6..abbaf630e78e 100644 --- a/src/test/ui/run-pass/issues/issue-3609.rs +++ b/src/test/run-pass/issues/issue-3609.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_mut)] use std::thread; use std::sync::mpsc::Sender; diff --git a/src/test/ui/run-pass/issues/issue-36139-normalize-closure-sig.rs b/src/test/run-pass/issues/issue-36139-normalize-closure-sig.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36139-normalize-closure-sig.rs rename to src/test/run-pass/issues/issue-36139-normalize-closure-sig.rs diff --git a/src/test/ui/run-pass/issues/issue-36260.rs b/src/test/run-pass/issues/issue-36260.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36260.rs rename to src/test/run-pass/issues/issue-36260.rs diff --git a/src/test/ui/run-pass/issues/issue-36278-prefix-nesting.rs b/src/test/run-pass/issues/issue-36278-prefix-nesting.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36278-prefix-nesting.rs rename to src/test/run-pass/issues/issue-36278-prefix-nesting.rs diff --git a/src/test/ui/run-pass/issues/issue-36381.rs b/src/test/run-pass/issues/issue-36381.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36381.rs rename to src/test/run-pass/issues/issue-36381.rs diff --git a/src/test/ui/run-pass/issues/issue-36401.rs b/src/test/run-pass/issues/issue-36401.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36401.rs rename to src/test/run-pass/issues/issue-36401.rs diff --git a/src/test/ui/run-pass/issues/issue-36474.rs b/src/test/run-pass/issues/issue-36474.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36474.rs rename to src/test/run-pass/issues/issue-36474.rs diff --git a/src/test/ui/run-pass/issues/issue-3656.rs b/src/test/run-pass/issues/issue-3656.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3656.rs rename to src/test/run-pass/issues/issue-3656.rs index 1e626e2e9c1f..63b27406198c 100644 --- a/src/test/ui/run-pass/issues/issue-3656.rs +++ b/src/test/run-pass/issues/issue-3656.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(improper_ctypes)] // Issue #3656 diff --git a/src/test/ui/run-pass/issues/issue-36744-bitcast-args-if-needed.rs b/src/test/run-pass/issues/issue-36744-bitcast-args-if-needed.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36744-bitcast-args-if-needed.rs rename to src/test/run-pass/issues/issue-36744-bitcast-args-if-needed.rs diff --git a/src/test/ui/run-pass/issues/issue-36744-without-calls.rs b/src/test/run-pass/issues/issue-36744-without-calls.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36744-without-calls.rs rename to src/test/run-pass/issues/issue-36744-without-calls.rs diff --git a/src/test/ui/run-pass/issues/issue-36768.rs b/src/test/run-pass/issues/issue-36768.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36768.rs rename to src/test/run-pass/issues/issue-36768.rs diff --git a/src/test/ui/run-pass/issues/issue-36786-resolve-call.rs b/src/test/run-pass/issues/issue-36786-resolve-call.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36786-resolve-call.rs rename to src/test/run-pass/issues/issue-36786-resolve-call.rs diff --git a/src/test/ui/run-pass/issues/issue-36792.rs b/src/test/run-pass/issues/issue-36792.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36792.rs rename to src/test/run-pass/issues/issue-36792.rs diff --git a/src/test/ui/run-pass/issues/issue-36816.rs b/src/test/run-pass/issues/issue-36816.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36816.rs rename to src/test/run-pass/issues/issue-36816.rs diff --git a/src/test/ui/run-pass/issues/issue-3683.rs b/src/test/run-pass/issues/issue-3683.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3683.rs rename to src/test/run-pass/issues/issue-3683.rs diff --git a/src/test/ui/run-pass/issues/issue-36856.rs b/src/test/run-pass/issues/issue-36856.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36856.rs rename to src/test/run-pass/issues/issue-36856.rs diff --git a/src/test/ui/run-pass/issues/issue-36936.rs b/src/test/run-pass/issues/issue-36936.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36936.rs rename to src/test/run-pass/issues/issue-36936.rs diff --git a/src/test/ui/run-pass/issues/issue-36954.rs b/src/test/run-pass/issues/issue-36954.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-36954.rs rename to src/test/run-pass/issues/issue-36954.rs diff --git a/src/test/ui/run-pass/issues/issue-3702.rs b/src/test/run-pass/issues/issue-3702.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-3702.rs rename to src/test/run-pass/issues/issue-3702.rs index 5ca851f8b779..dfe63913d56f 100644 --- a/src/test/ui/run-pass/issues/issue-3702.rs +++ b/src/test/run-pass/issues/issue-3702.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub fn main() { trait Text { diff --git a/src/test/ui/run-pass/issues/issue-37109.rs b/src/test/run-pass/issues/issue-37109.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37109.rs rename to src/test/run-pass/issues/issue-37109.rs diff --git a/src/test/ui/run-pass/issues/issue-37175.rs b/src/test/run-pass/issues/issue-37175.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37175.rs rename to src/test/run-pass/issues/issue-37175.rs diff --git a/src/test/ui/run-pass/issues/issue-37222.rs b/src/test/run-pass/issues/issue-37222.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-37222.rs rename to src/test/run-pass/issues/issue-37222.rs index af19a922faec..114177702c53 100644 --- a/src/test/ui/run-pass/issues/issue-37222.rs +++ b/src/test/run-pass/issues/issue-37222.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[derive(Debug, PartialEq)] enum Bar { A(i64), diff --git a/src/test/ui/run-pass/issues/issue-37291/auxiliary/lib.rs b/src/test/run-pass/issues/issue-37291/auxiliary/lib.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37291/auxiliary/lib.rs rename to src/test/run-pass/issues/issue-37291/auxiliary/lib.rs diff --git a/src/test/ui/run-pass/issues/issue-37291/main.rs b/src/test/run-pass/issues/issue-37291/main.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-37291/main.rs rename to src/test/run-pass/issues/issue-37291/main.rs index c30e87ad785a..b9b827d34577 100644 --- a/src/test/ui/run-pass/issues/issue-37291/main.rs +++ b/src/test/run-pass/issues/issue-37291/main.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:lib.rs // Regression test for #37291. The problem was that the starting diff --git a/src/test/ui/run-pass/issues/issue-3743.rs b/src/test/run-pass/issues/issue-3743.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3743.rs rename to src/test/run-pass/issues/issue-3743.rs diff --git a/src/test/ui/run-pass/issues/issue-3753.rs b/src/test/run-pass/issues/issue-3753.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3753.rs rename to src/test/run-pass/issues/issue-3753.rs diff --git a/src/test/ui/run-pass/issues/issue-37598.rs b/src/test/run-pass/issues/issue-37598.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-37598.rs rename to src/test/run-pass/issues/issue-37598.rs index b5a11f5a0fd6..3001591c406e 100644 --- a/src/test/ui/run-pass/issues/issue-37598.rs +++ b/src/test/run-pass/issues/issue-37598.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(slice_patterns)] fn check(list: &[u8]) { diff --git a/src/test/ui/run-pass/issues/issue-37655.rs b/src/test/run-pass/issues/issue-37655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37655.rs rename to src/test/run-pass/issues/issue-37655.rs diff --git a/src/test/ui/run-pass/issues/issue-37686.rs b/src/test/run-pass/issues/issue-37686.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37686.rs rename to src/test/run-pass/issues/issue-37686.rs diff --git a/src/test/ui/run-pass/issues/issue-37725.rs b/src/test/run-pass/issues/issue-37725.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-37725.rs rename to src/test/run-pass/issues/issue-37725.rs index ce952a7e5203..8b29dad918d3 100644 --- a/src/test/ui/run-pass/issues/issue-37725.rs +++ b/src/test/run-pass/issues/issue-37725.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn foo(&self); } diff --git a/src/test/ui/run-pass/issues/issue-37733.rs b/src/test/run-pass/issues/issue-37733.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-37733.rs rename to src/test/run-pass/issues/issue-37733.rs index 0b1b08d4e7b9..a982cae26212 100644 --- a/src/test/ui/run-pass/issues/issue-37733.rs +++ b/src/test/run-pass/issues/issue-37733.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] type A = for<> fn(); type B = for<'a,> fn(); diff --git a/src/test/ui/run-pass/issues/issue-3794.rs b/src/test/run-pass/issues/issue-3794.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3794.rs rename to src/test/run-pass/issues/issue-3794.rs diff --git a/src/test/ui/run-pass/issues/issue-37991.rs b/src/test/run-pass/issues/issue-37991.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-37991.rs rename to src/test/run-pass/issues/issue-37991.rs diff --git a/src/test/ui/run-pass/issues/issue-38002.rs b/src/test/run-pass/issues/issue-38002.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-38002.rs rename to src/test/run-pass/issues/issue-38002.rs index 70892ba7d624..044d84c06d45 100644 --- a/src/test/ui/run-pass/issues/issue-38002.rs +++ b/src/test/run-pass/issues/issue-38002.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Check that constant ADTs are codegened OK, part k of N. enum Bar { diff --git a/src/test/ui/run-pass/issues/issue-38033.rs b/src/test/run-pass/issues/issue-38033.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38033.rs rename to src/test/run-pass/issues/issue-38033.rs diff --git a/src/test/ui/run-pass/issues/issue-38074.rs b/src/test/run-pass/issues/issue-38074.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38074.rs rename to src/test/run-pass/issues/issue-38074.rs diff --git a/src/test/ui/run-pass/issues/issue-38091.rs b/src/test/run-pass/issues/issue-38091.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38091.rs rename to src/test/run-pass/issues/issue-38091.rs diff --git a/src/test/ui/run-pass/issues/issue-38190.rs b/src/test/run-pass/issues/issue-38190.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38190.rs rename to src/test/run-pass/issues/issue-38190.rs diff --git a/src/test/ui/run-pass/issues/issue-38226.rs b/src/test/run-pass/issues/issue-38226.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38226.rs rename to src/test/run-pass/issues/issue-38226.rs diff --git a/src/test/ui/run-pass/issues/issue-38437.rs b/src/test/run-pass/issues/issue-38437.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-38437.rs rename to src/test/run-pass/issues/issue-38437.rs index cea55270aa0f..2fec9542e0e6 100644 --- a/src/test/ui/run-pass/issues/issue-38437.rs +++ b/src/test/run-pass/issues/issue-38437.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Check that drop elaboration clears the "master" discriminant // drop flag even if it protects no fields. diff --git a/src/test/ui/run-pass/issues/issue-3847.rs b/src/test/run-pass/issues/issue-3847.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3847.rs rename to src/test/run-pass/issues/issue-3847.rs diff --git a/src/test/ui/run-pass/issues/issue-38556.rs b/src/test/run-pass/issues/issue-38556.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-38556.rs rename to src/test/run-pass/issues/issue-38556.rs index b1a30f910dff..4f1dc22af3cd 100644 --- a/src/test/ui/run-pass/issues/issue-38556.rs +++ b/src/test/run-pass/issues/issue-38556.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub struct Foo; macro_rules! reexport { diff --git a/src/test/ui/run-pass/issues/issue-38715.rs b/src/test/run-pass/issues/issue-38715.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38715.rs rename to src/test/run-pass/issues/issue-38715.rs diff --git a/src/test/ui/run-pass/issues/issue-38727.rs b/src/test/run-pass/issues/issue-38727.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-38727.rs rename to src/test/run-pass/issues/issue-38727.rs index 81e63476524c..ccf0e1c2bdbd 100644 --- a/src/test/ui/run-pass/issues/issue-38727.rs +++ b/src/test/run-pass/issues/issue-38727.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #[repr(u64)] enum A { A = 0u64, diff --git a/src/test/ui/run-pass/issues/issue-3874.rs b/src/test/run-pass/issues/issue-3874.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3874.rs rename to src/test/run-pass/issues/issue-3874.rs index 53a57c9943b3..2b1e25d2a1a7 100644 --- a/src/test/ui/run-pass/issues/issue-3874.rs +++ b/src/test/run-pass/issues/issue-3874.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum PureCounter { PureCounterVariant(usize) } diff --git a/src/test/ui/run-pass/issues/issue-38763.rs b/src/test/run-pass/issues/issue-38763.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38763.rs rename to src/test/run-pass/issues/issue-38763.rs diff --git a/src/test/ui/run-pass/issues/issue-3878.rs b/src/test/run-pass/issues/issue-3878.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3878.rs rename to src/test/run-pass/issues/issue-3878.rs diff --git a/src/test/ui/run-pass/issues/issue-3888-2.rs b/src/test/run-pass/issues/issue-3888-2.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-3888-2.rs rename to src/test/run-pass/issues/issue-3888-2.rs index 707145392c7d..2d702dac0285 100644 --- a/src/test/ui/run-pass/issues/issue-3888-2.rs +++ b/src/test/run-pass/issues/issue-3888-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] { diff --git a/src/test/ui/run-pass/issues/issue-38942.rs b/src/test/run-pass/issues/issue-38942.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38942.rs rename to src/test/run-pass/issues/issue-38942.rs diff --git a/src/test/ui/run-pass/issues/issue-3895.rs b/src/test/run-pass/issues/issue-3895.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-3895.rs rename to src/test/run-pass/issues/issue-3895.rs index 3620cb874f56..692075491262 100644 --- a/src/test/ui/run-pass/issues/issue-3895.rs +++ b/src/test/run-pass/issues/issue-3895.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub fn main() { enum State { BadChar, BadSyntax } diff --git a/src/test/ui/run-pass/issues/issue-38987.rs b/src/test/run-pass/issues/issue-38987.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-38987.rs rename to src/test/run-pass/issues/issue-38987.rs diff --git a/src/test/ui/run-pass/issues/issue-3904.rs b/src/test/run-pass/issues/issue-3904.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3904.rs rename to src/test/run-pass/issues/issue-3904.rs diff --git a/src/test/ui/run-pass/issues/issue-39089.rs b/src/test/run-pass/issues/issue-39089.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-39089.rs rename to src/test/run-pass/issues/issue-39089.rs index e4ace4299bd2..6908563a81ce 100644 --- a/src/test/ui/run-pass/issues/issue-39089.rs +++ b/src/test/run-pass/issues/issue-39089.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn f Sized>() {} fn main() {} diff --git a/src/test/ui/run-pass/issues/issue-39292.rs b/src/test/run-pass/issues/issue-39292.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39292.rs rename to src/test/run-pass/issues/issue-39292.rs diff --git a/src/test/ui/run-pass/issues/issue-3935.rs b/src/test/run-pass/issues/issue-3935.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3935.rs rename to src/test/run-pass/issues/issue-3935.rs diff --git a/src/test/ui/run-pass/issues/issue-39367.rs b/src/test/run-pass/issues/issue-39367.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39367.rs rename to src/test/run-pass/issues/issue-39367.rs diff --git a/src/test/ui/run-pass/issues/issue-39467.rs b/src/test/run-pass/issues/issue-39467.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-39467.rs rename to src/test/run-pass/issues/issue-39467.rs index 3fab06d9a683..d54cf3f27c51 100644 --- a/src/test/ui/run-pass/issues/issue-39467.rs +++ b/src/test/run-pass/issues/issue-39467.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] macro_rules! expr { () => { () } } enum A {} diff --git a/src/test/ui/run-pass/issues/issue-39548.rs b/src/test/run-pass/issues/issue-39548.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39548.rs rename to src/test/run-pass/issues/issue-39548.rs diff --git a/src/test/ui/run-pass/issues/issue-39709.rs b/src/test/run-pass/issues/issue-39709.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-39709.rs rename to src/test/run-pass/issues/issue-39709.rs index 44caa644edf4..25d8a707fe47 100644 --- a/src/test/ui/run-pass/issues/issue-39709.rs +++ b/src/test/run-pass/issues/issue-39709.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] fn main() { println!("{}", { macro_rules! x { ($(t:tt)*) => {} } 33 }); } diff --git a/src/test/ui/run-pass/issues/issue-39720.rs b/src/test/run-pass/issues/issue-39720.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39720.rs rename to src/test/run-pass/issues/issue-39720.rs diff --git a/src/test/ui/run-pass/issues/issue-39720.stderr b/src/test/run-pass/issues/issue-39720.stderr similarity index 100% rename from src/test/ui/run-pass/issues/issue-39720.stderr rename to src/test/run-pass/issues/issue-39720.stderr diff --git a/src/test/ui/run-pass/issues/issue-3979-2.rs b/src/test/run-pass/issues/issue-3979-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-3979-2.rs rename to src/test/run-pass/issues/issue-3979-2.rs diff --git a/src/test/ui/run-pass/issues/issue-3979-generics.rs b/src/test/run-pass/issues/issue-3979-generics.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-3979-generics.rs rename to src/test/run-pass/issues/issue-3979-generics.rs index 7766d7d1bdc8..8402aac138ef 100644 --- a/src/test/ui/run-pass/issues/issue-3979-generics.rs +++ b/src/test/run-pass/issues/issue-3979-generics.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] use std::ops::Add; diff --git a/src/test/ui/run-pass/issues/issue-3979-xcrate.rs b/src/test/run-pass/issues/issue-3979-xcrate.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3979-xcrate.rs rename to src/test/run-pass/issues/issue-3979-xcrate.rs index d698e7ac775e..a087504c5819 100644 --- a/src/test/ui/run-pass/issues/issue-3979-xcrate.rs +++ b/src/test/run-pass/issues/issue-3979-xcrate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue_3979_traits.rs extern crate issue_3979_traits; diff --git a/src/test/ui/run-pass/issues/issue-3979.rs b/src/test/run-pass/issues/issue-3979.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-3979.rs rename to src/test/run-pass/issues/issue-3979.rs index 4cc2e882baaa..ce7d20b6ef1d 100644 --- a/src/test/ui/run-pass/issues/issue-3979.rs +++ b/src/test/run-pass/issues/issue-3979.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] trait Positioned { diff --git a/src/test/ui/run-pass/issues/issue-39808.rs b/src/test/run-pass/issues/issue-39808.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39808.rs rename to src/test/run-pass/issues/issue-39808.rs diff --git a/src/test/ui/run-pass/issues/issue-39823.rs b/src/test/run-pass/issues/issue-39823.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39823.rs rename to src/test/run-pass/issues/issue-39823.rs diff --git a/src/test/ui/run-pass/issues/issue-39827.rs b/src/test/run-pass/issues/issue-39827.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-39827.rs rename to src/test/run-pass/issues/issue-39827.rs diff --git a/src/test/ui/run-pass/issues/issue-3991.rs b/src/test/run-pass/issues/issue-3991.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-3991.rs rename to src/test/run-pass/issues/issue-3991.rs index d3efcaf636e8..9028066cfacd 100644 --- a/src/test/ui/run-pass/issues/issue-3991.rs +++ b/src/test/run-pass/issues/issue-3991.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-39984.rs b/src/test/run-pass/issues/issue-39984.rs similarity index 93% rename from src/test/ui/run-pass/issues/issue-39984.rs rename to src/test/run-pass/issues/issue-39984.rs index 450620da35ac..c90585cb734e 100644 --- a/src/test/ui/run-pass/issues/issue-39984.rs +++ b/src/test/run-pass/issues/issue-39984.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unreachable_code)] // Regression test for issue #39984. // // The key here is that the error type of the `Ok` call ought to be diff --git a/src/test/ui/run-pass/issues/issue-40003.rs b/src/test/run-pass/issues/issue-40003.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-40003.rs rename to src/test/run-pass/issues/issue-40003.rs index cf18ab47c39a..d2ed14d14139 100644 --- a/src/test/ui/run-pass/issues/issue-40003.rs +++ b/src/test/run-pass/issues/issue-40003.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] fn main() { if false { test(); } } diff --git a/src/test/ui/run-pass/issues/issue-40085.rs b/src/test/run-pass/issues/issue-40085.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-40085.rs rename to src/test/run-pass/issues/issue-40085.rs diff --git a/src/test/ui/run-pass/issues/issue-40136.rs b/src/test/run-pass/issues/issue-40136.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-40136.rs rename to src/test/run-pass/issues/issue-40136.rs index 5c1a527dbeb9..00d33fae13c1 100644 --- a/src/test/ui/run-pass/issues/issue-40136.rs +++ b/src/test/run-pass/issues/issue-40136.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] macro_rules! m { () => { 0 } } diff --git a/src/test/ui/run-pass/issues/issue-40235.rs b/src/test/run-pass/issues/issue-40235.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-40235.rs rename to src/test/run-pass/issues/issue-40235.rs index 3c26183f1467..b37372c682f8 100644 --- a/src/test/ui/run-pass/issues/issue-40235.rs +++ b/src/test/run-pass/issues/issue-40235.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] fn foo() {} fn main() { diff --git a/src/test/ui/run-pass/issues/issue-4025.rs b/src/test/run-pass/issues/issue-4025.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-4025.rs rename to src/test/run-pass/issues/issue-4025.rs index f216ba9b9c98..41af0826c00a 100644 --- a/src/test/ui/run-pass/issues/issue-4025.rs +++ b/src/test/run-pass/issues/issue-4025.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] /* # if b { x } else { y } requires identical types for x and y */ diff --git a/src/test/ui/run-pass/issues/issue-40408.rs b/src/test/run-pass/issues/issue-40408.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-40408.rs rename to src/test/run-pass/issues/issue-40408.rs diff --git a/src/test/ui/run-pass/issues/issue-40469.rs b/src/test/run-pass/issues/issue-40469.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-40469.rs rename to src/test/run-pass/issues/issue-40469.rs diff --git a/src/test/ui/run-pass/issues/issue-40770.rs b/src/test/run-pass/issues/issue-40770.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-40770.rs rename to src/test/run-pass/issues/issue-40770.rs index d27b13c3a10e..566f92519b83 100644 --- a/src/test/ui/run-pass/issues/issue-40770.rs +++ b/src/test/run-pass/issues/issue-40770.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] macro_rules! m { ($e:expr) => { macro_rules! n { () => { $e } } diff --git a/src/test/ui/run-pass/issues/issue-40847.rs b/src/test/run-pass/issues/issue-40847.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-40847.rs rename to src/test/run-pass/issues/issue-40847.rs diff --git a/src/test/ui/run-pass/issues/issue-40883.rs b/src/test/run-pass/issues/issue-40883.rs similarity index 99% rename from src/test/ui/run-pass/issues/issue-40883.rs rename to src/test/run-pass/issues/issue-40883.rs index 357152b60e5a..8de60a64ea49 100644 --- a/src/test/ui/run-pass/issues/issue-40883.rs +++ b/src/test/run-pass/issues/issue-40883.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // check that we don't have linear stack usage with multiple calls to `push` #![feature(test)] diff --git a/src/test/ui/run-pass/issues/issue-40951.rs b/src/test/run-pass/issues/issue-40951.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-40951.rs rename to src/test/run-pass/issues/issue-40951.rs index b6f74f4f1cd2..693234a17207 100644 --- a/src/test/ui/run-pass/issues/issue-40951.rs +++ b/src/test/run-pass/issues/issue-40951.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Regression test for #40951. const FOO: [&'static str; 1] = ["foo"]; diff --git a/src/test/ui/run-pass/issues/issue-40962.rs b/src/test/run-pass/issues/issue-40962.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-40962.rs rename to src/test/run-pass/issues/issue-40962.rs diff --git a/src/test/ui/run-pass/issues/issue-41053.rs b/src/test/run-pass/issues/issue-41053.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41053.rs rename to src/test/run-pass/issues/issue-41053.rs diff --git a/src/test/ui/run-pass/issues/issue-4107.rs b/src/test/run-pass/issues/issue-4107.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-4107.rs rename to src/test/run-pass/issues/issue-4107.rs index a05b1ddd9f46..dee393d07c79 100644 --- a/src/test/ui/run-pass/issues/issue-4107.rs +++ b/src/test/run-pass/issues/issue-4107.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub fn main() { let _id: &Mat2 = &Matrix::identity(1.0); diff --git a/src/test/ui/run-pass/issues/issue-41213.rs b/src/test/run-pass/issues/issue-41213.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-41213.rs rename to src/test/run-pass/issues/issue-41213.rs index 0f1d8fe72493..66499b0a4696 100644 --- a/src/test/ui/run-pass/issues/issue-41213.rs +++ b/src/test/run-pass/issues/issue-41213.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum A { A1, A2, diff --git a/src/test/ui/run-pass/issues/issue-41272.rs b/src/test/run-pass/issues/issue-41272.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-41272.rs rename to src/test/run-pass/issues/issue-41272.rs index 3debd77d1236..827edd39d2f9 100644 --- a/src/test/ui/run-pass/issues/issue-41272.rs +++ b/src/test/run-pass/issues/issue-41272.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Foo; impl Foo { diff --git a/src/test/ui/run-pass/issues/issue-41298.rs b/src/test/run-pass/issues/issue-41298.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-41298.rs rename to src/test/run-pass/issues/issue-41298.rs index 62e1afb92304..189c419c5dbb 100644 --- a/src/test/ui/run-pass/issues/issue-41298.rs +++ b/src/test/run-pass/issues/issue-41298.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Function { t: T, f: F } impl Function R> { fn foo() { } } diff --git a/src/test/ui/run-pass/issues/issue-41394.rs b/src/test/run-pass/issues/issue-41394.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41394.rs rename to src/test/run-pass/issues/issue-41394.rs diff --git a/src/test/ui/run-pass/issues/issue-41479.rs b/src/test/run-pass/issues/issue-41479.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41479.rs rename to src/test/run-pass/issues/issue-41479.rs diff --git a/src/test/ui/run-pass/issues/issue-41498.rs b/src/test/run-pass/issues/issue-41498.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41498.rs rename to src/test/run-pass/issues/issue-41498.rs diff --git a/src/test/ui/run-pass/issues/issue-41604.rs b/src/test/run-pass/issues/issue-41604.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41604.rs rename to src/test/run-pass/issues/issue-41604.rs diff --git a/src/test/ui/run-pass/issues/issue-41628.rs b/src/test/run-pass/issues/issue-41628.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41628.rs rename to src/test/run-pass/issues/issue-41628.rs diff --git a/src/test/ui/run-pass/issues/issue-41677.rs b/src/test/run-pass/issues/issue-41677.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41677.rs rename to src/test/run-pass/issues/issue-41677.rs diff --git a/src/test/ui/run-pass/issues/issue-41696.rs b/src/test/run-pass/issues/issue-41696.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-41696.rs rename to src/test/run-pass/issues/issue-41696.rs index 780290dce7fa..3937f9c19307 100644 --- a/src/test/ui/run-pass/issues/issue-41696.rs +++ b/src/test/run-pass/issues/issue-41696.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // this used to cause exponential code-size blowup during LLVM passes. #![feature(test)] diff --git a/src/test/ui/run-pass/issues/issue-41744.rs b/src/test/run-pass/issues/issue-41744.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41744.rs rename to src/test/run-pass/issues/issue-41744.rs diff --git a/src/test/ui/run-pass/issues/issue-41803.rs b/src/test/run-pass/issues/issue-41803.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41803.rs rename to src/test/run-pass/issues/issue-41803.rs diff --git a/src/test/ui/run-pass/issues/issue-41849-variance-req.rs b/src/test/run-pass/issues/issue-41849-variance-req.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-41849-variance-req.rs rename to src/test/run-pass/issues/issue-41849-variance-req.rs index 2f8c108f590b..61706f6acabe 100644 --- a/src/test/ui/run-pass/issues/issue-41849-variance-req.rs +++ b/src/test/run-pass/issues/issue-41849-variance-req.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #41849. use std::ops::Mul; diff --git a/src/test/ui/run-pass/issues/issue-41888.rs b/src/test/run-pass/issues/issue-41888.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-41888.rs rename to src/test/run-pass/issues/issue-41888.rs diff --git a/src/test/ui/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs b/src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs rename to src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs index f47e69931d55..1a4b283a81be 100644 --- a/src/test/ui/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs +++ b/src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for #41936. The coerce-unsized trait check in // coherence was using subtyping, which triggered variance // computation, which failed because it required type info for fields diff --git a/src/test/ui/run-pass/issues/issue-42007.rs b/src/test/run-pass/issues/issue-42007.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-42007.rs rename to src/test/run-pass/issues/issue-42007.rs index b72343f05c60..1347cb62d0ee 100644 --- a/src/test/ui/run-pass/issues/issue-42007.rs +++ b/src/test/run-pass/issues/issue-42007.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue_42007_s.rs extern crate issue_42007_s; diff --git a/src/test/ui/run-pass/issues/issue-4208.rs b/src/test/run-pass/issues/issue-4208.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-4208.rs rename to src/test/run-pass/issues/issue-4208.rs index fa6f56bc817c..d47e95e9b078 100644 --- a/src/test/ui/run-pass/issues/issue-4208.rs +++ b/src/test/run-pass/issues/issue-4208.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue-4208-cc.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-42148.rs b/src/test/run-pass/issues/issue-42148.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42148.rs rename to src/test/run-pass/issues/issue-42148.rs diff --git a/src/test/ui/run-pass/issues/issue-42210.rs b/src/test/run-pass/issues/issue-42210.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42210.rs rename to src/test/run-pass/issues/issue-42210.rs diff --git a/src/test/ui/run-pass/issues/issue-4228.rs b/src/test/run-pass/issues/issue-4228.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4228.rs rename to src/test/run-pass/issues/issue-4228.rs diff --git a/src/test/ui/run-pass/issues/issue-42453.rs b/src/test/run-pass/issues/issue-42453.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-42453.rs rename to src/test/run-pass/issues/issue-42453.rs index 649f52ef82e2..6a4780ece6d4 100644 --- a/src/test/ui/run-pass/issues/issue-42453.rs +++ b/src/test/run-pass/issues/issue-42453.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #[derive(Debug)] diff --git a/src/test/ui/run-pass/issues/issue-42463.rs b/src/test/run-pass/issues/issue-42463.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42463.rs rename to src/test/run-pass/issues/issue-42463.rs diff --git a/src/test/ui/run-pass/issues/issue-42467.rs b/src/test/run-pass/issues/issue-42467.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-42467.rs rename to src/test/run-pass/issues/issue-42467.rs index 0f89d5057519..82bab74a49b6 100644 --- a/src/test/ui/run-pass/issues/issue-42467.rs +++ b/src/test/run-pass/issues/issue-42467.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct Foo(T); struct IntoIter(T); diff --git a/src/test/ui/run-pass/issues/issue-4252.rs b/src/test/run-pass/issues/issue-4252.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4252.rs rename to src/test/run-pass/issues/issue-4252.rs diff --git a/src/test/ui/run-pass/issues/issue-42552.rs b/src/test/run-pass/issues/issue-42552.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42552.rs rename to src/test/run-pass/issues/issue-42552.rs diff --git a/src/test/ui/run-pass/issues/issue-42679.rs b/src/test/run-pass/issues/issue-42679.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42679.rs rename to src/test/run-pass/issues/issue-42679.rs diff --git a/src/test/ui/run-pass/issues/issue-42747.rs b/src/test/run-pass/issues/issue-42747.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-42747.rs rename to src/test/run-pass/issues/issue-42747.rs diff --git a/src/test/ui/run-pass/issues/issue-42956.rs b/src/test/run-pass/issues/issue-42956.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-42956.rs rename to src/test/run-pass/issues/issue-42956.rs index cee9d8be98dd..2210facf294a 100644 --- a/src/test/ui/run-pass/issues/issue-42956.rs +++ b/src/test/run-pass/issues/issue-42956.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(stable_features)] #![feature(associated_consts)] diff --git a/src/test/ui/run-pass/issues/issue-43057.rs b/src/test/run-pass/issues/issue-43057.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43057.rs rename to src/test/run-pass/issues/issue-43057.rs diff --git a/src/test/ui/run-pass/issues/issue-43132.rs b/src/test/run-pass/issues/issue-43132.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43132.rs rename to src/test/run-pass/issues/issue-43132.rs diff --git a/src/test/ui/run-pass/issues/issue-43205.rs b/src/test/run-pass/issues/issue-43205.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43205.rs rename to src/test/run-pass/issues/issue-43205.rs diff --git a/src/test/ui/run-pass/issues/issue-43291.rs b/src/test/run-pass/issues/issue-43291.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43291.rs rename to src/test/run-pass/issues/issue-43291.rs diff --git a/src/test/ui/run-pass/issues/issue-4333.rs b/src/test/run-pass/issues/issue-4333.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-4333.rs rename to src/test/run-pass/issues/issue-4333.rs index 193a438fc9c8..0886cf0aa68f 100644 --- a/src/test/ui/run-pass/issues/issue-4333.rs +++ b/src/test/run-pass/issues/issue-4333.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // pretty-expanded FIXME #23616 use std::io; diff --git a/src/test/ui/run-pass/issues/issue-43357.rs b/src/test/run-pass/issues/issue-43357.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-43357.rs rename to src/test/run-pass/issues/issue-43357.rs index 75d05c064289..558b0712bb1f 100644 --- a/src/test/ui/run-pass/issues/issue-43357.rs +++ b/src/test/run-pass/issues/issue-43357.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Trait { type Output; } diff --git a/src/test/ui/run-pass/issues/issue-43483.rs b/src/test/run-pass/issues/issue-43483.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-43483.rs rename to src/test/run-pass/issues/issue-43483.rs index 52ee080125fa..841bc629ce5b 100644 --- a/src/test/ui/run-pass/issues/issue-43483.rs +++ b/src/test/run-pass/issues/issue-43483.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] trait VecN { const DIM: usize; } diff --git a/src/test/ui/run-pass/issues/issue-43692.rs b/src/test/run-pass/issues/issue-43692.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43692.rs rename to src/test/run-pass/issues/issue-43692.rs diff --git a/src/test/ui/run-pass/issues/issue-43853.rs b/src/test/run-pass/issues/issue-43853.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43853.rs rename to src/test/run-pass/issues/issue-43853.rs diff --git a/src/test/ui/run-pass/issues/issue-4387.rs b/src/test/run-pass/issues/issue-4387.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4387.rs rename to src/test/run-pass/issues/issue-4387.rs diff --git a/src/test/ui/run-pass/issues/issue-43910.rs b/src/test/run-pass/issues/issue-43910.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-43910.rs rename to src/test/run-pass/issues/issue-43910.rs diff --git a/src/test/ui/run-pass/issues/issue-43923.rs b/src/test/run-pass/issues/issue-43923.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-43923.rs rename to src/test/run-pass/issues/issue-43923.rs index 220a68e1335c..3f72c5d8af02 100644 --- a/src/test/ui/run-pass/issues/issue-43923.rs +++ b/src/test/run-pass/issues/issue-43923.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] struct A { ptr: T } fn foo(x: &A<[T]>) {} diff --git a/src/test/ui/run-pass/issues/issue-44005.rs b/src/test/run-pass/issues/issue-44005.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-44005.rs rename to src/test/run-pass/issues/issue-44005.rs diff --git a/src/test/ui/run-pass/issues/issue-4401.rs b/src/test/run-pass/issues/issue-4401.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4401.rs rename to src/test/run-pass/issues/issue-4401.rs diff --git a/src/test/ui/run-pass/issues/issue-44056.rs b/src/test/run-pass/issues/issue-44056.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-44056.rs rename to src/test/run-pass/issues/issue-44056.rs diff --git a/src/test/ui/run-pass/issues/issue-44247.rs b/src/test/run-pass/issues/issue-44247.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-44247.rs rename to src/test/run-pass/issues/issue-44247.rs index f431e94889cb..c1204aa43a22 100644 --- a/src/test/ui/run-pass/issues/issue-44247.rs +++ b/src/test/run-pass/issues/issue-44247.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait T { type X; const X: Self::X; diff --git a/src/test/ui/run-pass/issues/issue-44333.rs b/src/test/run-pass/issues/issue-44333.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-44333.rs rename to src/test/run-pass/issues/issue-44333.rs diff --git a/src/test/ui/run-pass/issues/issue-44373.rs b/src/test/run-pass/issues/issue-44373.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-44373.rs rename to src/test/run-pass/issues/issue-44373.rs index 4d5bb5449b7b..2ed79dd89c8e 100644 --- a/src/test/ui/run-pass/issues/issue-44373.rs +++ b/src/test/run-pass/issues/issue-44373.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: -Z borrowck=compare struct Foo(bool); diff --git a/src/test/ui/run-pass/issues/issue-44402.rs b/src/test/run-pass/issues/issue-44402.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-44402.rs rename to src/test/run-pass/issues/issue-44402.rs index 427ac016c08c..6863fdbb5669 100644 --- a/src/test/ui/run-pass/issues/issue-44402.rs +++ b/src/test/run-pass/issues/issue-44402.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(never_type)] #![feature(exhaustive_patterns)] diff --git a/src/test/ui/run-pass/issues/issue-4446.rs b/src/test/run-pass/issues/issue-4446.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4446.rs rename to src/test/run-pass/issues/issue-4446.rs diff --git a/src/test/ui/run-pass/issues/issue-4448.rs b/src/test/run-pass/issues/issue-4448.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4448.rs rename to src/test/run-pass/issues/issue-4448.rs diff --git a/src/test/ui/run-pass/issues/issue-4464.rs b/src/test/run-pass/issues/issue-4464.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-4464.rs rename to src/test/run-pass/issues/issue-4464.rs index bb788aaf88dd..fda063e8ddd2 100644 --- a/src/test/ui/run-pass/issues/issue-4464.rs +++ b/src/test/run-pass/issues/issue-4464.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn broken(v: &[u8], i: usize, j: usize) -> &[u8] { &v[i..j] } diff --git a/src/test/ui/run-pass/issues/issue-44730.rs b/src/test/run-pass/issues/issue-44730.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-44730.rs rename to src/test/run-pass/issues/issue-44730.rs diff --git a/src/test/ui/run-pass/issues/issue-44851.rs b/src/test/run-pass/issues/issue-44851.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-44851.rs rename to src/test/run-pass/issues/issue-44851.rs diff --git a/src/test/ui/run-pass/issues/issue-45124.rs b/src/test/run-pass/issues/issue-45124.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-45124.rs rename to src/test/run-pass/issues/issue-45124.rs index 774ad8ac7601..da29d65ae145 100644 --- a/src/test/ui/run-pass/issues/issue-45124.rs +++ b/src/test/run-pass/issues/issue-45124.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] // compile-flags: --edition 2018 #![feature(try_blocks)] diff --git a/src/test/ui/run-pass/issues/issue-45152.rs b/src/test/run-pass/issues/issue-45152.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-45152.rs rename to src/test/run-pass/issues/issue-45152.rs index 71c1f92baa7f..2bba7fec3968 100644 --- a/src/test/ui/run-pass/issues/issue-45152.rs +++ b/src/test/run-pass/issues/issue-45152.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![feature(unsize, coerce_unsized)] #[repr(packed)] diff --git a/src/test/ui/run-pass/issues/issue-4541.rs b/src/test/run-pass/issues/issue-4541.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4541.rs rename to src/test/run-pass/issues/issue-4541.rs diff --git a/src/test/ui/run-pass/issues/issue-4542.rs b/src/test/run-pass/issues/issue-4542.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4542.rs rename to src/test/run-pass/issues/issue-4542.rs diff --git a/src/test/ui/run-pass/issues/issue-45425.rs b/src/test/run-pass/issues/issue-45425.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-45425.rs rename to src/test/run-pass/issues/issue-45425.rs index c75236640478..dfc7c8a8795b 100644 --- a/src/test/ui/run-pass/issues/issue-45425.rs +++ b/src/test/run-pass/issues/issue-45425.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::ops::Add; fn ref_add(a: &T, b: &T) -> T diff --git a/src/test/ui/run-pass/issues/issue-4545.rs b/src/test/run-pass/issues/issue-4545.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4545.rs rename to src/test/run-pass/issues/issue-4545.rs diff --git a/src/test/ui/run-pass/issues/issue-45731.rs b/src/test/run-pass/issues/issue-45731.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-45731.rs rename to src/test/run-pass/issues/issue-45731.rs index 568d6674c3a0..27ecc566233d 100644 --- a/src/test/ui/run-pass/issues/issue-45731.rs +++ b/src/test/run-pass/issues/issue-45731.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // compile-flags:--test -g #[cfg(target_os = "macos")] diff --git a/src/test/ui/run-pass/issues/issue-46069.rs b/src/test/run-pass/issues/issue-46069.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46069.rs rename to src/test/run-pass/issues/issue-46069.rs diff --git a/src/test/ui/run-pass/issues/issue-46095.rs b/src/test/run-pass/issues/issue-46095.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46095.rs rename to src/test/run-pass/issues/issue-46095.rs diff --git a/src/test/ui/run-pass/issues/issue-46519.rs b/src/test/run-pass/issues/issue-46519.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46519.rs rename to src/test/run-pass/issues/issue-46519.rs diff --git a/src/test/ui/run-pass/issues/issue-46553.rs b/src/test/run-pass/issues/issue-46553.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46553.rs rename to src/test/run-pass/issues/issue-46553.rs diff --git a/src/test/ui/run-pass/issues/issue-46845.rs b/src/test/run-pass/issues/issue-46845.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46845.rs rename to src/test/run-pass/issues/issue-46845.rs diff --git a/src/test/ui/run-pass/issues/issue-46855.rs b/src/test/run-pass/issues/issue-46855.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-46855.rs rename to src/test/run-pass/issues/issue-46855.rs index 8e6a37083e35..3a099c241b1f 100644 --- a/src/test/ui/run-pass/issues/issue-46855.rs +++ b/src/test/run-pass/issues/issue-46855.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: -Zmir-opt-level=1 use std::mem; diff --git a/src/test/ui/run-pass/issues/issue-46920-byte-array-patterns.rs b/src/test/run-pass/issues/issue-46920-byte-array-patterns.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46920-byte-array-patterns.rs rename to src/test/run-pass/issues/issue-46920-byte-array-patterns.rs diff --git a/src/test/ui/run-pass/issues/issue-46959.rs b/src/test/run-pass/issues/issue-46959.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46959.rs rename to src/test/run-pass/issues/issue-46959.rs diff --git a/src/test/ui/run-pass/issues/issue-46964.rs b/src/test/run-pass/issues/issue-46964.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-46964.rs rename to src/test/run-pass/issues/issue-46964.rs diff --git a/src/test/ui/run-pass/issues/issue-47139-1.rs b/src/test/run-pass/issues/issue-47139-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-47139-1.rs rename to src/test/run-pass/issues/issue-47139-1.rs diff --git a/src/test/ui/run-pass/issues/issue-47139-2.rs b/src/test/run-pass/issues/issue-47139-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-47139-2.rs rename to src/test/run-pass/issues/issue-47139-2.rs diff --git a/src/test/ui/run-pass/issues/issue-4734.rs b/src/test/run-pass/issues/issue-4734.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-4734.rs rename to src/test/run-pass/issues/issue-4734.rs index 216fd5370223..5bc977e1491c 100644 --- a/src/test/ui/run-pass/issues/issue-4734.rs +++ b/src/test/run-pass/issues/issue-4734.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Ensures that destructors are run for expressions of the form "e;" where // `e` is a type which requires a destructor. diff --git a/src/test/ui/run-pass/issues/issue-4735.rs b/src/test/run-pass/issues/issue-4735.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4735.rs rename to src/test/run-pass/issues/issue-4735.rs diff --git a/src/test/ui/run-pass/issues/issue-47364.rs b/src/test/run-pass/issues/issue-47364.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-47364.rs rename to src/test/run-pass/issues/issue-47364.rs index 61dd0714a1f1..58e11ff10357 100644 --- a/src/test/ui/run-pass/issues/issue-47364.rs +++ b/src/test/run-pass/issues/issue-47364.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // compile-flags: -C codegen-units=8 -O #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/issues/issue-4759-1.rs b/src/test/run-pass/issues/issue-4759-1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4759-1.rs rename to src/test/run-pass/issues/issue-4759-1.rs diff --git a/src/test/ui/run-pass/issues/issue-4759.rs b/src/test/run-pass/issues/issue-4759.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4759.rs rename to src/test/run-pass/issues/issue-4759.rs diff --git a/src/test/ui/run-pass/issues/issue-47638.rs b/src/test/run-pass/issues/issue-47638.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-47638.rs rename to src/test/run-pass/issues/issue-47638.rs index c3c662ea2d4a..1a6edd9f4980 100644 --- a/src/test/ui/run-pass/issues/issue-47638.rs +++ b/src/test/run-pass/issues/issue-47638.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] fn id<'c, 'b>(f: &'c &'b Fn(&i32)) -> &'c &'b Fn(&'static i32) { f } diff --git a/src/test/ui/run-pass/issues/issue-47673.rs b/src/test/run-pass/issues/issue-47673.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-47673.rs rename to src/test/run-pass/issues/issue-47673.rs index 96f38deec4c2..1e733a0c4d6f 100644 --- a/src/test/ui/run-pass/issues/issue-47673.rs +++ b/src/test/run-pass/issues/issue-47673.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] use {{}, {}}; diff --git a/src/test/ui/run-pass/issues/issue-47703-1.rs b/src/test/run-pass/issues/issue-47703-1.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-47703-1.rs rename to src/test/run-pass/issues/issue-47703-1.rs index 8fa931abb860..7cf34d3cd428 100644 --- a/src/test/ui/run-pass/issues/issue-47703-1.rs +++ b/src/test/run-pass/issues/issue-47703-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(nll)] struct AtomicRefMut<'a> { diff --git a/src/test/ui/run-pass/issues/issue-47703-tuple.rs b/src/test/run-pass/issues/issue-47703-tuple.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-47703-tuple.rs rename to src/test/run-pass/issues/issue-47703-tuple.rs index 188d4bc55200..ee9d7f38dbea 100644 --- a/src/test/ui/run-pass/issues/issue-47703-tuple.rs +++ b/src/test/run-pass/issues/issue-47703-tuple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(nll)] struct WithDrop; diff --git a/src/test/ui/run-pass/issues/issue-47703.rs b/src/test/run-pass/issues/issue-47703.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-47703.rs rename to src/test/run-pass/issues/issue-47703.rs index 0a0388ac48ed..17353c8e59f7 100644 --- a/src/test/ui/run-pass/issues/issue-47703.rs +++ b/src/test/run-pass/issues/issue-47703.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(nll)] struct MyStruct<'a> { diff --git a/src/test/ui/run-pass/issues/issue-47722.rs b/src/test/run-pass/issues/issue-47722.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-47722.rs rename to src/test/run-pass/issues/issue-47722.rs index 92309297356c..a8e0faeed060 100644 --- a/src/test/ui/run-pass/issues/issue-47722.rs +++ b/src/test/run-pass/issues/issue-47722.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Tests that automatic coercions from &mut T to *mut T // allow borrows of T to expire immediately - essentially, that diff --git a/src/test/ui/run-pass/issues/issue-47789.rs b/src/test/run-pass/issues/issue-47789.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-47789.rs rename to src/test/run-pass/issues/issue-47789.rs index 57aac45e51a9..349aa4f73abc 100644 --- a/src/test/ui/run-pass/issues/issue-47789.rs +++ b/src/test/run-pass/issues/issue-47789.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] #![feature(nll)] diff --git a/src/test/ui/run-pass/issues/issue-48159.rs b/src/test/run-pass/issues/issue-48159.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-48159.rs rename to src/test/run-pass/issues/issue-48159.rs diff --git a/src/test/ui/run-pass/issues/issue-4830.rs b/src/test/run-pass/issues/issue-4830.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-4830.rs rename to src/test/run-pass/issues/issue-4830.rs index 42800255c6be..5140162ae435 100644 --- a/src/test/ui/run-pass/issues/issue-4830.rs +++ b/src/test/run-pass/issues/issue-4830.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-48508-aux.rs b/src/test/run-pass/issues/issue-48508-aux.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-48508-aux.rs rename to src/test/run-pass/issues/issue-48508-aux.rs diff --git a/src/test/ui/run-pass/issues/issue-48508.rs b/src/test/run-pass/issues/issue-48508.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-48508.rs rename to src/test/run-pass/issues/issue-48508.rs diff --git a/src/test/ui/run-pass/issues/issue-48551.rs b/src/test/run-pass/issues/issue-48551.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-48551.rs rename to src/test/run-pass/issues/issue-48551.rs diff --git a/src/test/ui/run-pass/issues/issue-4865-1.rs b/src/test/run-pass/issues/issue-4865-1.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-4865-1.rs rename to src/test/run-pass/issues/issue-4865-1.rs index 9a22cf08c048..5dd142844f56 100644 --- a/src/test/ui/run-pass/issues/issue-4865-1.rs +++ b/src/test/run-pass/issues/issue-4865-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // This should resolve fine. // Prior to fix, the crossed imports between a and b // would block on the glob import, itself never being resolved diff --git a/src/test/ui/run-pass/issues/issue-4865-2.rs b/src/test/run-pass/issues/issue-4865-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-4865-2.rs rename to src/test/run-pass/issues/issue-4865-2.rs diff --git a/src/test/ui/run-pass/issues/issue-4865-3.rs b/src/test/run-pass/issues/issue-4865-3.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-4865-3.rs rename to src/test/run-pass/issues/issue-4865-3.rs index 4a18539c3028..b4126337d05e 100644 --- a/src/test/ui/run-pass/issues/issue-4865-3.rs +++ b/src/test/run-pass/issues/issue-4865-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // This should resolve fine even with the circular imports as // they are not `pub`. diff --git a/src/test/ui/run-pass/issues/issue-4875.rs b/src/test/run-pass/issues/issue-4875.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-4875.rs rename to src/test/run-pass/issues/issue-4875.rs index d33d08ab18cd..c1ef78242fb8 100644 --- a/src/test/ui/run-pass/issues/issue-4875.rs +++ b/src/test/run-pass/issues/issue-4875.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // regression test for issue 4875 // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-48962.rs b/src/test/run-pass/issues/issue-48962.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-48962.rs rename to src/test/run-pass/issues/issue-48962.rs index ea309981af1b..2fd3ad47f00c 100644 --- a/src/test/ui/run-pass/issues/issue-48962.rs +++ b/src/test/run-pass/issues/issue-48962.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // Test that we are able to reinitialize box with moved referent #![feature(nll)] static mut ORDER: [usize; 3] = [0, 0, 0]; diff --git a/src/test/ui/run-pass/issues/issue-48984.rs b/src/test/run-pass/issues/issue-48984.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-48984.rs rename to src/test/run-pass/issues/issue-48984.rs index faffc2e4fb05..035c7e7fcc1c 100644 --- a/src/test/ui/run-pass/issues/issue-48984.rs +++ b/src/test/run-pass/issues/issue-48984.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue-48984-aux.rs extern crate issue48984aux; use issue48984aux::Bar; diff --git a/src/test/ui/run-pass/issues/issue-49298.rs b/src/test/run-pass/issues/issue-49298.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-49298.rs rename to src/test/run-pass/issues/issue-49298.rs index 22a34f334cb2..6463adc48a8c 100644 --- a/src/test/ui/run-pass/issues/issue-49298.rs +++ b/src/test/run-pass/issues/issue-49298.rs @@ -10,6 +10,7 @@ // run-pass #![feature(test)] +#![allow(unused_mut)] // under NLL we get warning about `x` below: rust-lang/rust#54499 extern crate test; diff --git a/src/test/ui/run-pass/issues/issue-49556.rs b/src/test/run-pass/issues/issue-49556.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49556.rs rename to src/test/run-pass/issues/issue-49556.rs diff --git a/src/test/ui/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs b/src/test/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs rename to src/test/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs index 3a70bdfb2fd0..ecda8b7d17e3 100644 --- a/src/test/ui/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs +++ b/src/test/run-pass/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![deny(non_shorthand_field_patterns)] pub struct Value { pub value: A } diff --git a/src/test/ui/run-pass/issues/issue-49632.rs b/src/test/run-pass/issues/issue-49632.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49632.rs rename to src/test/run-pass/issues/issue-49632.rs diff --git a/src/test/ui/run-pass/issues/issue-49685.rs b/src/test/run-pass/issues/issue-49685.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49685.rs rename to src/test/run-pass/issues/issue-49685.rs diff --git a/src/test/ui/run-pass/issues/issue-49854.rs b/src/test/run-pass/issues/issue-49854.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49854.rs rename to src/test/run-pass/issues/issue-49854.rs diff --git a/src/test/ui/run-pass/issues/issue-49955-2.rs b/src/test/run-pass/issues/issue-49955-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49955-2.rs rename to src/test/run-pass/issues/issue-49955-2.rs diff --git a/src/test/ui/run-pass/issues/issue-49955.rs b/src/test/run-pass/issues/issue-49955.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49955.rs rename to src/test/run-pass/issues/issue-49955.rs diff --git a/src/test/ui/run-pass/issues/issue-49973.rs b/src/test/run-pass/issues/issue-49973.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-49973.rs rename to src/test/run-pass/issues/issue-49973.rs diff --git a/src/test/ui/run-pass/issues/issue-5008-borrowed-traitobject-method-call.rs b/src/test/run-pass/issues/issue-5008-borrowed-traitobject-method-call.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5008-borrowed-traitobject-method-call.rs rename to src/test/run-pass/issues/issue-5008-borrowed-traitobject-method-call.rs diff --git a/src/test/ui/run-pass/issues/issue-50415.rs b/src/test/run-pass/issues/issue-50415.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-50415.rs rename to src/test/run-pass/issues/issue-50415.rs diff --git a/src/test/ui/run-pass/issues/issue-50442.rs b/src/test/run-pass/issues/issue-50442.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-50442.rs rename to src/test/run-pass/issues/issue-50442.rs index 6a55f2d633bd..b22cd8292533 100644 --- a/src/test/ui/run-pass/issues/issue-50442.rs +++ b/src/test/run-pass/issues/issue-50442.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Void {} enum Foo { diff --git a/src/test/ui/run-pass/issues/issue-5060.rs b/src/test/run-pass/issues/issue-5060.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5060.rs rename to src/test/run-pass/issues/issue-5060.rs diff --git a/src/test/ui/run-pass/issues/issue-50689.rs b/src/test/run-pass/issues/issue-50689.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-50689.rs rename to src/test/run-pass/issues/issue-50689.rs index bc94066b0413..6b7f4e6e95e9 100644 --- a/src/test/ui/run-pass/issues/issue-50689.rs +++ b/src/test/run-pass/issues/issue-50689.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] enum Foo { Bar = (|x: i32| { }, 42).1, } diff --git a/src/test/ui/run-pass/issues/issue-50731.rs b/src/test/run-pass/issues/issue-50731.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-50731.rs rename to src/test/run-pass/issues/issue-50731.rs diff --git a/src/test/ui/run-pass/issues/issue-50811.rs b/src/test/run-pass/issues/issue-50811.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-50811.rs rename to src/test/run-pass/issues/issue-50811.rs diff --git a/src/test/ui/run-pass/issues/issue-50865-private-impl-trait/auxiliary/lib.rs b/src/test/run-pass/issues/issue-50865-private-impl-trait/auxiliary/lib.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-50865-private-impl-trait/auxiliary/lib.rs rename to src/test/run-pass/issues/issue-50865-private-impl-trait/auxiliary/lib.rs diff --git a/src/test/ui/run-pass/issues/issue-50865-private-impl-trait/main.rs b/src/test/run-pass/issues/issue-50865-private-impl-trait/main.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-50865-private-impl-trait/main.rs rename to src/test/run-pass/issues/issue-50865-private-impl-trait/main.rs diff --git a/src/test/ui/run-pass/issues/issue-51185.rs b/src/test/run-pass/issues/issue-51185.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-51185.rs rename to src/test/run-pass/issues/issue-51185.rs diff --git a/src/test/ui/run-pass/issues/issue-51345.rs b/src/test/run-pass/issues/issue-51345.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-51345.rs rename to src/test/run-pass/issues/issue-51345.rs index 887feada3c82..cc97da8b45ea 100644 --- a/src/test/ui/run-pass/issues/issue-51345.rs +++ b/src/test/run-pass/issues/issue-51345.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_code)] #![feature(nll)] fn main() { diff --git a/src/test/ui/run-pass/issues/issue-51582.rs b/src/test/run-pass/issues/issue-51582.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-51582.rs rename to src/test/run-pass/issues/issue-51582.rs diff --git a/src/test/ui/run-pass/issues/issue-51655.rs b/src/test/run-pass/issues/issue-51655.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-51655.rs rename to src/test/run-pass/issues/issue-51655.rs diff --git a/src/test/ui/run-pass/issues/issue-51907.rs b/src/test/run-pass/issues/issue-51907.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-51907.rs rename to src/test/run-pass/issues/issue-51907.rs diff --git a/src/test/ui/run-pass/issues/issue-5192.rs b/src/test/run-pass/issues/issue-5192.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-5192.rs rename to src/test/run-pass/issues/issue-5192.rs index df9664dc234a..0f14b0fb5fce 100644 --- a/src/test/ui/run-pass/issues/issue-5192.rs +++ b/src/test/run-pass/issues/issue-5192.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/issues/issue-52140/auxiliary/some_crate.rs b/src/test/run-pass/issues/issue-52140/auxiliary/some_crate.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52140/auxiliary/some_crate.rs rename to src/test/run-pass/issues/issue-52140/auxiliary/some_crate.rs diff --git a/src/test/ui/run-pass/issues/issue-52140/main.rs b/src/test/run-pass/issues/issue-52140/main.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52140/main.rs rename to src/test/run-pass/issues/issue-52140/main.rs diff --git a/src/test/ui/run-pass/issues/issue-52141/auxiliary/some_crate.rs b/src/test/run-pass/issues/issue-52141/auxiliary/some_crate.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52141/auxiliary/some_crate.rs rename to src/test/run-pass/issues/issue-52141/auxiliary/some_crate.rs diff --git a/src/test/ui/run-pass/issues/issue-52141/main.rs b/src/test/run-pass/issues/issue-52141/main.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52141/main.rs rename to src/test/run-pass/issues/issue-52141/main.rs diff --git a/src/test/ui/run-pass/issues/issue-52169.rs b/src/test/run-pass/issues/issue-52169.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52169.rs rename to src/test/run-pass/issues/issue-52169.rs diff --git a/src/test/ui/run-pass/issues/issue-5239-2.rs b/src/test/run-pass/issues/issue-5239-2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5239-2.rs rename to src/test/run-pass/issues/issue-5239-2.rs diff --git a/src/test/ui/run-pass/issues/issue-5243.rs b/src/test/run-pass/issues/issue-5243.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5243.rs rename to src/test/run-pass/issues/issue-5243.rs index 708187643d85..3c630ceff7ab 100644 --- a/src/test/ui/run-pass/issues/issue-5243.rs +++ b/src/test/run-pass/issues/issue-5243.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Check that merely having lifetime parameters is not // enough for codegen to consider this as non-monomorphic, // which led to various assertions and failures in turn. diff --git a/src/test/ui/run-pass/issues/issue-52557.rs b/src/test/run-pass/issues/issue-52557.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-52557.rs rename to src/test/run-pass/issues/issue-52557.rs index 3c987d32b90e..c3dc404058c5 100644 --- a/src/test/ui/run-pass/issues/issue-52557.rs +++ b/src/test/run-pass/issues/issue-52557.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // This test checks for namespace pollution by private tests. // Tests used to marked as public causing name conflicts with normal // functions only in test builds. diff --git a/src/test/ui/run-pass/issues/issue-52705/auxiliary/png2.rs b/src/test/run-pass/issues/issue-52705/auxiliary/png2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-52705/auxiliary/png2.rs rename to src/test/run-pass/issues/issue-52705/auxiliary/png2.rs diff --git a/src/test/ui/run-pass/issues/issue-52705/main.rs b/src/test/run-pass/issues/issue-52705/main.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-52705/main.rs rename to src/test/run-pass/issues/issue-52705/main.rs index 00cb5ac103a9..9a27584c1819 100644 --- a/src/test/ui/run-pass/issues/issue-52705/main.rs +++ b/src/test/run-pass/issues/issue-52705/main.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:png2.rs // compile-flags:--extern png2 // edition:2018 diff --git a/src/test/ui/run-pass/issues/issue-5280.rs b/src/test/run-pass/issues/issue-5280.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5280.rs rename to src/test/run-pass/issues/issue-5280.rs index f80b80c72aff..c791113bee60 100644 --- a/src/test/ui/run-pass/issues/issue-5280.rs +++ b/src/test/run-pass/issues/issue-5280.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] type FontTableTag = u32; diff --git a/src/test/ui/run-pass/issues/issue-5315.rs b/src/test/run-pass/issues/issue-5315.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5315.rs rename to src/test/run-pass/issues/issue-5315.rs diff --git a/src/test/ui/run-pass/issues/issue-5321-immediates-with-bare-self.rs b/src/test/run-pass/issues/issue-5321-immediates-with-bare-self.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5321-immediates-with-bare-self.rs rename to src/test/run-pass/issues/issue-5321-immediates-with-bare-self.rs diff --git a/src/test/ui/run-pass/issues/issue-53333.rs b/src/test/run-pass/issues/issue-53333.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-53333.rs rename to src/test/run-pass/issues/issue-53333.rs index 8cb0d17cc166..db59f8f74164 100644 --- a/src/test/ui/run-pass/issues/issue-53333.rs +++ b/src/test/run-pass/issues/issue-53333.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // edition:2018 fn main() { diff --git a/src/test/ui/run-pass/issues/issue-5353.rs b/src/test/run-pass/issues/issue-5353.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5353.rs rename to src/test/run-pass/issues/issue-5353.rs index 678a42e75494..d9d078313316 100644 --- a/src/test/ui/run-pass/issues/issue-5353.rs +++ b/src/test/run-pass/issues/issue-5353.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 const INVALID_ENUM : u32 = 0; diff --git a/src/test/ui/run-pass/issues/issue-5518.rs b/src/test/run-pass/issues/issue-5518.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5518.rs rename to src/test/run-pass/issues/issue-5518.rs diff --git a/src/test/ui/run-pass/issues/issue-5521.rs b/src/test/run-pass/issues/issue-5521.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-5521.rs rename to src/test/run-pass/issues/issue-5521.rs index 4890156f7b8e..c17404305905 100644 --- a/src/test/ui/run-pass/issues/issue-5521.rs +++ b/src/test/run-pass/issues/issue-5521.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:issue-5521.rs diff --git a/src/test/ui/run-pass/issues/issue-5530.rs b/src/test/run-pass/issues/issue-5530.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-5530.rs rename to src/test/run-pass/issues/issue-5530.rs index cf0a225290f7..417dc6ce3c52 100644 --- a/src/test/ui/run-pass/issues/issue-5530.rs +++ b/src/test/run-pass/issues/issue-5530.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Enum { Foo { foo: usize }, diff --git a/src/test/ui/run-pass/issues/issue-5550.rs b/src/test/run-pass/issues/issue-5550.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-5550.rs rename to src/test/run-pass/issues/issue-5550.rs index 3b0f19b1f8ba..aa66737344d8 100644 --- a/src/test/ui/run-pass/issues/issue-5550.rs +++ b/src/test/run-pass/issues/issue-5550.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] // pretty-expanded FIXME #23616 pub fn main() { diff --git a/src/test/ui/run-pass/issues/issue-5554.rs b/src/test/run-pass/issues/issue-5554.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5554.rs rename to src/test/run-pass/issues/issue-5554.rs index 8ff48c8600ec..ec4a082c0ffd 100644 --- a/src/test/ui/run-pass/issues/issue-5554.rs +++ b/src/test/run-pass/issues/issue-5554.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 use std::default::Default; diff --git a/src/test/ui/run-pass/issues/issue-5572.rs b/src/test/run-pass/issues/issue-5572.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-5572.rs rename to src/test/run-pass/issues/issue-5572.rs index 418119e2fd6c..02f12a0303a5 100644 --- a/src/test/ui/run-pass/issues/issue-5572.rs +++ b/src/test/run-pass/issues/issue-5572.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn foo(_t: T) { } diff --git a/src/test/ui/run-pass/issues/issue-5666.rs b/src/test/run-pass/issues/issue-5666.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5666.rs rename to src/test/run-pass/issues/issue-5666.rs diff --git a/src/test/ui/run-pass/issues/issue-5688.rs b/src/test/run-pass/issues/issue-5688.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5688.rs rename to src/test/run-pass/issues/issue-5688.rs diff --git a/src/test/ui/run-pass/issues/issue-5708.rs b/src/test/run-pass/issues/issue-5708.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-5708.rs rename to src/test/run-pass/issues/issue-5708.rs index 2fef9bc19732..3d44c39c5772 100644 --- a/src/test/ui/run-pass/issues/issue-5708.rs +++ b/src/test/run-pass/issues/issue-5708.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] /* # ICE when returning struct with reference to trait diff --git a/src/test/ui/run-pass/issues/issue-5718.rs b/src/test/run-pass/issues/issue-5718.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5718.rs rename to src/test/run-pass/issues/issue-5718.rs diff --git a/src/test/ui/run-pass/issues/issue-5741.rs b/src/test/run-pass/issues/issue-5741.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5741.rs rename to src/test/run-pass/issues/issue-5741.rs diff --git a/src/test/ui/run-pass/issues/issue-5754.rs b/src/test/run-pass/issues/issue-5754.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5754.rs rename to src/test/run-pass/issues/issue-5754.rs index ba79c32a83de..9b9026304598 100644 --- a/src/test/ui/run-pass/issues/issue-5754.rs +++ b/src/test/run-pass/issues/issue-5754.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(improper_ctypes)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-5791.rs b/src/test/run-pass/issues/issue-5791.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5791.rs rename to src/test/run-pass/issues/issue-5791.rs index e6c9106111f5..921951696383 100644 --- a/src/test/ui/run-pass/issues/issue-5791.rs +++ b/src/test/run-pass/issues/issue-5791.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 extern { diff --git a/src/test/ui/run-pass/issues/issue-5884.rs b/src/test/run-pass/issues/issue-5884.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-5884.rs rename to src/test/run-pass/issues/issue-5884.rs index 26816f235e95..82d87d9d270a 100644 --- a/src/test/ui/run-pass/issues/issue-5884.rs +++ b/src/test/run-pass/issues/issue-5884.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/issues/issue-5900.rs b/src/test/run-pass/issues/issue-5900.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-5900.rs rename to src/test/run-pass/issues/issue-5900.rs index d75291bf1f3d..edb4ead53e42 100644 --- a/src/test/ui/run-pass/issues/issue-5900.rs +++ b/src/test/run-pass/issues/issue-5900.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub mod foo { diff --git a/src/test/ui/run-pass/issues/issue-5917.rs b/src/test/run-pass/issues/issue-5917.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5917.rs rename to src/test/run-pass/issues/issue-5917.rs diff --git a/src/test/ui/run-pass/issues/issue-5950.rs b/src/test/run-pass/issues/issue-5950.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5950.rs rename to src/test/run-pass/issues/issue-5950.rs diff --git a/src/test/ui/run-pass/issues/issue-5988.rs b/src/test/run-pass/issues/issue-5988.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-5988.rs rename to src/test/run-pass/issues/issue-5988.rs diff --git a/src/test/ui/run-pass/issues/issue-5997.rs b/src/test/run-pass/issues/issue-5997.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-5997.rs rename to src/test/run-pass/issues/issue-5997.rs index d888f691477b..84c2d3b8b14a 100644 --- a/src/test/ui/run-pass/issues/issue-5997.rs +++ b/src/test/run-pass/issues/issue-5997.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn f() -> bool { enum E { V(T) } diff --git a/src/test/ui/run-pass/issues/issue-6117.rs b/src/test/run-pass/issues/issue-6117.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-6117.rs rename to src/test/run-pass/issues/issue-6117.rs index fa9ef84746d6..68c729ced824 100644 --- a/src/test/ui/run-pass/issues/issue-6117.rs +++ b/src/test/run-pass/issues/issue-6117.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum Either { Left(T), Right(U) } diff --git a/src/test/ui/run-pass/issues/issue-6128.rs b/src/test/run-pass/issues/issue-6128.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6128.rs rename to src/test/run-pass/issues/issue-6128.rs diff --git a/src/test/ui/run-pass/issues/issue-6130.rs b/src/test/run-pass/issues/issue-6130.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6130.rs rename to src/test/run-pass/issues/issue-6130.rs diff --git a/src/test/ui/run-pass/issues/issue-6153.rs b/src/test/run-pass/issues/issue-6153.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6153.rs rename to src/test/run-pass/issues/issue-6153.rs diff --git a/src/test/ui/run-pass/issues/issue-6157.rs b/src/test/run-pass/issues/issue-6157.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6157.rs rename to src/test/run-pass/issues/issue-6157.rs diff --git a/src/test/ui/run-pass/issues/issue-6318.rs b/src/test/run-pass/issues/issue-6318.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6318.rs rename to src/test/run-pass/issues/issue-6318.rs diff --git a/src/test/ui/run-pass/issues/issue-6334.rs b/src/test/run-pass/issues/issue-6334.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6334.rs rename to src/test/run-pass/issues/issue-6334.rs diff --git a/src/test/ui/run-pass/issues/issue-6341.rs b/src/test/run-pass/issues/issue-6341.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6341.rs rename to src/test/run-pass/issues/issue-6341.rs diff --git a/src/test/ui/run-pass/issues/issue-6344-let.rs b/src/test/run-pass/issues/issue-6344-let.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6344-let.rs rename to src/test/run-pass/issues/issue-6344-let.rs diff --git a/src/test/ui/run-pass/issues/issue-6344-match.rs b/src/test/run-pass/issues/issue-6344-match.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6344-match.rs rename to src/test/run-pass/issues/issue-6344-match.rs diff --git a/src/test/ui/run-pass/issues/issue-6449.rs b/src/test/run-pass/issues/issue-6449.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-6449.rs rename to src/test/run-pass/issues/issue-6449.rs index 1987bca93308..9314990b0f32 100644 --- a/src/test/ui/run-pass/issues/issue-6449.rs +++ b/src/test/run-pass/issues/issue-6449.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Foo { Bar(isize), diff --git a/src/test/ui/run-pass/issues/issue-6470.rs b/src/test/run-pass/issues/issue-6470.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-6470.rs rename to src/test/run-pass/issues/issue-6470.rs index 152b4bbedc3f..a23a6532b155 100644 --- a/src/test/ui/run-pass/issues/issue-6470.rs +++ b/src/test/run-pass/issues/issue-6470.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(improper_ctypes)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-6557.rs b/src/test/run-pass/issues/issue-6557.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-6557.rs rename to src/test/run-pass/issues/issue-6557.rs index 5179ddb472ba..886d13c4c6f1 100644 --- a/src/test/ui/run-pass/issues/issue-6557.rs +++ b/src/test/run-pass/issues/issue-6557.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(box_patterns)] diff --git a/src/test/ui/run-pass/issues/issue-6892.rs b/src/test/run-pass/issues/issue-6892.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-6892.rs rename to src/test/run-pass/issues/issue-6892.rs index 173ad5833e58..b92c53479827 100644 --- a/src/test/ui/run-pass/issues/issue-6892.rs +++ b/src/test/run-pass/issues/issue-6892.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Ensures that destructors are run for expressions of the form "let _ = e;" // where `e` is a type which requires a destructor. diff --git a/src/test/ui/run-pass/issues/issue-6898.rs b/src/test/run-pass/issues/issue-6898.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-6898.rs rename to src/test/run-pass/issues/issue-6898.rs diff --git a/src/test/ui/run-pass/issues/issue-6919.rs b/src/test/run-pass/issues/issue-6919.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-6919.rs rename to src/test/run-pass/issues/issue-6919.rs index 94c1a1ae00ac..1332c863935a 100644 --- a/src/test/ui/run-pass/issues/issue-6919.rs +++ b/src/test/run-pass/issues/issue-6919.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] // aux-build:iss.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-6991.rs b/src/test/run-pass/issues/issue-6991.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-6991.rs rename to src/test/run-pass/issues/issue-6991.rs index 13b738ac0e6d..3d1108e84ad2 100644 --- a/src/test/ui/run-pass/issues/issue-6991.rs +++ b/src/test/run-pass/issues/issue-6991.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] static x: &'static usize = &1; diff --git a/src/test/ui/run-pass/issues/issue-7012.rs b/src/test/run-pass/issues/issue-7012.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7012.rs rename to src/test/run-pass/issues/issue-7012.rs diff --git a/src/test/ui/run-pass/issues/issue-7178.rs b/src/test/run-pass/issues/issue-7178.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7178.rs rename to src/test/run-pass/issues/issue-7178.rs diff --git a/src/test/ui/run-pass/issues/issue-7222.rs b/src/test/run-pass/issues/issue-7222.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7222.rs rename to src/test/run-pass/issues/issue-7222.rs diff --git a/src/test/ui/run-pass/issues/issue-7268.rs b/src/test/run-pass/issues/issue-7268.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-7268.rs rename to src/test/run-pass/issues/issue-7268.rs index 3a93a144ee8b..961f90dfc377 100644 --- a/src/test/ui/run-pass/issues/issue-7268.rs +++ b/src/test/run-pass/issues/issue-7268.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 fn foo(_: T) {} diff --git a/src/test/ui/run-pass/issues/issue-7344.rs b/src/test/run-pass/issues/issue-7344.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-7344.rs rename to src/test/run-pass/issues/issue-7344.rs index cc160c79ae9c..7402ae1c975b 100644 --- a/src/test/ui/run-pass/issues/issue-7344.rs +++ b/src/test/run-pass/issues/issue-7344.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // pretty-expanded FIXME #23616 #![allow(unreachable_code)] diff --git a/src/test/ui/run-pass/issues/issue-7519-match-unit-in-arg.rs b/src/test/run-pass/issues/issue-7519-match-unit-in-arg.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7519-match-unit-in-arg.rs rename to src/test/run-pass/issues/issue-7519-match-unit-in-arg.rs diff --git a/src/test/ui/run-pass/issues/issue-7563.rs b/src/test/run-pass/issues/issue-7563.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-7563.rs rename to src/test/run-pass/issues/issue-7563.rs index 203c9cdfa496..e8c2a4683a5e 100644 --- a/src/test/ui/run-pass/issues/issue-7563.rs +++ b/src/test/run-pass/issues/issue-7563.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait IDummy { fn do_nothing(&self); } diff --git a/src/test/ui/run-pass/issues/issue-7575.rs b/src/test/run-pass/issues/issue-7575.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7575.rs rename to src/test/run-pass/issues/issue-7575.rs diff --git a/src/test/ui/run-pass/issues/issue-7607-2.rs b/src/test/run-pass/issues/issue-7607-2.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-7607-2.rs rename to src/test/run-pass/issues/issue-7607-2.rs index 7a1f0159df94..fa97eae7cb33 100644 --- a/src/test/ui/run-pass/issues/issue-7607-2.rs +++ b/src/test/run-pass/issues/issue-7607-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub mod a { diff --git a/src/test/ui/run-pass/issues/issue-7660.rs b/src/test/run-pass/issues/issue-7660.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-7660.rs rename to src/test/run-pass/issues/issue-7660.rs index 774d9706d909..e584fc790853 100644 --- a/src/test/ui/run-pass/issues/issue-7660.rs +++ b/src/test/run-pass/issues/issue-7660.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Regression test for issue 7660 // rvalue lifetime too short when equivalent `match` works diff --git a/src/test/ui/run-pass/issues/issue-7663.rs b/src/test/run-pass/issues/issue-7663.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7663.rs rename to src/test/run-pass/issues/issue-7663.rs diff --git a/src/test/ui/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs b/src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs rename to src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs index f9dae8472a89..6e5a6c551ebf 100644 --- a/src/test/ui/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs +++ b/src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 /* diff --git a/src/test/ui/run-pass/issues/issue-7784.rs b/src/test/run-pass/issues/issue-7784.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7784.rs rename to src/test/run-pass/issues/issue-7784.rs diff --git a/src/test/ui/run-pass/issues/issue-7899.rs b/src/test/run-pass/issues/issue-7899.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-7899.rs rename to src/test/run-pass/issues/issue-7899.rs index 74a5b0608224..6141eec68fc0 100644 --- a/src/test/ui/run-pass/issues/issue-7899.rs +++ b/src/test/run-pass/issues/issue-7899.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // aux-build:issue-7899.rs // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-7911.rs b/src/test/run-pass/issues/issue-7911.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-7911.rs rename to src/test/run-pass/issues/issue-7911.rs diff --git a/src/test/ui/run-pass/issues/issue-8044.rs b/src/test/run-pass/issues/issue-8044.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8044.rs rename to src/test/run-pass/issues/issue-8044.rs diff --git a/src/test/ui/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs b/src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs rename to src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs index 311fd129ab07..9ddc63a208ae 100644 --- a/src/test/ui/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs +++ b/src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 /* diff --git a/src/test/ui/run-pass/issues/issue-8248.rs b/src/test/run-pass/issues/issue-8248.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8248.rs rename to src/test/run-pass/issues/issue-8248.rs diff --git a/src/test/ui/run-pass/issues/issue-8249.rs b/src/test/run-pass/issues/issue-8249.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-8249.rs rename to src/test/run-pass/issues/issue-8249.rs index 9afa6f937b5e..07916d9cdb8f 100644 --- a/src/test/ui/run-pass/issues/issue-8249.rs +++ b/src/test/run-pass/issues/issue-8249.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait A { diff --git a/src/test/ui/run-pass/issues/issue-8259.rs b/src/test/run-pass/issues/issue-8259.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-8259.rs rename to src/test/run-pass/issues/issue-8259.rs index a0e2caee40a6..b26392b6c72a 100644 --- a/src/test/ui/run-pass/issues/issue-8259.rs +++ b/src/test/run-pass/issues/issue-8259.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] // aux-build:issue-8259.rs diff --git a/src/test/ui/run-pass/issues/issue-8351-1.rs b/src/test/run-pass/issues/issue-8351-1.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-8351-1.rs rename to src/test/run-pass/issues/issue-8351-1.rs index 3caecf9fb939..5d0dc31caa66 100644 --- a/src/test/ui/run-pass/issues/issue-8351-1.rs +++ b/src/test/run-pass/issues/issue-8351-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { Foo{f: isize}, diff --git a/src/test/ui/run-pass/issues/issue-8351-2.rs b/src/test/run-pass/issues/issue-8351-2.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-8351-2.rs rename to src/test/run-pass/issues/issue-8351-2.rs index da70fc415c02..5a3b1b13a63e 100644 --- a/src/test/ui/run-pass/issues/issue-8351-2.rs +++ b/src/test/run-pass/issues/issue-8351-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum E { Foo{f: isize, b: bool}, diff --git a/src/test/ui/run-pass/issues/issue-8391.rs b/src/test/run-pass/issues/issue-8391.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8391.rs rename to src/test/run-pass/issues/issue-8391.rs diff --git a/src/test/ui/run-pass/issues/issue-8398.rs b/src/test/run-pass/issues/issue-8398.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-8398.rs rename to src/test/run-pass/issues/issue-8398.rs index e4f5a457f418..2458e91daeb8 100644 --- a/src/test/ui/run-pass/issues/issue-8398.rs +++ b/src/test/run-pass/issues/issue-8398.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub trait Writer { diff --git a/src/test/ui/run-pass/issues/issue-8401.rs b/src/test/run-pass/issues/issue-8401.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8401.rs rename to src/test/run-pass/issues/issue-8401.rs diff --git a/src/test/ui/run-pass/issues/issue-8460.rs b/src/test/run-pass/issues/issue-8460.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-8460.rs rename to src/test/run-pass/issues/issue-8460.rs index 9f0f7e2fa421..515b0949a716 100644 --- a/src/test/ui/run-pass/issues/issue-8460.rs +++ b/src/test/run-pass/issues/issue-8460.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support #![feature(rustc_attrs)] diff --git a/src/test/ui/run-pass/issues/issue-8498.rs b/src/test/run-pass/issues/issue-8498.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8498.rs rename to src/test/run-pass/issues/issue-8498.rs diff --git a/src/test/ui/run-pass/issues/issue-8506.rs b/src/test/run-pass/issues/issue-8506.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8506.rs rename to src/test/run-pass/issues/issue-8506.rs diff --git a/src/test/ui/run-pass/issues/issue-8521.rs b/src/test/run-pass/issues/issue-8521.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8521.rs rename to src/test/run-pass/issues/issue-8521.rs diff --git a/src/test/ui/run-pass/issues/issue-8578.rs b/src/test/run-pass/issues/issue-8578.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-8578.rs rename to src/test/run-pass/issues/issue-8578.rs index 8753ee8370b0..4cf39e3e5f05 100644 --- a/src/test/ui/run-pass/issues/issue-8578.rs +++ b/src/test/run-pass/issues/issue-8578.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/issues/issue-868.rs b/src/test/run-pass/issues/issue-868.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-868.rs rename to src/test/run-pass/issues/issue-868.rs index a545abefb7a3..6e9b736cccd4 100644 --- a/src/test/ui/run-pass/issues/issue-868.rs +++ b/src/test/run-pass/issues/issue-868.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_parens)] // pretty-expanded FIXME #23616 fn f(g: F) -> T where F: FnOnce() -> T { g() } diff --git a/src/test/ui/run-pass/issues/issue-8709.rs b/src/test/run-pass/issues/issue-8709.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8709.rs rename to src/test/run-pass/issues/issue-8709.rs diff --git a/src/test/ui/run-pass/issues/issue-8783.rs b/src/test/run-pass/issues/issue-8783.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-8783.rs rename to src/test/run-pass/issues/issue-8783.rs index 741411aeffb1..71915cfb33e9 100644 --- a/src/test/ui/run-pass/issues/issue-8783.rs +++ b/src/test/run-pass/issues/issue-8783.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 use std::default::Default; diff --git a/src/test/ui/run-pass/issues/issue-8827.rs b/src/test/run-pass/issues/issue-8827.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8827.rs rename to src/test/run-pass/issues/issue-8827.rs diff --git a/src/test/ui/run-pass/issues/issue-8851.rs b/src/test/run-pass/issues/issue-8851.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-8851.rs rename to src/test/run-pass/issues/issue-8851.rs index 19fd51b476d4..ff4fbc973e04 100644 --- a/src/test/ui/run-pass/issues/issue-8851.rs +++ b/src/test/run-pass/issues/issue-8851.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // after fixing #9384 and implementing hygiene for match bindings, // this now fails because the insertion of the 'y' into the match // doesn't cause capture. Making this macro hygienic (as I've done) diff --git a/src/test/ui/run-pass/issues/issue-8860.rs b/src/test/run-pass/issues/issue-8860.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-8860.rs rename to src/test/run-pass/issues/issue-8860.rs index c4d9cab9ff36..e0b491642812 100644 --- a/src/test/ui/run-pass/issues/issue-8860.rs +++ b/src/test/run-pass/issues/issue-8860.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: -Z borrowck=compare static mut DROP: isize = 0; diff --git a/src/test/ui/run-pass/issues/issue-8898.rs b/src/test/run-pass/issues/issue-8898.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-8898.rs rename to src/test/run-pass/issues/issue-8898.rs diff --git a/src/test/ui/run-pass/issues/issue-9047.rs b/src/test/run-pass/issues/issue-9047.rs similarity index 92% rename from src/test/ui/run-pass/issues/issue-9047.rs rename to src/test/run-pass/issues/issue-9047.rs index 30f886f6784c..9e919e7b89c9 100644 --- a/src/test/ui/run-pass/issues/issue-9047.rs +++ b/src/test/run-pass/issues/issue-9047.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] fn decode() -> String { 'outer: loop { let mut ch_start: usize; diff --git a/src/test/ui/run-pass/issues/issue-9110.rs b/src/test/run-pass/issues/issue-9110.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-9110.rs rename to src/test/run-pass/issues/issue-9110.rs index 906c7a422e77..150df681ea4d 100644 --- a/src/test/ui/run-pass/issues/issue-9110.rs +++ b/src/test/run-pass/issues/issue-9110.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/issues/issue-9123.rs b/src/test/run-pass/issues/issue-9123.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9123.rs rename to src/test/run-pass/issues/issue-9123.rs diff --git a/src/test/ui/run-pass/issues/issue-9129.rs b/src/test/run-pass/issues/issue-9129.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-9129.rs rename to src/test/run-pass/issues/issue-9129.rs index 21e192b23f5a..7c9f49c51b5d 100644 --- a/src/test/ui/run-pass/issues/issue-9129.rs +++ b/src/test/run-pass/issues/issue-9129.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] // ignore-pretty unreported diff --git a/src/test/ui/run-pass/issues/issue-9188.rs b/src/test/run-pass/issues/issue-9188.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9188.rs rename to src/test/run-pass/issues/issue-9188.rs diff --git a/src/test/ui/run-pass/issues/issue-9243.rs b/src/test/run-pass/issues/issue-9243.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-9243.rs rename to src/test/run-pass/issues/issue-9243.rs index 957330a1925b..f079268d6e10 100644 --- a/src/test/ui/run-pass/issues/issue-9243.rs +++ b/src/test/run-pass/issues/issue-9243.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for issue 9243 #![allow(non_upper_case_globals)] diff --git a/src/test/ui/run-pass/issues/issue-9249.rs b/src/test/run-pass/issues/issue-9249.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue-9249.rs rename to src/test/run-pass/issues/issue-9249.rs index d11665c531e9..eb66c565a78c 100644 --- a/src/test/ui/run-pass/issues/issue-9249.rs +++ b/src/test/run-pass/issues/issue-9249.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 static DATA:&'static [&'static str] = &["my string"]; diff --git a/src/test/ui/run-pass/issues/issue-9259.rs b/src/test/run-pass/issues/issue-9259.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-9259.rs rename to src/test/run-pass/issues/issue-9259.rs index 481014fe3f35..7f93f5a8ab3b 100644 --- a/src/test/ui/run-pass/issues/issue-9259.rs +++ b/src/test/run-pass/issues/issue-9259.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct A<'a> { a: &'a [String], diff --git a/src/test/ui/run-pass/issues/issue-9382.rs b/src/test/run-pass/issues/issue-9382.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-9382.rs rename to src/test/run-pass/issues/issue-9382.rs index 6a4f868cdf12..9ae26d638ffb 100644 --- a/src/test/ui/run-pass/issues/issue-9382.rs +++ b/src/test/run-pass/issues/issue-9382.rs @@ -11,6 +11,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] // Tests for a previous bug that occurred due to an interaction diff --git a/src/test/ui/run-pass/issues/issue-9394-inherited-trait-calls.rs b/src/test/run-pass/issues/issue-9394-inherited-trait-calls.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9394-inherited-trait-calls.rs rename to src/test/run-pass/issues/issue-9394-inherited-trait-calls.rs diff --git a/src/test/ui/run-pass/issues/issue-9396.rs b/src/test/run-pass/issues/issue-9396.rs similarity index 97% rename from src/test/ui/run-pass/issues/issue-9396.rs rename to src/test/run-pass/issues/issue-9396.rs index 62a38767ddd0..db717e3c99af 100644 --- a/src/test/ui/run-pass/issues/issue-9396.rs +++ b/src/test/run-pass/issues/issue-9396.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] #![allow(deprecated)] // ignore-emscripten no threads support diff --git a/src/test/ui/run-pass/issues/issue-9446.rs b/src/test/run-pass/issues/issue-9446.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9446.rs rename to src/test/run-pass/issues/issue-9446.rs diff --git a/src/test/ui/run-pass/issues/issue-9719.rs b/src/test/run-pass/issues/issue-9719.rs similarity index 98% rename from src/test/ui/run-pass/issues/issue-9719.rs rename to src/test/run-pass/issues/issue-9719.rs index 1e52f326c1f6..f98eba1cfdf8 100644 --- a/src/test/ui/run-pass/issues/issue-9719.rs +++ b/src/test/run-pass/issues/issue-9719.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod a { diff --git a/src/test/ui/run-pass/issues/issue-9737.rs b/src/test/run-pass/issues/issue-9737.rs similarity index 95% rename from src/test/ui/run-pass/issues/issue-9737.rs rename to src/test/run-pass/issues/issue-9737.rs index 304eb7808a74..b74acf5d8163 100644 --- a/src/test/ui/run-pass/issues/issue-9737.rs +++ b/src/test/run-pass/issues/issue-9737.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] macro_rules! f { (v: $x:expr) => ( println!("{}", $x) ) } diff --git a/src/test/ui/run-pass/issues/issue-979.rs b/src/test/run-pass/issues/issue-979.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-979.rs rename to src/test/run-pass/issues/issue-979.rs diff --git a/src/test/ui/run-pass/issues/issue-9837.rs b/src/test/run-pass/issues/issue-9837.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9837.rs rename to src/test/run-pass/issues/issue-9837.rs diff --git a/src/test/ui/run-pass/issues/issue-9906.rs b/src/test/run-pass/issues/issue-9906.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9906.rs rename to src/test/run-pass/issues/issue-9906.rs diff --git a/src/test/ui/run-pass/issues/issue-9918.rs b/src/test/run-pass/issues/issue-9918.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9918.rs rename to src/test/run-pass/issues/issue-9918.rs diff --git a/src/test/ui/run-pass/issues/issue-9942.rs b/src/test/run-pass/issues/issue-9942.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9942.rs rename to src/test/run-pass/issues/issue-9942.rs diff --git a/src/test/ui/run-pass/issues/issue-9951.rs b/src/test/run-pass/issues/issue-9951.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9951.rs rename to src/test/run-pass/issues/issue-9951.rs diff --git a/src/test/ui/run-pass/issues/issue-9968.rs b/src/test/run-pass/issues/issue-9968.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue-9968.rs rename to src/test/run-pass/issues/issue-9968.rs diff --git a/src/test/ui/run-pass/issues/issue2170exe.rs b/src/test/run-pass/issues/issue2170exe.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue2170exe.rs rename to src/test/run-pass/issues/issue2170exe.rs diff --git a/src/test/ui/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_lib.rs b/src/test/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_lib.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_lib.rs rename to src/test/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_lib.rs diff --git a/src/test/ui/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_mbcs_in_comments.rs b/src/test/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_mbcs_in_comments.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_mbcs_in_comments.rs rename to src/test/run-pass/issues/issue24687-embed-debuginfo/auxiliary/issue24687_mbcs_in_comments.rs diff --git a/src/test/ui/run-pass/issues/issue24687-embed-debuginfo/main.rs b/src/test/run-pass/issues/issue24687-embed-debuginfo/main.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue24687-embed-debuginfo/main.rs rename to src/test/run-pass/issues/issue24687-embed-debuginfo/main.rs diff --git a/src/test/ui/run-pass/issues/issue28498-must-work-ex1.rs b/src/test/run-pass/issues/issue28498-must-work-ex1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-must-work-ex1.rs rename to src/test/run-pass/issues/issue28498-must-work-ex1.rs diff --git a/src/test/ui/run-pass/issues/issue28498-must-work-ex2.rs b/src/test/run-pass/issues/issue28498-must-work-ex2.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-must-work-ex2.rs rename to src/test/run-pass/issues/issue28498-must-work-ex2.rs diff --git a/src/test/ui/run-pass/issues/issue28498-ugeh-ex1.rs b/src/test/run-pass/issues/issue28498-ugeh-ex1.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-ugeh-ex1.rs rename to src/test/run-pass/issues/issue28498-ugeh-ex1.rs diff --git a/src/test/ui/run-pass/issues/issue28498-ugeh-with-lifetime-param.rs b/src/test/run-pass/issues/issue28498-ugeh-with-lifetime-param.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-ugeh-with-lifetime-param.rs rename to src/test/run-pass/issues/issue28498-ugeh-with-lifetime-param.rs diff --git a/src/test/ui/run-pass/issues/issue28498-ugeh-with-passed-to-fn.rs b/src/test/run-pass/issues/issue28498-ugeh-with-passed-to-fn.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-ugeh-with-passed-to-fn.rs rename to src/test/run-pass/issues/issue28498-ugeh-with-passed-to-fn.rs diff --git a/src/test/ui/run-pass/issues/issue28498-ugeh-with-trait-bound.rs b/src/test/run-pass/issues/issue28498-ugeh-with-trait-bound.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue28498-ugeh-with-trait-bound.rs rename to src/test/run-pass/issues/issue28498-ugeh-with-trait-bound.rs diff --git a/src/test/ui/run-pass/issues/issue29927-1.rs b/src/test/run-pass/issues/issue29927-1.rs similarity index 96% rename from src/test/ui/run-pass/issues/issue29927-1.rs rename to src/test/run-pass/issues/issue29927-1.rs index c613560aff12..e33329092067 100644 --- a/src/test/ui/run-pass/issues/issue29927-1.rs +++ b/src/test/run-pass/issues/issue29927-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(min_const_fn)] const fn f() -> usize { 5 diff --git a/src/test/ui/run-pass/issues/issue_26873_multifile/A/B.rs b/src/test/run-pass/issues/issue_26873_multifile/A/B.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_26873_multifile/A/B.rs rename to src/test/run-pass/issues/issue_26873_multifile/A/B.rs diff --git a/src/test/ui/run-pass/issues/issue_26873_multifile/A/C.rs b/src/test/run-pass/issues/issue_26873_multifile/A/C.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_26873_multifile/A/C.rs rename to src/test/run-pass/issues/issue_26873_multifile/A/C.rs diff --git a/src/test/ui/run-pass/issues/issue_26873_multifile/A/mod.rs b/src/test/run-pass/issues/issue_26873_multifile/A/mod.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_26873_multifile/A/mod.rs rename to src/test/run-pass/issues/issue_26873_multifile/A/mod.rs diff --git a/src/test/ui/run-pass/issues/issue_26873_multifile/compiletest-ignore-dir b/src/test/run-pass/issues/issue_26873_multifile/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/issues/issue_26873_multifile/compiletest-ignore-dir rename to src/test/run-pass/issues/issue_26873_multifile/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/issues/issue_26873_multifile/mod.rs b/src/test/run-pass/issues/issue_26873_multifile/mod.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_26873_multifile/mod.rs rename to src/test/run-pass/issues/issue_26873_multifile/mod.rs diff --git a/src/test/ui/run-pass/issues/issue_3136_b.rs b/src/test/run-pass/issues/issue_3136_b.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_3136_b.rs rename to src/test/run-pass/issues/issue_3136_b.rs diff --git a/src/test/ui/run-pass/issues/issue_9155.rs b/src/test/run-pass/issues/issue_9155.rs similarity index 100% rename from src/test/ui/run-pass/issues/issue_9155.rs rename to src/test/run-pass/issues/issue_9155.rs diff --git a/src/test/ui/run-pass/iterators/into-iterator-type-inference-shift.rs b/src/test/run-pass/iterators/into-iterator-type-inference-shift.rs similarity index 92% rename from src/test/ui/run-pass/iterators/into-iterator-type-inference-shift.rs rename to src/test/run-pass/iterators/into-iterator-type-inference-shift.rs index 0043c1bc829c..bb51b2519d6b 100644 --- a/src/test/ui/run-pass/iterators/into-iterator-type-inference-shift.rs +++ b/src/test/run-pass/iterators/into-iterator-type-inference-shift.rs @@ -9,6 +9,10 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_variables)] // Regression test for type inference failure around shifting. In this // case, the iteration yields an isize, but we hadn't run the full type // propagation yet, and so we just saw a type variable, yielding an diff --git a/src/test/ui/run-pass/iterators/iter-cloned-type-inference.rs b/src/test/run-pass/iterators/iter-cloned-type-inference.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-cloned-type-inference.rs rename to src/test/run-pass/iterators/iter-cloned-type-inference.rs diff --git a/src/test/ui/run-pass/iterators/iter-range.rs b/src/test/run-pass/iterators/iter-range.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-range.rs rename to src/test/run-pass/iterators/iter-range.rs diff --git a/src/test/ui/run-pass/iterators/iter-step-overflow-debug.rs b/src/test/run-pass/iterators/iter-step-overflow-debug.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-step-overflow-debug.rs rename to src/test/run-pass/iterators/iter-step-overflow-debug.rs diff --git a/src/test/ui/run-pass/iterators/iter-step-overflow-ndebug.rs b/src/test/run-pass/iterators/iter-step-overflow-ndebug.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-step-overflow-ndebug.rs rename to src/test/run-pass/iterators/iter-step-overflow-ndebug.rs diff --git a/src/test/ui/run-pass/iterators/iter-sum-overflow-debug.rs b/src/test/run-pass/iterators/iter-sum-overflow-debug.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-sum-overflow-debug.rs rename to src/test/run-pass/iterators/iter-sum-overflow-debug.rs diff --git a/src/test/ui/run-pass/iterators/iter-sum-overflow-ndebug.rs b/src/test/run-pass/iterators/iter-sum-overflow-ndebug.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-sum-overflow-ndebug.rs rename to src/test/run-pass/iterators/iter-sum-overflow-ndebug.rs diff --git a/src/test/ui/run-pass/iterators/iter-sum-overflow-overflow-checks.rs b/src/test/run-pass/iterators/iter-sum-overflow-overflow-checks.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-sum-overflow-overflow-checks.rs rename to src/test/run-pass/iterators/iter-sum-overflow-overflow-checks.rs diff --git a/src/test/ui/run-pass/iterators/iter-zip.rs b/src/test/run-pass/iterators/iter-zip.rs similarity index 100% rename from src/test/ui/run-pass/iterators/iter-zip.rs rename to src/test/run-pass/iterators/iter-zip.rs diff --git a/src/test/ui/run-pass/macros/assert-eq-macro-success.rs b/src/test/run-pass/macros/assert-eq-macro-success.rs similarity index 100% rename from src/test/ui/run-pass/macros/assert-eq-macro-success.rs rename to src/test/run-pass/macros/assert-eq-macro-success.rs diff --git a/src/test/ui/run-pass/macros/assert-eq-macro-unsized.rs b/src/test/run-pass/macros/assert-eq-macro-unsized.rs similarity index 100% rename from src/test/ui/run-pass/macros/assert-eq-macro-unsized.rs rename to src/test/run-pass/macros/assert-eq-macro-unsized.rs diff --git a/src/test/ui/run-pass/macros/assert-ne-macro-success.rs b/src/test/run-pass/macros/assert-ne-macro-success.rs similarity index 100% rename from src/test/ui/run-pass/macros/assert-ne-macro-success.rs rename to src/test/run-pass/macros/assert-ne-macro-success.rs diff --git a/src/test/ui/run-pass/macros/assert-ne-macro-unsized.rs b/src/test/run-pass/macros/assert-ne-macro-unsized.rs similarity index 100% rename from src/test/ui/run-pass/macros/assert-ne-macro-unsized.rs rename to src/test/run-pass/macros/assert-ne-macro-unsized.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro-comma-support.rs b/src/test/run-pass/macros/auxiliary/macro-comma-support.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro-comma-support.rs rename to src/test/run-pass/macros/auxiliary/macro-comma-support.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro-include-items-expr.rs b/src/test/run-pass/macros/auxiliary/macro-include-items-expr.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro-include-items-expr.rs rename to src/test/run-pass/macros/auxiliary/macro-include-items-expr.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro-include-items-item.rs b/src/test/run-pass/macros/auxiliary/macro-include-items-item.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro-include-items-item.rs rename to src/test/run-pass/macros/auxiliary/macro-include-items-item.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro_crate_def_only.rs b/src/test/run-pass/macros/auxiliary/macro_crate_def_only.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro_crate_def_only.rs rename to src/test/run-pass/macros/auxiliary/macro_crate_def_only.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro_crate_nonterminal.rs b/src/test/run-pass/macros/auxiliary/macro_crate_nonterminal.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro_crate_nonterminal.rs rename to src/test/run-pass/macros/auxiliary/macro_crate_nonterminal.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro_export_inner_module.rs b/src/test/run-pass/macros/auxiliary/macro_export_inner_module.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro_export_inner_module.rs rename to src/test/run-pass/macros/auxiliary/macro_export_inner_module.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/macro_with_super_1.rs b/src/test/run-pass/macros/auxiliary/macro_with_super_1.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/macro_with_super_1.rs rename to src/test/run-pass/macros/auxiliary/macro_with_super_1.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/two_macros.rs b/src/test/run-pass/macros/auxiliary/two_macros.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/two_macros.rs rename to src/test/run-pass/macros/auxiliary/two_macros.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/unstable-macros.rs b/src/test/run-pass/macros/auxiliary/unstable-macros.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/unstable-macros.rs rename to src/test/run-pass/macros/auxiliary/unstable-macros.rs diff --git a/src/test/ui/run-pass/macros/auxiliary/use-macro-self.rs b/src/test/run-pass/macros/auxiliary/use-macro-self.rs similarity index 100% rename from src/test/ui/run-pass/macros/auxiliary/use-macro-self.rs rename to src/test/run-pass/macros/auxiliary/use-macro-self.rs diff --git a/src/test/ui/run-pass/macros/colorful-write-macros.rs b/src/test/run-pass/macros/colorful-write-macros.rs similarity index 98% rename from src/test/ui/run-pass/macros/colorful-write-macros.rs rename to src/test/run-pass/macros/colorful-write-macros.rs index 37eaf2e8cde6..7c557eb2bd07 100644 --- a/src/test/ui/run-pass/macros/colorful-write-macros.rs +++ b/src/test/run-pass/macros/colorful-write-macros.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::io::Write; use std::fmt; diff --git a/src/test/ui/run-pass/macros/conditional-debug-macro-on.rs b/src/test/run-pass/macros/conditional-debug-macro-on.rs similarity index 100% rename from src/test/ui/run-pass/macros/conditional-debug-macro-on.rs rename to src/test/run-pass/macros/conditional-debug-macro-on.rs diff --git a/src/test/ui/run-pass/macros/die-macro.rs b/src/test/run-pass/macros/die-macro.rs similarity index 96% rename from src/test/ui/run-pass/macros/die-macro.rs rename to src/test/run-pass/macros/die-macro.rs index 65ba591404bd..26b339550cc9 100644 --- a/src/test/ui/run-pass/macros/die-macro.rs +++ b/src/test/run-pass/macros/die-macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Just testing that panic!() type checks in statement or expr diff --git a/src/test/ui/run-pass/macros/log_syntax-trace_macros-macro-locations.rs b/src/test/run-pass/macros/log_syntax-trace_macros-macro-locations.rs similarity index 100% rename from src/test/ui/run-pass/macros/log_syntax-trace_macros-macro-locations.rs rename to src/test/run-pass/macros/log_syntax-trace_macros-macro-locations.rs diff --git a/src/test/ui/run-pass/macros/log_syntax-trace_macros-macro-locations.stdout b/src/test/run-pass/macros/log_syntax-trace_macros-macro-locations.stdout similarity index 100% rename from src/test/ui/run-pass/macros/log_syntax-trace_macros-macro-locations.stdout rename to src/test/run-pass/macros/log_syntax-trace_macros-macro-locations.stdout diff --git a/src/test/ui/run-pass/macros/macro-2.rs b/src/test/run-pass/macros/macro-2.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-2.rs rename to src/test/run-pass/macros/macro-2.rs diff --git a/src/test/ui/run-pass/macros/macro-at-most-once-rep.rs b/src/test/run-pass/macros/macro-at-most-once-rep.rs similarity index 98% rename from src/test/ui/run-pass/macros/macro-at-most-once-rep.rs rename to src/test/run-pass/macros/macro-at-most-once-rep.rs index 3625e0e7efa2..c7129423cb65 100644 --- a/src/test/ui/run-pass/macros/macro-at-most-once-rep.rs +++ b/src/test/run-pass/macros/macro-at-most-once-rep.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // The logic for parsing Kleene operators in macros has a special case to disambiguate `?`. // Specifically, `$(pat)?` is the ZeroOrOne operator whereas `$(pat)?+` or `$(pat)?*` are the // ZeroOrMore and OneOrMore operators using `?` as a separator. These tests are intended to diff --git a/src/test/ui/run-pass/macros/macro-attribute-expansion.rs b/src/test/run-pass/macros/macro-attribute-expansion.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-attribute-expansion.rs rename to src/test/run-pass/macros/macro-attribute-expansion.rs diff --git a/src/test/ui/run-pass/macros/macro-attributes.rs b/src/test/run-pass/macros/macro-attributes.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-attributes.rs rename to src/test/run-pass/macros/macro-attributes.rs diff --git a/src/test/ui/run-pass/macros/macro-block-nonterminal.rs b/src/test/run-pass/macros/macro-block-nonterminal.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-block-nonterminal.rs rename to src/test/run-pass/macros/macro-block-nonterminal.rs diff --git a/src/test/ui/run-pass/macros/macro-comma-behavior.rs b/src/test/run-pass/macros/macro-comma-behavior.rs similarity index 99% rename from src/test/ui/run-pass/macros/macro-comma-behavior.rs rename to src/test/run-pass/macros/macro-comma-behavior.rs index bfa32817b100..95774cad229a 100644 --- a/src/test/ui/run-pass/macros/macro-comma-behavior.rs +++ b/src/test/run-pass/macros/macro-comma-behavior.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Ideally, any macro call with a trailing comma should behave // identically to a call without the comma. // diff --git a/src/test/ui/run-pass/macros/macro-comma-support.rs b/src/test/run-pass/macros/macro-comma-support.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-comma-support.rs rename to src/test/run-pass/macros/macro-comma-support.rs diff --git a/src/test/ui/run-pass/macros/macro-crate-def-only.rs b/src/test/run-pass/macros/macro-crate-def-only.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-crate-def-only.rs rename to src/test/run-pass/macros/macro-crate-def-only.rs diff --git a/src/test/ui/run-pass/macros/macro-crate-nonterminal-renamed.rs b/src/test/run-pass/macros/macro-crate-nonterminal-renamed.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-crate-nonterminal-renamed.rs rename to src/test/run-pass/macros/macro-crate-nonterminal-renamed.rs diff --git a/src/test/ui/run-pass/macros/macro-crate-nonterminal.rs b/src/test/run-pass/macros/macro-crate-nonterminal.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-crate-nonterminal.rs rename to src/test/run-pass/macros/macro-crate-nonterminal.rs diff --git a/src/test/ui/run-pass/macros/macro-crate-use.rs b/src/test/run-pass/macros/macro-crate-use.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-crate-use.rs rename to src/test/run-pass/macros/macro-crate-use.rs diff --git a/src/test/ui/run-pass/macros/macro-deep_expansion.rs b/src/test/run-pass/macros/macro-deep_expansion.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-deep_expansion.rs rename to src/test/run-pass/macros/macro-deep_expansion.rs diff --git a/src/test/ui/run-pass/macros/macro-delimiter-significance.rs b/src/test/run-pass/macros/macro-delimiter-significance.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-delimiter-significance.rs rename to src/test/run-pass/macros/macro-delimiter-significance.rs diff --git a/src/test/ui/run-pass/macros/macro-doc-comments.rs b/src/test/run-pass/macros/macro-doc-comments.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-doc-comments.rs rename to src/test/run-pass/macros/macro-doc-comments.rs diff --git a/src/test/ui/run-pass/macros/macro-doc-escapes.rs b/src/test/run-pass/macros/macro-doc-escapes.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-doc-escapes.rs rename to src/test/run-pass/macros/macro-doc-escapes.rs diff --git a/src/test/ui/run-pass/macros/macro-doc-raw-str-hashes.rs b/src/test/run-pass/macros/macro-doc-raw-str-hashes.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-doc-raw-str-hashes.rs rename to src/test/run-pass/macros/macro-doc-raw-str-hashes.rs diff --git a/src/test/ui/run-pass/macros/macro-export-inner-module.rs b/src/test/run-pass/macros/macro-export-inner-module.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-export-inner-module.rs rename to src/test/run-pass/macros/macro-export-inner-module.rs diff --git a/src/test/ui/run-pass/macros/macro-first-set.rs b/src/test/run-pass/macros/macro-first-set.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-first-set.rs rename to src/test/run-pass/macros/macro-first-set.rs diff --git a/src/test/ui/run-pass/macros/macro-follow.rs b/src/test/run-pass/macros/macro-follow.rs similarity index 99% rename from src/test/ui/run-pass/macros/macro-follow.rs rename to src/test/run-pass/macros/macro-follow.rs index 2cb2e43fd658..89a51827d7e7 100644 --- a/src/test/ui/run-pass/macros/macro-follow.rs +++ b/src/test/run-pass/macros/macro-follow.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] // Check the macro follow sets (see corresponding cfail test). // FOLLOW(pat) = {FatArrow, Comma, Eq, Or, Ident(if), Ident(in)} diff --git a/src/test/ui/run-pass/macros/macro-followed-by-seq.rs b/src/test/run-pass/macros/macro-followed-by-seq.rs similarity index 96% rename from src/test/ui/run-pass/macros/macro-followed-by-seq.rs rename to src/test/run-pass/macros/macro-followed-by-seq.rs index 8b7961876646..157382303339 100644 --- a/src/test/ui/run-pass/macros/macro-followed-by-seq.rs +++ b/src/test/run-pass/macros/macro-followed-by-seq.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] // Regression test for issue #25436: check that things which can be // followed by any token also permit X* to come afterwards. diff --git a/src/test/ui/run-pass/macros/macro-include-items.rs b/src/test/run-pass/macros/macro-include-items.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-include-items.rs rename to src/test/run-pass/macros/macro-include-items.rs diff --git a/src/test/ui/run-pass/macros/macro-interpolation.rs b/src/test/run-pass/macros/macro-interpolation.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-interpolation.rs rename to src/test/run-pass/macros/macro-interpolation.rs diff --git a/src/test/ui/run-pass/macros/macro-invocation-in-count-expr-fixed-array-type.rs b/src/test/run-pass/macros/macro-invocation-in-count-expr-fixed-array-type.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-invocation-in-count-expr-fixed-array-type.rs rename to src/test/run-pass/macros/macro-invocation-in-count-expr-fixed-array-type.rs diff --git a/src/test/ui/run-pass/macros/macro-lifetime-used-with-bound.rs b/src/test/run-pass/macros/macro-lifetime-used-with-bound.rs similarity index 96% rename from src/test/ui/run-pass/macros/macro-lifetime-used-with-bound.rs rename to src/test/run-pass/macros/macro-lifetime-used-with-bound.rs index eadef9803772..31170a74164d 100644 --- a/src/test/ui/run-pass/macros/macro-lifetime-used-with-bound.rs +++ b/src/test/run-pass/macros/macro-lifetime-used-with-bound.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] macro_rules! foo { ($l:lifetime, $l2:lifetime) => { fn f<$l: $l2, $l2>(arg: &$l str, arg2: &$l2 str) -> &$l str { diff --git a/src/test/ui/run-pass/macros/macro-lifetime-used-with-labels.rs b/src/test/run-pass/macros/macro-lifetime-used-with-labels.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-lifetime-used-with-labels.rs rename to src/test/run-pass/macros/macro-lifetime-used-with-labels.rs diff --git a/src/test/ui/run-pass/macros/macro-lifetime-used-with-labels.stderr b/src/test/run-pass/macros/macro-lifetime-used-with-labels.stderr similarity index 100% rename from src/test/ui/run-pass/macros/macro-lifetime-used-with-labels.stderr rename to src/test/run-pass/macros/macro-lifetime-used-with-labels.stderr diff --git a/src/test/ui/run-pass/macros/macro-lifetime-used-with-static.rs b/src/test/run-pass/macros/macro-lifetime-used-with-static.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-lifetime-used-with-static.rs rename to src/test/run-pass/macros/macro-lifetime-used-with-static.rs diff --git a/src/test/ui/run-pass/macros/macro-lifetime.rs b/src/test/run-pass/macros/macro-lifetime.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-lifetime.rs rename to src/test/run-pass/macros/macro-lifetime.rs diff --git a/src/test/ui/run-pass/macros/macro-literal.rs b/src/test/run-pass/macros/macro-literal.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-literal.rs rename to src/test/run-pass/macros/macro-literal.rs diff --git a/src/test/ui/run-pass/macros/macro-meta-items.rs b/src/test/run-pass/macros/macro-meta-items.rs similarity index 97% rename from src/test/ui/run-pass/macros/macro-meta-items.rs rename to src/test/run-pass/macros/macro-meta-items.rs index d19c33b2e3a2..68f1eae969e8 100644 --- a/src/test/ui/run-pass/macros/macro-meta-items.rs +++ b/src/test/run-pass/macros/macro-meta-items.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // compile-flags: --cfg foo macro_rules! compiles_fine { diff --git a/src/test/ui/run-pass/macros/macro-method-issue-4621.rs b/src/test/run-pass/macros/macro-method-issue-4621.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-method-issue-4621.rs rename to src/test/run-pass/macros/macro-method-issue-4621.rs diff --git a/src/test/ui/run-pass/macros/macro-multiple-items.rs b/src/test/run-pass/macros/macro-multiple-items.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-multiple-items.rs rename to src/test/run-pass/macros/macro-multiple-items.rs diff --git a/src/test/ui/run-pass/macros/macro-named-default.rs b/src/test/run-pass/macros/macro-named-default.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-named-default.rs rename to src/test/run-pass/macros/macro-named-default.rs diff --git a/src/test/ui/run-pass/macros/macro-nested_definition_issue-31946.rs b/src/test/run-pass/macros/macro-nested_definition_issue-31946.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-nested_definition_issue-31946.rs rename to src/test/run-pass/macros/macro-nested_definition_issue-31946.rs diff --git a/src/test/ui/run-pass/macros/macro-nested_expr.rs b/src/test/run-pass/macros/macro-nested_expr.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-nested_expr.rs rename to src/test/run-pass/macros/macro-nested_expr.rs diff --git a/src/test/ui/run-pass/macros/macro-nested_stmt_macros.rs b/src/test/run-pass/macros/macro-nested_stmt_macros.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-nested_stmt_macros.rs rename to src/test/run-pass/macros/macro-nested_stmt_macros.rs diff --git a/src/test/ui/run-pass/macros/macro-nt-list.rs b/src/test/run-pass/macros/macro-nt-list.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-nt-list.rs rename to src/test/run-pass/macros/macro-nt-list.rs diff --git a/src/test/ui/run-pass/macros/macro-of-higher-order.rs b/src/test/run-pass/macros/macro-of-higher-order.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-of-higher-order.rs rename to src/test/run-pass/macros/macro-of-higher-order.rs diff --git a/src/test/ui/run-pass/macros/macro-pat-follow.rs b/src/test/run-pass/macros/macro-pat-follow.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-pat-follow.rs rename to src/test/run-pass/macros/macro-pat-follow.rs diff --git a/src/test/ui/run-pass/macros/macro-pat-neg-lit.rs b/src/test/run-pass/macros/macro-pat-neg-lit.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-pat-neg-lit.rs rename to src/test/run-pass/macros/macro-pat-neg-lit.rs diff --git a/src/test/ui/run-pass/macros/macro-pat.rs b/src/test/run-pass/macros/macro-pat.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-pat.rs rename to src/test/run-pass/macros/macro-pat.rs diff --git a/src/test/ui/run-pass/macros/macro-path.rs b/src/test/run-pass/macros/macro-path.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-path.rs rename to src/test/run-pass/macros/macro-path.rs diff --git a/src/test/ui/run-pass/macros/macro-pub-matcher.rs b/src/test/run-pass/macros/macro-pub-matcher.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-pub-matcher.rs rename to src/test/run-pass/macros/macro-pub-matcher.rs diff --git a/src/test/ui/run-pass/macros/macro-seq-followed-by-seq.rs b/src/test/run-pass/macros/macro-seq-followed-by-seq.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-seq-followed-by-seq.rs rename to src/test/run-pass/macros/macro-seq-followed-by-seq.rs diff --git a/src/test/ui/run-pass/macros/macro-stability.rs b/src/test/run-pass/macros/macro-stability.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-stability.rs rename to src/test/run-pass/macros/macro-stability.rs diff --git a/src/test/ui/run-pass/macros/macro-stmt.rs b/src/test/run-pass/macros/macro-stmt.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-stmt.rs rename to src/test/run-pass/macros/macro-stmt.rs diff --git a/src/test/ui/run-pass/macros/macro-stmt_macro_in_expr_macro.rs b/src/test/run-pass/macros/macro-stmt_macro_in_expr_macro.rs similarity index 97% rename from src/test/ui/run-pass/macros/macro-stmt_macro_in_expr_macro.rs rename to src/test/run-pass/macros/macro-stmt_macro_in_expr_macro.rs index 22e983dd9cef..9b197eb29020 100644 --- a/src/test/ui/run-pass/macros/macro-stmt_macro_in_expr_macro.rs +++ b/src/test/run-pass/macros/macro-stmt_macro_in_expr_macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] macro_rules! foo { () => { struct Bar; diff --git a/src/test/ui/run-pass/macros/macro-tt-followed-by-seq.rs b/src/test/run-pass/macros/macro-tt-followed-by-seq.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-tt-followed-by-seq.rs rename to src/test/run-pass/macros/macro-tt-followed-by-seq.rs diff --git a/src/test/ui/run-pass/macros/macro-use-all-and-none.rs b/src/test/run-pass/macros/macro-use-all-and-none.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-use-all-and-none.rs rename to src/test/run-pass/macros/macro-use-all-and-none.rs diff --git a/src/test/ui/run-pass/macros/macro-use-all.rs b/src/test/run-pass/macros/macro-use-all.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-use-all.rs rename to src/test/run-pass/macros/macro-use-all.rs diff --git a/src/test/ui/run-pass/macros/macro-use-both.rs b/src/test/run-pass/macros/macro-use-both.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-use-both.rs rename to src/test/run-pass/macros/macro-use-both.rs diff --git a/src/test/ui/run-pass/macros/macro-use-one.rs b/src/test/run-pass/macros/macro-use-one.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-use-one.rs rename to src/test/run-pass/macros/macro-use-one.rs diff --git a/src/test/ui/run-pass/macros/macro-with-attrs1.rs b/src/test/run-pass/macros/macro-with-attrs1.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-with-attrs1.rs rename to src/test/run-pass/macros/macro-with-attrs1.rs diff --git a/src/test/ui/run-pass/macros/macro-with-attrs2.rs b/src/test/run-pass/macros/macro-with-attrs2.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro-with-attrs2.rs rename to src/test/run-pass/macros/macro-with-attrs2.rs diff --git a/src/test/ui/run-pass/macros/macro-with-braces-in-expr-position.rs b/src/test/run-pass/macros/macro-with-braces-in-expr-position.rs similarity index 96% rename from src/test/ui/run-pass/macros/macro-with-braces-in-expr-position.rs rename to src/test/run-pass/macros/macro-with-braces-in-expr-position.rs index 830ec620fcae..8524f047a0bc 100644 --- a/src/test/ui/run-pass/macros/macro-with-braces-in-expr-position.rs +++ b/src/test/run-pass/macros/macro-with-braces-in-expr-position.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/macros/macro_with_super_2.rs b/src/test/run-pass/macros/macro_with_super_2.rs similarity index 100% rename from src/test/ui/run-pass/macros/macro_with_super_2.rs rename to src/test/run-pass/macros/macro_with_super_2.rs diff --git a/src/test/ui/run-pass/macros/macros-in-extern.rs b/src/test/run-pass/macros/macros-in-extern.rs similarity index 100% rename from src/test/ui/run-pass/macros/macros-in-extern.rs rename to src/test/run-pass/macros/macros-in-extern.rs diff --git a/src/test/ui/run-pass/macros/parse-complex-macro-invoc-op.rs b/src/test/run-pass/macros/parse-complex-macro-invoc-op.rs similarity index 90% rename from src/test/ui/run-pass/macros/parse-complex-macro-invoc-op.rs rename to src/test/run-pass/macros/parse-complex-macro-invoc-op.rs index f0431b925702..4ec211058824 100644 --- a/src/test/ui/run-pass/macros/parse-complex-macro-invoc-op.rs +++ b/src/test/run-pass/macros/parse-complex-macro-invoc-op.rs @@ -9,6 +9,10 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_assignments)] +#![allow(unused_variables)] #![allow(stable_features)] // Test parsing binary operators after macro invocations. diff --git a/src/test/ui/run-pass/macros/paths-in-macro-invocations.rs b/src/test/run-pass/macros/paths-in-macro-invocations.rs similarity index 97% rename from src/test/ui/run-pass/macros/paths-in-macro-invocations.rs rename to src/test/run-pass/macros/paths-in-macro-invocations.rs index 358c97d468b9..121a02226fec 100644 --- a/src/test/ui/run-pass/macros/paths-in-macro-invocations.rs +++ b/src/test/run-pass/macros/paths-in-macro-invocations.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:two_macros.rs extern crate two_macros; diff --git a/src/test/ui/run-pass/macros/pub-item-inside-macro.rs b/src/test/run-pass/macros/pub-item-inside-macro.rs similarity index 100% rename from src/test/ui/run-pass/macros/pub-item-inside-macro.rs rename to src/test/run-pass/macros/pub-item-inside-macro.rs diff --git a/src/test/ui/run-pass/macros/pub-method-inside-macro.rs b/src/test/run-pass/macros/pub-method-inside-macro.rs similarity index 100% rename from src/test/ui/run-pass/macros/pub-method-inside-macro.rs rename to src/test/run-pass/macros/pub-method-inside-macro.rs diff --git a/src/test/ui/run-pass/macros/semi-after-macro-ty.rs b/src/test/run-pass/macros/semi-after-macro-ty.rs similarity index 100% rename from src/test/ui/run-pass/macros/semi-after-macro-ty.rs rename to src/test/run-pass/macros/semi-after-macro-ty.rs diff --git a/src/test/ui/run-pass/macros/stmt_expr_attr_macro_parse.rs b/src/test/run-pass/macros/stmt_expr_attr_macro_parse.rs similarity index 100% rename from src/test/ui/run-pass/macros/stmt_expr_attr_macro_parse.rs rename to src/test/run-pass/macros/stmt_expr_attr_macro_parse.rs diff --git a/src/test/ui/run-pass/macros/syntax-extension-cfg.rs b/src/test/run-pass/macros/syntax-extension-cfg.rs similarity index 100% rename from src/test/ui/run-pass/macros/syntax-extension-cfg.rs rename to src/test/run-pass/macros/syntax-extension-cfg.rs diff --git a/src/test/ui/run-pass/macros/syntax-extension-source-utils-files/includeme.fragment b/src/test/run-pass/macros/syntax-extension-source-utils-files/includeme.fragment similarity index 100% rename from src/test/ui/run-pass/macros/syntax-extension-source-utils-files/includeme.fragment rename to src/test/run-pass/macros/syntax-extension-source-utils-files/includeme.fragment diff --git a/src/test/ui/run-pass/macros/syntax-extension-source-utils.rs b/src/test/run-pass/macros/syntax-extension-source-utils.rs similarity index 100% rename from src/test/ui/run-pass/macros/syntax-extension-source-utils.rs rename to src/test/run-pass/macros/syntax-extension-source-utils.rs diff --git a/src/test/ui/run-pass/macros/try-macro.rs b/src/test/run-pass/macros/try-macro.rs similarity index 100% rename from src/test/ui/run-pass/macros/try-macro.rs rename to src/test/run-pass/macros/try-macro.rs diff --git a/src/test/ui/run-pass/macros/two-macro-use.rs b/src/test/run-pass/macros/two-macro-use.rs similarity index 100% rename from src/test/ui/run-pass/macros/two-macro-use.rs rename to src/test/run-pass/macros/two-macro-use.rs diff --git a/src/test/ui/run-pass/macros/type-macros-hlist.rs b/src/test/run-pass/macros/type-macros-hlist.rs similarity index 100% rename from src/test/ui/run-pass/macros/type-macros-hlist.rs rename to src/test/run-pass/macros/type-macros-hlist.rs diff --git a/src/test/ui/run-pass/macros/type-macros-simple.rs b/src/test/run-pass/macros/type-macros-simple.rs similarity index 95% rename from src/test/ui/run-pass/macros/type-macros-simple.rs rename to src/test/run-pass/macros/type-macros-simple.rs index 8f091ec192b6..176e9a635c80 100644 --- a/src/test/ui/run-pass/macros/type-macros-simple.rs +++ b/src/test/run-pass/macros/type-macros-simple.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] macro_rules! Tuple { { $A:ty,$B:ty } => { ($A, $B) } } diff --git a/src/test/ui/run-pass/macros/typeck-macro-interaction-issue-8852.rs b/src/test/run-pass/macros/typeck-macro-interaction-issue-8852.rs similarity index 98% rename from src/test/ui/run-pass/macros/typeck-macro-interaction-issue-8852.rs rename to src/test/run-pass/macros/typeck-macro-interaction-issue-8852.rs index 31bf37ec0a9a..43d70975a9ad 100644 --- a/src/test/ui/run-pass/macros/typeck-macro-interaction-issue-8852.rs +++ b/src/test/run-pass/macros/typeck-macro-interaction-issue-8852.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum T { A(isize), diff --git a/src/test/ui/run-pass/macros/use-macro-self.rs b/src/test/run-pass/macros/use-macro-self.rs similarity index 96% rename from src/test/ui/run-pass/macros/use-macro-self.rs rename to src/test/run-pass/macros/use-macro-self.rs index fb816f9e78f7..65db1f1a306f 100644 --- a/src/test/ui/run-pass/macros/use-macro-self.rs +++ b/src/test/run-pass/macros/use-macro-self.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:use-macro-self.rs #[macro_use] diff --git a/src/test/ui/run-pass/methods/auxiliary/method_self_arg1.rs b/src/test/run-pass/methods/auxiliary/method_self_arg1.rs similarity index 100% rename from src/test/ui/run-pass/methods/auxiliary/method_self_arg1.rs rename to src/test/run-pass/methods/auxiliary/method_self_arg1.rs diff --git a/src/test/ui/run-pass/methods/auxiliary/method_self_arg2.rs b/src/test/run-pass/methods/auxiliary/method_self_arg2.rs similarity index 100% rename from src/test/ui/run-pass/methods/auxiliary/method_self_arg2.rs rename to src/test/run-pass/methods/auxiliary/method_self_arg2.rs diff --git a/src/test/ui/run-pass/methods/method-argument-inference-associated-type.rs b/src/test/run-pass/methods/method-argument-inference-associated-type.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-argument-inference-associated-type.rs rename to src/test/run-pass/methods/method-argument-inference-associated-type.rs diff --git a/src/test/ui/run-pass/methods/method-attributes.rs b/src/test/run-pass/methods/method-attributes.rs similarity index 97% rename from src/test/ui/run-pass/methods/method-attributes.rs rename to src/test/run-pass/methods/method-attributes.rs index b1afbd8d11c8..cf61714608ba 100644 --- a/src/test/ui/run-pass/methods/method-attributes.rs +++ b/src/test/run-pass/methods/method-attributes.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] #![allow(non_camel_case_types)] // pp-exact - Make sure we print all the attributes diff --git a/src/test/ui/run-pass/methods/method-early-bound-lifetimes-on-self.rs b/src/test/run-pass/methods/method-early-bound-lifetimes-on-self.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-early-bound-lifetimes-on-self.rs rename to src/test/run-pass/methods/method-early-bound-lifetimes-on-self.rs diff --git a/src/test/ui/run-pass/methods/method-mut-self-modifies-mut-slice-lvalue.rs b/src/test/run-pass/methods/method-mut-self-modifies-mut-slice-lvalue.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-mut-self-modifies-mut-slice-lvalue.rs rename to src/test/run-pass/methods/method-mut-self-modifies-mut-slice-lvalue.rs diff --git a/src/test/ui/run-pass/methods/method-normalize-bounds-issue-20604.rs b/src/test/run-pass/methods/method-normalize-bounds-issue-20604.rs similarity index 97% rename from src/test/ui/run-pass/methods/method-normalize-bounds-issue-20604.rs rename to src/test/run-pass/methods/method-normalize-bounds-issue-20604.rs index a56e5b5170d9..27064c792fea 100644 --- a/src/test/ui/run-pass/methods/method-normalize-bounds-issue-20604.rs +++ b/src/test/run-pass/methods/method-normalize-bounds-issue-20604.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(stable_features)] // Test that we handle projection types which wind up important for diff --git a/src/test/ui/run-pass/methods/method-projection.rs b/src/test/run-pass/methods/method-projection.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-projection.rs rename to src/test/run-pass/methods/method-projection.rs diff --git a/src/test/ui/run-pass/methods/method-recursive-blanket-impl.rs b/src/test/run-pass/methods/method-recursive-blanket-impl.rs similarity index 95% rename from src/test/ui/run-pass/methods/method-recursive-blanket-impl.rs rename to src/test/run-pass/methods/method-recursive-blanket-impl.rs index d1cd974070fb..72ce7a1ac562 100644 --- a/src/test/ui/run-pass/methods/method-recursive-blanket-impl.rs +++ b/src/test/run-pass/methods/method-recursive-blanket-impl.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] +#![allow(unused_imports)] // Test that we don't trigger on the blanket impl for all `&'a T` but // rather keep autoderefing and trigger on the underlying impl. To // know not to stop at the blanket, we have to recursively evaluate diff --git a/src/test/ui/run-pass/methods/method-self-arg-aux1.rs b/src/test/run-pass/methods/method-self-arg-aux1.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-self-arg-aux1.rs rename to src/test/run-pass/methods/method-self-arg-aux1.rs diff --git a/src/test/ui/run-pass/methods/method-self-arg-aux2.rs b/src/test/run-pass/methods/method-self-arg-aux2.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-self-arg-aux2.rs rename to src/test/run-pass/methods/method-self-arg-aux2.rs diff --git a/src/test/ui/run-pass/methods/method-self-arg-trait.rs b/src/test/run-pass/methods/method-self-arg-trait.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-self-arg-trait.rs rename to src/test/run-pass/methods/method-self-arg-trait.rs diff --git a/src/test/ui/run-pass/methods/method-self-arg.rs b/src/test/run-pass/methods/method-self-arg.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-self-arg.rs rename to src/test/run-pass/methods/method-self-arg.rs diff --git a/src/test/ui/run-pass/methods/method-two-trait-defer-resolution-1.rs b/src/test/run-pass/methods/method-two-trait-defer-resolution-1.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-two-trait-defer-resolution-1.rs rename to src/test/run-pass/methods/method-two-trait-defer-resolution-1.rs diff --git a/src/test/ui/run-pass/methods/method-two-trait-defer-resolution-2.rs b/src/test/run-pass/methods/method-two-trait-defer-resolution-2.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-two-trait-defer-resolution-2.rs rename to src/test/run-pass/methods/method-two-trait-defer-resolution-2.rs diff --git a/src/test/ui/run-pass/methods/method-two-traits-distinguished-via-where-clause.rs b/src/test/run-pass/methods/method-two-traits-distinguished-via-where-clause.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-two-traits-distinguished-via-where-clause.rs rename to src/test/run-pass/methods/method-two-traits-distinguished-via-where-clause.rs diff --git a/src/test/ui/run-pass/methods/method-where-clause.rs b/src/test/run-pass/methods/method-where-clause.rs similarity index 100% rename from src/test/ui/run-pass/methods/method-where-clause.rs rename to src/test/run-pass/methods/method-where-clause.rs diff --git a/src/test/ui/run-pass/mir/auxiliary/mir_external_refs.rs b/src/test/run-pass/mir/auxiliary/mir_external_refs.rs similarity index 100% rename from src/test/ui/run-pass/mir/auxiliary/mir_external_refs.rs rename to src/test/run-pass/mir/auxiliary/mir_external_refs.rs diff --git a/src/test/ui/run-pass/mir/mir-inlining/ice-issue-45493.rs b/src/test/run-pass/mir/mir-inlining/ice-issue-45493.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir-inlining/ice-issue-45493.rs rename to src/test/run-pass/mir/mir-inlining/ice-issue-45493.rs diff --git a/src/test/ui/run-pass/mir/mir-inlining/ice-issue-45885.rs b/src/test/run-pass/mir/mir-inlining/ice-issue-45885.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir-inlining/ice-issue-45885.rs rename to src/test/run-pass/mir/mir-inlining/ice-issue-45885.rs diff --git a/src/test/ui/run-pass/mir/mir-inlining/no-trait-method-issue-40473.rs b/src/test/run-pass/mir/mir-inlining/no-trait-method-issue-40473.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir-inlining/no-trait-method-issue-40473.rs rename to src/test/run-pass/mir/mir-inlining/no-trait-method-issue-40473.rs diff --git a/src/test/ui/run-pass/mir/mir-typeck-normalize-fn-sig.rs b/src/test/run-pass/mir/mir-typeck-normalize-fn-sig.rs similarity index 97% rename from src/test/ui/run-pass/mir/mir-typeck-normalize-fn-sig.rs rename to src/test/run-pass/mir/mir-typeck-normalize-fn-sig.rs index 3fc2ce44eaaf..8d8c7af724ff 100644 --- a/src/test/ui/run-pass/mir/mir-typeck-normalize-fn-sig.rs +++ b/src/test/run-pass/mir/mir-typeck-normalize-fn-sig.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // This code was creating an ICE in the MIR type checker. The reason // is that we are reifying a reference to a function (`foo::<'x>`), // which involves extracting its signature, but we were not diff --git a/src/test/ui/run-pass/mir/mir_adt_construction.rs b/src/test/run-pass/mir/mir_adt_construction.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_adt_construction.rs rename to src/test/run-pass/mir/mir_adt_construction.rs diff --git a/src/test/ui/run-pass/mir/mir_ascription_coercion.rs b/src/test/run-pass/mir/mir_ascription_coercion.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_ascription_coercion.rs rename to src/test/run-pass/mir/mir_ascription_coercion.rs diff --git a/src/test/ui/run-pass/mir/mir_augmented_assignments.rs b/src/test/run-pass/mir/mir_augmented_assignments.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_augmented_assignments.rs rename to src/test/run-pass/mir/mir_augmented_assignments.rs diff --git a/src/test/ui/run-pass/mir/mir_autoderef.rs b/src/test/run-pass/mir/mir_autoderef.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_autoderef.rs rename to src/test/run-pass/mir/mir_autoderef.rs diff --git a/src/test/ui/run-pass/mir/mir_boxing.rs b/src/test/run-pass/mir/mir_boxing.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_boxing.rs rename to src/test/run-pass/mir/mir_boxing.rs diff --git a/src/test/ui/run-pass/mir/mir_build_match_comparisons.rs b/src/test/run-pass/mir/mir_build_match_comparisons.rs similarity index 98% rename from src/test/ui/run-pass/mir/mir_build_match_comparisons.rs rename to src/test/run-pass/mir/mir_build_match_comparisons.rs index 45ac6566637a..f5a7362e4a9b 100644 --- a/src/test/ui/run-pass/mir/mir_build_match_comparisons.rs +++ b/src/test/run-pass/mir/mir_build_match_comparisons.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn test1(x: i8) -> i32 { match x { 1...10 => 0, diff --git a/src/test/ui/run-pass/mir/mir_call_with_associated_type.rs b/src/test/run-pass/mir/mir_call_with_associated_type.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_call_with_associated_type.rs rename to src/test/run-pass/mir/mir_call_with_associated_type.rs diff --git a/src/test/ui/run-pass/mir/mir_calls_to_shims.rs b/src/test/run-pass/mir/mir_calls_to_shims.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_calls_to_shims.rs rename to src/test/run-pass/mir/mir_calls_to_shims.rs diff --git a/src/test/ui/run-pass/mir/mir_cast_fn_ret.rs b/src/test/run-pass/mir/mir_cast_fn_ret.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_cast_fn_ret.rs rename to src/test/run-pass/mir/mir_cast_fn_ret.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_array.rs b/src/test/run-pass/mir/mir_codegen_array.rs similarity index 96% rename from src/test/ui/run-pass/mir/mir_codegen_array.rs rename to src/test/run-pass/mir/mir_codegen_array.rs index a0cd3c8dd125..ecbafef8c009 100644 --- a/src/test/ui/run-pass/mir/mir_codegen_array.rs +++ b/src/test/run-pass/mir/mir_codegen_array.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] fn into_inner() -> [u64; 1024] { let mut x = 10 + 20; [x; 1024] diff --git a/src/test/ui/run-pass/mir/mir_codegen_array_2.rs b/src/test/run-pass/mir/mir_codegen_array_2.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_array_2.rs rename to src/test/run-pass/mir/mir_codegen_array_2.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_call_converging.rs b/src/test/run-pass/mir/mir_codegen_call_converging.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_call_converging.rs rename to src/test/run-pass/mir/mir_codegen_call_converging.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_calls.rs b/src/test/run-pass/mir/mir_codegen_calls.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_calls.rs rename to src/test/run-pass/mir/mir_codegen_calls.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_calls_variadic.rs b/src/test/run-pass/mir/mir_codegen_calls_variadic.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_calls_variadic.rs rename to src/test/run-pass/mir/mir_codegen_calls_variadic.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_critical_edge.rs b/src/test/run-pass/mir/mir_codegen_critical_edge.rs similarity index 98% rename from src/test/ui/run-pass/mir/mir_codegen_critical_edge.rs rename to src/test/run-pass/mir/mir_codegen_critical_edge.rs index 48a5d6ab0f02..e22cead44f5b 100644 --- a/src/test/ui/run-pass/mir/mir_codegen_critical_edge.rs +++ b/src/test/run-pass/mir/mir_codegen_critical_edge.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // This code produces a CFG with critical edges that, if we don't // handle properly, will cause invalid codegen. diff --git a/src/test/ui/run-pass/mir/mir_codegen_spike1.rs b/src/test/run-pass/mir/mir_codegen_spike1.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_spike1.rs rename to src/test/run-pass/mir/mir_codegen_spike1.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_switch.rs b/src/test/run-pass/mir/mir_codegen_switch.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_switch.rs rename to src/test/run-pass/mir/mir_codegen_switch.rs diff --git a/src/test/ui/run-pass/mir/mir_codegen_switchint.rs b/src/test/run-pass/mir/mir_codegen_switchint.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_codegen_switchint.rs rename to src/test/run-pass/mir/mir_codegen_switchint.rs diff --git a/src/test/ui/run-pass/mir/mir_coercion_casts.rs b/src/test/run-pass/mir/mir_coercion_casts.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_coercion_casts.rs rename to src/test/run-pass/mir/mir_coercion_casts.rs diff --git a/src/test/ui/run-pass/mir/mir_coercions.rs b/src/test/run-pass/mir/mir_coercions.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_coercions.rs rename to src/test/run-pass/mir/mir_coercions.rs diff --git a/src/test/ui/run-pass/mir/mir_constval_adts.rs b/src/test/run-pass/mir/mir_constval_adts.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_constval_adts.rs rename to src/test/run-pass/mir/mir_constval_adts.rs diff --git a/src/test/ui/run-pass/mir/mir_drop_order.rs b/src/test/run-pass/mir/mir_drop_order.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_drop_order.rs rename to src/test/run-pass/mir/mir_drop_order.rs diff --git a/src/test/ui/run-pass/mir/mir_early_return_scope.rs b/src/test/run-pass/mir/mir_early_return_scope.rs similarity index 97% rename from src/test/ui/run-pass/mir/mir_early_return_scope.rs rename to src/test/run-pass/mir/mir_early_return_scope.rs index 27b907223286..af2f55ff650d 100644 --- a/src/test/ui/run-pass/mir/mir_early_return_scope.rs +++ b/src/test/run-pass/mir/mir_early_return_scope.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] static mut DROP: bool = false; struct ConnWrap(Conn); diff --git a/src/test/ui/run-pass/mir/mir_fat_ptr.rs b/src/test/run-pass/mir/mir_fat_ptr.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_fat_ptr.rs rename to src/test/run-pass/mir/mir_fat_ptr.rs diff --git a/src/test/ui/run-pass/mir/mir_fat_ptr_drop.rs b/src/test/run-pass/mir/mir_fat_ptr_drop.rs similarity index 97% rename from src/test/ui/run-pass/mir/mir_fat_ptr_drop.rs rename to src/test/run-pass/mir/mir_fat_ptr_drop.rs index 84528b3296aa..a2063cd2b3a8 100644 --- a/src/test/ui/run-pass/mir/mir_fat_ptr_drop.rs +++ b/src/test/run-pass/mir/mir_fat_ptr_drop.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(stable_features)] // test that ordinary fat pointer operations work. diff --git a/src/test/ui/run-pass/mir/mir_heavy_promoted.rs b/src/test/run-pass/mir/mir_heavy_promoted.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_heavy_promoted.rs rename to src/test/run-pass/mir/mir_heavy_promoted.rs diff --git a/src/test/ui/run-pass/mir/mir_match_arm_guard.rs b/src/test/run-pass/mir/mir_match_arm_guard.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_match_arm_guard.rs rename to src/test/run-pass/mir/mir_match_arm_guard.rs diff --git a/src/test/ui/run-pass/mir/mir_misc_casts.rs b/src/test/run-pass/mir/mir_misc_casts.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_misc_casts.rs rename to src/test/run-pass/mir/mir_misc_casts.rs diff --git a/src/test/ui/run-pass/mir/mir_overflow_off.rs b/src/test/run-pass/mir/mir_overflow_off.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_overflow_off.rs rename to src/test/run-pass/mir/mir_overflow_off.rs diff --git a/src/test/ui/run-pass/mir/mir_raw_fat_ptr.rs b/src/test/run-pass/mir/mir_raw_fat_ptr.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_raw_fat_ptr.rs rename to src/test/run-pass/mir/mir_raw_fat_ptr.rs diff --git a/src/test/ui/run-pass/mir/mir_refs_correct.rs b/src/test/run-pass/mir/mir_refs_correct.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_refs_correct.rs rename to src/test/run-pass/mir/mir_refs_correct.rs diff --git a/src/test/ui/run-pass/mir/mir_small_agg_arg.rs b/src/test/run-pass/mir/mir_small_agg_arg.rs similarity index 95% rename from src/test/ui/run-pass/mir/mir_small_agg_arg.rs rename to src/test/run-pass/mir/mir_small_agg_arg.rs index 48eae959b4e2..fd81239daffd 100644 --- a/src/test/ui/run-pass/mir/mir_small_agg_arg.rs +++ b/src/test/run-pass/mir/mir_small_agg_arg.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] fn foo((x, y): (i8, i8)) { } diff --git a/src/test/ui/run-pass/mir/mir_struct_with_assoc_ty.rs b/src/test/run-pass/mir/mir_struct_with_assoc_ty.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_struct_with_assoc_ty.rs rename to src/test/run-pass/mir/mir_struct_with_assoc_ty.rs diff --git a/src/test/ui/run-pass/mir/mir_temp_promotions.rs b/src/test/run-pass/mir/mir_temp_promotions.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_temp_promotions.rs rename to src/test/run-pass/mir/mir_temp_promotions.rs diff --git a/src/test/ui/run-pass/mir/mir_void_return.rs b/src/test/run-pass/mir/mir_void_return.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_void_return.rs rename to src/test/run-pass/mir/mir_void_return.rs diff --git a/src/test/ui/run-pass/mir/mir_void_return_2.rs b/src/test/run-pass/mir/mir_void_return_2.rs similarity index 100% rename from src/test/ui/run-pass/mir/mir_void_return_2.rs rename to src/test/run-pass/mir/mir_void_return_2.rs diff --git a/src/test/ui/run-pass/modules/auxiliary/two_macros_2.rs b/src/test/run-pass/modules/auxiliary/two_macros_2.rs similarity index 100% rename from src/test/ui/run-pass/modules/auxiliary/two_macros_2.rs rename to src/test/run-pass/modules/auxiliary/two_macros_2.rs diff --git a/src/test/ui/run-pass/modules/mod-inside-fn.rs b/src/test/run-pass/modules/mod-inside-fn.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod-inside-fn.rs rename to src/test/run-pass/modules/mod-inside-fn.rs diff --git a/src/test/ui/run-pass/modules/mod-view-items.rs b/src/test/run-pass/modules/mod-view-items.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod-view-items.rs rename to src/test/run-pass/modules/mod-view-items.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_implicit.rs b/src/test/run-pass/modules/mod_dir_implicit.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_implicit.rs rename to src/test/run-pass/modules/mod_dir_implicit.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_implicit_aux/compiletest-ignore-dir b/src/test/run-pass/modules/mod_dir_implicit_aux/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_implicit_aux/compiletest-ignore-dir rename to src/test/run-pass/modules/mod_dir_implicit_aux/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/modules/mod_dir_implicit_aux/mod.rs b/src/test/run-pass/modules/mod_dir_implicit_aux/mod.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_implicit_aux/mod.rs rename to src/test/run-pass/modules/mod_dir_implicit_aux/mod.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_path.rs b/src/test/run-pass/modules/mod_dir_path.rs similarity index 97% rename from src/test/ui/run-pass/modules/mod_dir_path.rs rename to src/test/run-pass/modules/mod_dir_path.rs index d614b2fb8605..ff958f23f114 100644 --- a/src/test/ui/run-pass/modules/mod_dir_path.rs +++ b/src/test/run-pass/modules/mod_dir_path.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] // ignore-pretty issue #37195 mod mod_dir_simple { diff --git a/src/test/ui/run-pass/modules/mod_dir_path2.rs b/src/test/run-pass/modules/mod_dir_path2.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_path2.rs rename to src/test/run-pass/modules/mod_dir_path2.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_path3.rs b/src/test/run-pass/modules/mod_dir_path3.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_path3.rs rename to src/test/run-pass/modules/mod_dir_path3.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_path_multi.rs b/src/test/run-pass/modules/mod_dir_path_multi.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_path_multi.rs rename to src/test/run-pass/modules/mod_dir_path_multi.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_recursive.rs b/src/test/run-pass/modules/mod_dir_recursive.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_recursive.rs rename to src/test/run-pass/modules/mod_dir_recursive.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_simple.rs b/src/test/run-pass/modules/mod_dir_simple.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_simple.rs rename to src/test/run-pass/modules/mod_dir_simple.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_simple/compiletest-ignore-dir b/src/test/run-pass/modules/mod_dir_simple/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_simple/compiletest-ignore-dir rename to src/test/run-pass/modules/mod_dir_simple/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/modules/mod_dir_simple/load_another_mod.rs b/src/test/run-pass/modules/mod_dir_simple/load_another_mod.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_simple/load_another_mod.rs rename to src/test/run-pass/modules/mod_dir_simple/load_another_mod.rs diff --git a/src/test/ui/run-pass/modules/mod_dir_simple/test.rs b/src/test/run-pass/modules/mod_dir_simple/test.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_dir_simple/test.rs rename to src/test/run-pass/modules/mod_dir_simple/test.rs diff --git a/src/test/ui/run-pass/modules/mod_file.rs b/src/test/run-pass/modules/mod_file.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_file.rs rename to src/test/run-pass/modules/mod_file.rs diff --git a/src/test/ui/run-pass/modules/mod_file_aux.rs b/src/test/run-pass/modules/mod_file_aux.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_file_aux.rs rename to src/test/run-pass/modules/mod_file_aux.rs diff --git a/src/test/ui/run-pass/modules/mod_file_with_path_attr.rs b/src/test/run-pass/modules/mod_file_with_path_attr.rs similarity index 100% rename from src/test/ui/run-pass/modules/mod_file_with_path_attr.rs rename to src/test/run-pass/modules/mod_file_with_path_attr.rs diff --git a/src/test/ui/run-pass/modules/module-polymorphism3-files/compiletest-ignore-dir b/src/test/run-pass/modules/module-polymorphism3-files/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/modules/module-polymorphism3-files/compiletest-ignore-dir rename to src/test/run-pass/modules/module-polymorphism3-files/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_f32.rs b/src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_f32.rs similarity index 100% rename from src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_f32.rs rename to src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_f32.rs diff --git a/src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_f64.rs b/src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_f64.rs similarity index 100% rename from src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_f64.rs rename to src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_f64.rs diff --git a/src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_float.rs b/src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_float.rs similarity index 100% rename from src/test/ui/run-pass/modules/module-polymorphism3-files/float-template/inst_float.rs rename to src/test/run-pass/modules/module-polymorphism3-files/float-template/inst_float.rs diff --git a/src/test/ui/run-pass/moves/move-1-unique.rs b/src/test/run-pass/moves/move-1-unique.rs similarity index 97% rename from src/test/ui/run-pass/moves/move-1-unique.rs rename to src/test/run-pass/moves/move-1-unique.rs index 1557f13b10d3..5a0eefc20af8 100644 --- a/src/test/ui/run-pass/moves/move-1-unique.rs +++ b/src/test/run-pass/moves/move-1-unique.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![feature(box_syntax)] #[derive(Clone)] diff --git a/src/test/ui/run-pass/moves/move-2-unique.rs b/src/test/run-pass/moves/move-2-unique.rs similarity index 96% rename from src/test/ui/run-pass/moves/move-2-unique.rs rename to src/test/run-pass/moves/move-2-unique.rs index 270a59904968..e62c73935517 100644 --- a/src/test/ui/run-pass/moves/move-2-unique.rs +++ b/src/test/run-pass/moves/move-2-unique.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct X { x: isize, y: isize, z: isize } diff --git a/src/test/ui/run-pass/moves/move-2.rs b/src/test/run-pass/moves/move-2.rs similarity index 96% rename from src/test/ui/run-pass/moves/move-2.rs rename to src/test/run-pass/moves/move-2.rs index 9207c71e0835..caab86e584eb 100644 --- a/src/test/ui/run-pass/moves/move-2.rs +++ b/src/test/run-pass/moves/move-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct X { x: isize, y: isize, z: isize } diff --git a/src/test/ui/run-pass/moves/move-3-unique.rs b/src/test/run-pass/moves/move-3-unique.rs similarity index 97% rename from src/test/ui/run-pass/moves/move-3-unique.rs rename to src/test/run-pass/moves/move-3-unique.rs index 6f86674104c1..9247eac848a4 100644 --- a/src/test/ui/run-pass/moves/move-3-unique.rs +++ b/src/test/run-pass/moves/move-3-unique.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![feature(box_syntax)] #[derive(Clone)] diff --git a/src/test/ui/run-pass/moves/move-4-unique.rs b/src/test/run-pass/moves/move-4-unique.rs similarity index 97% rename from src/test/ui/run-pass/moves/move-4-unique.rs rename to src/test/run-pass/moves/move-4-unique.rs index 0876f37fd2d4..6d69b5ec946d 100644 --- a/src/test/ui/run-pass/moves/move-4-unique.rs +++ b/src/test/run-pass/moves/move-4-unique.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct Triple {a: isize, b: isize, c: isize} diff --git a/src/test/ui/run-pass/moves/move-4.rs b/src/test/run-pass/moves/move-4.rs similarity index 97% rename from src/test/ui/run-pass/moves/move-4.rs rename to src/test/run-pass/moves/move-4.rs index 61dcc08805b1..5edaffeb2c2c 100644 --- a/src/test/ui/run-pass/moves/move-4.rs +++ b/src/test/run-pass/moves/move-4.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct Triple { a: isize, b: isize, c: isize } diff --git a/src/test/ui/run-pass/moves/move-arg-2-unique.rs b/src/test/run-pass/moves/move-arg-2-unique.rs similarity index 100% rename from src/test/ui/run-pass/moves/move-arg-2-unique.rs rename to src/test/run-pass/moves/move-arg-2-unique.rs diff --git a/src/test/ui/run-pass/moves/move-arg-2.rs b/src/test/run-pass/moves/move-arg-2.rs similarity index 100% rename from src/test/ui/run-pass/moves/move-arg-2.rs rename to src/test/run-pass/moves/move-arg-2.rs diff --git a/src/test/ui/run-pass/moves/move-arg.rs b/src/test/run-pass/moves/move-arg.rs similarity index 100% rename from src/test/ui/run-pass/moves/move-arg.rs rename to src/test/run-pass/moves/move-arg.rs diff --git a/src/test/ui/run-pass/moves/move-nullary-fn.rs b/src/test/run-pass/moves/move-nullary-fn.rs similarity index 100% rename from src/test/ui/run-pass/moves/move-nullary-fn.rs rename to src/test/run-pass/moves/move-nullary-fn.rs diff --git a/src/test/ui/run-pass/moves/move-out-of-field.rs b/src/test/run-pass/moves/move-out-of-field.rs similarity index 100% rename from src/test/ui/run-pass/moves/move-out-of-field.rs rename to src/test/run-pass/moves/move-out-of-field.rs diff --git a/src/test/ui/run-pass/moves/move-scalar.rs b/src/test/run-pass/moves/move-scalar.rs similarity index 96% rename from src/test/ui/run-pass/moves/move-scalar.rs rename to src/test/run-pass/moves/move-scalar.rs index c72be92654c5..f25741f355e6 100644 --- a/src/test/ui/run-pass/moves/move-scalar.rs +++ b/src/test/run-pass/moves/move-scalar.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] pub fn main() { diff --git a/src/test/ui/run-pass/moves/moves-based-on-type-capture-clause.rs b/src/test/run-pass/moves/moves-based-on-type-capture-clause.rs similarity index 96% rename from src/test/ui/run-pass/moves/moves-based-on-type-capture-clause.rs rename to src/test/run-pass/moves/moves-based-on-type-capture-clause.rs index 857bf7ff2607..333d6e4fd526 100644 --- a/src/test/ui/run-pass/moves/moves-based-on-type-capture-clause.rs +++ b/src/test/run-pass/moves/moves-based-on-type-capture-clause.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/nll/issue-47153-generic-const.rs b/src/test/run-pass/nll/issue-47153-generic-const.rs similarity index 100% rename from src/test/ui/run-pass/nll/issue-47153-generic-const.rs rename to src/test/run-pass/nll/issue-47153-generic-const.rs diff --git a/src/test/ui/run-pass/nll/issue-47589.rs b/src/test/run-pass/nll/issue-47589.rs similarity index 100% rename from src/test/ui/run-pass/nll/issue-47589.rs rename to src/test/run-pass/nll/issue-47589.rs diff --git a/src/test/ui/run-pass/nll/issue-48623-closure.rs b/src/test/run-pass/nll/issue-48623-closure.rs similarity index 93% rename from src/test/ui/run-pass/nll/issue-48623-closure.rs rename to src/test/run-pass/nll/issue-48623-closure.rs index 312aa6d577aa..68c9c428b063 100644 --- a/src/test/ui/run-pass/nll/issue-48623-closure.rs +++ b/src/test/run-pass/nll/issue-48623-closure.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(path_statements)] +#![allow(dead_code)] #![feature(nll)] diff --git a/src/test/ui/run-pass/nll/issue-48623-generator.rs b/src/test/run-pass/nll/issue-48623-generator.rs similarity index 93% rename from src/test/ui/run-pass/nll/issue-48623-generator.rs rename to src/test/run-pass/nll/issue-48623-generator.rs index 24b25c4db16c..b733545256fa 100644 --- a/src/test/ui/run-pass/nll/issue-48623-generator.rs +++ b/src/test/run-pass/nll/issue-48623-generator.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(path_statements)] +#![allow(dead_code)] #![feature(nll)] #![feature(generators, generator_trait)] diff --git a/src/test/ui/run-pass/nll/issue-50343.rs b/src/test/run-pass/nll/issue-50343.rs similarity index 100% rename from src/test/ui/run-pass/nll/issue-50343.rs rename to src/test/run-pass/nll/issue-50343.rs diff --git a/src/test/ui/run-pass/nll/issue-50461-used-mut-from-moves.rs b/src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs similarity index 100% rename from src/test/ui/run-pass/nll/issue-50461-used-mut-from-moves.rs rename to src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs diff --git a/src/test/ui/run-pass/nll/issue-53123-raw-pointer-cast.rs b/src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs similarity index 100% rename from src/test/ui/run-pass/nll/issue-53123-raw-pointer-cast.rs rename to src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs diff --git a/src/test/ui/run-pass/nll/mutating_references.rs b/src/test/run-pass/nll/mutating_references.rs similarity index 100% rename from src/test/ui/run-pass/nll/mutating_references.rs rename to src/test/run-pass/nll/mutating_references.rs diff --git a/src/test/ui/run-pass/nll/process_or_insert_default.rs b/src/test/run-pass/nll/process_or_insert_default.rs similarity index 100% rename from src/test/ui/run-pass/nll/process_or_insert_default.rs rename to src/test/run-pass/nll/process_or_insert_default.rs diff --git a/src/test/ui/run-pass/nll/rc-loop.rs b/src/test/run-pass/nll/rc-loop.rs similarity index 100% rename from src/test/ui/run-pass/nll/rc-loop.rs rename to src/test/run-pass/nll/rc-loop.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod.rs b/src/test/run-pass/non_modrs_mods/foors_mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod.rs rename to src/test/run-pass/non_modrs_mods/foors_mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod/compiletest-ignore-dir b/src/test/run-pass/non_modrs_mods/foors_mod/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod/compiletest-ignore-dir rename to src/test/run-pass/non_modrs_mods/foors_mod/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_foors_mod.rs b/src/test/run-pass/non_modrs_mods/foors_mod/inner_foors_mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_foors_mod.rs rename to src/test/run-pass/non_modrs_mods/foors_mod/inner_foors_mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_foors_mod/innest.rs b/src/test/run-pass/non_modrs_mods/foors_mod/inner_foors_mod/innest.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_foors_mod/innest.rs rename to src/test/run-pass/non_modrs_mods/foors_mod/inner_foors_mod/innest.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/innest.rs b/src/test/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/innest.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/innest.rs rename to src/test/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/innest.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/mod.rs b/src/test/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/mod.rs rename to src/test/run-pass/non_modrs_mods/foors_mod/inner_modrs_mod/mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/compiletest-ignore-dir b/src/test/run-pass/non_modrs_mods/modrs_mod/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/compiletest-ignore-dir rename to src/test/run-pass/non_modrs_mods/modrs_mod/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod.rs b/src/test/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod.rs rename to src/test/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod/innest.rs b/src/test/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod/innest.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod/innest.rs rename to src/test/run-pass/non_modrs_mods/modrs_mod/inner_foors_mod/innest.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/innest.rs b/src/test/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/innest.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/innest.rs rename to src/test/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/innest.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/mod.rs b/src/test/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/mod.rs rename to src/test/run-pass/non_modrs_mods/modrs_mod/inner_modrs_mod/mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/modrs_mod/mod.rs b/src/test/run-pass/non_modrs_mods/modrs_mod/mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/modrs_mod/mod.rs rename to src/test/run-pass/non_modrs_mods/modrs_mod/mod.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/arbitrary_name.rs b/src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/arbitrary_name.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/arbitrary_name.rs rename to src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/arbitrary_name.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/compiletest-ignore-dir b/src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/compiletest-ignore-dir similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/compiletest-ignore-dir rename to src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/compiletest-ignore-dir diff --git a/src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/innest.rs b/src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/innest.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/innest.rs rename to src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/innest.rs diff --git a/src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/mod.rs b/src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/mod.rs similarity index 100% rename from src/test/ui/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/mod.rs rename to src/test/run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod/mod.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/arith-0.rs b/src/test/run-pass/numbers-arithmetic/arith-0.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/arith-0.rs rename to src/test/run-pass/numbers-arithmetic/arith-0.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/arith-1.rs b/src/test/run-pass/numbers-arithmetic/arith-1.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/arith-1.rs rename to src/test/run-pass/numbers-arithmetic/arith-1.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/arith-2.rs b/src/test/run-pass/numbers-arithmetic/arith-2.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/arith-2.rs rename to src/test/run-pass/numbers-arithmetic/arith-2.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/arith-unsigned.rs b/src/test/run-pass/numbers-arithmetic/arith-unsigned.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/arith-unsigned.rs rename to src/test/run-pass/numbers-arithmetic/arith-unsigned.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/div-mod.rs b/src/test/run-pass/numbers-arithmetic/div-mod.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/div-mod.rs rename to src/test/run-pass/numbers-arithmetic/div-mod.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float-int-invalid-const-cast.rs b/src/test/run-pass/numbers-arithmetic/float-int-invalid-const-cast.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float-int-invalid-const-cast.rs rename to src/test/run-pass/numbers-arithmetic/float-int-invalid-const-cast.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float-literal-inference.rs b/src/test/run-pass/numbers-arithmetic/float-literal-inference.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float-literal-inference.rs rename to src/test/run-pass/numbers-arithmetic/float-literal-inference.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float-nan.rs b/src/test/run-pass/numbers-arithmetic/float-nan.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float-nan.rs rename to src/test/run-pass/numbers-arithmetic/float-nan.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float-signature.rs b/src/test/run-pass/numbers-arithmetic/float-signature.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float-signature.rs rename to src/test/run-pass/numbers-arithmetic/float-signature.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float.rs b/src/test/run-pass/numbers-arithmetic/float.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float.rs rename to src/test/run-pass/numbers-arithmetic/float.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float2.rs b/src/test/run-pass/numbers-arithmetic/float2.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float2.rs rename to src/test/run-pass/numbers-arithmetic/float2.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/float_math.rs b/src/test/run-pass/numbers-arithmetic/float_math.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/float_math.rs rename to src/test/run-pass/numbers-arithmetic/float_math.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/floatlits.rs b/src/test/run-pass/numbers-arithmetic/floatlits.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/floatlits.rs rename to src/test/run-pass/numbers-arithmetic/floatlits.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/i128-ffi.rs b/src/test/run-pass/numbers-arithmetic/i128-ffi.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/i128-ffi.rs rename to src/test/run-pass/numbers-arithmetic/i128-ffi.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/i128.rs b/src/test/run-pass/numbers-arithmetic/i128.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/i128.rs rename to src/test/run-pass/numbers-arithmetic/i128.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/i32-sub.rs b/src/test/run-pass/numbers-arithmetic/i32-sub.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/i32-sub.rs rename to src/test/run-pass/numbers-arithmetic/i32-sub.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/i8-incr.rs b/src/test/run-pass/numbers-arithmetic/i8-incr.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/i8-incr.rs rename to src/test/run-pass/numbers-arithmetic/i8-incr.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/int-abs-overflow.rs b/src/test/run-pass/numbers-arithmetic/int-abs-overflow.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/int-abs-overflow.rs rename to src/test/run-pass/numbers-arithmetic/int-abs-overflow.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/int.rs b/src/test/run-pass/numbers-arithmetic/int.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/int.rs rename to src/test/run-pass/numbers-arithmetic/int.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/integer-literal-radix.rs b/src/test/run-pass/numbers-arithmetic/integer-literal-radix.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/integer-literal-radix.rs rename to src/test/run-pass/numbers-arithmetic/integer-literal-radix.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference-2.rs b/src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference-2.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference-2.rs rename to src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference-2.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference-3.rs b/src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference-3.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference-3.rs rename to src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference-3.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference.rs b/src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/integer-literal-suffix-inference.rs rename to src/test/run-pass/numbers-arithmetic/integer-literal-suffix-inference.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/next-power-of-two-overflow-debug.rs b/src/test/run-pass/numbers-arithmetic/next-power-of-two-overflow-debug.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/next-power-of-two-overflow-debug.rs rename to src/test/run-pass/numbers-arithmetic/next-power-of-two-overflow-debug.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/next-power-of-two-overflow-ndebug.rs b/src/test/run-pass/numbers-arithmetic/next-power-of-two-overflow-ndebug.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/next-power-of-two-overflow-ndebug.rs rename to src/test/run-pass/numbers-arithmetic/next-power-of-two-overflow-ndebug.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/num-wrapping.rs b/src/test/run-pass/numbers-arithmetic/num-wrapping.rs similarity index 99% rename from src/test/ui/run-pass/numbers-arithmetic/num-wrapping.rs rename to src/test/run-pass/numbers-arithmetic/num-wrapping.rs index 6d3653e79775..86ca2c8a4958 100644 --- a/src/test/ui/run-pass/numbers-arithmetic/num-wrapping.rs +++ b/src/test/run-pass/numbers-arithmetic/num-wrapping.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_macros)] // compile-flags: -C debug-assertions // diff --git a/src/test/ui/run-pass/numbers-arithmetic/numeric-method-autoexport.rs b/src/test/run-pass/numbers-arithmetic/numeric-method-autoexport.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/numeric-method-autoexport.rs rename to src/test/run-pass/numbers-arithmetic/numeric-method-autoexport.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/promoted_overflow_opt.rs b/src/test/run-pass/numbers-arithmetic/promoted_overflow_opt.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/promoted_overflow_opt.rs rename to src/test/run-pass/numbers-arithmetic/promoted_overflow_opt.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/saturating-float-casts.rs b/src/test/run-pass/numbers-arithmetic/saturating-float-casts.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/saturating-float-casts.rs rename to src/test/run-pass/numbers-arithmetic/saturating-float-casts.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/shift-near-oflo.rs b/src/test/run-pass/numbers-arithmetic/shift-near-oflo.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/shift-near-oflo.rs rename to src/test/run-pass/numbers-arithmetic/shift-near-oflo.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/shift-various-types.rs b/src/test/run-pass/numbers-arithmetic/shift-various-types.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/shift-various-types.rs rename to src/test/run-pass/numbers-arithmetic/shift-various-types.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/shift.rs b/src/test/run-pass/numbers-arithmetic/shift.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/shift.rs rename to src/test/run-pass/numbers-arithmetic/shift.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/signed-shift-const-eval.rs b/src/test/run-pass/numbers-arithmetic/signed-shift-const-eval.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/signed-shift-const-eval.rs rename to src/test/run-pass/numbers-arithmetic/signed-shift-const-eval.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/u128-as-f32.rs b/src/test/run-pass/numbers-arithmetic/u128-as-f32.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/u128-as-f32.rs rename to src/test/run-pass/numbers-arithmetic/u128-as-f32.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/u128.rs b/src/test/run-pass/numbers-arithmetic/u128.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/u128.rs rename to src/test/run-pass/numbers-arithmetic/u128.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/u32-decr.rs b/src/test/run-pass/numbers-arithmetic/u32-decr.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/u32-decr.rs rename to src/test/run-pass/numbers-arithmetic/u32-decr.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/u8-incr-decr.rs b/src/test/run-pass/numbers-arithmetic/u8-incr-decr.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/u8-incr-decr.rs rename to src/test/run-pass/numbers-arithmetic/u8-incr-decr.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/u8-incr.rs b/src/test/run-pass/numbers-arithmetic/u8-incr.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/u8-incr.rs rename to src/test/run-pass/numbers-arithmetic/u8-incr.rs diff --git a/src/test/ui/run-pass/numbers-arithmetic/uint.rs b/src/test/run-pass/numbers-arithmetic/uint.rs similarity index 100% rename from src/test/ui/run-pass/numbers-arithmetic/uint.rs rename to src/test/run-pass/numbers-arithmetic/uint.rs diff --git a/src/test/ui/run-pass/overloaded/auxiliary/overloaded_autoderef_xc.rs b/src/test/run-pass/overloaded/auxiliary/overloaded_autoderef_xc.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/auxiliary/overloaded_autoderef_xc.rs rename to src/test/run-pass/overloaded/auxiliary/overloaded_autoderef_xc.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef-count.rs b/src/test/run-pass/overloaded/overloaded-autoderef-count.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef-count.rs rename to src/test/run-pass/overloaded/overloaded-autoderef-count.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef-indexing.rs b/src/test/run-pass/overloaded/overloaded-autoderef-indexing.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef-indexing.rs rename to src/test/run-pass/overloaded/overloaded-autoderef-indexing.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef-order.rs b/src/test/run-pass/overloaded/overloaded-autoderef-order.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef-order.rs rename to src/test/run-pass/overloaded/overloaded-autoderef-order.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef-vtable.rs b/src/test/run-pass/overloaded/overloaded-autoderef-vtable.rs similarity index 98% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef-vtable.rs rename to src/test/run-pass/overloaded/overloaded-autoderef-vtable.rs index 2ed9032f86e1..cb987c21a3cc 100644 --- a/src/test/ui/run-pass/overloaded/overloaded-autoderef-vtable.rs +++ b/src/test/run-pass/overloaded/overloaded-autoderef-vtable.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::ops::Deref; diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef-xcrate.rs b/src/test/run-pass/overloaded/overloaded-autoderef-xcrate.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef-xcrate.rs rename to src/test/run-pass/overloaded/overloaded-autoderef-xcrate.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-autoderef.rs b/src/test/run-pass/overloaded/overloaded-autoderef.rs similarity index 98% rename from src/test/ui/run-pass/overloaded/overloaded-autoderef.rs rename to src/test/run-pass/overloaded/overloaded-autoderef.rs index 7be57400da0d..0c991247eb23 100644 --- a/src/test/ui/run-pass/overloaded/overloaded-autoderef.rs +++ b/src/test/run-pass/overloaded/overloaded-autoderef.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(stable_features)] #![feature(box_syntax, core)] diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-object-one-arg.rs b/src/test/run-pass/overloaded/overloaded-calls-object-one-arg.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-object-one-arg.rs rename to src/test/run-pass/overloaded/overloaded-calls-object-one-arg.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-object-two-args.rs b/src/test/run-pass/overloaded/overloaded-calls-object-two-args.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-object-two-args.rs rename to src/test/run-pass/overloaded/overloaded-calls-object-two-args.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-object-zero-args.rs b/src/test/run-pass/overloaded/overloaded-calls-object-zero-args.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-object-zero-args.rs rename to src/test/run-pass/overloaded/overloaded-calls-object-zero-args.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-param-vtables.rs b/src/test/run-pass/overloaded/overloaded-calls-param-vtables.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-param-vtables.rs rename to src/test/run-pass/overloaded/overloaded-calls-param-vtables.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-simple.rs b/src/test/run-pass/overloaded/overloaded-calls-simple.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-simple.rs rename to src/test/run-pass/overloaded/overloaded-calls-simple.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-calls-zero-args.rs b/src/test/run-pass/overloaded/overloaded-calls-zero-args.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-calls-zero-args.rs rename to src/test/run-pass/overloaded/overloaded-calls-zero-args.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-deref-count.rs b/src/test/run-pass/overloaded/overloaded-deref-count.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-deref-count.rs rename to src/test/run-pass/overloaded/overloaded-deref-count.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-deref.rs b/src/test/run-pass/overloaded/overloaded-deref.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-deref.rs rename to src/test/run-pass/overloaded/overloaded-deref.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-index-assoc-list.rs b/src/test/run-pass/overloaded/overloaded-index-assoc-list.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-index-assoc-list.rs rename to src/test/run-pass/overloaded/overloaded-index-assoc-list.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-index-autoderef.rs b/src/test/run-pass/overloaded/overloaded-index-autoderef.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-index-autoderef.rs rename to src/test/run-pass/overloaded/overloaded-index-autoderef.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-index-in-field.rs b/src/test/run-pass/overloaded/overloaded-index-in-field.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-index-in-field.rs rename to src/test/run-pass/overloaded/overloaded-index-in-field.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded-index.rs b/src/test/run-pass/overloaded/overloaded-index.rs similarity index 100% rename from src/test/ui/run-pass/overloaded/overloaded-index.rs rename to src/test/run-pass/overloaded/overloaded-index.rs diff --git a/src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs b/src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs similarity index 98% rename from src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs rename to src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs index d092df329579..b5ed5cc37d9a 100644 --- a/src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs +++ b/src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] // Test that we choose Deref or DerefMut appropriately based on mutability of ref bindings (#15609). use std::ops::{Deref, DerefMut}; diff --git a/src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs b/src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs similarity index 95% rename from src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs rename to src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs index 8f0b3356d079..ae405350ad0c 100644 --- a/src/test/ui/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs +++ b/src/test/run-pass/overloaded/overloaded_deref_with_ref_pattern_issue15609.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that we choose Deref or DerefMut appropriately based on mutability of ref bindings (#15609). fn main() { diff --git a/src/test/ui/run-pass/packed/auxiliary/packed.rs b/src/test/run-pass/packed/auxiliary/packed.rs similarity index 100% rename from src/test/ui/run-pass/packed/auxiliary/packed.rs rename to src/test/run-pass/packed/auxiliary/packed.rs diff --git a/src/test/ui/run-pass/packed/packed-struct-borrow-element.rs b/src/test/run-pass/packed/packed-struct-borrow-element.rs similarity index 98% rename from src/test/ui/run-pass/packed/packed-struct-borrow-element.rs rename to src/test/run-pass/packed/packed-struct-borrow-element.rs index 5d5bcbd325d4..69969ba640fb 100644 --- a/src/test/ui/run-pass/packed/packed-struct-borrow-element.rs +++ b/src/test/run-pass/packed/packed-struct-borrow-element.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-emscripten weird assertion? #![feature(repr_packed)] diff --git a/src/test/ui/run-pass/packed/packed-struct-drop-aligned.rs b/src/test/run-pass/packed/packed-struct-drop-aligned.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-struct-drop-aligned.rs rename to src/test/run-pass/packed/packed-struct-drop-aligned.rs diff --git a/src/test/ui/run-pass/packed/packed-struct-generic-layout.rs b/src/test/run-pass/packed/packed-struct-generic-layout.rs similarity index 98% rename from src/test/ui/run-pass/packed/packed-struct-generic-layout.rs rename to src/test/run-pass/packed/packed-struct-generic-layout.rs index 30f7124f2437..045449181712 100644 --- a/src/test/ui/run-pass/packed/packed-struct-generic-layout.rs +++ b/src/test/run-pass/packed/packed-struct-generic-layout.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(overflowing_literals)] diff --git a/src/test/ui/run-pass/packed/packed-struct-generic-size.rs b/src/test/run-pass/packed/packed-struct-generic-size.rs similarity index 98% rename from src/test/ui/run-pass/packed/packed-struct-generic-size.rs rename to src/test/run-pass/packed/packed-struct-generic-size.rs index 6df51f457299..58cd5505ffc2 100644 --- a/src/test/ui/run-pass/packed/packed-struct-generic-size.rs +++ b/src/test/run-pass/packed/packed-struct-generic-size.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(stable_features)] #![allow(unused_comparisons)] diff --git a/src/test/ui/run-pass/packed/packed-struct-generic-size.stderr b/src/test/run-pass/packed/packed-struct-generic-size.stderr similarity index 86% rename from src/test/ui/run-pass/packed/packed-struct-generic-size.stderr rename to src/test/run-pass/packed/packed-struct-generic-size.stderr index f9c343b60b06..994ea7c44fbe 100644 --- a/src/test/ui/run-pass/packed/packed-struct-generic-size.stderr +++ b/src/test/run-pass/packed/packed-struct-generic-size.stderr @@ -1,35 +1,35 @@ warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:48:14 + --> $DIR/packed-struct-generic-size.rs:49:14 | LL | check!(P1::, 1, 3); | ^^ try removing `::` warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:49:14 + --> $DIR/packed-struct-generic-size.rs:50:14 | LL | check!(P1::, 1, 11); | ^^ try removing `::` warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:51:14 + --> $DIR/packed-struct-generic-size.rs:52:14 | LL | check!(P2::, 1, 3); | ^^ try removing `::` warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:52:14 + --> $DIR/packed-struct-generic-size.rs:53:14 | LL | check!(P2::, 2, 12); | ^^ try removing `::` warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:54:15 + --> $DIR/packed-struct-generic-size.rs:55:15 | LL | check!(P4C::, 1, 3); | ^^ try removing `::` warning: unnecessary path disambiguator - --> $DIR/packed-struct-generic-size.rs:55:15 + --> $DIR/packed-struct-generic-size.rs:56:15 | LL | check!(P4C::, 4, 12); | ^^ try removing `::` diff --git a/src/test/ui/run-pass/packed/packed-struct-layout.rs b/src/test/run-pass/packed/packed-struct-layout.rs similarity index 97% rename from src/test/ui/run-pass/packed/packed-struct-layout.rs rename to src/test/run-pass/packed/packed-struct-layout.rs index 2c9216a96c2c..6aa8770304a7 100644 --- a/src/test/ui/run-pass/packed/packed-struct-layout.rs +++ b/src/test/run-pass/packed/packed-struct-layout.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem; #[repr(packed)] diff --git a/src/test/ui/run-pass/packed/packed-struct-match.rs b/src/test/run-pass/packed/packed-struct-match.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-struct-match.rs rename to src/test/run-pass/packed/packed-struct-match.rs diff --git a/src/test/ui/run-pass/packed/packed-struct-optimized-enum.rs b/src/test/run-pass/packed/packed-struct-optimized-enum.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-struct-optimized-enum.rs rename to src/test/run-pass/packed/packed-struct-optimized-enum.rs diff --git a/src/test/ui/run-pass/packed/packed-struct-size-xc.rs b/src/test/run-pass/packed/packed-struct-size-xc.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-struct-size-xc.rs rename to src/test/run-pass/packed/packed-struct-size-xc.rs diff --git a/src/test/ui/run-pass/packed/packed-struct-size.rs b/src/test/run-pass/packed/packed-struct-size.rs similarity index 99% rename from src/test/ui/run-pass/packed/packed-struct-size.rs rename to src/test/run-pass/packed/packed-struct-size.rs index 85e7f1544a02..27e07b87ff41 100644 --- a/src/test/ui/run-pass/packed/packed-struct-size.rs +++ b/src/test/run-pass/packed/packed-struct-size.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/run-pass/packed/packed-struct-vec.rs b/src/test/run-pass/packed/packed-struct-vec.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-struct-vec.rs rename to src/test/run-pass/packed/packed-struct-vec.rs diff --git a/src/test/ui/run-pass/packed/packed-tuple-struct-layout.rs b/src/test/run-pass/packed/packed-tuple-struct-layout.rs similarity index 100% rename from src/test/ui/run-pass/packed/packed-tuple-struct-layout.rs rename to src/test/run-pass/packed/packed-tuple-struct-layout.rs diff --git a/src/test/ui/run-pass/packed/packed-tuple-struct-size.rs b/src/test/run-pass/packed/packed-tuple-struct-size.rs similarity index 98% rename from src/test/ui/run-pass/packed/packed-tuple-struct-size.rs rename to src/test/run-pass/packed/packed-tuple-struct-size.rs index b4e24925f75e..011ff4c20f4a 100644 --- a/src/test/ui/run-pass/packed/packed-tuple-struct-size.rs +++ b/src/test/run-pass/packed/packed-tuple-struct-size.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(repr_packed)] diff --git a/src/test/ui/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs b/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs similarity index 97% rename from src/test/ui/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs rename to src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs index 5bff65d0cfab..5de5786d6a59 100644 --- a/src/test/ui/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs +++ b/src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs @@ -9,7 +9,7 @@ // except according to those terms. // run-pass - +#![allow(unused_variables)] // compile-flags:-C panic=abort // aux-build:exit-success-if-unwind.rs // no-prefer-dynamic diff --git a/src/test/ui/run-pass/panic-runtime/abort.rs b/src/test/run-pass/panic-runtime/abort.rs similarity index 97% rename from src/test/ui/run-pass/panic-runtime/abort.rs rename to src/test/run-pass/panic-runtime/abort.rs index 2275efa188ed..621a258dc9d8 100644 --- a/src/test/ui/run-pass/panic-runtime/abort.rs +++ b/src/test/run-pass/panic-runtime/abort.rs @@ -9,7 +9,7 @@ // except according to those terms. // run-pass - +#![allow(unused_variables)] // compile-flags:-C panic=abort // no-prefer-dynamic // ignore-cloudabi no processes diff --git a/src/test/ui/run-pass/panic-runtime/auxiliary/exit-success-if-unwind.rs b/src/test/run-pass/panic-runtime/auxiliary/exit-success-if-unwind.rs similarity index 100% rename from src/test/ui/run-pass/panic-runtime/auxiliary/exit-success-if-unwind.rs rename to src/test/run-pass/panic-runtime/auxiliary/exit-success-if-unwind.rs diff --git a/src/test/ui/run-pass/panic-runtime/link-to-abort.rs b/src/test/run-pass/panic-runtime/link-to-abort.rs similarity index 100% rename from src/test/ui/run-pass/panic-runtime/link-to-abort.rs rename to src/test/run-pass/panic-runtime/link-to-abort.rs diff --git a/src/test/ui/run-pass/panic-runtime/link-to-unwind.rs b/src/test/run-pass/panic-runtime/link-to-unwind.rs similarity index 100% rename from src/test/ui/run-pass/panic-runtime/link-to-unwind.rs rename to src/test/run-pass/panic-runtime/link-to-unwind.rs diff --git a/src/test/ui/run-pass/panic-runtime/lto-abort.rs b/src/test/run-pass/panic-runtime/lto-abort.rs similarity index 97% rename from src/test/ui/run-pass/panic-runtime/lto-abort.rs rename to src/test/run-pass/panic-runtime/lto-abort.rs index 6e3dbe1d0f3c..dd884b966bce 100644 --- a/src/test/ui/run-pass/panic-runtime/lto-abort.rs +++ b/src/test/run-pass/panic-runtime/lto-abort.rs @@ -9,7 +9,7 @@ // except according to those terms. // run-pass - +#![allow(unused_variables)] // compile-flags:-C lto -C panic=abort // no-prefer-dynamic // ignore-cloudabi no processes diff --git a/src/test/ui/run-pass/panic-runtime/lto-unwind.rs b/src/test/run-pass/panic-runtime/lto-unwind.rs similarity index 97% rename from src/test/ui/run-pass/panic-runtime/lto-unwind.rs rename to src/test/run-pass/panic-runtime/lto-unwind.rs index a0caa4e80c2f..3b2a5dd7141e 100644 --- a/src/test/ui/run-pass/panic-runtime/lto-unwind.rs +++ b/src/test/run-pass/panic-runtime/lto-unwind.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // compile-flags:-C lto -C panic=unwind // no-prefer-dynamic diff --git a/src/test/run-pass/panic-uninitialized-zeroed.rs b/src/test/run-pass/panic-uninitialized-zeroed.rs deleted file mode 100644 index 2972f6efa32e..000000000000 --- a/src/test/run-pass/panic-uninitialized-zeroed.rs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-wasm32-bare always compiled as panic=abort right now and this requires unwinding -// This test checks that instantiating an uninhabited type via `mem::{uninitialized,zeroed}` results -// in a runtime panic. - -#![feature(never_type)] - -use std::{mem, panic}; - -#[allow(dead_code)] -struct Foo { - x: u8, - y: !, -} - -enum Bar {} - -fn main() { - unsafe { - assert_eq!( - panic::catch_unwind(|| { - mem::uninitialized::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type ! using mem::uninitialized" - })), - Some(true) - ); - - assert_eq!( - panic::catch_unwind(|| { - mem::zeroed::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type ! using mem::zeroed" - })), - Some(true) - ); - - assert_eq!( - panic::catch_unwind(|| { - mem::uninitialized::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type Foo using mem::uninitialized" - })), - Some(true) - ); - - assert_eq!( - panic::catch_unwind(|| { - mem::zeroed::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type Foo using mem::zeroed" - })), - Some(true) - ); - - assert_eq!( - panic::catch_unwind(|| { - mem::uninitialized::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type Bar using mem::uninitialized" - })), - Some(true) - ); - - assert_eq!( - panic::catch_unwind(|| { - mem::zeroed::() - }).err().and_then(|a| a.downcast_ref::().map(|s| { - s == "Attempted to instantiate uninhabited type Bar using mem::zeroed" - })), - Some(true) - ); - } -} diff --git a/src/test/ui/run-pass/panics/panic-handler-chain.rs b/src/test/run-pass/panics/panic-handler-chain.rs similarity index 100% rename from src/test/ui/run-pass/panics/panic-handler-chain.rs rename to src/test/run-pass/panics/panic-handler-chain.rs diff --git a/src/test/ui/run-pass/panics/panic-handler-flail-wildly.rs b/src/test/run-pass/panics/panic-handler-flail-wildly.rs similarity index 100% rename from src/test/ui/run-pass/panics/panic-handler-flail-wildly.rs rename to src/test/run-pass/panics/panic-handler-flail-wildly.rs diff --git a/src/test/ui/run-pass/panics/panic-handler-set-twice.rs b/src/test/run-pass/panics/panic-handler-set-twice.rs similarity index 97% rename from src/test/ui/run-pass/panics/panic-handler-set-twice.rs rename to src/test/run-pass/panics/panic-handler-set-twice.rs index 340333b119e6..1e493fc2bb49 100644 --- a/src/test/ui/run-pass/panics/panic-handler-set-twice.rs +++ b/src/test/run-pass/panics/panic-handler-set-twice.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(stable_features)] #![feature(std_panic)] diff --git a/src/test/ui/run-pass/panics/panic-in-dtor-drops-fields.rs b/src/test/run-pass/panics/panic-in-dtor-drops-fields.rs similarity index 97% rename from src/test/ui/run-pass/panics/panic-in-dtor-drops-fields.rs rename to src/test/run-pass/panics/panic-in-dtor-drops-fields.rs index f5dd2716d2cf..bb115f92b90f 100644 --- a/src/test/ui/run-pass/panics/panic-in-dtor-drops-fields.rs +++ b/src/test/run-pass/panics/panic-in-dtor-drops-fields.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] // ignore-emscripten no threads support diff --git a/src/test/ui/run-pass/panics/panic-recover-propagate.rs b/src/test/run-pass/panics/panic-recover-propagate.rs similarity index 100% rename from src/test/ui/run-pass/panics/panic-recover-propagate.rs rename to src/test/run-pass/panics/panic-recover-propagate.rs diff --git a/src/test/ui/run-pass/panics/panic-safe.rs b/src/test/run-pass/panics/panic-safe.rs similarity index 100% rename from src/test/ui/run-pass/panics/panic-safe.rs rename to src/test/run-pass/panics/panic-safe.rs diff --git a/src/test/ui/run-pass/privacy/auxiliary/priv-impl-prim-ty.rs b/src/test/run-pass/privacy/auxiliary/priv-impl-prim-ty.rs similarity index 100% rename from src/test/ui/run-pass/privacy/auxiliary/priv-impl-prim-ty.rs rename to src/test/run-pass/privacy/auxiliary/priv-impl-prim-ty.rs diff --git a/src/test/ui/run-pass/privacy/auxiliary/privacy_reexport.rs b/src/test/run-pass/privacy/auxiliary/privacy_reexport.rs similarity index 100% rename from src/test/ui/run-pass/privacy/auxiliary/privacy_reexport.rs rename to src/test/run-pass/privacy/auxiliary/privacy_reexport.rs diff --git a/src/test/ui/run-pass/privacy/auxiliary/pub_use_mods_xcrate.rs b/src/test/run-pass/privacy/auxiliary/pub_use_mods_xcrate.rs similarity index 100% rename from src/test/ui/run-pass/privacy/auxiliary/pub_use_mods_xcrate.rs rename to src/test/run-pass/privacy/auxiliary/pub_use_mods_xcrate.rs diff --git a/src/test/ui/run-pass/privacy/auxiliary/pub_use_xcrate1.rs b/src/test/run-pass/privacy/auxiliary/pub_use_xcrate1.rs similarity index 100% rename from src/test/ui/run-pass/privacy/auxiliary/pub_use_xcrate1.rs rename to src/test/run-pass/privacy/auxiliary/pub_use_xcrate1.rs diff --git a/src/test/ui/run-pass/privacy/auxiliary/pub_use_xcrate2.rs b/src/test/run-pass/privacy/auxiliary/pub_use_xcrate2.rs similarity index 100% rename from src/test/ui/run-pass/privacy/auxiliary/pub_use_xcrate2.rs rename to src/test/run-pass/privacy/auxiliary/pub_use_xcrate2.rs diff --git a/src/test/ui/run-pass/privacy/priv-impl-prim-ty.rs b/src/test/run-pass/privacy/priv-impl-prim-ty.rs similarity index 100% rename from src/test/ui/run-pass/privacy/priv-impl-prim-ty.rs rename to src/test/run-pass/privacy/priv-impl-prim-ty.rs diff --git a/src/test/ui/run-pass/privacy/privacy-ns.rs b/src/test/run-pass/privacy/privacy-ns.rs similarity index 100% rename from src/test/ui/run-pass/privacy/privacy-ns.rs rename to src/test/run-pass/privacy/privacy-ns.rs diff --git a/src/test/ui/run-pass/privacy/privacy-reexport.rs b/src/test/run-pass/privacy/privacy-reexport.rs similarity index 100% rename from src/test/ui/run-pass/privacy/privacy-reexport.rs rename to src/test/run-pass/privacy/privacy-reexport.rs diff --git a/src/test/ui/run-pass/privacy/privacy1.rs b/src/test/run-pass/privacy/privacy1.rs similarity index 97% rename from src/test/ui/run-pass/privacy/privacy1.rs rename to src/test/run-pass/privacy/privacy1.rs index 7c1dbb500d84..703867713e6b 100644 --- a/src/test/ui/run-pass/privacy/privacy1.rs +++ b/src/test/run-pass/privacy/privacy1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub mod test2 { diff --git a/src/test/ui/run-pass/privacy/private-class-field.rs b/src/test/run-pass/privacy/private-class-field.rs similarity index 97% rename from src/test/ui/run-pass/privacy/private-class-field.rs rename to src/test/run-pass/privacy/private-class-field.rs index 2910c462c2bc..15d83ea4d951 100644 --- a/src/test/ui/run-pass/privacy/private-class-field.rs +++ b/src/test/run-pass/privacy/private-class-field.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/privacy/private-method.rs b/src/test/run-pass/privacy/private-method.rs similarity index 97% rename from src/test/ui/run-pass/privacy/private-method.rs rename to src/test/run-pass/privacy/private-method.rs index a0f012a6059b..012616403c69 100644 --- a/src/test/ui/run-pass/privacy/private-method.rs +++ b/src/test/run-pass/privacy/private-method.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/privacy/pub-extern-privacy.rs b/src/test/run-pass/privacy/pub-extern-privacy.rs similarity index 100% rename from src/test/ui/run-pass/privacy/pub-extern-privacy.rs rename to src/test/run-pass/privacy/pub-extern-privacy.rs diff --git a/src/test/ui/run-pass/privacy/pub-use-xcrate.rs b/src/test/run-pass/privacy/pub-use-xcrate.rs similarity index 100% rename from src/test/ui/run-pass/privacy/pub-use-xcrate.rs rename to src/test/run-pass/privacy/pub-use-xcrate.rs diff --git a/src/test/ui/run-pass/privacy/pub_use_mods_xcrate_exe.rs b/src/test/run-pass/privacy/pub_use_mods_xcrate_exe.rs similarity index 100% rename from src/test/ui/run-pass/privacy/pub_use_mods_xcrate_exe.rs rename to src/test/run-pass/privacy/pub_use_mods_xcrate_exe.rs diff --git a/src/test/ui/run-pass/process/process-envs.rs b/src/test/run-pass/process/process-envs.rs similarity index 100% rename from src/test/ui/run-pass/process/process-envs.rs rename to src/test/run-pass/process/process-envs.rs diff --git a/src/test/ui/run-pass/process/process-exit.rs b/src/test/run-pass/process/process-exit.rs similarity index 97% rename from src/test/ui/run-pass/process/process-exit.rs rename to src/test/run-pass/process/process-exit.rs index e43631e3189a..6314dc2cd64f 100644 --- a/src/test/ui/run-pass/process/process-exit.rs +++ b/src/test/run-pass/process/process-exit.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // ignore-cloudabi no processes // ignore-emscripten no processes diff --git a/src/test/ui/run-pass/process/process-remove-from-env.rs b/src/test/run-pass/process/process-remove-from-env.rs similarity index 100% rename from src/test/ui/run-pass/process/process-remove-from-env.rs rename to src/test/run-pass/process/process-remove-from-env.rs diff --git a/src/test/ui/run-pass/process/process-sigpipe.rs b/src/test/run-pass/process/process-sigpipe.rs similarity index 98% rename from src/test/ui/run-pass/process/process-sigpipe.rs rename to src/test/run-pass/process/process-sigpipe.rs index d1e3fba14cf1..715da1514f30 100644 --- a/src/test/ui/run-pass/process/process-sigpipe.rs +++ b/src/test/run-pass/process/process-sigpipe.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(deprecated)] // ignore-android since the dynamic linker sets a SIGPIPE handler (to do diff --git a/src/test/ui/run-pass/process/process-spawn-nonexistent.rs b/src/test/run-pass/process/process-spawn-nonexistent.rs similarity index 100% rename from src/test/ui/run-pass/process/process-spawn-nonexistent.rs rename to src/test/run-pass/process/process-spawn-nonexistent.rs diff --git a/src/test/ui/run-pass/process/process-spawn-with-unicode-params.rs b/src/test/run-pass/process/process-spawn-with-unicode-params.rs similarity index 100% rename from src/test/ui/run-pass/process/process-spawn-with-unicode-params.rs rename to src/test/run-pass/process/process-spawn-with-unicode-params.rs diff --git a/src/test/ui/run-pass/process/process-status-inherits-stdin.rs b/src/test/run-pass/process/process-status-inherits-stdin.rs similarity index 100% rename from src/test/ui/run-pass/process/process-status-inherits-stdin.rs rename to src/test/run-pass/process/process-status-inherits-stdin.rs diff --git a/src/test/ui/run-pass/regions/regions-addr-of-interior-of-unique-box.rs b/src/test/run-pass/regions/regions-addr-of-interior-of-unique-box.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-addr-of-interior-of-unique-box.rs rename to src/test/run-pass/regions/regions-addr-of-interior-of-unique-box.rs index 770733b89397..8bd66b90d58c 100644 --- a/src/test/ui/run-pass/regions/regions-addr-of-interior-of-unique-box.rs +++ b/src/test/run-pass/regions/regions-addr-of-interior-of-unique-box.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-addr-of-ret.rs b/src/test/run-pass/regions/regions-addr-of-ret.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-addr-of-ret.rs rename to src/test/run-pass/regions/regions-addr-of-ret.rs diff --git a/src/test/ui/run-pass/regions/regions-assoc-type-region-bound.rs b/src/test/run-pass/regions/regions-assoc-type-region-bound.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-assoc-type-region-bound.rs rename to src/test/run-pass/regions/regions-assoc-type-region-bound.rs index a7801136a842..6a9a25352203 100644 --- a/src/test/ui/run-pass/regions/regions-assoc-type-region-bound.rs +++ b/src/test/run-pass/regions/regions-assoc-type-region-bound.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that the compiler considers the 'a bound declared in the // trait. Issue #20890. diff --git a/src/test/ui/run-pass/regions/regions-assoc-type-static-bound.rs b/src/test/run-pass/regions/regions-assoc-type-static-bound.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-assoc-type-static-bound.rs rename to src/test/run-pass/regions/regions-assoc-type-static-bound.rs index b81d30568130..e0bb62b8929d 100644 --- a/src/test/ui/run-pass/regions/regions-assoc-type-static-bound.rs +++ b/src/test/run-pass/regions/regions-assoc-type-static-bound.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that the compiler considers the 'static bound declared in the // trait. Issue #20890. diff --git a/src/test/ui/run-pass/regions/regions-borrow-at.rs b/src/test/run-pass/regions/regions-borrow-at.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-borrow-at.rs rename to src/test/run-pass/regions/regions-borrow-at.rs diff --git a/src/test/ui/run-pass/regions/regions-borrow-evec-fixed.rs b/src/test/run-pass/regions/regions-borrow-evec-fixed.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-borrow-evec-fixed.rs rename to src/test/run-pass/regions/regions-borrow-evec-fixed.rs diff --git a/src/test/ui/run-pass/regions/regions-borrow-evec-uniq.rs b/src/test/run-pass/regions/regions-borrow-evec-uniq.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-borrow-evec-uniq.rs rename to src/test/run-pass/regions/regions-borrow-evec-uniq.rs diff --git a/src/test/ui/run-pass/regions/regions-borrow-uniq.rs b/src/test/run-pass/regions/regions-borrow-uniq.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-borrow-uniq.rs rename to src/test/run-pass/regions/regions-borrow-uniq.rs diff --git a/src/test/ui/run-pass/regions/regions-bot.rs b/src/test/run-pass/regions/regions-bot.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-bot.rs rename to src/test/run-pass/regions/regions-bot.rs index d3af66b41622..3d1ac6277f7b 100644 --- a/src/test/ui/run-pass/regions/regions-bot.rs +++ b/src/test/run-pass/regions/regions-bot.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // A very limited test of the "bottom" region diff --git a/src/test/ui/run-pass/regions/regions-bound-lists-feature-gate-2.rs b/src/test/run-pass/regions/regions-bound-lists-feature-gate-2.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-bound-lists-feature-gate-2.rs rename to src/test/run-pass/regions/regions-bound-lists-feature-gate-2.rs index d5d2408d5d24..568b8eed4f38 100644 --- a/src/test/ui/run-pass/regions/regions-bound-lists-feature-gate-2.rs +++ b/src/test/run-pass/regions/regions-bound-lists-feature-gate-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(stable_features)] #![feature(issue_5723_bootstrap)] diff --git a/src/test/ui/run-pass/regions/regions-bound-lists-feature-gate.rs b/src/test/run-pass/regions/regions-bound-lists-feature-gate.rs similarity index 93% rename from src/test/ui/run-pass/regions/regions-bound-lists-feature-gate.rs rename to src/test/run-pass/regions/regions-bound-lists-feature-gate.rs index 50073f8b9f05..f2785992564f 100644 --- a/src/test/ui/run-pass/regions/regions-bound-lists-feature-gate.rs +++ b/src/test/run-pass/regions/regions-bound-lists-feature-gate.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(stable_features)] #![feature(issue_5723_bootstrap)] diff --git a/src/test/ui/run-pass/regions/regions-close-over-type-parameter-successfully.rs b/src/test/run-pass/regions/regions-close-over-type-parameter-successfully.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-close-over-type-parameter-successfully.rs rename to src/test/run-pass/regions/regions-close-over-type-parameter-successfully.rs diff --git a/src/test/ui/run-pass/regions/regions-copy-closure.rs b/src/test/run-pass/regions/regions-copy-closure.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-copy-closure.rs rename to src/test/run-pass/regions/regions-copy-closure.rs diff --git a/src/test/ui/run-pass/regions/regions-creating-enums2.rs b/src/test/run-pass/regions/regions-creating-enums2.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-creating-enums2.rs rename to src/test/run-pass/regions/regions-creating-enums2.rs index 84d4a261f1d9..51fdc2dc00e8 100644 --- a/src/test/ui/run-pass/regions/regions-creating-enums2.rs +++ b/src/test/run-pass/regions/regions-creating-enums2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-creating-enums5.rs b/src/test/run-pass/regions/regions-creating-enums5.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-creating-enums5.rs rename to src/test/run-pass/regions/regions-creating-enums5.rs index 24ba0c176113..637748ebec8a 100644 --- a/src/test/ui/run-pass/regions/regions-creating-enums5.rs +++ b/src/test/run-pass/regions/regions-creating-enums5.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-debruijn-of-object.rs b/src/test/run-pass/regions/regions-debruijn-of-object.rs similarity index 93% rename from src/test/ui/run-pass/regions/regions-debruijn-of-object.rs rename to src/test/run-pass/regions/regions-debruijn-of-object.rs index 71464f30ef03..100fd423cd46 100644 --- a/src/test/ui/run-pass/regions/regions-debruijn-of-object.rs +++ b/src/test/run-pass/regions/regions-debruijn-of-object.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-dependent-addr-of.rs b/src/test/run-pass/regions/regions-dependent-addr-of.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-dependent-addr-of.rs rename to src/test/run-pass/regions/regions-dependent-addr-of.rs diff --git a/src/test/ui/run-pass/regions/regions-dependent-autofn.rs b/src/test/run-pass/regions/regions-dependent-autofn.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-dependent-autofn.rs rename to src/test/run-pass/regions/regions-dependent-autofn.rs diff --git a/src/test/ui/run-pass/regions/regions-dependent-autoslice.rs b/src/test/run-pass/regions/regions-dependent-autoslice.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-dependent-autoslice.rs rename to src/test/run-pass/regions/regions-dependent-autoslice.rs diff --git a/src/test/ui/run-pass/regions/regions-dependent-let-ref.rs b/src/test/run-pass/regions/regions-dependent-let-ref.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-dependent-let-ref.rs rename to src/test/run-pass/regions/regions-dependent-let-ref.rs diff --git a/src/test/ui/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs b/src/test/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs rename to src/test/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs index 77659c100ff3..72c4dc377109 100644 --- a/src/test/ui/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs +++ b/src/test/run-pass/regions/regions-early-bound-lifetime-in-assoc-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Test that we are able to compile calls to associated fns like // `decode()` where the bound on the `Self` parameter references a // lifetime parameter of the trait. This example indicates why trait diff --git a/src/test/ui/run-pass/regions/regions-early-bound-trait-param.rs b/src/test/run-pass/regions/regions-early-bound-trait-param.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-early-bound-trait-param.rs rename to src/test/run-pass/regions/regions-early-bound-trait-param.rs diff --git a/src/test/ui/run-pass/regions/regions-early-bound-used-in-bound-method.rs b/src/test/run-pass/regions/regions-early-bound-used-in-bound-method.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-early-bound-used-in-bound-method.rs rename to src/test/run-pass/regions/regions-early-bound-used-in-bound-method.rs diff --git a/src/test/ui/run-pass/regions/regions-early-bound-used-in-bound.rs b/src/test/run-pass/regions/regions-early-bound-used-in-bound.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-early-bound-used-in-bound.rs rename to src/test/run-pass/regions/regions-early-bound-used-in-bound.rs diff --git a/src/test/ui/run-pass/regions/regions-early-bound-used-in-type-param.rs b/src/test/run-pass/regions/regions-early-bound-used-in-type-param.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-early-bound-used-in-type-param.rs rename to src/test/run-pass/regions/regions-early-bound-used-in-type-param.rs diff --git a/src/test/ui/run-pass/regions/regions-escape-into-other-fn.rs b/src/test/run-pass/regions/regions-escape-into-other-fn.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-escape-into-other-fn.rs rename to src/test/run-pass/regions/regions-escape-into-other-fn.rs diff --git a/src/test/ui/run-pass/regions/regions-expl-self.rs b/src/test/run-pass/regions/regions-expl-self.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-expl-self.rs rename to src/test/run-pass/regions/regions-expl-self.rs index 1af6febb53af..d19e7b6c7b5b 100644 --- a/src/test/ui/run-pass/regions/regions-expl-self.rs +++ b/src/test/run-pass/regions/regions-expl-self.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that you can insert an explicit lifetime in explicit self. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-fn-subtyping-2.rs b/src/test/run-pass/regions/regions-fn-subtyping-2.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-fn-subtyping-2.rs rename to src/test/run-pass/regions/regions-fn-subtyping-2.rs index a23c5005f07d..1f9f7baf48b2 100644 --- a/src/test/ui/run-pass/regions/regions-fn-subtyping-2.rs +++ b/src/test/run-pass/regions/regions-fn-subtyping-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #2263. // Here, `f` is a function that takes a pointer `x` and a function diff --git a/src/test/ui/run-pass/regions/regions-fn-subtyping.rs b/src/test/run-pass/regions/regions-fn-subtyping.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-fn-subtyping.rs rename to src/test/run-pass/regions/regions-fn-subtyping.rs index e561fa743462..0192890277b7 100644 --- a/src/test/ui/run-pass/regions/regions-fn-subtyping.rs +++ b/src/test/run-pass/regions/regions-fn-subtyping.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] // Issue #2263. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs b/src/test/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs rename to src/test/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs index 67a77940742d..bc316983f825 100644 --- a/src/test/ui/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs +++ b/src/test/run-pass/regions/regions-free-region-outlives-static-outlives-free-region.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that we recognize that if you have // // 'a : 'static diff --git a/src/test/ui/run-pass/regions/regions-infer-borrow-scope-addr-of.rs b/src/test/run-pass/regions/regions-infer-borrow-scope-addr-of.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-borrow-scope-addr-of.rs rename to src/test/run-pass/regions/regions-infer-borrow-scope-addr-of.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-borrow-scope-view.rs b/src/test/run-pass/regions/regions-infer-borrow-scope-view.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-borrow-scope-view.rs rename to src/test/run-pass/regions/regions-infer-borrow-scope-view.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-borrow-scope-within-loop-ok.rs b/src/test/run-pass/regions/regions-infer-borrow-scope-within-loop-ok.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-borrow-scope-within-loop-ok.rs rename to src/test/run-pass/regions/regions-infer-borrow-scope-within-loop-ok.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-borrow-scope.rs b/src/test/run-pass/regions/regions-infer-borrow-scope.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-infer-borrow-scope.rs rename to src/test/run-pass/regions/regions-infer-borrow-scope.rs index f3660d8dd17d..6bc2c62c6dcf 100644 --- a/src/test/ui/run-pass/regions/regions-infer-borrow-scope.rs +++ b/src/test/run-pass/regions/regions-infer-borrow-scope.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] struct Point {x: isize, y: isize} diff --git a/src/test/ui/run-pass/regions/regions-infer-call-2.rs b/src/test/run-pass/regions/regions-infer-call-2.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-call-2.rs rename to src/test/run-pass/regions/regions-infer-call-2.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-call.rs b/src/test/run-pass/regions/regions-infer-call.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-call.rs rename to src/test/run-pass/regions/regions-infer-call.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-contravariance-due-to-ret.rs b/src/test/run-pass/regions/regions-infer-contravariance-due-to-ret.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-contravariance-due-to-ret.rs rename to src/test/run-pass/regions/regions-infer-contravariance-due-to-ret.rs diff --git a/src/test/ui/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs b/src/test/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs rename to src/test/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs index f6ed97195c1d..0608802e6827 100644 --- a/src/test/ui/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs +++ b/src/test/run-pass/regions/regions-infer-reborrow-ref-mut-recurse.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test an edge case in region inference: the lifetime of the borrow // of `*x` must be extended to at least 'a. diff --git a/src/test/ui/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs b/src/test/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs similarity index 94% rename from src/test/ui/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs rename to src/test/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs index 7af25be1d03a..4eeeac1767c8 100644 --- a/src/test/ui/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs +++ b/src/test/run-pass/regions/regions-infer-region-in-fn-but-not-type.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/regions/regions-infer-static-from-proc.rs b/src/test/run-pass/regions/regions-infer-static-from-proc.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-infer-static-from-proc.rs rename to src/test/run-pass/regions/regions-infer-static-from-proc.rs diff --git a/src/test/ui/run-pass/regions/regions-issue-21422.rs b/src/test/run-pass/regions/regions-issue-21422.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-issue-21422.rs rename to src/test/run-pass/regions/regions-issue-21422.rs diff --git a/src/test/ui/run-pass/regions/regions-issue-22246.rs b/src/test/run-pass/regions/regions-issue-22246.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-issue-22246.rs rename to src/test/run-pass/regions/regions-issue-22246.rs index 8a54f30133ed..3b7cc8e37759 100644 --- a/src/test/ui/run-pass/regions/regions-issue-22246.rs +++ b/src/test/run-pass/regions/regions-issue-22246.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Regression test for issue #22246 -- we should be able to deduce // that `&'a B::Owned` implies that `B::Owned : 'a`. diff --git a/src/test/ui/run-pass/regions/regions-lifetime-nonfree-late-bound.rs b/src/test/run-pass/regions/regions-lifetime-nonfree-late-bound.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-lifetime-nonfree-late-bound.rs rename to src/test/run-pass/regions/regions-lifetime-nonfree-late-bound.rs diff --git a/src/test/ui/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs b/src/test/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs rename to src/test/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs index 758473634cb4..2f0de4f47841 100644 --- a/src/test/ui/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs +++ b/src/test/run-pass/regions/regions-lifetime-static-items-enclosing-scopes.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // This test verifies that temporary lifetime is correctly computed // for static objects in enclosing scopes. diff --git a/src/test/ui/run-pass/regions/regions-link-fn-args.rs b/src/test/run-pass/regions/regions-link-fn-args.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-link-fn-args.rs rename to src/test/run-pass/regions/regions-link-fn-args.rs diff --git a/src/test/ui/run-pass/regions/regions-lub-ref-ref-rc.rs b/src/test/run-pass/regions/regions-lub-ref-ref-rc.rs similarity index 98% rename from src/test/ui/run-pass/regions/regions-lub-ref-ref-rc.rs rename to src/test/run-pass/regions/regions-lub-ref-ref-rc.rs index 907746a65eed..110bc2f1fd30 100644 --- a/src/test/ui/run-pass/regions/regions-lub-ref-ref-rc.rs +++ b/src/test/run-pass/regions/regions-lub-ref-ref-rc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test a corner case of LUB coercion. In this case, one arm of the // match requires a deref coercion and the other doesn't, and there // is an extra `&` on the `rc`. We want to be sure that the lifetime diff --git a/src/test/ui/run-pass/regions/regions-mock-codegen.rs b/src/test/run-pass/regions/regions-mock-codegen.rs similarity index 98% rename from src/test/ui/run-pass/regions/regions-mock-codegen.rs rename to src/test/run-pass/regions/regions-mock-codegen.rs index 6d521432849e..2393457409ee 100644 --- a/src/test/ui/run-pass/regions/regions-mock-codegen.rs +++ b/src/test/run-pass/regions/regions-mock-codegen.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-no-bound-in-argument-cleanup.rs b/src/test/run-pass/regions/regions-no-bound-in-argument-cleanup.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-no-bound-in-argument-cleanup.rs rename to src/test/run-pass/regions/regions-no-bound-in-argument-cleanup.rs diff --git a/src/test/ui/run-pass/regions/regions-no-variance-from-fn-generics.rs b/src/test/run-pass/regions/regions-no-variance-from-fn-generics.rs similarity index 98% rename from src/test/ui/run-pass/regions/regions-no-variance-from-fn-generics.rs rename to src/test/run-pass/regions/regions-no-variance-from-fn-generics.rs index 3d0d5f2dbcfe..e409e43297ff 100644 --- a/src/test/ui/run-pass/regions/regions-no-variance-from-fn-generics.rs +++ b/src/test/run-pass/regions/regions-no-variance-from-fn-generics.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Issue #12856: a lifetime formal binding introduced by a generic fn // should not upset the variance inference for actual occurrences of // that lifetime in type expressions. diff --git a/src/test/ui/run-pass/regions/regions-nullary-variant.rs b/src/test/run-pass/regions/regions-nullary-variant.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-nullary-variant.rs rename to src/test/run-pass/regions/regions-nullary-variant.rs index b24e24963506..bde2cf1c082f 100644 --- a/src/test/ui/run-pass/regions/regions-nullary-variant.rs +++ b/src/test/run-pass/regions/regions-nullary-variant.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/regions/regions-params.rs b/src/test/run-pass/regions/regions-params.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-params.rs rename to src/test/run-pass/regions/regions-params.rs index b7060cb2b942..81e26e0444e4 100644 --- a/src/test/ui/run-pass/regions/regions-params.rs +++ b/src/test/run-pass/regions/regions-params.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_parens)] fn region_identity(x: &usize) -> &usize { x } diff --git a/src/test/ui/run-pass/regions/regions-reassign-let-bound-pointer.rs b/src/test/run-pass/regions/regions-reassign-let-bound-pointer.rs similarity index 93% rename from src/test/ui/run-pass/regions/regions-reassign-let-bound-pointer.rs rename to src/test/run-pass/regions/regions-reassign-let-bound-pointer.rs index 0a30dcb721f9..39dc92cbd7bf 100644 --- a/src/test/ui/run-pass/regions/regions-reassign-let-bound-pointer.rs +++ b/src/test/run-pass/regions/regions-reassign-let-bound-pointer.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] // Check that the type checker permits us to reassign `z` which // started out with a longer lifetime and was reassigned to a shorter // one (it should infer to be the intersection). diff --git a/src/test/ui/run-pass/regions/regions-reassign-match-bound-pointer.rs b/src/test/run-pass/regions/regions-reassign-match-bound-pointer.rs similarity index 93% rename from src/test/ui/run-pass/regions/regions-reassign-match-bound-pointer.rs rename to src/test/run-pass/regions/regions-reassign-match-bound-pointer.rs index 28455b1f3cf1..329efaf5555d 100644 --- a/src/test/ui/run-pass/regions/regions-reassign-match-bound-pointer.rs +++ b/src/test/run-pass/regions/regions-reassign-match-bound-pointer.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] +#![allow(unused_variables)] // Check that the type checker permits us to reassign `z` which // started out with a longer lifetime and was reassigned to a shorter // one (it should infer to be the intersection). diff --git a/src/test/ui/run-pass/regions/regions-refcell.rs b/src/test/run-pass/regions/regions-refcell.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-refcell.rs rename to src/test/run-pass/regions/regions-refcell.rs diff --git a/src/test/ui/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs b/src/test/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs similarity index 99% rename from src/test/ui/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs rename to src/test/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs index 86d841726293..1b6c025d7fa1 100644 --- a/src/test/ui/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs +++ b/src/test/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that this fairly specialized, but also reasonable, pattern // typechecks. The pattern involves regions bound in closures that // wind up related to inference variables. diff --git a/src/test/ui/run-pass/regions/regions-return-interior-of-option.rs b/src/test/run-pass/regions/regions-return-interior-of-option.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-return-interior-of-option.rs rename to src/test/run-pass/regions/regions-return-interior-of-option.rs diff --git a/src/test/ui/run-pass/regions/regions-scope-chain-example.rs b/src/test/run-pass/regions/regions-scope-chain-example.rs similarity index 96% rename from src/test/ui/run-pass/regions/regions-scope-chain-example.rs rename to src/test/run-pass/regions/regions-scope-chain-example.rs index 973f7bd5319a..ccfa080d216d 100644 --- a/src/test/ui/run-pass/regions/regions-scope-chain-example.rs +++ b/src/test/run-pass/regions/regions-scope-chain-example.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // This is an example where the older inference algorithm failed. The // specifics of why it failed are somewhat, but not entirely, tailed // to the algorithm. Ultimately the problem is that when computing the diff --git a/src/test/ui/run-pass/regions/regions-self-impls.rs b/src/test/run-pass/regions/regions-self-impls.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-self-impls.rs rename to src/test/run-pass/regions/regions-self-impls.rs diff --git a/src/test/ui/run-pass/regions/regions-self-in-enums.rs b/src/test/run-pass/regions/regions-self-in-enums.rs similarity index 97% rename from src/test/ui/run-pass/regions/regions-self-in-enums.rs rename to src/test/run-pass/regions/regions-self-in-enums.rs index 5cb9ad7774ce..61160951000f 100644 --- a/src/test/ui/run-pass/regions/regions-self-in-enums.rs +++ b/src/test/run-pass/regions/regions-self-in-enums.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![allow(non_camel_case_types)] enum int_wrapper<'a> { diff --git a/src/test/ui/run-pass/regions/regions-simple.rs b/src/test/run-pass/regions/regions-simple.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-simple.rs rename to src/test/run-pass/regions/regions-simple.rs diff --git a/src/test/ui/run-pass/regions/regions-static-bound.rs b/src/test/run-pass/regions/regions-static-bound.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-static-bound.rs rename to src/test/run-pass/regions/regions-static-bound.rs diff --git a/src/test/ui/run-pass/regions/regions-static-closure.rs b/src/test/run-pass/regions/regions-static-closure.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-static-closure.rs rename to src/test/run-pass/regions/regions-static-closure.rs diff --git a/src/test/ui/run-pass/regions/regions-trait-object-1.rs b/src/test/run-pass/regions/regions-trait-object-1.rs similarity index 100% rename from src/test/ui/run-pass/regions/regions-trait-object-1.rs rename to src/test/run-pass/regions/regions-trait-object-1.rs diff --git a/src/test/ui/run-pass/regions/regions-variance-contravariant-use-contravariant.rs b/src/test/run-pass/regions/regions-variance-contravariant-use-contravariant.rs similarity index 95% rename from src/test/ui/run-pass/regions/regions-variance-contravariant-use-contravariant.rs rename to src/test/run-pass/regions/regions-variance-contravariant-use-contravariant.rs index ffab7dc2e413..de19fbd0e8ce 100644 --- a/src/test/ui/run-pass/regions/regions-variance-contravariant-use-contravariant.rs +++ b/src/test/run-pass/regions/regions-variance-contravariant-use-contravariant.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that a type which is contravariant with respect to its region // parameter compiles successfully when used in a contravariant way. // diff --git a/src/test/ui/run-pass/regions/regions-variance-covariant-use-covariant.rs b/src/test/run-pass/regions/regions-variance-covariant-use-covariant.rs similarity index 98% rename from src/test/ui/run-pass/regions/regions-variance-covariant-use-covariant.rs rename to src/test/run-pass/regions/regions-variance-covariant-use-covariant.rs index ea0051c6b265..fb20324ce976 100644 --- a/src/test/ui/run-pass/regions/regions-variance-covariant-use-covariant.rs +++ b/src/test/run-pass/regions/regions-variance-covariant-use-covariant.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test that a type which is covariant with respect to its region // parameter is successful when used in a covariant way. // diff --git a/src/test/ui/run-pass/rfcs/rfc-1014-2.rs b/src/test/run-pass/rfcs/rfc-1014-2.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-1014-2.rs rename to src/test/run-pass/rfcs/rfc-1014-2.rs index f0ff85612436..7fbc0d1db70d 100644 --- a/src/test/ui/run-pass/rfcs/rfc-1014-2.rs +++ b/src/test/run-pass/rfcs/rfc-1014-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(libc)] diff --git a/src/test/ui/run-pass/rfcs/rfc-1014.rs b/src/test/run-pass/rfcs/rfc-1014.rs similarity index 98% rename from src/test/ui/run-pass/rfcs/rfc-1014.rs rename to src/test/run-pass/rfcs/rfc-1014.rs index 35290ae8e6a2..d101c3c9ab19 100644 --- a/src/test/ui/run-pass/rfcs/rfc-1014.rs +++ b/src/test/run-pass/rfcs/rfc-1014.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-cloudabi stdout does not map to file descriptor 1 by default // ignore-wasm32-bare no libc diff --git a/src/test/ui/run-pass/rfcs/rfc-1789-as-cell/from-mut.rs b/src/test/run-pass/rfcs/rfc-1789-as-cell/from-mut.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1789-as-cell/from-mut.rs rename to src/test/run-pass/rfcs/rfc-1789-as-cell/from-mut.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs b/src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs rename to src/test/run-pass/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs similarity index 95% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs index f0ef9ca37b3a..8d67e235a934 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs +++ b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/box.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unreachable_patterns)] #![feature(box_syntax, box_patterns)] struct Foo{} diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/constref.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/constref.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/constref.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/constref.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/enum.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/enum.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/enum.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/enum.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/for.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/for.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/for.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/for.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs similarity index 99% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs index 2aad9ccd6efa..6244daab1e6f 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs +++ b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/general.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] fn some_or_wildcard(r: &Option, b: &i32) { let _: &i32 = match r { Some(a) => a, diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs similarity index 98% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs index ac6f61b32b71..9df250ea3995 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs +++ b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/lit.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] fn with_u8() { let s = 5u8; let r = match &s { diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/range.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/range.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/range.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/range.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/ref-region.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/ref-region.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/ref-region.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/ref-region.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/reset-mode.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/reset-mode.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/reset-mode.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/reset-mode.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/slice.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/slice.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/slice.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/slice.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/struct.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/struct.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/struct.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/struct.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs index 072332cd9d0a..9427482ed9c0 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs +++ b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Foo { Bar(Option, (), (), Vec), Baz, diff --git a/src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/tuple.rs b/src/test/run-pass/rfcs/rfc-2005-default-binding-mode/tuple.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2005-default-binding-mode/tuple.rs rename to src/test/run-pass/rfcs/rfc-2005-default-binding-mode/tuple.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/enums.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/enums.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/enums.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/enums.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/enums_same_crate.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/enums_same_crate.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/enums_same_crate.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/enums_same_crate.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs similarity index 95% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs index 2bfdddc8eb70..34756677636f 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs +++ b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // aux-build:structs.rs extern crate structs; diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs index 6c71c05709c5..4bbd9e2b7fa3 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs +++ b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![feature(non_exhaustive)] #[non_exhaustive] diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/variants.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/variants.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/variants.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/variants.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs b/src/test/run-pass/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs rename to src/test/run-pass/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs similarity index 98% rename from src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs rename to src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs index 71904acae724..612f5bc0cfcb 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs +++ b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.rs @@ -10,7 +10,7 @@ // run-pass #![feature(crate_in_paths)] - +#![allow(dead_code)] use crate::m::f; use crate as root; diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.stderr b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.stderr similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.stderr rename to src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.stderr diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs rename to src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs index 37821777822f..fc77d744a23e 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs +++ b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.rs @@ -11,7 +11,7 @@ // run-pass #![feature(crate_in_paths)] #![feature(crate_visibility_modifier)] - +#![allow(dead_code)] mod m { pub struct Z; pub struct S1(crate (::m::Z)); // OK diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.stderr b/src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.stderr similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.stderr rename to src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.stderr diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs rename to src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs rename to src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs index b13602297a4a..61cf6dcf30c4 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs +++ b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/basic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:xcrate.rs // compile-flags:--extern xcrate // edition:2018 diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs similarity index 98% rename from src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs rename to src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs index 0d84ccc3d322..e25f76ab48ee 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs +++ b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:xcrate.rs // compile-flags:--extern xcrate diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/test.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/test.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/test.rs rename to src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/test.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/whitelisted.rs b/src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/whitelisted.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2126-extern-absolute-paths/whitelisted.rs rename to src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/whitelisted.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/attr.rs b/src/test/run-pass/rfcs/rfc-2151-raw-identifiers/attr.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/attr.rs rename to src/test/run-pass/rfcs/rfc-2151-raw-identifiers/attr.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/basic.rs b/src/test/run-pass/rfcs/rfc-2151-raw-identifiers/basic.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/basic.rs rename to src/test/run-pass/rfcs/rfc-2151-raw-identifiers/basic.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/items.rs b/src/test/run-pass/rfcs/rfc-2151-raw-identifiers/items.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/items.rs rename to src/test/run-pass/rfcs/rfc-2151-raw-identifiers/items.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/macros.rs b/src/test/run-pass/rfcs/rfc-2151-raw-identifiers/macros.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2151-raw-identifiers/macros.rs rename to src/test/run-pass/rfcs/rfc-2151-raw-identifiers/macros.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs b/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs similarity index 97% rename from src/test/ui/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs rename to src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs index 29e8ab8ed1fb..f9d1ee0e9e05 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs +++ b/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(if_while_or_patterns)] enum E { diff --git a/src/test/ui/run-pass/rfcs/rfc-2302-self-struct-ctor.rs b/src/test/run-pass/rfcs/rfc-2302-self-struct-ctor.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc-2302-self-struct-ctor.rs rename to src/test/run-pass/rfcs/rfc-2302-self-struct-ctor.rs diff --git a/src/test/ui/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs b/src/test/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs similarity index 93% rename from src/test/ui/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs rename to src/test/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs index 755e3cb8c3b7..a6046cdba94b 100644 --- a/src/test/ui/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs +++ b/src/test/run-pass/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that removed keywords are allowed as identifiers. fn main () { let offsetof = (); diff --git a/src/test/ui/run-pass/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs b/src/test/run-pass/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs rename to src/test/run-pass/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs diff --git a/src/test/ui/run-pass/rfcs/rfc1445/eq-allows-match.rs b/src/test/run-pass/rfcs/rfc1445/eq-allows-match.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc1445/eq-allows-match.rs rename to src/test/run-pass/rfcs/rfc1445/eq-allows-match.rs diff --git a/src/test/ui/run-pass/rfcs/rfc1623.rs b/src/test/run-pass/rfcs/rfc1623.rs similarity index 98% rename from src/test/ui/run-pass/rfcs/rfc1623.rs rename to src/test/run-pass/rfcs/rfc1623.rs index ddb83317fd93..cc085a6f3678 100644 --- a/src/test/ui/run-pass/rfcs/rfc1623.rs +++ b/src/test/run-pass/rfcs/rfc1623.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(non_upper_case_globals)] #![allow(dead_code)] diff --git a/src/test/ui/run-pass/rfcs/rfc1717/auxiliary/clibrary.rs b/src/test/run-pass/rfcs/rfc1717/auxiliary/clibrary.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc1717/auxiliary/clibrary.rs rename to src/test/run-pass/rfcs/rfc1717/auxiliary/clibrary.rs diff --git a/src/test/ui/run-pass/rfcs/rfc1717/library-override.rs b/src/test/run-pass/rfcs/rfc1717/library-override.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc1717/library-override.rs rename to src/test/run-pass/rfcs/rfc1717/library-override.rs diff --git a/src/test/ui/run-pass/rfcs/rfc1857-drop-order.rs b/src/test/run-pass/rfcs/rfc1857-drop-order.rs similarity index 100% rename from src/test/ui/run-pass/rfcs/rfc1857-drop-order.rs rename to src/test/run-pass/rfcs/rfc1857-drop-order.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_raw_pointer_struct.rs b/src/test/run-pass/self/arbitrary_self_types_raw_pointer_struct.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_raw_pointer_struct.rs rename to src/test/run-pass/self/arbitrary_self_types_raw_pointer_struct.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_raw_pointer_trait.rs b/src/test/run-pass/self/arbitrary_self_types_raw_pointer_trait.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_raw_pointer_trait.rs rename to src/test/run-pass/self/arbitrary_self_types_raw_pointer_trait.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_silly.rs b/src/test/run-pass/self/arbitrary_self_types_silly.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_silly.rs rename to src/test/run-pass/self/arbitrary_self_types_silly.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_struct.rs b/src/test/run-pass/self/arbitrary_self_types_struct.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_struct.rs rename to src/test/run-pass/self/arbitrary_self_types_struct.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_trait.rs b/src/test/run-pass/self/arbitrary_self_types_trait.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_trait.rs rename to src/test/run-pass/self/arbitrary_self_types_trait.rs diff --git a/src/test/ui/run-pass/self/arbitrary_self_types_unsized_struct.rs b/src/test/run-pass/self/arbitrary_self_types_unsized_struct.rs similarity index 100% rename from src/test/ui/run-pass/self/arbitrary_self_types_unsized_struct.rs rename to src/test/run-pass/self/arbitrary_self_types_unsized_struct.rs diff --git a/src/test/ui/run-pass/self/auxiliary/explicit_self_xcrate.rs b/src/test/run-pass/self/auxiliary/explicit_self_xcrate.rs similarity index 100% rename from src/test/ui/run-pass/self/auxiliary/explicit_self_xcrate.rs rename to src/test/run-pass/self/auxiliary/explicit_self_xcrate.rs diff --git a/src/test/ui/run-pass/self/builtin-superkinds-self-type.rs b/src/test/run-pass/self/builtin-superkinds-self-type.rs similarity index 100% rename from src/test/ui/run-pass/self/builtin-superkinds-self-type.rs rename to src/test/run-pass/self/builtin-superkinds-self-type.rs diff --git a/src/test/ui/run-pass/self/by-value-self-in-mut-slot.rs b/src/test/run-pass/self/by-value-self-in-mut-slot.rs similarity index 100% rename from src/test/ui/run-pass/self/by-value-self-in-mut-slot.rs rename to src/test/run-pass/self/by-value-self-in-mut-slot.rs diff --git a/src/test/ui/run-pass/self/explicit-self-closures.rs b/src/test/run-pass/self/explicit-self-closures.rs similarity index 97% rename from src/test/ui/run-pass/self/explicit-self-closures.rs rename to src/test/run-pass/self/explicit-self-closures.rs index 0144433010f4..04e40021a5fb 100644 --- a/src/test/ui/run-pass/self/explicit-self-closures.rs +++ b/src/test/run-pass/self/explicit-self-closures.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test to make sure that explicit self params work inside closures // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/self/explicit-self-generic.rs b/src/test/run-pass/self/explicit-self-generic.rs similarity index 97% rename from src/test/ui/run-pass/self/explicit-self-generic.rs rename to src/test/run-pass/self/explicit-self-generic.rs index cf1546810a45..d23ad94f1f56 100644 --- a/src/test/ui/run-pass/self/explicit-self-generic.rs +++ b/src/test/run-pass/self/explicit-self-generic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] #[derive(Copy, Clone)] diff --git a/src/test/ui/run-pass/self/explicit-self-objects-uniq.rs b/src/test/run-pass/self/explicit-self-objects-uniq.rs similarity index 100% rename from src/test/ui/run-pass/self/explicit-self-objects-uniq.rs rename to src/test/run-pass/self/explicit-self-objects-uniq.rs diff --git a/src/test/ui/run-pass/self/explicit-self.rs b/src/test/run-pass/self/explicit-self.rs similarity index 98% rename from src/test/ui/run-pass/self/explicit-self.rs rename to src/test/run-pass/self/explicit-self.rs index 862d02bda0ce..1cf38a384ca5 100644 --- a/src/test/ui/run-pass/self/explicit-self.rs +++ b/src/test/run-pass/self/explicit-self.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/run-pass/self/explicit_self_xcrate_exe.rs b/src/test/run-pass/self/explicit_self_xcrate_exe.rs similarity index 100% rename from src/test/ui/run-pass/self/explicit_self_xcrate_exe.rs rename to src/test/run-pass/self/explicit_self_xcrate_exe.rs diff --git a/src/test/ui/run-pass/self/move-self.rs b/src/test/run-pass/self/move-self.rs similarity index 100% rename from src/test/ui/run-pass/self/move-self.rs rename to src/test/run-pass/self/move-self.rs diff --git a/src/test/ui/run-pass/self/object-safety-sized-self-by-value-self.rs b/src/test/run-pass/self/object-safety-sized-self-by-value-self.rs similarity index 98% rename from src/test/ui/run-pass/self/object-safety-sized-self-by-value-self.rs rename to src/test/run-pass/self/object-safety-sized-self-by-value-self.rs index 2ea1dcb221e1..42ed4f91e73e 100644 --- a/src/test/ui/run-pass/self/object-safety-sized-self-by-value-self.rs +++ b/src/test/run-pass/self/object-safety-sized-self-by-value-self.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // Check that a trait is still object-safe (and usable) if it has // methods with by-value self so long as they require `Self : Sized`. diff --git a/src/test/ui/run-pass/self/object-safety-sized-self-generic-method.rs b/src/test/run-pass/self/object-safety-sized-self-generic-method.rs similarity index 97% rename from src/test/ui/run-pass/self/object-safety-sized-self-generic-method.rs rename to src/test/run-pass/self/object-safety-sized-self-generic-method.rs index 5f8ae3ce4954..218a36f22264 100644 --- a/src/test/ui/run-pass/self/object-safety-sized-self-generic-method.rs +++ b/src/test/run-pass/self/object-safety-sized-self-generic-method.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Check that a trait is still object-safe (and usable) if it has // generic methods so long as they require `Self : Sized`. diff --git a/src/test/ui/run-pass/self/object-safety-sized-self-return-Self.rs b/src/test/run-pass/self/object-safety-sized-self-return-Self.rs similarity index 100% rename from src/test/ui/run-pass/self/object-safety-sized-self-return-Self.rs rename to src/test/run-pass/self/object-safety-sized-self-return-Self.rs diff --git a/src/test/ui/run-pass/self/self-impl.rs b/src/test/run-pass/self/self-impl.rs similarity index 97% rename from src/test/ui/run-pass/self/self-impl.rs rename to src/test/run-pass/self/self-impl.rs index c0a7eee437cc..465ca4678598 100644 --- a/src/test/ui/run-pass/self/self-impl.rs +++ b/src/test/run-pass/self/self-impl.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that we can use `Self` types in impls in the expected way. // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/self/self-in-mut-slot-default-method.rs b/src/test/run-pass/self/self-in-mut-slot-default-method.rs similarity index 100% rename from src/test/ui/run-pass/self/self-in-mut-slot-default-method.rs rename to src/test/run-pass/self/self-in-mut-slot-default-method.rs diff --git a/src/test/ui/run-pass/self/self-in-mut-slot-immediate-value.rs b/src/test/run-pass/self/self-in-mut-slot-immediate-value.rs similarity index 100% rename from src/test/ui/run-pass/self/self-in-mut-slot-immediate-value.rs rename to src/test/run-pass/self/self-in-mut-slot-immediate-value.rs diff --git a/src/test/ui/run-pass/self/self-in-typedefs.rs b/src/test/run-pass/self/self-in-typedefs.rs similarity index 100% rename from src/test/ui/run-pass/self/self-in-typedefs.rs rename to src/test/run-pass/self/self-in-typedefs.rs diff --git a/src/test/ui/run-pass/self/self-re-assign.rs b/src/test/run-pass/self/self-re-assign.rs similarity index 100% rename from src/test/ui/run-pass/self/self-re-assign.rs rename to src/test/run-pass/self/self-re-assign.rs diff --git a/src/test/ui/run-pass/self/self-shadowing-import.rs b/src/test/run-pass/self/self-shadowing-import.rs similarity index 100% rename from src/test/ui/run-pass/self/self-shadowing-import.rs rename to src/test/run-pass/self/self-shadowing-import.rs diff --git a/src/test/ui/run-pass/self/self-type-param.rs b/src/test/run-pass/self/self-type-param.rs similarity index 96% rename from src/test/ui/run-pass/self/self-type-param.rs rename to src/test/run-pass/self/self-type-param.rs index 13e28e62e5ea..645d61d79c81 100644 --- a/src/test/ui/run-pass/self/self-type-param.rs +++ b/src/test/run-pass/self/self-type-param.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 trait MyTrait { diff --git a/src/test/ui/run-pass/self/string-self-append.rs b/src/test/run-pass/self/string-self-append.rs similarity index 100% rename from src/test/ui/run-pass/self/string-self-append.rs rename to src/test/run-pass/self/string-self-append.rs diff --git a/src/test/ui/run-pass/self/ufcs-explicit-self.rs b/src/test/run-pass/self/ufcs-explicit-self.rs similarity index 100% rename from src/test/ui/run-pass/self/ufcs-explicit-self.rs rename to src/test/run-pass/self/ufcs-explicit-self.rs diff --git a/src/test/ui/run-pass/self/uniq-self-in-mut-slot.rs b/src/test/run-pass/self/uniq-self-in-mut-slot.rs similarity index 100% rename from src/test/ui/run-pass/self/uniq-self-in-mut-slot.rs rename to src/test/run-pass/self/uniq-self-in-mut-slot.rs diff --git a/src/test/ui/run-pass/self/where-for-self.rs b/src/test/run-pass/self/where-for-self.rs similarity index 100% rename from src/test/ui/run-pass/self/where-for-self.rs rename to src/test/run-pass/self/where-for-self.rs diff --git a/src/test/ui/run-pass/sepcomp/auxiliary/sepcomp-extern-lib.rs b/src/test/run-pass/sepcomp/auxiliary/sepcomp-extern-lib.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/auxiliary/sepcomp-extern-lib.rs rename to src/test/run-pass/sepcomp/auxiliary/sepcomp-extern-lib.rs diff --git a/src/test/ui/run-pass/sepcomp/auxiliary/sepcomp_cci_lib.rs b/src/test/run-pass/sepcomp/auxiliary/sepcomp_cci_lib.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/auxiliary/sepcomp_cci_lib.rs rename to src/test/run-pass/sepcomp/auxiliary/sepcomp_cci_lib.rs diff --git a/src/test/ui/run-pass/sepcomp/auxiliary/sepcomp_lib.rs b/src/test/run-pass/sepcomp/auxiliary/sepcomp_lib.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/auxiliary/sepcomp_lib.rs rename to src/test/run-pass/sepcomp/auxiliary/sepcomp_lib.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-cci.rs b/src/test/run-pass/sepcomp/sepcomp-cci.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/sepcomp-cci.rs rename to src/test/run-pass/sepcomp/sepcomp-cci.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-extern.rs b/src/test/run-pass/sepcomp/sepcomp-extern.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/sepcomp-extern.rs rename to src/test/run-pass/sepcomp/sepcomp-extern.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-fns-backwards.rs b/src/test/run-pass/sepcomp/sepcomp-fns-backwards.rs similarity index 98% rename from src/test/ui/run-pass/sepcomp/sepcomp-fns-backwards.rs rename to src/test/run-pass/sepcomp/sepcomp-fns-backwards.rs index 96993d3a7bef..8241711bc121 100644 --- a/src/test/ui/run-pass/sepcomp/sepcomp-fns-backwards.rs +++ b/src/test/run-pass/sepcomp/sepcomp-fns-backwards.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-bitrig // compile-flags: -C codegen-units=3 diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-fns.rs b/src/test/run-pass/sepcomp/sepcomp-fns.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/sepcomp-fns.rs rename to src/test/run-pass/sepcomp/sepcomp-fns.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-lib-lto.rs b/src/test/run-pass/sepcomp/sepcomp-lib-lto.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/sepcomp-lib-lto.rs rename to src/test/run-pass/sepcomp/sepcomp-lib-lto.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-lib.rs b/src/test/run-pass/sepcomp/sepcomp-lib.rs similarity index 100% rename from src/test/ui/run-pass/sepcomp/sepcomp-lib.rs rename to src/test/run-pass/sepcomp/sepcomp-lib.rs diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-statics.rs b/src/test/run-pass/sepcomp/sepcomp-statics.rs similarity index 98% rename from src/test/ui/run-pass/sepcomp/sepcomp-statics.rs rename to src/test/run-pass/sepcomp/sepcomp-statics.rs index 7022a5eee719..8739b9f52de5 100644 --- a/src/test/ui/run-pass/sepcomp/sepcomp-statics.rs +++ b/src/test/run-pass/sepcomp/sepcomp-statics.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-bitrig // compile-flags: -C codegen-units=3 diff --git a/src/test/ui/run-pass/sepcomp/sepcomp-unwind.rs b/src/test/run-pass/sepcomp/sepcomp-unwind.rs similarity index 98% rename from src/test/ui/run-pass/sepcomp/sepcomp-unwind.rs rename to src/test/run-pass/sepcomp/sepcomp-unwind.rs index 15b076532246..7a1642bcb29e 100644 --- a/src/test/ui/run-pass/sepcomp/sepcomp-unwind.rs +++ b/src/test/run-pass/sepcomp/sepcomp-unwind.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-bitrig // compile-flags: -C codegen-units=3 // ignore-emscripten no threads support diff --git a/src/test/ui/run-pass/simd/simd-generics.rs b/src/test/run-pass/simd/simd-generics.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-generics.rs rename to src/test/run-pass/simd/simd-generics.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-float-math.rs b/src/test/run-pass/simd/simd-intrinsic-float-math.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-float-math.rs rename to src/test/run-pass/simd/simd-intrinsic-float-math.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-float-minmax.rs b/src/test/run-pass/simd/simd-intrinsic-float-minmax.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-float-minmax.rs rename to src/test/run-pass/simd/simd-intrinsic-float-minmax.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-arithmetic.rs b/src/test/run-pass/simd/simd-intrinsic-generic-arithmetic.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-arithmetic.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-arithmetic.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-cast.rs b/src/test/run-pass/simd/simd-intrinsic-generic-cast.rs similarity index 99% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-cast.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-cast.rs index e24a141e6e03..f0fb24b5832b 100644 --- a/src/test/ui/run-pass/simd/simd-intrinsic-generic-cast.rs +++ b/src/test/run-pass/simd/simd-intrinsic-generic-cast.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten FIXME(#45351) hits an LLVM assert #![feature(repr_simd, platform_intrinsics, concat_idents, test)] diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-comparison.rs b/src/test/run-pass/simd/simd-intrinsic-generic-comparison.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-comparison.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-comparison.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-elements.rs b/src/test/run-pass/simd/simd-intrinsic-generic-elements.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-elements.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-elements.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-gather.rs b/src/test/run-pass/simd/simd-intrinsic-generic-gather.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-gather.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-gather.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-reduction.rs b/src/test/run-pass/simd/simd-intrinsic-generic-reduction.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-reduction.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-reduction.rs diff --git a/src/test/ui/run-pass/simd/simd-intrinsic-generic-select.rs b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-intrinsic-generic-select.rs rename to src/test/run-pass/simd/simd-intrinsic-generic-select.rs diff --git a/src/test/ui/run-pass/simd/simd-size-align.rs b/src/test/run-pass/simd/simd-size-align.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-size-align.rs rename to src/test/run-pass/simd/simd-size-align.rs diff --git a/src/test/ui/run-pass/simd/simd-target-feature-mixup.rs b/src/test/run-pass/simd/simd-target-feature-mixup.rs similarity index 99% rename from src/test/ui/run-pass/simd/simd-target-feature-mixup.rs rename to src/test/run-pass/simd/simd-target-feature-mixup.rs index 7ac91592d81d..5c845031ee41 100644 --- a/src/test/ui/run-pass/simd/simd-target-feature-mixup.rs +++ b/src/test/run-pass/simd/simd-target-feature-mixup.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(stable_features)] #![allow(overflowing_literals)] diff --git a/src/test/ui/run-pass/simd/simd-type.rs b/src/test/run-pass/simd/simd-type.rs similarity index 96% rename from src/test/ui/run-pass/simd/simd-type.rs rename to src/test/run-pass/simd/simd-type.rs index a1a655eec86d..3be3960e7ced 100644 --- a/src/test/ui/run-pass/simd/simd-type.rs +++ b/src/test/run-pass/simd/simd-type.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/simd/simd-upgraded.rs b/src/test/run-pass/simd/simd-upgraded.rs similarity index 100% rename from src/test/ui/run-pass/simd/simd-upgraded.rs rename to src/test/run-pass/simd/simd-upgraded.rs diff --git a/src/test/ui/run-pass/specialization/README.md b/src/test/run-pass/specialization/README.md similarity index 100% rename from src/test/ui/run-pass/specialization/README.md rename to src/test/run-pass/specialization/README.md diff --git a/src/test/ui/run-pass/specialization/assoc-ty-graph-cycle.rs b/src/test/run-pass/specialization/assoc-ty-graph-cycle.rs similarity index 100% rename from src/test/ui/run-pass/specialization/assoc-ty-graph-cycle.rs rename to src/test/run-pass/specialization/assoc-ty-graph-cycle.rs diff --git a/src/test/ui/run-pass/specialization/auxiliary/cross_crates_defaults.rs b/src/test/run-pass/specialization/auxiliary/cross_crates_defaults.rs similarity index 100% rename from src/test/ui/run-pass/specialization/auxiliary/cross_crates_defaults.rs rename to src/test/run-pass/specialization/auxiliary/cross_crates_defaults.rs diff --git a/src/test/ui/run-pass/specialization/auxiliary/go_trait.rs b/src/test/run-pass/specialization/auxiliary/go_trait.rs similarity index 100% rename from src/test/ui/run-pass/specialization/auxiliary/go_trait.rs rename to src/test/run-pass/specialization/auxiliary/go_trait.rs diff --git a/src/test/ui/run-pass/specialization/auxiliary/specialization_cross_crate.rs b/src/test/run-pass/specialization/auxiliary/specialization_cross_crate.rs similarity index 100% rename from src/test/ui/run-pass/specialization/auxiliary/specialization_cross_crate.rs rename to src/test/run-pass/specialization/auxiliary/specialization_cross_crate.rs diff --git a/src/test/ui/run-pass/specialization/cross-crate-defaults.rs b/src/test/run-pass/specialization/cross-crate-defaults.rs similarity index 100% rename from src/test/ui/run-pass/specialization/cross-crate-defaults.rs rename to src/test/run-pass/specialization/cross-crate-defaults.rs diff --git a/src/test/ui/run-pass/specialization/defaultimpl/allowed-cross-crate.rs b/src/test/run-pass/specialization/defaultimpl/allowed-cross-crate.rs similarity index 91% rename from src/test/ui/run-pass/specialization/defaultimpl/allowed-cross-crate.rs rename to src/test/run-pass/specialization/defaultimpl/allowed-cross-crate.rs index 4a481beffd2a..941bc55a5858 100644 --- a/src/test/ui/run-pass/specialization/defaultimpl/allowed-cross-crate.rs +++ b/src/test/run-pass/specialization/defaultimpl/allowed-cross-crate.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +#![allow(unused_imports)] // aux-build:go_trait.rs diff --git a/src/test/ui/run-pass/specialization/defaultimpl/auxiliary/go_trait.rs b/src/test/run-pass/specialization/defaultimpl/auxiliary/go_trait.rs similarity index 100% rename from src/test/ui/run-pass/specialization/defaultimpl/auxiliary/go_trait.rs rename to src/test/run-pass/specialization/defaultimpl/auxiliary/go_trait.rs diff --git a/src/test/ui/run-pass/specialization/defaultimpl/out-of-order.rs b/src/test/run-pass/specialization/defaultimpl/out-of-order.rs similarity index 100% rename from src/test/ui/run-pass/specialization/defaultimpl/out-of-order.rs rename to src/test/run-pass/specialization/defaultimpl/out-of-order.rs diff --git a/src/test/ui/run-pass/specialization/defaultimpl/overlap-projection.rs b/src/test/run-pass/specialization/defaultimpl/overlap-projection.rs similarity index 100% rename from src/test/ui/run-pass/specialization/defaultimpl/overlap-projection.rs rename to src/test/run-pass/specialization/defaultimpl/overlap-projection.rs diff --git a/src/test/ui/run-pass/specialization/defaultimpl/projection.rs b/src/test/run-pass/specialization/defaultimpl/projection.rs similarity index 98% rename from src/test/ui/run-pass/specialization/defaultimpl/projection.rs rename to src/test/run-pass/specialization/defaultimpl/projection.rs index 989f4f286f2c..9d8d99e9ca31 100644 --- a/src/test/ui/run-pass/specialization/defaultimpl/projection.rs +++ b/src/test/run-pass/specialization/defaultimpl/projection.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(specialization)] diff --git a/src/test/ui/run-pass/specialization/defaultimpl/specialization-trait-item-not-implemented.rs b/src/test/run-pass/specialization/defaultimpl/specialization-trait-item-not-implemented.rs similarity index 100% rename from src/test/ui/run-pass/specialization/defaultimpl/specialization-trait-item-not-implemented.rs rename to src/test/run-pass/specialization/defaultimpl/specialization-trait-item-not-implemented.rs diff --git a/src/test/ui/run-pass/specialization/specialization-allowed-cross-crate.rs b/src/test/run-pass/specialization/specialization-allowed-cross-crate.rs similarity index 91% rename from src/test/ui/run-pass/specialization/specialization-allowed-cross-crate.rs rename to src/test/run-pass/specialization/specialization-allowed-cross-crate.rs index 4a481beffd2a..941bc55a5858 100644 --- a/src/test/ui/run-pass/specialization/specialization-allowed-cross-crate.rs +++ b/src/test/run-pass/specialization/specialization-allowed-cross-crate.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +#![allow(unused_imports)] // aux-build:go_trait.rs diff --git a/src/test/ui/run-pass/specialization/specialization-assoc-fns.rs b/src/test/run-pass/specialization/specialization-assoc-fns.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-assoc-fns.rs rename to src/test/run-pass/specialization/specialization-assoc-fns.rs diff --git a/src/test/ui/run-pass/specialization/specialization-basics.rs b/src/test/run-pass/specialization/specialization-basics.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-basics.rs rename to src/test/run-pass/specialization/specialization-basics.rs diff --git a/src/test/ui/run-pass/specialization/specialization-cross-crate-no-gate.rs b/src/test/run-pass/specialization/specialization-cross-crate-no-gate.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-cross-crate-no-gate.rs rename to src/test/run-pass/specialization/specialization-cross-crate-no-gate.rs diff --git a/src/test/ui/run-pass/specialization/specialization-cross-crate.rs b/src/test/run-pass/specialization/specialization-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-cross-crate.rs rename to src/test/run-pass/specialization/specialization-cross-crate.rs diff --git a/src/test/ui/run-pass/specialization/specialization-default-methods.rs b/src/test/run-pass/specialization/specialization-default-methods.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-default-methods.rs rename to src/test/run-pass/specialization/specialization-default-methods.rs diff --git a/src/test/ui/run-pass/specialization/specialization-on-projection.rs b/src/test/run-pass/specialization/specialization-on-projection.rs similarity index 97% rename from src/test/ui/run-pass/specialization/specialization-on-projection.rs rename to src/test/run-pass/specialization/specialization-on-projection.rs index 39af761fd48b..01ec184d6f56 100644 --- a/src/test/ui/run-pass/specialization/specialization-on-projection.rs +++ b/src/test/run-pass/specialization/specialization-on-projection.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(specialization)] diff --git a/src/test/ui/run-pass/specialization/specialization-out-of-order.rs b/src/test/run-pass/specialization/specialization-out-of-order.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-out-of-order.rs rename to src/test/run-pass/specialization/specialization-out-of-order.rs diff --git a/src/test/ui/run-pass/specialization/specialization-overlap-projection.rs b/src/test/run-pass/specialization/specialization-overlap-projection.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-overlap-projection.rs rename to src/test/run-pass/specialization/specialization-overlap-projection.rs diff --git a/src/test/ui/run-pass/specialization/specialization-projection-alias.rs b/src/test/run-pass/specialization/specialization-projection-alias.rs similarity index 94% rename from src/test/ui/run-pass/specialization/specialization-projection-alias.rs rename to src/test/run-pass/specialization/specialization-projection-alias.rs index f2f107653445..8d5e732397fe 100644 --- a/src/test/ui/run-pass/specialization/specialization-projection-alias.rs +++ b/src/test/run-pass/specialization/specialization-projection-alias.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![feature(specialization)] diff --git a/src/test/ui/run-pass/specialization/specialization-projection.rs b/src/test/run-pass/specialization/specialization-projection.rs similarity index 98% rename from src/test/ui/run-pass/specialization/specialization-projection.rs rename to src/test/run-pass/specialization/specialization-projection.rs index 2bed94ccbc16..ba9051e0061e 100644 --- a/src/test/ui/run-pass/specialization/specialization-projection.rs +++ b/src/test/run-pass/specialization/specialization-projection.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(specialization)] diff --git a/src/test/ui/run-pass/specialization/specialization-super-traits.rs b/src/test/run-pass/specialization/specialization-super-traits.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-super-traits.rs rename to src/test/run-pass/specialization/specialization-super-traits.rs diff --git a/src/test/ui/run-pass/specialization/specialization-translate-projections-with-lifetimes.rs b/src/test/run-pass/specialization/specialization-translate-projections-with-lifetimes.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-translate-projections-with-lifetimes.rs rename to src/test/run-pass/specialization/specialization-translate-projections-with-lifetimes.rs diff --git a/src/test/ui/run-pass/specialization/specialization-translate-projections-with-params.rs b/src/test/run-pass/specialization/specialization-translate-projections-with-params.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-translate-projections-with-params.rs rename to src/test/run-pass/specialization/specialization-translate-projections-with-params.rs diff --git a/src/test/ui/run-pass/specialization/specialization-translate-projections.rs b/src/test/run-pass/specialization/specialization-translate-projections.rs similarity index 100% rename from src/test/ui/run-pass/specialization/specialization-translate-projections.rs rename to src/test/run-pass/specialization/specialization-translate-projections.rs diff --git a/src/test/ui/run-pass/statics/auxiliary/static-function-pointer-aux.rs b/src/test/run-pass/statics/auxiliary/static-function-pointer-aux.rs similarity index 100% rename from src/test/ui/run-pass/statics/auxiliary/static-function-pointer-aux.rs rename to src/test/run-pass/statics/auxiliary/static-function-pointer-aux.rs diff --git a/src/test/ui/run-pass/statics/auxiliary/static-methods-crate.rs b/src/test/run-pass/statics/auxiliary/static-methods-crate.rs similarity index 100% rename from src/test/ui/run-pass/statics/auxiliary/static-methods-crate.rs rename to src/test/run-pass/statics/auxiliary/static-methods-crate.rs diff --git a/src/test/ui/run-pass/statics/auxiliary/static_fn_inline_xc_aux.rs b/src/test/run-pass/statics/auxiliary/static_fn_inline_xc_aux.rs similarity index 100% rename from src/test/ui/run-pass/statics/auxiliary/static_fn_inline_xc_aux.rs rename to src/test/run-pass/statics/auxiliary/static_fn_inline_xc_aux.rs diff --git a/src/test/ui/run-pass/statics/auxiliary/static_fn_trait_xc_aux.rs b/src/test/run-pass/statics/auxiliary/static_fn_trait_xc_aux.rs similarity index 100% rename from src/test/ui/run-pass/statics/auxiliary/static_fn_trait_xc_aux.rs rename to src/test/run-pass/statics/auxiliary/static_fn_trait_xc_aux.rs diff --git a/src/test/ui/run-pass/statics/auxiliary/static_mut_xc.rs b/src/test/run-pass/statics/auxiliary/static_mut_xc.rs similarity index 100% rename from src/test/ui/run-pass/statics/auxiliary/static_mut_xc.rs rename to src/test/run-pass/statics/auxiliary/static_mut_xc.rs diff --git a/src/test/ui/run-pass/statics/static-fn-inline-xc.rs b/src/test/run-pass/statics/static-fn-inline-xc.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-fn-inline-xc.rs rename to src/test/run-pass/statics/static-fn-inline-xc.rs diff --git a/src/test/ui/run-pass/statics/static-fn-trait-xc.rs b/src/test/run-pass/statics/static-fn-trait-xc.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-fn-trait-xc.rs rename to src/test/run-pass/statics/static-fn-trait-xc.rs diff --git a/src/test/ui/run-pass/statics/static-function-pointer-xc.rs b/src/test/run-pass/statics/static-function-pointer-xc.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-function-pointer-xc.rs rename to src/test/run-pass/statics/static-function-pointer-xc.rs diff --git a/src/test/ui/run-pass/statics/static-function-pointer.rs b/src/test/run-pass/statics/static-function-pointer.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-function-pointer.rs rename to src/test/run-pass/statics/static-function-pointer.rs diff --git a/src/test/ui/run-pass/statics/static-impl.rs b/src/test/run-pass/statics/static-impl.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-impl.rs rename to src/test/run-pass/statics/static-impl.rs diff --git a/src/test/ui/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs b/src/test/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs similarity index 97% rename from src/test/ui/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs rename to src/test/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs index e70984df37e6..2c5b514df6e8 100644 --- a/src/test/ui/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs +++ b/src/test/run-pass/statics/static-method-in-trait-with-tps-intracrate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Deserializer { fn read_int(&self) -> isize; diff --git a/src/test/ui/run-pass/statics/static-method-xcrate.rs b/src/test/run-pass/statics/static-method-xcrate.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-method-xcrate.rs rename to src/test/run-pass/statics/static-method-xcrate.rs diff --git a/src/test/ui/run-pass/statics/static-methods-in-traits.rs b/src/test/run-pass/statics/static-methods-in-traits.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-methods-in-traits.rs rename to src/test/run-pass/statics/static-methods-in-traits.rs diff --git a/src/test/ui/run-pass/statics/static-methods-in-traits2.rs b/src/test/run-pass/statics/static-methods-in-traits2.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-methods-in-traits2.rs rename to src/test/run-pass/statics/static-methods-in-traits2.rs diff --git a/src/test/ui/run-pass/statics/static-mut-foreign.rs b/src/test/run-pass/statics/static-mut-foreign.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-mut-foreign.rs rename to src/test/run-pass/statics/static-mut-foreign.rs diff --git a/src/test/ui/run-pass/statics/static-mut-xc.rs b/src/test/run-pass/statics/static-mut-xc.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-mut-xc.rs rename to src/test/run-pass/statics/static-mut-xc.rs diff --git a/src/test/ui/run-pass/statics/static-recursive.rs b/src/test/run-pass/statics/static-recursive.rs similarity index 100% rename from src/test/ui/run-pass/statics/static-recursive.rs rename to src/test/run-pass/statics/static-recursive.rs diff --git a/src/test/ui/run-pass/structs-enums/align-struct.rs b/src/test/run-pass/structs-enums/align-struct.rs similarity index 99% rename from src/test/ui/run-pass/structs-enums/align-struct.rs rename to src/test/run-pass/structs-enums/align-struct.rs index 122734e817a6..a0d05a6d0d2c 100644 --- a/src/test/ui/run-pass/structs-enums/align-struct.rs +++ b/src/test/run-pass/structs-enums/align-struct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(box_syntax)] #![feature(repr_packed)] diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_2.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_2.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_2.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_2.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_3.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_3.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_3.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_3.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_4.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_4.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_4.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_4.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_6.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_6.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_6.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_6.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_cast.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_cast.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_cast.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_cast.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/cci_class_trait.rs b/src/test/run-pass/structs-enums/auxiliary/cci_class_trait.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/cci_class_trait.rs rename to src/test/run-pass/structs-enums/auxiliary/cci_class_trait.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/empty-struct.rs b/src/test/run-pass/structs-enums/auxiliary/empty-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/empty-struct.rs rename to src/test/run-pass/structs-enums/auxiliary/empty-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/namespaced_enum_emulate_flat.rs b/src/test/run-pass/structs-enums/auxiliary/namespaced_enum_emulate_flat.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/namespaced_enum_emulate_flat.rs rename to src/test/run-pass/structs-enums/auxiliary/namespaced_enum_emulate_flat.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/namespaced_enums.rs b/src/test/run-pass/structs-enums/auxiliary/namespaced_enums.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/namespaced_enums.rs rename to src/test/run-pass/structs-enums/auxiliary/namespaced_enums.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/newtype_struct_xc.rs b/src/test/run-pass/structs-enums/auxiliary/newtype_struct_xc.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/newtype_struct_xc.rs rename to src/test/run-pass/structs-enums/auxiliary/newtype_struct_xc.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/struct_destructuring_cross_crate.rs b/src/test/run-pass/structs-enums/auxiliary/struct_destructuring_cross_crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/struct_destructuring_cross_crate.rs rename to src/test/run-pass/structs-enums/auxiliary/struct_destructuring_cross_crate.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/struct_variant_xc_aux.rs b/src/test/run-pass/structs-enums/auxiliary/struct_variant_xc_aux.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/struct_variant_xc_aux.rs rename to src/test/run-pass/structs-enums/auxiliary/struct_variant_xc_aux.rs diff --git a/src/test/ui/run-pass/structs-enums/auxiliary/xcrate_struct_aliases.rs b/src/test/run-pass/structs-enums/auxiliary/xcrate_struct_aliases.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/auxiliary/xcrate_struct_aliases.rs rename to src/test/run-pass/structs-enums/auxiliary/xcrate_struct_aliases.rs diff --git a/src/test/ui/run-pass/structs-enums/borrow-tuple-fields.rs b/src/test/run-pass/structs-enums/borrow-tuple-fields.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/borrow-tuple-fields.rs rename to src/test/run-pass/structs-enums/borrow-tuple-fields.rs diff --git a/src/test/ui/run-pass/structs-enums/class-attributes-1.rs b/src/test/run-pass/structs-enums/class-attributes-1.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/class-attributes-1.rs rename to src/test/run-pass/structs-enums/class-attributes-1.rs index c5926bc15866..bdacb40911bd 100644 --- a/src/test/ui/run-pass/structs-enums/class-attributes-1.rs +++ b/src/test/run-pass/structs-enums/class-attributes-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] #![allow(non_camel_case_types)] // pp-exact - Make sure we actually print the attributes diff --git a/src/test/ui/run-pass/structs-enums/class-attributes-2.rs b/src/test/run-pass/structs-enums/class-attributes-2.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/class-attributes-2.rs rename to src/test/run-pass/structs-enums/class-attributes-2.rs index f9d88de145ac..d17601d44adc 100644 --- a/src/test/ui/run-pass/structs-enums/class-attributes-2.rs +++ b/src/test/run-pass/structs-enums/class-attributes-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_attributes)] #![allow(non_camel_case_types)] #![feature(custom_attribute)] diff --git a/src/test/ui/run-pass/structs-enums/class-cast-to-trait-cross-crate-2.rs b/src/test/run-pass/structs-enums/class-cast-to-trait-cross-crate-2.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-cast-to-trait-cross-crate-2.rs rename to src/test/run-pass/structs-enums/class-cast-to-trait-cross-crate-2.rs diff --git a/src/test/ui/run-pass/structs-enums/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/structs-enums/class-cast-to-trait-multiple-types.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-cast-to-trait-multiple-types.rs rename to src/test/run-pass/structs-enums/class-cast-to-trait-multiple-types.rs diff --git a/src/test/ui/run-pass/structs-enums/class-cast-to-trait.rs b/src/test/run-pass/structs-enums/class-cast-to-trait.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/class-cast-to-trait.rs rename to src/test/run-pass/structs-enums/class-cast-to-trait.rs index 695318d0ee79..517dad17d1f8 100644 --- a/src/test/ui/run-pass/structs-enums/class-cast-to-trait.rs +++ b/src/test/run-pass/structs-enums/class-cast-to-trait.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] #![allow(non_camel_case_types)] // ignore-freebsd FIXME fails on BSD diff --git a/src/test/ui/run-pass/structs-enums/class-dtor.rs b/src/test/run-pass/structs-enums/class-dtor.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/class-dtor.rs rename to src/test/run-pass/structs-enums/class-dtor.rs index 13559906795e..bd5fd86cefc1 100644 --- a/src/test/ui/run-pass/structs-enums/class-dtor.rs +++ b/src/test/run-pass/structs-enums/class-dtor.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/structs-enums/class-exports.rs b/src/test/run-pass/structs-enums/class-exports.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/class-exports.rs rename to src/test/run-pass/structs-enums/class-exports.rs index b4bce42e6470..6f9c609fa455 100644 --- a/src/test/ui/run-pass/structs-enums/class-exports.rs +++ b/src/test/run-pass/structs-enums/class-exports.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] /* Test that exporting a class also exports its diff --git a/src/test/ui/run-pass/structs-enums/class-impl-very-parameterized-trait.rs b/src/test/run-pass/structs-enums/class-impl-very-parameterized-trait.rs similarity index 99% rename from src/test/ui/run-pass/structs-enums/class-impl-very-parameterized-trait.rs rename to src/test/run-pass/structs-enums/class-impl-very-parameterized-trait.rs index 6ceaab93e792..deb31c9e0538 100644 --- a/src/test/ui/run-pass/structs-enums/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/structs-enums/class-impl-very-parameterized-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] use std::cmp; diff --git a/src/test/ui/run-pass/structs-enums/class-implement-trait-cross-crate.rs b/src/test/run-pass/structs-enums/class-implement-trait-cross-crate.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/class-implement-trait-cross-crate.rs rename to src/test/run-pass/structs-enums/class-implement-trait-cross-crate.rs index 4f319cf8ea4d..3b09ebec2563 100644 --- a/src/test/ui/run-pass/structs-enums/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/structs-enums/class-implement-trait-cross-crate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // aux-build:cci_class_trait.rs diff --git a/src/test/ui/run-pass/structs-enums/class-implement-traits.rs b/src/test/run-pass/structs-enums/class-implement-traits.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-implement-traits.rs rename to src/test/run-pass/structs-enums/class-implement-traits.rs diff --git a/src/test/ui/run-pass/structs-enums/class-method-cross-crate.rs b/src/test/run-pass/structs-enums/class-method-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-method-cross-crate.rs rename to src/test/run-pass/structs-enums/class-method-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/class-methods-cross-crate.rs b/src/test/run-pass/structs-enums/class-methods-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-methods-cross-crate.rs rename to src/test/run-pass/structs-enums/class-methods-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/class-methods.rs b/src/test/run-pass/structs-enums/class-methods.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-methods.rs rename to src/test/run-pass/structs-enums/class-methods.rs diff --git a/src/test/ui/run-pass/structs-enums/class-poly-methods-cross-crate.rs b/src/test/run-pass/structs-enums/class-poly-methods-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/class-poly-methods-cross-crate.rs rename to src/test/run-pass/structs-enums/class-poly-methods-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/class-poly-methods.rs b/src/test/run-pass/structs-enums/class-poly-methods.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/class-poly-methods.rs rename to src/test/run-pass/structs-enums/class-poly-methods.rs index e32ba9d02395..693a6e829b6e 100644 --- a/src/test/ui/run-pass/structs-enums/class-poly-methods.rs +++ b/src/test/run-pass/structs-enums/class-poly-methods.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/structs-enums/class-separate-impl.rs b/src/test/run-pass/structs-enums/class-separate-impl.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/class-separate-impl.rs rename to src/test/run-pass/structs-enums/class-separate-impl.rs index a1c9afaa6346..c482992f7bd7 100644 --- a/src/test/ui/run-pass/structs-enums/class-separate-impl.rs +++ b/src/test/run-pass/structs-enums/class-separate-impl.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/structs-enums/class-str-field.rs b/src/test/run-pass/structs-enums/class-str-field.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/class-str-field.rs rename to src/test/run-pass/structs-enums/class-str-field.rs index 5ad60dfd6d96..57ec91c9d338 100644 --- a/src/test/ui/run-pass/structs-enums/class-str-field.rs +++ b/src/test/run-pass/structs-enums/class-str-field.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/structs-enums/class-typarams.rs b/src/test/run-pass/structs-enums/class-typarams.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/class-typarams.rs rename to src/test/run-pass/structs-enums/class-typarams.rs index d3b4083f843a..3d9dafc6f732 100644 --- a/src/test/ui/run-pass/structs-enums/class-typarams.rs +++ b/src/test/run-pass/structs-enums/class-typarams.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/structs-enums/classes-cross-crate.rs b/src/test/run-pass/structs-enums/classes-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/classes-cross-crate.rs rename to src/test/run-pass/structs-enums/classes-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/classes-self-referential.rs b/src/test/run-pass/structs-enums/classes-self-referential.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/classes-self-referential.rs rename to src/test/run-pass/structs-enums/classes-self-referential.rs index 49016d14b9dd..3f0e912e2ad4 100644 --- a/src/test/ui/run-pass/structs-enums/classes-self-referential.rs +++ b/src/test/run-pass/structs-enums/classes-self-referential.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/structs-enums/classes-simple-cross-crate.rs b/src/test/run-pass/structs-enums/classes-simple-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/classes-simple-cross-crate.rs rename to src/test/run-pass/structs-enums/classes-simple-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/classes-simple-method.rs b/src/test/run-pass/structs-enums/classes-simple-method.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/classes-simple-method.rs rename to src/test/run-pass/structs-enums/classes-simple-method.rs index 6eaf8939dcc7..48a7d58300c9 100644 --- a/src/test/ui/run-pass/structs-enums/classes-simple-method.rs +++ b/src/test/run-pass/structs-enums/classes-simple-method.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] struct cat { diff --git a/src/test/ui/run-pass/structs-enums/classes-simple.rs b/src/test/run-pass/structs-enums/classes-simple.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/classes-simple.rs rename to src/test/run-pass/structs-enums/classes-simple.rs index 771943802aa2..c53f135c0e03 100644 --- a/src/test/ui/run-pass/structs-enums/classes-simple.rs +++ b/src/test/run-pass/structs-enums/classes-simple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] struct cat { diff --git a/src/test/ui/run-pass/structs-enums/classes.rs b/src/test/run-pass/structs-enums/classes.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/classes.rs rename to src/test/run-pass/structs-enums/classes.rs index f40fe3e8186e..0f9b5b1d7f44 100644 --- a/src/test/ui/run-pass/structs-enums/classes.rs +++ b/src/test/run-pass/structs-enums/classes.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] struct cat { diff --git a/src/test/ui/run-pass/structs-enums/codegen-tag-static-padding.rs b/src/test/run-pass/structs-enums/codegen-tag-static-padding.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/codegen-tag-static-padding.rs rename to src/test/run-pass/structs-enums/codegen-tag-static-padding.rs diff --git a/src/test/ui/run-pass/structs-enums/compare-generic-enums.rs b/src/test/run-pass/structs-enums/compare-generic-enums.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/compare-generic-enums.rs rename to src/test/run-pass/structs-enums/compare-generic-enums.rs diff --git a/src/test/ui/run-pass/structs-enums/discrim-explicit-23030.rs b/src/test/run-pass/structs-enums/discrim-explicit-23030.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/discrim-explicit-23030.rs rename to src/test/run-pass/structs-enums/discrim-explicit-23030.rs diff --git a/src/test/ui/run-pass/structs-enums/empty-struct-braces.rs b/src/test/run-pass/structs-enums/empty-struct-braces.rs similarity index 99% rename from src/test/ui/run-pass/structs-enums/empty-struct-braces.rs rename to src/test/run-pass/structs-enums/empty-struct-braces.rs index 7deb90cc3e8e..aebd1b70c3c7 100644 --- a/src/test/ui/run-pass/structs-enums/empty-struct-braces.rs +++ b/src/test/run-pass/structs-enums/empty-struct-braces.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![allow(non_upper_case_globals)] // Empty struct defined with braces add names into type namespace diff --git a/src/test/ui/run-pass/structs-enums/empty-tag.rs b/src/test/run-pass/structs-enums/empty-tag.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/empty-tag.rs rename to src/test/run-pass/structs-enums/empty-tag.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-alignment.rs b/src/test/run-pass/structs-enums/enum-alignment.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/enum-alignment.rs rename to src/test/run-pass/structs-enums/enum-alignment.rs index 862025ea9342..60bfe151b7e2 100644 --- a/src/test/ui/run-pass/structs-enums/enum-alignment.rs +++ b/src/test/run-pass/structs-enums/enum-alignment.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(deprecated)] use std::mem; diff --git a/src/test/ui/run-pass/structs-enums/enum-clike-ffi-as-int.rs b/src/test/run-pass/structs-enums/enum-clike-ffi-as-int.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/enum-clike-ffi-as-int.rs rename to src/test/run-pass/structs-enums/enum-clike-ffi-as-int.rs index 838db7058173..ea63b35e59fc 100644 --- a/src/test/ui/run-pass/structs-enums/enum-clike-ffi-as-int.rs +++ b/src/test/run-pass/structs-enums/enum-clike-ffi-as-int.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] /*! * C-like enums have to be represented as LLVM ints, not wrapped in a diff --git a/src/test/ui/run-pass/structs-enums/enum-discr.rs b/src/test/run-pass/structs-enums/enum-discr.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/enum-discr.rs rename to src/test/run-pass/structs-enums/enum-discr.rs index 0962f41f78d0..e1e1d6dfeecc 100644 --- a/src/test/ui/run-pass/structs-enums/enum-discr.rs +++ b/src/test/run-pass/structs-enums/enum-discr.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] enum Animal { Cat = 0, diff --git a/src/test/ui/run-pass/structs-enums/enum-discrim-autosizing.rs b/src/test/run-pass/structs-enums/enum-discrim-autosizing.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/enum-discrim-autosizing.rs rename to src/test/run-pass/structs-enums/enum-discrim-autosizing.rs index 55bf80138b97..f9a375d74e99 100644 --- a/src/test/ui/run-pass/structs-enums/enum-discrim-autosizing.rs +++ b/src/test/run-pass/structs-enums/enum-discrim-autosizing.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(overflowing_literals)] use std::mem::size_of; diff --git a/src/test/ui/run-pass/structs-enums/enum-discrim-manual-sizing.rs b/src/test/run-pass/structs-enums/enum-discrim-manual-sizing.rs similarity index 99% rename from src/test/ui/run-pass/structs-enums/enum-discrim-manual-sizing.rs rename to src/test/run-pass/structs-enums/enum-discrim-manual-sizing.rs index b4f8b5427e0d..54bc6506a4bf 100644 --- a/src/test/ui/run-pass/structs-enums/enum-discrim-manual-sizing.rs +++ b/src/test/run-pass/structs-enums/enum-discrim-manual-sizing.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem::{size_of, align_of}; diff --git a/src/test/ui/run-pass/structs-enums/enum-discrim-range-overflow.rs b/src/test/run-pass/structs-enums/enum-discrim-range-overflow.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-discrim-range-overflow.rs rename to src/test/run-pass/structs-enums/enum-discrim-range-overflow.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-discrim-width-stuff.rs b/src/test/run-pass/structs-enums/enum-discrim-width-stuff.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-discrim-width-stuff.rs rename to src/test/run-pass/structs-enums/enum-discrim-width-stuff.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-disr-val-pretty.rs b/src/test/run-pass/structs-enums/enum-disr-val-pretty.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-disr-val-pretty.rs rename to src/test/run-pass/structs-enums/enum-disr-val-pretty.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-export-inheritance.rs b/src/test/run-pass/structs-enums/enum-export-inheritance.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/enum-export-inheritance.rs rename to src/test/run-pass/structs-enums/enum-export-inheritance.rs index 050479d28dcd..d68073711b08 100644 --- a/src/test/ui/run-pass/structs-enums/enum-export-inheritance.rs +++ b/src/test/run-pass/structs-enums/enum-export-inheritance.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod a { diff --git a/src/test/ui/run-pass/structs-enums/enum-layout-optimization.rs b/src/test/run-pass/structs-enums/enum-layout-optimization.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-layout-optimization.rs rename to src/test/run-pass/structs-enums/enum-layout-optimization.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-c-and-int.rs b/src/test/run-pass/structs-enums/enum-non-c-like-repr-c-and-int.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-c-and-int.rs rename to src/test/run-pass/structs-enums/enum-non-c-like-repr-c-and-int.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-c.rs b/src/test/run-pass/structs-enums/enum-non-c-like-repr-c.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-c.rs rename to src/test/run-pass/structs-enums/enum-non-c-like-repr-c.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-int.rs b/src/test/run-pass/structs-enums/enum-non-c-like-repr-int.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-non-c-like-repr-int.rs rename to src/test/run-pass/structs-enums/enum-non-c-like-repr-int.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-null-pointer-opt.rs b/src/test/run-pass/structs-enums/enum-null-pointer-opt.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-null-pointer-opt.rs rename to src/test/run-pass/structs-enums/enum-null-pointer-opt.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-nullable-const-null-with-fields.rs b/src/test/run-pass/structs-enums/enum-nullable-const-null-with-fields.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-nullable-const-null-with-fields.rs rename to src/test/run-pass/structs-enums/enum-nullable-const-null-with-fields.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-nullable-simplifycfg-misopt.rs b/src/test/run-pass/structs-enums/enum-nullable-simplifycfg-misopt.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-nullable-simplifycfg-misopt.rs rename to src/test/run-pass/structs-enums/enum-nullable-simplifycfg-misopt.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-univariant-repr.rs b/src/test/run-pass/structs-enums/enum-univariant-repr.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-univariant-repr.rs rename to src/test/run-pass/structs-enums/enum-univariant-repr.rs diff --git a/src/test/ui/run-pass/structs-enums/enum-variants.rs b/src/test/run-pass/structs-enums/enum-variants.rs similarity index 94% rename from src/test/ui/run-pass/structs-enums/enum-variants.rs rename to src/test/run-pass/structs-enums/enum-variants.rs index 1eff9ad413d5..4e9b51fdd0cd 100644 --- a/src/test/ui/run-pass/structs-enums/enum-variants.rs +++ b/src/test/run-pass/structs-enums/enum-variants.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_assignments)] // pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/src/test/ui/run-pass/structs-enums/enum-vec-initializer.rs b/src/test/run-pass/structs-enums/enum-vec-initializer.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/enum-vec-initializer.rs rename to src/test/run-pass/structs-enums/enum-vec-initializer.rs diff --git a/src/test/ui/run-pass/structs-enums/export-abstract-tag.rs b/src/test/run-pass/structs-enums/export-abstract-tag.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/export-abstract-tag.rs rename to src/test/run-pass/structs-enums/export-abstract-tag.rs diff --git a/src/test/ui/run-pass/structs-enums/export-tag-variant.rs b/src/test/run-pass/structs-enums/export-tag-variant.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/export-tag-variant.rs rename to src/test/run-pass/structs-enums/export-tag-variant.rs diff --git a/src/test/ui/run-pass/structs-enums/expr-if-struct.rs b/src/test/run-pass/structs-enums/expr-if-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/expr-if-struct.rs rename to src/test/run-pass/structs-enums/expr-if-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/expr-match-struct.rs b/src/test/run-pass/structs-enums/expr-match-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/expr-match-struct.rs rename to src/test/run-pass/structs-enums/expr-match-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/field-destruction-order.rs b/src/test/run-pass/structs-enums/field-destruction-order.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/field-destruction-order.rs rename to src/test/run-pass/structs-enums/field-destruction-order.rs index 5b9d1530321f..5b7b60ff61f4 100644 --- a/src/test/ui/run-pass/structs-enums/field-destruction-order.rs +++ b/src/test/run-pass/structs-enums/field-destruction-order.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_upper_case_globals)] // In theory, it doesn't matter what order destructors are run in for rust diff --git a/src/test/ui/run-pass/structs-enums/foreign-struct.rs b/src/test/run-pass/structs-enums/foreign-struct.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/foreign-struct.rs rename to src/test/run-pass/structs-enums/foreign-struct.rs index 1e4955bd5ece..47ad6232152f 100644 --- a/src/test/ui/run-pass/structs-enums/foreign-struct.rs +++ b/src/test/run-pass/structs-enums/foreign-struct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // Passing enums by value diff --git a/src/test/ui/run-pass/structs-enums/functional-struct-upd.rs b/src/test/run-pass/structs-enums/functional-struct-upd.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/functional-struct-upd.rs rename to src/test/run-pass/structs-enums/functional-struct-upd.rs diff --git a/src/test/ui/run-pass/structs-enums/ivec-tag.rs b/src/test/run-pass/structs-enums/ivec-tag.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/ivec-tag.rs rename to src/test/run-pass/structs-enums/ivec-tag.rs index fb7585f99894..b94260f91288 100644 --- a/src/test/ui/run-pass/structs-enums/ivec-tag.rs +++ b/src/test/run-pass/structs-enums/ivec-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/structs-enums/module-qualified-struct-destructure.rs b/src/test/run-pass/structs-enums/module-qualified-struct-destructure.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/module-qualified-struct-destructure.rs rename to src/test/run-pass/structs-enums/module-qualified-struct-destructure.rs diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enum-emulate-flat-xc.rs b/src/test/run-pass/structs-enums/namespaced-enum-emulate-flat-xc.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/namespaced-enum-emulate-flat-xc.rs rename to src/test/run-pass/structs-enums/namespaced-enum-emulate-flat-xc.rs diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enum-emulate-flat.rs b/src/test/run-pass/structs-enums/namespaced-enum-emulate-flat.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/namespaced-enum-emulate-flat.rs rename to src/test/run-pass/structs-enums/namespaced-enum-emulate-flat.rs index 1185519dac66..b98772dcf79c 100644 --- a/src/test/ui/run-pass/structs-enums/namespaced-enum-emulate-flat.rs +++ b/src/test/run-pass/structs-enums/namespaced-enum-emulate-flat.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub use Foo::*; diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enum-glob-import-xcrate.rs b/src/test/run-pass/structs-enums/namespaced-enum-glob-import-xcrate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/namespaced-enum-glob-import-xcrate.rs rename to src/test/run-pass/structs-enums/namespaced-enum-glob-import-xcrate.rs diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enum-glob-import.rs b/src/test/run-pass/structs-enums/namespaced-enum-glob-import.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/namespaced-enum-glob-import.rs rename to src/test/run-pass/structs-enums/namespaced-enum-glob-import.rs index 85af2f0d9d61..4d0524e306d4 100644 --- a/src/test/ui/run-pass/structs-enums/namespaced-enum-glob-import.rs +++ b/src/test/run-pass/structs-enums/namespaced-enum-glob-import.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod m2 { diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enums-xcrate.rs b/src/test/run-pass/structs-enums/namespaced-enums-xcrate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/namespaced-enums-xcrate.rs rename to src/test/run-pass/structs-enums/namespaced-enums-xcrate.rs diff --git a/src/test/ui/run-pass/structs-enums/namespaced-enums.rs b/src/test/run-pass/structs-enums/namespaced-enums.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/namespaced-enums.rs rename to src/test/run-pass/structs-enums/namespaced-enums.rs index 05a4c190712e..79235525a53e 100644 --- a/src/test/ui/run-pass/structs-enums/namespaced-enums.rs +++ b/src/test/run-pass/structs-enums/namespaced-enums.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum Foo { diff --git a/src/test/ui/run-pass/structs-enums/nested-enum-same-names.rs b/src/test/run-pass/structs-enums/nested-enum-same-names.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/nested-enum-same-names.rs rename to src/test/run-pass/structs-enums/nested-enum-same-names.rs index 6e294b27abf3..8a63b990030c 100644 --- a/src/test/ui/run-pass/structs-enums/nested-enum-same-names.rs +++ b/src/test/run-pass/structs-enums/nested-enum-same-names.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 /* diff --git a/src/test/ui/run-pass/structs-enums/newtype-struct-drop-run.rs b/src/test/run-pass/structs-enums/newtype-struct-drop-run.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/newtype-struct-drop-run.rs rename to src/test/run-pass/structs-enums/newtype-struct-drop-run.rs diff --git a/src/test/ui/run-pass/structs-enums/newtype-struct-with-dtor.rs b/src/test/run-pass/structs-enums/newtype-struct-with-dtor.rs similarity index 92% rename from src/test/ui/run-pass/structs-enums/newtype-struct-with-dtor.rs rename to src/test/run-pass/structs-enums/newtype-struct-with-dtor.rs index 6bdf69478aee..c42958aa7e18 100644 --- a/src/test/ui/run-pass/structs-enums/newtype-struct-with-dtor.rs +++ b/src/test/run-pass/structs-enums/newtype-struct-with-dtor.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_unsafe)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 pub struct Fd(u32); diff --git a/src/test/ui/run-pass/structs-enums/newtype-struct-xc-2.rs b/src/test/run-pass/structs-enums/newtype-struct-xc-2.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/newtype-struct-xc-2.rs rename to src/test/run-pass/structs-enums/newtype-struct-xc-2.rs diff --git a/src/test/ui/run-pass/structs-enums/newtype-struct-xc.rs b/src/test/run-pass/structs-enums/newtype-struct-xc.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/newtype-struct-xc.rs rename to src/test/run-pass/structs-enums/newtype-struct-xc.rs diff --git a/src/test/ui/run-pass/structs-enums/nonzero-enum.rs b/src/test/run-pass/structs-enums/nonzero-enum.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/nonzero-enum.rs rename to src/test/run-pass/structs-enums/nonzero-enum.rs index 7a6afec4e6d2..83bc5c25de39 100644 --- a/src/test/ui/run-pass/structs-enums/nonzero-enum.rs +++ b/src/test/run-pass/structs-enums/nonzero-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::mem::size_of; enum E { diff --git a/src/test/ui/run-pass/structs-enums/numeric-fields.rs b/src/test/run-pass/structs-enums/numeric-fields.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/numeric-fields.rs rename to src/test/run-pass/structs-enums/numeric-fields.rs diff --git a/src/test/ui/run-pass/structs-enums/object-lifetime-default-from-ref-struct.rs b/src/test/run-pass/structs-enums/object-lifetime-default-from-ref-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/object-lifetime-default-from-ref-struct.rs rename to src/test/run-pass/structs-enums/object-lifetime-default-from-ref-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/object-lifetime-default-from-rptr-struct.rs b/src/test/run-pass/structs-enums/object-lifetime-default-from-rptr-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/object-lifetime-default-from-rptr-struct.rs rename to src/test/run-pass/structs-enums/object-lifetime-default-from-rptr-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/rec-align-u32.rs b/src/test/run-pass/structs-enums/rec-align-u32.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/rec-align-u32.rs rename to src/test/run-pass/structs-enums/rec-align-u32.rs index e2c960b89cb6..c82d449391a0 100644 --- a/src/test/ui/run-pass/structs-enums/rec-align-u32.rs +++ b/src/test/run-pass/structs-enums/rec-align-u32.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_unsafe)] // Issue #2303 #![feature(intrinsics)] diff --git a/src/test/ui/run-pass/structs-enums/rec-align-u64.rs b/src/test/run-pass/structs-enums/rec-align-u64.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/rec-align-u64.rs rename to src/test/run-pass/structs-enums/rec-align-u64.rs index 6fe3aefaef5a..3315232ec84a 100644 --- a/src/test/ui/run-pass/structs-enums/rec-align-u64.rs +++ b/src/test/run-pass/structs-enums/rec-align-u64.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_unsafe)] // ignore-wasm32-bare seems unimportant to test // Issue #2303 diff --git a/src/test/ui/run-pass/structs-enums/rec-auto.rs b/src/test/run-pass/structs-enums/rec-auto.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/rec-auto.rs rename to src/test/run-pass/structs-enums/rec-auto.rs diff --git a/src/test/ui/run-pass/structs-enums/rec-extend.rs b/src/test/run-pass/structs-enums/rec-extend.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/rec-extend.rs rename to src/test/run-pass/structs-enums/rec-extend.rs diff --git a/src/test/ui/run-pass/structs-enums/rec-tup.rs b/src/test/run-pass/structs-enums/rec-tup.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/rec-tup.rs rename to src/test/run-pass/structs-enums/rec-tup.rs diff --git a/src/test/ui/run-pass/structs-enums/rec.rs b/src/test/run-pass/structs-enums/rec.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/rec.rs rename to src/test/run-pass/structs-enums/rec.rs diff --git a/src/test/ui/run-pass/structs-enums/record-pat.rs b/src/test/run-pass/structs-enums/record-pat.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/record-pat.rs rename to src/test/run-pass/structs-enums/record-pat.rs diff --git a/src/test/ui/run-pass/structs-enums/resource-in-struct.rs b/src/test/run-pass/structs-enums/resource-in-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/resource-in-struct.rs rename to src/test/run-pass/structs-enums/resource-in-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/simple-generic-tag.rs b/src/test/run-pass/structs-enums/simple-generic-tag.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/simple-generic-tag.rs rename to src/test/run-pass/structs-enums/simple-generic-tag.rs index be73224c7ecb..a4ef3b0732f7 100644 --- a/src/test/ui/run-pass/structs-enums/simple-generic-tag.rs +++ b/src/test/run-pass/structs-enums/simple-generic-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/structs-enums/simple-match-generic-tag.rs b/src/test/run-pass/structs-enums/simple-match-generic-tag.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/simple-match-generic-tag.rs rename to src/test/run-pass/structs-enums/simple-match-generic-tag.rs index 7093ba5138d1..054f8ce074be 100644 --- a/src/test/ui/run-pass/structs-enums/simple-match-generic-tag.rs +++ b/src/test/run-pass/structs-enums/simple-match-generic-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] enum opt { none, some(T) } diff --git a/src/test/ui/run-pass/structs-enums/small-enum-range-edge.rs b/src/test/run-pass/structs-enums/small-enum-range-edge.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/small-enum-range-edge.rs rename to src/test/run-pass/structs-enums/small-enum-range-edge.rs diff --git a/src/test/ui/run-pass/structs-enums/small-enums-with-fields.rs b/src/test/run-pass/structs-enums/small-enums-with-fields.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/small-enums-with-fields.rs rename to src/test/run-pass/structs-enums/small-enums-with-fields.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-aliases-xcrate.rs b/src/test/run-pass/structs-enums/struct-aliases-xcrate.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/struct-aliases-xcrate.rs rename to src/test/run-pass/structs-enums/struct-aliases-xcrate.rs index b20173574cc7..38a2ebdabc9f 100644 --- a/src/test/ui/run-pass/structs-enums/struct-aliases-xcrate.rs +++ b/src/test/run-pass/structs-enums/struct-aliases-xcrate.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(non_shorthand_field_patterns)] // aux-build:xcrate_struct_aliases.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-aliases.rs b/src/test/run-pass/structs-enums/struct-aliases.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-aliases.rs rename to src/test/run-pass/structs-enums/struct-aliases.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-destructuring-cross-crate.rs b/src/test/run-pass/structs-enums/struct-destructuring-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-destructuring-cross-crate.rs rename to src/test/run-pass/structs-enums/struct-destructuring-cross-crate.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-field-shorthand.rs b/src/test/run-pass/structs-enums/struct-field-shorthand.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-field-shorthand.rs rename to src/test/run-pass/structs-enums/struct-field-shorthand.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-like-variant-construct.rs b/src/test/run-pass/structs-enums/struct-like-variant-construct.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/struct-like-variant-construct.rs rename to src/test/run-pass/structs-enums/struct-like-variant-construct.rs index a970c1b0d78e..6ed6035caf09 100644 --- a/src/test/ui/run-pass/structs-enums/struct-like-variant-construct.rs +++ b/src/test/run-pass/structs-enums/struct-like-variant-construct.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum Foo { diff --git a/src/test/ui/run-pass/structs-enums/struct-like-variant-match.rs b/src/test/run-pass/structs-enums/struct-like-variant-match.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-like-variant-match.rs rename to src/test/run-pass/structs-enums/struct-like-variant-match.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-lit-functional-no-fields.rs b/src/test/run-pass/structs-enums/struct-lit-functional-no-fields.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-lit-functional-no-fields.rs rename to src/test/run-pass/structs-enums/struct-lit-functional-no-fields.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-literal-dtor.rs b/src/test/run-pass/structs-enums/struct-literal-dtor.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-literal-dtor.rs rename to src/test/run-pass/structs-enums/struct-literal-dtor.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-new-as-field-name.rs b/src/test/run-pass/structs-enums/struct-new-as-field-name.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-new-as-field-name.rs rename to src/test/run-pass/structs-enums/struct-new-as-field-name.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-1.rs b/src/test/run-pass/structs-enums/struct-order-of-eval-1.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/struct-order-of-eval-1.rs rename to src/test/run-pass/structs-enums/struct-order-of-eval-1.rs index 1e674cb89708..989da3cdd6e1 100644 --- a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-1.rs +++ b/src/test/run-pass/structs-enums/struct-order-of-eval-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S { f0: String, f1: isize } diff --git a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-2.rs b/src/test/run-pass/structs-enums/struct-order-of-eval-2.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/struct-order-of-eval-2.rs rename to src/test/run-pass/structs-enums/struct-order-of-eval-2.rs index c054f31beae4..1b0d19db591c 100644 --- a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-2.rs +++ b/src/test/run-pass/structs-enums/struct-order-of-eval-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S { f0: String, diff --git a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-3.rs b/src/test/run-pass/structs-enums/struct-order-of-eval-3.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-order-of-eval-3.rs rename to src/test/run-pass/structs-enums/struct-order-of-eval-3.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-order-of-eval-4.rs b/src/test/run-pass/structs-enums/struct-order-of-eval-4.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-order-of-eval-4.rs rename to src/test/run-pass/structs-enums/struct-order-of-eval-4.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-partial-move-1.rs b/src/test/run-pass/structs-enums/struct-partial-move-1.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-partial-move-1.rs rename to src/test/run-pass/structs-enums/struct-partial-move-1.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-partial-move-2.rs b/src/test/run-pass/structs-enums/struct-partial-move-2.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-partial-move-2.rs rename to src/test/run-pass/structs-enums/struct-partial-move-2.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-path-associated-type.rs b/src/test/run-pass/structs-enums/struct-path-associated-type.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/struct-path-associated-type.rs rename to src/test/run-pass/structs-enums/struct-path-associated-type.rs index 868be1341217..89fa79c85e62 100644 --- a/src/test/ui/run-pass/structs-enums/struct-path-associated-type.rs +++ b/src/test/run-pass/structs-enums/struct-path-associated-type.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] struct S { a: T, b: U, diff --git a/src/test/ui/run-pass/structs-enums/struct-path-self.rs b/src/test/run-pass/structs-enums/struct-path-self.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-path-self.rs rename to src/test/run-pass/structs-enums/struct-path-self.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-pattern-matching.rs b/src/test/run-pass/structs-enums/struct-pattern-matching.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct-pattern-matching.rs rename to src/test/run-pass/structs-enums/struct-pattern-matching.rs diff --git a/src/test/ui/run-pass/structs-enums/struct-return.rs b/src/test/run-pass/structs-enums/struct-return.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/struct-return.rs rename to src/test/run-pass/structs-enums/struct-return.rs index a2b380c7e18e..5f85954f6b11 100644 --- a/src/test/ui/run-pass/structs-enums/struct-return.rs +++ b/src/test/run-pass/structs-enums/struct-return.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // ignore-wasm32-bare no libc to test ffi with #[repr(C)] diff --git a/src/test/ui/run-pass/structs-enums/struct-variant-field-visibility.rs b/src/test/run-pass/structs-enums/struct-variant-field-visibility.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/struct-variant-field-visibility.rs rename to src/test/run-pass/structs-enums/struct-variant-field-visibility.rs index 4b7854145f00..206ff2ad13d6 100644 --- a/src/test/ui/run-pass/structs-enums/struct-variant-field-visibility.rs +++ b/src/test/run-pass/structs-enums/struct-variant-field-visibility.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 mod foo { diff --git a/src/test/ui/run-pass/structs-enums/struct_variant_xc.rs b/src/test/run-pass/structs-enums/struct_variant_xc.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct_variant_xc.rs rename to src/test/run-pass/structs-enums/struct_variant_xc.rs diff --git a/src/test/ui/run-pass/structs-enums/struct_variant_xc_match.rs b/src/test/run-pass/structs-enums/struct_variant_xc_match.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/struct_variant_xc_match.rs rename to src/test/run-pass/structs-enums/struct_variant_xc_match.rs diff --git a/src/test/ui/run-pass/structs-enums/tag-align-dyn-u64.rs b/src/test/run-pass/structs-enums/tag-align-dyn-u64.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/tag-align-dyn-u64.rs rename to src/test/run-pass/structs-enums/tag-align-dyn-u64.rs index a7f7841fac84..39b406958253 100644 --- a/src/test/ui/run-pass/structs-enums/tag-align-dyn-u64.rs +++ b/src/test/run-pass/structs-enums/tag-align-dyn-u64.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(deprecated)] use std::mem; diff --git a/src/test/ui/run-pass/structs-enums/tag-align-dyn-variants.rs b/src/test/run-pass/structs-enums/tag-align-dyn-variants.rs similarity index 99% rename from src/test/ui/run-pass/structs-enums/tag-align-dyn-variants.rs rename to src/test/run-pass/structs-enums/tag-align-dyn-variants.rs index cbba62d156bc..f25321ef7b15 100644 --- a/src/test/ui/run-pass/structs-enums/tag-align-dyn-variants.rs +++ b/src/test/run-pass/structs-enums/tag-align-dyn-variants.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(deprecated)] #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/structs-enums/tag-align-shape.rs b/src/test/run-pass/structs-enums/tag-align-shape.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tag-align-shape.rs rename to src/test/run-pass/structs-enums/tag-align-shape.rs diff --git a/src/test/ui/run-pass/structs-enums/tag-align-u64.rs b/src/test/run-pass/structs-enums/tag-align-u64.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/tag-align-u64.rs rename to src/test/run-pass/structs-enums/tag-align-u64.rs index 9f6349a23ada..e2f7ffe27681 100644 --- a/src/test/ui/run-pass/structs-enums/tag-align-u64.rs +++ b/src/test/run-pass/structs-enums/tag-align-u64.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(deprecated)] use std::mem; diff --git a/src/test/ui/run-pass/structs-enums/tag-disr-val-shape.rs b/src/test/run-pass/structs-enums/tag-disr-val-shape.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/tag-disr-val-shape.rs rename to src/test/run-pass/structs-enums/tag-disr-val-shape.rs index bfc3213a040c..0f6197f14d5d 100644 --- a/src/test/ui/run-pass/structs-enums/tag-disr-val-shape.rs +++ b/src/test/run-pass/structs-enums/tag-disr-val-shape.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #[derive(Debug)] diff --git a/src/test/ui/run-pass/structs-enums/tag-exports.rs b/src/test/run-pass/structs-enums/tag-exports.rs similarity index 97% rename from src/test/ui/run-pass/structs-enums/tag-exports.rs rename to src/test/run-pass/structs-enums/tag-exports.rs index d0eea7bdcd24..c93183cff4d4 100644 --- a/src/test/ui/run-pass/structs-enums/tag-exports.rs +++ b/src/test/run-pass/structs-enums/tag-exports.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/structs-enums/tag-in-block.rs b/src/test/run-pass/structs-enums/tag-in-block.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/tag-in-block.rs rename to src/test/run-pass/structs-enums/tag-in-block.rs index db9b2c3b60cc..e3a39fe2480f 100644 --- a/src/test/ui/run-pass/structs-enums/tag-in-block.rs +++ b/src/test/run-pass/structs-enums/tag-in-block.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs b/src/test/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs rename to src/test/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs index 085d0bc1fdce..ca3021b21368 100644 --- a/src/test/ui/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs +++ b/src/test/run-pass/structs-enums/tag-variant-disr-type-mismatch.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/structs-enums/tag-variant-disr-val.rs b/src/test/run-pass/structs-enums/tag-variant-disr-val.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tag-variant-disr-val.rs rename to src/test/run-pass/structs-enums/tag-variant-disr-val.rs diff --git a/src/test/ui/run-pass/structs-enums/tag.rs b/src/test/run-pass/structs-enums/tag.rs similarity index 98% rename from src/test/ui/run-pass/structs-enums/tag.rs rename to src/test/run-pass/structs-enums/tag.rs index bd28320ffb67..d2b0d9dac0a1 100644 --- a/src/test/ui/run-pass/structs-enums/tag.rs +++ b/src/test/run-pass/structs-enums/tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_parens)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/run-pass/structs-enums/tuple-struct-construct.rs b/src/test/run-pass/structs-enums/tuple-struct-construct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tuple-struct-construct.rs rename to src/test/run-pass/structs-enums/tuple-struct-construct.rs diff --git a/src/test/ui/run-pass/structs-enums/tuple-struct-constructor-pointer.rs b/src/test/run-pass/structs-enums/tuple-struct-constructor-pointer.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tuple-struct-constructor-pointer.rs rename to src/test/run-pass/structs-enums/tuple-struct-constructor-pointer.rs diff --git a/src/test/ui/run-pass/structs-enums/tuple-struct-destructuring.rs b/src/test/run-pass/structs-enums/tuple-struct-destructuring.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tuple-struct-destructuring.rs rename to src/test/run-pass/structs-enums/tuple-struct-destructuring.rs diff --git a/src/test/ui/run-pass/structs-enums/tuple-struct-matching.rs b/src/test/run-pass/structs-enums/tuple-struct-matching.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/tuple-struct-matching.rs rename to src/test/run-pass/structs-enums/tuple-struct-matching.rs diff --git a/src/test/ui/run-pass/structs-enums/tuple-struct-trivial.rs b/src/test/run-pass/structs-enums/tuple-struct-trivial.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/tuple-struct-trivial.rs rename to src/test/run-pass/structs-enums/tuple-struct-trivial.rs index d77d9c7e163b..bbf810abb9f5 100644 --- a/src/test/ui/run-pass/structs-enums/tuple-struct-trivial.rs +++ b/src/test/run-pass/structs-enums/tuple-struct-trivial.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 struct Foo(isize, isize, isize); diff --git a/src/test/ui/run-pass/structs-enums/uninstantiable-struct.rs b/src/test/run-pass/structs-enums/uninstantiable-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/uninstantiable-struct.rs rename to src/test/run-pass/structs-enums/uninstantiable-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/unit-like-struct-drop-run.rs b/src/test/run-pass/structs-enums/unit-like-struct-drop-run.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/unit-like-struct-drop-run.rs rename to src/test/run-pass/structs-enums/unit-like-struct-drop-run.rs diff --git a/src/test/ui/run-pass/structs-enums/unit-like-struct.rs b/src/test/run-pass/structs-enums/unit-like-struct.rs similarity index 100% rename from src/test/ui/run-pass/structs-enums/unit-like-struct.rs rename to src/test/run-pass/structs-enums/unit-like-struct.rs diff --git a/src/test/ui/run-pass/structs-enums/variant-structs-trivial.rs b/src/test/run-pass/structs-enums/variant-structs-trivial.rs similarity index 96% rename from src/test/ui/run-pass/structs-enums/variant-structs-trivial.rs rename to src/test/run-pass/structs-enums/variant-structs-trivial.rs index 9cef1c834760..7aaaef943473 100644 --- a/src/test/ui/run-pass/structs-enums/variant-structs-trivial.rs +++ b/src/test/run-pass/structs-enums/variant-structs-trivial.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 enum Foo { diff --git a/src/test/ui/run-pass/thinlto/all-crates.rs b/src/test/run-pass/thinlto/all-crates.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/all-crates.rs rename to src/test/run-pass/thinlto/all-crates.rs diff --git a/src/test/ui/run-pass/thinlto/auxiliary/dylib.rs b/src/test/run-pass/thinlto/auxiliary/dylib.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/auxiliary/dylib.rs rename to src/test/run-pass/thinlto/auxiliary/dylib.rs diff --git a/src/test/ui/run-pass/thinlto/auxiliary/msvc-imp-present.rs b/src/test/run-pass/thinlto/auxiliary/msvc-imp-present.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/auxiliary/msvc-imp-present.rs rename to src/test/run-pass/thinlto/auxiliary/msvc-imp-present.rs diff --git a/src/test/ui/run-pass/thinlto/auxiliary/thin-lto-inlines-aux.rs b/src/test/run-pass/thinlto/auxiliary/thin-lto-inlines-aux.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/auxiliary/thin-lto-inlines-aux.rs rename to src/test/run-pass/thinlto/auxiliary/thin-lto-inlines-aux.rs diff --git a/src/test/ui/run-pass/thinlto/dylib-works.rs b/src/test/run-pass/thinlto/dylib-works.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/dylib-works.rs rename to src/test/run-pass/thinlto/dylib-works.rs diff --git a/src/test/ui/run-pass/thinlto/msvc-imp-present.rs b/src/test/run-pass/thinlto/msvc-imp-present.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/msvc-imp-present.rs rename to src/test/run-pass/thinlto/msvc-imp-present.rs diff --git a/src/test/ui/run-pass/thinlto/thin-lto-inlines.rs b/src/test/run-pass/thinlto/thin-lto-inlines.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/thin-lto-inlines.rs rename to src/test/run-pass/thinlto/thin-lto-inlines.rs diff --git a/src/test/ui/run-pass/thinlto/thin-lto-inlines2.rs b/src/test/run-pass/thinlto/thin-lto-inlines2.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/thin-lto-inlines2.rs rename to src/test/run-pass/thinlto/thin-lto-inlines2.rs diff --git a/src/test/ui/run-pass/thinlto/weak-works.rs b/src/test/run-pass/thinlto/weak-works.rs similarity index 100% rename from src/test/ui/run-pass/thinlto/weak-works.rs rename to src/test/run-pass/thinlto/weak-works.rs diff --git a/src/test/ui/run-pass/threads-sendsync/auxiliary/thread-local-extern-static.rs b/src/test/run-pass/threads-sendsync/auxiliary/thread-local-extern-static.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/auxiliary/thread-local-extern-static.rs rename to src/test/run-pass/threads-sendsync/auxiliary/thread-local-extern-static.rs diff --git a/src/test/ui/run-pass/threads-sendsync/comm.rs b/src/test/run-pass/threads-sendsync/comm.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/comm.rs rename to src/test/run-pass/threads-sendsync/comm.rs index 7a8e27ca20b3..b4654b553a4e 100644 --- a/src/test/ui/run-pass/threads-sendsync/comm.rs +++ b/src/test/run-pass/threads-sendsync/comm.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/send-is-not-static-par-for.rs b/src/test/run-pass/threads-sendsync/send-is-not-static-par-for.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/send-is-not-static-par-for.rs rename to src/test/run-pass/threads-sendsync/send-is-not-static-par-for.rs index 00a7acfa94fd..58abd373f0a0 100644 --- a/src/test/ui/run-pass/threads-sendsync/send-is-not-static-par-for.rs +++ b/src/test/run-pass/threads-sendsync/send-is-not-static-par-for.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] use std::thread; use std::sync::Mutex; diff --git a/src/test/ui/run-pass/threads-sendsync/send-resource.rs b/src/test/run-pass/threads-sendsync/send-resource.rs similarity index 95% rename from src/test/ui/run-pass/threads-sendsync/send-resource.rs rename to src/test/run-pass/threads-sendsync/send-resource.rs index be671084c84f..a03a3f50c51f 100644 --- a/src/test/ui/run-pass/threads-sendsync/send-resource.rs +++ b/src/test/run-pass/threads-sendsync/send-resource.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/threads-sendsync/send-type-inference.rs b/src/test/run-pass/threads-sendsync/send-type-inference.rs similarity index 92% rename from src/test/ui/run-pass/threads-sendsync/send-type-inference.rs rename to src/test/run-pass/threads-sendsync/send-type-inference.rs index e1aaf6d220ee..a855bc514805 100644 --- a/src/test/ui/run-pass/threads-sendsync/send-type-inference.rs +++ b/src/test/run-pass/threads-sendsync/send-type-inference.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_mut)] // pretty-expanded FIXME #23616 use std::sync::mpsc::{channel, Sender}; diff --git a/src/test/ui/run-pass/threads-sendsync/send_str_hashmap.rs b/src/test/run-pass/threads-sendsync/send_str_hashmap.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/send_str_hashmap.rs rename to src/test/run-pass/threads-sendsync/send_str_hashmap.rs diff --git a/src/test/ui/run-pass/threads-sendsync/send_str_treemap.rs b/src/test/run-pass/threads-sendsync/send_str_treemap.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/send_str_treemap.rs rename to src/test/run-pass/threads-sendsync/send_str_treemap.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sendable-class.rs b/src/test/run-pass/threads-sendsync/sendable-class.rs similarity index 91% rename from src/test/ui/run-pass/threads-sendsync/sendable-class.rs rename to src/test/run-pass/threads-sendsync/sendable-class.rs index 2e82a278f3d3..1dcd7c948683 100644 --- a/src/test/ui/run-pass/threads-sendsync/sendable-class.rs +++ b/src/test/run-pass/threads-sendsync/sendable-class.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(non_camel_case_types)] // Test that a class with only sendable fields can be sent diff --git a/src/test/ui/run-pass/threads-sendsync/sendfn-is-a-block.rs b/src/test/run-pass/threads-sendsync/sendfn-is-a-block.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sendfn-is-a-block.rs rename to src/test/run-pass/threads-sendsync/sendfn-is-a-block.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/threads-sendsync/sendfn-spawn-with-fn-arg.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sendfn-spawn-with-fn-arg.rs rename to src/test/run-pass/threads-sendsync/sendfn-spawn-with-fn-arg.rs diff --git a/src/test/ui/run-pass/threads-sendsync/spawn-fn.rs b/src/test/run-pass/threads-sendsync/spawn-fn.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/spawn-fn.rs rename to src/test/run-pass/threads-sendsync/spawn-fn.rs index 39fbba043613..1e1382df60fc 100644 --- a/src/test/ui/run-pass/threads-sendsync/spawn-fn.rs +++ b/src/test/run-pass/threads-sendsync/spawn-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/spawn-types.rs b/src/test/run-pass/threads-sendsync/spawn-types.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/spawn-types.rs rename to src/test/run-pass/threads-sendsync/spawn-types.rs diff --git a/src/test/ui/run-pass/threads-sendsync/spawn.rs b/src/test/run-pass/threads-sendsync/spawn.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/spawn.rs rename to src/test/run-pass/threads-sendsync/spawn.rs diff --git a/src/test/ui/run-pass/threads-sendsync/spawn2.rs b/src/test/run-pass/threads-sendsync/spawn2.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/spawn2.rs rename to src/test/run-pass/threads-sendsync/spawn2.rs diff --git a/src/test/ui/run-pass/threads-sendsync/spawning-with-debug.rs b/src/test/run-pass/threads-sendsync/spawning-with-debug.rs similarity index 93% rename from src/test/ui/run-pass/threads-sendsync/spawning-with-debug.rs rename to src/test/run-pass/threads-sendsync/spawning-with-debug.rs index e582cff43abf..38fc9dec8297 100644 --- a/src/test/ui/run-pass/threads-sendsync/spawning-with-debug.rs +++ b/src/test/run-pass/threads-sendsync/spawning-with-debug.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_mut)] // ignore-windows // exec-env:RUST_LOG=debug // ignore-emscripten no threads support diff --git a/src/test/ui/run-pass/threads-sendsync/std-sync-right-kind-impls.rs b/src/test/run-pass/threads-sendsync/std-sync-right-kind-impls.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/std-sync-right-kind-impls.rs rename to src/test/run-pass/threads-sendsync/std-sync-right-kind-impls.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sync-send-atomics.rs b/src/test/run-pass/threads-sendsync/sync-send-atomics.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sync-send-atomics.rs rename to src/test/run-pass/threads-sendsync/sync-send-atomics.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sync-send-in-std.rs b/src/test/run-pass/threads-sendsync/sync-send-in-std.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sync-send-in-std.rs rename to src/test/run-pass/threads-sendsync/sync-send-in-std.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sync-send-iterators-in-libcollections.rs b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcollections.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sync-send-iterators-in-libcollections.rs rename to src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcollections.rs diff --git a/src/test/ui/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs rename to src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-0.rs b/src/test/run-pass/threads-sendsync/task-comm-0.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-0.rs rename to src/test/run-pass/threads-sendsync/task-comm-0.rs index 1626b23fdc2f..955304a5c456 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-0.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-0.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-1.rs b/src/test/run-pass/threads-sendsync/task-comm-1.rs similarity index 96% rename from src/test/ui/run-pass/threads-sendsync/task-comm-1.rs rename to src/test/run-pass/threads-sendsync/task-comm-1.rs index 975789e8cd25..0059403c3bb0 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-1.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-10.rs b/src/test/run-pass/threads-sendsync/task-comm-10.rs similarity index 95% rename from src/test/ui/run-pass/threads-sendsync/task-comm-10.rs rename to src/test/run-pass/threads-sendsync/task-comm-10.rs index cbb225200934..2fadece739fc 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-10.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-10.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_mut)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-11.rs b/src/test/run-pass/threads-sendsync/task-comm-11.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-11.rs rename to src/test/run-pass/threads-sendsync/task-comm-11.rs index 28710116dc32..7ecb62364fb5 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-11.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-11.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // pretty-expanded FIXME #23616 // ignore-emscripten no threads support diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-12.rs b/src/test/run-pass/threads-sendsync/task-comm-12.rs similarity index 95% rename from src/test/ui/run-pass/threads-sendsync/task-comm-12.rs rename to src/test/run-pass/threads-sendsync/task-comm-12.rs index e6195bf011b7..6c8e456bcdfb 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-12.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-12.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_mut)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-13.rs b/src/test/run-pass/threads-sendsync/task-comm-13.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-13.rs rename to src/test/run-pass/threads-sendsync/task-comm-13.rs index 2276fd8031fc..6afc031ffb15 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-13.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-13.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // ignore-emscripten no threads support use std::sync::mpsc::{channel, Sender}; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-14.rs b/src/test/run-pass/threads-sendsync/task-comm-14.rs similarity index 98% rename from src/test/ui/run-pass/threads-sendsync/task-comm-14.rs rename to src/test/run-pass/threads-sendsync/task-comm-14.rs index f6a96a84eb69..7b5336a0551f 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-14.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-14.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_parens)] // ignore-emscripten no threads support use std::sync::mpsc::{channel, Sender}; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-15.rs b/src/test/run-pass/threads-sendsync/task-comm-15.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-15.rs rename to src/test/run-pass/threads-sendsync/task-comm-15.rs index 0398b55720d4..fdf17d3ce6f7 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-15.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-15.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-16.rs b/src/test/run-pass/threads-sendsync/task-comm-16.rs similarity index 98% rename from src/test/ui/run-pass/threads-sendsync/task-comm-16.rs rename to src/test/run-pass/threads-sendsync/task-comm-16.rs index d98766f91941..1732411629e5 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-16.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-16.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_parens)] #![allow(non_camel_case_types)] use std::sync::mpsc::channel; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-17.rs b/src/test/run-pass/threads-sendsync/task-comm-17.rs similarity index 96% rename from src/test/ui/run-pass/threads-sendsync/task-comm-17.rs rename to src/test/run-pass/threads-sendsync/task-comm-17.rs index 53a233da820a..8dce1f7e31e6 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-17.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-17.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-3.rs b/src/test/run-pass/threads-sendsync/task-comm-3.rs similarity index 98% rename from src/test/ui/run-pass/threads-sendsync/task-comm-3.rs rename to src/test/run-pass/threads-sendsync/task-comm-3.rs index d18ed1c567ca..9d3985fcde6d 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-3.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-4.rs b/src/test/run-pass/threads-sendsync/task-comm-4.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-4.rs rename to src/test/run-pass/threads-sendsync/task-comm-4.rs index 47cbf8ec98a2..f6101498a055 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-4.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-4.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] use std::sync::mpsc::channel; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-5.rs b/src/test/run-pass/threads-sendsync/task-comm-5.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/task-comm-5.rs rename to src/test/run-pass/threads-sendsync/task-comm-5.rs diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-6.rs b/src/test/run-pass/threads-sendsync/task-comm-6.rs similarity index 96% rename from src/test/ui/run-pass/threads-sendsync/task-comm-6.rs rename to src/test/run-pass/threads-sendsync/task-comm-6.rs index 83eb36728ef5..7564e640371e 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-6.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-6.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_assignments)] use std::sync::mpsc::channel; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-7.rs b/src/test/run-pass/threads-sendsync/task-comm-7.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-7.rs rename to src/test/run-pass/threads-sendsync/task-comm-7.rs index 6bf1bad07c1c..de7efc4159d8 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-7.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-7.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] +#![allow(unused_assignments)] // ignore-emscripten no threads support use std::sync::mpsc::{channel, Sender}; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-9.rs b/src/test/run-pass/threads-sendsync/task-comm-9.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-comm-9.rs rename to src/test/run-pass/threads-sendsync/task-comm-9.rs index f23a15945075..01d749cba4cf 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-comm-9.rs +++ b/src/test/run-pass/threads-sendsync/task-comm-9.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/task-comm-chan-nil.rs b/src/test/run-pass/threads-sendsync/task-comm-chan-nil.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/task-comm-chan-nil.rs rename to src/test/run-pass/threads-sendsync/task-comm-chan-nil.rs diff --git a/src/test/ui/run-pass/threads-sendsync/task-life-0.rs b/src/test/run-pass/threads-sendsync/task-life-0.rs similarity index 96% rename from src/test/ui/run-pass/threads-sendsync/task-life-0.rs rename to src/test/run-pass/threads-sendsync/task-life-0.rs index 8ec7c871c683..48d8c8e50b76 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-life-0.rs +++ b/src/test/run-pass/threads-sendsync/task-life-0.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/threads-sendsync/task-spawn-move-and-copy.rs b/src/test/run-pass/threads-sendsync/task-spawn-move-and-copy.rs similarity index 97% rename from src/test/ui/run-pass/threads-sendsync/task-spawn-move-and-copy.rs rename to src/test/run-pass/threads-sendsync/task-spawn-move-and-copy.rs index 65e2236f2e11..04adacd689c1 100644 --- a/src/test/ui/run-pass/threads-sendsync/task-spawn-move-and-copy.rs +++ b/src/test/run-pass/threads-sendsync/task-spawn-move-and-copy.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/threads-sendsync/task-stderr.rs b/src/test/run-pass/threads-sendsync/task-stderr.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/task-stderr.rs rename to src/test/run-pass/threads-sendsync/task-stderr.rs diff --git a/src/test/ui/run-pass/threads-sendsync/thread-local-extern-static.rs b/src/test/run-pass/threads-sendsync/thread-local-extern-static.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/thread-local-extern-static.rs rename to src/test/run-pass/threads-sendsync/thread-local-extern-static.rs diff --git a/src/test/ui/run-pass/threads-sendsync/thread-local-syntax.rs b/src/test/run-pass/threads-sendsync/thread-local-syntax.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/thread-local-syntax.rs rename to src/test/run-pass/threads-sendsync/thread-local-syntax.rs diff --git a/src/test/ui/run-pass/threads-sendsync/threads.rs b/src/test/run-pass/threads-sendsync/threads.rs similarity index 96% rename from src/test/ui/run-pass/threads-sendsync/threads.rs rename to src/test/run-pass/threads-sendsync/threads.rs index 7be239e29fb8..51d2d356b007 100644 --- a/src/test/ui/run-pass/threads-sendsync/threads.rs +++ b/src/test/run-pass/threads-sendsync/threads.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support use std::thread; diff --git a/src/test/ui/run-pass/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs b/src/test/run-pass/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs rename to src/test/run-pass/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs diff --git a/src/test/ui/run-pass/threads-sendsync/tls-init-on-init.rs b/src/test/run-pass/threads-sendsync/tls-init-on-init.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/tls-init-on-init.rs rename to src/test/run-pass/threads-sendsync/tls-init-on-init.rs diff --git a/src/test/ui/run-pass/threads-sendsync/tls-try-with.rs b/src/test/run-pass/threads-sendsync/tls-try-with.rs similarity index 100% rename from src/test/ui/run-pass/threads-sendsync/tls-try-with.rs rename to src/test/run-pass/threads-sendsync/tls-try-with.rs diff --git a/src/test/ui/run-pass/traits/anon-trait-static-method.rs b/src/test/run-pass/traits/anon-trait-static-method.rs similarity index 100% rename from src/test/ui/run-pass/traits/anon-trait-static-method.rs rename to src/test/run-pass/traits/anon-trait-static-method.rs diff --git a/src/test/ui/run-pass/traits/anon_trait_static_method_exe.rs b/src/test/run-pass/traits/anon_trait_static_method_exe.rs similarity index 100% rename from src/test/ui/run-pass/traits/anon_trait_static_method_exe.rs rename to src/test/run-pass/traits/anon_trait_static_method_exe.rs diff --git a/src/test/ui/run-pass/traits/assignability-trait.rs b/src/test/run-pass/traits/assignability-trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/assignability-trait.rs rename to src/test/run-pass/traits/assignability-trait.rs diff --git a/src/test/ui/run-pass/traits/astconv-cycle-between-trait-and-type.rs b/src/test/run-pass/traits/astconv-cycle-between-trait-and-type.rs similarity index 100% rename from src/test/ui/run-pass/traits/astconv-cycle-between-trait-and-type.rs rename to src/test/run-pass/traits/astconv-cycle-between-trait-and-type.rs diff --git a/src/test/ui/run-pass/traits/augmented-assignments-trait.rs b/src/test/run-pass/traits/augmented-assignments-trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/augmented-assignments-trait.rs rename to src/test/run-pass/traits/augmented-assignments-trait.rs diff --git a/src/test/ui/run-pass/traits/auto-traits.rs b/src/test/run-pass/traits/auto-traits.rs similarity index 97% rename from src/test/ui/run-pass/traits/auto-traits.rs rename to src/test/run-pass/traits/auto-traits.rs index 79c2108ba833..f4d824557e55 100644 --- a/src/test/ui/run-pass/traits/auto-traits.rs +++ b/src/test/run-pass/traits/auto-traits.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_doc_comments)] #![feature(optin_builtin_traits)] auto trait Auto {} diff --git a/src/test/ui/run-pass/traits/auxiliary/anon_trait_static_method_lib.rs b/src/test/run-pass/traits/auxiliary/anon_trait_static_method_lib.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/anon_trait_static_method_lib.rs rename to src/test/run-pass/traits/auxiliary/anon_trait_static_method_lib.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/go_trait.rs b/src/test/run-pass/traits/auxiliary/go_trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/go_trait.rs rename to src/test/run-pass/traits/auxiliary/go_trait.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_default_method_xc_aux.rs b/src/test/run-pass/traits/auxiliary/trait_default_method_xc_aux.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_default_method_xc_aux.rs rename to src/test/run-pass/traits/auxiliary/trait_default_method_xc_aux.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_default_method_xc_aux_2.rs b/src/test/run-pass/traits/auxiliary/trait_default_method_xc_aux_2.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_default_method_xc_aux_2.rs rename to src/test/run-pass/traits/auxiliary/trait_default_method_xc_aux_2.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs b/src/test/run-pass/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs rename to src/test/run-pass/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_inheritance_auto_xc_aux.rs b/src/test/run-pass/traits/auxiliary/trait_inheritance_auto_xc_aux.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_inheritance_auto_xc_aux.rs rename to src/test/run-pass/traits/auxiliary/trait_inheritance_auto_xc_aux.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/run-pass/traits/auxiliary/trait_inheritance_overloading_xc.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_inheritance_overloading_xc.rs rename to src/test/run-pass/traits/auxiliary/trait_inheritance_overloading_xc.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_safety_lib.rs b/src/test/run-pass/traits/auxiliary/trait_safety_lib.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_safety_lib.rs rename to src/test/run-pass/traits/auxiliary/trait_safety_lib.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/trait_xc_call_aux.rs b/src/test/run-pass/traits/auxiliary/trait_xc_call_aux.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/trait_xc_call_aux.rs rename to src/test/run-pass/traits/auxiliary/trait_xc_call_aux.rs diff --git a/src/test/ui/run-pass/traits/auxiliary/traitimpl.rs b/src/test/run-pass/traits/auxiliary/traitimpl.rs similarity index 100% rename from src/test/ui/run-pass/traits/auxiliary/traitimpl.rs rename to src/test/run-pass/traits/auxiliary/traitimpl.rs diff --git a/src/test/ui/run-pass/traits/conservative_impl_trait.rs b/src/test/run-pass/traits/conservative_impl_trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/conservative_impl_trait.rs rename to src/test/run-pass/traits/conservative_impl_trait.rs diff --git a/src/test/ui/run-pass/traits/cycle-trait-type-trait.rs b/src/test/run-pass/traits/cycle-trait-type-trait.rs similarity index 97% rename from src/test/ui/run-pass/traits/cycle-trait-type-trait.rs rename to src/test/run-pass/traits/cycle-trait-type-trait.rs index c19583980054..9328c86bd7e5 100644 --- a/src/test/ui/run-pass/traits/cycle-trait-type-trait.rs +++ b/src/test/run-pass/traits/cycle-trait-type-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Test a case where a supertrait references a type that references // the original trait. This poses no problem at the moment. diff --git a/src/test/ui/run-pass/traits/default-method-supertrait-vtable.rs b/src/test/run-pass/traits/default-method-supertrait-vtable.rs similarity index 100% rename from src/test/ui/run-pass/traits/default-method-supertrait-vtable.rs rename to src/test/run-pass/traits/default-method-supertrait-vtable.rs diff --git a/src/test/ui/run-pass/traits/dyn-trait.rs b/src/test/run-pass/traits/dyn-trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/dyn-trait.rs rename to src/test/run-pass/traits/dyn-trait.rs diff --git a/src/test/ui/run-pass/traits/fmt-pointer-trait.rs b/src/test/run-pass/traits/fmt-pointer-trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/fmt-pointer-trait.rs rename to src/test/run-pass/traits/fmt-pointer-trait.rs diff --git a/src/test/ui/run-pass/traits/impl-implicit-trait.rs b/src/test/run-pass/traits/impl-implicit-trait.rs similarity index 97% rename from src/test/ui/run-pass/traits/impl-implicit-trait.rs rename to src/test/run-pass/traits/impl-implicit-trait.rs index 76cfaf2c68ef..f25ce8423117 100644 --- a/src/test/ui/run-pass/traits/impl-implicit-trait.rs +++ b/src/test/run-pass/traits/impl-implicit-trait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/traits/impl-inherent-prefer-over-trait.rs b/src/test/run-pass/traits/impl-inherent-prefer-over-trait.rs similarity index 100% rename from src/test/ui/run-pass/traits/impl-inherent-prefer-over-trait.rs rename to src/test/run-pass/traits/impl-inherent-prefer-over-trait.rs diff --git a/src/test/ui/run-pass/traits/infer-from-object-trait-issue-26952.rs b/src/test/run-pass/traits/infer-from-object-trait-issue-26952.rs similarity index 95% rename from src/test/ui/run-pass/traits/infer-from-object-trait-issue-26952.rs rename to src/test/run-pass/traits/infer-from-object-trait-issue-26952.rs index d53619d0c9d0..f2956d383310 100644 --- a/src/test/ui/run-pass/traits/infer-from-object-trait-issue-26952.rs +++ b/src/test/run-pass/traits/infer-from-object-trait-issue-26952.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that when we match a trait reference like `Foo: Foo<_#0t>`, // we unify with `_#0t` with `A`. In this code, if we failed to do // that, then you get an unconstrained type-variable in `call`. diff --git a/src/test/ui/run-pass/traits/inherent-trait-method-order.rs b/src/test/run-pass/traits/inherent-trait-method-order.rs similarity index 100% rename from src/test/ui/run-pass/traits/inherent-trait-method-order.rs rename to src/test/run-pass/traits/inherent-trait-method-order.rs diff --git a/src/test/ui/run-pass/traits/kindck-owned-trait-contains-1.rs b/src/test/run-pass/traits/kindck-owned-trait-contains-1.rs similarity index 100% rename from src/test/ui/run-pass/traits/kindck-owned-trait-contains-1.rs rename to src/test/run-pass/traits/kindck-owned-trait-contains-1.rs diff --git a/src/test/ui/run-pass/traits/multiple-trait-bounds.rs b/src/test/run-pass/traits/multiple-trait-bounds.rs similarity index 100% rename from src/test/ui/run-pass/traits/multiple-trait-bounds.rs rename to src/test/run-pass/traits/multiple-trait-bounds.rs diff --git a/src/test/ui/run-pass/traits/object-one-type-two-traits.rs b/src/test/run-pass/traits/object-one-type-two-traits.rs similarity index 95% rename from src/test/ui/run-pass/traits/object-one-type-two-traits.rs rename to src/test/run-pass/traits/object-one-type-two-traits.rs index 5a468e0d6449..ae2f0d31af27 100644 --- a/src/test/ui/run-pass/traits/object-one-type-two-traits.rs +++ b/src/test/run-pass/traits/object-one-type-two-traits.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Testing creating two vtables with the same self type, but different // traits. diff --git a/src/test/ui/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs b/src/test/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs similarity index 97% rename from src/test/ui/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs rename to src/test/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs index d9a051ee02e0..991d482c15be 100644 --- a/src/test/ui/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs +++ b/src/test/run-pass/traits/overlap-permitted-for-marker-traits-neg.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(overlapping_marker_traits)] #![feature(optin_builtin_traits)] diff --git a/src/test/ui/run-pass/traits/overlap-permitted-for-marker-traits.rs b/src/test/run-pass/traits/overlap-permitted-for-marker-traits.rs similarity index 100% rename from src/test/ui/run-pass/traits/overlap-permitted-for-marker-traits.rs rename to src/test/run-pass/traits/overlap-permitted-for-marker-traits.rs diff --git a/src/test/ui/run-pass/traits/parameterized-trait-with-bounds.rs b/src/test/run-pass/traits/parameterized-trait-with-bounds.rs similarity index 100% rename from src/test/ui/run-pass/traits/parameterized-trait-with-bounds.rs rename to src/test/run-pass/traits/parameterized-trait-with-bounds.rs diff --git a/src/test/ui/run-pass/traits/supertrait-default-generics.rs b/src/test/run-pass/traits/supertrait-default-generics.rs similarity index 98% rename from src/test/ui/run-pass/traits/supertrait-default-generics.rs rename to src/test/run-pass/traits/supertrait-default-generics.rs index c3c37d6b9c02..984089b4d11a 100644 --- a/src/test/ui/run-pass/traits/supertrait-default-generics.rs +++ b/src/test/run-pass/traits/supertrait-default-generics.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // There is some other borrowck bug, so we make the stuff not mut. diff --git a/src/test/ui/run-pass/traits/syntax-trait-polarity.rs b/src/test/run-pass/traits/syntax-trait-polarity.rs similarity index 97% rename from src/test/ui/run-pass/traits/syntax-trait-polarity.rs rename to src/test/run-pass/traits/syntax-trait-polarity.rs index 89b49b11f010..a77099b4257f 100644 --- a/src/test/ui/run-pass/traits/syntax-trait-polarity.rs +++ b/src/test/run-pass/traits/syntax-trait-polarity.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(optin_builtin_traits)] diff --git a/src/test/ui/run-pass/traits/trait-bounds-basic.rs b/src/test/run-pass/traits/trait-bounds-basic.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-bounds-basic.rs rename to src/test/run-pass/traits/trait-bounds-basic.rs index 1a2621f76794..81b410b7777e 100644 --- a/src/test/ui/run-pass/traits/trait-bounds-basic.rs +++ b/src/test/run-pass/traits/trait-bounds-basic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(unconditional_recursion)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/traits/trait-bounds-impl-comparison-duplicates.rs b/src/test/run-pass/traits/trait-bounds-impl-comparison-duplicates.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-bounds-impl-comparison-duplicates.rs rename to src/test/run-pass/traits/trait-bounds-impl-comparison-duplicates.rs diff --git a/src/test/ui/run-pass/traits/trait-bounds-in-arc.rs b/src/test/run-pass/traits/trait-bounds-in-arc.rs similarity index 99% rename from src/test/ui/run-pass/traits/trait-bounds-in-arc.rs rename to src/test/run-pass/traits/trait-bounds-in-arc.rs index 35210be34781..0b67f492d452 100644 --- a/src/test/ui/run-pass/traits/trait-bounds-in-arc.rs +++ b/src/test/run-pass/traits/trait-bounds-in-arc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // Tests that a heterogeneous list of existential types can be put inside an Arc // and shared between threads as long as all types fulfill Send. diff --git a/src/test/ui/run-pass/traits/trait-bounds-on-structs-and-enums.rs b/src/test/run-pass/traits/trait-bounds-on-structs-and-enums.rs similarity index 93% rename from src/test/ui/run-pass/traits/trait-bounds-on-structs-and-enums.rs rename to src/test/run-pass/traits/trait-bounds-on-structs-and-enums.rs index 1b32c51aa85d..aa6b845bb013 100644 --- a/src/test/ui/run-pass/traits/trait-bounds-on-structs-and-enums.rs +++ b/src/test/run-pass/traits/trait-bounds-on-structs-and-enums.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 trait U {} diff --git a/src/test/ui/run-pass/traits/trait-bounds-recursion.rs b/src/test/run-pass/traits/trait-bounds-recursion.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-bounds-recursion.rs rename to src/test/run-pass/traits/trait-bounds-recursion.rs diff --git a/src/test/ui/run-pass/traits/trait-bounds.rs b/src/test/run-pass/traits/trait-bounds.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-bounds.rs rename to src/test/run-pass/traits/trait-bounds.rs index 3c433b58a3a9..20a9bd47d0e5 100644 --- a/src/test/ui/run-pass/traits/trait-bounds.rs +++ b/src/test/run-pass/traits/trait-bounds.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] diff --git a/src/test/ui/run-pass/traits/trait-cache-issue-18209.rs b/src/test/run-pass/traits/trait-cache-issue-18209.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-cache-issue-18209.rs rename to src/test/run-pass/traits/trait-cache-issue-18209.rs diff --git a/src/test/ui/run-pass/traits/trait-coercion-generic.rs b/src/test/run-pass/traits/trait-coercion-generic.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-coercion-generic.rs rename to src/test/run-pass/traits/trait-coercion-generic.rs index 2b64bb005e92..541c6e19b237 100644 --- a/src/test/ui/run-pass/traits/trait-coercion-generic.rs +++ b/src/test/run-pass/traits/trait-coercion-generic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Trait { fn f(&self, x: T); } diff --git a/src/test/ui/run-pass/traits/trait-coercion.rs b/src/test/run-pass/traits/trait-coercion.rs similarity index 92% rename from src/test/ui/run-pass/traits/trait-coercion.rs rename to src/test/run-pass/traits/trait-coercion.rs index 18fc122439bc..948f2e7afafe 100644 --- a/src/test/ui/run-pass/traits/trait-coercion.rs +++ b/src/test/run-pass/traits/trait-coercion.rs @@ -9,6 +9,9 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_mut)] +#![allow(unused_variables)] #![feature(box_syntax)] use std::io::{self, Write}; diff --git a/src/test/ui/run-pass/traits/trait-composition-trivial.rs b/src/test/run-pass/traits/trait-composition-trivial.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-composition-trivial.rs rename to src/test/run-pass/traits/trait-composition-trivial.rs diff --git a/src/test/ui/run-pass/traits/trait-copy-guessing.rs b/src/test/run-pass/traits/trait-copy-guessing.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-copy-guessing.rs rename to src/test/run-pass/traits/trait-copy-guessing.rs index 2d2ea50a1fd5..1035c9a1751b 100644 --- a/src/test/ui/run-pass/traits/trait-copy-guessing.rs +++ b/src/test/run-pass/traits/trait-copy-guessing.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // "guessing" in trait selection can affect `copy_or_move`. Check that this // is correctly handled. I am not sure what is the "correct" behaviour, // but we should at least not ICE. diff --git a/src/test/ui/run-pass/traits/trait-default-method-bound-subst.rs b/src/test/run-pass/traits/trait-default-method-bound-subst.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-default-method-bound-subst.rs rename to src/test/run-pass/traits/trait-default-method-bound-subst.rs diff --git a/src/test/ui/run-pass/traits/trait-default-method-bound-subst2.rs b/src/test/run-pass/traits/trait-default-method-bound-subst2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-default-method-bound-subst2.rs rename to src/test/run-pass/traits/trait-default-method-bound-subst2.rs diff --git a/src/test/ui/run-pass/traits/trait-default-method-bound-subst3.rs b/src/test/run-pass/traits/trait-default-method-bound-subst3.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-default-method-bound-subst3.rs rename to src/test/run-pass/traits/trait-default-method-bound-subst3.rs diff --git a/src/test/ui/run-pass/traits/trait-default-method-bound-subst4.rs b/src/test/run-pass/traits/trait-default-method-bound-subst4.rs similarity index 96% rename from src/test/ui/run-pass/traits/trait-default-method-bound-subst4.rs rename to src/test/run-pass/traits/trait-default-method-bound-subst4.rs index 70c440c76658..6f3e2e1e72b0 100644 --- a/src/test/ui/run-pass/traits/trait-default-method-bound-subst4.rs +++ b/src/test/run-pass/traits/trait-default-method-bound-subst4.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] trait A { diff --git a/src/test/ui/run-pass/traits/trait-default-method-bound.rs b/src/test/run-pass/traits/trait-default-method-bound.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-default-method-bound.rs rename to src/test/run-pass/traits/trait-default-method-bound.rs diff --git a/src/test/ui/run-pass/traits/trait-default-method-xc-2.rs b/src/test/run-pass/traits/trait-default-method-xc-2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-default-method-xc-2.rs rename to src/test/run-pass/traits/trait-default-method-xc-2.rs diff --git a/src/test/ui/run-pass/traits/trait-default-method-xc.rs b/src/test/run-pass/traits/trait-default-method-xc.rs similarity index 99% rename from src/test/ui/run-pass/traits/trait-default-method-xc.rs rename to src/test/run-pass/traits/trait-default-method-xc.rs index 426b3e2ad794..da84e8992cd5 100644 --- a/src/test/ui/run-pass/traits/trait-default-method-xc.rs +++ b/src/test/run-pass/traits/trait-default-method-xc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // aux-build:trait_default_method_xc_aux.rs diff --git a/src/test/ui/run-pass/traits/trait-false-ambiguity-where-clause-builtin-bound.rs b/src/test/run-pass/traits/trait-false-ambiguity-where-clause-builtin-bound.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-false-ambiguity-where-clause-builtin-bound.rs rename to src/test/run-pass/traits/trait-false-ambiguity-where-clause-builtin-bound.rs diff --git a/src/test/ui/run-pass/traits/trait-generic.rs b/src/test/run-pass/traits/trait-generic.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-generic.rs rename to src/test/run-pass/traits/trait-generic.rs diff --git a/src/test/ui/run-pass/traits/trait-impl-2.rs b/src/test/run-pass/traits/trait-impl-2.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-impl-2.rs rename to src/test/run-pass/traits/trait-impl-2.rs index 8fadb09377f8..52657042dd82 100644 --- a/src/test/ui/run-pass/traits/trait-impl-2.rs +++ b/src/test/run-pass/traits/trait-impl-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/traits/trait-impl.rs b/src/test/run-pass/traits/trait-impl.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-impl.rs rename to src/test/run-pass/traits/trait-impl.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-auto-xc-2.rs b/src/test/run-pass/traits/trait-inheritance-auto-xc-2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-auto-xc-2.rs rename to src/test/run-pass/traits/trait-inheritance-auto-xc-2.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-auto-xc.rs b/src/test/run-pass/traits/trait-inheritance-auto-xc.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-auto-xc.rs rename to src/test/run-pass/traits/trait-inheritance-auto-xc.rs index d6b3d900a090..17d4d42e0c04 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-auto-xc.rs +++ b/src/test/run-pass/traits/trait-inheritance-auto-xc.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // aux-build:trait_inheritance_auto_xc_aux.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-auto.rs b/src/test/run-pass/traits/trait-inheritance-auto.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-inheritance-auto.rs rename to src/test/run-pass/traits/trait-inheritance-auto.rs index 698f8ac23dde..4d61e42445dd 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-auto.rs +++ b/src/test/run-pass/traits/trait-inheritance-auto.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Testing that this impl turns A into a Quux, because // A is already a Foo Bar Baz diff --git a/src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited.rs b/src/test/run-pass/traits/trait-inheritance-call-bound-inherited.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited.rs rename to src/test/run-pass/traits/trait-inheritance-call-bound-inherited.rs index 566d59f460e0..6a6bd9c7be54 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited.rs +++ b/src/test/run-pass/traits/trait-inheritance-call-bound-inherited.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn f(&self) -> isize; } trait Bar : Foo { fn g(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited2.rs b/src/test/run-pass/traits/trait-inheritance-call-bound-inherited2.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited2.rs rename to src/test/run-pass/traits/trait-inheritance-call-bound-inherited2.rs index a769da5e2cb5..c8d8c3d62a2f 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-call-bound-inherited2.rs +++ b/src/test/run-pass/traits/trait-inheritance-call-bound-inherited2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn f(&self) -> isize; } trait Bar : Foo { fn g(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs b/src/test/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs rename to src/test/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs index 00d74ca07810..5410c5c79adf 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs +++ b/src/test/run-pass/traits/trait-inheritance-cast-without-call-to-supertrait.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Testing that we can cast to a subtrait and call subtrait // methods. Not testing supertrait methods diff --git a/src/test/ui/run-pass/traits/trait-inheritance-cast.rs b/src/test/run-pass/traits/trait-inheritance-cast.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-cast.rs rename to src/test/run-pass/traits/trait-inheritance-cast.rs index f2d1cb0cb3d0..084a7d8440d9 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-cast.rs +++ b/src/test/run-pass/traits/trait-inheritance-cast.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Testing that supertrait methods can be called on subtrait object types diff --git a/src/test/ui/run-pass/traits/trait-inheritance-cross-trait-call-xc.rs b/src/test/run-pass/traits/trait-inheritance-cross-trait-call-xc.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-cross-trait-call-xc.rs rename to src/test/run-pass/traits/trait-inheritance-cross-trait-call-xc.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-cross-trait-call.rs b/src/test/run-pass/traits/trait-inheritance-cross-trait-call.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-cross-trait-call.rs rename to src/test/run-pass/traits/trait-inheritance-cross-trait-call.rs index 3a57fc525b26..29d54ed697d7 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-cross-trait-call.rs +++ b/src/test/run-pass/traits/trait-inheritance-cross-trait-call.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn f(&self) -> isize; } trait Bar : Foo { fn g(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-diamond.rs b/src/test/run-pass/traits/trait-inheritance-diamond.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-inheritance-diamond.rs rename to src/test/run-pass/traits/trait-inheritance-diamond.rs index bf66d50d1592..47b3c7446e89 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-diamond.rs +++ b/src/test/run-pass/traits/trait-inheritance-diamond.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // B and C both require A, so D does as well, twice, but that's just fine diff --git a/src/test/ui/run-pass/traits/trait-inheritance-multiple-inheritors.rs b/src/test/run-pass/traits/trait-inheritance-multiple-inheritors.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-multiple-inheritors.rs rename to src/test/run-pass/traits/trait-inheritance-multiple-inheritors.rs index b9a9795c6c0d..163914e7462d 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-multiple-inheritors.rs +++ b/src/test/run-pass/traits/trait-inheritance-multiple-inheritors.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait A { fn a(&self) -> isize; } trait B: A { fn b(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-multiple-params.rs b/src/test/run-pass/traits/trait-inheritance-multiple-params.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-inheritance-multiple-params.rs rename to src/test/run-pass/traits/trait-inheritance-multiple-params.rs index 5e6aa85498c7..1a08099aa040 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-multiple-params.rs +++ b/src/test/run-pass/traits/trait-inheritance-multiple-params.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait A { fn a(&self) -> isize; } trait B: A { fn b(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num.rs b/src/test/run-pass/traits/trait-inheritance-num.rs similarity index 93% rename from src/test/ui/run-pass/traits/trait-inheritance-num.rs rename to src/test/run-pass/traits/trait-inheritance-num.rs index 9d4c9f431ddb..cd269eac9a40 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-num.rs +++ b/src/test/run-pass/traits/trait-inheritance-num.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 pub trait NumExt: PartialEq + PartialOrd {} diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num0.rs b/src/test/run-pass/traits/trait-inheritance-num0.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-num0.rs rename to src/test/run-pass/traits/trait-inheritance-num0.rs index 0d57dee49a17..7ff30118c863 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-num0.rs +++ b/src/test/run-pass/traits/trait-inheritance-num0.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Extending Num and using inherited static methods // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num1.rs b/src/test/run-pass/traits/trait-inheritance-num1.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-num1.rs rename to src/test/run-pass/traits/trait-inheritance-num1.rs index e2a4f4154f9f..4b47ab58b1d0 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-num1.rs +++ b/src/test/run-pass/traits/trait-inheritance-num1.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 pub trait NumCast: Sized { diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num2.rs b/src/test/run-pass/traits/trait-inheritance-num2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-num2.rs rename to src/test/run-pass/traits/trait-inheritance-num2.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num3.rs b/src/test/run-pass/traits/trait-inheritance-num3.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-num3.rs rename to src/test/run-pass/traits/trait-inheritance-num3.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-num5.rs b/src/test/run-pass/traits/trait-inheritance-num5.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-num5.rs rename to src/test/run-pass/traits/trait-inheritance-num5.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-overloading-simple.rs b/src/test/run-pass/traits/trait-inheritance-overloading-simple.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-overloading-simple.rs rename to src/test/run-pass/traits/trait-inheritance-overloading-simple.rs index ff2f6b2d8250..374246da2855 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-overloading-simple.rs +++ b/src/test/run-pass/traits/trait-inheritance-overloading-simple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] use std::cmp::PartialEq; trait MyNum : PartialEq { } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-overloading-xc-exe.rs b/src/test/run-pass/traits/trait-inheritance-overloading-xc-exe.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-overloading-xc-exe.rs rename to src/test/run-pass/traits/trait-inheritance-overloading-xc-exe.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-overloading.rs b/src/test/run-pass/traits/trait-inheritance-overloading.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-overloading.rs rename to src/test/run-pass/traits/trait-inheritance-overloading.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-self-in-supertype.rs b/src/test/run-pass/traits/trait-inheritance-self-in-supertype.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-self-in-supertype.rs rename to src/test/run-pass/traits/trait-inheritance-self-in-supertype.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-self.rs b/src/test/run-pass/traits/trait-inheritance-self.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-self.rs rename to src/test/run-pass/traits/trait-inheritance-self.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-simple.rs b/src/test/run-pass/traits/trait-inheritance-simple.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance-simple.rs rename to src/test/run-pass/traits/trait-inheritance-simple.rs index 379a98cdebe5..7da4647f6521 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance-simple.rs +++ b/src/test/run-pass/traits/trait-inheritance-simple.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn f(&self) -> isize; } trait Bar : Foo { fn g(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-inheritance-static.rs b/src/test/run-pass/traits/trait-inheritance-static.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-static.rs rename to src/test/run-pass/traits/trait-inheritance-static.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-static2.rs b/src/test/run-pass/traits/trait-inheritance-static2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-static2.rs rename to src/test/run-pass/traits/trait-inheritance-static2.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-subst.rs b/src/test/run-pass/traits/trait-inheritance-subst.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-subst.rs rename to src/test/run-pass/traits/trait-inheritance-subst.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-subst2.rs b/src/test/run-pass/traits/trait-inheritance-subst2.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-subst2.rs rename to src/test/run-pass/traits/trait-inheritance-subst2.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance-visibility.rs b/src/test/run-pass/traits/trait-inheritance-visibility.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-inheritance-visibility.rs rename to src/test/run-pass/traits/trait-inheritance-visibility.rs diff --git a/src/test/ui/run-pass/traits/trait-inheritance2.rs b/src/test/run-pass/traits/trait-inheritance2.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-inheritance2.rs rename to src/test/run-pass/traits/trait-inheritance2.rs index 01088d655378..22c3b30c9e45 100644 --- a/src/test/ui/run-pass/traits/trait-inheritance2.rs +++ b/src/test/run-pass/traits/trait-inheritance2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] trait Foo { fn f(&self) -> isize; } trait Bar { fn g(&self) -> isize; } diff --git a/src/test/ui/run-pass/traits/trait-item-inside-macro.rs b/src/test/run-pass/traits/trait-item-inside-macro.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-item-inside-macro.rs rename to src/test/run-pass/traits/trait-item-inside-macro.rs diff --git a/src/test/ui/run-pass/traits/trait-object-auto-dedup.rs b/src/test/run-pass/traits/trait-object-auto-dedup.rs similarity index 98% rename from src/test/ui/run-pass/traits/trait-object-auto-dedup.rs rename to src/test/run-pass/traits/trait-object-auto-dedup.rs index c33482e8a710..0d9728210f29 100644 --- a/src/test/ui/run-pass/traits/trait-object-auto-dedup.rs +++ b/src/test/run-pass/traits/trait-object-auto-dedup.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] // Test that duplicate auto trait bounds in trait objects don't create new types. #[allow(unused_assignments)] diff --git a/src/test/ui/run-pass/traits/trait-object-exclusion.rs b/src/test/run-pass/traits/trait-object-exclusion.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-object-exclusion.rs rename to src/test/run-pass/traits/trait-object-exclusion.rs diff --git a/src/test/ui/run-pass/traits/trait-object-generics.rs b/src/test/run-pass/traits/trait-object-generics.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-object-generics.rs rename to src/test/run-pass/traits/trait-object-generics.rs diff --git a/src/test/ui/run-pass/traits/trait-object-lifetime-first.rs b/src/test/run-pass/traits/trait-object-lifetime-first.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-object-lifetime-first.rs rename to src/test/run-pass/traits/trait-object-lifetime-first.rs diff --git a/src/test/ui/run-pass/traits/trait-object-with-lifetime-bound.rs b/src/test/run-pass/traits/trait-object-with-lifetime-bound.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-object-with-lifetime-bound.rs rename to src/test/run-pass/traits/trait-object-with-lifetime-bound.rs diff --git a/src/test/ui/run-pass/traits/trait-region-pointer-simple.rs b/src/test/run-pass/traits/trait-region-pointer-simple.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-region-pointer-simple.rs rename to src/test/run-pass/traits/trait-region-pointer-simple.rs diff --git a/src/test/ui/run-pass/traits/trait-safety-ok-cc.rs b/src/test/run-pass/traits/trait-safety-ok-cc.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-safety-ok-cc.rs rename to src/test/run-pass/traits/trait-safety-ok-cc.rs diff --git a/src/test/ui/run-pass/traits/trait-safety-ok.rs b/src/test/run-pass/traits/trait-safety-ok.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-safety-ok.rs rename to src/test/run-pass/traits/trait-safety-ok.rs diff --git a/src/test/ui/run-pass/traits/trait-static-method-overwriting.rs b/src/test/run-pass/traits/trait-static-method-overwriting.rs similarity index 97% rename from src/test/ui/run-pass/traits/trait-static-method-overwriting.rs rename to src/test/run-pass/traits/trait-static-method-overwriting.rs index 25307e822ffd..76ec05aba34f 100644 --- a/src/test/ui/run-pass/traits/trait-static-method-overwriting.rs +++ b/src/test/run-pass/traits/trait-static-method-overwriting.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] mod base { pub trait HasNew { fn new() -> Self; diff --git a/src/test/ui/run-pass/traits/trait-to-str.rs b/src/test/run-pass/traits/trait-to-str.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-to-str.rs rename to src/test/run-pass/traits/trait-to-str.rs diff --git a/src/test/ui/run-pass/traits/trait-where-clause-vs-impl.rs b/src/test/run-pass/traits/trait-where-clause-vs-impl.rs similarity index 96% rename from src/test/ui/run-pass/traits/trait-where-clause-vs-impl.rs rename to src/test/run-pass/traits/trait-where-clause-vs-impl.rs index 3a732aabbf74..e811cc7d6e12 100644 --- a/src/test/ui/run-pass/traits/trait-where-clause-vs-impl.rs +++ b/src/test/run-pass/traits/trait-where-clause-vs-impl.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // Test that when there is a conditional (but blanket) impl and a // where clause, we don't get confused in trait resolution. // diff --git a/src/test/ui/run-pass/traits/trait-with-bounds-default.rs b/src/test/run-pass/traits/trait-with-bounds-default.rs similarity index 100% rename from src/test/ui/run-pass/traits/trait-with-bounds-default.rs rename to src/test/run-pass/traits/trait-with-bounds-default.rs diff --git a/src/test/ui/run-pass/traits/traits-assoc-type-in-supertrait.rs b/src/test/run-pass/traits/traits-assoc-type-in-supertrait.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-assoc-type-in-supertrait.rs rename to src/test/run-pass/traits/traits-assoc-type-in-supertrait.rs diff --git a/src/test/ui/run-pass/traits/traits-conditional-dispatch.rs b/src/test/run-pass/traits/traits-conditional-dispatch.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-conditional-dispatch.rs rename to src/test/run-pass/traits/traits-conditional-dispatch.rs diff --git a/src/test/ui/run-pass/traits/traits-conditional-model-fn.rs b/src/test/run-pass/traits/traits-conditional-model-fn.rs similarity index 98% rename from src/test/ui/run-pass/traits/traits-conditional-model-fn.rs rename to src/test/run-pass/traits/traits-conditional-model-fn.rs index cc5ce571a4e1..106774bd3379 100644 --- a/src/test/ui/run-pass/traits/traits-conditional-model-fn.rs +++ b/src/test/run-pass/traits/traits-conditional-model-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // A model for how the `Fn` traits could work. You can implement at // most one of `Go`, `GoMut`, or `GoOnce`, and then the others follow // automatically. diff --git a/src/test/ui/run-pass/traits/traits-default-method-macro.rs b/src/test/run-pass/traits/traits-default-method-macro.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-default-method-macro.rs rename to src/test/run-pass/traits/traits-default-method-macro.rs diff --git a/src/test/ui/run-pass/traits/traits-default-method-mut.rs b/src/test/run-pass/traits/traits-default-method-mut.rs similarity index 95% rename from src/test/ui/run-pass/traits/traits-default-method-mut.rs rename to src/test/run-pass/traits/traits-default-method-mut.rs index 7cfdae9e652b..c83856f03528 100644 --- a/src/test/ui/run-pass/traits/traits-default-method-mut.rs +++ b/src/test/run-pass/traits/traits-default-method-mut.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] // pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/src/test/ui/run-pass/traits/traits-default-method-self.rs b/src/test/run-pass/traits/traits-default-method-self.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-default-method-self.rs rename to src/test/run-pass/traits/traits-default-method-self.rs diff --git a/src/test/ui/run-pass/traits/traits-default-method-trivial.rs b/src/test/run-pass/traits/traits-default-method-trivial.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-default-method-trivial.rs rename to src/test/run-pass/traits/traits-default-method-trivial.rs diff --git a/src/test/ui/run-pass/traits/traits-elaborate-type-region.rs b/src/test/run-pass/traits/traits-elaborate-type-region.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-elaborate-type-region.rs rename to src/test/run-pass/traits/traits-elaborate-type-region.rs diff --git a/src/test/ui/run-pass/traits/traits-impl-object-overlap-issue-23853.rs b/src/test/run-pass/traits/traits-impl-object-overlap-issue-23853.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-impl-object-overlap-issue-23853.rs rename to src/test/run-pass/traits/traits-impl-object-overlap-issue-23853.rs diff --git a/src/test/ui/run-pass/traits/traits-issue-22019.rs b/src/test/run-pass/traits/traits-issue-22019.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-issue-22019.rs rename to src/test/run-pass/traits/traits-issue-22019.rs diff --git a/src/test/ui/run-pass/traits/traits-issue-22110.rs b/src/test/run-pass/traits/traits-issue-22110.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-issue-22110.rs rename to src/test/run-pass/traits/traits-issue-22110.rs diff --git a/src/test/ui/run-pass/traits/traits-issue-22655.rs b/src/test/run-pass/traits/traits-issue-22655.rs similarity index 97% rename from src/test/ui/run-pass/traits/traits-issue-22655.rs rename to src/test/run-pass/traits/traits-issue-22655.rs index 0e80d20ad451..6766d6616227 100644 --- a/src/test/ui/run-pass/traits/traits-issue-22655.rs +++ b/src/test/run-pass/traits/traits-issue-22655.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Regression test for issue #22655: This test should not lead to // infinite recursion. diff --git a/src/test/ui/run-pass/traits/traits-issue-23003.rs b/src/test/run-pass/traits/traits-issue-23003.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-issue-23003.rs rename to src/test/run-pass/traits/traits-issue-23003.rs diff --git a/src/test/ui/run-pass/traits/traits-issue-26339.rs b/src/test/run-pass/traits/traits-issue-26339.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-issue-26339.rs rename to src/test/run-pass/traits/traits-issue-26339.rs diff --git a/src/test/ui/run-pass/traits/traits-multidispatch-infer-convert-target.rs b/src/test/run-pass/traits/traits-multidispatch-infer-convert-target.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-multidispatch-infer-convert-target.rs rename to src/test/run-pass/traits/traits-multidispatch-infer-convert-target.rs diff --git a/src/test/ui/run-pass/traits/traits-negative-impls.rs b/src/test/run-pass/traits/traits-negative-impls.rs similarity index 96% rename from src/test/ui/run-pass/traits/traits-negative-impls.rs rename to src/test/run-pass/traits/traits-negative-impls.rs index 96c86f147ce2..0740ab01104b 100644 --- a/src/test/ui/run-pass/traits/traits-negative-impls.rs +++ b/src/test/run-pass/traits/traits-negative-impls.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] #![feature(optin_builtin_traits)] use std::marker::Send; diff --git a/src/test/ui/run-pass/traits/traits-repeated-supertrait.rs b/src/test/run-pass/traits/traits-repeated-supertrait.rs similarity index 100% rename from src/test/ui/run-pass/traits/traits-repeated-supertrait.rs rename to src/test/run-pass/traits/traits-repeated-supertrait.rs diff --git a/src/test/ui/run-pass/traits/ufcs-trait-object.rs b/src/test/run-pass/traits/ufcs-trait-object.rs similarity index 100% rename from src/test/ui/run-pass/traits/ufcs-trait-object.rs rename to src/test/run-pass/traits/ufcs-trait-object.rs diff --git a/src/test/ui/run-pass/traits/use-trait-before-def.rs b/src/test/run-pass/traits/use-trait-before-def.rs similarity index 100% rename from src/test/ui/run-pass/traits/use-trait-before-def.rs rename to src/test/run-pass/traits/use-trait-before-def.rs diff --git a/src/test/ui/run-pass/unboxed-closures/auxiliary/unboxed-closures-cross-crate.rs b/src/test/run-pass/unboxed-closures/auxiliary/unboxed-closures-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/auxiliary/unboxed-closures-cross-crate.rs rename to src/test/run-pass/unboxed-closures/auxiliary/unboxed-closures-cross-crate.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-all-traits.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-all-traits.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-all-traits.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-all-traits.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs similarity index 96% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs index eebd30a01f9f..6c1346113124 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn-mut.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that you can supply `&F` where `F: FnMut()`. #![feature(lang_items)] diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs similarity index 96% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs index 52a10869610c..966458a45f36 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-blanket-fn.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that you can supply `&F` where `F: Fn()`. #![feature(lang_items)] diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-boxed.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-boxed.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-boxed.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-boxed.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-by-ref.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-by-ref.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-by-ref.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-by-ref.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs similarity index 97% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs index b178f0af909a..adfdc0d26e90 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-call-fn-autoderef.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // Test that the call operator autoderefs when calling a bounded type parameter. use std::ops::FnMut; diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-autoderef.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-autoderef.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-autoderef.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-autoderef.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-object-autoderef.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-object-autoderef.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-object-autoderef.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-object-autoderef.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-object.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-object.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-call-sugar-object.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-call-sugar-object.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs similarity index 97% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs index dc6903db326c..4ebf6b61cc3a 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-counter-not-moved.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // Test that we mutate a counter on the stack only when we expect to. fn call(f: F) where F : FnOnce() { diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-cross-crate.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-cross-crate.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-cross-crate.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs similarity index 96% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs index 1f84db7f7205..46a69c4dff29 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-direct-sugary-call.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // pretty-expanded FIXME #23616 fn main() { diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-drop.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-drop.rs similarity index 98% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-drop.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-drop.rs index 02edd01ac187..46ea9b29e448 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-drop.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-drop.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(path_statements)] +#![allow(dead_code)] // A battery of tests to ensure destructors of unboxed closure environments // run at the right times. diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-extern-fn-hr.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-extern-fn-hr.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-extern-fn-hr.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-extern-fn-hr.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-extern-fn.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-extern-fn.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-extern-fn.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-extern-fn.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-fn-as-fnmut-and-fnonce.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-fn-as-fnmut-and-fnonce.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-fn-as-fnmut-and-fnonce.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-fn-as-fnmut-and-fnonce.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-fnmut-as-fnonce.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-fnmut-as-fnonce.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-fnmut-as-fnonce.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-fnmut-as-fnonce.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-generic.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-generic.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-generic.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-generic.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-explicit-call-early.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-explicit-call-early.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-explicit-call-early.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-explicit-call-early.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-move.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-move.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-move.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut-move.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnmut.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnmut.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnonce-move.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnonce-move.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnonce-move.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnonce-move.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnonce.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnonce.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-fnonce.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-fnonce.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-kind.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-kind.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-kind.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-kind.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-recursive-fn.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-recursive-fn.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-recursive-fn.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-recursive-fn.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-upvar.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-infer-upvar.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-infer-upvar.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-infer-upvar.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-manual-impl.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-manual-impl.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-manual-impl.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-manual-impl.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-monomorphization.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-monomorphization.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-monomorphization.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-monomorphization.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-from-projection-issue-30046.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-move-from-projection-issue-30046.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-from-projection-issue-30046.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-move-from-projection-issue-30046.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-mutable.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-move-mutable.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-mutable.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-move-mutable.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-some-upvars-in-by-ref-closure.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-move-some-upvars-in-by-ref-closure.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-move-some-upvars-in-by-ref-closure.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-move-some-upvars-in-by-ref-closure.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-prelude.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-prelude.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-prelude.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-prelude.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-simple.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-simple.rs similarity index 92% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-simple.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-simple.rs index b7230ed5d82a..3f50c7e72629 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-simple.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-simple.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_imports)] use std::ops::FnMut; pub fn main() { diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-single-word-env.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-single-word-env.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-single-word-env.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-single-word-env.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-static-call-fn-once.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-static-call-fn-once.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-static-call-fn-once.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-static-call-fn-once.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-sugar-object.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-sugar-object.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-sugar-object.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-sugar-object.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-unique-type-id.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-unique-type-id.rs similarity index 100% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-unique-type-id.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-unique-type-id.rs diff --git a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-zero-args.rs b/src/test/run-pass/unboxed-closures/unboxed-closures-zero-args.rs similarity index 96% rename from src/test/ui/run-pass/unboxed-closures/unboxed-closures-zero-args.rs rename to src/test/run-pass/unboxed-closures/unboxed-closures-zero-args.rs index ae9124c9fc14..cf8fe03e3e53 100644 --- a/src/test/ui/run-pass/unboxed-closures/unboxed-closures-zero-args.rs +++ b/src/test/run-pass/unboxed-closures/unboxed-closures-zero-args.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] // pretty-expanded FIXME #23616 fn main() { diff --git a/src/test/ui/run-pass/uniform-paths/basic-nested.rs b/src/test/run-pass/uniform-paths/basic-nested.rs similarity index 98% rename from src/test/ui/run-pass/uniform-paths/basic-nested.rs rename to src/test/run-pass/uniform-paths/basic-nested.rs index 1aaa1e70726c..a0256187dbba 100644 --- a/src/test/ui/run-pass/uniform-paths/basic-nested.rs +++ b/src/test/run-pass/uniform-paths/basic-nested.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(non_camel_case_types)] // edition:2018 diff --git a/src/test/ui/run-pass/uniform-paths/basic.rs b/src/test/run-pass/uniform-paths/basic.rs similarity index 97% rename from src/test/ui/run-pass/uniform-paths/basic.rs rename to src/test/run-pass/uniform-paths/basic.rs index 7d997fe493a7..b957b24d6251 100644 --- a/src/test/ui/run-pass/uniform-paths/basic.rs +++ b/src/test/run-pass/uniform-paths/basic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] #![allow(non_camel_case_types)] // edition:2018 diff --git a/src/test/ui/run-pass/uniform-paths/macros-nested.rs b/src/test/run-pass/uniform-paths/macros-nested.rs similarity index 100% rename from src/test/ui/run-pass/uniform-paths/macros-nested.rs rename to src/test/run-pass/uniform-paths/macros-nested.rs diff --git a/src/test/ui/run-pass/uniform-paths/macros.rs b/src/test/run-pass/uniform-paths/macros.rs similarity index 100% rename from src/test/ui/run-pass/uniform-paths/macros.rs rename to src/test/run-pass/uniform-paths/macros.rs diff --git a/src/test/ui/run-pass/uniform-paths/same-crate.rs b/src/test/run-pass/uniform-paths/same-crate.rs similarity index 100% rename from src/test/ui/run-pass/uniform-paths/same-crate.rs rename to src/test/run-pass/uniform-paths/same-crate.rs diff --git a/src/test/ui/run-pass/union/auxiliary/union.rs b/src/test/run-pass/union/auxiliary/union.rs similarity index 100% rename from src/test/ui/run-pass/union/auxiliary/union.rs rename to src/test/run-pass/union/auxiliary/union.rs diff --git a/src/test/ui/run-pass/union/union-align.rs b/src/test/run-pass/union/union-align.rs similarity index 98% rename from src/test/ui/run-pass/union/union-align.rs rename to src/test/run-pass/union/union-align.rs index 02f447c626f8..2ba1b97e4ff9 100644 --- a/src/test/ui/run-pass/union/union-align.rs +++ b/src/test/run-pass/union/union-align.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![feature(untagged_unions)] diff --git a/src/test/ui/run-pass/union/union-backcomp.rs b/src/test/run-pass/union/union-backcomp.rs similarity index 93% rename from src/test/ui/run-pass/union/union-backcomp.rs rename to src/test/run-pass/union/union-backcomp.rs index 23d51d39c2ed..b274a101ee90 100644 --- a/src/test/ui/run-pass/union/union-backcomp.rs +++ b/src/test/run-pass/union/union-backcomp.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(path_statements)] +#![allow(dead_code)] macro_rules! union { () => (struct S;) diff --git a/src/test/ui/run-pass/union/union-basic.rs b/src/test/run-pass/union/union-basic.rs similarity index 98% rename from src/test/ui/run-pass/union/union-basic.rs rename to src/test/run-pass/union/union-basic.rs index bfbac1a6bf20..9bebe3f265e2 100644 --- a/src/test/ui/run-pass/union/union-basic.rs +++ b/src/test/run-pass/union/union-basic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_imports)] // aux-build:union.rs diff --git a/src/test/ui/run-pass/union/union-c-interop.rs b/src/test/run-pass/union/union-c-interop.rs similarity index 100% rename from src/test/ui/run-pass/union/union-c-interop.rs rename to src/test/run-pass/union/union-c-interop.rs diff --git a/src/test/ui/run-pass/union/union-const-codegen.rs b/src/test/run-pass/union/union-const-codegen.rs similarity index 100% rename from src/test/ui/run-pass/union/union-const-codegen.rs rename to src/test/run-pass/union/union-const-codegen.rs diff --git a/src/test/ui/run-pass/union/union-const-eval-field.rs b/src/test/run-pass/union/union-const-eval-field.rs similarity index 100% rename from src/test/ui/run-pass/union/union-const-eval-field.rs rename to src/test/run-pass/union/union-const-eval-field.rs diff --git a/src/test/ui/run-pass/union/union-derive.rs b/src/test/run-pass/union/union-derive.rs similarity index 95% rename from src/test/ui/run-pass/union/union-derive.rs rename to src/test/run-pass/union/union-derive.rs index 248595ee7ac0..605017808160 100644 --- a/src/test/ui/run-pass/union/union-derive.rs +++ b/src/test/run-pass/union/union-derive.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(unions_with_drop_fields)] // Some traits can be derived for unions. diff --git a/src/test/ui/run-pass/union/union-drop-assign.rs b/src/test/run-pass/union/union-drop-assign.rs similarity index 97% rename from src/test/ui/run-pass/union/union-drop-assign.rs rename to src/test/run-pass/union/union-drop-assign.rs index 2884cf16b967..d147fcd0f093 100644 --- a/src/test/ui/run-pass/union/union-drop-assign.rs +++ b/src/test/run-pass/union/union-drop-assign.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] #![allow(unions_with_drop_fields)] // Drop works for union itself. diff --git a/src/test/ui/run-pass/union/union-drop.rs b/src/test/run-pass/union/union-drop.rs similarity index 96% rename from src/test/ui/run-pass/union/union-drop.rs rename to src/test/run-pass/union/union-drop.rs index ba5c20b6dc3c..7d955f7210f9 100644 --- a/src/test/ui/run-pass/union/union-drop.rs +++ b/src/test/run-pass/union/union-drop.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] #![allow(unions_with_drop_fields)] // Drop works for union itself. diff --git a/src/test/ui/run-pass/union/union-generic.rs b/src/test/run-pass/union/union-generic.rs similarity index 98% rename from src/test/ui/run-pass/union/union-generic.rs rename to src/test/run-pass/union/union-generic.rs index dcea56c288f9..efa623841c14 100644 --- a/src/test/ui/run-pass/union/union-generic.rs +++ b/src/test/run-pass/union/union-generic.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(unions_with_drop_fields)] #![feature(untagged_unions)] diff --git a/src/test/ui/run-pass/union/union-inherent-method.rs b/src/test/run-pass/union/union-inherent-method.rs similarity index 100% rename from src/test/ui/run-pass/union/union-inherent-method.rs rename to src/test/run-pass/union/union-inherent-method.rs diff --git a/src/test/ui/run-pass/union/union-macro.rs b/src/test/run-pass/union/union-macro.rs similarity index 96% rename from src/test/ui/run-pass/union/union-macro.rs rename to src/test/run-pass/union/union-macro.rs index f4ffa2edbde0..ae215dc83ee8 100644 --- a/src/test/ui/run-pass/union/union-macro.rs +++ b/src/test/run-pass/union/union-macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] macro_rules! duplicate { ($i: item) => { diff --git a/src/test/ui/run-pass/union/union-nodrop.rs b/src/test/run-pass/union/union-nodrop.rs similarity index 100% rename from src/test/ui/run-pass/union/union-nodrop.rs rename to src/test/run-pass/union/union-nodrop.rs diff --git a/src/test/ui/run-pass/union/union-overwrite.rs b/src/test/run-pass/union/union-overwrite.rs similarity index 100% rename from src/test/ui/run-pass/union/union-overwrite.rs rename to src/test/run-pass/union/union-overwrite.rs diff --git a/src/test/ui/run-pass/union/union-packed.rs b/src/test/run-pass/union/union-packed.rs similarity index 99% rename from src/test/ui/run-pass/union/union-packed.rs rename to src/test/run-pass/union/union-packed.rs index c167a40507a8..a6aef9046eeb 100644 --- a/src/test/ui/run-pass/union/union-packed.rs +++ b/src/test/run-pass/union/union-packed.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_snake_case)] #![feature(untagged_unions)] diff --git a/src/test/ui/run-pass/union/union-pat-refutability.rs b/src/test/run-pass/union/union-pat-refutability.rs similarity index 98% rename from src/test/ui/run-pass/union/union-pat-refutability.rs rename to src/test/run-pass/union/union-pat-refutability.rs index 2c481160fdad..62a023379868 100644 --- a/src/test/ui/run-pass/union/union-pat-refutability.rs +++ b/src/test/run-pass/union/union-pat-refutability.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(illegal_floating_point_literal_pattern)] #[repr(u32)] diff --git a/src/test/ui/run-pass/union/union-trait-impl.rs b/src/test/run-pass/union/union-trait-impl.rs similarity index 100% rename from src/test/ui/run-pass/union/union-trait-impl.rs rename to src/test/run-pass/union/union-trait-impl.rs diff --git a/src/test/ui/run-pass/union/union-transmute.rs b/src/test/run-pass/union/union-transmute.rs similarity index 100% rename from src/test/ui/run-pass/union/union-transmute.rs rename to src/test/run-pass/union/union-transmute.rs diff --git a/src/test/ui/run-pass/union/union-with-drop-fields-lint.rs b/src/test/run-pass/union/union-with-drop-fields-lint.rs similarity index 100% rename from src/test/ui/run-pass/union/union-with-drop-fields-lint.rs rename to src/test/run-pass/union/union-with-drop-fields-lint.rs diff --git a/src/test/ui/run-pass/unique/unique-assign-copy.rs b/src/test/run-pass/unique/unique-assign-copy.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-assign-copy.rs rename to src/test/run-pass/unique/unique-assign-copy.rs diff --git a/src/test/ui/run-pass/unique/unique-assign-drop.rs b/src/test/run-pass/unique/unique-assign-drop.rs similarity index 95% rename from src/test/ui/run-pass/unique/unique-assign-drop.rs rename to src/test/run-pass/unique/unique-assign-drop.rs index dd9314801961..fc99a8969665 100644 --- a/src/test/ui/run-pass/unique/unique-assign-drop.rs +++ b/src/test/run-pass/unique/unique-assign-drop.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_assignments)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/unique/unique-assign-generic.rs b/src/test/run-pass/unique/unique-assign-generic.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-assign-generic.rs rename to src/test/run-pass/unique/unique-assign-generic.rs diff --git a/src/test/ui/run-pass/unique/unique-assign.rs b/src/test/run-pass/unique/unique-assign.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-assign.rs rename to src/test/run-pass/unique/unique-assign.rs index 206503f87ce9..ee6c084410d6 100644 --- a/src/test/ui/run-pass/unique/unique-assign.rs +++ b/src/test/run-pass/unique/unique-assign.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![feature(box_syntax)] pub fn main() { diff --git a/src/test/ui/run-pass/unique/unique-autoderef-field.rs b/src/test/run-pass/unique/unique-autoderef-field.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-autoderef-field.rs rename to src/test/run-pass/unique/unique-autoderef-field.rs diff --git a/src/test/ui/run-pass/unique/unique-autoderef-index.rs b/src/test/run-pass/unique/unique-autoderef-index.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-autoderef-index.rs rename to src/test/run-pass/unique/unique-autoderef-index.rs diff --git a/src/test/ui/run-pass/unique/unique-cmp.rs b/src/test/run-pass/unique/unique-cmp.rs similarity index 95% rename from src/test/ui/run-pass/unique/unique-cmp.rs rename to src/test/run-pass/unique/unique-cmp.rs index b11b1a8cdbc8..5c17058dbe4e 100644 --- a/src/test/ui/run-pass/unique/unique-cmp.rs +++ b/src/test/run-pass/unique/unique-cmp.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_allocation)] #![feature(box_syntax)] pub fn main() { diff --git a/src/test/ui/run-pass/unique/unique-containing-tag.rs b/src/test/run-pass/unique/unique-containing-tag.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-containing-tag.rs rename to src/test/run-pass/unique/unique-containing-tag.rs index d849c1d32981..f2a7de671837 100644 --- a/src/test/ui/run-pass/unique/unique-containing-tag.rs +++ b/src/test/run-pass/unique/unique-containing-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/unique/unique-create.rs b/src/test/run-pass/unique/unique-create.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-create.rs rename to src/test/run-pass/unique/unique-create.rs index 5c7488b1120d..da0ae17a4cd9 100644 --- a/src/test/ui/run-pass/unique/unique-create.rs +++ b/src/test/run-pass/unique/unique-create.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // pretty-expanded FIXME #23616 #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/unique/unique-decl-init-copy.rs b/src/test/run-pass/unique/unique-decl-init-copy.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-decl-init-copy.rs rename to src/test/run-pass/unique/unique-decl-init-copy.rs diff --git a/src/test/ui/run-pass/unique/unique-decl-init.rs b/src/test/run-pass/unique/unique-decl-init.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-decl-init.rs rename to src/test/run-pass/unique/unique-decl-init.rs diff --git a/src/test/ui/run-pass/unique/unique-decl-move.rs b/src/test/run-pass/unique/unique-decl-move.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-decl-move.rs rename to src/test/run-pass/unique/unique-decl-move.rs diff --git a/src/test/ui/run-pass/unique/unique-decl.rs b/src/test/run-pass/unique/unique-decl.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-decl.rs rename to src/test/run-pass/unique/unique-decl.rs index 37b8b94b15a4..9b1425381b68 100644 --- a/src/test/ui/run-pass/unique/unique-decl.rs +++ b/src/test/run-pass/unique/unique-decl.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] pub fn main() { diff --git a/src/test/ui/run-pass/unique/unique-deref.rs b/src/test/run-pass/unique/unique-deref.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-deref.rs rename to src/test/run-pass/unique/unique-deref.rs diff --git a/src/test/ui/run-pass/unique/unique-destructure.rs b/src/test/run-pass/unique/unique-destructure.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-destructure.rs rename to src/test/run-pass/unique/unique-destructure.rs diff --git a/src/test/ui/run-pass/unique/unique-drop-complex.rs b/src/test/run-pass/unique/unique-drop-complex.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-drop-complex.rs rename to src/test/run-pass/unique/unique-drop-complex.rs diff --git a/src/test/ui/run-pass/unique/unique-ffi-symbols.rs b/src/test/run-pass/unique/unique-ffi-symbols.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-ffi-symbols.rs rename to src/test/run-pass/unique/unique-ffi-symbols.rs diff --git a/src/test/ui/run-pass/unique/unique-fn-arg-move.rs b/src/test/run-pass/unique/unique-fn-arg-move.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-fn-arg-move.rs rename to src/test/run-pass/unique/unique-fn-arg-move.rs diff --git a/src/test/ui/run-pass/unique/unique-fn-arg-mut.rs b/src/test/run-pass/unique/unique-fn-arg-mut.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-fn-arg-mut.rs rename to src/test/run-pass/unique/unique-fn-arg-mut.rs diff --git a/src/test/ui/run-pass/unique/unique-fn-arg.rs b/src/test/run-pass/unique/unique-fn-arg.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-fn-arg.rs rename to src/test/run-pass/unique/unique-fn-arg.rs diff --git a/src/test/ui/run-pass/unique/unique-fn-ret.rs b/src/test/run-pass/unique/unique-fn-ret.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-fn-ret.rs rename to src/test/run-pass/unique/unique-fn-ret.rs diff --git a/src/test/ui/run-pass/unique/unique-generic-assign.rs b/src/test/run-pass/unique/unique-generic-assign.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-generic-assign.rs rename to src/test/run-pass/unique/unique-generic-assign.rs index 571a5620cd8d..beb3b2fbb48c 100644 --- a/src/test/ui/run-pass/unique/unique-generic-assign.rs +++ b/src/test/run-pass/unique/unique-generic-assign.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #976 diff --git a/src/test/ui/run-pass/unique/unique-in-tag.rs b/src/test/run-pass/unique/unique-in-tag.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-in-tag.rs rename to src/test/run-pass/unique/unique-in-tag.rs index 31fe43dae998..52473bd8e892 100644 --- a/src/test/ui/run-pass/unique/unique-in-tag.rs +++ b/src/test/run-pass/unique/unique-in-tag.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/unique/unique-in-vec-copy.rs b/src/test/run-pass/unique/unique-in-vec-copy.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-in-vec-copy.rs rename to src/test/run-pass/unique/unique-in-vec-copy.rs diff --git a/src/test/ui/run-pass/unique/unique-in-vec.rs b/src/test/run-pass/unique/unique-in-vec.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-in-vec.rs rename to src/test/run-pass/unique/unique-in-vec.rs diff --git a/src/test/ui/run-pass/unique/unique-init.rs b/src/test/run-pass/unique/unique-init.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-init.rs rename to src/test/run-pass/unique/unique-init.rs diff --git a/src/test/ui/run-pass/unique/unique-kinds.rs b/src/test/run-pass/unique/unique-kinds.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-kinds.rs rename to src/test/run-pass/unique/unique-kinds.rs diff --git a/src/test/ui/run-pass/unique/unique-log.rs b/src/test/run-pass/unique/unique-log.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-log.rs rename to src/test/run-pass/unique/unique-log.rs diff --git a/src/test/ui/run-pass/unique/unique-match-discrim.rs b/src/test/run-pass/unique/unique-match-discrim.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-match-discrim.rs rename to src/test/run-pass/unique/unique-match-discrim.rs index 43004e8673aa..e3ceadee1a50 100644 --- a/src/test/ui/run-pass/unique/unique-match-discrim.rs +++ b/src/test/run-pass/unique/unique-match-discrim.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #961 // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/unique/unique-move-drop.rs b/src/test/run-pass/unique/unique-move-drop.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-move-drop.rs rename to src/test/run-pass/unique/unique-move-drop.rs diff --git a/src/test/ui/run-pass/unique/unique-move-temp.rs b/src/test/run-pass/unique/unique-move-temp.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-move-temp.rs rename to src/test/run-pass/unique/unique-move-temp.rs index a68fe021d09c..e006e1e4f237 100644 --- a/src/test/ui/run-pass/unique/unique-move-temp.rs +++ b/src/test/run-pass/unique/unique-move-temp.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![feature(box_syntax)] pub fn main() { diff --git a/src/test/ui/run-pass/unique/unique-move.rs b/src/test/run-pass/unique/unique-move.rs similarity index 96% rename from src/test/ui/run-pass/unique/unique-move.rs rename to src/test/run-pass/unique/unique-move.rs index 4dba48a5ea0a..0a1b80c33df2 100644 --- a/src/test/ui/run-pass/unique/unique-move.rs +++ b/src/test/run-pass/unique/unique-move.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] #![feature(box_syntax)] pub fn main() { diff --git a/src/test/ui/run-pass/unique/unique-mutable.rs b/src/test/run-pass/unique/unique-mutable.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-mutable.rs rename to src/test/run-pass/unique/unique-mutable.rs diff --git a/src/test/ui/run-pass/unique/unique-object-move.rs b/src/test/run-pass/unique/unique-object-move.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-object-move.rs rename to src/test/run-pass/unique/unique-object-move.rs index d85b22f5dc97..472257b8c799 100644 --- a/src/test/ui/run-pass/unique/unique-object-move.rs +++ b/src/test/run-pass/unique/unique-object-move.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] // Issue #5192 // pretty-expanded FIXME #23616 diff --git a/src/test/ui/run-pass/unique/unique-pat-2.rs b/src/test/run-pass/unique/unique-pat-2.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-pat-2.rs rename to src/test/run-pass/unique/unique-pat-2.rs index 3796be683695..0adf23ceeac4 100644 --- a/src/test/ui/run-pass/unique/unique-pat-2.rs +++ b/src/test/run-pass/unique/unique-pat-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_shorthand_field_patterns)] diff --git a/src/test/ui/run-pass/unique/unique-pat-3.rs b/src/test/run-pass/unique/unique-pat-3.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-pat-3.rs rename to src/test/run-pass/unique/unique-pat-3.rs index 2ed984c3a37b..8deda0e30893 100644 --- a/src/test/ui/run-pass/unique/unique-pat-3.rs +++ b/src/test/run-pass/unique/unique-pat-3.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(dead_code)] #![allow(non_camel_case_types)] #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/unique/unique-pat.rs b/src/test/run-pass/unique/unique-pat.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-pat.rs rename to src/test/run-pass/unique/unique-pat.rs diff --git a/src/test/ui/run-pass/unique/unique-rec.rs b/src/test/run-pass/unique/unique-rec.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-rec.rs rename to src/test/run-pass/unique/unique-rec.rs diff --git a/src/test/ui/run-pass/unique/unique-send-2.rs b/src/test/run-pass/unique/unique-send-2.rs similarity index 97% rename from src/test/ui/run-pass/unique/unique-send-2.rs rename to src/test/run-pass/unique/unique-send-2.rs index 285772b95411..f34a7c2cd00f 100644 --- a/src/test/ui/run-pass/unique/unique-send-2.rs +++ b/src/test/run-pass/unique/unique-send-2.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_must_use)] // ignore-emscripten no threads support #![feature(box_syntax)] diff --git a/src/test/ui/run-pass/unique/unique-send.rs b/src/test/run-pass/unique/unique-send.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-send.rs rename to src/test/run-pass/unique/unique-send.rs diff --git a/src/test/ui/run-pass/unique/unique-swap.rs b/src/test/run-pass/unique/unique-swap.rs similarity index 100% rename from src/test/ui/run-pass/unique/unique-swap.rs rename to src/test/run-pass/unique/unique-swap.rs diff --git a/src/test/ui/run-pass/unsized-locals/reference-unsized-locals.rs b/src/test/run-pass/unsized-locals/reference-unsized-locals.rs similarity index 100% rename from src/test/ui/run-pass/unsized-locals/reference-unsized-locals.rs rename to src/test/run-pass/unsized-locals/reference-unsized-locals.rs diff --git a/src/test/ui/run-pass/unsized-locals/simple-unsized-locals.rs b/src/test/run-pass/unsized-locals/simple-unsized-locals.rs similarity index 100% rename from src/test/ui/run-pass/unsized-locals/simple-unsized-locals.rs rename to src/test/run-pass/unsized-locals/simple-unsized-locals.rs diff --git a/src/test/ui/run-pass/unsized-locals/unsized-exprs.rs b/src/test/run-pass/unsized-locals/unsized-exprs.rs similarity index 100% rename from src/test/ui/run-pass/unsized-locals/unsized-exprs.rs rename to src/test/run-pass/unsized-locals/unsized-exprs.rs diff --git a/src/test/ui/run-pass/unsized-locals/unsized-parameters.rs b/src/test/run-pass/unsized-locals/unsized-parameters.rs similarity index 100% rename from src/test/ui/run-pass/unsized-locals/unsized-parameters.rs rename to src/test/run-pass/unsized-locals/unsized-parameters.rs diff --git a/src/test/ui/run-pass/where-clauses/auxiliary/where_clauses_xc.rs b/src/test/run-pass/where-clauses/auxiliary/where_clauses_xc.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/auxiliary/where_clauses_xc.rs rename to src/test/run-pass/where-clauses/auxiliary/where_clauses_xc.rs diff --git a/src/test/ui/run-pass/where-clauses/where-clause-bounds-inconsistency.rs b/src/test/run-pass/where-clauses/where-clause-bounds-inconsistency.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/where-clause-bounds-inconsistency.rs rename to src/test/run-pass/where-clauses/where-clause-bounds-inconsistency.rs diff --git a/src/test/ui/run-pass/where-clauses/where-clause-early-bound-lifetimes.rs b/src/test/run-pass/where-clauses/where-clause-early-bound-lifetimes.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/where-clause-early-bound-lifetimes.rs rename to src/test/run-pass/where-clauses/where-clause-early-bound-lifetimes.rs diff --git a/src/test/ui/run-pass/where-clauses/where-clause-method-substituion.rs b/src/test/run-pass/where-clauses/where-clause-method-substituion.rs similarity index 96% rename from src/test/ui/run-pass/where-clauses/where-clause-method-substituion.rs rename to src/test/run-pass/where-clauses/where-clause-method-substituion.rs index 3afccab07b73..bb9d01a57c14 100644 --- a/src/test/ui/run-pass/where-clauses/where-clause-method-substituion.rs +++ b/src/test/run-pass/where-clauses/where-clause-method-substituion.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 trait Foo { fn dummy(&self, arg: T) { } } diff --git a/src/test/ui/run-pass/where-clauses/where-clause-region-outlives.rs b/src/test/run-pass/where-clauses/where-clause-region-outlives.rs similarity index 93% rename from src/test/ui/run-pass/where-clauses/where-clause-region-outlives.rs rename to src/test/run-pass/where-clauses/where-clause-region-outlives.rs index 445a090d6014..5a296c17df08 100644 --- a/src/test/ui/run-pass/where-clauses/where-clause-region-outlives.rs +++ b/src/test/run-pass/where-clauses/where-clause-region-outlives.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(dead_code)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 struct A<'a, 'b> where 'a : 'b { x: &'a isize, y: &'b isize } diff --git a/src/test/ui/run-pass/where-clauses/where-clauses-cross-crate.rs b/src/test/run-pass/where-clauses/where-clauses-cross-crate.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/where-clauses-cross-crate.rs rename to src/test/run-pass/where-clauses/where-clauses-cross-crate.rs diff --git a/src/test/ui/run-pass/where-clauses/where-clauses-lifetimes.rs b/src/test/run-pass/where-clauses/where-clauses-lifetimes.rs similarity index 92% rename from src/test/ui/run-pass/where-clauses/where-clauses-lifetimes.rs rename to src/test/run-pass/where-clauses/where-clauses-lifetimes.rs index 22b1acb2a60b..fc5119145174 100644 --- a/src/test/ui/run-pass/where-clauses/where-clauses-lifetimes.rs +++ b/src/test/run-pass/where-clauses/where-clauses-lifetimes.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] // pretty-expanded FIXME #23616 fn foo<'a, I>(mut it: I) where I: Iterator {} diff --git a/src/test/ui/run-pass/where-clauses/where-clauses-method.rs b/src/test/run-pass/where-clauses/where-clauses-method.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/where-clauses-method.rs rename to src/test/run-pass/where-clauses/where-clauses-method.rs diff --git a/src/test/ui/run-pass/where-clauses/where-clauses-unboxed-closures.rs b/src/test/run-pass/where-clauses/where-clauses-unboxed-closures.rs similarity index 96% rename from src/test/ui/run-pass/where-clauses/where-clauses-unboxed-closures.rs rename to src/test/run-pass/where-clauses/where-clauses-unboxed-closures.rs index c3cfbbda4ea6..79d1431eca50 100644 --- a/src/test/ui/run-pass/where-clauses/where-clauses-unboxed-closures.rs +++ b/src/test/run-pass/where-clauses/where-clauses-unboxed-closures.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] // pretty-expanded FIXME #23616 struct Bencher; diff --git a/src/test/ui/run-pass/where-clauses/where-clauses.rs b/src/test/run-pass/where-clauses/where-clauses.rs similarity index 100% rename from src/test/ui/run-pass/where-clauses/where-clauses.rs rename to src/test/run-pass/where-clauses/where-clauses.rs diff --git a/src/test/ui/run-pass/zero-sized/zero-size-type-destructors.rs b/src/test/run-pass/zero-sized/zero-size-type-destructors.rs similarity index 100% rename from src/test/ui/run-pass/zero-sized/zero-size-type-destructors.rs rename to src/test/run-pass/zero-sized/zero-size-type-destructors.rs diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-binary-heap-push.rs b/src/test/run-pass/zero-sized/zero-sized-binary-heap-push.rs similarity index 97% rename from src/test/ui/run-pass/zero-sized/zero-sized-binary-heap-push.rs rename to src/test/run-pass/zero-sized/zero-sized-binary-heap-push.rs index 4ab329f166a2..118e83537ca9 100644 --- a/src/test/ui/run-pass/zero-sized/zero-sized-binary-heap-push.rs +++ b/src/test/run-pass/zero-sized/zero-sized-binary-heap-push.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::collections::BinaryHeap; use std::iter::Iterator; diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-btreemap-insert.rs b/src/test/run-pass/zero-sized/zero-sized-btreemap-insert.rs similarity index 95% rename from src/test/ui/run-pass/zero-sized/zero-sized-btreemap-insert.rs rename to src/test/run-pass/zero-sized/zero-sized-btreemap-insert.rs index 5e406152d935..a2c0f78850c7 100644 --- a/src/test/ui/run-pass/zero-sized/zero-sized-btreemap-insert.rs +++ b/src/test/run-pass/zero-sized/zero-sized-btreemap-insert.rs @@ -9,6 +9,8 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] +#![allow(unused_imports)] use std::cmp::{Ord, Ordering, PartialOrd}; use std::collections::BTreeMap; use std::iter::Iterator; diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-linkedlist-push.rs b/src/test/run-pass/zero-sized/zero-sized-linkedlist-push.rs similarity index 100% rename from src/test/ui/run-pass/zero-sized/zero-sized-linkedlist-push.rs rename to src/test/run-pass/zero-sized/zero-sized-linkedlist-push.rs diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-tuple-struct.rs b/src/test/run-pass/zero-sized/zero-sized-tuple-struct.rs similarity index 100% rename from src/test/ui/run-pass/zero-sized/zero-sized-tuple-struct.rs rename to src/test/run-pass/zero-sized/zero-sized-tuple-struct.rs diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-vec-deque-push.rs b/src/test/run-pass/zero-sized/zero-sized-vec-deque-push.rs similarity index 100% rename from src/test/ui/run-pass/zero-sized/zero-sized-vec-deque-push.rs rename to src/test/run-pass/zero-sized/zero-sized-vec-deque-push.rs diff --git a/src/test/ui/run-pass/zero-sized/zero-sized-vec-push.rs b/src/test/run-pass/zero-sized/zero-sized-vec-push.rs similarity index 96% rename from src/test/ui/run-pass/zero-sized/zero-sized-vec-push.rs rename to src/test/run-pass/zero-sized/zero-sized-vec-push.rs index dd8b717761b3..d418535bf9fe 100644 --- a/src/test/ui/run-pass/zero-sized/zero-sized-vec-push.rs +++ b/src/test/run-pass/zero-sized/zero-sized-vec-push.rs @@ -9,6 +9,7 @@ // except according to those terms. // run-pass +#![allow(unused_variables)] use std::iter::Iterator; use std::vec::Vec; diff --git a/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs b/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs new file mode 100644 index 000000000000..6aac070c45bd --- /dev/null +++ b/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs @@ -0,0 +1,37 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type="proc-macro"] +#![crate_name="some_macros"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +/// a proc-macro that swallows its input and does nothing. +#[proc_macro] +pub fn some_proc_macro(_input: TokenStream) -> TokenStream { + TokenStream::new() +} + +/// a proc-macro attribute that passes its item through verbatim. +#[proc_macro_attribute] +pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { + item +} + +/// a derive attribute that adds nothing to its input. +#[proc_macro_derive(SomeDerive)] +pub fn some_derive(_item: TokenStream) -> TokenStream { + TokenStream::new() +} + diff --git a/src/test/rustdoc/inline_cross/proc_macro.rs b/src/test/rustdoc/inline_cross/proc_macro.rs new file mode 100644 index 000000000000..a879258f82ae --- /dev/null +++ b/src/test/rustdoc/inline_cross/proc_macro.rs @@ -0,0 +1,27 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-stage1 +// aux-build:proc_macro.rs +// build-aux-docs + +// FIXME: if/when proc-macros start exporting their doc attributes across crates, we can turn on +// cross-crate inlining for them + +extern crate some_macros; + +// @has proc_macro/index.html +// @has - '//a/@href' '../some_macros/macro.some_proc_macro.html' +// @has - '//a/@href' '../some_macros/attr.some_proc_attr.html' +// @has - '//a/@href' '../some_macros/derive.SomeDerive.html' +// @!has proc_macro/macro.some_proc_macro.html +// @!has proc_macro/attr.some_proc_attr.html +// @!has proc_macro/derive.SomeDerive.html +pub use some_macros::{some_proc_macro, some_proc_attr, SomeDerive}; diff --git a/src/test/rustdoc/proc-macro.rs b/src/test/rustdoc/proc-macro.rs new file mode 100644 index 000000000000..bfd194701c85 --- /dev/null +++ b/src/test/rustdoc/proc-macro.rs @@ -0,0 +1,62 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-stage1 + +#![crate_type="proc-macro"] +#![crate_name="some_macros"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +// @has some_macros/index.html +// @has - '//h2' 'Macros' +// @has - '//h2' 'Attribute Macros' +// @has - '//h2' 'Derive Macros' +// @!has - '//h2' 'Functions' + +// @has some_macros/all.html +// @has - '//a[@href="macro.some_proc_macro.html"]' 'some_proc_macro' +// @has - '//a[@href="attr.some_proc_attr.html"]' 'some_proc_attr' +// @has - '//a[@href="derive.SomeDerive.html"]' 'SomeDerive' +// @!has - '//a/@href' 'fn.some_proc_macro.html' +// @!has - '//a/@href' 'fn.some_proc_attr.html' +// @!has - '//a/@href' 'fn.some_derive.html' + +// @has some_macros/index.html '//a/@href' 'macro.some_proc_macro.html' +// @!has - '//a/@href' 'fn.some_proc_macro.html' +// @has some_macros/macro.some_proc_macro.html +// @!has some_macros/fn.some_proc_macro.html +/// a proc-macro that swallows its input and does nothing. +#[proc_macro] +pub fn some_proc_macro(_input: TokenStream) -> TokenStream { + TokenStream::new() +} + +// @has some_macros/index.html '//a/@href' 'attr.some_proc_attr.html' +// @!has - '//a/@href' 'fn.some_proc_attr.html' +// @has some_macros/attr.some_proc_attr.html +// @!has some_macros/fn.some_proc_attr.html +/// a proc-macro attribute that passes its item through verbatim. +#[proc_macro_attribute] +pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { + item +} + +// @has some_macros/index.html '//a/@href' 'derive.SomeDerive.html' +// @!has - '//a/@href' 'fn.some_derive.html' +// @has some_macros/derive.SomeDerive.html +// @!has some_macros/fn.some_derive.html +/// a derive attribute that adds nothing to its input. +#[proc_macro_derive(SomeDerive)] +pub fn some_derive(_item: TokenStream) -> TokenStream { + TokenStream::new() +} diff --git a/src/test/ui/cfg-attr-trailing-comma.rs b/src/test/ui/cfg-attr-trailing-comma.rs new file mode 100644 index 000000000000..21e00544ca00 --- /dev/null +++ b/src/test/ui/cfg-attr-trailing-comma.rs @@ -0,0 +1,13 @@ +// compile-flags: --cfg TRUE + +#[cfg_attr(TRUE, inline,)] // OK +fn f() {} + +#[cfg_attr(FALSE, inline,)] // OK +fn g() {} + +#[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,` +fn h() {} + +#[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,` +fn i() {} diff --git a/src/test/ui/cfg-attr-trailing-comma.stderr b/src/test/ui/cfg-attr-trailing-comma.stderr new file mode 100644 index 000000000000..76a470417e9e --- /dev/null +++ b/src/test/ui/cfg-attr-trailing-comma.stderr @@ -0,0 +1,14 @@ +error: expected `)`, found `,` + --> $DIR/cfg-attr-trailing-comma.rs:9:25 + | +LL | #[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,` + | ^ expected `)` + +error: expected `)`, found `,` + --> $DIR/cfg-attr-trailing-comma.rs:12:26 + | +LL | #[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,` + | ^ expected `)` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr index 724d4b1ec67a..1e46ce6a30f8 100644 --- a/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr +++ b/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr @@ -1,8 +1,8 @@ error[E0391]: cycle detected when computing the supertraits of `Chromosome` - --> $DIR/cycle-trait-supertrait-direct.rs:13:1 + --> $DIR/cycle-trait-supertrait-direct.rs:13:19 | LL | trait Chromosome: Chromosome { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: ...which again requires computing the supertraits of `Chromosome`, completing the cycle diff --git a/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr index 85681b478e21..dd88a9c4d40e 100644 --- a/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr +++ b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr @@ -1,20 +1,20 @@ error[E0391]: cycle detected when computing the supertraits of `B` - --> $DIR/cycle-trait-supertrait-indirect.rs:17:1 + --> $DIR/cycle-trait-supertrait-indirect.rs:17:10 | LL | trait B: C { - | ^^^^^^^^^^ + | ^ | note: ...which requires computing the supertraits of `C`... - --> $DIR/cycle-trait-supertrait-indirect.rs:21:1 + --> $DIR/cycle-trait-supertrait-indirect.rs:21:10 | LL | trait C: B { } - | ^^^^^^^^^^ + | ^ = note: ...which again requires computing the supertraits of `B`, completing the cycle note: cycle used when computing the supertraits of `A` - --> $DIR/cycle-trait-supertrait-indirect.rs:14:1 + --> $DIR/cycle-trait-supertrait-indirect.rs:14:10 | LL | trait A: B { - | ^^^^^^^^^^ + | ^ error: aborting due to previous error diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr index 02e7d5b7cd01..5955410aa106 100644 --- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr @@ -23,7 +23,7 @@ LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t | ^^^^^ error: expected one of `move`, `|`, or `||`, found `` - --> :1:22 + --> <::edition_kw_macro_2015::passes_ident macros>:1:22 | LL | ( $ i : ident ) => ( $ i ) | ^^^ expected one of `move`, `|`, or `||` here diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr index 435e395c2910..6ea736828f90 100644 --- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr @@ -23,7 +23,7 @@ LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t | ^^^^^ error: expected one of `move`, `|`, or `||`, found `` - --> :1:22 + --> <::edition_kw_macro_2018::passes_ident macros>:1:22 | LL | ( $ i : ident ) => ( $ i ) | ^^^ expected one of `move`, `|`, or `||` here diff --git a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr b/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr index 22ca92bbe139..ab04953f3e50 100644 --- a/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr +++ b/src/test/ui/feature-gates/feature-gate-self_in_typedefs.stderr @@ -3,6 +3,8 @@ error[E0411]: cannot find type `Self` in this scope | LL | Cons(T, &'a Self) | ^^^^ `Self` is only available in traits and impls + | + = help: add #![feature(self_in_typedefs)] to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr index cce1fd30f1d6..9c475451ce32 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr @@ -60,7 +60,7 @@ LL | define_panic!(); = note: macro-expanded macros do not shadow error[E0659]: `panic` is ambiguous - --> :1:13 + --> <::std::macros::panic macros>:1:13 | LL | ( ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => ( | ^^^^^ ambiguous name diff --git a/src/test/ui/inference/inference_unstable.stderr b/src/test/ui/inference/inference_unstable.stderr index 3a5cb6f2b2e0..2851af4891e5 100644 --- a/src/test/ui/inference/inference_unstable.stderr +++ b/src/test/ui/inference/inference_unstable.stderr @@ -8,5 +8,5 @@ LL | assert_eq!('x'.ipu_flatten(), 1); = warning: once this method is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method - = note: add #![feature(ipu_flatten)] to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten` + = help: add #![feature(ipu_flatten)] to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten` diff --git a/src/test/ui/inline-asm-bad-constraint.rs b/src/test/ui/inline-asm-bad-constraint.rs new file mode 100644 index 000000000000..654f230741e9 --- /dev/null +++ b/src/test/ui/inline-asm-bad-constraint.rs @@ -0,0 +1,47 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that the compiler will catch invalid inline assembly constraints. + +#![feature(asm)] + +extern "C" { + fn foo(a: usize); +} + +fn main() { + bad_register_constraint(); + bad_input(); + wrong_size_output(); +} + +// Issue #54130 +fn bad_register_constraint() { + let rax: u64; + unsafe { + asm!("" :"={rax"(rax)) //~ ERROR E0668 + }; + println!("Accumulator is: {}", rax); +} + +// Issue #54376 +fn bad_input() { + unsafe { + asm!("callq $0" : : "0"(foo)) //~ ERROR E0668 + }; +} + +fn wrong_size_output() { + let rax: u64 = 0; + unsafe { + asm!("addb $1, $0" : "={rax}"((0i32, rax))); //~ ERROR E0668 + } + println!("rax: {}", rax); +} diff --git a/src/test/ui/inline-asm-bad-constraint.stderr b/src/test/ui/inline-asm-bad-constraint.stderr new file mode 100644 index 000000000000..ce1f274749f1 --- /dev/null +++ b/src/test/ui/inline-asm-bad-constraint.stderr @@ -0,0 +1,21 @@ +error[E0668]: malformed inline assembly + --> $DIR/inline-asm-bad-constraint.rs:29:9 + | +LL | asm!("" :"={rax"(rax)) //~ ERROR E0668 + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0668]: malformed inline assembly + --> $DIR/inline-asm-bad-constraint.rs:37:9 + | +LL | asm!("callq $0" : : "0"(foo)) //~ ERROR E0668 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0668]: malformed inline assembly + --> $DIR/inline-asm-bad-constraint.rs:44:9 + | +LL | asm!("addb $1, $0" : "={rax}"((0i32, rax))); //~ ERROR E0668 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0668`. diff --git a/src/test/ui/issues/issue-12511.stderr b/src/test/ui/issues/issue-12511.stderr index 1a48e6a6de1c..345d7b30d47b 100644 --- a/src/test/ui/issues/issue-12511.stderr +++ b/src/test/ui/issues/issue-12511.stderr @@ -1,14 +1,14 @@ error[E0391]: cycle detected when computing the supertraits of `t1` - --> $DIR/issue-12511.rs:11:1 + --> $DIR/issue-12511.rs:11:12 | LL | trait t1 : t2 { - | ^^^^^^^^^^^^^ + | ^^ | note: ...which requires computing the supertraits of `t2`... - --> $DIR/issue-12511.rs:15:1 + --> $DIR/issue-12511.rs:15:12 | LL | trait t2 : t1 { - | ^^^^^^^^^^^^^ + | ^^ = note: ...which again requires computing the supertraits of `t1`, completing the cycle error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16922.nll.stderr b/src/test/ui/issues/issue-16922.nll.stderr deleted file mode 100644 index 3406d5348966..000000000000 --- a/src/test/ui/issues/issue-16922.nll.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `value` - --> $DIR/issue-16922.rs:14:5 - | -LL | fn foo(value: &T) -> Box { - | -- help: add explicit lifetime `'static` to the type of `value`: `&'static T` -LL | Box::new(value) as Box - | ^^^^^^^^^^^^^^^ lifetime `'static` required - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issues/issue-16922.stderr b/src/test/ui/issues/issue-16922.stderr index e70869eb1838..3406d5348966 100644 --- a/src/test/ui/issues/issue-16922.stderr +++ b/src/test/ui/issues/issue-16922.stderr @@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `value` LL | fn foo(value: &T) -> Box { | -- help: add explicit lifetime `'static` to the type of `value`: `&'static T` LL | Box::new(value) as Box - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required + | ^^^^^^^^^^^^^^^ lifetime `'static` required error: aborting due to previous error diff --git a/src/test/ui/macro_backtrace/main.stderr b/src/test/ui/macro_backtrace/main.stderr index 10eabca63538..8cecef508a2b 100644 --- a/src/test/ui/macro_backtrace/main.stderr +++ b/src/test/ui/macro_backtrace/main.stderr @@ -22,7 +22,7 @@ LL | | } LL | ping!(); | -------- in this macro invocation | - ::: :1:1 + ::: <::ping::ping macros>:1:1 | LL | ( ) => { pong ! ( ) ; } | ------------------------- @@ -42,7 +42,7 @@ LL | | } LL | deep!(); | -------- in this macro invocation (#1) | - ::: :1:1 + ::: <::ping::deep macros>:1:1 | LL | ( ) => { foo ! ( ) ; } | ------------------------ @@ -50,7 +50,7 @@ LL | ( ) => { foo ! ( ) ; } | | in this macro invocation (#2) | in this expansion of `deep!` (#1) | - ::: :1:1 + ::: <::ping::foo macros>:1:1 | LL | ( ) => { bar ! ( ) ; } | ------------------------ @@ -58,7 +58,7 @@ LL | ( ) => { bar ! ( ) ; } | | in this macro invocation (#3) | in this expansion of `foo!` (#2) | - ::: :1:1 + ::: <::ping::bar macros>:1:1 | LL | ( ) => { ping ! ( ) ; } | ------------------------- @@ -66,7 +66,7 @@ LL | ( ) => { ping ! ( ) ; } | | in this macro invocation (#4) | in this expansion of `bar!` (#3) | - ::: :1:1 + ::: <::ping::ping macros>:1:1 | LL | ( ) => { pong ! ( ) ; } | ------------------------- diff --git a/src/test/ui/nll/issue-22323-temp-destruction.rs b/src/test/ui/nll/issue-22323-temp-destruction.rs new file mode 100644 index 000000000000..2c547fb7c7da --- /dev/null +++ b/src/test/ui/nll/issue-22323-temp-destruction.rs @@ -0,0 +1,32 @@ +// rust-lang/rust#22323: regression test demonstrating that NLL +// precisely tracks temporary destruction order. + +// compile-pass + +#![feature(nll)] + +fn main() { + let _s = construct().borrow().consume_borrowed(); +} + +fn construct() -> Value { Value } + +pub struct Value; + +impl Value { + fn borrow<'a>(&'a self) -> Borrowed<'a> { unimplemented!() } +} + +pub struct Borrowed<'a> { + _inner: Guard<'a, Value>, +} + +impl<'a> Borrowed<'a> { + fn consume_borrowed(self) -> String { unimplemented!() } +} + +pub struct Guard<'a, T: ?Sized + 'a> { + _lock: &'a T, +} + +impl<'a, T: ?Sized> Drop for Guard<'a, T> { fn drop(&mut self) {} } diff --git a/src/test/ui/nll/polonius-smoke-test.rs b/src/test/ui/nll/polonius-smoke-test.rs new file mode 100644 index 000000000000..bea5e4559988 --- /dev/null +++ b/src/test/ui/nll/polonius-smoke-test.rs @@ -0,0 +1,47 @@ +// Check that Polonius borrow check works for simple cases. +// ignore-compare-mode-nll +// compile-flags: -Z borrowck=mir -Zpolonius + +pub fn return_ref_to_local() -> &'static i32 { + let x = 0; + &x //~ ERROR +} + +pub fn use_while_mut() { + let mut x = 0; + let y = &mut x; + let z = x; //~ ERROR + let w = y; +} + +pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 { + let y = &mut *x; + let z = x; //~ ERROR + y +} + +// Cases like this are why we have Polonius. +pub fn position_dependent_outlives(x: &mut i32, cond: bool) -> &mut i32 { + let y = &mut *x; + if cond { + return y; + } else { + *x = 0; + return x; + } +} + +fn foo<'a, 'b>(p: &'b &'a mut usize) -> &'b usize { + p +} + +// Check that we create constraints for well-formedness of function arguments +fn well_formed_function_inputs() { + let s = &mut 1; + let r = &mut *s; + let tmp = foo(&r); + s; //~ ERROR + tmp; +} + +fn main() {} diff --git a/src/test/ui/nll/polonius-smoke-test.stderr b/src/test/ui/nll/polonius-smoke-test.stderr new file mode 100644 index 000000000000..a30d522f3ff0 --- /dev/null +++ b/src/test/ui/nll/polonius-smoke-test.stderr @@ -0,0 +1,45 @@ +error[E0597]: `x` does not live long enough + --> $DIR/polonius-smoke-test.rs:7:5 + | +LL | &x //~ ERROR + | ^^ borrowed value does not live long enough +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/polonius-smoke-test.rs:13:13 + | +LL | let y = &mut x; + | ------ borrow of `x` occurs here +LL | let z = x; //~ ERROR + | ^ use of borrowed `x` +LL | let w = y; + | - borrow later used here + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/polonius-smoke-test.rs:19:13 + | +LL | let y = &mut *x; + | ------- borrow of `*x` occurs here +LL | let z = x; //~ ERROR + | ^ move out of `x` occurs here +LL | y + | - borrow later used here + +error[E0505]: cannot move out of `s` because it is borrowed + --> $DIR/polonius-smoke-test.rs:43:5 + | +LL | let r = &mut *s; + | ------- borrow of `*s` occurs here +LL | let tmp = foo(&r); +LL | s; //~ ERROR + | ^ move out of `s` occurs here +LL | tmp; + | --- borrow later used here + +error: aborting due to 4 previous errors + +Some errors occurred: E0503, E0505, E0597. +For more information about an error, try `rustc --explain E0503`. diff --git a/src/test/ui/nll/ty-outlives/issue-53789-1.rs b/src/test/ui/nll/ty-outlives/issue-53789-1.rs new file mode 100644 index 000000000000..593cdfdbf711 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/issue-53789-1.rs @@ -0,0 +1,91 @@ +// Regression test for #53789. +// +// compile-pass + +#![feature(nll)] +#![allow(unused_variables)] + +use std::collections::BTreeMap; + +trait ValueTree { + type Value; +} + +trait Strategy { + type Value: ValueTree; +} + +type StrategyFor = StrategyType<'static, A>; +type StrategyType<'a, A> = >::Strategy; + +impl Strategy for (K, V) { + type Value = TupleValueTree<(K, V)>; +} + +impl ValueTree for TupleValueTree<(K, V)> { + type Value = BTreeMapValueTree; +} + +struct TupleValueTree { + tree: T, +} + +struct BTreeMapStrategy(std::marker::PhantomData<(K, V)>) +where + K: Strategy, + V: Strategy; + +struct BTreeMapValueTree(std::marker::PhantomData<(K, V)>) +where + K: ValueTree, + V: ValueTree; + +impl Strategy for BTreeMapStrategy +where + K: Strategy, + V: Strategy, +{ + type Value = BTreeMapValueTree; +} + +impl ValueTree for BTreeMapValueTree +where + K: ValueTree, + V: ValueTree, +{ + type Value = BTreeMap; +} + +trait Arbitrary<'a>: Sized { + fn arbitrary_with(args: Self::Parameters) -> Self::Strategy; + type Parameters; + type Strategy: Strategy; + type ValueTree: ValueTree; +} + +impl<'a, A, B> Arbitrary<'a> for BTreeMap +where + A: Arbitrary<'static>, + B: Arbitrary<'static>, + StrategyFor: 'static, + StrategyFor: 'static, +{ + type ValueTree = ::Value; + type Parameters = (A::Parameters, B::Parameters); + type Strategy = BTreeMapStrategy; + fn arbitrary_with(args: Self::Parameters) -> BTreeMapStrategy { + let (a, b) = args; + btree_map(any_with::(a), any_with::(b)) + } +} + +fn btree_map(key: K, value: V) -> BTreeMapStrategy { + unimplemented!() +} + +fn any_with<'a, A: Arbitrary<'a>>(args: A::Parameters) -> StrategyType<'a, A> { + unimplemented!() +} + +fn main() { } + diff --git a/src/test/ui/nll/ty-outlives/issue-53789-2.rs b/src/test/ui/nll/ty-outlives/issue-53789-2.rs new file mode 100644 index 000000000000..62e2833aa1b1 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/issue-53789-2.rs @@ -0,0 +1,251 @@ +// Regression test for #53789. +// +// compile-pass + +#![feature(nll)] +#![allow(unused_variables)] + +use std::collections::BTreeMap; +use std::ops::Range; +use std::cmp::Ord; + +macro_rules! valuetree { + () => { + type ValueTree = + ::Value; + }; +} + +macro_rules! product_unpack { + ($factor: pat) => { + ($factor,) + }; + ($($factor: pat),*) => { + ( $( $factor ),* ) + }; + ($($factor: pat),*,) => { + ( $( $factor ),* ) + }; +} + +macro_rules! product_type { + ($factor: ty) => { + ($factor,) + }; + ($($factor: ty),*) => { + ( $( $factor, )* ) + }; + ($($factor: ty),*,) => { + ( $( $factor, )* ) + }; +} + +macro_rules! default { + ($type: ty, $val: expr) => { + impl Default for $type { + fn default() -> Self { $val.into() } + } + }; +} + +// Pervasive internal sugar +macro_rules! mapfn { + ($(#[$meta:meta])* [$($vis:tt)*] + fn $name:ident[$($gen:tt)*]($parm:ident: $input:ty) -> $output:ty { + $($body:tt)* + }) => { + $(#[$meta])* + #[derive(Clone, Copy)] + $($vis)* struct $name; + impl $($gen)* statics::MapFn<$input> for $name { + type Output = $output; + } + } +} + +macro_rules! opaque_strategy_wrapper { + ($(#[$smeta:meta])* pub struct $stratname:ident + [$($sgen:tt)*][$($swhere:tt)*] + ($innerstrat:ty) -> $stratvtty:ty; + + $(#[$vmeta:meta])* pub struct $vtname:ident + [$($vgen:tt)*][$($vwhere:tt)*] + ($innervt:ty) -> $actualty:ty; + ) => { + $(#[$smeta])* struct $stratname $($sgen)* (std::marker::PhantomData<(K, V)>) + $($swhere)*; + + $(#[$vmeta])* struct $vtname $($vgen)* ($innervt) $($vwhere)*; + + impl $($sgen)* Strategy for $stratname $($sgen)* $($swhere)* { + type Value = $stratvtty; + } + + impl $($vgen)* ValueTree for $vtname $($vgen)* $($vwhere)* { + type Value = $actualty; + } + } +} + +trait ValueTree { + type Value; +} + +trait Strategy { + type Value : ValueTree; +} + +#[derive(Clone)] +struct VecStrategy { + element: T, + size: Range, +} + +fn vec(element: T, size: Range) + -> VecStrategy { + VecStrategy { + element: element, + size: size, + } +} + +type ValueFor = <::Value as ValueTree>::Value; + +trait Arbitrary<'a>: Sized { + fn arbitrary_with(args: Self::Parameters) -> Self::Strategy; + + type Parameters: Default; + type Strategy: Strategy; + type ValueTree: ValueTree; +} + +type StrategyFor = StrategyType<'static, A>; +type StrategyType<'a, A> = >::Strategy; + +//#[derive(Clone, PartialEq, Eq, Hash, Debug, From, Into)] +struct SizeBounds(Range); +default!(SizeBounds, 0..100); + + +impl From> for SizeBounds { + fn from(high: Range) -> Self { + unimplemented!() + } +} + +impl From for Range { + fn from(high: SizeBounds) -> Self { + unimplemented!() + } +} + + +fn any_with<'a, A: Arbitrary<'a>>(args: A::Parameters) + -> StrategyType<'a, A> { + unimplemented!() +} + +impl Strategy for (K, V) where + ::Value: Ord { + type Value = TupleValueTree<(K, V)>; +} + +impl ValueTree for TupleValueTree<(K, V)> where + ::Value: Ord { + type Value = BTreeMapValueTree; +} + +#[derive(Clone)] +struct VecValueTree { + elements: Vec, +} + +#[derive(Clone, Copy)] +struct TupleValueTree { + tree: T, +} + +opaque_strategy_wrapper! { + #[derive(Clone)] + pub struct BTreeMapStrategy[] + [where K : Strategy, V : Strategy, ValueFor : Ord]( + statics::Filter, + VecToBTreeMap>, MinSize>) + -> BTreeMapValueTree; + + #[derive(Clone)] + pub struct BTreeMapValueTree[] + [where K : ValueTree, V : ValueTree, K::Value : Ord]( + statics::Filter>, + VecToBTreeMap>, MinSize>) + -> BTreeMap; +} + +type RangedParams2 = product_type![SizeBounds, A, B]; + +impl<'a, A, B> Arbitrary<'a> for BTreeMap +where + A: Arbitrary<'static> + Ord, + B: Arbitrary<'static>, +StrategyFor: 'static, +StrategyFor: 'static, +{ + valuetree!(); + type Parameters = RangedParams2; + type Strategy = BTreeMapStrategy; + fn arbitrary_with(args: Self::Parameters) -> Self::Strategy { + let product_unpack![range, a, b] = args; + btree_map(any_with::(a), any_with::(b), range.into()) + } +} + +#[derive(Clone, Copy)] +struct MinSize(usize); + +mapfn! { + [] fn VecToBTreeMap[] + (vec: Vec<(K, V)>) -> BTreeMap + { + vec.into_iter().collect() + } +} + +fn btree_map + (key: K, value: V, size: Range) + -> BTreeMapStrategy +where ValueFor : Ord { + unimplemented!() +} + +mod statics { + pub(super) trait MapFn { + type Output; + } + + #[derive(Clone)] + pub struct Filter { + source: S, + fun: F, + } + + impl Filter { + pub fn new(source: S, whence: String, filter: F) -> Self { + unimplemented!() + } + } + + #[derive(Clone)] + pub struct Map { + source: S, + fun: F, + } + + impl Map { + pub fn new(source: S, fun: F) -> Self { + unimplemented!() + } + } +} + +fn main() { } + diff --git a/src/test/ui/nll/ty-outlives/projection-body.rs b/src/test/ui/nll/ty-outlives/projection-body.rs new file mode 100644 index 000000000000..2e105ece8b55 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-body.rs @@ -0,0 +1,27 @@ +// Test that when we infer the lifetime to a subset of the fn body, it +// works out. +// +// compile-pass + +trait MyTrait<'a> { + type Output; +} + +fn foo1() +where + for<'x> T: MyTrait<'x>, +{ + // Here the region `'c` in `>::Output` will be + // inferred to a subset of the fn body. + let x = bar::(); + drop(x); +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs b/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs index 995c4d6dc813..6667457e13b1 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs @@ -74,19 +74,10 @@ where T: Anything<'b>, T::AssocType: 'a, { - // This error is unfortunate. This code ought to type-check: we - // are projecting `>::AssocType`, and we know - // that this outlives `'a` because of the where-clause. However, - // the way the region checker works, we don't register this - // outlives obligation, and hence we get an error: this is because - // what we see is a projection like `>::AssocType`, and we don't yet know if `?0` will - // equal `'b` or not, so we ignore the where-clause. Obviously we - // can do better here with a more involved verification step. + // We are projecting `>::AssocType`, and we know + // that this outlives `'a` because of the where-clause. with_signature(cell, t, |cell, t| require(cell, t)); - //~^ ERROR the parameter type `T` may not live long enough - //~| ERROR } #[rustc_regions] diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index 4bd96ab4e713..455fbba23200 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -106,7 +106,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` note: External requirements - --> $DIR/projection-one-region-closure.rs:87:29 + --> $DIR/projection-one-region-closure.rs:80:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -119,8 +119,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)) ] = note: number of external vids: 4 - = note: where T: '_#3r - = note: where '_#2r: '_#3r + = note: where >::AssocType: '_#3r note: No external requirements --> $DIR/projection-one-region-closure.rs:72:1 @@ -130,7 +129,7 @@ LL | | where LL | | T: Anything<'b>, LL | | T::AssocType: 'a, ... | -LL | | //~| ERROR +LL | | with_signature(cell, t, |cell, t| require(cell, t)); LL | | } | |_^ | @@ -140,27 +139,8 @@ LL | | } T ] -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/projection-one-region-closure.rs:87:29 - | -LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`... - -error: unsatisfied lifetime constraints - --> $DIR/projection-one-region-closure.rs:87:29 - | -LL | fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T) - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -... -LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` - note: External requirements - --> $DIR/projection-one-region-closure.rs:99:29 + --> $DIR/projection-one-region-closure.rs:90:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -177,7 +157,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where '_#2r: '_#3r note: No external requirements - --> $DIR/projection-one-region-closure.rs:93:1 + --> $DIR/projection-one-region-closure.rs:84:1 | LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -194,6 +174,6 @@ LL | | } T ] -error: aborting due to 6 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs index 923faadc2961..a94d8239fbec 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs @@ -64,18 +64,10 @@ where T: Anything<'b>, T::AssocType: 'a, { - // This error is unfortunate. This code ought to type-check: we - // are projecting `>::AssocType`, and we know - // that this outlives `'a` because of the where-clause. However, - // the way the region checker works, we don't register this - // outlives obligation, and hence we get an error: this is because - // what we see is a projection like `>::AssocType`, and we don't yet know if `?0` will - // equal `'b` or not, so we ignore the where-clause. Obviously we - // can do better here with a more involved verification step. + // We are projecting `>::AssocType`, and we know + // that this outlives `'a` because of the where-clause. with_signature(cell, t, |cell, t| require(cell, t)); - //~^ ERROR } #[rustc_regions] diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index ccf70a77bffc..b98aca74058b 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -88,7 +88,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` note: External requirements - --> $DIR/projection-one-region-trait-bound-closure.rs:77:29 + --> $DIR/projection-one-region-trait-bound-closure.rs:70:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,7 +101,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)) ] = note: number of external vids: 4 - = note: where '_#2r: '_#3r + = note: where >::AssocType: '_#3r note: No external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:62:1 @@ -111,7 +111,7 @@ LL | | where LL | | T: Anything<'b>, LL | | T::AssocType: 'a, ... | -LL | | //~^ ERROR +LL | | with_signature(cell, t, |cell, t| require(cell, t)); LL | | } | |_^ | @@ -121,19 +121,8 @@ LL | | } T ] -error: unsatisfied lifetime constraints - --> $DIR/projection-one-region-trait-bound-closure.rs:77:29 - | -LL | fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T) - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -... -LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` - note: External requirements - --> $DIR/projection-one-region-trait-bound-closure.rs:87:29 + --> $DIR/projection-one-region-trait-bound-closure.rs:79:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -149,7 +138,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where '_#2r: '_#3r note: No external requirements - --> $DIR/projection-one-region-trait-bound-closure.rs:82:1 + --> $DIR/projection-one-region-trait-bound-closure.rs:74:1 | LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -167,7 +156,7 @@ LL | | } ] note: External requirements - --> $DIR/projection-one-region-trait-bound-closure.rs:99:29 + --> $DIR/projection-one-region-trait-bound-closure.rs:91:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -182,7 +171,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where '_#1r: '_#2r note: No external requirements - --> $DIR/projection-one-region-trait-bound-closure.rs:91:1 + --> $DIR/projection-one-region-trait-bound-closure.rs:83:1 | LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -198,5 +187,5 @@ LL | | } T ] -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs index b49252535244..95c344e6dffb 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs @@ -65,18 +65,10 @@ where T: Anything<'b, 'c>, T::AssocType: 'a, { - // This error is unfortunate. This code ought to type-check: we - // are projecting `>::AssocType`, and we know - // that this outlives `'a` because of the where-clause. However, - // the way the region checker works, we don't register this - // outlives obligation, and hence we get an error: this is because - // what we see is a projection like `>::AssocType`, and we don't yet know if `?0` will - // equal `'b` or not, so we ignore the where-clause. Obviously we - // can do better here with a more involved verification step. + // We are projecting `>::AssocType`, and we know + // that this outlives `'a` because of the where-clause. with_signature(cell, t, |cell, t| require(cell, t)); - //~^ ERROR associated type `>::AssocType` may not live long enough } #[rustc_regions] diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index 372b803082f1..f872c87b0bb6 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -86,7 +86,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = help: consider adding an explicit lifetime bound `>::AssocType: ReEarlyBound(0, 'a)`... note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:78:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:71:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -110,7 +110,7 @@ LL | | where LL | | T: Anything<'b, 'c>, LL | | T::AssocType: 'a, ... | -LL | | //~^ ERROR associated type `>::AssocType` may not live long enough +LL | | with_signature(cell, t, |cell, t| require(cell, t)); LL | | } | |_^ | @@ -121,16 +121,8 @@ LL | | } T ] -error[E0309]: the associated type `>::AssocType` may not live long enough - --> $DIR/projection-two-region-trait-bound-closure.rs:78:29 - | -LL | with_signature(cell, t, |cell, t| require(cell, t)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `>::AssocType: ReEarlyBound(0, 'a)`... - note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:88:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:80:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -147,7 +139,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where >::AssocType: '_#4r note: No external requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:83:1 + --> $DIR/projection-two-region-trait-bound-closure.rs:75:1 | LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -166,7 +158,7 @@ LL | | } ] note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:97:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:89:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -183,7 +175,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where >::AssocType: '_#4r note: No external requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:92:1 + --> $DIR/projection-two-region-trait-bound-closure.rs:84:1 | LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -202,7 +194,7 @@ LL | | } ] note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:105:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:97:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -218,7 +210,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where >::AssocType: '_#2r note: No external requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:101:1 + --> $DIR/projection-two-region-trait-bound-closure.rs:93:1 | LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -235,7 +227,7 @@ LL | | } ] error: unsatisfied lifetime constraints - --> $DIR/projection-two-region-trait-bound-closure.rs:105:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:97:29 | LL | fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T) | -- -- lifetime `'b` defined here @@ -246,7 +238,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a` note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:115:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:107:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -262,7 +254,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where >::AssocType: '_#3r note: No external requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:110:1 + --> $DIR/projection-two-region-trait-bound-closure.rs:102:1 | LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -280,7 +272,7 @@ LL | | } ] note: External requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:127:29 + --> $DIR/projection-two-region-trait-bound-closure.rs:119:29 | LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -295,7 +287,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); = note: where >::AssocType: '_#2r note: No external requirements - --> $DIR/projection-two-region-trait-bound-closure.rs:119:1 + --> $DIR/projection-two-region-trait-bound-closure.rs:111:1 | LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T) LL | | where @@ -311,6 +303,6 @@ LL | | } T ] -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs new file mode 100644 index 000000000000..9c2cbfd4a453 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs @@ -0,0 +1,36 @@ +#![feature(nll)] + +// Test that we are able to establish that `>::Output` outlives `'b` here. We need to prove however +// that `>::Output` outlives `'a`, so we also have to +// prove that `'b: 'a`. + +trait MyTrait<'a> { + type Output; +} + +fn foo1<'a, 'b, T>() -> &'a () +where + T: MyTrait<'a>, + >::Output: 'b, +{ + bar::() //~ ERROR may not live long enough +} + +fn foo2<'a, 'b, T>() -> &'a () +where + T: MyTrait<'a>, + >::Output: 'b, + 'b: 'a, +{ + bar::() // OK +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr new file mode 100644 index 000000000000..acb978b5d5a2 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr @@ -0,0 +1,11 @@ +error[E0309]: the associated type `>::Output` may not live long enough + --> $DIR/projection-where-clause-env-wrong-bound.rs:17:5 + | +LL | bar::() //~ ERROR may not live long enough + | ^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `>::Output: 'a`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr new file mode 100644 index 000000000000..1e953ecff692 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr @@ -0,0 +1,11 @@ +error[E0309]: the associated type `>::Output` may not live long enough + --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5 + | +LL | bar::<>::Output>() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `>::Output: 'a`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs new file mode 100644 index 000000000000..9e3590ca7154 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs @@ -0,0 +1,25 @@ +// Test that if we need to prove that `>::Output: +// 'a`, but we only know that `>::Output: 'a`, that +// doesn't suffice. + +trait MyTrait<'a> { + type Output; +} + +fn foo1<'a, 'b, T>() -> &'a () +where + for<'x> T: MyTrait<'x>, + >::Output: 'a, +{ + bar::<>::Output>() + //~^ ERROR the associated type `>::Output` may not live long enough +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr new file mode 100644 index 000000000000..d6ade2a603e8 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr @@ -0,0 +1,16 @@ +error[E0309]: the associated type `>::Output` may not live long enough + --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5 + | +LL | bar::<>::Output>() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `>::Output: 'a`... +note: ...so that the type `>::Output` will meet its required lifetime bounds + --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5 + | +LL | bar::<>::Output>() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs new file mode 100644 index 000000000000..c6935badf54b --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs @@ -0,0 +1,30 @@ +#![feature(nll)] + +// Test that when we have a `>::Output: 'a` +// relationship in the environment we take advantage of it. In this +// case, that means we **don't** have to prove that `T: 'a`. +// +// Regression test for #53121. +// +// compile-pass + +trait MyTrait<'a> { + type Output; +} + +fn foo<'a, T>() -> &'a () +where + T: MyTrait<'a>, + >::Output: 'a, +{ + bar::() +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs new file mode 100644 index 000000000000..f0f72f5d27f7 --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.rs @@ -0,0 +1,26 @@ +#![feature(nll)] + +// Test that we are NOT able to establish that `>::Output: 'a` outlives `'a` here -- we have only one +// recourse, which is to prove that `T: 'a` and `'a: 'a`, but we don't +// know that `T: 'a`. + +trait MyTrait<'a> { + type Output; +} + +fn foo<'a, T>() -> &'a () +where + T: MyTrait<'a>, +{ + bar::() //~ ERROR the parameter type `T` may not live long enough +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr new file mode 100644 index 000000000000..2d171a98789f --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr @@ -0,0 +1,11 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/projection-where-clause-none.rs:16:5 + | +LL | bar::() //~ ERROR the parameter type `T` may not live long enough + | ^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'a`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs new file mode 100644 index 000000000000..7c7d64a8cb4d --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs @@ -0,0 +1,27 @@ +#![feature(nll)] + +// Test that we are able to establish that `>::Output: 'a` outlives `'a` (because the trait says +// so). +// +// compile-pass + +trait MyTrait<'a> { + type Output: 'a; +} + +fn foo<'a, T>() -> &'a () +where + T: MyTrait<'a>, +{ + bar::() +} + +fn bar<'a, T>() -> &'a () +where + T: 'a, +{ + &() +} + +fn main() {} diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr index 45e7d8451f71..b8c22583ff8d 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr @@ -9,7 +9,7 @@ note: first, the lifetime cannot outlive the lifetime 'a as defined on the funct | LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { | ^^ -note: ...so that the type `(dyn SomeTrait + 'a)` is not borrowed for too long +note: ...so that reference does not outlive borrowed content --> $DIR/object-lifetime-default-elision.rs:81:5 | LL | ss diff --git a/src/test/ui/regions/region-object-lifetime-2.stderr b/src/test/ui/regions/region-object-lifetime-2.stderr index e396680f99b4..314f43585fed 100644 --- a/src/test/ui/regions/region-object-lifetime-2.stderr +++ b/src/test/ui/regions/region-object-lifetime-2.stderr @@ -9,7 +9,7 @@ note: first, the lifetime cannot outlive the lifetime 'a as defined on the funct | LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { | ^^ -note: ...so that the type `(dyn Foo + 'a)` is not borrowed for too long +note: ...so that reference does not outlive borrowed content --> $DIR/region-object-lifetime-2.rs:20:5 | LL | x.borrowed() //~ ERROR cannot infer diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr index 1b078855efdb..a281b36946bf 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr @@ -26,7 +26,7 @@ note: first, the lifetime cannot outlive the lifetime 'a as defined on the funct | LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { | ^^ -note: ...so that the type `(dyn Dummy + 'a)` is not borrowed for too long +note: ...so that reference does not outlive borrowed content --> $DIR/regions-trait-object-subtyping.rs:25:5 | LL | x //~ ERROR lifetime bound not satisfied diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.rs b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.rs new file mode 100644 index 000000000000..441e1446e5ad --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.rs @@ -0,0 +1,85 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] +#![deny(explicit_outlives_requirements)] + +use std::fmt::{Debug, Display}; + +// These examples should live in edition-lint-infer-outlives.rs, but are split +// into this separate file because they can't be `rustfix`'d (and thus, can't +// be part of a `run-rustfix` test file) until rust-lang-nursery/rustfix#141 +// is solved + +struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: &'b U +} + +fn main() {} diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr new file mode 100644 index 000000000000..8b05a8094619 --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr @@ -0,0 +1,118 @@ +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:21:43 + | +LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> { + | ^^^^^ ^^^^^ + | +note: lint level defined here + --> $DIR/edition-lint-infer-outlives-multispan.rs:12:9 + | +LL | #![deny(explicit_outlives_requirements)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:26:57 + | +LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b { + | ^^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:31:49 + | +LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> { + | ^^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:37:44 + | +LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> { + | ^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:43:44 + | +LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> { + | ^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:49:42 + | +LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b { + | ^^^^ ^^^^^^^^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U> { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:55:63 + | +LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b { + | ^^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:61:49 + | +LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug { + | ^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:67:49 + | +LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b { + | ^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:73:65 + | +LL | struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug { + | ^^^^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug { + | -- -- + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives-multispan.rs:79:65 + | +LL | struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b { + | ^^^^^^^ ^^^^^ +help: remove these bounds + | +LL | struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug { + | -- -- + +error: aborting due to 11 previous errors + diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed b/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed new file mode 100644 index 000000000000..d70c847e9fe6 --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed @@ -0,0 +1,212 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// run-rustfix + +#![allow(unused)] +#![deny(explicit_outlives_requirements)] + +use std::fmt::{Debug, Display}; + + +// Programmatically generated examples! +// +// Exercise outlives bounds for each of the following parameter/position +// combinations— +// +// • one generic parameter (T) bound inline +// • one parameter (T) with a where clause +// • two parameters (T and U), both bound inline +// • two paramters (T and U), one bound inline, one with a where clause +// • two parameters (T and U), both with where clauses +// +// —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1 +// trait bounds distributed among said parameters (subject to no where clause +// being empty and the struct having at least one lifetime). + + +struct TeeOutlivesAy<'a, T> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeOutlivesAyIsDebug<'a, T: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeIsDebugOutlivesAy<'a, T: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeOutlivesAyBee<'a, 'b, T> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeOutlivesAyBeeIsDebug<'a, 'b, T: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereOutlivesAy<'a, T> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereOutlivesAyIsDebug<'a, T> where T: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereOutlivesAyBee<'a, 'b, T> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeYooOutlivesAy<'a, T, U> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooOutlivesAyIsDebug<'a, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooIsDebugOutlivesAy<'a, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeOutlivesAyYooIsDebug<'a, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeYooOutlivesAyBee<'a, 'b, T, U> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyBeeYooIsDebug<'a, 'b, T, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + +struct TeeYooWhereOutlivesAy<'a, T, U> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeYooWhereOutlivesAyBee<'a, 'b, T, U> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + +struct TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + + +// But outlives inference for 'static lifetimes is under a separate +// feature-gate for now +// (https://github.com/rust-lang/rust/issues/44493#issuecomment-407846046). +struct StaticRef { + field: &'static T +} + + +fn main() {} diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives.rs b/src/test/ui/rust-2018/edition-lint-infer-outlives.rs new file mode 100644 index 000000000000..0e4436fe1632 --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-infer-outlives.rs @@ -0,0 +1,212 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// run-rustfix + +#![allow(unused)] +#![deny(explicit_outlives_requirements)] + +use std::fmt::{Debug, Display}; + + +// Programmatically generated examples! +// +// Exercise outlives bounds for each of the following parameter/position +// combinations— +// +// • one generic parameter (T) bound inline +// • one parameter (T) with a where clause +// • two parameters (T and U), both bound inline +// • two paramters (T and U), one bound inline, one with a where clause +// • two parameters (T and U), both with where clauses +// +// —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1 +// trait bounds distributed among said parameters (subject to no where clause +// being empty and the struct having at least one lifetime). + + +struct TeeOutlivesAy<'a, T: 'a> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeOutlivesAyIsDebug<'a, T: 'a + Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeIsDebugOutlivesAy<'a, T: Debug + 'a> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeOutlivesAyBee<'a, 'b, T: 'a + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeOutlivesAyBeeIsDebug<'a, 'b, T: 'a + 'b + Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug + 'a + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereOutlivesAy<'a, T> where T: 'a { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereOutlivesAyIsDebug<'a, T> where T: 'a + Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug + 'a { + //~^ ERROR outlives requirements can be inferred + tee: &'a T +} + +struct TeeWhereOutlivesAyBee<'a, 'b, T> where T: 'a + 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: 'a + 'b + Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug + 'a + 'b { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T +} + +struct TeeYooOutlivesAy<'a, T, U: 'a> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooOutlivesAyIsDebug<'a, T, U: 'a + Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooIsDebugOutlivesAy<'a, T, U: Debug + 'a> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeOutlivesAyYooIsDebug<'a, T: 'a, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeYooOutlivesAyBee<'a, 'b, T, U: 'a + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: 'a + 'b + Debug> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug + 'a + 'b> { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyBeeYooIsDebug<'a, 'b, T: 'a + 'b, U: Debug> { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + +struct TeeYooWhereOutlivesAy<'a, T, U> where U: 'a { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: 'a + Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug + 'a { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a U +} + +struct TeeOutlivesAyYooWhereIsDebug<'a, T: 'a, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeYooWhereOutlivesAyBee<'a, 'b, T, U> where U: 'a + 'b { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: 'a + 'b + Debug { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug + 'a + 'b { + //~^ ERROR outlives requirements can be inferred + tee: T, + yoo: &'a &'b U +} + +struct TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T: 'a + 'b, U> where U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + +struct TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where T: 'a, U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a T, + yoo: U +} + +struct TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where T: 'a + 'b, U: Debug { + //~^ ERROR outlives requirements can be inferred + tee: &'a &'b T, + yoo: U +} + + +// But outlives inference for 'static lifetimes is under a separate +// feature-gate for now +// (https://github.com/rust-lang/rust/issues/44493#issuecomment-407846046). +struct StaticRef { + field: &'static T +} + + +fn main() {} diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives.stderr b/src/test/ui/rust-2018/edition-lint-infer-outlives.stderr new file mode 100644 index 000000000000..910de1dd06c0 --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-infer-outlives.stderr @@ -0,0 +1,188 @@ +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:35:27 + | +LL | struct TeeOutlivesAy<'a, T: 'a> { + | ^^^^ help: remove this bound + | +note: lint level defined here + --> $DIR/edition-lint-infer-outlives.rs:14:9 + | +LL | #![deny(explicit_outlives_requirements)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:40:36 + | +LL | struct TeeOutlivesAyIsDebug<'a, T: 'a + Debug> { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:45:41 + | +LL | struct TeeIsDebugOutlivesAy<'a, T: Debug + 'a> { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:50:34 + | +LL | struct TeeOutlivesAyBee<'a, 'b, T: 'a + 'b> { + | ^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:55:43 + | +LL | struct TeeOutlivesAyBeeIsDebug<'a, 'b, T: 'a + 'b + Debug> { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:60:48 + | +LL | struct TeeIsDebugOutlivesAyBee<'a, 'b, T: Debug + 'a + 'b> { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:65:33 + | +LL | struct TeeWhereOutlivesAy<'a, T> where T: 'a { + | ^^^^^^^^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:70:50 + | +LL | struct TeeWhereOutlivesAyIsDebug<'a, T> where T: 'a + Debug { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:75:55 + | +LL | struct TeeWhereIsDebugOutlivesAy<'a, T> where T: Debug + 'a { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:80:40 + | +LL | struct TeeWhereOutlivesAyBee<'a, 'b, T> where T: 'a + 'b { + | ^^^^^^^^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:85:57 + | +LL | struct TeeWhereOutlivesAyBeeIsDebug<'a, 'b, T> where T: 'a + 'b + Debug { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:90:62 + | +LL | struct TeeWhereIsDebugOutlivesAyBee<'a, 'b, T> where T: Debug + 'a + 'b { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:95:33 + | +LL | struct TeeYooOutlivesAy<'a, T, U: 'a> { + | ^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:101:42 + | +LL | struct TeeYooOutlivesAyIsDebug<'a, T, U: 'a + Debug> { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:107:47 + | +LL | struct TeeYooIsDebugOutlivesAy<'a, T, U: Debug + 'a> { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:113:37 + | +LL | struct TeeOutlivesAyYooIsDebug<'a, T: 'a, U: Debug> { + | ^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:119:40 + | +LL | struct TeeYooOutlivesAyBee<'a, 'b, T, U: 'a + 'b> { + | ^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:125:49 + | +LL | struct TeeYooOutlivesAyBeeIsDebug<'a, 'b, T, U: 'a + 'b + Debug> { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:131:54 + | +LL | struct TeeYooIsDebugOutlivesAyBee<'a, 'b, T, U: Debug + 'a + 'b> { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:137:44 + | +LL | struct TeeOutlivesAyBeeYooIsDebug<'a, 'b, T: 'a + 'b, U: Debug> { + | ^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:143:39 + | +LL | struct TeeYooWhereOutlivesAy<'a, T, U> where U: 'a { + | ^^^^^^^^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:149:56 + | +LL | struct TeeYooWhereOutlivesAyIsDebug<'a, T, U> where U: 'a + Debug { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:155:61 + | +LL | struct TeeYooWhereIsDebugOutlivesAy<'a, T, U> where U: Debug + 'a { + | ^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:161:42 + | +LL | struct TeeOutlivesAyYooWhereIsDebug<'a, T: 'a, U> where U: Debug { + | ^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:167:46 + | +LL | struct TeeYooWhereOutlivesAyBee<'a, 'b, T, U> where U: 'a + 'b { + | ^^^^^^^^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:173:63 + | +LL | struct TeeYooWhereOutlivesAyBeeIsDebug<'a, 'b, T, U> where U: 'a + 'b + Debug { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:179:68 + | +LL | struct TeeYooWhereIsDebugOutlivesAyBee<'a, 'b, T, U> where U: Debug + 'a + 'b { + | ^^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:185:49 + | +LL | struct TeeOutlivesAyBeeYooWhereIsDebug<'a, 'b, T: 'a + 'b, U> where U: Debug { + | ^^^^^^^^^ help: remove these bounds + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:191:58 + | +LL | struct TeeWhereOutlivesAyYooWhereIsDebug<'a, T, U> where T: 'a, U: Debug { + | ^^^^^^^ help: remove this bound + +error: outlives requirements can be inferred + --> $DIR/edition-lint-infer-outlives.rs:197:65 + | +LL | struct TeeWhereOutlivesAyBeeYooWhereIsDebug<'a, 'b, T, U> where T: 'a + 'b, U: Debug { + | ^^^^^^^^^^^^ help: remove these bounds + +error: aborting due to 30 previous errors + diff --git a/src/test/ui/rust-2018/edition-lint-uninferable-outlives.rs b/src/test/ui/rust-2018/edition-lint-uninferable-outlives.rs new file mode 100644 index 000000000000..00059294a976 --- /dev/null +++ b/src/test/ui/rust-2018/edition-lint-uninferable-outlives.rs @@ -0,0 +1,40 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-pass + +#![allow(unused)] +#![deny(explicit_outlives_requirements)] + +// A case where we can't infer the outlives requirement. Example copied from +// RFC 2093. +// (https://rust-lang.github.io/rfcs/2093-infer-outlives.html +// #where-explicit-annotations-would-still-be-required) + + +trait MakeRef<'a> { + type Type; +} + +impl<'a, T> MakeRef<'a> for Vec + where T: 'a // still required +{ + type Type = &'a T; +} + + +struct Foo<'a, T> + where T: 'a // still required, not inferred from `field` +{ + field: as MakeRef<'a>>::Type +} + + +fn main() {} diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr index ae6390057561..df4a6c83e50c 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr @@ -1,41 +1,26 @@ warning: Trait bound std::string::String: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-copy.rs:16:1 + --> $DIR/trivial-bounds-inconsistent-copy.rs:16:51 | -LL | / fn copy_string(t: String) -> String where String: Copy { -LL | | is_copy(&t); -LL | | let x = t; -LL | | drop(t); -LL | | t -LL | | } - | |_^ +LL | fn copy_string(t: String) -> String where String: Copy { + | ^^^^ | = note: #[warn(trivial_bounds)] on by default warning: Trait bound std::string::String: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-copy.rs:23:1 + --> $DIR/trivial-bounds-inconsistent-copy.rs:23:56 | -LL | / fn copy_out_string(t: &String) -> String where String: Copy { -LL | | *t -LL | | } - | |_^ +LL | fn copy_out_string(t: &String) -> String where String: Copy { + | ^^^^ warning: Trait bound std::string::String: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-copy.rs:27:1 + --> $DIR/trivial-bounds-inconsistent-copy.rs:27:55 | -LL | / fn copy_string_with_param(x: String) where String: Copy { -LL | | let y = x; -LL | | let z = x; -LL | | } - | |_^ +LL | fn copy_string_with_param(x: String) where String: Copy { + | ^^^^ warning: Trait bound for<'b> &'b mut i32: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-copy.rs:33:1 + --> $DIR/trivial-bounds-inconsistent-copy.rs:33:76 | -LL | / fn copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy { -LL | | is_copy(t); -LL | | let x = *t; -LL | | drop(x); -LL | | x -LL | | } - | |_^ +LL | fn copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy { + | ^^^^ diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr index 201a041830f8..e88b71c5c5a3 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr @@ -1,57 +1,44 @@ warning: Trait bound B: A does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-projection.rs:29:1 + --> $DIR/trivial-bounds-inconsistent-projection.rs:31:8 | -LL | / fn underspecified_bound() -> u8 -LL | | where -LL | | B: A -LL | | { -LL | | B::get_x() -LL | | } - | |_^ +LL | B: A + | ^ | = note: #[warn(trivial_bounds)] on by default warning: Trait bound B: A does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-projection.rs:36:1 + --> $DIR/trivial-bounds-inconsistent-projection.rs:38:8 | -LL | / fn inconsistent_bound() -> i32 -LL | | where -LL | | B: A -LL | | { -LL | | B::get_x() -LL | | } - | |_^ +LL | B: A + | ^^^^^^^^^^ warning: Trait bound B: A does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-projection.rs:43:1 + --> $DIR/trivial-bounds-inconsistent-projection.rs:45:8 | -LL | / fn redundant_bound() -> u8 -LL | | where -LL | | B: A -LL | | { -LL | | B::get_x() -LL | | } - | |_^ +LL | B: A + | ^^^^^^^^^ warning: Trait bound B: A does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-projection.rs:50:1 + --> $DIR/trivial-bounds-inconsistent-projection.rs:52:8 | -LL | / fn inconsistent_dup_bound() -> i32 -LL | | where -LL | | B: A + A -LL | | { -LL | | B::get_x() -LL | | } - | |_^ +LL | B: A + A + | ^^^^^^^^^^ warning: Trait bound B: A does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-projection.rs:57:1 + --> $DIR/trivial-bounds-inconsistent-projection.rs:52:21 | -LL | / fn redundant_dup_bound() -> u8 -LL | | where -LL | | B: A + A -LL | | { -LL | | B::get_x() -LL | | } - | |_^ +LL | B: A + A + | ^ + +warning: Trait bound B: A does not depend on any type or lifetime parameters + --> $DIR/trivial-bounds-inconsistent-projection.rs:59:8 + | +LL | B: A + A + | ^^^^^^^^^ + +warning: Trait bound B: A does not depend on any type or lifetime parameters + --> $DIR/trivial-bounds-inconsistent-projection.rs:59:20 + | +LL | B: A + A + | ^ diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr index e18018c6f0c0..493646aa46f5 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr @@ -1,24 +1,20 @@ warning: Trait bound str: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-sized.rs:24:1 + --> $DIR/trivial-bounds-inconsistent-sized.rs:24:31 | LL | struct S(str, str) where str: Sized; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^ | = note: #[warn(trivial_bounds)] on by default warning: Trait bound for<'a> T<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-sized.rs:26:1 + --> $DIR/trivial-bounds-inconsistent-sized.rs:26:45 | -LL | / fn unsized_local() where for<'a> T: Sized { -LL | | let x: T = *(Box::new(T { x: 1 }) as Box>); -LL | | } - | |_^ +LL | fn unsized_local() where for<'a> T: Sized { + | ^^^^^ warning: Trait bound str: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-sized.rs:30:1 + --> $DIR/trivial-bounds-inconsistent-sized.rs:30:35 | -LL | / fn return_str() -> str where str: Sized { -LL | | *"Sized".to_string().into_boxed_str() -LL | | } - | |_^ +LL | fn return_str() -> str where str: Sized { + | ^^^^^ diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr index b51ecd499007..052c45b73b9c 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr @@ -1,20 +1,14 @@ warning: Trait bound std::vec::Vec: std::fmt::Debug does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-well-formed.rs:17:1 + --> $DIR/trivial-bounds-inconsistent-well-formed.rs:17:30 | -LL | / pub fn foo() where Vec: Debug, str: Copy { -LL | | let x = vec![*"1"]; -LL | | println!("{:?}", x); -LL | | } - | |_^ +LL | pub fn foo() where Vec: Debug, str: Copy { + | ^^^^^ | = note: #[warn(trivial_bounds)] on by default warning: Trait bound str: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent-well-formed.rs:17:1 + --> $DIR/trivial-bounds-inconsistent-well-formed.rs:17:42 | -LL | / pub fn foo() where Vec: Debug, str: Copy { -LL | | let x = vec![*"1"]; -LL | | println!("{:?}", x); -LL | | } - | |_^ +LL | pub fn foo() where Vec: Debug, str: Copy { + | ^^^^ diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr index 85b16b17042f..0cfab2fab86d 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr @@ -1,28 +1,28 @@ warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:24:1 + --> $DIR/trivial-bounds-inconsistent.rs:24:19 | LL | enum E where i32: Foo { V } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ | = note: #[warn(trivial_bounds)] on by default warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:26:1 + --> $DIR/trivial-bounds-inconsistent.rs:26:21 | LL | struct S where i32: Foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:28:1 + --> $DIR/trivial-bounds-inconsistent.rs:28:20 | LL | trait T where i32: Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:30:1 + --> $DIR/trivial-bounds-inconsistent.rs:30:20 | LL | union U where i32: Foo { f: i32 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ warning: where clauses are not enforced in type aliases --> $DIR/trivial-bounds-inconsistent.rs:32:14 @@ -34,79 +34,56 @@ LL | type Y where i32: Foo = (); = help: the clause will not be checked when the type alias is used, and should be removed warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:32:1 + --> $DIR/trivial-bounds-inconsistent.rs:32:19 | LL | type Y where i32: Foo = (); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:34:1 + --> $DIR/trivial-bounds-inconsistent.rs:34:28 | -LL | / impl Foo for () where i32: Foo { -LL | | fn test(&self) { -LL | | 3i32.test(); -LL | | Foo::test(&4i32); -LL | | generic_function(5i32); -LL | | } -LL | | } - | |_^ +LL | impl Foo for () where i32: Foo { + | ^^^ warning: Trait bound i32: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:42:1 + --> $DIR/trivial-bounds-inconsistent.rs:42:19 | -LL | / fn f() where i32: Foo { -LL | | let s = S; -LL | | 3i32.test(); -LL | | Foo::test(&4i32); -LL | | generic_function(5i32); -LL | | } - | |_^ +LL | fn f() where i32: Foo { + | ^^^ warning: Trait bound &'static str: Foo does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:49:1 + --> $DIR/trivial-bounds-inconsistent.rs:49:28 | -LL | / fn g() where &'static str: Foo { -LL | | "Foo".test(); -LL | | Foo::test(&"Foo"); -LL | | generic_function("Foo"); -LL | | } - | |_^ +LL | fn g() where &'static str: Foo { + | ^^^ warning: Trait bound str: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:63:1 + --> $DIR/trivial-bounds-inconsistent.rs:63:37 | LL | struct TwoStrs(str, str) where str: Sized; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^ warning: Trait bound for<'a> Dst<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:65:1 + --> $DIR/trivial-bounds-inconsistent.rs:65:47 | -LL | / fn unsized_local() where for<'a> Dst: Sized { -LL | | let x: Dst = *(Box::new(Dst { x: 1 }) as Box>); -LL | | } - | |_^ +LL | fn unsized_local() where for<'a> Dst: Sized { + | ^^^^^ warning: Trait bound str: std::marker::Sized does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:69:1 + --> $DIR/trivial-bounds-inconsistent.rs:69:35 | -LL | / fn return_str() -> str where str: Sized { -LL | | *"Sized".to_string().into_boxed_str() -LL | | } - | |_^ +LL | fn return_str() -> str where str: Sized { + | ^^^^^ warning: Trait bound std::string::String: std::ops::Neg does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:73:1 + --> $DIR/trivial-bounds-inconsistent.rs:73:46 | -LL | / fn use_op(s: String) -> String where String: ::std::ops::Neg { -LL | | -s -LL | | } - | |_^ +LL | fn use_op(s: String) -> String where String: ::std::ops::Neg { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: Trait bound i32: std::iter::Iterator does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-inconsistent.rs:77:1 + --> $DIR/trivial-bounds-inconsistent.rs:77:25 | -LL | / fn use_for() where i32: Iterator { -LL | | for _ in 2i32 {} -LL | | } - | |_^ +LL | fn use_for() where i32: Iterator { + | ^^^^^^^^ diff --git a/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr b/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr index 6a3e1981025c..db8cbdc0932d 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr @@ -1,8 +1,8 @@ error: Trait bound i32: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:15:1 + --> $DIR/trivial-bounds-lint.rs:15:21 | LL | struct A where i32: Copy; //~ ERROR - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^ | note: lint level defined here --> $DIR/trivial-bounds-lint.rs:13:9 @@ -11,40 +11,40 @@ LL | #![deny(trivial_bounds)] | ^^^^^^^^^^^^^^ error: Trait bound i32: X<()> does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:28:1 + --> $DIR/trivial-bounds-lint.rs:28:30 | LL | fn global_param() where i32: X<()> {} //~ ERROR - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^ error: Trait bound i32: Z does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:32:1 + --> $DIR/trivial-bounds-lint.rs:32:35 | LL | fn global_projection() where i32: Z {} //~ ERROR - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ error: Lifetime bound i32 : 'static does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:39:1 + --> $DIR/trivial-bounds-lint.rs:39:34 | LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ error: Lifetime bound &'static str : 'static does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:39:1 + --> $DIR/trivial-bounds-lint.rs:39:57 | LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ error: Lifetime bound 'static : 'static does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:45:1 + --> $DIR/trivial-bounds-lint.rs:45:37 | LL | fn global_outlives() where 'static: 'static {} //~ ERROR - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ error: Trait bound i32: std::marker::Copy does not depend on any type or lifetime parameters - --> $DIR/trivial-bounds-lint.rs:48:1 + --> $DIR/trivial-bounds-lint.rs:48:46 | LL | fn mixed_bounds() where i32: X + Copy {} //~ ERROR - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^ error: aborting due to 7 previous errors diff --git a/src/tools/clippy b/src/tools/clippy index 125907ad0885..a72e786c5d88 160000 --- a/src/tools/clippy +++ b/src/tools/clippy @@ -1 +1 @@ -Subproject commit 125907ad08853b92d35e86aecebcf0f784f348d5 +Subproject commit a72e786c5d8866d554effd246c30fb553b63fa06 diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index a5cf45baa653..2fa459bec945 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -278,7 +278,10 @@ pub fn parse_config(args: Vec) -> Config { } } - let (gdb, gdb_version, gdb_native_rust) = analyze_gdb(matches.opt_str("gdb")); + let target = opt_str2(matches.opt_str("target")); + let android_cross_path = opt_path(matches, "android-cross-path"); + let (gdb, gdb_version, gdb_native_rust) = analyze_gdb(matches.opt_str("gdb"), &target, + &android_cross_path); let color = match matches.opt_str("color").as_ref().map(|x| &**x) { Some("auto") | None => ColorConfig::AutoColor, @@ -318,7 +321,7 @@ pub fn parse_config(args: Vec) -> Config { runtool: matches.opt_str("runtool"), host_rustcflags: matches.opt_str("host-rustcflags"), target_rustcflags: matches.opt_str("target-rustcflags"), - target: opt_str2(matches.opt_str("target")), + target: target, host: opt_str2(matches.opt_str("host")), gdb, gdb_version, @@ -326,7 +329,7 @@ pub fn parse_config(args: Vec) -> Config { lldb_version: extract_lldb_version(matches.opt_str("lldb-version")), llvm_version: matches.opt_str("llvm-version"), system_llvm: matches.opt_present("system-llvm"), - android_cross_path: opt_path(matches, "android-cross-path"), + android_cross_path: android_cross_path, adb_path: opt_str2(matches.opt_str("adb-path")), adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")), adb_device_status: opt_str2(matches.opt_str("target")).contains("android") @@ -780,8 +783,18 @@ fn make_test_closure( })) } +/// Returns true if the given target is an Android target for the +/// purposes of GDB testing. +fn is_android_gdb_target(target: &String) -> bool { + match &target[..] { + "arm-linux-androideabi" | "armv7-linux-androideabi" | "aarch64-linux-android" => true, + _ => false, + } +} + /// Returns (Path to GDB, GDB Version, GDB has Rust Support) -fn analyze_gdb(gdb: Option) -> (Option, Option, bool) { +fn analyze_gdb(gdb: Option, target: &String, android_cross_path: &PathBuf) + -> (Option, Option, bool) { #[cfg(not(windows))] const GDB_FALLBACK: &str = "gdb"; #[cfg(windows)] @@ -789,14 +802,27 @@ fn analyze_gdb(gdb: Option) -> (Option, Option, bool) { const MIN_GDB_WITH_RUST: u32 = 7011010; + let fallback_gdb = || { + if is_android_gdb_target(target) { + let mut gdb_path = match android_cross_path.to_str() { + Some(x) => x.to_owned(), + None => panic!("cannot find android cross path"), + }; + gdb_path.push_str("/bin/gdb"); + gdb_path + } else { + GDB_FALLBACK.to_owned() + } + }; + let gdb = match gdb { - None => GDB_FALLBACK, - Some(ref s) if s.is_empty() => GDB_FALLBACK, // may be empty if configure found no gdb - Some(ref s) => s, + None => fallback_gdb(), + Some(ref s) if s.is_empty() => fallback_gdb(), // may be empty if configure found no gdb + Some(ref s) => s.to_owned(), }; let mut version_line = None; - if let Ok(output) = Command::new(gdb).arg("--version").output() { + if let Ok(output) = Command::new(&gdb).arg("--version").output() { if let Some(first_line) = String::from_utf8_lossy(&output.stdout).lines().next() { version_line = Some(first_line.to_string()); } @@ -809,7 +835,7 @@ fn analyze_gdb(gdb: Option) -> (Option, Option, bool) { let gdb_native_rust = version.map_or(false, |v| v >= MIN_GDB_WITH_RUST); - (Some(gdb.to_owned()), version, gdb_native_rust) + (Some(gdb), version, gdb_native_rust) } fn extract_gdb_version(full_version_line: &str) -> Option { diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 401dec7b184b..63a282c227c2 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -38,6 +38,7 @@ use std::process::{Child, Command, ExitStatus, Output, Stdio}; use std::str; use extract_gdb_version; +use is_android_gdb_target; #[cfg(windows)] fn disable_error_reporting R, R>(f: F) -> R { @@ -224,6 +225,19 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) { pub fn compute_stamp_hash(config: &Config) -> String { let mut hash = DefaultHasher::new(); config.stage_id.hash(&mut hash); + match config.mode { + DebugInfoGdb => match config.gdb { + None => env::var_os("PATH").hash(&mut hash), + Some(ref s) if s.is_empty() => env::var_os("PATH").hash(&mut hash), + Some(ref s) => s.hash(&mut hash), + }, + DebugInfoLldb => { + env::var_os("PATH").hash(&mut hash); + env::var_os("PYTHONPATH").hash(&mut hash); + }, + + _ => {}, + }; format!("{:x}", hash.finish()) } @@ -240,6 +254,11 @@ struct DebuggerCommands { breakpoint_lines: Vec, } +enum ReadFrom { + Path, + Stdin(String), +} + impl<'test> TestCx<'test> { /// Code executed for each revision in turn (or, if there are no /// revisions, exactly once, with revision == None). @@ -450,8 +469,14 @@ impl<'test> TestCx<'test> { round, self.revision ), ); - let proc_res = self.print_source(srcs[round].to_owned(), &self.props.pretty_mode); + let read_from = if round == 0 { + ReadFrom::Path + } else { + ReadFrom::Stdin(srcs[round].to_owned()) + }; + let proc_res = self.print_source(read_from, + &self.props.pretty_mode); if !proc_res.status.success() { self.fatal_proc_rec( &format!( @@ -506,7 +531,7 @@ impl<'test> TestCx<'test> { } // additionally, run `--pretty expanded` and try to build it. - let proc_res = self.print_source(srcs[round].clone(), "expanded"); + let proc_res = self.print_source(ReadFrom::Path, "expanded"); if !proc_res.status.success() { self.fatal_proc_rec("pretty-printing (expanded) failed", &proc_res); } @@ -524,12 +549,16 @@ impl<'test> TestCx<'test> { } } - fn print_source(&self, src: String, pretty_type: &str) -> ProcRes { + fn print_source(&self, read_from: ReadFrom, pretty_type: &str) -> ProcRes { let aux_dir = self.aux_output_dir_name(); + let input: &str = match read_from { + ReadFrom::Stdin(_) => "-", + ReadFrom::Path => self.testpaths.file.to_str().unwrap(), + }; let mut rustc = Command::new(&self.config.rustc_path); rustc - .arg("-") + .arg(input) .args(&["-Z", &format!("unpretty={}", pretty_type)]) .args(&["--target", &self.config.target]) .arg("-L") @@ -538,11 +567,16 @@ impl<'test> TestCx<'test> { .args(&self.props.compile_flags) .envs(self.props.exec_env.clone()); + let src = match read_from { + ReadFrom::Stdin(src) => Some(src), + ReadFrom::Path => None + }; + self.compose_and_run( rustc, self.config.compile_lib_path.to_str().unwrap(), Some(aux_dir.to_str().unwrap()), - Some(src), + src, ) } @@ -646,222 +680,217 @@ impl<'test> TestCx<'test> { let exe_file = self.make_exe_name(); let debugger_run_result; - match &*self.config.target { - "arm-linux-androideabi" | "armv7-linux-androideabi" | "aarch64-linux-android" => { - cmds = cmds.replace("run", "continue"); + if is_android_gdb_target(&self.config.target) { + cmds = cmds.replace("run", "continue"); - let tool_path = match self.config.android_cross_path.to_str() { - Some(x) => x.to_owned(), - None => self.fatal("cannot find android cross path"), - }; + let tool_path = match self.config.android_cross_path.to_str() { + Some(x) => x.to_owned(), + None => self.fatal("cannot find android cross path"), + }; - // write debugger script - let mut script_str = String::with_capacity(2048); - script_str.push_str(&format!("set charset {}\n", Self::charset())); - script_str.push_str(&format!("set sysroot {}\n", tool_path)); - script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap())); - script_str.push_str("target remote :5039\n"); - script_str.push_str(&format!( - "set solib-search-path \ - ./{}/stage2/lib/rustlib/{}/lib/\n", - self.config.host, self.config.target - )); - for line in &breakpoint_lines { - script_str.push_str( - &format!( - "break {:?}:{}\n", - self.testpaths.file.file_name().unwrap().to_string_lossy(), - *line - )[..], - ); - } - script_str.push_str(&cmds); - script_str.push_str("\nquit\n"); - - debug!("script_str = {}", script_str); - self.dump_output_file(&script_str, "debugger.script"); - - let adb_path = &self.config.adb_path; - - Command::new(adb_path) - .arg("push") - .arg(&exe_file) - .arg(&self.config.adb_test_dir) - .status() - .expect(&format!("failed to exec `{:?}`", adb_path)); - - Command::new(adb_path) - .args(&["forward", "tcp:5039", "tcp:5039"]) - .status() - .expect(&format!("failed to exec `{:?}`", adb_path)); - - let adb_arg = format!( - "export LD_LIBRARY_PATH={}; \ - gdbserver{} :5039 {}/{}", - self.config.adb_test_dir.clone(), - if self.config.target.contains("aarch64") { - "64" - } else { - "" - }, - self.config.adb_test_dir.clone(), - exe_file.file_name().unwrap().to_str().unwrap() - ); - - debug!("adb arg: {}", adb_arg); - let mut adb = Command::new(adb_path) - .args(&["shell", &adb_arg]) - .stdout(Stdio::piped()) - .stderr(Stdio::inherit()) - .spawn() - .expect(&format!("failed to exec `{:?}`", adb_path)); - - // Wait for the gdbserver to print out "Listening on port ..." - // at which point we know that it's started and then we can - // execute the debugger below. - let mut stdout = BufReader::new(adb.stdout.take().unwrap()); - let mut line = String::new(); - loop { - line.truncate(0); - stdout.read_line(&mut line).unwrap(); - if line.starts_with("Listening on port 5039") { - break; - } - } - drop(stdout); - - let debugger_script = self.make_out_name("debugger.script"); - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), - ]; - - let mut gdb_path = tool_path; - gdb_path.push_str("/bin/gdb"); - let Output { - status, - stdout, - stderr, - } = Command::new(&gdb_path) - .args(&debugger_opts) - .output() - .expect(&format!("failed to exec `{:?}`", gdb_path)); - let cmdline = { - let mut gdb = Command::new(&format!("{}-gdb", self.config.target)); - gdb.args(&debugger_opts); - let cmdline = self.make_cmdline(&gdb, ""); - logv(self.config, format!("executing {}", cmdline)); - cmdline - }; - - debugger_run_result = ProcRes { - status, - stdout: String::from_utf8(stdout).unwrap(), - stderr: String::from_utf8(stderr).unwrap(), - cmdline, - }; - if adb.kill().is_err() { - println!("Adb process is already finished."); - } - } - - _ => { - let rust_src_root = self - .config - .find_rust_src_root() - .expect("Could not find Rust source root"); - let rust_pp_module_rel_path = Path::new("./src/etc"); - let rust_pp_module_abs_path = rust_src_root - .join(rust_pp_module_rel_path) - .to_str() - .unwrap() - .to_owned(); - // write debugger script - let mut script_str = String::with_capacity(2048); - script_str.push_str(&format!("set charset {}\n", Self::charset())); - script_str.push_str("show version\n"); - - match self.config.gdb_version { - Some(version) => { - println!( - "NOTE: compiletest thinks it is using GDB version {}", - version - ); - - if version > extract_gdb_version("7.4").unwrap() { - // Add the directory containing the pretty printers to - // GDB's script auto loading safe path - script_str.push_str(&format!( - "add-auto-load-safe-path {}\n", - rust_pp_module_abs_path.replace(r"\", r"\\") - )); - } - } - _ => { - println!( - "NOTE: compiletest does not know which version of \ - GDB it is using" - ); - } - } - - // The following line actually doesn't have to do anything with - // pretty printing, it just tells GDB to print values on one line: - script_str.push_str("set print pretty off\n"); - - // Add the pretty printer directory to GDB's source-file search path - script_str.push_str(&format!("directory {}\n", rust_pp_module_abs_path)); - - // Load the target executable - script_str.push_str(&format!( - "file {}\n", - exe_file.to_str().unwrap().replace(r"\", r"\\") - )); - - // Force GDB to print values in the Rust format. - if self.config.gdb_native_rust { - script_str.push_str("set language rust\n"); - } - - // Add line breakpoints - for line in &breakpoint_lines { - script_str.push_str(&format!( - "break '{}':{}\n", + // write debugger script + let mut script_str = String::with_capacity(2048); + script_str.push_str(&format!("set charset {}\n", Self::charset())); + script_str.push_str(&format!("set sysroot {}\n", tool_path)); + script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap())); + script_str.push_str("target remote :5039\n"); + script_str.push_str(&format!( + "set solib-search-path \ + ./{}/stage2/lib/rustlib/{}/lib/\n", + self.config.host, self.config.target + )); + for line in &breakpoint_lines { + script_str.push_str( + &format!( + "break {:?}:{}\n", self.testpaths.file.file_name().unwrap().to_string_lossy(), *line - )); - } - - script_str.push_str(&cmds); - script_str.push_str("\nquit\n"); - - debug!("script_str = {}", script_str); - self.dump_output_file(&script_str, "debugger.script"); - - let debugger_script = self.make_out_name("debugger.script"); - - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), - ]; - - let mut gdb = Command::new(self.config.gdb.as_ref().unwrap()); - gdb.args(&debugger_opts) - .env("PYTHONPATH", rust_pp_module_abs_path); - - debugger_run_result = self.compose_and_run( - gdb, - self.config.run_lib_path.to_str().unwrap(), - None, - None, + )[..], ); } + script_str.push_str(&cmds); + script_str.push_str("\nquit\n"); + + debug!("script_str = {}", script_str); + self.dump_output_file(&script_str, "debugger.script"); + + let adb_path = &self.config.adb_path; + + Command::new(adb_path) + .arg("push") + .arg(&exe_file) + .arg(&self.config.adb_test_dir) + .status() + .expect(&format!("failed to exec `{:?}`", adb_path)); + + Command::new(adb_path) + .args(&["forward", "tcp:5039", "tcp:5039"]) + .status() + .expect(&format!("failed to exec `{:?}`", adb_path)); + + let adb_arg = format!( + "export LD_LIBRARY_PATH={}; \ + gdbserver{} :5039 {}/{}", + self.config.adb_test_dir.clone(), + if self.config.target.contains("aarch64") { + "64" + } else { + "" + }, + self.config.adb_test_dir.clone(), + exe_file.file_name().unwrap().to_str().unwrap() + ); + + debug!("adb arg: {}", adb_arg); + let mut adb = Command::new(adb_path) + .args(&["shell", &adb_arg]) + .stdout(Stdio::piped()) + .stderr(Stdio::inherit()) + .spawn() + .expect(&format!("failed to exec `{:?}`", adb_path)); + + // Wait for the gdbserver to print out "Listening on port ..." + // at which point we know that it's started and then we can + // execute the debugger below. + let mut stdout = BufReader::new(adb.stdout.take().unwrap()); + let mut line = String::new(); + loop { + line.truncate(0); + stdout.read_line(&mut line).unwrap(); + if line.starts_with("Listening on port 5039") { + break; + } + } + drop(stdout); + + let debugger_script = self.make_out_name("debugger.script"); + // FIXME (#9639): This needs to handle non-utf8 paths + let debugger_opts = vec![ + "-quiet".to_owned(), + "-batch".to_owned(), + "-nx".to_owned(), + format!("-command={}", debugger_script.to_str().unwrap()), + ]; + + let gdb_path = self.config.gdb.as_ref().unwrap(); + let Output { + status, + stdout, + stderr, + } = Command::new(&gdb_path) + .args(&debugger_opts) + .output() + .expect(&format!("failed to exec `{:?}`", gdb_path)); + let cmdline = { + let mut gdb = Command::new(&format!("{}-gdb", self.config.target)); + gdb.args(&debugger_opts); + let cmdline = self.make_cmdline(&gdb, ""); + logv(self.config, format!("executing {}", cmdline)); + cmdline + }; + + debugger_run_result = ProcRes { + status, + stdout: String::from_utf8(stdout).unwrap(), + stderr: String::from_utf8(stderr).unwrap(), + cmdline, + }; + if adb.kill().is_err() { + println!("Adb process is already finished."); + } + } else { + let rust_src_root = self + .config + .find_rust_src_root() + .expect("Could not find Rust source root"); + let rust_pp_module_rel_path = Path::new("./src/etc"); + let rust_pp_module_abs_path = rust_src_root + .join(rust_pp_module_rel_path) + .to_str() + .unwrap() + .to_owned(); + // write debugger script + let mut script_str = String::with_capacity(2048); + script_str.push_str(&format!("set charset {}\n", Self::charset())); + script_str.push_str("show version\n"); + + match self.config.gdb_version { + Some(version) => { + println!( + "NOTE: compiletest thinks it is using GDB version {}", + version + ); + + if version > extract_gdb_version("7.4").unwrap() { + // Add the directory containing the pretty printers to + // GDB's script auto loading safe path + script_str.push_str(&format!( + "add-auto-load-safe-path {}\n", + rust_pp_module_abs_path.replace(r"\", r"\\") + )); + } + } + _ => { + println!( + "NOTE: compiletest does not know which version of \ + GDB it is using" + ); + } + } + + // The following line actually doesn't have to do anything with + // pretty printing, it just tells GDB to print values on one line: + script_str.push_str("set print pretty off\n"); + + // Add the pretty printer directory to GDB's source-file search path + script_str.push_str(&format!("directory {}\n", rust_pp_module_abs_path)); + + // Load the target executable + script_str.push_str(&format!( + "file {}\n", + exe_file.to_str().unwrap().replace(r"\", r"\\") + )); + + // Force GDB to print values in the Rust format. + if self.config.gdb_native_rust { + script_str.push_str("set language rust\n"); + } + + // Add line breakpoints + for line in &breakpoint_lines { + script_str.push_str(&format!( + "break '{}':{}\n", + self.testpaths.file.file_name().unwrap().to_string_lossy(), + *line + )); + } + + script_str.push_str(&cmds); + script_str.push_str("\nquit\n"); + + debug!("script_str = {}", script_str); + self.dump_output_file(&script_str, "debugger.script"); + + let debugger_script = self.make_out_name("debugger.script"); + + // FIXME (#9639): This needs to handle non-utf8 paths + let debugger_opts = vec![ + "-quiet".to_owned(), + "-batch".to_owned(), + "-nx".to_owned(), + format!("-command={}", debugger_script.to_str().unwrap()), + ]; + + let mut gdb = Command::new(self.config.gdb.as_ref().unwrap()); + gdb.args(&debugger_opts) + .env("PYTHONPATH", rust_pp_module_abs_path); + + debugger_run_result = self.compose_and_run( + gdb, + self.config.run_lib_path.to_str().unwrap(), + None, + None, + ); } if !debugger_run_result.status.success() { diff --git a/src/tools/rls b/src/tools/rls index 9e2864638643..15d4d4a5b0cf 160000 --- a/src/tools/rls +++ b/src/tools/rls @@ -1 +1 @@ -Subproject commit 9e2864638643be481c164a76d1e87506adcdaadb +Subproject commit 15d4d4a5b0cf3c0155195f3322cc7a61148e5567