Browse Source

Bump MSRV (Minimum Supported Rust Version) to 1.54.0 (#703)

1.51.0 clippy has been giving me trouble (not reporting all problems),
and so I take the easy way out and just bump MSRV.

We will upgrade to 1.56.0 once it comes around anyway
to get access to that sweet disjoint capture in closures
(https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html)
pull/704/head
Emil Ernerfeldt 3 years ago
committed by GitHub
parent
commit
f37180f7dc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      .github/workflows/rust.yml
  2. 1
      CHANGELOG.md
  3. 9
      eframe/src/lib.rs
  4. 10
      egui/src/lib.rs
  5. 7
      egui_demo_app/src/lib.rs
  6. 7
      egui_demo_app/src/main.rs
  7. 8
      egui_demo_lib/src/lib.rs
  8. 9
      egui_glium/src/lib.rs
  9. 9
      egui_web/src/lib.rs
  10. 31
      egui_web/src/shader/vertex_100es.glsl
  11. 15
      egui_web/src/webgl1.rs
  12. 8
      emath/src/lib.rs
  13. 8
      epaint/src/lib.rs
  14. 10
      epi/src/lib.rs
  15. 2
      rust-toolchain

18
.github/workflows/rust.yml

@ -17,7 +17,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: sudo apt-get install libspeechd-dev
- uses: actions-rs/cargo@v1
@ -32,7 +32,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: sudo apt-get install libspeechd-dev
- uses: actions-rs/cargo@v1
@ -48,7 +48,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: rustup target add wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
@ -64,7 +64,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: rustup target add wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
@ -80,7 +80,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- uses: actions-rs/cargo@v1
@ -96,7 +96,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
@ -112,7 +112,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: rustup component add clippy
- run: sudo apt-get install libspeechd-dev
@ -129,7 +129,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: sudo apt-get install libspeechd-dev
- run: cargo doc -p emath -p epaint -p egui -p eframe -p epi -p egui_web -p egui_glium --lib --no-deps --all-features
@ -142,7 +142,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
toolchain: 1.54.0
override: true
- run: sudo apt-get install libspeechd-dev
- run: rustup target add wasm32-unknown-unknown

1
CHANGELOG.md

@ -18,6 +18,7 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [
* All `Ui`:s must now have a finite `max_rect`.
* Deprecated: `max_rect_finite`, `available_size_before_wrap_finite` and `available_rect_before_wrap_finite`.
* `Painter`/`Fonts`: text layout now expect color when creating a `Galley`. You may override that color with `Painter::galley_with_color`.
* MSRV (Minimum Supported Rust Version) is now `1.54.0`.
### Fixed 🐛
* Fix wrongly sized multiline `TextEdit` in justified layouts.

9
eframe/src/lib.rs

@ -13,15 +13,8 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(clippy::all, missing_docs, rust_2018_idioms)]
#![warn(clippy::all, missing_crate_level_docs, missing_docs, rust_2018_idioms)]
pub use {egui, epi};

10
egui/src/lib.rs

@ -3,7 +3,7 @@
//! Try the live web demo: <https://emilk.github.io/egui/index.html>. Read more about egui at <https://github.com/emilk/egui>.
//!
//! `egui` is in heavy development, with each new version having breaking changes.
//! You need to have rust 1.51.0 or later to use `egui`.
//! You need to have rust 1.54.0 or later to use `egui`.
//!
//! To quickly get started with egui, you can take a look at [`egui_template`](https://github.com/emilk/egui_template)
//! which uses [`eframe`](https://docs.rs/eframe).
@ -267,13 +267,6 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(
clippy::all,
@ -336,6 +329,7 @@
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
missing_crate_level_docs,
nonstandard_style,
rust_2018_idioms
)]

7
egui_demo_app/src/lib.rs

@ -1,12 +1,5 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(clippy::all, rust_2018_idioms)]

7
egui_demo_app/src/main.rs

@ -1,12 +1,5 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(clippy::all, rust_2018_idioms)]

8
egui_demo_lib/src/lib.rs

@ -4,13 +4,6 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(
clippy::all,
@ -73,6 +66,7 @@
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
missing_crate_level_docs,
nonstandard_style,
rust_2018_idioms
)]

9
egui_glium/src/lib.rs

@ -7,15 +7,8 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(clippy::all, rust_2018_idioms)]
#![warn(clippy::all, missing_crate_level_docs, rust_2018_idioms)]
#![allow(clippy::manual_range_contains, clippy::single_match)]
mod backend;

9
egui_web/src/lib.rs

@ -11,15 +11,8 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(clippy::all, rust_2018_idioms)]
#![warn(clippy::all, missing_crate_level_docs, rust_2018_idioms)]
pub mod backend;
mod painter;

31
egui_web/src/shader/vertex_100es.glsl

@ -1,31 +0,0 @@
precision mediump float;
uniform vec2 u_screen_size;
attribute vec2 a_pos;
attribute vec2 a_tc;
attribute vec4 a_srgba;
varying vec4 v_rgba;
varying vec2 v_tc;
// 0-1 linear from 0-255 sRGB
vec3 linear_from_srgb(vec3 srgb) {
bvec3 cutoff = lessThan(srgb, vec3(10.31475));
vec3 lower = srgb / vec3(3294.6);
vec3 higher = pow((srgb + vec3(14.025)) / vec3(269.025), vec3(2.4));
return mix(higher, lower, vec3(cutoff));
}
// 0-1 linear from 0-255 sRGBA
vec4 linear_from_srgba(vec4 srgba) {
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
}
void main() {
gl_Position = vec4(
2.0 * a_pos.x / u_screen_size.x - 1.0,
1.0 - 2.0 * a_pos.y / u_screen_size.y,
0.0,
1.0);
// egui encodes vertex colors in gamma spaces, so we must decode the colors here:
v_rgba = linear_from_srgba(a_srgba);
v_tc = a_tc;
}

15
egui_web/src/webgl1.rs

@ -64,12 +64,12 @@ impl WebGlPainter {
let srgb_supported = matches!(gl.get_extension("EXT_sRGB"), Ok(Some(_)));
let vert_shader = compile_shader(
&gl,
Gl::VERTEX_SHADER,
include_str!("shader/main_vertex_100es.glsl"),
)?;
let (texture_format, program, post_process) = if srgb_supported {
let vert_shader = compile_shader(
&gl,
Gl::VERTEX_SHADER,
include_str!("shader/main_vertex_100es.glsl"),
)?;
let frag_shader = compile_shader(
&gl,
Gl::FRAGMENT_SHADER,
@ -82,11 +82,6 @@ impl WebGlPainter {
(ExtSRgb::SRGB_ALPHA_EXT, program, Some(post_process))
} else {
let vert_shader = compile_shader(
&gl,
Gl::VERTEX_SHADER,
include_str!("shader/vertex_100es.glsl"),
)?;
let frag_shader = compile_shader(
&gl,
Gl::FRAGMENT_SHADER,

8
emath/src/lib.rs

@ -11,13 +11,6 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(
clippy::all,
@ -80,6 +73,7 @@
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
missing_crate_level_docs,
nonstandard_style,
rust_2018_idioms
)]

8
epaint/src/lib.rs

@ -2,13 +2,6 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(
clippy::all,
@ -71,6 +64,7 @@
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
missing_crate_level_docs,
nonstandard_style,
rust_2018_idioms
)]

10
epi/src/lib.rs

@ -8,13 +8,6 @@
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
// Disabled so we can support rust 1.51:
// #![deny(
// rustdoc::broken_intra_doc_links,
// rustdoc::invalid_codeblock_attributes,
// rustdoc::missing_crate_level_docs,
// rustdoc::private_intra_doc_links
// )]
#![forbid(unsafe_code)]
#![warn(
clippy::all,
@ -77,11 +70,13 @@
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
missing_crate_level_docs,
nonstandard_style,
rust_2018_idioms
)]
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![warn(missing_docs)] // Let's keep `epi` well-documented.
pub use egui; // Re-export for user convenience
@ -312,6 +307,7 @@ pub trait TextureAllocator {
/// Abstraction for platform dependent texture reference
pub trait NativeTexture {
/// The native texture type.
type Texture;
/// Bind native texture to egui texture

2
rust-toolchain

@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
[toolchain]
channel = "1.51.0"
channel = "1.54.0"
components = [ "rustfmt", "clippy" ]
targets = [ "wasm32-unknown-unknown" ]

Loading…
Cancel
Save