From 934f92d451ab07fa25352d823a6ab6558b090e1b Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Wed, 17 Apr 2024 18:47:28 -0400 Subject: [PATCH] Enable MSVC in CI --- src/ci/github-actions/jobs.yml | 5 +++++ tests/ui/env-null-vars.rs | 14 ++++---------- tests/ui/runtime/out-of-stack.rs | 7 +------ tests/ui/sanitizer/thread.rs | 1 - 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 7e89eef2670e4..462985457d165 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -48,3 +48,8 @@ pr: <<: *job-linux-16c - name: x86_64-gnu-tools <<: *job-linux-16c + - name: x86_64-msvc + env: + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler + SCRIPT: make ci-msvc + <<: *job-windows-8c diff --git a/tests/ui/env-null-vars.rs b/tests/ui/env-null-vars.rs index bb86fd353c4e9..24d783553d126 100644 --- a/tests/ui/env-null-vars.rs +++ b/tests/ui/env-null-vars.rs @@ -1,21 +1,15 @@ +// Ensure that env::vars() does not panic if environ is null. +// Regression test for rust-lang/rust#53200 //@ run-pass -#![allow(unused_imports)] - -//@ ignore-windows - -// issue-53200 - #![feature(rustc_private)] -extern crate libc; - -use std::env; // FIXME: more platforms? #[cfg(target_os = "linux")] fn main() { + extern crate libc; unsafe { libc::clearenv(); } - assert_eq!(env::vars().count(), 0); + assert_eq!(std::env::vars().count(), 0); } #[cfg(not(target_os = "linux"))] diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs index ab2b50b293ce5..a62398df8b80b 100644 --- a/tests/ui/runtime/out-of-stack.rs +++ b/tests/ui/runtime/out-of-stack.rs @@ -8,21 +8,16 @@ //@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590) //@ ignore-nto no stack overflow handler used (no alternate stack available) -#![feature(core_intrinsics)] #![feature(rustc_private)] #[cfg(unix)] extern crate libc; use std::env; +use std::hint::black_box; use std::process::Command; use std::thread; -// Inlining to avoid llvm turning the recursive functions into tail calls, -// which doesn't consume stack. -#[inline(always)] -pub fn black_box(dummy: T) { std::intrinsics::black_box(dummy); } - fn silent_recurse() { let buf = [0u8; 1000]; black_box(buf); diff --git a/tests/ui/sanitizer/thread.rs b/tests/ui/sanitizer/thread.rs index 9d9ad6ee51867..566774d6b1d64 100644 --- a/tests/ui/sanitizer/thread.rs +++ b/tests/ui/sanitizer/thread.rs @@ -20,7 +20,6 @@ //@ error-pattern: Location is heap block of size 4 //@ error-pattern: allocated by main thread -#![feature(raw_ref_op)] #![feature(rustc_private)] extern crate libc;