Skip to content

Instantly share code, notes, and snippets.

@Others
Created December 29, 2019 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Others/c8b70b6a1db5ee7c73e9bd5a8f598600 to your computer and use it in GitHub Desktop.
Save Others/c8b70b6a1db5ee7c73e9bd5a8f598600 to your computer and use it in GitHub Desktop.
test tests\compile-fail\example_compile_error.rs ... mismatch
EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0425]: cannot find value `cx` in this scope
--> $DIR/example_compile_error.rs:6:19
|
6 | JsNumber::new(cx, "9000")
| ^^ not found in this scope
error[E0277]: the trait bound `f64: std::convert::From<&str>` is not satisfied
--> $DIR/example_compile_error.rs:6:5
|
6 | JsNumber::new(cx, "9000")
| ^^^^^^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `f64`
|
::: $WORKSPACE/src/types/mod.rs:313:39
|
313 | pub fn new<'a, C: Context<'a>, T: Into<f64>>(cx: &mut C, x: T) -> Handle<'a, JsNumber> {
| --------- required by this bound in `neon::types::JsNumber::new`
|
= help: the following implementations were found:
<f64 as std::convert::From<f32>>
<f64 as std::convert::From<i16>>
<f64 as std::convert::From<i32>>
<f64 as std::convert::From<i8>>
and 3 others
= note: required because of the requirements on the impl of `std::convert::Into<f64>` for `&str`
error[E0308]: mismatched types
--> $DIR/example_compile_error.rs:6:5
|
5 | fn main() {
| - expected `()` because of default return type
6 | JsNumber::new(cx, "9000")
| ^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
| |
| expected (), found struct `neon::handle::Handle`
|
= note: expected type `()`
found type `neon::handle::Handle<'_, neon::types::JsNumber>`
Some errors have detailed explanations: E0277, E0308, E0425.
For more information about an error, try `rustc --explain E0277`.
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0425]: cannot find value `cx` in this scope
--> $DIR/example_compile_error.rs:6:19
|
6 | JsNumber::new(cx, "9000")
| ^^ not found in this scope
error[E0277]: the trait bound `f64: std::convert::From<&str>` is not satisfied
--> $DIR/example_compile_error.rs:6:5
|
6 | JsNumber::new(cx, "9000")
| ^^^^^^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `f64`
|
::: $WORKSPACE/src/types/mod.rs:313:39
|
313 | pub fn new<'a, C: Context<'a>, T: Into<f64>>(cx: &mut C, x: T) -> Handle<'a, JsNumber> {
| --------- required by this bound in `neon::types::JsNumber::new`
|
= help: the following implementations were found:
<f64 as std::convert::From<f32>>
<f64 as std::convert::From<i16>>
<f64 as std::convert::From<i32>>
<f64 as std::convert::From<i8>>
and 3 others
= note: required because of the requirements on the impl of `std::convert::Into<f64>` for `&str`
error[E0308]: mismatched types
--> $DIR/example_compile_error.rs:6:5
|
5 | fn main() {
| - expected `()` because of default return type
6 | JsNumber::new(cx, "9000")
| ^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
| |
| expected `()`, found struct `neon::handle::Handle`
|
= note: expected unit type `()`
found struct `neon::handle::Handle<'_, neon::types::JsNumber>`
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment