Actually fail on clippy failures (#7619)

Before the change to `script/clippy`, bash ignored first `clippy`
invocation failure and CI moved on with Linux errors and warnings
emitted.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Kirill Bulatov
2024-02-09 10:13:00 -08:00
committed by GitHub
co-authored by Mikayla Maki
parent eee00c3fef
commit 5175c8963a
8 changed files with 208 additions and 154 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ impl BladeBelt {
let index_maybe = self
.buffers
.iter()
.position(|&(ref rb, ref sp)| size <= rb.size && gpu.wait_for(sp, 0));
.position(|(rb, sp)| size <= rb.size && gpu.wait_for(sp, 0));
if let Some(index) = index_maybe {
let (rb, _) = self.buffers.remove(index);
let piece = rb.raw.into();
@@ -85,7 +85,7 @@ impl BladeBelt {
"Type alignment {} is too big",
type_alignment
);
let total_bytes = data.len() * mem::size_of::<T>();
let total_bytes = std::mem::size_of_val(data);
let bp = self.alloc(total_bytes as u64, gpu);
unsafe {
std::ptr::copy_nonoverlapping(data.as_ptr() as *const u8, bp.data(), total_bytes);
@@ -455,7 +455,7 @@ impl BladeRenderer {
sprites,
} => {
let tex_info = self.atlas.get_texture_info(texture_id);
let instance_buf = self.instance_belt.alloc_data(&sprites, &self.gpu);
let instance_buf = self.instance_belt.alloc_data(sprites, &self.gpu);
let mut encoder = pass.with(&self.pipelines.mono_sprites);
encoder.bind(
0,
@@ -473,7 +473,7 @@ impl BladeRenderer {
sprites,
} => {
let tex_info = self.atlas.get_texture_info(texture_id);
let instance_buf = self.instance_belt.alloc_data(&sprites, &self.gpu);
let instance_buf = self.instance_belt.alloc_data(sprites, &self.gpu);
let mut encoder = pass.with(&self.pipelines.poly_sprites);
encoder.bind(
0,
+1 -1
View File
@@ -109,7 +109,7 @@ impl PlatformDispatcher for LinuxDispatcher {
let moment = Instant::now() + duration;
let mut timed_tasks = self.timed_tasks.lock();
timed_tasks.push((moment, runnable));
timed_tasks.sort_unstable_by(|&(ref a, _), &(ref b, _)| b.cmp(a));
timed_tasks.sort_unstable_by(|(a, _), (b, _)| b.cmp(a));
}
fn tick(&self, background_only: bool) -> bool {
+5 -5
View File
@@ -59,7 +59,7 @@ pub(crate) struct LinuxPlatform {
pub(crate) struct LinuxPlatformState {
quit_requested: bool,
windows: HashMap<x::Window, Arc<LinuxWindowState>>,
windows: HashMap<x::Window, Rc<LinuxWindowState>>,
}
impl Default for LinuxPlatform {
@@ -133,7 +133,7 @@ impl Platform for LinuxPlatform {
xcb::Event::X(x::Event::Expose(ev)) => {
let window = {
let state = self.state.lock();
Arc::clone(&state.windows[&ev.window()])
Rc::clone(&state.windows[&ev.window()])
};
window.expose();
}
@@ -150,7 +150,7 @@ impl Platform for LinuxPlatform {
};
let window = {
let state = self.state.lock();
Arc::clone(&state.windows[&ev.window()])
Rc::clone(&state.windows[&ev.window()])
};
window.configure(bounds)
}
@@ -217,7 +217,7 @@ impl Platform for LinuxPlatform {
) -> Box<dyn PlatformWindow> {
let x_window = self.xcb_connection.generate_id();
let window_ptr = Arc::new(LinuxWindowState::new(
let window_ptr = Rc::new(LinuxWindowState::new(
options,
&self.xcb_connection,
self.x_root_index,
@@ -228,7 +228,7 @@ impl Platform for LinuxPlatform {
self.state
.lock()
.windows
.insert(x_window, Arc::clone(&window_ptr));
.insert(x_window, Rc::clone(&window_ptr));
Box::new(LinuxWindow(window_ptr))
}
+3 -3
View File
@@ -77,7 +77,7 @@ pub(crate) struct LinuxWindowState {
}
#[derive(Clone)]
pub(crate) struct LinuxWindow(pub(crate) Arc<LinuxWindowState>);
pub(crate) struct LinuxWindow(pub(crate) Rc<LinuxWindowState>);
//todo!(linux): Remove other RawWindowHandle implementation
unsafe impl blade_rwh::HasRawWindowHandle for RawWindow {
@@ -191,7 +191,7 @@ impl LinuxWindowState {
//Warning: it looks like this reported size is immediately invalidated
// on some platforms, followed by a "ConfigureNotify" event.
let gpu_extent = query_render_extent(&xcb_connection, x_window);
let gpu_extent = query_render_extent(xcb_connection, x_window);
let raw = RawWindow {
connection: as_raw_xcb_connection::AsRawXcbConnection::as_raw_xcb_connection(
@@ -430,6 +430,6 @@ impl PlatformWindow for LinuxWindow {
}
fn set_graphics_profiler_enabled(&self, enabled: bool) {
todo!("linux")
unimplemented!("linux")
}
}