Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Doesn't build with 1.8.0 #3

Closed
steveklabnik opened this issue May 8, 2016 · 5 comments
Closed

Doesn't build with 1.8.0 #3

steveklabnik opened this issue May 8, 2016 · 5 comments

Comments

@steveklabnik
Copy link
Contributor

$ rustc --version
rustc 1.8.0 (db2939409 2016-04-11)

errors:

src/macros.rs:99:127: 99:138 error: `$ret:ty` is followed by `$body:block`, which is not allowed for `ty` fragments
src/macros.rs:99     { $cls:ident; ($($mimpl:tt)*) ; ($($mdef:tt)*) ; def $name:ident( $self_arg:tt , $($arg:ident : $argty:ty),* ) -> $ret:ty $body:block $($rest:tt)* } => {
                                                                                                                                               ^~~~~~~~~~~

Any ideas?

@d-unsed
Copy link

d-unsed commented May 9, 2016

@steveklabnik, I had the same issue in Ruru when implementing method definitions.

This problem was solved with rust-lang/rfcs#1494 and rust-lang/rust#32945, but it's not included into 1.8.0. Thus I decided to use ident instead of ty temporarily, until 1.9 is released

@marianposaceanu
Copy link

@steveklabnik @d-unseductable made those changes in src/macros.rs and it now complies just fine:

    { $cls:ident; ($($mimpl:tt)*) ; ($($mdef:tt)*) ; def $name:ident( $self_arg:tt , $($arg:ident : $argty:ident),* ) -> $ret:ident $body:block $($rest:tt)* } => {
        class_definition! { $cls; ($($mimpl)*) ; ($($mdef)*) ; defn $name ; $self_arg ; ($($arg : $argty),*) ; $body ; $ret ; $($rest)*  }
    };

    { $cls:ident; ($($mimpl:tt)*) ; ($($mdef:tt)*) ; def $name:ident( $self_arg:tt , $($arg:ident : $argty:ident),* ) $body:block $($rest:tt)* } => {
        class_definition! { $cls; ($($mimpl)*) ; ($($mdef)*) ; defn $name ; $self_arg ; ($($arg : $argty),*) ; $body ; () ; $($rest)*  }
    };

also the examples and specs are running just fine

@chancancode
Copy link
Member

👍 thank you for investigating! Mind opening a PR with those changes to the macros (or just update the README to require nightly for now)?

steveklabnik added a commit to steveklabnik/helix that referenced this issue Jun 19, 2016
@chancancode chancancode reopened this Jun 24, 2016
@chancancode
Copy link
Member

I had to revert the fix because it doesn't seem to work with types like &[usize] in the membership example. It doesn't look like this was fixed in 1.9, but it seems to work in beta. So I think we will need to require 1.10, is that correct?

@steveklabnik
Copy link
Contributor Author

Yeah, beta will be 1.10.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants