What I'm trying to do
I'm trying to apply a substitution with sed
on an output of the rust compiler.
Small example
Do cargo new test
.
src/main.rs
fn main() {
println("Println is a macro!!");
}
Now do cargo run | sed -n -e 's/help/Help/'
.
Expected output
error[E0423]: expected function, found macro `println`
--> src/main.rs:2:5
|
2 | println("Println is a macro!!");
| ^^^^^^^ not a function
|
Help: use `!` to invoke the macro
|
2 | println!("Println is a macro!!");
| +
For more information about this error, try `rustc --explain E0423`.
error: could not compile `rust_tmp` due to previous error
What I get
error[E0423]: expected function, found macro `println`
--> src/main.rs:2:5
|
2 | println("Println is a macro!!");
| ^^^^^^^ not a function
|
help: use `!` to invoke the macro
|
2 | println!("Println is a macro!!");
| +
For more information about this error, try `rustc --explain E0423`.
error: could not compile `rust_tmp` due to previous error
(nothing has changed)
What else I tried
I also tried:
cargo run 2>&1 sed -n -e 's/help/Help/'