// `extern crate foo as bar;`
// ^^^ Comparing this.
- let result = match (a_name, b_name) {
+ match (a_name, b_name) {
(Some(..), None) => Ordering::Greater,
(None, Some(..)) => Ordering::Less,
(None, None) => Ordering::Equal,
(Some(..), Some(..)) => a.ident.name.as_str().cmp(&b.ident.name.as_str()),
- };
- result
+ }
}
_ => unreachable!(),
}
#![feature(decl_macro)]
#![feature(match_default_bindings)]
-#![feature(rustc_private)]
#![feature(type_ascription)]
#[macro_use]
}
for c in s.chars().rev() {
match c {
- ')' | ']' | '}' | '?' | '>' => continue,
+ '(' | ')' | ']' | '}' | '?' | '>' => continue,
'\n' => break,
_ if c.is_whitespace() => continue,
_ => return false,
}).collect();
}
}
+
+// #2415
+// Avoid orphan in chain
+fn issue2415() {
+ let base_url = (|| {
+ // stuff
+
+ Ok((|| {
+ // stuff
+ Some(value.to_string())
+ })()
+ .ok_or("")?)
+ })()
+ .unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));
+}
.collect();
}
}
+
+// #2415
+// Avoid orphan in chain
+fn issue2415() {
+ let base_url = (|| {
+ // stuff
+
+ Ok((|| {
+ // stuff
+ Some(value.to_string())
+ })().ok_or("")?)
+ })().unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));
+}