Skip to content

Commit

Permalink
Update to rust 1.62
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Jul 1, 2022
1 parent 36ddab7 commit 31eb9b5
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 26 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.61-bullseye as builder
FROM rust:1.62-bullseye as builder

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.learn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.61-bullseye as builder
FROM rust:1.62-bullseye as builder

RUN cargo install --features=ssl websocat

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.61-bullseye as builder
FROM rust:1.62-bullseye as builder

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ docker exec -it fa7e3b4cec86 sh
If you are not comfortable with managing library packages on your system or don't have experience with, please use the Docker image provided above.

For local builds, tremor requires rust 2021 (version `1.61` or later), along with all the tools needed to build rust programs. Eg: for CentOS, the packages `gcc`, `make`, `cmake`, `clang`, `openssl`, and `libstdc++` are required. For different distributions or operating systems, please install the packages accordingly.
For local builds, tremor requires rust 2021 (version `1.62` or later), along with all the tools needed to build rust programs. Eg: for CentOS, the packages `gcc`, `make`, `cmake`, `clang`, `openssl`, and `libstdc++` are required. For different distributions or operating systems, please install the packages accordingly.
**NOTE** AVX2, SSE4.2 or NEON are needed to build [simd-json](https://github.com/simd-lite/simd-json#cpu-target) used by tremor. So if you are building in vm, check which processor instruction are passed to it. Like `lscpu | grep Flags`
For a more detailed guide on local builds, please refer to the [tremor development docs](https://www.tremor.rs/community/development/quick-start).

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.61.0
1.62.0
1 change: 1 addition & 0 deletions tremor-cli/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ error_chain! {
YamlError(serde_yaml::Error) #[doc = "Error during yaml parsing"];
JsonError(simd_json::Error) #[doc = "Error during json parsing"];
Io(std::io::Error) #[doc = "Error during std::io"];
Fmt(std::fmt::Error) #[doc = "Error during std::fmt"];
FutureTimeoutError(async_std::future::TimeoutError) #[doc = "Error waiting for futures to complete"];
Globwalk(globwalk::GlobError) #[doc = "Glob walker error"];
SendError(std::sync::mpsc::SendError<String>);
Expand Down
6 changes: 3 additions & 3 deletions tremor-cli/src/test/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use super::TestConfig;
use crate::errors::{Error, Result};
use crate::test;
use crate::test::stats;
use crate::test::status;
use crate::{env, report};
use report::TestSuite;
use std::fmt::Write as _; // import without risk of name clashing
use std::io::Read;
use std::{collections::HashMap, path::Path};
use test::tag;
Expand All @@ -31,8 +33,6 @@ use tremor_script::{
NO_AGGRS,
};
use tremor_script::{ctx::EventContext, NO_CONSTS};

use super::TestConfig;
const EXEC_OPTS: ExecOpts = ExecOpts {
result_needed: true,
aggr: AggrType::Tick,
Expand Down Expand Up @@ -150,7 +150,7 @@ fn eval_suite_tests(
let success = if let Some(success) = value.as_bool() {
success
} else if let Some([expected, got]) = value.as_array().map(Vec::as_slice) {
info.push_str(&format!("{} != {}", expected, got));
write!(info, "{expected} != {got}")?;
false
} else {
false
Expand Down
2 changes: 2 additions & 0 deletions tremor-influx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
clippy::unnecessary_unwrap,
clippy::pedantic
)]
// TODO: remove this when https://github.com/rust-lang/rust-clippy/issues/9076 is fixed
#![allow(clippy::trait_duplication_in_bounds)]

mod decoder;
mod encoder;
Expand Down
8 changes: 4 additions & 4 deletions tremor-pipeline/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ macro_rules! op {
($factory:ident ($uid:ident, $node:ident) $constructor:block) => {
#[derive(Default)]
pub struct $factory {}
impl crate::op::InitializableOperator for $factory {
impl $crate::op::InitializableOperator for $factory {
fn node_to_operator(
&self,
$uid: tremor_common::ids::OperatorId,
$node: &crate::NodeConfig,
) -> crate::errors::Result<Box<dyn crate::op::Operator>> {
$node: &$crate::NodeConfig,
) -> $crate::errors::Result<Box<dyn $crate::op::Operator>> {
$constructor
}
}
impl $factory {
fn new() -> Self {
Self {}
}
pub fn new_boxed() -> Box<dyn crate::op::InitializableOperator> {
pub fn new_boxed() -> Box<dyn $crate::op::InitializableOperator> {
Box::new(Self::new())
}
}
Expand Down
4 changes: 2 additions & 2 deletions tremor-script/src/ast/base_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ macro_rules! impl_expr_exraw {
<Ex as Upable<'script>>::Target: Expression + 'script,
Ex: ExpressionRaw<'script> + 'script,
{
fn meta(&self) -> &crate::ast::NodeMeta {
fn meta(&self) -> &$crate::ast::NodeMeta {
&self.mid
}
}
Expand All @@ -47,7 +47,7 @@ macro_rules! impl_expr_exraw {
macro_rules! impl_expr_no_lt {
($name:ident) => {
impl BaseExpr for $name {
fn meta(&self) -> &crate::ast::NodeMeta {
fn meta(&self) -> &$crate::ast::NodeMeta {
&self.mid
}
}
Expand Down
2 changes: 1 addition & 1 deletion tremor-script/src/ast/node_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub trait BaseRef {
#[macro_export]
macro_rules! impl_fqn {
($struct:ident) => {
impl crate::ast::node_id::BaseRef for $struct<'_> {
impl $crate::ast::node_id::BaseRef for $struct<'_> {
fn fqn(&self) -> String {
self.node_id.fqn()
}
Expand Down
4 changes: 2 additions & 2 deletions tremor-script/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ fn is_test_start(ch: char) -> bool {
}

fn is_dec_digit(ch: char) -> bool {
ch.is_digit(10)
ch.is_ascii_digit()
}

fn is_hex(ch: char) -> bool {
ch.is_digit(16)
ch.is_ascii_hexdigit()
}

pub(crate) fn ident_to_token(ident: &str) -> Token {
Expand Down
2 changes: 2 additions & 0 deletions tremor-script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
clippy::unnecessary_unwrap,
clippy::pedantic
)]
// TODO: remove this when https://github.com/rust-lang/rust-clippy/issues/9076 is fixed
#![allow(clippy::trait_duplication_in_bounds)]

#[cfg(test)]
#[macro_use]
Expand Down
6 changes: 5 additions & 1 deletion tremor-value/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
clippy::unnecessary_unwrap,
clippy::pedantic
)]
#![deny(missing_docs)]
// We might want to revisit inline_always
#![allow(clippy::module_name_repetitions, clippy::inline_always)]
#![deny(missing_docs)]
// TODO: remove this when https://github.com/rust-lang/rust-clippy/issues/9076 is fixed
#![allow(clippy::trait_duplication_in_bounds)]
// TODO: remove this when https://github.com/rust-lang/rust-clippy/issues/8772 is fixed
#![allow(clippy::type_repetition_in_bounds)]
// Copyright 2020-2021, The Tremor Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
8 changes: 4 additions & 4 deletions tremor-value/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ impl<'value> Value<'value> {
/// Tries to get an element of an object as bytes
#[inline]
#[must_use]
pub fn get_bytes<Q: ?Sized>(&self, k: &Q) -> Option<&[u8]>
pub fn get_bytes<Q>(&self, k: &Q) -> Option<&[u8]>
where
Cow<'value, str>: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
Q: Hash + Eq + Ord + ?Sized,
{
self.get(k).and_then(Self::as_bytes)
}
Expand All @@ -341,10 +341,10 @@ impl<'value> Value<'value> {
/// is a string
#[inline]
#[must_use]
pub fn get_char<Q: ?Sized>(&self, k: &Q) -> Option<char>
pub fn get_char<Q>(&self, k: &Q) -> Option<char>
where
Cow<'value, str>: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
Q: Hash + Eq + Ord + ?Sized,
{
self.get(k).and_then(Self::as_char)
}
Expand Down

0 comments on commit 31eb9b5

Please sign in to comment.