mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
18 lines
358 B
Rust
18 lines
358 B
Rust
|
// run-pass
|
||
|
// run-rustfix
|
||
|
|
||
|
#![allow(dead_code)]
|
||
|
#![warn(unused_parens)]
|
||
|
|
||
|
// Parser test for #37765
|
||
|
|
||
|
fn with_parens<T: ToString>(arg: T) -> String {
|
||
|
return <T as ToString>::to_string(&arg); //~WARN unnecessary parentheses around `return` value
|
||
|
}
|
||
|
|
||
|
fn no_parens<T: ToString>(arg: T) -> String {
|
||
|
return <T as ToString>::to_string(&arg);
|
||
|
}
|
||
|
|
||
|
fn main() {}
|