Skip to content
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

Rollup of 7 pull requests #70062

Merged
merged 19 commits into from
Mar 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
eafeb9a
expand/builtin_macros: Minor cleanup
petrochenkov Dec 30, 2019
552a887
expand: Implement support for retrying macro expansions
petrochenkov Mar 9, 2020
2e65289
builtin_macros: Add attribute macro `#[cfg_accessible(path)]`
petrochenkov Mar 9, 2020
71ebc61
resolve: Simplify `fn report_privacy_error`
petrochenkov Mar 7, 2020
580c6a2
resolve: Print import chains on privacy errors
petrochenkov Mar 7, 2020
f4083c6
Add the "consider importing it directly" label to public imports as well
petrochenkov Mar 11, 2020
e80cb20
resolve: Fix regression in resolution of raw keywords in paths
petrochenkov Mar 14, 2020
81099c2
VariantSizeDifferences: bail on SizeOverflow
Centril Mar 10, 2020
f53f9a8
Bump the bootstrap compiler
jonas-schievink Mar 15, 2020
ce5e49f
Use sublice patterns to avoid computing the len
tesuji Mar 16, 2020
e1bc9af
Fix wrong deref
tesuji Mar 16, 2020
7894509
Fiddle `ParamEnv` through to a place that used to use `ParamEnv::empt…
oli-obk Mar 16, 2020
b691145
Rollup merge of #69811 - petrochenkov:privdiag2, r=estebank
Centril Mar 17, 2020
9fc5c2d
Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasper
Centril Mar 17, 2020
1b0c73b
Rollup merge of #69881 - Centril:fix-69485, r=oli-obk
Centril Mar 17, 2020
3d25622
Rollup merge of #70000 - petrochenkov:rawkeypars, r=davidtwco
Centril Mar 17, 2020
f907598
Rollup merge of #70029 - jonas-schievink:bootstrap, r=Centril
Centril Mar 17, 2020
4d7ec70
Rollup merge of #70046 - lzutao:patch-1, r=Centril
Centril Mar 17, 2020
f118fee
Rollup merge of #70049 - oli-obk:param_env_empty_considered_unimpleme…
Centril Mar 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use sublice patterns to avoid computing the len
  • Loading branch information
tesuji authored Mar 16, 2020
commit ce5e49f86fc8bff241695f8a62e77f517749bd6d
16 changes: 4 additions & 12 deletions src/libstd/sys_common/wtf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,24 +599,16 @@ impl Wtf8 {

#[inline]
fn final_lead_surrogate(&self) -> Option<u16> {
let len = self.len();
if len < 3 {
return None;
}
match self.bytes[(len - 3)..] {
[0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(b2, b3)),
match self.bytes {
[.., 0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(*b2, *b3)),
_ => None,
}
}

#[inline]
fn initial_trail_surrogate(&self) -> Option<u16> {
let len = self.len();
if len < 3 {
return None;
}
match self.bytes[..3] {
[0xED, b2 @ 0xB0..=0xBF, b3] => Some(decode_surrogate(b2, b3)),
match self.bytes {
[0xED, b2 @ 0xB0..=0xBF, b3, ..] => Some(decode_surrogate(*b2, *b3)),
_ => None,
}
}
Expand Down