Skip to content

Format! Padding strange utf-8 characters #17105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
decentninja opened this issue Sep 8, 2014 · 2 comments
Closed

Format! Padding strange utf-8 characters #17105

decentninja opened this issue Sep 8, 2014 · 2 comments

Comments

@decentninja
Copy link

This produces only spaces and does not terminate.

fn main() {
    println!("{:2}", "☃")
}

Output (lots of spaces)

☃                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
^C

I guess that the counting of the padding is incorrect when dealing double with unicode characters.

I run OSX 10.10 Beta x86_64

@bluss
Copy link
Member

bluss commented Sep 8, 2014

I'd suspect wraparound and a loop that's trying to count to 2**64-1. Looks like line 760 of libcore/fmt/mod.rs -- .char_len() vs .len()

@huonw huonw added the A-libs label Sep 8, 2014
@kmcallister
Copy link
Contributor

Seems to be fixed.

lnicola pushed a commit to lnicola/rust that referenced this issue Apr 20, 2024
Make test harness arguments configurable and not `--nocapture`.

* Added config `runnables.extraTestBinaryArgs` to control the args.
* The default is `--show-output` rather than `--nocapture` to prevent unreadable output when 2 or more tests fail or print output at once.
* Renamed variables in `CargoTargetSpec::runnable_args()` for clarity.

Fixes rust-lang#12737.

Suggested changelog info:

> New Features
>
> * add `rust-analyzer.runnables.extraTestBinaryArgs` to configure test harness options when running tests; replaces a previously hard-coded `--nocapture` option.

I'm not sure I made the right choices in vocabulary, between “binary”, “executable”, and “runnable”, and “launch” vs. “execute”, so let me know if I missed something to be consistent with in the naming and documentation.
lnicola pushed a commit to lnicola/rust that referenced this issue Apr 20, 2024
Make test harness arguments configurable and not `--nocapture`.

* Added config `runnables.extraTestBinaryArgs` to control the args.
* The default is `--show-output` rather than `--nocapture` to prevent unreadable output when 2 or more tests fail or print output at once.
* Renamed variables in `CargoTargetSpec::runnable_args()` for clarity.

Fixes rust-lang#12737.

Suggested changelog info:

> New Features
>
> * add `rust-analyzer.runnables.extraTestBinaryArgs` to configure test harness options when running tests; replaces a previously hard-coded `--nocapture` option.

I'm not sure I made the right choices in vocabulary, between “binary”, “executable”, and “runnable”, and “launch” vs. “execute”, so let me know if I missed something to be consistent with in the naming and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants