rgardner / bsh-rs

Bash-like shell (builtins, job control, piping) written in Rust
Apache License 2.0
4 stars 0 forks source link

fails to compile in 1.53.0 #30

Closed godmar closed 3 years ago

godmar commented 3 years ago

cargo run fails with:

   Compiling rustyline v3.0.0
error[E0283]: type annotations needed
   --> /home/gback/.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-3.0.0/src/lib.rs:655:43
    |
655 |             editor.add_history_entry(line.as_ref());
    |                                      -----^^^^^^--
    |                                      |    |
    |                                      |    cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                      this method call resolves to `&T`
    |
    = note: cannot satisfy `String: AsRef<_>`
help: use the fully qualified path for the potential candidates
    |
655 |             editor.add_history_entry(<String as AsRef<OsStr>>::as_ref(line));
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 |             editor.add_history_entry(<String as AsRef<Path>>::as_ref(line));
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 |             editor.add_history_entry(<String as AsRef<[u8]>>::as_ref(line));
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 |             editor.add_history_entry(<String as AsRef<str>>::as_ref(line));
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0283]: type annotations needed
   --> /home/gback/.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-3.0.0/src/history.rs:151:28
    |
151 |             self.add(line?.as_ref()); // TODO truncate to MAX_LINE
    |                      ------^^^^^^--
    |                      |     |
    |                      |     cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                      this method call resolves to `&T`
    |
    = note: cannot satisfy `String: AsRef<_>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0283`.
error: could not compile `rustyline`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
rgardner commented 3 years ago

Thanks for letting me know, @godmar!

Out of curiosity, how did you discover this project?

godmar commented 3 years ago

Out of curiosity, how did you discover this project?

I was looking for shells written in Rust to see how they solved a number of problems.

I was now able to try yours but it seems that it's perhaps just in its early stages. For instance, neither ^C nor ^Z appear to work yet, and sleep 1 & doesn't work, either. If those things should work I'll be glad to file issues.