This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
rust
Watch
2
Star
0
Fork
0
You've already forked rust
mirror of
https://github.com/rust-lang/rust.git
synced
2024-11-30 18:53:39 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
051eb7ca7c
rust
/
tests
/
ui
/
fmt
/
ifmt-unimpl.rs
5 lines
89 B
Rust
Raw
Normal View
History
Unescape
Escape
Add initial support for a new formatting syntax The new macro is available under the name ifmt! (only an intermediate name)
2013-07-29 08:12:41 +00:00
fn
main
(
)
{
std: Stabilize std::fmt This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-17 19:29:38 +00:00
format!
(
"
{:X}
"
,
"
3
"
)
;
pretty: trim paths of unique symbols If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-09-02 07:40:56 +00:00
//~^ ERROR: `str: UpperHex` is not satisfied
Add initial support for a new formatting syntax The new macro is available under the name ifmt! (only an intermediate name)
2013-07-29 08:12:41 +00:00
}
Reference in New Issue
Copy Permalink