Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/ui/coercion/any-trait-object-debug-12744.rs

8 lines
194 B
Rust
Raw Permalink Normal View History

comments
2025-07-24 17:22:54 +05:00
//! Regression test for https://github.com/rust-lang/rust/issues/12744
[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ run-pass
Add tests for E-needstest issues
2014-12-07 15:22:06 +00:00
fn main() {
Update run-pass test suite to use dyn
2019-05-28 14:47:21 -04:00
fn test() -> Box<dyn std::any::Any + 'static> { Box::new(1) }
core: split into fmt::Show and fmt::String fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2014-12-20 00:09:35 -08:00
println!("{:?}", test())
Add tests for E-needstest issues
2014-12-07 15:22:06 +00:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3305ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API