You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: internal compiler error: librustc\traits\specialize\mod.rs:104: When translating substitutions for specialization, the expected specialization failed to hold
#55442
Closed
EyeOfPython opened this issue
Oct 28, 2018
· 1 comment
When trying to follow the PyO3 tutorial, I receive the following error message:
Command: cargo +nightly build
Compiling version_check v0.1.5
Compiling proc-macro2 v0.4.20
Compiling cfg-if v0.1.6
Compiling unicode-xid v0.1.0
Compiling libc v0.2.43
Compiling ucd-util v0.1.1
Compiling regex v1.0.5
Compiling utf8-ranges v1.0.1
Compiling proc-macro-hack-impl v0.4.1
Compiling num-traits v0.2.6
Compiling spin v0.4.9
Compiling log v0.4.6
Compiling lazy_static v1.1.0
Compiling memchr v2.1.0
Compiling regex-syntax v0.6.2
Compiling proc-macro-hack v0.4.1
Compiling thread_local v0.3.6
Compiling aho-corasick v0.6.8
Compiling quote v0.6.8
Compiling mashup-impl v0.1.9
Compiling syn v0.14.9
Compiling mashup v0.1.9
Compiling pyo3 v0.4.1
Compiling pyo3-derive-backend v0.4.1
Compiling pyo3cls v0.4.1
error: internal compiler error: librustc\traits\specialize\mod.rs:104: When tran
slating substitutions for specialization, the expected specialization failed to
hold
thread 'main' panicked at 'Box<Any>', librustc_errors\lib.rs:600:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: rustc 1.31.0-nightly (cae6efc37 2018-10-27) running on x86_64-pc-windows-m
svc
note: compiler flags: -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `pyo3`.
To learn more, run the command again with --verbose.
My Cargo.toml looks like this:
[package]
name = "pyext"version = "0.1.0"authors = ["me"]
[lib]
name = "pyext"crate-type = ["dylib"]
[dependencies.pyo3]
version = "0.4.1"features = ["extension-module"]
My lib.rs looks like this:
#[macro_use]externcrate pyo3;use pyo3::prelude::*;#[pyfunction]/// Formats the sum of two numbers as stringfnsum_as_string(a:usize,b:usize) -> PyResult<String>{Ok((a + b).to_string())}/// This module is a python module implemented in Rust.#[pymodinit]fnstring_sum(py:Python,m:&PyModule) -> PyResult<()>{
m.add_function(wrap_function!(sum_as_string))?;Ok(())}
I opened this issue as I was asked to do so. Please close it immediately if this has been reported already.
The text was updated successfully, but these errors were encountered:
When trying to follow the PyO3 tutorial, I receive the following error message:
Command:
cargo +nightly build
My Cargo.toml looks like this:
My lib.rs looks like this:
I opened this issue as I was asked to do so. Please close it immediately if this has been reported already.
The text was updated successfully, but these errors were encountered: