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

Test suite work #395

Merged
merged 4 commits into from
Jul 12, 2018
Merged

Test suite work #395

merged 4 commits into from
Jul 12, 2018

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jul 11, 2018

Fix most compile-fail tests. Some are left ignored, but at least the rest is tested against regressions.

Also move some tests out of fullmir that no longer need it.

@RalfJung RalfJung mentioned this pull request Jul 11, 2018
5 tasks
@RalfJung
Copy link
Member Author

Panic handling on Windows is unhappy:

error[E0080]: constant evaluation error
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys\windows\compat.rs:33:22
   |
33 |         let handle = c::GetModuleHandleW(module.as_ptr());
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no mir for `std::sys::windows::c::::GetModuleHandleW`
   |
note: inside call to `std::sys::windows::compat::lookup`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys\windows\mutex.rs:150:21
   |
150|     let ret = match compat::lookup("kernel32", "AcquireSRWLockExclusive") {
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::windows::mutex::kind`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys\windows\mutex.rs:68:15
   |
68 |         match kind() {
   |               ^^^^^^
note: inside call to `std::sys::windows::mutex::Mutex::lock`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys_common\mutex.rs:40:37
   |
40 |     pub unsafe fn raw_lock(&self) { self.0.lock() }
   |                                     ^^^^^^^^^^^^^
note: inside call to `std::sys_common::mutex::Mutex::raw_lock`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys_common\mutex.rs:46:9
   |
46 |         self.raw_lock();
   |         ^^^^^^^^^^^^^^^
note: inside call to `std::sys_common::mutex::Mutex::lock`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys_common\thread_local.rs:165:26
   |
165|             let _guard = INIT_LOCK.lock();
   |                          ^^^^^^^^^^^^^^^^
note: inside call to `std::sys_common::thread_local::StaticKey::lazy_init`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys_common\thread_local.rs:152:18
   |
152|             0 => self.lazy_init() as imp::Key,
   |                  ^^^^^^^^^^^^^^^^
note: inside call to `std::sys_common::thread_local::StaticKey::key`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\sys_common\thread_local.rs:140:52
   |
140|     pub unsafe fn get(&self) -> *mut u8 { imp::get(self.key()) }
   |                                                    ^^^^^^^^^^
note: inside call to `std::sys_common::thread_local::StaticKey::get`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:443:23
   |
443|             let ptr = self.os.get() as *mut Value<T>;
   |                       ^^^^^^^^^^^^^
note: inside call to `<std::thread::Key<T>><std::cell::Cell<usize>>::get`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:188:17
   |
188|                 __KEY.get()
   |                 ^^^^^^^^^^^
note: inside call to `std::rt::update_panic_count::PANIC_COUNT::__getit`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:291:24
   |
291|             let slot = (self.inner)().ok_or(AccessError {
   |                        ^^^^^^^^^^^^^^
note: inside call to `<std::thread::LocalKey<T>><std::cell::Cell<usize>>::try_with::<[closure@DefId(1/1:1801 ~ std[4c00]::panicking[0]::update_panic_count[0]::{{closure}}[0]) 0:&isize], usize>`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:248:9
   |
248|         self.try_with(f).expect("cannot access a TLS value during or \
   |         ^^^^^^^^^^^^^^^^
note: inside call to `<std::thread::LocalKey<T>><std::cell::Cell<usize>>::with::<[closure@DefId(1/1:1801 ~ std[4c00]::panicking[0]::update_panic_count[0]::{{closure}}[0]) 0:&isize], usize>`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:240:5
   |
240| /     PANIC_COUNT.with(|c| {
241| |         let next = (c.get() as isize + amt) as usize;
242| |         c.set(next);
243| |         return next
244| |     })
   | |______^
note: inside call to `std::rt::update_panic_count`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:449:18
   |
449|     let panics = update_panic_count(1);
   |                  ^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::panicking::rust_panic_with_hook`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:390:5
   |
390| /     rust_panic_with_hook(
391| |         &mut PanicPayload::new(msg),
392| |         info.message(),
393| |         &file_line_col);
   | |_______________________^
note: inside call to `std::panicking::continue_panic_fmt`
  --> C:\Users\appveyor\.rustup\toolchains\nightly-i686-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:345:5
   |
345|     continue_panic_fmt(&info)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::rt::begin_panic_fmt`
  --> tests/compile-fail\panic.rs:6:5
   |
6  |     assert_eq!(5, 6);
   |     ^^^^^^^^^^^^^^^^^
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

@oli-obk
Copy link
Contributor

oli-obk commented Jul 11, 2018

We can merge without windows working. Or just ignore the tests on windows for now. Once my const panic PR is merged we can copy the logic and do something similar and OS independent

@RalfJung
Copy link
Member Author

Once my const panic PR is merged we can copy the logic and do something similar and OS independent

Ah, good point. I was going to try and add some more shims for these syscalls (or whatever they are), but if this will all change soon anyway, I'll just make it ignore the test.

I'd prefer to keep AppVeyor green.

@RalfJung RalfJung changed the title Fix most compile-fail tests Test suite work Jul 12, 2018
@oli-obk oli-obk merged commit f8fabe4 into rust-lang:master Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants