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

Rust panicked when compiling on Raspbian (Raspberry pi 3B) #78563

Closed
lilymonad opened this issue Oct 30, 2020 · 1 comment
Closed

Rust panicked when compiling on Raspbian (Raspberry pi 3B) #78563

lilymonad opened this issue Oct 30, 2020 · 1 comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lilymonad
Copy link

lilymonad commented Oct 30, 2020

When trying to compile a web server (with actix-web framework) in my raspberry pi 3b, the compiler panicked. The buf only happens with nightly toolchain, stable works.

Code

use actix_web::{get, web, App, HttpServer, Responder};
use std::env;

const DEFAULT_BIND_ADDRESS : & 'static str = "127.0.0.1:8080";


#[get("/{name}")]
async fn hello(name: web::Path<String>) -> String {
    format!("Hello {}!", name)
}


#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().service(hello))
        .bind(env::var("SERVER_BIND_ADDRESS").unwrap_or(DEFAULT_BIND_ADDRESS.to_string()))?
        .run()
        .await
}

Meta

rustc --version --verbose:

rustc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: armv7-unknown-linux-gnueabihf
release: 1.47.0
LLVM version: 11.0

Error output

error: internal compiler error: compiler/rustc_mir_build/src/thir/pattern/_match.rs:934:18: trying to compare incompatible constructors Single and Str(Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [105, 115, 115, 117, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 5 } }, size: Size { raw: 5 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 5 }) })

// notes about bug report + backtrace ...
error: aborting due to previous error

error: could not compile `trust-dns-proto`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Backtrace

stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir_build::thir::pattern::_match::Matrix::specialize_constructor
   9: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
  10: rustc_mir_build::thir::pattern::_match::is_useful
  11: <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  12: rustc_hir::intravisit::walk_expr
  13: <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  14: rustc_mir_build::thir::pattern::check_match::check_match
  15: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_match>::compute
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::get_query_impl
  19: rustc_query_system::query::plumbing::ensure_query_impl
  20: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  21: rustc_interface::passes::analysis
  22: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  23: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  24: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
  25: rustc_query_system::query::plumbing::get_query_impl
  26: rustc_interface::passes::QueryContext::enter
  27: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  28: rustc_span::with_source_map
  29: scoped_tls::ScopedKey<T>::set

@lilymonad lilymonad added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 30, 2020
@jonas-schievink
Copy link
Contributor

Duplicate of #78549

@jonas-schievink jonas-schievink marked this as a duplicate of #78549 Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants