From 3715a08c461574e520e1c0aa58c353ad595005a7 Mon Sep 17 00:00:00 2001 From: Ethan Donowitz Date: Thu, 25 Apr 2024 11:10:26 -0400 Subject: [PATCH] Revert "Revert "treewide: Bump rust version to nightly-2023-12-28"" This reverts commit bde05974330a69526f06f1fbcafab925064cd659. Change-Id: I56b71ed96e508ac617579ca1d0e181a1387671f1 --- array2/src/lib.rs | 22 +++++++++---------- nom-sql/src/sql_identifier.rs | 6 ----- readyset-alloc/src/lib.rs | 1 + readyset-mir/src/graph.rs | 10 ++++----- readyset-tracing/src/lib.rs | 1 - replicators/src/mysql_connector/snapshot.rs | 14 +++++++----- .../src/postgres_connector/snapshot.rs | 14 +++++++----- rust-toolchain | 2 +- 8 files changed, 33 insertions(+), 37 deletions(-) diff --git a/array2/src/lib.rs b/array2/src/lib.rs index e8e76a8d67..8ec5b6fce5 100644 --- a/array2/src/lib.rs +++ b/array2/src/lib.rs @@ -20,9 +20,8 @@ //! Internally, values are stored in a single continuous allocation row-first, alongside the length //! of the row. -#![feature(core_intrinsics, int_roundings)] +#![feature(int_roundings)] use std::fmt::Debug; -use std::intrinsics::unlikely; use std::ops::{Index, IndexMut}; use std::usize; @@ -85,11 +84,16 @@ impl Array2 { /// passed an empty vector or if the rows are a different size. #[inline] pub fn try_from_rows(rows: Vec>) -> Result { + #[cold] + fn not_equal(x: usize, y: usize) -> bool { + x != y + } + let row_size = rows.first().ok_or(Error::Empty)?.len(); let mut elems = Vec::with_capacity(row_size * rows.len()); for (row_index, row) in rows.into_iter().enumerate() { - if unlikely(row.len() != row_size) { + if not_equal(row.len(), row_size) { return Err(Error::InconsistentRowSize { row_index, row_size, @@ -199,9 +203,7 @@ impl Array2 { /// ); /// ``` #[inline] - pub fn rows( - &self, - ) -> impl Iterator + ExactSizeIterator + DoubleEndedIterator + '_ { + pub fn rows(&self) -> impl ExactSizeIterator + DoubleEndedIterator + '_ { self.cells.chunks(self.row_size) } @@ -220,7 +222,7 @@ impl Array2 { /// ) /// ``` #[inline] - pub fn entries(&self) -> impl Iterator + ExactSizeIterator + '_ { + pub fn entries(&self) -> impl ExactSizeIterator + '_ { self.cells.iter().enumerate().map(move |(i, v)| { let row = i.div_floor(self.row_size); let col = i % self.row_size; @@ -243,9 +245,7 @@ impl Array2 { /// assert_eq!(my_array2, Array2::from_rows(vec![vec![1, 3], vec![4, 6]])) /// ``` #[inline] - pub fn entries_mut( - &mut self, - ) -> impl Iterator + ExactSizeIterator + '_ { + pub fn entries_mut(&mut self) -> impl ExactSizeIterator + '_ { let row_size = self.row_size; self.cells.iter_mut().enumerate().map(move |(i, v)| { let row = i.div_floor(row_size); @@ -270,7 +270,7 @@ impl Array2 { /// ) /// ``` #[inline] - pub fn into_entries(self) -> impl Iterator + ExactSizeIterator { + pub fn into_entries(self) -> impl ExactSizeIterator { self.cells .into_vec() .into_iter() diff --git a/nom-sql/src/sql_identifier.rs b/nom-sql/src/sql_identifier.rs index 36038b26ac..5b7bd4002b 100644 --- a/nom-sql/src/sql_identifier.rs +++ b/nom-sql/src/sql_identifier.rs @@ -307,12 +307,6 @@ impl std::borrow::Borrow for SqlIdentifier { } } -impl std::borrow::Borrow<[u8]> for SqlIdentifier { - fn borrow(&self) -> &[u8] { - self.as_ref() - } -} - impl PartialOrd for SqlIdentifier { #[inline] #[allow(clippy::non_canonical_partial_ord_impl)] diff --git a/readyset-alloc/src/lib.rs b/readyset-alloc/src/lib.rs index 66baa0f72e..747429a50d 100644 --- a/readyset-alloc/src/lib.rs +++ b/readyset-alloc/src/lib.rs @@ -59,6 +59,7 @@ #![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(custom_test_frameworks))] #![cfg_attr(test, test_runner(runner::run_env_conditional_tests))] +#![allow(internal_features)] #![feature(core_intrinsics)] #[macro_use] diff --git a/readyset-mir/src/graph.rs b/readyset-mir/src/graph.rs index 4c001cc191..d55fd59371 100644 --- a/readyset-mir/src/graph.rs +++ b/readyset-mir/src/graph.rs @@ -378,12 +378,10 @@ impl MirGraph { }, // otherwise, just look up in the column set // Compare by name if there is no table - _ => match { - if c.table.is_none() { - self.columns(node).iter().position(|cc| cc.name == c.name) - } else { - self.columns(node).iter().position(|cc| cc == c) - } + _ => match if c.table.is_none() { + self.columns(node).iter().position(|cc| cc.name == c.name) + } else { + self.columns(node).iter().position(|cc| cc == c) } { Some(id) => Ok(id), None => err, diff --git a/readyset-tracing/src/lib.rs b/readyset-tracing/src/lib.rs index 7e5f1a25ae..5170c72b59 100644 --- a/readyset-tracing/src/lib.rs +++ b/readyset-tracing/src/lib.rs @@ -15,7 +15,6 @@ //! [presampling](presampled) - sampling spans at creation time rather than when a subscriber would //! send them to a collector. -#![feature(core_intrinsics)] use std::fs::File; use std::path::{Path, PathBuf}; use std::sync::Arc; diff --git a/replicators/src/mysql_connector/snapshot.rs b/replicators/src/mysql_connector/snapshot.rs index 89f0ac2199..cb5bfa5498 100644 --- a/replicators/src/mysql_connector/snapshot.rs +++ b/replicators/src/mysql_connector/snapshot.rs @@ -204,7 +204,7 @@ impl MySqlReplicator { let mut bad_tables = Vec::new(); // Process `CREATE TABLE` statements for (db, table) in replicated_tables.iter() { - match create_for_table(&mut tx, db, table, TableKind::BaseTable) + let res = create_for_table(&mut tx, db, table, TableKind::BaseTable) .map_err(|e| e.into()) .and_then(|create_table| { debug!(%create_table, "Extending recipe"); @@ -222,8 +222,9 @@ impl MySqlReplicator { changelist.with_schema_search_path(vec![db.clone().into()]), ) }) - .await - { + .await; + + match res { Ok(_) => {} Err(error) => { warn!(%error, "Error extending CREATE TABLE, table will not be used"); @@ -256,7 +257,7 @@ impl MySqlReplicator { // Process `CREATE VIEW` statements for (db, view) in all_views.iter() { - match create_for_table(&mut tx, db, view, TableKind::View) + let res = create_for_table(&mut tx, db, view, TableKind::View) .map_err(|e| e.into()) .and_then(|create_view| { db_schemas.extend_create_schema_for_view( @@ -272,8 +273,9 @@ impl MySqlReplicator { changelist.with_schema_search_path(vec![db.clone().into()]), ) }) - .await - { + .await; + + match res { Ok(_) => {} Err(error) => { warn!(%view, %error, "Error extending CREATE VIEW, view will not be used"); diff --git a/replicators/src/postgres_connector/snapshot.rs b/replicators/src/postgres_connector/snapshot.rs index d2c822a405..70b2c05c47 100644 --- a/replicators/src/postgres_connector/snapshot.rs +++ b/replicators/src/postgres_connector/snapshot.rs @@ -774,7 +774,7 @@ impl<'a> PostgresReplicator<'a> { let mut tables = Vec::with_capacity(table_list.len()); for table in table_list { let table_name = &table.name.clone().to_string(); - match table + let res = table .get_table(get_transaction!(self)) .and_then(|create_table| { future::ready( @@ -809,8 +809,9 @@ impl<'a> PostgresReplicator<'a> { )) .map_ok(|_| create_table) }) - .await - { + .await; + + match res { Ok(create_table) => { tables.push(create_table); } @@ -836,7 +837,7 @@ impl<'a> PostgresReplicator<'a> { let view_name = view.name.clone(); let view_schema = view.schema.clone(); - match view + let res = view .get_create_view(get_transaction!(self)) .map_err(|e| e.into()) .and_then(|create_view| { @@ -856,8 +857,9 @@ impl<'a> PostgresReplicator<'a> { .with_schema_search_path(vec![view_schema.clone().into()]), ) }) - .await - { + .await; + + match res { Ok(_) => {} Err(error) => { warn!( diff --git a/rust-toolchain b/rust-toolchain index fac9292f1d..0e2ac63c79 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-11-09 +nightly-2023-12-28