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
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.
The text was updated successfully, but these errors were encountered:
Doing
rustc main.rs && ./main
results inThe cause does not appear to actually be a stack overflow though. Running with rust-lldb reports
EXC_BAD_ACCESS
in thefrom
method for&'static str
.The text was updated successfully, but these errors were encountered: