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

Doesn't build with 1.8.0 #3

Closed
Closed
@steveklabnik

Description

@steveklabnik
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?

Activity

d-unsed

d-unsed commented on May 9, 2016

@d-unsed

@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

marianposaceanu commented on May 24, 2016

@marianposaceanu

@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

chancancode commented on Jun 19, 2016

@chancancode
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)?

added a commit that references this issue on Jun 19, 2016
4a4e8cd
chancancode

chancancode commented on Jun 24, 2016

@chancancode
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

steveklabnik commented on Jun 24, 2016

@steveklabnik
ContributorAuthor

Yeah, beta will be 1.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@marianposaceanu@chancancode@d-unsed

        Issue actions

          Doesn't build with 1.8.0 · Issue #3 · tildeio/helix