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

FTBFS on 1.26.0-nightly (80785a547 2018-03-30) #218

Closed
kivikakk opened this issue Mar 31, 2018 · 6 comments
Closed

FTBFS on 1.26.0-nightly (80785a547 2018-03-30) #218

kivikakk opened this issue Mar 31, 2018 · 6 comments

Comments

@kivikakk
Copy link
Contributor

Hey there,

meta currently fails to build from source on nightly:

$ cargo build
   Compiling pest_meta v2.0.0 (file:///Users/kivikakk/Code/pest-parser/pest/meta)
error[E0518]: attribute should be applied to function
  --> meta/src/parser.rs:21:10
   |
21 | #[derive(Parser)]
   |          ^^^^^^ not a function

error: aborting due to previous error

For more information about this error, try `rustc --explain E0518`.
error: Could not compile `pest_meta`.

To learn more, run the command again with --verbose.

The pest_derive from crates.io it's using is 1.0.6.

E0158 appears to be #[inline(…)] applied to a non-function:

This error indicates that an `#[inline(..)]` attribute was incorrectly placed
on something other than a function or method.

I've tried looking at the generated code with --pretty=expanded and … well, there's a lot of inlines, and I can't easily find one that doesn't correspond with a fn or lambda.

I can't easily find a change in rustc itself that would've caused this … so I'm going to try manually bisecting by installing nightlies that correspond to changes in the relevant code, i.e. https://github.com/rust-lang/rust/commits/361509320c882ee76f0d1359f842dec4637e6b08/src/librustc/hir/check_attr.rs. Wish me luck!

@kivikakk
Copy link
Contributor Author

  • ✅ 2018-03-28
  • ❌ 2018-03-29

The one change to that file was the merge of rust-lang/rust#49291.

@kivikakk
Copy link
Contributor Author

It looks like it's complaining about #[inline] as applied to lambdas: rust-lang/rust#49291 (comment)

@kivikakk
Copy link
Contributor Author

kivikakk commented Mar 31, 2018

Turns out #[inline] never had an effect on lambdas! rust-lang/rust#49291 (comment)

I'll open a PR here.

@dragostis
Copy link
Contributor

The reason I've added the inlines was because deeply nested labdas would not get inlined. (I checked the assembly) This was causing extra moves of some fat pointers (when changing from the Rc input to &str) and was solved by using the inlines. I cannot check right now, but removing the inlines might cause a dip in performance. You can check to see whether there's a difference by running the benchmark in grammars.

@kivikakk
Copy link
Contributor Author

master:

     Running /Users/kivikakk/Code/pest-parser/pest/target/release/deps/json-05d1fc53b4dd1f96

running 1 test
test data ... bench:      14,324 ns/iter (+/- 2,841)

#219:

     Running /Users/kivikakk/Code/pest-parser/pest/target/release/deps/json-05d1fc53b4dd1f96

running 1 test
test data ... bench:      14,256 ns/iter (+/- 4,804)

@technetos
Copy link

Thanks so much ❤️

est31 added a commit to est31/cargo-local-serve that referenced this issue Apr 22, 2018
Handlebars failed to compile due to wrong code
emitted by pest_derive that rustc decided to error
on: pest-parser/pest#218
remexre added a commit to remexre/remexre.github.io that referenced this issue May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants