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 11 pull requests #82426

Closed
wants to merge 51 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8a83c8f
Improve suggestion for tuple struct pattern matching errors.
reese Jan 21, 2021
f165f49
Slight perf improvement on char::to_ascii_lowercase
gilescope Feb 6, 2021
f30c51a
Pulling out constant.
gilescope Feb 6, 2021
a0f9d4b
Enable smart punctuation
camelid Sep 15, 2020
f1581ed
Test that code does not get smart-punctuated
camelid Feb 8, 2021
e4b83fc
Document smart punctuation
camelid Feb 8, 2021
cadcf5e
Unify way to flip 6th bit. (Same assembly generated)
gilescope Feb 8, 2021
0a34521
Fix `@has` checks "no closing quotation" error
camelid Feb 8, 2021
1b29b29
Update Markdown unit tests
camelid Feb 9, 2021
0060c91
Make WASI's `hard_link` behavior match other platforms.
sunfishcode Feb 11, 2021
daa55ac
Slightly more explicit
gilescope Feb 12, 2021
9d29793
Improve design of `assert_len`
dylni Jan 18, 2021
cb647f3
Fix possible soundness issue in `ensure_subset_of`
dylni Jan 18, 2021
f6111a2
Remove unnecessary documentation page
dylni Jan 18, 2021
5d519ea
Rename `Range::ensure_subset_of` to `slice::range`
dylni Feb 2, 2021
fe4fe19
Update new usage of `assert_len`
dylni Feb 13, 2021
506a0df
Do not consider using a semicolon inside of a different-crate macro
notriddle Feb 14, 2021
0cc6d2e
Add test case for local macro (which is different from foreign crate …
notriddle Feb 14, 2021
259e738
Add missing error indicator
notriddle Feb 14, 2021
eace240
use option<PlaceRef<'tcx>> to clean up mir code a little
henryboisdequin Feb 14, 2021
48af406
Update issue-81943.rs
notriddle Feb 14, 2021
43d0da5
Clarify comment
notriddle Feb 14, 2021
7879099
Clarify error message and remove pretty printing in help suggestions.
reese Feb 14, 2021
33d8b04
Move const def nearer usage.
gilescope Feb 14, 2021
5ef2025
add diagnostic items
anall Feb 15, 2021
c6bb628
requested/proposed changes
anall Feb 15, 2021
30c5125
update formating
henryboisdequin Feb 16, 2021
67fcaaa
a few more diagnostic items
anall Feb 16, 2021
5ec4b06
make `visit_projection` take a `PlaceRef`
henryboisdequin Feb 16, 2021
eeb5552
Remove query parameters when leaving search results
GuillaumeGomez Feb 17, 2021
ba6c648
Use the existing in_external_macro function instead of reimplementing it
notriddle Feb 18, 2021
1abcdfe
x.py fmt
sunfishcode Feb 19, 2021
a9c6188
make `super_projection` take a `PlaceRef`
henryboisdequin Feb 20, 2021
d8540ae
Fix suggestion span and move suggestions into new subwindow.
reese Feb 20, 2021
796ce9f
Suggest `return`ing tail expressions that match return type
estebank Feb 4, 2021
020edd9
reword `;` suggestions to have consistent wording
estebank Feb 4, 2021
d669882
Do not suggest `;` if expression is side effect free
estebank Feb 5, 2021
86b3f3f
tidy
estebank Feb 5, 2021
fc6c19e
fix rebase
estebank Feb 22, 2021
7bc5016
Avoid `cfg_if` in `std::os`
jonas-schievink Feb 10, 2021
19489ae
Rollup merge of #79423 - camelid:smart-punct, r=jyn514
Dylan-DPC Feb 23, 2021
ff9fc7d
Rollup merge of #81154 - dylni:improve-design-of-assert-len, r=KodrAus
Dylan-DPC Feb 23, 2021
d02102e
Rollup merge of #81235 - reese:rw-tuple-diagnostics, r=estebank
Dylan-DPC Feb 23, 2021
ea7a90d
Rollup merge of #81769 - estebank:tail-expr-as-potential-return, r=lcnr
Dylan-DPC Feb 23, 2021
39d841d
Rollup merge of #81837 - gilescope:to_ascii_speedups, r=dtolnay
Dylan-DPC Feb 23, 2021
299ea9d
Rollup merge of #81969 - jonas-schievink:no-cfg-if, r=Mark-Simulacrum
Dylan-DPC Feb 23, 2021
f30f76b
Rollup merge of #81984 - sunfishcode:wasi-link, r=alexcrichton
Dylan-DPC Feb 23, 2021
502ac07
Rollup merge of #82090 - notriddle:consider-using-a-semicolon-here, r…
Dylan-DPC Feb 23, 2021
16ce41b
Rollup merge of #82091 - henryboisdequin:use-place-ref-more, r=RalfJung
Dylan-DPC Feb 23, 2021
faf89a6
Rollup merge of #82128 - anall:feature/add_diagnostic_items, r=davidtwco
Dylan-DPC Feb 23, 2021
aa9585e
Rollup merge of #82234 - GuillaumeGomez:remove-query-param-on-esc, r=…
Dylan-DPC Feb 23, 2021
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
Slight perf improvement on char::to_ascii_lowercase
gilescope committed Feb 6, 2021

Unverified

This user has not yet uploaded their public signing key.
commit f165f49d228d2582d2dbfd588c2729cfc9585eb0
10 changes: 10 additions & 0 deletions library/core/benches/char/methods.rs
Original file line number Diff line number Diff line change
@@ -35,3 +35,13 @@ fn bench_to_digit_radix_var(b: &mut Bencher) {
.min()
})
}

#[bench]
fn bench_to_ascii_uppercase(b: &mut Bencher) {
b.iter(|| CHARS.iter().cycle().take(10_000).map(|c| c.to_ascii_uppercase()).min())
}

#[bench]
fn bench_to_ascii_lowercase(b: &mut Bencher) {
b.iter(|| CHARS.iter().cycle().take(10_000).map(|c| c.to_ascii_lowercase()).min())
}
6 changes: 4 additions & 2 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
@@ -1090,7 +1090,8 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn to_ascii_uppercase(&self) -> char {
if self.is_ascii() { (*self as u8).to_ascii_uppercase() as char } else { *self }
// 6th bit dictates ascii case.
if self.is_ascii_lowercase() { ((*self as u8) & !0b10_0000u8) as char } else { *self }
}

/// Makes a copy of the value in its ASCII lower case equivalent.
@@ -1118,7 +1119,8 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn to_ascii_lowercase(&self) -> char {
if self.is_ascii() { (*self as u8).to_ascii_lowercase() as char } else { *self }
// 6th bit dictates ascii case.
if self.is_ascii_uppercase() { ((*self as u8) | 0b10_0000u8) as char } else { *self }
}

/// Checks that two values are an ASCII case-insensitive match.