Skip to content

xfail more external syntax extension tests on android #11656

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
wants to merge 2 commits into from

Conversation

brson
Copy link
Contributor

@brson brson commented Jan 18, 2014

No description provided.

@sfackler
Copy link
Member

I don't know if this got them all, but all tests tagged xfail-stage1 should be tagged xfail-android as well.

brson added 2 commits January 18, 2014 16:32
… in tests

This makes pretty print tests that have aux crates work correctly on Android.
Without they generate errors ICEs about incorrect node ids. Not sure why.
bors added a commit that referenced this pull request Jan 20, 2014
@bors bors closed this Jan 20, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 11, 2024
…archo

[`unnecessary_to_owned`]: catch `to_owned` on byte slice to create temporary `&str`

Closes rust-lang#11648

Detects the pattern `&String::from_utf8(bytes.to_vec()).unwrap()` and suggests `core::str::from_utf8(bytes).unwrap()`, which avoids the unnecessary intermediate allocation.

I decided to put this in the existing `unnecessary_to_owned` lint (rather than creating a new lint) for a few reasons:
- we get to use some of its logic (for example, recognizing any of the functions in the `to_owned` family, e.g. `to_vec`)
- the actual inefficient operation that can be avoided here is the call to `.to_vec()`, so this is in a way similar to the other cases caught by `unnecessary_to_owned`, just through a bunch of type conversions
- we can make this more "generic" later and catch other cases, so imo it's best not to tie this lint specifically to the `String` type

changelog: [`unnecessary_to_owned`]: catch `&String::from_utf8(bytes.to_vec()).unwrap()` and suggest `core::str::from_utf8(bytes).unwrap()`
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

Successfully merging this pull request may close these issues.

4 participants