We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried this code:
extern crate nanomsg; extern crate futures;
use std::sync::mpsc::*; use std::thread::{Thread, current};
pub use self::futures::{Future, Poll, Async};
pub use self::nanomsg::{PollFd, Socket, PollRequest, PollInOut};
type Notify = (PollFd, Thread);
pub struct NanoCore { tx: Sender, rx: Receiver }
pub enum NanoCoreError { NanoError(nanomsg::Error), SendError(SendError), RecvError(RecvError), }
impl Fromnanomsg::Error for NanoCoreError { fn from(e: nanomsg::Error) -> Self { NanoCoreError::NanoError(e) } }
impl From<SendError> for NanoCoreError { fn from(e: SendError) -> Self { NanoCoreError::SendError(e) } }
impl From for NanoCoreError { fn from(e: RecvError) -> Self { NanoCoreError::RecvError(e) } }
struct ReadReady { socket: Socket, sender: Sender<(PollFd, Thread)>, }
impl ReadReady { fn new(socket: Socket, core: &NanoCore) -> ReadReady { ReadReady { socket: socket, sender: core.tx.clone() } }
fn new_poll_fd(&self) -> PollFd { self.socket.new_pollfd(PollInOut::In) }
}
impl Future for ReadReady { type Item = Socket; type Error = NanoCoreError;
fn poll(&mut self) -> Poll<Self::Item, Self::Error> { self.sender.send((self.new_poll_fd(), current()))?; Ok(Async::NotReady) }
impl NanoCore { pub fn new() -> NanoCore { let (tx, rx) = channel(); NanoCore { tx: tx, rx: rx } }
pub fn poll(&self) -> nanomsg::Result<()> { let timeout = 10; Ok(()) }
I expected to see this happen:
Instead, this happened:
rustc --version --verbose:
rustc --version --verbose
rustc 1.18.0 (03fc9d6 2017-06-06) binary: rustc commit-hash: 03fc9d6 commit-date: 2017-06-06 host: x86_64-pc-windows-msvc release: 1.18.0 LLVM version: 3.9
Backtrace:
thread 'rustc' panicked at 'invalid lint-id trivial_numeric_casts', src\librustc\lint\context.rs:1322 stack backtrace: 0: <std::time::SystemTimeError as core::fmt::Display>::fmt 1: std::panicking::Location::line 2: std::panicking::Location::line 3: std::panicking::rust_panic_with_hook 4: std::panicking::begin_panic_fmt 5: std::panicking::begin_panic_fmt 6: 7: rustc_metadata::decoder::::item_body_tables 8: rustc_metadata::cstore_impl::provide 9: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables<'tcx>>::try_get 10: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables<'tcx>>::get 11: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::item_tables 12: rustc_const_eval::eval::provide 13: rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::try_get 14: rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::get 15: rustc::ty::layout::Layout::compute_uncached 16: rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::needs_drop_uncached 17: 18: 19: rustc::ty::layout::Layout::compute_uncached 20: 21: 22: 23: 24: rustc::ty::layout::Layout::compute_uncached 25: <rustc_lint::types::VariantSizeDifferences as rustc::lint::LateLintPass<'a, 'tcx>>::check_item 26: rustc::lint::context::gather_attrs 27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod 28: rustc::hir::intravisit::NestedVisitorMap::inter 29: rustc::lint::context::gather_attrs 30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod 31: rustc::lint::context::check_crate 32: rustc_driver::driver::count_nodes 33: 34: rustc_driver::driver::count_nodes 35: rustc_driver::driver::compile_input 36: rustc_driver::run_compiler 37: 38: _rust_maybe_catch_panic 39: 40: std::sys::imp::thread::Thread::new 41: BaseThreadInitThunk
trivial_numeric_casts
The text was updated successfully, but these errors were encountered:
cased by pub enum NanoCoreError { NanoError(nanomsg::Error),
Sorry, something went wrong.
Please try if it crashes on 1.19-beta or nightly. If it doesn't, then this issue is a duplicate of #42007 and #42546 which has been fixed.
thx.
can be fixed by this.
impl Fromnanomsg::Error for NanoCoreError { fn from(e: nanomsg::Error) -> Self { NanoCoreError::NanoError(e.to_raw() as isize) } }
it could cased by nanomsg::Error define
pub enum Error { Unknown = 0 as isize,
No branches or pull requests
I tried this code:
extern crate nanomsg;
extern crate futures;
use std::sync::mpsc::*;
use std::thread::{Thread, current};
pub use self::futures::{Future, Poll, Async};
pub use self::nanomsg::{PollFd, Socket, PollRequest, PollInOut};
type Notify = (PollFd, Thread);
pub struct NanoCore {
tx: Sender,
rx: Receiver
}
pub enum NanoCoreError {
NanoError(nanomsg::Error),
SendError(SendError),
RecvError(RecvError),
}
impl Fromnanomsg::Error for NanoCoreError {
fn from(e: nanomsg::Error) -> Self {
NanoCoreError::NanoError(e)
}
}
impl From<SendError> for NanoCoreError {
fn from(e: SendError) -> Self {
NanoCoreError::SendError(e)
}
}
impl From for NanoCoreError {
fn from(e: RecvError) -> Self {
NanoCoreError::RecvError(e)
}
}
struct ReadReady {
socket: Socket,
sender: Sender<(PollFd, Thread)>,
}
impl ReadReady {
fn new(socket: Socket, core: &NanoCore) -> ReadReady {
ReadReady { socket: socket, sender: core.tx.clone() }
}
}
impl Future for ReadReady {
type Item = Socket;
type Error = NanoCoreError;
}
impl NanoCore {
pub fn new() -> NanoCore {
let (tx, rx) = channel();
NanoCore {
tx: tx,
rx: rx
}
}
}
I expected to see this happen:
Instead, this happened:
Meta
rustc --version --verbose
:rustc 1.18.0 (03fc9d6 2017-06-06)
binary: rustc
commit-hash: 03fc9d6
commit-date: 2017-06-06
host: x86_64-pc-windows-msvc
release: 1.18.0
LLVM version: 3.9
Backtrace:
thread 'rustc' panicked at 'invalid lint-id
trivial_numeric_casts
', src\librustc\lint\context.rs:1322stack backtrace:
0: <std::time::SystemTimeError as core::fmt::Display>::fmt
1: std::panicking::Location::line
2: std::panicking::Location::line
3: std::panicking::rust_panic_with_hook
4: std::panicking::begin_panic_fmt
5: std::panicking::begin_panic_fmt
6:
7: rustc_metadata::decoder::::item_body_tables
8: rustc_metadata::cstore_impl::provide
9: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables<'tcx>>::try_get
10: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables<'tcx>>::get
11: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::item_tables
12: rustc_const_eval::eval::provide
13: rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::try_get
14: rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::get
15: rustc::ty::layout::Layout::compute_uncached
16: rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::needs_drop_uncached
17:
18:
19: rustc::ty::layout::Layout::compute_uncached
20:
21:
22:
23:
24: rustc::ty::layout::Layout::compute_uncached
25: <rustc_lint::types::VariantSizeDifferences as rustc::lint::LateLintPass<'a, 'tcx>>::check_item
26: rustc::lint::context::gather_attrs
27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
28: rustc::hir::intravisit::NestedVisitorMap::inter
29: rustc::lint::context::gather_attrs
30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
31: rustc::lint::context::check_crate
32: rustc_driver::driver::count_nodes
33:
34: rustc_driver::driver::count_nodes
35: rustc_driver::driver::compile_input
36: rustc_driver::run_compiler
37:
38: _rust_maybe_catch_panic
39:
40: std::sys::imp::thread::Thread::new
41: BaseThreadInitThunk
The text was updated successfully, but these errors were encountered: