Skip to content

Commit

Permalink
Revert "Revert "treewide: Bump rust version to nightly-2023-12-28""
Browse files Browse the repository at this point in the history
This reverts commit bde05974330a69526f06f1fbcafab925064cd659.

Change-Id: I56b71ed96e508ac617579ca1d0e181a1387671f1
  • Loading branch information
ethowitz committed Apr 25, 2024
1 parent 91f7145 commit 54932c6
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 38 deletions.
22 changes: 11 additions & 11 deletions array2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -85,11 +84,16 @@ impl<T> Array2<T> {
/// passed an empty vector or if the rows are a different size.
#[inline]
pub fn try_from_rows(rows: Vec<Vec<T>>) -> Result<Self> {
#[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,
Expand Down Expand Up @@ -199,9 +203,7 @@ impl<T> Array2<T> {
/// );
/// ```
#[inline]
pub fn rows(
&self,
) -> impl Iterator<Item = &[T]> + ExactSizeIterator + DoubleEndedIterator + '_ {
pub fn rows(&self) -> impl ExactSizeIterator<Item = &[T]> + DoubleEndedIterator + '_ {
self.cells.chunks(self.row_size)
}

Expand All @@ -220,7 +222,7 @@ impl<T> Array2<T> {
/// )
/// ```
#[inline]
pub fn entries(&self) -> impl Iterator<Item = ((usize, usize), &T)> + ExactSizeIterator + '_ {
pub fn entries(&self) -> impl ExactSizeIterator<Item = ((usize, usize), &T)> + '_ {
self.cells.iter().enumerate().map(move |(i, v)| {
let row = i.div_floor(self.row_size);
let col = i % self.row_size;
Expand All @@ -243,9 +245,7 @@ impl<T> Array2<T> {
/// assert_eq!(my_array2, Array2::from_rows(vec![vec![1, 3], vec![4, 6]]))
/// ```
#[inline]
pub fn entries_mut(
&mut self,
) -> impl Iterator<Item = ((usize, usize), &mut T)> + ExactSizeIterator + '_ {
pub fn entries_mut(&mut self) -> impl ExactSizeIterator<Item = ((usize, usize), &mut T)> + '_ {
let row_size = self.row_size;
self.cells.iter_mut().enumerate().map(move |(i, v)| {
let row = i.div_floor(row_size);
Expand All @@ -270,7 +270,7 @@ impl<T> Array2<T> {
/// )
/// ```
#[inline]
pub fn into_entries(self) -> impl Iterator<Item = ((usize, usize), T)> + ExactSizeIterator {
pub fn into_entries(self) -> impl ExactSizeIterator<Item = ((usize, usize), T)> {
self.cells
.into_vec()
.into_iter()
Expand Down
6 changes: 0 additions & 6 deletions nom-sql/src/sql_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,6 @@ impl std::borrow::Borrow<str> 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)]
Expand Down
1 change: 1 addition & 0 deletions readyset-alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion readyset-clustertest/src/readyset_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ async fn views_synchronize_between_deployments() {

// Eventually it should show up in adapter 1 too
eventually! {
adapter_1.as_mysql_conn().unwrap().query_drop("SELECT * FROM t1;");
adapter_1.as_mysql_conn().unwrap().query_drop("SELECT * FROM t1;").await.unwrap();
last_statement_destination(adapter_1.as_mysql_conn().unwrap()).await == QueryDestination::Readyset
}

Expand Down
10 changes: 4 additions & 6 deletions readyset-mir/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion readyset-tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 8 additions & 6 deletions replicators/src/mysql_connector/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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(
Expand All @@ -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");
Expand Down
14 changes: 8 additions & 6 deletions replicators/src/postgres_connector/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -809,8 +809,9 @@ impl<'a> PostgresReplicator<'a> {
))
.map_ok(|_| create_table)
})
.await
{
.await;

match res {
Ok(create_table) => {
tables.push(create_table);
}
Expand All @@ -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| {
Expand All @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-11-09
nightly-2023-12-28

0 comments on commit 54932c6

Please sign in to comment.