Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize layout of TypeVariants #50395

Merged
merged 3 commits into from
May 10, 2018
Merged

Optimize layout of TypeVariants #50395

merged 3 commits into from
May 10, 2018

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented May 2, 2018

This makes references to Slice use thin pointers by storing the slice length in the slice itself. GeneratorInterior is replaced by storing the movability of generators in TyGenerator and the interior witness is stored in GeneratorSubsts (which is just a wrapper around &'tcx Substs, like ClosureSubsts). Finally the fields of TypeAndMut is stored inline in TyRef. These changes combine to reduce TypeVariants from 48 bytes to 24 bytes on x86_64.

r? @michaelwoerister

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Zoxc! Looks beautiful! :)

You should definitely add a regression test that makes sure that TypeVariants stays at 24 bytes. Would be a shame if it grew again (without good reason).

I've added some comments to the first commit. The other commits look good to me. It would be great though, if someone else could take a look at the GeneratorSubsts change, since I don't know that code too well.

@@ -40,6 +40,7 @@
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]

#![feature(asm)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It not. I've removed it.

let i = ($alloc_to_ret)(self.global_interners.arena.$alloc_method(v));
let i: &$lt_tcx $ty = $alloc_method(&self.global_interners.arena, v);
// Cast to 'gcx
let i = unsafe { mem::transmute(i) };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this let i: &'gcx $ty = ... would make it even more explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work since $ty uses 'tcx lifetimes, hence the need for transmute.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean that the transmute should be removed, rather that the binding is explicitly annotated for more clarity:

let i: &$lt_tcx $ty = $alloc_method(&self.global_interners.arena, v);
// Cast to 'gcx
let i: &'gcx $ty = unsafe { mem::transmute(i) };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @Zoxc's point is that $ty already has explicit lifetimes in it, so it wouldn't work.
OTOH, since this is a reference, maybe pointer casting should be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can probably just refactor the macros to get rid of the transmute here.

@@ -566,18 +568,75 @@ impl <'gcx: 'tcx, 'tcx> Canonicalize<'gcx, 'tcx> for Ty<'tcx> {
}
}

extern {
type Unsized;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have a more descriptive name, such as OpaqueSliceContents.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed it to that.

// Align up the size of the len (usize) field
let align = mem::align_of::<T>();
let align_mask = align - 1;
let offset = mem::size_of::<usize>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A u32 for the length would probably be enough in practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps. I don't think we have many 4-byte aligned types in slices though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. Nevermind then.


let mem: *mut u8 = &mut arena.alloc_raw(
size,
cmp::max(mem::align_of::<T>(), mem::align_of::<usize>()))[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use .as_mut_ptr() here, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

&self.0
unsafe {
if self as *const _ as usize == EMPTY_SLICE {
return mem::transmute(slice::from_raw_parts(mem::align_of::<T>() as *const T, 0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to just return &[] here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@michaelwoerister
Copy link
Member

@bors p=1 (this is likely to bitrot)

@michaelwoerister
Copy link
Member

r? @eddyb (for reviewing the commit that introduces GeneratorSubsts)

// Trigger a debugger if we crashed during bootstrap
DebugBreak();
}
eprintln!("PANIC HOOK END");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Zoxc Zoxc force-pushed the small-tys branch 2 times, most recently from 119916b to 9973dea Compare May 3, 2018 03:24
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:23:32]    Compiling std_unicode v0.0.0 (file:///checkout/src/libstd_unicode)
[00:23:34]    Compiling alloc_system v0.0.0 (file:///checkout/src/liballoc_system)
[00:23:34]    Compiling panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:23:39]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:23:53] error: linking with `cc` failed: exit code: 1
[00:23:53]   |
[00:23:53]   = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std1.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std10.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std11.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std12.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std13.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std14.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std2.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std3.rcgu.o" "/_64-unknown-linux-gnu/native/jemalloc/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "backtrace" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/libpanic_unwind-0f87329e4bd3c0f7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/liballoc_jemalloc-909cf87121ccda41.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/libunwind-3ec72233e5879871.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/liballoc_system-b1bb164d648edeea.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/liblibc-164dc4f4837c074c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/liballoc-f46a9c47c3fa6e2c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.6QRPkDrjyy3a/libcore-07c899b6c3d44697.rlib" "-Wl,--no-whole-archive" "/tmp/rustc.6QRPkDrjyy3a/libcompiler_builtins-eee3ea2678e1ce45.rlib" "-Wl,-Bdynamic" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-shared" "-Wl,-rpath,$ORIGIN/../lib"
[00:23:53]   = note: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std10.rcgu.o: In function `std::panicking::default_hook::hdc1a409ab419596d':
[00:23:53]           std10-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std9panicking12default_hook17hdc1a409ab419596dE+0xnix::fs::OpenOptions::create::h38ae1d9074f655e6'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File6create17h71ccc7e41a018c74E+0x44): undefined reference to `std::sys::unix::fs::OpenOptions::truncate::h810aab583b8a8096'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::sync_all::h6788e1045a280718':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File8sync_all17h6788e1045a280718E+0x5): undefined reference to `std::sys::unix::fs::File::fsync::h60f7b5ca1d30d45c'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::sync_data::h40ad3f82ce016e1b':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File9sync_data17h40ad3f82ce016e1bE+0x5): undefined reference to `std::sys::unix::fs::File::datasync::h055a6d0b0899b58a'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::set_len::hd09f079f05f5af29':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File7set_len17hd09f079f05f5af29E+0x5): undefined reference to `std::sys::unix::fs::File::truncate::hbfb5cb1f9e6d7984'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::metadata::hc5d539cb3c89fbc8':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File8metadata17hc5d539cb3c89fbc8E+0x15): undefined reference to `std::sys::unix::fs::File::file_attr::h4883fa265e937a68'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::try_clone::h31f03dcd32b97ced':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File9try_clone17h31f03dcd32b97cedE+0x13): undefined reference to `std::sys::unix::fs::File::duplicate::h5963e2ffe4a7e45c'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::File::set_permissions::h86698c958bca0de6':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs4File15set_permissions17h86698c958bca0de6E+0x5): undefined reference to `std::sys::unix::fs::File::set_permissions::hb49ce8fa81934eff'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..File$u20$as$u20$std..io..Read$GT$::read::h085a757aa38299b1':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN47_$LT$std..fs..File$u20$as$u20$std..io..Read$GT$4read17h085a757aa38299b1E+0x5): undefined reference to `std::sys::unix::fs::File::read::hf242b742015cc510'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..File$u20$as$u20$std..io..Write$GT$::write::h3015592a49d19d4c':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN48_$LT$std..fs..File$u20$as$u20$std..io..Write$GT$5write17h3015592a49d19d4cE+0x5): undefined reference to `std::sys::unix::fs::File::write::h95d8392109720fdd'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..File$u20$as$u20$std..io..Write$GT$::flush::h3bb1ef753fa8eeb4':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN48_$LT$std..fs..File$u20$as$u20$std..io..Write$GT$5flush17h3bb1ef753fa8eeb4E+0x5): undefined reference to `std::sys::unix::fs::File::flush::h62cfe67bc4544320'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..File$u20$as$u20$std..io..Seek$GT$::seek::hc2b8d69bf401e9b2':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN47_$LT$std..fs..File$u20$as$u20$std..io..Seek$GT$4seek17hc2b8d69bf401e9b2E+0x14): undefined reference to `std::sys::unix::fs::File::seek::hb8406e264ec9bd05'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In fOpenOptions::create_new::hf23ebecbf2ab6e2e'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::OpenOptions::_open::hf100156a9abc17f1':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs11OpenOptions5_open17hf100156a9abc17f1E+0x1f): undefined reference to `std::sys::unix::fs::File::open::h605b4aac5d1d8447'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::file_type::h6b71102ef4ddeff1':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata9file_type17h6b71102ef4ddeff1E+0x1): undefined reference to `std::sys::unix::fs::FileAttr::file_type::h9e9a1f5f6a9a948b'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::is_dir::he22d8d978ac0768a':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata6is_dir17he22d8d978ac0768aE+0x2): undefined reference to `std::sys::unix::fs::FileAttr::file_type::h9e9a1f5f6a9a948b'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata6is_dir17he22d8d978ac0768aE+0x10): undefined reference to `std::sys::unix::fs::FileType::is_dir::hbdbaa7a05b009842'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::is_file::h9a161a92ec70ec85':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata7is_file17h9a161a92ec70ec85E+0x2): undefined reference to `std::sys::unix::fs::FileAttr::file_type::h9e9a1f5f6a9a948b'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata7is_file17h9a161a92ec70ec85E+0x10): undefined reference to `std::sys::unix::fs::FileType::is_file::h89a4ff45d8a553df'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::len::hdceb2de0bb4123de':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata3len17hdceb2de0bb4123deE+0x1): undefined reference to `std::sys::unix::fs::FileAttr::size::h6a96429327c378e2'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::permissions::h77c3d4bdfe7ad395':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8Metadata11permissions17h77c3d4bdfe7ad395E+0x1): undefined reference to `std::sys::unix::fs::FileAttr::perm::h8286707a0873a140'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::Metadata::modified::hffa9099f357f9aab':c66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0x5e): undefined reference to `std::sys::unix::fs::FileAttr::file_type::h9e9a1f5f6a9a948b'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0x6c): undefined reference to `std::sys::unix::fs::FileType::is_dir::hbdbaa7a05b009842'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0x9e): undefined reference to `std::sys::unix::fs::FileAttr::file_type::h9e9a1f5f6a9a948b'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0xac): undefined reference to `std::sys::unix::fs::FileType::is_file::h89a4ff45d8a553df'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0xd7): undefined reference to `std::sys::unix::fs::FileAttr::perm::h8286707a0873a140'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0x10b): undefined reference to `std::sys::unix::fs::FileAttr::modified::h55ccc8c5d716b123'
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..Metadata$u20$as$u20$core..fmt..Debug$GT$3fmt17h27b4345a72adc1b4E+0x17e): undefined reference to `sbdae45aE+0x15): undefined reference to `std::sys::unix::fs::DirEntry::metadata::h5b13fb74de637b4a'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::DirEntry::file_type::h03ee0cb03db8c8db':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8DirEntry9file_type17h03ee0cb03db8c8dbE+0xe): undefined reference to `std::sys::unix::fs::DirEntry::file_type::h2f04a1f5896b4844'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `std::fs::DirEntry::file_name::hd9681ccaa8fdc551':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std2fs8DirEntry9file_name17hd9681ccaa8fdc551E+0x5): undefined reference to `std::sys::unix::fs::DirEntry::file_name::h709a9d62004639fb'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..DirEntry$u20$as$u20$core..fmt..Debug$GT$::fmt::habd4b4455997c7f8':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN54_$LT$std..fs..DirEntry$u20$as$u20$core..fmt..Debug$GT$3fmt17habd4b4455997c7f8E+0x30): undefined reference to `std::sys::unix::fs::DirEntry::path::h45525d90941c3c2c'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function:fs::FileType::is::h85b6b8bcf642b0a4'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$::is_char_device::hfdfb4aac09d6d859':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN74_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$14is_char_device17hfdfb4aac09d6d859E+0x6): undefined reference to `std::sys::unix::fs::FileType::is::h85b6b8bcf642b0a4'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$::is_fifo::h1952dd1b9710bede':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN74_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$7is_fifo17h1952dd1b9710bedeE+0x6): undefined reference to `std::sys::unix::fs::FileType::is::h85b6b8bcf642b0a4'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std15.rcgu.o: In function `_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$::is_socket::hebb7a964c8fb06c9':
[00:23:53]           std15-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN74_$LT$std..fs..FileType$u20$as$u20$std..sys..unix..ext..fs..FileTypeExt$GT$9is_socket17hebb7a964c8fb06c9E+0x6): undefined reference to `std::sys::sys::unix::net::Socket::read::ha81fe367c8216cea'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std4.rcgu.o: In function `_$LT$$RF$$u27$a$u20$std..sys..unix..ext..net..UnixStream$u20$as$u20$std..io..Write$GT$::write::h918433ac71d14949':
[00:23:53]           std4-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN86_$LT$$RF$$u27$a$u20$std..sys..unix..ext..net..UnixStream$u20$as$u20$std..io..Write$GT$5write17h918433ac71d14949E+0x8): undefined reference to `std::sys::unix::net::Socket::write::h8eaadd4354368a98'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std4.rcgu.o: In function `_$LT$std..sys..unix..ext..net..Incoming$LT$$u27$a$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$::next::h0b3590b4ef55ff9a':
[00:23:53]           std4-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN99_$LT$std..sys..unix..ext..net..Incoming$LT$$u27$a$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17h0b3590b4ef55ff9aE+0x66): undefined reference to `std::sys::unix::net::Socket::accept::hd1ac2ba1e8d21127'
[00:23:53]           /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-1f9e2160e67cbd84.std4.rcgu.o: In function `std::sys::unix::cvt_r::ha275672e780546fa':
[00:23:53]           std4-72db38eb59647a5ed1b17001dc66bb3c.rs:(.text._ZN3std3sys4unix5cvt_r17ha275672e780546faE+0x2b): undefined reference to `std::sys::unix::fs::File::datasync::os_datasync::hc0c1f3e48ace2fc6'
[00n/ld: final link failed: Bad value
[00:23:53]           collect2: error: ld returned 1 exit status
[00:23:53] 
[00:23:53] error: aborting due to previous error
[00:23:53] 
[00:23:53] error: Could not compile `std`.
[00:23:53] error: Could not compile `std`.
[00:23:53] 
[00:23:53] Caused by:
[00:23:53]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name std libstd/lib.rs --color always --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="alloc_jemalloc" --cfg feature="backtrace" --cfg feature="jemalloc" --cfg feature="panic-unwind" --cfg feature="panic_unwind" -C metadata=1f9e2160e67cbd84 -C extra-filename=-1f9e2160e67cbd84 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcompiler_builtins-eee3ea2678e1ce45.rlib --extern alloc_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoc_system-b1bb164d648edeea.rlib --extern rustc_lsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_lsan-95c712b682081e11.rlib --extern rustc_tsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_tsan-3dfd2a93cfcbaf65.rlib --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-07c899b6c3d44697.rlib --extern alloc_jemalloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoc_jemalloc-909cf87121ccda41.rlib --extern std_unicode=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libstd_unicode-008dd577fa1b2f45.rlib --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libunwind-3ec72233e5879871.rlib --extern rustc_asan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_asan-bcf8d8dcaff7bef5.rlib --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_abort-54b8cb60fec24e1c.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liblibc-164dc4f4837c074c.rlib --extern rustc_msan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_msan-1fd70d9208ac050f.rlib --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_unwind-0f87329e4bd3c0f7.rlib --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoc-f46a9c47c3fa6e2c.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/native/libbacktrace/.libs -l static=backtrace -l dl -l rt -l pthread -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-b3ef454c059c1146/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/native/jemalloc/lib` (exit code: 101)
[00:23:53] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:23:53] expected success, got: exit code: 101
[00:23:53] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:23:53] travis_fold:end:stage1-std

[00:23:53] travis_time:end:stage1-std:start=1525319344974918746,finish=1525319431037362734,duration=86062443988


[00:23:53] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:23:53] Build completed unsuccessfully in 0:18:46
[00:23:53] Makefile:28: recipe for target 'all' failed
[00:23:53] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@@ -888,9 +888,10 @@ for ty::TypeVariants<'gcx>
TyRawPtr(pointee_ty) => {
pointee_ty.hash_stable(hcx, hasher);
}
TyRef(region, pointee_ty) => {
TyRef(region, pointee_ty, mutbl) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not also change TyRawPtr and maybe getting rid of TypeAndMut?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's additional work which does not further reduce the size of TypeVariants. It probably would be a bit cleaner though.

@eddyb
Copy link
Member

eddyb commented May 3, 2018

So this PR looks relatively okay (the generator parts especially).
However, we should really measure the perf impact of the change to Slice.

@Zoxc
Copy link
Contributor Author

Zoxc commented May 3, 2018

I've removed the commit for thin slices. It caused linking errors after I rebased this PR.

@michaelwoerister
Copy link
Member

I've removed the commit for thin slices. It caused linking errors after I rebased this PR.

That's weird. Did the commit introduce some instability in symbol hashes?

@Zoxc
Copy link
Contributor Author

Zoxc commented May 3, 2018

@bors try

@bors
Copy link
Contributor

bors commented May 3, 2018

⌛ Trying commit 95dd3a8 with merge b2a52e4...

bors added a commit that referenced this pull request May 3, 2018
Optimize layout of TypeVariants

This makes references to `Slice` use thin pointers by storing the slice length in the slice itself. `GeneratorInterior` is replaced by storing the movability of generators in `TyGenerator` and the interior witness is stored in `GeneratorSubsts` (which is just a wrapper around `&'tcx Substs`, like `ClosureSubsts`). Finally the fields of `TypeAndMut` is stored inline in `TyRef`. These changes combine to reduce `TypeVariants` from 48 bytes to 24 bytes on x86_64.

r? @michaelwoerister
@bors
Copy link
Contributor

bors commented May 3, 2018

☀️ Test successful - status-travis
State: approved= try=True

@Zoxc
Copy link
Contributor Author

Zoxc commented May 3, 2018

@Mark-Simulacrum I'd like a perf run here

@kennytm kennytm added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 3, 2018
@michaelwoerister
Copy link
Member

The perf results show runtime improved in some cases and degraded in others. It's mostly noise, I'd say. max-rss is also worse in some cases, which suggests noise again. I think we should merge.

@leoyvens
Copy link
Contributor

leoyvens commented May 7, 2018

Some sort of memory usage benchmark would be interesting for this.

@kennytm kennytm removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 7, 2018
@Zoxc
Copy link
Contributor Author

Zoxc commented May 8, 2018

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented May 8, 2018

📌 Commit c9d9c24 has been approved by michaelwoerister

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 8, 2018
@bors
Copy link
Contributor

bors commented May 8, 2018

⌛ Testing commit c9d9c24 with merge 25a79f6b346ed8e0c43d313fab38a206b06677e3...

@bors
Copy link
Contributor

bors commented May 8, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 8, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:55:51]    Compiling serde_derive v1.0.40
[00:56:13]    Compiling cargo_metadata v0.5.4
[00:56:28] [RUSTC-TIMING] cargo_metadata test:false 15.065
[00:56:28]    Compiling clippy_lints v0.0.197 (file:///checkout/src/tools/clippy/clippy_lints)
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 429 |             ty::TyRef(_, tam) => match tam.ty.sty {
[00:56:32]     |             ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 677 |         ty::TyRef(_, ref tm) => walk_ptrs_ty(tm.ty),
[00:56:32]     |         ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 429 |             ty::TyRef(_, tam) => match tam.ty.sty {
[00:56:32]     |             ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 687 |             ty::TyRef(_, ref tm) => inner(tm.ty, depth + 1),
[00:56:32]     |             ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 677 |         ty::TyRef(_, ref tm) => walk_ptrs_ty(tm.ty),
[00:56:32]     |         ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]     |
[00:56:32]     |
[00:56:32] 687 |             ty::TyRef(_, ref tm) => inner(tm.ty, depth + 1),
[00:56:32]     |             ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]     |
[00:56:33]     |
[00:56:33] 746 |         ty::TyRef(_, ref subty) => is_slice_like(cx, subty.ty),
[00:56:33]     |         ^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]      |
[00:56:33]      |
[00:56:33] 1368 |                 ty::TyRef(_, ref tam) => match (&pat[0].node, &pat[1].node) {
[00:56:33]      |                 ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]      |
[00:56:33]      |
[00:56:33] 1708 |                     if let ty::TyRef(_, mutbl) = ty.sty {
[00:56:33]      |                            ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]      |
[00:56:33]      |
[00:56:33] 1720 |                     if let ty::TyRef(_, mutbl) = ty.sty {
[00:56:33]      |                            ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]    |
[00:56:33]    |
[00:56:33] 54 |                                     if let ty::TyRef(_, tam) = ty.sty {
[00:56:33]    |                                            ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]     |
[00:56:33]     |
[00:56:33] 746 |         ty::TyRef(_, ref subty) => is_slice_like(cx, subty.ty),
[00:56:33]     |         ^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:33] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1368 |                 ty::TyRef(_, ref tam) => match (&pat[0].node, &pat[1].node) {
[00:56:34]      |                 ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1708 |                     if let ty::TyRef(_, mutbl) = ty.sty {
[00:56:34]      |                            ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1720 |                     if let ty::TyRef(_, mutbl) = ty.sty {
[00:56:34]      |                            ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 752 |                     ty::TyRef(_, ty) if ty.ty.sty == ty::TyStr => for &(method, pos) in &PATTERN_METHODS {
[00:56:34]     |                     ^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 54 |                                     if let ty::TyRef(_, tam) = ty.sty {
[00:56:34]    |                                            ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 970 |     if let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = arg_ty.sty {
[00:56:34]     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 971 |         if let ty::TyRef(_, ty::TypeAndMut { ty: innermost, .. }) = inner.sty {
[00:56:34]     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 981 |                     while let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = ty.sty {
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1318 |             ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) => if may_slice(cx, inner) {
[00:56:34]      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1303 |             ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) => may_slice(cx, inner),
[00:56:34]      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 752 |                     ty::TyRef(_, ty) if ty.ty.sty == ty::TyStr => for &(method, pos) in &PATTERN_METHODS {
[00:56:34]     |                     ^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 970 |     if let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = arg_ty.sty {
[00:56:34]     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 971 |         if let ty::TyRef(_, ty::TypeAndMut { ty: innermost, .. }) = inner.sty {
[00:56:34]     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 981 |                     while let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = ty.sty {
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 73 |               } else if let ty::TyRef(
[00:56:34] 74 | |                 _,
[00:56:34] 74 | |                 _,
[00:56:34] 75 | |                 ty::TypeAndMut {
[00:56:34] 76 | |                     mutbl: hir::MutMutable,
[00:56:34] 78 | |                 },
[00:56:34] 78 | |                 },
[00:56:34] 79 | |             ) = self.cx.tables.expr_ty(e).sty
[00:56:34]    | |_____________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1318 |             ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) => if may_slice(cx, inner) {
[00:56:34]      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1303 |             ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) => may_slice(cx, inner),
[00:56:34]      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34] 64 | /                     ty::TyRef(
[00:56:34] 65 | |                         _,
[00:56:34] 65 | |                         _,
[00:56:34] 66 | |                         ty::TypeAndMut {
[00:56:34] 67 | |                             mutbl: MutImmutable,
[00:56:34] 69 | |                         },
[00:56:34] 70 | |                     ) |
[00:56:34] 70 | |                     ) |
[00:56:34]    | |_____________________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 80 |             if let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty;
[00:56:34]    |                    ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 82 |             if let ty::TyRef(_, ref tam) = tam.ty.sty;
[00:56:34]    |                    ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 73 |               } else if let ty::TyRef(
[00:56:34] 74 | |                 _,
[00:56:34] 74 | |                 _,
[00:56:34] 75 | |                 ty::TypeAndMut {
[00:56:34] 76 | |                     mutbl: hir::MutMutable,
[00:56:34] 78 | |                 },
[00:56:34] 78 | |                 },
[00:56:34] 79 | |             ) = self.cx.tables.expr_ty(e).sty
[00:56:34]    | |_____________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34] 64 | /                     ty::TyRef(
[00:56:34] 65 | |                         _,
[00:56:34] 65 | |                         _,
[00:56:34] 66 | |                         ty::TypeAndMut {
[00:56:34] 67 | |                             mutbl: MutImmutable,
[00:56:34] 69 | |                         },
[00:56:34] 70 | |                     ) |
[00:56:34] 70 | |                     ) |
[00:56:34]    | |_____________________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 80 |             if let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty;
[00:56:34]    |                    ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 82 |             if let ty::TyRef(_, ref tam) = tam.ty.sty;
[00:56:34]    |                    ^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/ptr.rs:153:16
[00:56:34]     |
[00:56:34] 153 |           if let ty::TyRef(
[00:56:34] 154 | |             _,
[00:56:34] 154 | |             _,
[00:56:34] 155 | |             ty::TypeAndMut {
[00:56:34] 156 | |                 ty,
[00:56:34] 157 | |                 mutbl: MutImmutable,
[00:56:34] 158 | |             },
[00:56:34] 159 | |         ) = ty.sty
[00:56:34]     | |_________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/ptr.rs:153:16
[00:56:34]     |
[00:56:34] 153 |           if let ty::TyRef(
[00:56:34] 154 | |             _,
[00:56:34] 154 | |             _,
[00:56:34] 155 | |             ty::TypeAndMut {
[00:56:34] 156 | |                 ty,
[00:56:34] 157 | |                 mutbl: MutImmutable,
[00:56:34] 158 | |             },
[00:56:34] 159 | |         ) = ty.sty
[00:56:34]     | |_________^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 232 |                             (&ty::TyRef(_, rty), &ty::TyRawPtr(ptr_ty)) => span_lint_and_then(
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 287 |                             (&ty::TyRawPtr(from_pty), &ty::TyRef(_, to_ref_ty)) => span_lint_and_then(
[00:56:34]     |                                                        ^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 334 |                             (&ty::TyRef(_, ref ref_from), &ty::TyRef(_, ref ref_to)) => {
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 334 |                             (&ty::TyRef(_, ref ref_from), &ty::TyRef(_, ref ref_to)) => {
[00:56:34]     |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 232 |                             (&ty::TyRef(_, rty), &ty::TyRawPtr(ptr_ty)) => span_lint_and_then(
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 287 |                             (&ty::TyRawPtr(from_pty), &ty::TyRef(_, to_ref_ty)) => span_lint_and_then(
[00:56:34]     |                                                        ^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 334 |                             (&ty::TyRef(_, ref ref_from), &ty::TyRef(_, ref ref_to)) => {
[00:56:34]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     |
[00:56:34]     |
[00:56:34] 334 |                             (&ty::TyRef(_, ref ref_from), &ty::TyRef(_, ref ref_to)) => {
[00:56:34]     |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    |
[00:56:34]    |
[00:56:34] 38 |             if let ty::TyRef(_, ref ty) = cx.tables.expr_ty_adjusted(expr).sty;
[00:56:34]    |                    ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:35] error: aborting due to 24 previous errors
[00:56:35] 
[00:56:35] For more information about this error, try `rustc --explain E0023`.
[00:56:35] [RUSTC-TIMING] clippy_lints test:false 6.407
[00:56:35] [RUSTC-TIMING] clippy_lints test:false 6.407
[00:56:35] error: Could not compile `clippy_lints`.
[00:56:35] 
[00:56:35] Caused by:
[00:56:35]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name clippy_lints tools/clippy/clippy_lints/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=83a1334c5fea0e9c -C extra-filename=-83a1334c5fea0e9c --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps --extern pulldown_cmark=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libpulldown_cmark-7f2f9a2d0435c18e.rlib --extern serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-2cf386f66182433d.so --extern quine_mc_cluskey=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquine_mc_cluskey-0e4603a69e92573a.rlib --extern semver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsemver-b1deacd60bfb3467.rlib --extern lazy_static=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/liblazy_static-b9cb06bc45180e7a.rlib --extern url=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/liburl-45f65d65dd6d2bb7.rlib --extern if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-4752be648b1a17ac.rlib --extern matches=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libmatches-75ce18cd1348fe32.rlib --extern serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-527d35c40b476be0.rlib --extern toml=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtoml-5c9967c64118fa51.rlib --extern cargo_metadata=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libcargo_metadata-1eb24d7fae38db8d.rlib --extern unicode_normalization=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libunicode_normalization-647d63666653882f.rlib --extern itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-0be9d273ba4062d8.rlib --extern regex_syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex_syntax-201758bda4bd8ffb.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/backtrace-sys-2365887b342ce731/out/.libs` (exit code: 101)
[00:56:35] warning: build failed, waiting for other jobs to finish...
[00:56:35] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:35]    |
[00:56:35]    |
[00:56:35] 38 |             if let ty::TyRef(_, ref ty) = cx.tables.expr_ty_adjusted(expr).sty;
[00:56:35]    |                    ^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:35] error: aborting due to 24 previous errors
[00:56:35] 
[00:56:35] For more information about this error, try `rustc --explain E0023`.
[00:56:35] error: Could not compile `clippy_lints`.
---
Building stage2 tool miri (x86_64-unknown-linux-gnu)
[01:17:26]    Compiling miri v0.1.0 (file:///checkout/src/tools/miri)
[01:17:26]    Compiling byteorder v1.2.2
[01:17:27] [RUSTC-TIMING] byteorder test:false 0.827
[01:17:30] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[01:17:30]     |
[01:17:30]     |
[01:17:30] 404 |             ty::TyRef(_, ty::TypeAndMut { ty: pointee, .. }) |
[01:17:30]     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[01:17:30] 
[01:17:30] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[01:17:30]     |
[01:17:30]     |
[01:17:30] 661 | /                 TyRef(region,
[01:17:30] 662 | |                     ty::TypeAndMut {
[01:17:30] 663 | |                         ty: pointee_ty,
[01:17:30] 664 | |                         mutbl,
[01:17:30] 665 | |                     }) => {
[01:17:30]     | |______________________^ expected 3 fields, found 2
[01:17:30] error: aborting due to 2 previous errors
[01:17:30] 
[01:17:30] For more information about this error, try `rustc --explain E0023`.
[01:17:30] [RUSTC-TIMING] miri test:false 3.137
---
[01:17:30] Cloning into 'rust-toolstate'...
[01:17:30] [master 7eff5f2] (linux CI update)
[01:17:30]  1 file changed, 1 insertion(+)
[01:17:34] To https://github.com/rust-lang-nursery/rust-toolstate.git
[01:17:34]    eec401a..7eff5f2  master -> master
[01:17:34] Error: The state of "clippy-driver" has regressed from "test-pass" to "build-fail"
[01:17:34] Error: The state of "miri" has regressed from "test-pass" to "build-fail"

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
travis_time:start:0534c600
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]    --> tools/clippy/clippy_lints/src/utils/mod.rs:677:9
[00:56:32]     |
[00:56:32] 677 |         ty::TyRef(_, ref tm) => walk_ptrs_ty(tm.ty),
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]    --> tools/clippy/clippy_lints/src/consts.rs:429:13
[00:56:32]     |
[00:56:32]     |
[00:56:32] 429 |             ty::TyRef(_, tam) => match tam.ty.sty {
[00:56:32]     |             ^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]    --> tools/clippy/clippy_lints/src/utils/mod.rs:687:13
[00:56:32]     |
[00:56:32] 687 |             ty::TyRef(_, ref tm) => inner(tm.ty, depth + 1),
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]    --> tools/clippy/clippy_lints/src/utils/mod.rs:677:9
[00:56:32]     |
[00:56:32]     |
[00:56:32] 677 |         ty::TyRef(_, ref tm) => walk_ptrs_ty(tm.ty),
[00:56:32] 
[00:56:32] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:32]    --> tools/clippy/clippy_lints/src/utils/mod.rs:687:13
[00:56:32]     |
[00:56:32]     |
[00:56:32] 687 |             ty::TyRef(_, ref tm) => inner(tm.ty, depth + 1),
[00:56:32] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]    --> tools/clippy/clippy_lints/src/loops.rs:746:9
[00:56:33]     |
[00:56:33]     |
[00:56:33] 746 |         ty::TyRef(_, ref subty) => is_slice_like(cx, subty.ty),
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]     --> tools/clippy/clippy_lints/src/loops.rs:1368:17
[00:56:33]      |
[00:56:33]      |
[00:56:33] 1368 |                 ty::TyRef(_, ref tam) => match (&pat[0].node, &pat[1].node) {
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]     --> tools/clippy/clippy_lints/src/loops.rs:1708:28
[00:56:33]      |
---
[00:56:33] 
[00:56:33] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:33]    --> tools/clippy/clippy_lints/src/loops.rs:746:9
[00:56:33]     |
[00:56:33] 746 |         ty::TyRef(_, ref subty) => is_slice_like(cx, subty.ty),
[00:56:33] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     --> tools/clippy/clippy_lints/src/loops.rs:1368:17
[00:56:34]      |
[00:56:34]      |
[00:56:34] 1368 |                 ty::TyRef(_, ref tam) => match (&pat[0].node, &pat[1].node) {
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     --> tools/clippy/clippy_lints/src/loops.rs:1708:28
[00:56:34]      |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:752:21
[00:56:34]     |
[00:56:34] 752 |                     ty::TyRef(_, ty) if ty.ty.sty == ty::TyStr => for &(method, pos) in &PATTERN_METHODS {
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/map_clone.rs:54:44
[00:56:34]    |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:971:16
[00:56:34]     |
[00:56:34] 971 |         if let ty::TyRef(_, ty::TypeAndMut { ty: innermost, .. }) = inner.sty {
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:981:31
[00:56:34]     |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:752:21
[00:56:34]     |
[00:56:34] 752 |                     ty::TyRef(_, ty) if ty.ty.sty == ty::TyStr => for &(method, pos) in &PATTERN_METHODS {
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:970:12
[00:56:34]     |
[00:56:34]     |
[00:56:34] 970 |     if let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = arg_ty.sty {
[00:56:34]     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:971:16
[00:56:34]     |
[00:56:34] 971 |         if let ty::TyRef(_, ty::TypeAndMut { ty: innermost, .. }) = inner.sty {
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/methods.rs:981:31
[00:56:34]     |
---
[00:56:34] 75 | |                 ty::TypeAndMut {
[00:56:34] 76 | |                     mutbl: hir::MutMutable,
[00:56:34] 77 | |                     ..
[00:56:34] 78 | |                 },
[00:56:34] 79 | |             ) = self.cx.tables.expr_ty(e).sty
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]     --> tools/clippy/clippy_lints/src/methods.rs:1318:13
[00:56:34]      |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/needless_borrow.rs:80:20
[00:56:34]    |
[00:56:34] 80 |             if let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty;
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/needless_borrow.rs:82:20
[00:56:34]    |
---
[00:56:34] 75 | |                 ty::TypeAndMut {
[00:56:34] 76 | |                     mutbl: hir::MutMutable,
[00:56:34] 77 | |                     ..
[00:56:34] 78 | |                 },
[00:56:34] 79 | |             ) = self.cx.tables.expr_ty(e).sty
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/mut_reference.rs:64:21
[00:56:34]    |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/needless_borrow.rs:80:20
[00:56:34]    |
[00:56:34] 80 |             if let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty;
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/needless_borrow.rs:82:20
[00:56:34]    |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:232:31
[00:56:34]     |
[00:56:34] 232 |                             (&ty::TyRef(_, rty), &ty::TyRawPtr(ptr_ty)) => span_lint_and_then(
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:287:56
[00:56:34]     |
[00:56:34]     |
[00:56:34] 287 |                             (&ty::TyRawPtr(from_pty), &ty::TyRef(_, to_ref_ty)) => span_lint_and_then(
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:334:31
[00:56:34]     |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:232:31
[00:56:34]     |
[00:56:34] 232 |                             (&ty::TyRef(_, rty), &ty::TyRawPtr(ptr_ty)) => span_lint_and_then(
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:287:56
[00:56:34]     |
[00:56:34]     |
[00:56:34] 287 |                             (&ty::TyRawPtr(from_pty), &ty::TyRef(_, to_ref_ty)) => span_lint_and_then(
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]    --> tools/clippy/clippy_lints/src/transmute.rs:334:31
[00:56:34]     |
---
[00:56:34] 
[00:56:34] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:34]   --> tools/clippy/clippy_lints/src/vec.rs:38:20
[00:56:34]    |
[00:56:34] 38 |             if let ty::TyRef(_, ref ty) = cx.tables.expr_ty_adjusted(expr).sty;
[00:56:34] 
[00:56:35] error: aborting due to 24 previous errors
[00:56:35] 
[00:56:35] For more information about this error, try `rustc --explain E0023`.
---
[00:56:35] warning: build failed, waiting for other jobs to finish...
[00:56:35] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[00:56:35]   --> tools/clippy/clippy_lints/src/vec.rs:38:20
[00:56:35]    |
[00:56:35] 38 |             if let ty::TyRef(_, ref ty) = cx.tables.expr_ty_adjusted(expr).sty;
[00:56:35] 
[00:56:35] error: aborting due to 24 previous errors
[00:56:35] 
[00:56:35] For more information about this error, try `rustc --explain E0023`.
---
[01:17:27] [RUSTC-TIMING] byteorder test:false 0.827
[01:17:30] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[01:17:30]    --> tools/miri/miri/validation.rs:404:13
[01:17:30]     |
[01:17:30] 404 |             ty::TyRef(_, ty::TypeAndMut { ty: pointee, .. }) |
[01:17:30] 
[01:17:30] error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
[01:17:30]    --> tools/miri/miri/validation.rs:661:17
[01:17:30]     |
[01:17:30]     |
[01:17:30] 661 | /                 TyRef(region,
[01:17:30] 662 | |                     ty::TypeAndMut {
[01:17:30] 663 | |                         ty: pointee_ty,
[01:17:30] 664 | |                         mutbl,
[01:17:30] 665 | |                     }) => {
[01:17:30] 
[01:17:30] error: aborting due to 2 previous errors
[01:17:30] 
[01:17:30] For more information about this error, try `rustc --explain E0023`.
---
[01:17:30] Cloning into 'rust-toolstate'...
[01:17:30] [master 7eff5f2] (linux CI update)
[01:17:30]  1 file changed, 1 insertion(+)
[01:17:34] To https://github.com/rust-lang-nursery/rust-toolstate.git
[01:17:34]    eec401a..7eff5f2  master -> master
[01:17:34] Error: The state of "clippy-driver" has regressed from "test-pass" to "build-fail"
[01:17:34] Error: The state of "miri" has regressed from "test-pass" to "build-fail"

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
travis_time:start:0534c600
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented May 10, 2018

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2018
@bors
Copy link
Contributor

bors commented May 10, 2018

⌛ Testing commit c9d9c24 with merge 0a223d1...

bors added a commit that referenced this pull request May 10, 2018
Optimize layout of TypeVariants

This makes references to `Slice` use thin pointers by storing the slice length in the slice itself. `GeneratorInterior` is replaced by storing the movability of generators in `TyGenerator` and the interior witness is stored in `GeneratorSubsts` (which is just a wrapper around `&'tcx Substs`, like `ClosureSubsts`). Finally the fields of `TypeAndMut` is stored inline in `TyRef`. These changes combine to reduce `TypeVariants` from 48 bytes to 24 bytes on x86_64.

r? @michaelwoerister
@bors
Copy link
Contributor

bors commented May 10, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing 0a223d1 to master...

@kennytm-githubbot
Copy link

📣 Toolstate changed by #50395!

Tested on commit 0a223d1.
Direct link to PR: #50395

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).

kennytm-githubbot added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request May 10, 2018
Tested on commit rust-lang/rust@0a223d1.
Direct link to PR: <rust-lang/rust#50395>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
bors added a commit that referenced this pull request May 22, 2018
Make &Slice a thin pointer

Split out from #50395

r? @michaelwoerister
bors added a commit that referenced this pull request May 28, 2018
@Zoxc Zoxc deleted the small-tys branch November 30, 2018 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants