Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Amethyst fails to compile on nightly due to Tuple Suffix #1492

Closed
piedoom opened this issue Mar 29, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@piedoom
Copy link

commented Mar 29, 2019

Description

Amethyst errors as of 1.35.0-nightly with the issue suffixes on a tuple index are invalid.

Reproduction Steps

  1. Compile a project using amethyst_renderer

Quick version:

error: suffixes on a tuple index are invalid
   --> C:\Users\doomy\.cargo\git\checkouts\amethyst-fedb0a1032a075ce\1a77ac4\amethyst_renderer\src\light.rs:188:50
    |
188 | #[derive(Default, Clone, Serialize, Deserialize, PrefabData)]
    |                                                  ^^^^^^^^^^ invalid suffix `usize`

error: proc-macro derive produced unparseable tokens
   --> C:\Users\doomy\.cargo\git\checkouts\amethyst-fedb0a1032a075ce\1a77ac4\amethyst_renderer\src\light.rs:188:50
    |
188 | #[derive(Default, Clone, Serialize, Deserialize, PrefabData)]
    |                                                  ^^^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile `amethyst_renderer`.

Verbose:

See gist

Your Environment

  1. OS: Windows 10
  2. Operating System Version: 10.0.17134 Build 17134
  3. Version of Amethyst: Master

@piedoom piedoom changed the title [BUG] Amethyst fails to compile on nightly [BUG] Amethyst fails to compile on nightly due to Tuple Suffix Mar 29, 2019

@johan-bjareholt

This comment has been minimized.

Copy link

commented Apr 1, 2019

Just updated my cargo nightly version and also get this issue now.
Seems like it's fixed though, so maybe we just need to wait for the next nightly version? rust-lang/rust#59418

@Patryk27

This comment has been minimized.

Copy link

commented Apr 2, 2019

@johan-bjareholt: Seems like the Rust compiler has been fixed and that's precisely the reason Amethyst fails to compile now - the error about tuple suffix was not thrown before only because there was a bug in the compiler.

rustup install nightly-2019-03-20 && rustup default nightly-2019-03-20 and the bug is "gone" again :-)

@azriel91

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

Could someone with a recent nightly run this:

cargo install cargo-expand
cd path/to/amethyst/amethyst_renderer
cargo expand light > /tmp/expanded.rs

I'd like to see the output of expanded.rs. I've done it on an older nightly and there's no tuple suffix with usize, so maybe proc macro code has changed.

azriel91 added a commit to azriel91/amethyst that referenced this issue Apr 4, 2019

azriel91 added a commit to azriel91/amethyst that referenced this issue Apr 4, 2019

@azriel91 azriel91 referenced this issue Apr 4, 2019

Merged

Bugfix/prefab data derive tuple suffix #1501

4 of 4 tasks complete

bors bot added a commit that referenced this issue Apr 5, 2019

Merge #1501
1501: Bugfix/prefab data derive tuple suffix r=torkleyy,jojolepro a=azriel91

## Description

Fixes #1492. Use `proc_macro2::Literal::usize_unsuffixed` in `PrefabData` quoted tokens.

## PR Checklist

By placing an x in the boxes I certify that I have:

- [x] Ran `cargo test --all` locally if this modified any rs files.
- [x] Ran `cargo +stable fmt --all` locally if this modified any rs files.
- **n/a** Updated the content of the book if this PR would make the book outdated.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- **n/a** Added unit tests for new APIs if any were added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.


Co-authored-by: Azriel Hoh <azriel91@gmail.com>

bors bot added a commit that referenced this issue Apr 5, 2019

Merge #1501
1501: Bugfix/prefab data derive tuple suffix r=torkleyy,jojolepro a=azriel91

## Description

Fixes #1492. Use `proc_macro2::Literal::usize_unsuffixed` in `PrefabData` quoted tokens.

## PR Checklist

By placing an x in the boxes I certify that I have:

- [x] Ran `cargo test --all` locally if this modified any rs files.
- [x] Ran `cargo +stable fmt --all` locally if this modified any rs files.
- **n/a** Updated the content of the book if this PR would make the book outdated.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- **n/a** Added unit tests for new APIs if any were added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.


Co-authored-by: Azriel Hoh <azriel91@gmail.com>

@bors bors bot closed this in #1501 Apr 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.