Comments (3)
I have a minimal example. How should I upload it?
from rust.
I prefer code blocks in issue comments like you did above. Even if it's multiple files, then at least it doesn't rely on a commit staying around in someone's repo.
from rust.
While trying to simplify the proc-macro, I think I figured out what is going on. The issue is the following line in the proc-macro above:
quote_spanned! {f.span()=> crate::BitwiseEq::bitwise_eq(&self.#index, &other.#index) }
When I changed quote_spanned!
to quote!
, it works. The f.span()
refers to the i32
token in impl_bitwise5!(Wrap5, i32);
. When he compiler sees the self
in the expanded code, and the span for which is outside the macro_rules
, it seems to be looking for self
outside the macro_rules!
call-site and errors out.
I don't fully understand how spans interact with macro hygiene, but it makes sense for the compiler to show some kind of error. But the error was very confusing.
Anyways, I know how to fix my code. I'll close this issue.
Thanks for looking into it!
from rust.
Related Issues (20)
- ICE: cannot convert `ReEarlyParam(DefId(0:11 ~ crash[8cfd]::{impl#0}::y::{opaque#0}::'_), 3, '_)` to a region vid HOT 1
- generic_const_exprs: internal compiler error
- Occasional memory leak in mpsc channels HOT 2
- ICE: `FloatToFloat/FloatToInt cast: source type usize is not a float type` HOT 1
- "--emit asm" uses different syntax than `asm!` HOT 1
- "asm_sub_register" could provide a bit more helpful information HOT 1
- windows: `TcpStream::shutdown` does not wake up blocking reads HOT 1
- ICE: `tried to select method from HRTB with non-lifetime bound vars` HOT 1
- ICE: async_fn_traits - error performing ParamEnvAnd when moving non-Copy value to async closure HOT 1
- Waker::will_wake() broken on nightly HOT 3
- Borrow checker fails to pick up existing region bounds in the environment when aliases are given to assoicated types in trait bounds. HOT 1
- regression: parameter type may not live long enough HOT 4
- regression: NonZero is ambiguous HOT 5
- regression: from_raw_parts is ambiguous HOT 5
- regression: visibility qualifiers are not permitted HOT 4
- regression: let-else syntax restriction (right curly brace not allowed) HOT 8
- regression: encountered mutable pointer in final value when "outer scope" rule applies in const/static with interior mutability HOT 26
- regression: no rules expected the token `.` HOT 3
- ICE: `value ScalarPair(...) cannot be written into local with type &MySlice<[bool]>` HOT 1
- ICE: `range end index 1 out of range for slice of length 0` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.