1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Update to Rust 1.76 (#4411)

Motivation: I want to replace `cargo-cranky` with workspace lints, first
available in Rust 1.74.
However, `cargo doc` would hange on `wgpu` and `wgpu-core` on 1.74 and
1.75… so now we're on 1.76.
I think this is fine - when 1.78 is released next week we're still two
versions behind the bleeding edge.

…and the branch name is just wrong 🤦
This commit is contained in:
Emil Ernerfeldt
2024-04-25 15:51:01 +02:00
committed by GitHub
parent bfe1858e0b
commit cee790681d
37 changed files with 45 additions and 48 deletions

View File

@@ -225,9 +225,7 @@ fn set_title_and_icon_mac(title: &str, icon_data: Option<&IconData>) -> AppIconS
}
unsafe {
let app = if let Some(app) = NSApp {
app
} else {
let Some(app) = NSApp else {
log::debug!("NSApp is null");
return AppIconStatus::NotSetIgnored;
};

View File

@@ -391,6 +391,8 @@ pub fn run_glow(
mut native_options: epi::NativeOptions,
app_creator: epi::AppCreator,
) -> Result<()> {
#![allow(clippy::needless_return_with_question_mark)] // False positive
use super::glow_integration::GlowWinitApp;
#[cfg(not(target_os = "ios"))]
@@ -414,6 +416,8 @@ pub fn run_wgpu(
mut native_options: epi::NativeOptions,
app_creator: epi::AppCreator,
) -> Result<()> {
#![allow(clippy::needless_return_with_question_mark)] // False positive
use super::wgpu_integration::WgpuWinitApp;
#[cfg(not(target_os = "ios"))]

View File

@@ -31,7 +31,7 @@ pub(crate) fn load_memory(_: &egui::Context) {}
#[cfg(feature = "persistence")]
pub(crate) fn save_memory(ctx: &egui::Context) {
match ctx.memory(|mem| ron::to_string(mem)) {
match ctx.memory(ron::to_string) {
Ok(ron) => {
local_storage_set("egui_memory_ron", &ron);
}

View File

@@ -230,7 +230,7 @@ impl CollapsingState {
}
}
/// Paint this [CollapsingState](CollapsingState)'s toggle button. Takes an [IconPainter](IconPainter) as the icon.
/// Paint this [`CollapsingState`]'s toggle button. Takes an [`IconPainter`] as the icon.
/// ```
/// # egui::__run_test_ui(|ui| {
/// fn circle_icon(ui: &mut egui::Ui, openness: f32, response: &egui::Response) {

View File

@@ -517,7 +517,7 @@ macro_rules! include_image {
};
}
/// Create a [`Hyperlink`](crate::Hyperlink) to the current [`file!()`] (and line) on Github
/// Create a [`Hyperlink`] to the current [`file!()`] (and line) on Github
///
/// ```
/// # egui::__run_test_ui(|ui| {
@@ -532,7 +532,7 @@ macro_rules! github_link_file_line {
}};
}
/// Create a [`Hyperlink`](crate::Hyperlink) to the current [`file!()`] on github.
/// Create a [`Hyperlink`] to the current [`file!()`] on github.
///
/// ```
/// # egui::__run_test_ui(|ui| {

View File

@@ -868,7 +868,7 @@ impl Memory {
// ----------------------------------------------------------------------------
/// Keeps track of [`Area`](crate::containers::area::Area)s, which are free-floating [`Ui`](crate::Ui)s.
/// These [`Area`](crate::containers::area::Area)s can be in any [`Order`](crate::Order).
/// These [`Area`](crate::containers::area::Area)s can be in any [`Order`].
#[derive(Clone, Debug, Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "serde", serde(default))]

View File

@@ -288,7 +288,7 @@ pub struct Spacing {
/// Default rail height of a [`Slider`].
pub slider_rail_height: f32,
/// Default (minimum) width of a [`ComboBox`](crate::ComboBox).
/// Default (minimum) width of a [`ComboBox`].
pub combo_width: f32,
/// Default width of a [`TextEdit`].

View File

@@ -131,7 +131,7 @@ impl Column {
self
}
/// Allowed range of movement (in points), if in a resizable [`Table`](crate::table::Table).
/// Allowed range of movement (in points), if in a resizable [`Table`].
#[inline]
pub fn range(mut self, range: impl Into<Rangef>) -> Self {
self.width_range = range.into();

View File

@@ -1293,12 +1293,7 @@ impl std::fmt::Debug for PaintCallback {
impl std::cmp::PartialEq for PaintCallback {
fn eq(&self, other: &Self) -> bool {
// As I understand it, the problem this clippy is trying to protect against
// can only happen if we do dynamic casts back and forth on the pointers, and we don't do that.
#[allow(clippy::vtable_address_comparisons)]
{
self.rect.eq(&other.rect) && Arc::ptr_eq(&self.callback, &other.callback)
}
self.rect.eq(&other.rect) && Arc::ptr_eq(&self.callback, &other.callback)
}
}