Rust 不打印到终端

标签 rust

rustc 在使用 println! 时不会向终端输出任何内容。

代码:

fn main() {
   println!("Hello, world!");
}

运行它:

me@mclaptop:~
> rustc helloworld.rs

me@mclaptop:~
>

为什么它不打印任何东西?

最佳答案

rustc 是 Rust 语言的编译器,它只是生成一个可执行文件来运行。如果您想真正看到输出,您必须运行 ./helloworld 命令。

你可以阅读它here .

关于Rust 不打印到终端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58356395/

相关文章:

rust - Rust 函数中奇怪的生命周期,发生第二个可变借用

multithreading - 使用 serde_json::from_str 反序列化为带有 &'static 字符串的结构存在生命周期错误

rust - 预期的关闭,发现不同的关闭

rust - 递归函数计算阶乘导致栈溢出

rust - 字符串切片的随机采样

iterator - Rhs 在有关 PartialEq 的编译器错误消息中指的是什么?

rust - 如何从 Substrate 端从 Polkadot 地址生成公钥

rust - 参数位置中的 dyn Trait 是什么意思?

exception - 如何使用 ?并捕获使用rust ?

rust - 为什么 Valgrind 在稳定版 1.55.0 中*再次*检测不到内存泄漏?