Skip to content

Commit

Permalink
chore: update rust to 1.83.0 (#5068)
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln authored Dec 2, 2024
1 parent d6d59dd commit c74f897
Show file tree
Hide file tree
Showing 101 changed files with 194 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# it is a shortcut for `--lib --bins --tests --benches --examples`.
- run: |
cargo clippy --workspace --all-features --all-targets
cargo clippy --all-features --all-targets -p query-engine-wasm --target wasm32-unknown-unknown
cargo clippy --all-features --all-targets -p query-engine-wasm -p prisma-schema-build --target wasm32-unknown-unknown
rustfmt:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ build-schema-wasm:

# Emulate pedantic CI compilation.
pedantic:
RUSTFLAGS="-D warnings" cargo fmt -- --check && RUSTFLAGS="-D warnings" cargo clippy --all-targets
RUSTFLAGS="-D warnings" cargo fmt -- --check
RUSTFLAGS="-D warnings" cargo clippy --all-features --all-targets
RUSTFLAGS="-D warnings" cargo clippy --all-features --all-targets -p query-engine-wasm -p prisma-schema-build --target wasm32-unknown-unknown

release:
cargo build --release
Expand Down Expand Up @@ -391,7 +393,7 @@ test-driver-adapter-planetscale-wasm: test-planetscale-wasm
# Local dev commands #
######################

measure-qe-wasm: build-qe-wasm-gz
measure-qe-wasm: build-qe-wasm-gz
@cd query-engine/query-engine-wasm/pkg; \
for provider in postgresql mysql sqlite; do \
echo "$${provider}_size=$$(cat $$provider/query_engine_bg.wasm | wc -c | tr -d ' ')" >> $(ENGINE_SIZE_OUTPUT); \
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

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

1 change: 0 additions & 1 deletion libs/crosstarget-utils/src/common/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use derive_more::Display;

#[derive(Debug, Display)]
#[display(fmt = "Failed to spawn a future")]

pub struct SpawnError;

impl std::error::Error for SpawnError {}
2 changes: 1 addition & 1 deletion libs/prisma-value/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ where

struct BigDecimalVisitor;

impl<'de> serde::de::Visitor<'de> for BigDecimalVisitor {
impl serde::de::Visitor<'_> for BigDecimalVisitor {
type Value = BigDecimal;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion libs/sql-ddl/src/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct ForeignKey<'a> {
pub on_update: Option<ForeignKeyAction>,
}

impl<'a> Display for ForeignKey<'a> {
impl Display for ForeignKey<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(constraint_name) = &self.constraint_name {
write!(f, "CONSTRAINT `{constraint_name}` ")?;
Expand Down
4 changes: 2 additions & 2 deletions libs/sql-ddl/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ pub struct CreateEnum<'a> {
pub variants: Vec<Cow<'a, str>>,
}

impl<'a> Display for CreateEnum<'a> {
impl Display for CreateEnum<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CREATE TYPE {enum_name} AS ENUM (", enum_name = self.enum_name)?;
self.variants.iter().map(|s| StrLit(s)).join(", ", f)?;
Expand All @@ -349,7 +349,7 @@ pub struct CreateIndex<'a> {
pub using: Option<IndexAlgorithm>,
}

impl<'a> Display for CreateIndex<'a> {
impl Display for CreateIndex<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let using = match self.using {
Some(IndexAlgorithm::Hash) => " USING HASH ",
Expand Down
2 changes: 1 addition & 1 deletion libs/test-setup/src/test_api_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub struct DatasourceBlock<'a> {
preview_features: &'static [&'static str],
}

impl<'a> DatasourceBlock<'a> {
impl DatasourceBlock<'_> {
pub fn url(&self) -> &str {
self.url
}
Expand Down
2 changes: 0 additions & 2 deletions libs/user-facing-errors/src/query_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ pub struct MongoReplicaSetRequired {}
code = "P2032",
message = "Error converting field \"{field}\" of expected non-nullable type \"{expected_type}\", found incompatible value of \"{found}\"."
)]

pub struct MissingFieldsInModel {
pub field: String,
pub expected_type: String,
Expand All @@ -307,7 +306,6 @@ pub struct MissingFieldsInModel {

#[derive(Debug, UserFacingError, Serialize)]
#[user_facing(code = "P2033", message = "{details}")]

pub struct ValueFitError {
pub details: String,
}
Expand Down
2 changes: 1 addition & 1 deletion prisma-fmt/src/code_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::LSPContext;

pub(super) type CodeActionsContext<'a> = LSPContext<'a, CodeActionParams>;

impl<'a> CodeActionsContext<'a> {
impl CodeActionsContext<'_> {
pub(super) fn diagnostics(&self) -> &[Diagnostic] {
&self.params.context.diagnostics
}
Expand Down
2 changes: 1 addition & 1 deletion prisma-fmt/src/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{offsets::position_to_offset, LSPContext};

pub(super) type HoverContext<'a> = LSPContext<'a, HoverParams>;

impl<'a> HoverContext<'a> {
impl HoverContext<'_> {
pub(super) fn position(&self) -> Option<usize> {
let pos = self.params.text_document_position_params.position;
let initiating_doc = self.initiating_file_source();
Expand Down
2 changes: 1 addition & 1 deletion psl/parser-database/src/types/index_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub(crate) enum OperatorClass<'a> {
Raw(&'a str),
}

impl<'a> From<crate::OperatorClass> for OperatorClass<'a> {
impl From<crate::OperatorClass> for OperatorClass<'_> {
fn from(inner: crate::OperatorClass) -> Self {
Self::Constant(inner)
}
Expand Down
2 changes: 1 addition & 1 deletion psl/parser-database/src/walkers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<'db, I> Walker<'db, I> {
}
}

impl<'db, I> PartialEq for Walker<'db, I>
impl<I> PartialEq for Walker<'_, I>
where
I: PartialEq,
{
Expand Down
16 changes: 8 additions & 8 deletions psl/parser-database/src/walkers/relation_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub enum RelationName<'db> {
Generated(String),
}

impl<'db> PartialEq for RelationName<'db> {
impl PartialEq for RelationName<'_> {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Explicit(l0), Self::Explicit(r0)) => l0 == r0,
Expand All @@ -188,9 +188,9 @@ impl<'db> PartialEq for RelationName<'db> {
}
}

impl<'db> Eq for RelationName<'db> {}
impl Eq for RelationName<'_> {}

impl<'db> Ord for RelationName<'db> {
impl Ord for RelationName<'_> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
match (self, other) {
(Self::Explicit(l0), Self::Explicit(r0)) => l0.cmp(r0),
Expand All @@ -201,13 +201,13 @@ impl<'db> Ord for RelationName<'db> {
}
}

impl<'db> PartialOrd for RelationName<'db> {
impl PartialOrd for RelationName<'_> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

impl<'db> std::hash::Hash for RelationName<'db> {
impl std::hash::Hash for RelationName<'_> {
fn hash<H: Hasher>(&self, state: &mut H) {
match self {
RelationName::Explicit(s) => s.hash(state),
Expand All @@ -216,7 +216,7 @@ impl<'db> std::hash::Hash for RelationName<'db> {
}
}

impl<'db> RelationName<'db> {
impl RelationName<'_> {
pub(crate) fn generated(model_a: &str, model_b: &str) -> Self {
if model_a < model_b {
Self::Generated(format!("{model_a}To{model_b}"))
Expand All @@ -226,7 +226,7 @@ impl<'db> RelationName<'db> {
}
}

impl<'db> fmt::Display for RelationName<'db> {
impl fmt::Display for RelationName<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
RelationName::Explicit(s) => f.write_str(s),
Expand All @@ -235,7 +235,7 @@ impl<'db> fmt::Display for RelationName<'db> {
}
}

impl<'db> AsRef<str> for RelationName<'db> {
impl AsRef<str> for RelationName<'_> {
fn as_ref(&self) -> &str {
match self {
RelationName::Explicit(s) => s,
Expand Down
2 changes: 1 addition & 1 deletion psl/parser-database/src/walkers/scalar_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<'db> ScalarFieldWalker<'db> {
}
}

impl<'db> fmt::Display for ScalarFieldWalker<'db> {
impl fmt::Display for ScalarFieldWalker<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.name())
}
Expand Down
1 change: 0 additions & 1 deletion psl/psl-core/src/datamodel_connector/constraint_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl ConstraintNames {
/// excl for an Exclusion constraint
/// seq for sequences
///
pub fn primary_key_name(table_name: &str, connector: &dyn Connector) -> String {
let suffix = "_pkey";
let limit = connector.max_identifier_length();
Expand Down
2 changes: 1 addition & 1 deletion psl/psl-core/src/reformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct MagicReformatCtx<'a> {
db: &'a ParserDatabase,
}

impl<'a> MagicReformatCtx<'a> {
impl MagicReformatCtx<'_> {
fn add_missing_bit(&mut self, file_id: FileId, bit: MissingBit) {
self.missing_bits_map.entry(file_id).or_default().push(bit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'db> CompositeTypePath<'db> {
}
}

impl<'db> fmt::Display for CompositeTypePath<'db> {
impl fmt::Display for CompositeTypePath<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut traversed = vec![self.current];
let mut this = self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl<'db> ConstraintName<'db> {
}
}

impl<'db> AsRef<str> for ConstraintName<'db> {
impl AsRef<str> for ConstraintName<'_> {
fn as_ref(&self) -> &str {
match self {
ConstraintName::Index(x) => x,
Expand All @@ -232,7 +232,7 @@ impl<'db> AsRef<str> for ConstraintName<'db> {
}
}

impl<'db> Deref for ConstraintName<'db> {
impl Deref for ConstraintName<'_> {
type Target = str;

fn deref(&self) -> &Self::Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ pub(crate) fn primary_key_connector_specific(model: ModelWalker<'_>, ctx: &mut C
}

if primary_key.fields().len() > 1 && !ctx.has_capability(ConnectorCapability::CompoundIds) {
return ctx.push_error(DatamodelError::new_model_validation_error(
ctx.push_error(DatamodelError::new_model_validation_error(
"The current connector does not support compound ids.",
container_type,
model.name(),
primary_key.ast_attribute().span,
));
))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<'db> Fields<'db> {
}
}

impl<'db> fmt::Display for Fields<'db> {
impl fmt::Display for Fields<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut fields = self
.fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'db> VisitedRelation<'db> {
}
}

impl<'db> fmt::Display for VisitedRelation<'db> {
impl fmt::Display for VisitedRelation<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut traversed = self.iter().map(|relation| {
format!(
Expand Down
Loading

0 comments on commit c74f897

Please sign in to comment.