0

I am trying to revive a project that was last modified 2 years ago and it has plenty of deprecated syntax. The original unmodified code in context.

I removed the feature and phase lines and changed all occurrences of deriving to derive; see after my modifications. I have also modified other files but they are the same kinds of modifications as in this file.

I'm running Rust 1.9 on Arch.

The compiler output. Note that this isn't cargo (as far as I can tell) but it supposedly worked once upon a time:

me@pc[equinox/bin]% make tests
rustc   ../src/main.rs -L ../lib/ --test -o equinox-tests
../src/engine/math.rs:244:10: 244:14 error: `#[derive]` for custom traits is not stable enough for use and is subject to change (see issue #29644)
../src/engine/math.rs:244 #[derive(Show)]
                                   ^~~~
error: aborting due to previous error
make: *** [makefile:8: tests] Error 101
me@pc[equinox/bin]%

Which didn't sound too bad until I read this from Reddit (can't link any more):

The idea is that there is an external tool that removes the derive attributes and replaces them with generated code. If the Rust compiler itself is seeing those attributes, it means that you've missed a step.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Powersource
  • 120
  • 1
  • 13
  • Duplicate of http://stackoverflow.com/q/27874987/155423 — replace `Show` with `Debug`. – Shepmaster Jun 19 '16 at 02:04
  • Thanks for the formatting :) I looked at that question before but that only solves formatting the output of `derive(Show)`. I couldn't get the compiler to accept the `derive` annotation in the first place. And I believe that error was only a symptom of trying to backspace until stuff worked. I believe the real errors that need solving are the errors relating to `phase`. E: Ok, trying Debug. – Powersource Jun 19 '16 at 02:11
  • 1
    FYI, you are going to be in for a world of hurt trying to update something from so far before Rust 1.0. At a quick look, I see `deriving` => `derive`, `int` => `isize`, `~` => `Box`, the removed `priv` keyword. The biggest scary thing is the checked-in compiled Rust library and the dynamic library. I can't imagine any way that will be usable. – Shepmaster Jun 19 '16 at 02:21
  • I have managed to fix `Box` and `priv` so far. Well, the compiler doesn't complain anymore but I imagine there might be a whole bunch of bugs waiting for me once I manage to get it to run. The errors in this post are gone though now, the next step seems to be to fix missing crates (why did he have to make his own build system?). But yes, this might be where I commit and bail, it is exhausting to say the least. – Powersource Jun 19 '16 at 02:34

1 Answers1

2

I simply had to use derive(Debug) instead of deriving(Show). The compiler doesn't complain anymore (about this at least) but if stuff works as intended is another question.

Powersource
  • 120
  • 1
  • 13
  • Wow, now I see that I tried derive(Show), I thought it was derive(Display) that I had tried. And I also see that the answer in the other question specified that Display couldn't even be derived so I was completely off in my reading comprehension. – Powersource Jun 20 '16 at 23:07