Skip to content

utf8 basics - #284

Closed
marijnh wants to merge 2 commits into
rust-lang:masterfrom
marijnh:master
Closed

utf8 basics#284
marijnh wants to merge 2 commits into
rust-lang:masterfrom
marijnh:master

Conversation

@marijnh

Copy link
Copy Markdown
Contributor

I'd like you to double-check the function at https://github.com/marijnh/rust/commit/8b51e075c5de83d50e40a30872db6a051b12413c#L7R188 to see you spot any glaring mistakes.

(make check passes if i first back up far enough to start from a passing HEAD again)

@marijnh

Copy link
Copy Markdown
ContributorAuthor

Hi Graydon,

The patches have been updated.

I'd really rather not get into formatting discussions at this point, since we have plans to use the pretty-printer to make all that moot. Please accept my compressed one-liners until then.

As for constants, adding a few of them did clarify things. I left the bitmasks as hex literals, since a constant named last_six_bits_set or so seems more indirect than 0x3f.

Regarding the refcounting in str_push_byte... My first attempt would deref v when allocating a new one, and leave the ref as is in the other case. However, this led to double-free errors. My conclusion is that rust expects a refcounted value returned from a foreign call to be 'new', in that it already has a refcount bump (or was initialized with refcount 1). Thus, when returning a value that was an argument to the foreign call, you have to bump its refcount. s = rustrc.str_push_byte(s, X) will decrement this refcount again when overwriting the old reference.

I added a clearer comment about the rustboot workaround at https://github.com/marijnh/rust/blob/master/src/lib/_str.rs#L292 .

Best,
Marijn

Finally implements _str.is_utf8, adds from_chars, from_char, to_chars,
char_at, char_len, (push|pop|shift|unshift)_char. Also, proper
character I/O for streams.
@graydon

Copy link
Copy Markdown
Contributor

Integrated (with rt/rustrt.def.in fix)

@graydongraydon closed this Mar 25, 2011
oli-obk added a commit to oli-obk/rust that referenced this pull request Sep 19, 2017
Rust reorders fields, but miri uses the order from the source files
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this pull request Dec 12, 2017
Added getloadavg for Linux, the BSDs and Solaris.
Sadly Android's bionic lacks this functionality.
kazcw pushed a commit to kazcw/rust that referenced this pull request Oct 23, 2018
workingjubilee pushed a commit to workingjubilee/rustc that referenced this pull request Jul 20, 2022
Change `Simd::splat` to not generate a loop
noscripter pushed a commit to noscripter/rust that referenced this pull request Sep 8, 2025
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
284: By default, log only to stderr, and not to disk. r=matklad a=eminence
This fixes a common problem when running under VS Code, the user doesn't have permissions to create a `log` directory in the CWD.
The old behavior can be re-enabled by setting `RA_INTERNAL_MODE=1`
Fixesrust-lang#282
Co-authored-by: Andrew Chin <achin@eminence32.net>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@marijnh@graydon