Skip to content

Commit

Permalink
Merge pull request #3543 from weiznich/fix/quote_breaking_change
Browse files Browse the repository at this point in the history
Fix #3541
  • Loading branch information
weiznich authored Mar 13, 2023
2 parents eedc141 + 6c70a2e commit c96cdc2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Increasing the minimal supported Rust version will always be coupled at least wi

## Unreleased

## [diesel_derives 2.0.2] 2023-03-13

## Fixed

* Fixing the fallout of a breaking change from `quote` by not using their internal API

## [2.0.3] 2023-01-24

## Fixed
Expand Down Expand Up @@ -1982,3 +1988,4 @@ queries or set `PIPES_AS_CONCAT` manually.
[2.0.0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0
[2.0.1]: https://github.com/diesel-rs/diesel/compare/v.2.0.0...v2.0.1
[2.0.2]: https://github.com/diesel-rs/diesel/compare/v.2.0.1...v2.0.2
[diesel_derives 2.0.2]: https://github.com/diesel-rs/diesel/compare/v.2.0.2...diesel_derives_v2.0.2
2 changes: 1 addition & 1 deletion diesel_derives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel_derives"
version = "2.0.1"
version = "2.0.2"
license = "MIT OR Apache-2.0"
description = "You should not use this crate directly, it is internal to Diesel."
documentation = "https://diesel.rs/guides/"
Expand Down
8 changes: 3 additions & 5 deletions diesel_derives/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::fmt::{Display, Formatter};

use proc_macro2::{Span, TokenStream};
use proc_macro_error::ResultExt;
use quote::spanned::Spanned;
use quote::ToTokens;
use syn::parse::discouraged::Speculative;
use syn::parse::{Parse, ParseStream, Parser, Result};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::token::Comma;
use syn::{parenthesized, Attribute, Ident, LitBool, LitStr, Path, Type, TypePath};

Expand Down Expand Up @@ -141,7 +141,7 @@ impl Parse for FieldAttr {
}

impl Spanned for FieldAttr {
fn __span(&self) -> Span {
fn span(&self) -> Span {
match self {
FieldAttr::Embed(ident)
| FieldAttr::ColumnName(ident, _)
Expand Down Expand Up @@ -240,7 +240,7 @@ impl Parse for StructAttr {
}

impl Spanned for StructAttr {
fn __span(&self) -> Span {
fn span(&self) -> Span {
match self {
StructAttr::Aggregate(ident)
| StructAttr::NotSized(ident)
Expand All @@ -262,8 +262,6 @@ pub fn parse_attributes<T>(attrs: &[Attribute]) -> Vec<AttributeSpanWrapper<T>>
where
T: Parse + ParseDeprecated + Spanned,
{
use syn::spanned::Spanned;

attrs
.iter()
.flat_map(|attr| {
Expand Down
4 changes: 3 additions & 1 deletion diesel_tests/tests/select.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::schema::*;
#[cfg(not(feature = "mysql"))]
use crate::schema_dsl::*;
use diesel::*;

Expand Down Expand Up @@ -214,7 +215,8 @@ table! {
}
}

#[cfg(not(feature = "sqlite"))]
// the test is somehow broken on some mariadb versions
#[cfg(not(any(feature = "sqlite", feature = "mysql")))]
#[test]
fn select_for_update_locks_selected_rows() {
use self::users_select_for_update::dsl::*;
Expand Down

0 comments on commit c96cdc2

Please sign in to comment.