-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
thread 'rustc' panicked at 'called Result::unwrap()
on an Err
#51301
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Comments
IllusiveS
changed the title
thread 'rustc' panicked at 'called
thread 'rustc' panicked at 'called Jun 3, 2018
Result::unwrap()
on an Err
value when expecting Eq on template parameterResult::unwrap()
on an Err
value when having template parameter named the same way as the associated type
IllusiveS
changed the title
thread 'rustc' panicked at 'called
thread 'rustc' panicked at 'called Jun 3, 2018
Result::unwrap()
on an Err
value when having template parameter named the same way as the associated typeResult::unwrap()
on an Err
Latest nightly seems to give more information, it might be a
|
estebank
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
labels
Jun 4, 2018
Current output (fixed to run):
|
estebank
added
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
and removed
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
labels
May 8, 2019
Is this test OK? Where can I store this? use std::any::TypeId;
use std::collections::HashMap;
use std::hash::Hash;
trait State {
type EventType;
fn get_type_id_of_state(&self) -> TypeId;
}
struct StateMachine<EventType: Hash + Eq> {
current_state: Box<dyn State<EventType = EventType>>,
transition_table:
HashMap<TypeId, HashMap<EventType, fn() -> Box<dyn State<EventType = EventType>>>>,
}
impl<EventType: Hash + Eq> StateMachine<EventType> {
fn inner_process_event(&mut self, event: EventType) -> Result<(), i8> {
let new_state_creation_function = self
.transition_table
.iter()
.find(|(&event_typeid, _)| event_typeid == self.current_state.get_type_id_of_state())
.ok_or(1)?
.1
.iter()
.find(|(&event_type, _)| event == event_type)
.ok_or(2)?
.1;
self.current_state = new_state_creation_function();
Ok(())
}
} |
That seems about right add the file to |
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 14, 2019
Add ui test for issue 51301 Closes rust-lang#51301
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 14, 2019
Add ui test for issue 51301 Closes rust-lang#51301
bors
added a commit
that referenced
this issue
Jun 14, 2019
Add ui test for issue 51301 Closes #51301
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I tried this code:
I expected to see this happen: for this code to compile, or throw an error
Instead, this happened: i broke the compiler
Meta
rustc --version --verbose
:rustc 1.26.1 (827013a 2018-05-25)
binary: rustc
commit-hash: 827013a
commit-date: 2018-05-25
host: x86_64-unknown-linux-gnu
release: 1.26.1
LLVM version: 6.0
Backtrace:
The text was updated successfully, but these errors were encountered: