Closed
Description
struct Test {
s: String
}
impl<'a> From<&'a String> for Test {
fn from(s: &'a String) -> Test {
return Test {s: s.to_string()};
}
}
impl From<&'static str> for Test {
fn from(s: &'static str) -> Test {
s.into()
}
}
fn main() {
let test: Test = "test".into();
}
Doing rustc main.rs && ./main
results in
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Abort trap: 6
The cause does not appear to actually be a stack overflow though. Running with rust-lldb reports EXC_BAD_ACCESS
in the from
method for &'static str
.
Metadata
Metadata
Assignees
Labels
No labels