Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dtolnay/trybuild
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.92
Choose a base ref
...
head repository: dtolnay/trybuild
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.93
Choose a head ref
  • 5 commits
  • 4 files changed
  • 2 contributors

Commits on May 4, 2024

  1. Remove dependency on once_cell

    taiki-e committed May 4, 2024
    Copy the full SHA
    f8795cf View commit details
  2. Merge pull request #266 from taiki-e/once_cell

    Remove dependency on once_cell
    dtolnay authored May 4, 2024
    Copy the full SHA
    62b1543 View commit details
  3. Remove OnceLock around intra-process lock's mutex

    dtolnay committed May 4, 2024
    Copy the full SHA
    95f8cdb View commit details
  4. Merge pull request #267 from dtolnay/constmutex

    Remove OnceLock around intra-process lock's mutex
    dtolnay authored May 4, 2024
    Copy the full SHA
    b988835 View commit details
  5. Release 1.0.93

    dtolnay committed May 4, 2024
    Copy the full SHA
    8a57d8c View commit details
Showing with 6 additions and 13 deletions.
  1. +1 −2 Cargo.toml
  2. +2 −7 src/flock.rs
  3. +1 −1 src/lib.rs
  4. +2 −3 src/term.rs
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trybuild"
version = "1.0.92"
version = "1.0.93"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::testing"]
description = "Test harness for ui tests of compiler diagnostics"
@@ -21,7 +21,6 @@ diff = ["dissimilar"]
[dependencies]
dissimilar = { version = "1.0", optional = true }
glob = "0.3"
once_cell = "1.9"
serde = "1.0.194"
serde_derive = "1.0.194"
serde_json = "1.0.110"
9 changes: 2 additions & 7 deletions src/flock.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::error::Result;
use once_cell::sync::OnceCell;
use std::fs::{self, File, OpenOptions};
use std::io;
use std::path::{Path, PathBuf};
@@ -8,7 +7,7 @@ use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
use std::thread;
use std::time::{Duration, SystemTime};

static LOCK: OnceCell<Mutex<()>> = OnceCell::new();
static LOCK: Mutex<()> = Mutex::new(());

pub(crate) struct Lock {
intraprocess_guard: Guard,
@@ -43,11 +42,7 @@ impl Lock {

impl Guard {
fn acquire() -> Self {
Guard::Locked(
LOCK.get_or_init(|| Mutex::new(()))
.lock()
.unwrap_or_else(PoisonError::into_inner),
)
Guard::Locked(LOCK.lock().unwrap_or_else(PoisonError::into_inner))
}
}

2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -208,7 +208,7 @@
//! makes error messages that we care about substantially worse, it is also
//! important to catch and report as a compiler issue.
#![doc(html_root_url = "https://docs.rs/trybuild/1.0.92")]
#![doc(html_root_url = "https://docs.rs/trybuild/1.0.93")]
#![allow(
clippy::collapsible_if,
clippy::default_trait_access,
5 changes: 2 additions & 3 deletions src/term.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use once_cell::sync::OnceCell;
use std::io::{Result, Write};
use std::sync::{Mutex, MutexGuard, PoisonError};
use std::sync::{Mutex, MutexGuard, OnceLock, PoisonError};
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream as Stream, WriteColor};

static TERM: OnceCell<Mutex<Term>> = OnceCell::new();
static TERM: OnceLock<Mutex<Term>> = OnceLock::new();

pub(crate) fn lock() -> MutexGuard<'static, Term> {
TERM.get_or_init(|| Mutex::new(Term::new()))