about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-01 02:53:28 -0700
committerGitHub <noreply@github.com>2016-09-01 02:53:28 -0700
commitb2799a56a1631ee351e4687ee649808e28cccda1 (patch)
treeee8fd765766cc38f38e8dd02782412c1d2ee189d /src/rustllvm/RustWrapper.cpp
parent3135b7877a66e72ac4833588eb8654aa155876e8 (diff)
parentf040208d533e1d6d9ee0e0408ee74e26e14d1284 (diff)
downloadrust-b2799a56a1631ee351e4687ee649808e28cccda1.tar.gz
rust-b2799a56a1631ee351e4687ee649808e28cccda1.zip
Auto merge of #35755 - SimonSapin:char_convert, r=alexcrichton
Implement std::convert traits for char

This is motivated by avoiding the `as` operator, which sometimes silently truncates, and instead use conversions that are explicitly lossless and infallible.

I’m less certain that `From<u8> for char` should be implemented: while it matches an existing behavior of `as`, it’s not necessarily the right thing to use for non-ASCII bytes. It effectively decodes bytes as ISO/IEC 8859-1 (since Unicode designed its first 256 code points to be compatible with that encoding), but that is not apparent in the API name.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions