Devise icon indicating copy to clipboard operation
Devise copied to clipboard

Mismatching of `quote!` with `quote_spanned!` in some macros

Open jebrosen opened this issue 4 years ago • 2 comments

https://github.com/rust-lang/rust/pull/68716 would change the default for quote! from call_site to mixed_site. As expected there is some breakage, but it looks like the breakage caused by devise specifically is "legitimate" and caused by mismatching quote! with quote_spanned!. For example:

https://github.com/SergioBenitez/Devise/blob/c4f110f03f3d2cceb470981d87a5bbd50340ee84/codegen/src/lib.rs#L74

is in a quote_spanned! invocation, but

https://github.com/SergioBenitez/Devise/blob/c4f110f03f3d2cceb470981d87a5bbd50340ee84/codegen/src/lib.rs#L120

is in a quote! invocation.

My opinion is that these should be realigned such that quote! is used consistently for variables such as __list, which should work even after a switch to mixed_site.

jebrosen avatar Feb 08 '20 19:02 jebrosen

Clarification: https://github.com/rust-lang/rust/pull/68716 itself won't change the meaning of quote!, but the next version of quote may use Span::mixed_site by default once it's stabilized.

So this issue need to be addressed sometime before migrating devise to that hypothetical future version of quote rather than immediately.

petrochenkov avatar Feb 08 '20 19:02 petrochenkov

Ah - thanks for that clarification.

jebrosen avatar Feb 08 '20 19:02 jebrosen