-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Description
When deprecated API usage is enclosed in a macro like try!, no warning is raised. However, using it directly in match does.
Below is an example using the deprecated url crate from rust nightly distribution. A warning is raised only in the use_match function.
extern crate url;
use url::Url;
fn main() {
println!("Host: {}", use_try("http://localhost").unwrap())
println!("Host: {}", use_match("http://localhost").unwrap())
}
fn use_try(s: &str) -> Result<String, String> {
let u = try!(Url::parse(s));
Ok(u.host)
}
fn use_match(s: &str) -> Result<String, String> {
return match Url::parse(s) {
Ok(u) => Ok(u.host),
Err(e) => Err(e)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Type
Fields
Give feedbackNo fields configured for issues without a type.