Skip to content

Instantly share code, notes, and snippets.

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 guzt/32437a394c5c3401f8ec80a6863efe56 to your computer and use it in GitHub Desktop.
Save guzt/32437a394c5c3401f8ec80a6863efe56 to your computer and use it in GitHub Desktop.
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
--> src/lib.rs:3:20
|
3 | return Err("c".to_string());
| ^^^^^^^^^^^^^^^ expected struct `failure::error::Error`, found struct `std::string::String`
|
= note: expected type `failure::error::Error`
found type `std::string::String`
error[E0317]: if may be missing an else clause
--> src/lib.rs:2:5
|
2 | / if "a" != "b" {
3 | | return Err("c".to_string());
4 | | }
| |_____^ expected (), found enum `std::result::Result`
|
= note: expected type `()`
found type `std::result::Result<(), failure::error::Error>`
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
error: internal compiler error: src/librustc/ty/context.rs:551: node_type: no type for node `expr { } (hir_id=HirId { owner: DefIndex(12), local_id: 3 })`
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:931:9
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:77
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:61
4: core::fmt::write
at src/libcore/fmt/mod.rs:1028
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1412
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:65
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:50
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:188
9: std::panicking::default_hook
at src/libstd/panicking.rs:205
10: rustc_driver::report_ice
11: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:468
12: std::panicking::begin_panic
13: rustc_errors::HandlerInner::bug
14: rustc_errors::Handler::bug
15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
16: rustc::ty::context::tls::with_opt::{{closure}}
17: rustc::ty::context::tls::with_context_opt
18: rustc::ty::context::tls::with_opt
19: rustc::util::bug::opt_span_bug_fmt
20: rustc::util::bug::bug_fmt
21: rustc::ty::context::TypeckTables::node_type::{{closure}}
22: rustc::ty::context::TypeckTables::expr_ty
23: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc::hir::intravisit::Visitor>::visit_expr
24: rustc::hir::intravisit::walk_expr
25: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc::hir::intravisit::Visitor>::visit_expr
26: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc::hir::intravisit::Visitor>::visit_expr
27: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc::hir::intravisit::Visitor>::visit_expr
28: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc::hir::intravisit::Visitor>::visit_expr
29: rustc_typeck::check::generator_interior::resolve_interior
30: rustc_typeck::check::FnCtxt::resolve_generator_interiors
31: rustc::ty::context::tls::with_context::{{closure}}
32: rustc_typeck::check::typeck_tables_of
33: rustc::ty::query::__query_compute::typeck_tables_of
34: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute
35: rustc::dep_graph::graph::DepGraph::with_task_impl
36: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
37: rustc::ty::query::__query_compute::typeck_tables_of
38: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute
39: rustc::dep_graph::graph::DepGraph::with_task_impl
40: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
41: rustc_typeck::collect::checked_type_of
42: rustc_typeck::collect::type_of
43: rustc::ty::query::__query_compute::type_of
44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::type_of>::compute
45: rustc::dep_graph::graph::DepGraph::with_task_impl
46: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
47: rustc::hir::intravisit::walk_expr
48: rustc::hir::intravisit::Visitor::visit_fn
49: rustc::hir::intravisit::walk_item
50: <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item
51: rustc::hir::map::Map::visit_item_likes_in_module
52: rustc_typeck::collect::collect_mod_item_types
53: rustc::ty::query::__query_compute::collect_mod_item_types
54: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute
55: rustc::dep_graph::graph::DepGraph::with_task_impl
56: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
57: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query
58: rustc_typeck::check_crate::{{closure}}::{{closure}}
59: rustc::util::common::time
60: rustc_typeck::check_crate
61: rustc_interface::passes::analysis
62: rustc::ty::query::__query_compute::analysis
63: rustc::dep_graph::graph::DepGraph::with_task_impl
64: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
65: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
66: rustc_interface::passes::create_global_ctxt::{{closure}}
67: rustc_interface::passes::BoxedGlobalCtxt::enter
68: rustc_interface::interface::run_compiler_in_existing_thread_pool
69: std::thread::local::LocalKey<T>::with
70: scoped_tls::ScopedKey<T>::set
71: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.40.0-beta.1 (76b40532a 2019-11-05) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck_tables_of] processing `f`
#1 [typeck_tables_of] processing `f::{{closure}}#0`
#2 [type_of] processing `f::{{closure}}#0`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0317.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment