Skip to content

Commit e200926

Browse files
committed
Explicitly specify minimum supported rust version
This should help with distributing apps using winit. Fixes #1075.
1 parent 5003564 commit e200926

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
rust_version: [stable, nightly]
25+
rust_version: [1.57.0, stable, nightly]
2626
platform:
2727
# Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml!
2828
- { target: x86_64-pc-windows-msvc, os: windows-latest, }
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: Lint with clippy
105105
shell: bash
106-
if: (matrix.rust_version != 'nightly') && !contains(matrix.platform.options, '--no-default-features')
106+
if: (matrix.rust_version == '1.57.0') && !contains(matrix.platform.options, '--no-default-features')
107107
run: cargo clippy --all-targets --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES -- -Dwarnings
108108

109109
- name: Build with serde enabled

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre
88

99
# Unreleased
1010

11+
- The minimum supported rust version was lowered to `1.57.0` and now explicitly tested.
12+
1113
# 0.27.0 (2022-07-26)
1214

1315
- On Windows, fix hiding a maximized window.

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ your description of the issue as detailed as possible:
2020

2121
When making a code contribution to winit, before opening your pull request, please make sure that:
2222

23+
- your patch builds with Winit's minimal supported rust version - Rust 1.57.0.
2324
- you tested your modifications on all the platforms impacted, or if not possible detail which platforms
2425
were not tested, and what should be tested, so that a maintainer or another contributor can test them
2526
- you updated any relevant documentation in winit

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ readme = "README.md"
1010
repository = "https://github.com/rust-windowing/winit"
1111
documentation = "https://docs.rs/winit"
1212
categories = ["gui"]
13+
rust-version = "1.57.0"
1314

1415
[package.metadata.docs.rs]
1516
features = ["serde"]

examples/fullscreen.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ fn main() {
5959
}
6060
VirtualKeyCode::F => {
6161
let fullscreen = Some(Fullscreen::Exclusive(mode.clone()));
62-
println!("Setting mode: {fullscreen:?}");
62+
println!("Setting mode: {:?}", fullscreen);
6363
window.set_fullscreen(fullscreen);
6464
}
6565
VirtualKeyCode::B => {
6666
let fullscreen = Some(Fullscreen::Borderless(Some(monitor.clone())));
67-
println!("Setting mode: {fullscreen:?}");
67+
println!("Setting mode: {:?}", fullscreen);
6868
window.set_fullscreen(fullscreen);
6969
}
7070
VirtualKeyCode::S => {

src/platform_impl/linux/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ impl Window {
587587

588588
/// Hooks for X11 errors.
589589
#[cfg(feature = "x11")]
590-
pub(crate) static mut XLIB_ERROR_HOOKS: Mutex<Vec<XlibErrorHook>> = Mutex::new(Vec::new());
590+
pub(crate) static mut XLIB_ERROR_HOOKS: Lazy<Mutex<Vec<XlibErrorHook>>> =
591+
Lazy::new(|| Mutex::new(Vec::new()));
591592

592593
#[cfg(feature = "x11")]
593594
unsafe extern "C" fn x_error_callback(

0 commit comments

Comments
 (0)