diff --git a/gpui/src/app.rs b/gpui/src/app.rs index 9c96b41097..30783b35f5 100644 --- a/gpui/src/app.rs +++ b/gpui/src/app.rs @@ -29,7 +29,7 @@ use std::{ time::Duration, }; -pub trait Entity: 'static + Send + Sync { +pub trait Entity: 'static { type Event; fn release(&mut self, _: &mut MutableAppContext) {} @@ -1738,7 +1738,7 @@ impl Debug for Effect { } } -pub trait AnyModel: Send + Sync { +pub trait AnyModel { fn as_any(&self) -> &dyn Any; fn as_any_mut(&mut self) -> &mut dyn Any; fn release(&mut self, cx: &mut MutableAppContext); @@ -1761,7 +1761,7 @@ where } } -pub trait AnyView: Send + Sync { +pub trait AnyView { fn as_any(&self) -> &dyn Any; fn as_any_mut(&mut self) -> &mut dyn Any; fn release(&mut self, cx: &mut MutableAppContext); @@ -2515,6 +2515,9 @@ pub struct WeakModelHandle { model_type: PhantomData, } +unsafe impl Send for WeakModelHandle {} +unsafe impl Sync for WeakModelHandle {} + impl WeakModelHandle { fn new(model_id: usize) -> Self { Self { diff --git a/zed/src/chat_panel.rs b/zed/src/chat_panel.rs index ec9f3f486f..57c2e79bd6 100644 --- a/zed/src/chat_panel.rs +++ b/zed/src/chat_panel.rs @@ -1,9 +1,10 @@ use super::channel::{Channel, ChannelList}; -use gpui::{Entity, ModelHandle, View}; +use gpui::{elements::*, Entity, ModelHandle, View}; pub struct ChatPanel { channel_list: ModelHandle, active_channel: Option>, + messages: ListState, } pub enum Event {} diff --git a/zed/src/test.rs b/zed/src/test.rs index 3576681cd3..6c861a31e5 100644 --- a/zed/src/test.rs +++ b/zed/src/test.rs @@ -169,7 +169,7 @@ pub fn build_app_state(cx: &AppContext) -> Arc { pub struct Observer(PhantomData); -impl Entity for Observer { +impl Entity for Observer { type Event = (); } diff --git a/zed/src/workspace.rs b/zed/src/workspace.rs index e5f4c95495..35ed7fc467 100644 --- a/zed/src/workspace.rs +++ b/zed/src/workspace.rs @@ -192,7 +192,7 @@ pub trait ItemHandle: Send + Sync { fn downgrade(&self) -> Box; } -pub trait WeakItemHandle: Send + Sync { +pub trait WeakItemHandle { fn file<'a>(&'a self, cx: &'a AppContext) -> Option<&'a File>; fn add_view( &self, @@ -203,7 +203,7 @@ pub trait WeakItemHandle: Send + Sync { fn alive(&self, cx: &AppContext) -> bool; } -pub trait ItemViewHandle: Send + Sync { +pub trait ItemViewHandle { fn title(&self, cx: &AppContext) -> String; fn entry_id(&self, cx: &AppContext) -> Option<(usize, Arc)>; fn boxed_clone(&self) -> Box;