Skip to content

Commit

Permalink
fix(pilota-build): don't derive eq for nested list double (#292)
Browse files Browse the repository at this point in the history
* fix(pilota-build): don't derive eq for nested list double

* chore: use stable toolchain for ci
  • Loading branch information
Millione authored Dec 11, 2024
1 parent f6859a9 commit 47c136c
Show file tree
Hide file tree
Showing 7 changed files with 1,081 additions and 879 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI'
name: "CI"
on:
pull_request:
push:
Expand Down Expand Up @@ -26,22 +26,22 @@ jobs:
runs-on: [self-hosted, X64]

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
# test-linux-aarch64:
# runs-on: [self-hosted, arm]

# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@nightly
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: rustfmt, clippy
# # - uses: Swatinem/rust-cache@v1
Expand All @@ -54,29 +54,29 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
test-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
lint:
runs-on: [self-hosted, X64]
Expand All @@ -87,14 +87,14 @@ jobs:
- nightly

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format check
run: |
cargo fmt -- --check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format check
run: |
cargo fmt -- --check
2 changes: 1 addition & 1 deletion 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 pilota-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-build"
version = "0.11.27"
version = "0.11.28"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand Down
16 changes: 8 additions & 8 deletions pilota-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ where
cx.exec_plugin(AutoDerivePlugin::new(
Arc::from(["#[derive(PartialOrd)]".into()]),
|ty| {
let ty = match &ty.kind {
ty::Vec(ty) => ty,
_ => ty,
};
let mut ty = ty;
while let ty::Vec(_ty) = &ty.kind {
ty = _ty;
}
if matches!(ty.kind, ty::Map(_, _) | ty::Set(_)) {
PredicateResult::No
} else {
Expand All @@ -393,10 +393,10 @@ where
cx.exec_plugin(AutoDerivePlugin::new(
Arc::from(["#[derive(Hash, Eq, Ord)]".into()]),
|ty| {
let ty = match &ty.kind {
ty::Vec(ty) => ty,
_ => ty,
};
let mut ty = ty;
while let ty::Vec(_ty) = &ty.kind {
ty = _ty;
}
if matches!(ty.kind, ty::Map(_, _) | ty::Set(_) | ty::F64 | ty::F32) {
PredicateResult::No
} else {
Expand Down
7 changes: 1 addition & 6 deletions pilota-build/src/middle/context.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use std::{
collections::{HashMap, HashSet},
ops::Deref,
path::PathBuf,
sync::Arc,
};
use std::{collections::HashMap, ops::Deref, path::PathBuf, sync::Arc};

use anyhow::Context as _;
use dashmap::DashMap;
Expand Down
Loading

0 comments on commit 47c136c

Please sign in to comment.