Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "treewide: Bump rust version to nightly-2023-12-28"" #1244

Open
wants to merge 14 commits into
base: Ie5faa100158fc80c906d8ad5cb897d8a02a07be9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .buildkite/pipeline.public-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ steps:
- export RUST_BACKTRACE=full
- cargo --locked run --bin readyset-logictest -- verify logictests
- cargo --locked run --bin readyset-logictest -- verify logictests/psql --database-type postgresql
- cargo --locked run --bin readyset-logictest -- verify logictests/mysql --database-type mysql
timeout_in_minutes: 60
depends_on:
- build-image
Expand Down
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
8 changes: 6 additions & 2 deletions data-generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ pub fn value_of_type(typ: &SqlType) -> DfValue {
// octets.
DfValue::ByteArray(Arc::new(vec![0u8]))
}
SqlType::Int(_) | SqlType::Int4 | SqlType::Serial => 1i32.into(),
SqlType::Int(_) | SqlType::MediumInt(_) | SqlType::Int4 | SqlType::Serial => 1i32.into(),
SqlType::BigInt(_) | SqlType::Int8 | SqlType::BigSerial => 1i64.into(),
SqlType::UnsignedInt(_) => 1u32.into(),
SqlType::UnsignedInt(_) | SqlType::UnsignedMediumInt(_) => 1u32.into(),
SqlType::UnsignedBigInt(_) => 1u64.into(),
SqlType::TinyInt(_) => 1i8.into(),
SqlType::UnsignedTinyInt(_) => 1u8.into(),
Expand Down Expand Up @@ -533,6 +533,8 @@ where
SqlType::UnsignedTinyInt(_) => rng.gen::<u8>().into(),
SqlType::SmallInt(_) | SqlType::Int2 => rng.gen::<i16>().into(),
SqlType::UnsignedSmallInt(_) => rng.gen::<u16>().into(),
SqlType::MediumInt(_) => rng.gen_range((-1i32 << 23)..(1i32 << 23)).into(),
SqlType::UnsignedMediumInt(_) => rng.gen_range(0..(1u32 << 24)).into(),
SqlType::Float | SqlType::Double => 1.5f64.try_into().unwrap(),
SqlType::Real => 1.5f32.try_into().unwrap(),
SqlType::Decimal(prec, scale) => {
Expand Down Expand Up @@ -660,6 +662,8 @@ pub fn unique_value_of_type(typ: &SqlType, idx: u32) -> DfValue {
SqlType::UnsignedTinyInt(_) => (idx).into(),
SqlType::SmallInt(_) | SqlType::Int2 => (idx as i16).into(),
SqlType::UnsignedSmallInt(_) => (idx as u16).into(),
SqlType::MediumInt(_) => (idx as i32).into(),
SqlType::UnsignedMediumInt(_) => (idx).into(),
SqlType::Float | SqlType::Double => (1.5 + idx as f64).try_into().unwrap(),
SqlType::Real => (1.5 + idx as f32).try_into().unwrap(),
SqlType::Decimal(prec, scale) => Decimal::new(clamp_digits(*prec as _), *scale as _).into(),
Expand Down
6 changes: 6 additions & 0 deletions dataflow-expression/src/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ fn mysql_type_conversion(left_ty: &DfType, right_ty: &DfType) -> DfType {
| DfType::UnsignedTinyInt
| DfType::SmallInt
| DfType::UnsignedSmallInt
| DfType::MediumInt
| DfType::UnsignedMediumInt
| DfType::Int
| DfType::UnsignedInt
| DfType::BigInt
Expand All @@ -479,6 +481,8 @@ fn mysql_type_conversion(left_ty: &DfType, right_ty: &DfType) -> DfType {
| DfType::UnsignedTinyInt
| DfType::SmallInt
| DfType::UnsignedSmallInt
| DfType::MediumInt
| DfType::UnsignedMediumInt
| DfType::Int
| DfType::UnsignedInt
| DfType::BigInt
Expand All @@ -503,6 +507,8 @@ fn mysql_type_conversion(left_ty: &DfType, right_ty: &DfType) -> DfType {
| DfType::UnsignedTinyInt
| DfType::SmallInt
| DfType::UnsignedSmallInt
| DfType::MediumInt
| DfType::UnsignedMediumInt
| DfType::Int
| DfType::UnsignedInt
| DfType::BigInt
Expand Down
Loading