From 201754c6c36552c7320bc2468035e580bfb9413b Mon Sep 17 00:00:00 2001 From: Michae Mauderer Date: Thu, 28 Oct 2021 09:25:10 +0100 Subject: [PATCH 1/3] Bump toolchain. --- .github/workflows/gui-ci.yml | 10 +++++----- run | 2 +- rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gui-ci.yml b/.github/workflows/gui-ci.yml index b942f42467..1d3e0b143f 100644 --- a/.github/workflows/gui-ci.yml +++ b/.github/workflows/gui-ci.yml @@ -114,7 +114,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-06-17 + toolchain: nightly-2021-10-22 override: true - name: Install Prettier run: npm install --save-dev --save-exact prettier @@ -148,7 +148,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-06-17 + toolchain: nightly-2021-10-22 override: true - name: Run tests (no WASM) run: node ./run test --no-wasm --skip-version-validation @@ -174,7 +174,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-06-17 + toolchain: nightly-2021-10-22 override: true - name: Install wasm-pack (macOS) env: @@ -233,7 +233,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-06-17 + toolchain: nightly-2021-10-22 override: true - name: Install wasm-pack (macOS) env: @@ -312,7 +312,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-06-17 + toolchain: nightly-2021-10-22 override: true - name: Install wasm-pack (macOS) env: diff --git a/run b/run index ae02cf07e3..89e4d3b312 100755 --- a/run +++ b/run @@ -19,7 +19,7 @@ async function init () { console.log("Checking versions of installed packages.") await cmd.check_version('node',node_lts_version) await cmd.check_version('npm',npm_lts_version) - await cmd.check_version('rustc','1.55.0-nightly',{ + await cmd.check_version('rustc','1.58.0-nightly',{ preprocess:(v)=>v.substring(6,20) }) } diff --git a/rust-toolchain b/rust-toolchain index 8398865b04..b62283c426 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-06-17 +nightly-2021-10-22 From 7d8f14bdcbd6f624d2d12b0961c5fc953b7ce187 Mon Sep 17 00:00:00 2001 From: Michae Mauderer Date: Thu, 28 Oct 2021 09:25:36 +0100 Subject: [PATCH 2/3] Update feature `min_type_alias_impl_trait` to `type_alias_impl_trait`. --- src/rust/ensogl/example/src/lib.rs | 2 +- src/rust/ensogl/lib/core/src/lib.rs | 2 +- src/rust/ide/lib/ast/impl/src/lib.rs | 2 +- src/rust/ide/lib/enso-protocol/src/lib.rs | 2 +- src/rust/ide/view/graph-editor/src/lib.rs | 2 +- src/rust/ide/view/src/lib.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rust/ensogl/example/src/lib.rs b/src/rust/ensogl/example/src/lib.rs index b31e365e02..6009567de7 100644 --- a/src/rust/ensogl/example/src/lib.rs +++ b/src/rust/ensogl/example/src/lib.rs @@ -9,7 +9,7 @@ #![feature(fn_traits)] #![feature(specialization)] #![feature(trait_alias)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(unboxed_closures)] #![allow(incomplete_features)] // To be removed, see: https://github.com/enso-org/ide/issues/1559 #![warn(missing_copy_implementations)] diff --git a/src/rust/ensogl/lib/core/src/lib.rs b/src/rust/ensogl/lib/core/src/lib.rs index da31080028..f254ba01f5 100644 --- a/src/rust/ensogl/lib/core/src/lib.rs +++ b/src/rust/ensogl/lib/core/src/lib.rs @@ -15,7 +15,7 @@ #![feature(specialization)] #![feature(trait_alias)] #![feature(marker_trait_attr)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(unboxed_closures)] #![allow(incomplete_features)] // To be removed, see: https://github.com/enso-org/ide/issues/1559 #![warn(missing_copy_implementations)] diff --git a/src/rust/ide/lib/ast/impl/src/lib.rs b/src/rust/ide/lib/ast/impl/src/lib.rs index bb57286036..590921caf1 100644 --- a/src/rust/ide/lib/ast/impl/src/lib.rs +++ b/src/rust/ide/lib/ast/impl/src/lib.rs @@ -2,7 +2,7 @@ #![feature(bool_to_option)] #![feature(generators, generator_trait)] #![feature(trivial_bounds)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #[warn(missing_docs)] pub mod assoc; diff --git a/src/rust/ide/lib/enso-protocol/src/lib.rs b/src/rust/ide/lib/enso-protocol/src/lib.rs index 8a7026f1ef..30ffe6db04 100644 --- a/src/rust/ide/lib/enso-protocol/src/lib.rs +++ b/src/rust/ide/lib/enso-protocol/src/lib.rs @@ -6,7 +6,7 @@ #![feature(associated_type_defaults)] #![feature(coerce_unsized)] #![feature(trait_alias)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![warn(missing_docs)] #![warn(trivial_casts)] #![warn(trivial_numeric_casts)] diff --git a/src/rust/ide/view/graph-editor/src/lib.rs b/src/rust/ide/view/graph-editor/src/lib.rs index cf35421025..6c6e722a92 100644 --- a/src/rust/ide/view/graph-editor/src/lib.rs +++ b/src/rust/ide/view/graph-editor/src/lib.rs @@ -11,7 +11,7 @@ #![feature(option_result_contains)] #![feature(specialization)] #![feature(trait_alias)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(unboxed_closures)] #![allow(incomplete_features)] // To be removed, see: https://github.com/enso-org/ide/issues/1559 #![warn(missing_copy_implementations)] diff --git a/src/rust/ide/view/src/lib.rs b/src/rust/ide/view/src/lib.rs index 9432b12ffd..25da53695b 100644 --- a/src/rust/ide/view/src/lib.rs +++ b/src/rust/ide/view/src/lib.rs @@ -11,7 +11,7 @@ #![feature(option_result_contains)] #![feature(specialization)] #![feature(trait_alias)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(unboxed_closures)] #![allow(incomplete_features)] // To be removed, see: https://github.com/enso-org/ide/issues/1559 #![warn(missing_copy_implementations)] From 729c8024f8ebf2b44cef88add212c01da0e7f3e7 Mon Sep 17 00:00:00 2001 From: Michae Mauderer Date: Thu, 28 Oct 2021 09:35:44 +0100 Subject: [PATCH 3/3] Fix new warnings. --- src/rust/ensogl/example/src/list_view.rs | 2 + .../lib/components/src/drop_down_menu.rs | 2 + src/rust/ensogl/lib/components/src/label.rs | 1 + .../display/shape/primitive/shader/canvas.rs | 4 +- src/rust/ensogl/lib/text/src/buffer/view.rs | 1 + .../lib/text/src/buffer/view/movement.rs | 2 +- src/rust/ide/lib/ast/impl/src/prefix.rs | 4 +- .../refactorings/collapse.rs | 1 + src/rust/ide/src/ide.rs | 1 + src/rust/ide/src/lib.rs | 1 + .../src/component/visualization/container.rs | 1 + src/rust/lib/frp/src/data/watch.rs | 1 + src/rust/lib/frp/src/debug.rs | 4 + src/rust/lib/frp/src/io/keyboard.rs | 3 + src/rust/lib/frp/src/nodes.rs | 79 +++++++++++++++---- 15 files changed, 87 insertions(+), 20 deletions(-) diff --git a/src/rust/ensogl/example/src/list_view.rs b/src/rust/ensogl/example/src/list_view.rs index e0552242cb..cff3fca205 100644 --- a/src/rust/ensogl/example/src/list_view.rs +++ b/src/rust/ensogl/example/src/list_view.rs @@ -40,7 +40,9 @@ pub fn entry_point_list_view() { #[derive(Clone,Debug)] struct MockEntries { + #[allow(dead_code)] logger : Logger, + #[allow(dead_code)] scene : Scene, entries_count : usize, } diff --git a/src/rust/ensogl/lib/components/src/drop_down_menu.rs b/src/rust/ensogl/lib/components/src/drop_down_menu.rs index 10e24f152d..48a7d85836 100644 --- a/src/rust/ensogl/lib/components/src/drop_down_menu.rs +++ b/src/rust/ensogl/lib/components/src/drop_down_menu.rs @@ -101,7 +101,9 @@ pub type Entry = list_view::entry::Label; #[derive(Clone,Debug)] struct Model { + #[allow(dead_code)] logger : Logger, + #[allow(dead_code)] app : Application, display_object : display::object::Instance, diff --git a/src/rust/ensogl/lib/components/src/label.rs b/src/rust/ensogl/lib/components/src/label.rs index 8e31f140bf..3fb46a1bcb 100644 --- a/src/rust/ensogl/lib/components/src/label.rs +++ b/src/rust/ensogl/lib/components/src/label.rs @@ -69,6 +69,7 @@ struct Model { background : background::View, label : text::Area, display_object : display::object::Instance, + #[allow(dead_code)] app : Application, style : StyleWatch, } diff --git a/src/rust/ensogl/lib/core/src/display/shape/primitive/shader/canvas.rs b/src/rust/ensogl/lib/core/src/display/shape/primitive/shader/canvas.rs index 415d47128a..aa5af7bb83 100644 --- a/src/rust/ensogl/lib/core/src/display/shape/primitive/shader/canvas.rs +++ b/src/rust/ensogl/lib/core/src/display/shape/primitive/shader/canvas.rs @@ -140,9 +140,7 @@ impl Canvas { /// Get the final GLSL code. pub fn to_glsl(&self) -> String { - if !self.current_function_lines.is_empty() { - panic!("Internal error. Not all canvas GLSL code lines were converted to functions."); - } + assert!(self.current_function_lines.is_empty(), "Internal error. Not all canvas GLSL code lines were converted to functions."); self.functions.join("\n\n") } } diff --git a/src/rust/ensogl/lib/text/src/buffer/view.rs b/src/rust/ensogl/lib/text/src/buffer/view.rs index 57a288a082..fd3050582a 100644 --- a/src/rust/ensogl/lib/text/src/buffer/view.rs +++ b/src/rust/ensogl/lib/text/src/buffer/view.rs @@ -47,6 +47,7 @@ pub struct History { #[derive(Debug,Clone,Default)] pub struct HistoryData { undo_stack : Vec<(Text,Style,selection::Group)>, + #[allow(dead_code)] redo_stack : Vec<(Text,Style,selection::Group)>, } diff --git a/src/rust/ensogl/lib/text/src/buffer/view/movement.rs b/src/rust/ensogl/lib/text/src/buffer/view/movement.rs index 5e960181eb..af8cfd23a7 100644 --- a/src/rust/ensogl/lib/text/src/buffer/view/movement.rs +++ b/src/rust/ensogl/lib/text/src/buffer/view/movement.rs @@ -112,7 +112,7 @@ impl ViewBuffer { pub fn moved_selection_region (&self, transform:Transform, selection:Selection, modify:bool) -> Selection { let text = &self.text(); - let shape = |start,end| selection::Shape(start,end); + let shape = selection::Shape; let shape : selection::Shape = match transform { Transform::All => { shape(default(),self.offset_to_location(text.byte_size())) diff --git a/src/rust/ide/lib/ast/impl/src/prefix.rs b/src/rust/ide/lib/ast/impl/src/prefix.rs index b486f53ac8..a107713879 100644 --- a/src/rust/ide/lib/ast/impl/src/prefix.rs +++ b/src/rust/ide/lib/ast/impl/src/prefix.rs @@ -95,9 +95,9 @@ impl Chain { /// App(App(a,b),c) into flat list where first element is the function and /// then arguments are placed: `{func:a, args:[b,c]}`. pub fn from_prefix(ast:&known::Prefix) -> Chain { - fn run(ast:&known::Prefix, mut acc: &mut Vec) -> Ast { + fn run(ast:&known::Prefix, acc: &mut Vec) -> Ast { let func = match known::Prefix::try_from(&ast.func) { - Ok(lhs_app) => run(&lhs_app, &mut acc), + Ok(lhs_app) => run(&lhs_app, acc), _ => ast.func.clone(), }; let sast = Shifted{wrapped:ast.arg.clone(),off:ast.off}; diff --git a/src/rust/ide/src/double_representation/refactorings/collapse.rs b/src/rust/ide/src/double_representation/refactorings/collapse.rs index 2f9fefa8df..804c74b565 100644 --- a/src/rust/ide/src/double_representation/refactorings/collapse.rs +++ b/src/rust/ide/src/double_representation/refactorings/collapse.rs @@ -182,6 +182,7 @@ pub struct Extracted { /// Nodes that are being collapsed and extracted into a separate method. extracted_nodes : Vec, /// Helper for efficient lookup. + #[allow(dead_code)] extracted_nodes_set : HashSet, } diff --git a/src/rust/ide/src/ide.rs b/src/rust/ide/src/ide.rs index f8345d3e88..8f86e7aa92 100644 --- a/src/rust/ide/src/ide.rs +++ b/src/rust/ide/src/ide.rs @@ -40,6 +40,7 @@ const ALIVE_LOG_INTERVAL_SEC:u64 = 60; #[derive(Debug)] pub struct Ide { application : Application, + #[allow(dead_code)] integration : Integration, network : frp::Network, } diff --git a/src/rust/ide/src/lib.rs b/src/rust/ide/src/lib.rs index 2e4af634a1..07f9e8ca30 100644 --- a/src/rust/ide/src/lib.rs +++ b/src/rust/ide/src/lib.rs @@ -77,6 +77,7 @@ pub mod prelude { pub use futures::task::LocalSpawnExt; pub use std::ops::Range; + pub use std::assert_matches::assert_matches; pub use utils::fail::FallibleResult; pub use utils::vec::VecExt; diff --git a/src/rust/ide/view/graph-editor/src/component/visualization/container.rs b/src/rust/ide/view/graph-editor/src/component/visualization/container.rs index 42525b8a25..3fad87b83f 100644 --- a/src/rust/ide/view/graph-editor/src/component/visualization/container.rs +++ b/src/rust/ide/view/graph-editor/src/component/visualization/container.rs @@ -155,6 +155,7 @@ ensogl::define_endpoints! { #[derive(Debug)] #[allow(missing_docs)] pub struct View { + #[allow(dead_code)] logger : Logger, display_object : display::object::Instance, diff --git a/src/rust/lib/frp/src/data/watch.rs b/src/rust/lib/frp/src/data/watch.rs index 866290eeb0..faf8e96ca7 100644 --- a/src/rust/lib/frp/src/data/watch.rs +++ b/src/rust/lib/frp/src/data/watch.rs @@ -80,6 +80,7 @@ pub struct Ref { /// The underlying type. #[shrinkwrap(main_field)] pub target : T, + #[allow(dead_code)] handle : Handle } diff --git a/src/rust/lib/frp/src/debug.rs b/src/rust/lib/frp/src/debug.rs index e7eca6dbb9..b42779c505 100644 --- a/src/rust/lib/frp/src/debug.rs +++ b/src/rust/lib/frp/src/debug.rs @@ -34,9 +34,12 @@ impl VizNode { /// Visualization data for a link between nodes. #[derive(Debug,Clone)] pub struct VizLink { + #[allow(dead_code)] source_display_id : usize, + #[allow(dead_code)] target_display_id : usize, // message_type : DataType, + #[allow(dead_code)] data_type : String, } @@ -55,6 +58,7 @@ impl VizLink { pub struct Graphviz { nodes : HashMap, labels : HashMap, + #[allow(dead_code)] links : Vec, } diff --git a/src/rust/lib/frp/src/io/keyboard.rs b/src/rust/lib/frp/src/io/keyboard.rs index 71ef0a2e5d..382acbbde8 100644 --- a/src/rust/lib/frp/src/io/keyboard.rs +++ b/src/rust/lib/frp/src/io/keyboard.rs @@ -385,8 +385,11 @@ impl Default for Keyboard { /// A handle of listener emitting events on bound FRP graph. #[derive(Debug)] pub struct DomBindings { + #[allow(dead_code)] key_down : Listener, + #[allow(dead_code)] key_up : Listener, + #[allow(dead_code)] blur : Listener, } diff --git a/src/rust/lib/frp/src/nodes.rs b/src/rust/lib/frp/src/nodes.rs index 0117cf8df8..d63b0378fc 100644 --- a/src/rust/lib/frp/src/nodes.rs +++ b/src/rust/lib/frp/src/nodes.rs @@ -878,6 +878,7 @@ impl IntoParam for &str {fn into_param(self) -> String {self #[derive(Debug)] pub struct SamplerData { + #[allow(dead_code)] src : Box, value : RefCell, /// Used to cache the output even if no connection is present YET. Consider the following @@ -935,7 +936,10 @@ impl stream::EventConsumer for OwnedSampler { // ============= #[derive(Clone,Debug)] -pub struct TraceData { src:T } +pub struct TraceData { + #[allow(dead_code)] + src:T +} pub type OwnedTrace = stream::Node >; pub type Trace = stream::WeakNode >; @@ -967,7 +971,11 @@ impl stream::EventConsumer> for OwnedTrace { // ============== #[derive(Debug)] -pub struct ToggleData { src:T, value:Cell } +pub struct ToggleData { + #[allow(dead_code)] + src:T, + value:Cell +} pub type OwnedToggle = stream::Node >; pub type Toggle = stream::WeakNode >; @@ -1005,7 +1013,11 @@ impl stream::EventConsumer> for OwnedToggle { // ============= #[derive(Debug)] -pub struct CountData { src:T, value:Cell } +pub struct CountData { + #[allow(dead_code)] + src:T, + value:Cell +} pub type OwnedCount = stream::Node >; pub type Count = stream::WeakNode >; @@ -1038,7 +1050,11 @@ impl stream::EventConsumer> for OwnedCount { // ================ #[derive(Debug)] -pub struct ConstantData { src:T, value:Out } +pub struct ConstantData { + #[allow(dead_code)] + src:T, + value:Out +} pub type OwnedConstant = stream::Node >; pub type Constant = stream::WeakNode >; @@ -1068,7 +1084,11 @@ impl stream::EventConsumer> for OwnedConstant< // ================ #[derive(Debug)] -pub struct PreviousData { src:T, previous:RefCell> } +pub struct PreviousData { + #[allow(dead_code)] + src:T, + previous:RefCell> +} pub type OwnedPrevious = stream::Node >; pub type Previous = stream::WeakNode >; @@ -1100,7 +1120,12 @@ impl stream::EventConsumer> for OwnedPrevious { // ============== #[derive(Debug)] -pub struct SampleData { behavior:watch::Ref, event:T2 } +pub struct SampleData { + #[allow(dead_code)] + behavior:watch::Ref, + #[allow(dead_code)] + event:T2 +} pub type OwnedSample = stream::Node >; pub type Sample = stream::WeakNode >; @@ -1137,7 +1162,11 @@ impl stream::InputBehaviors for SampleData { // ============ #[derive(Debug)] -pub struct GateData { event:T1, behavior:watch::Ref } +pub struct GateData { + #[allow(dead_code)] + event:T1, + behavior:watch::Ref +} pub type OwnedGate = stream::Node >; pub type Gate = stream::WeakNode >; @@ -1179,7 +1208,11 @@ where T2:EventOutput { // =============== #[derive(Debug)] -pub struct GateNotData { event:T1, behavior:watch::Ref } +pub struct GateNotData { + #[allow(dead_code)] + event:T1, + behavior:watch::Ref +} pub type OwnedGateNot = stream::Node >; pub type GateNot = stream::WeakNode >; @@ -1221,7 +1254,10 @@ impl stream::InputBehaviors for GateNotData // ============== #[derive(Debug)] -pub struct UnwrapData { src:T } +pub struct UnwrapData { + #[allow(dead_code)] + src:T +} pub type OwnedUnwrap = stream::Node >; pub type Unwrap = stream::WeakNode >; @@ -1454,7 +1490,10 @@ impl stream::EventConsumer for OwnedAny_ { // ============ #[derive(Debug)] -pub struct Get0Data { event:T1 } +pub struct Get0Data { + #[allow(dead_code)] + event:T1 +} pub type OwnedGet0 = stream::Node >; pub type Get0 = stream::WeakNode >; @@ -1493,7 +1532,10 @@ impl stream::InputBehaviors for Get0Data { // ============ #[derive(Debug)] -pub struct Get1Data { event:T1 } +pub struct Get1Data { + #[allow(dead_code)] + event:T1 +} pub type OwnedGet1 = stream::Node >; pub type Get1 = stream::WeakNode >; @@ -1532,7 +1574,10 @@ impl stream::InputBehaviors for Get1Data { // ============ #[derive(Debug)] -pub struct Get2Data { event:T1 } +pub struct Get2Data { + #[allow(dead_code)] + event:T1 +} pub type OwnedGet2 = stream::Node >; pub type Get2 = stream::WeakNode >; @@ -1571,7 +1616,10 @@ impl stream::InputBehaviors for Get2Data { // ============ #[derive(Debug)] -pub struct IterData { event:T1 } +pub struct IterData { + #[allow(dead_code)] + event:T1 +} pub type OwnedIter = stream::Node >; pub type Iter = stream::WeakNode >; @@ -1612,7 +1660,10 @@ impl stream::InputBehaviors for IterData { // ============ #[derive(Debug)] -pub struct FoldData { event:T1 } +pub struct FoldData { + #[allow(dead_code)] + event:T1 +} pub type OwnedFold = stream::Node >; pub type Fold = stream::WeakNode >;