Commit Graph

91881 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
05e8051d75
Rollup merge of #59252 - lcnr:mailmap, r=Centril
add self to mailmap
2019-03-19 15:16:57 +01:00
Mazdak Farrokhzad
8ebe2acb7b
Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkov
Be more discerning on when to attempt suggesting a comma in a macro invocation

Fix #58796.
2019-03-19 15:16:55 +01:00
Mazdak Farrokhzad
61ff887919
Rollup merge of #58939 - taeguk:fix-doc-about-pin, r=rkruppe
Fix a tiny error in documentation of std::pin.

`new_unmoved` must be `mut` for passing to `std::mem::swap`.
2019-03-19 15:16:53 +01:00
Mazdak Farrokhzad
5abd9c7d15
Rollup merge of #58812 - jonhoo:floor_v_trunc, r=alexcrichton
Clarify distinction between floor() and trunc()

`floor()` rounds towards `-INF`, `trunc()` rounds towards 0.
This PR clarifies this in the examples.
2019-03-19 15:16:50 +01:00
Mazdak Farrokhzad
fff8586193
Rollup merge of #58778 - xfix:exact_size_case_mapping_iter, r=SimonSapin
Implement ExactSizeIterator for ToLowercase and ToUppercase
2019-03-19 15:16:49 +01:00
Mazdak Farrokhzad
d4ef74b2da
Rollup merge of #57847 - clarcharr:dbg_no_params, r=Centril
dbg!() without parameters

Fixes #57845.
2019-03-19 15:16:46 +01:00
Mazdak Farrokhzad
c1975dbd34
Rollup merge of #57729 - pnkfelix:issue-55748-pat-types-are-constraints-on-bindings-too, r=nikomatsakis
extra testing of how NLL handles wildcard type `_`

test that wildcard type `_` is not duplicated by `type Foo<X> = (X, X);` and potentially instantiated at different types when used in type ascriptions in let bindings.

(NLL's handling of this for the type ascription *expression form* is currently broken, or at least differs from what AST-borrowck does. I'll file a separate bug about that. Its not something critical to address since that expression is guarded by `#![feature(type_ascription)]`.)

cc #55748
2019-03-19 15:16:45 +01:00
Mazdak Farrokhzad
d4dd8604eb
Rollup merge of #56348 - matklad:todo-macro, r=withoutboats
Add todo!() macro

The primary use-case of `todo!()` macro is to be a much easier to type
alternative to `unimplemented!()` macro.

EDIT: hide unpopular proposal about re-purposing unimplemented

<details>
However, instead of just replacing `unimplemented!()`, it gives it a
more nuanced meaning: a thing which is intentionally left
unimplemented and which should not be called at runtime. Usually,
you'd like to prevent such cases statically, but sometimes you, for
example, have to implement a trait only some methods of which are
applicable. There are examples in the wild of code doing this thing,
and in this case, the current message of `unimplemented`, "not *yet*
implemented" is slightly misleading.

With the addition of TODO, you have three nuanced choices for a
`!`-returning macro (in addition to a good-old panic we all love):

  * todo!()
  * unreachable!()
  * unimplemented!()

Here's a rough guideline what each one means:

- `todo`: use it during development, as a "hole" or placeholder. It
  might be a good idea to add a pre-commit hook which checks that
  `todo` is not accidentally committed.

- `unreachable!()`: use it when your code can statically guarantee
  that some situation can not happen. If you use a library and hit
  `unreachable!()` in the library's code, it's definitely a bug in the
  library. It's OK to have `unreachable!()` in the code base,
  although, if possible, it's better to replace it with
  compiler-verified exhaustive checks.

- `unimplemented!()`: use it when the type checker forces you to
  handle some situation, but there's a contract that a callee must not
  actually call the code. If you use a library and hit
  `unimplemented!()`, it's probably a bug in your code, though
  it *could* be a bug in the library (or library docs) as well. It is
  ok-ish to see an `unimplemented!()` in real code, but it usually
  signifies a clunky, eyebrow-rising API.
</details>
2019-03-19 15:16:43 +01:00
Simon Sapin
8cf720bd19 Make Option<ThreadId> no larger than ThreadId, with NonZeroU64 2019-03-19 14:00:13 +01:00
gnzlbg
144bdc6830 Directly reference the roadmap upstream 2019-03-19 13:58:48 +01:00
gnzlbg
cf5c360064 Export stats::Summary from libtest 2019-03-19 13:58:48 +01:00
gnzlbg
a5e7f0c75b Add missing explicit imports 2019-03-19 13:58:48 +01:00
gnzlbg
25c8f61a9f Move black_box back to rust-lang/libtest and use explicit imports 2019-03-19 13:58:48 +01:00
gnzlbg
008ce99028 Add a README to libtest with a roadmap 2019-03-19 13:58:48 +01:00
gnzlbg
4c38f1928e Allow the staged_api 2019-03-19 13:58:47 +01:00
gnzlbg
6dbb5f7104 Update Cargo.lock 2019-03-19 13:58:47 +01:00
gnzlbg
f2915a6f62 Use feature(test) 2019-03-19 13:58:47 +01:00
gnzlbg
3a9e30f6c9 Use libtest from crates.io 2019-03-19 13:58:47 +01:00
gnzlbg
2957c4c42e Re-export libtest 2019-03-19 13:58:47 +01:00
gnzlbg
95f79380ca Move libtest out of rust-lang/rust 2019-03-19 13:58:47 +01:00
Simon Sapin
7fad370fe9 ASCII uppercase: add "subtract multiplied bool" benchmark 2019-03-19 13:41:59 +01:00
Oliver Scherer
ab41023fd4 Run branch cleanup after copy prop 2019-03-19 12:38:18 +01:00
Saleem Jaffer
776407e4e6 tidy checks 2019-03-19 13:35:50 +05:30
Konrad Borowski
8f261a6abe Update since annotation for ExactSizeIterator for ToUppercase/Lowercase
This functionality was added in 1.35.0, not 1.34.0.
2019-03-19 08:50:02 +01:00
Simon Sapin
c1ec29ace0 ASCII uppercase: add "subtract shifted bool" benchmark 2019-03-19 08:32:15 +01:00
Mazdak Farrokhzad
37789c4a1d
Update src/librustc/hir/mod.rs
Co-Authored-By: llogiq <bogusandre@gmail.com>
2019-03-19 06:10:59 +01:00
bors
ef4d1c4195 Auto merge of #59279 - mati865:clippy, r=Xanewok
Update clippy

Fixes https://github.com/rust-lang/rust/issues/59218

cc @Xanewok
2019-03-19 00:48:06 +00:00
Simon Sapin
0ad91f73d9 Simplify u8::to_ascii_{upp,low}ercase while keeping it fast 2019-03-19 00:50:26 +01:00
Simon Sapin
4a3241a815 Benchmark more possibles impls of [u8]::make_ascii_uppercase 2019-03-19 00:49:06 +01:00
Josh Stone
0dabf8c835 Rebase LLVM to 8.0.0 final 2019-03-18 15:59:24 -07:00
Simon Sapin
b4faa9b456 Remove ASCII_CHARACTER_CLASS table, use match with range patterns instead. 2019-03-18 23:57:09 +01:00
Simon Sapin
6d3840b23a Add benchmarks for u8::is_ascii* 2019-03-18 23:56:50 +01:00
Simon Sapin
525a043c6b Rename src/libcore/benches/ascii_case.rs to ascii.rs 2019-03-18 23:32:36 +01:00
Joshua Liebow-Feeser
de4be2cd85 Stabilize refcell_map_split feature
- Closes #51476
2019-03-18 15:06:34 -07:00
bors
3bf064beaa Auto merge of #56462 - Zoxc:query-macro, r=oli-obk
Define queries using a proc macro

cc @rust-lang/compiler
2019-03-18 21:24:12 +00:00
Simon Sapin
e3fb6f89fe Tidy 2019-03-18 21:28:33 +01:00
varkor
9bc58118fc Rebase over LazyConst changes 2019-03-18 19:46:59 +00:00
varkor
f93ad414ab Rename first_ty_sty to ty_sty 2019-03-18 19:44:52 +00:00
varkor
b39e664ee8 Make clean::Constant display respect f.alternate() 2019-03-18 19:44:52 +00:00
varkor
9925d9b3b6 Fix indentation issue 2019-03-18 19:44:52 +00:00
varkor
38d98a1b22 Implement const generics in generics_to_path_params
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:44:51 +00:00
varkor
cd9a2c0b54 Refactor GenericArgs to include const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:44:51 +00:00
Simon Sapin
fbe34cc521 Add benchmark for not-quite-correct “fake SIMD” make_ascii_uppercase 2019-03-18 20:40:32 +01:00
varkor
29ed491743 Add GenericArg
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:38:23 +00:00
varkor
14913159e0 Implement Clean for const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:38:23 +00:00
varkor
c915fe0245 Rename external_typarams to external_param_names
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:38:23 +00:00
varkor
ec6f983e24 Rename typarams to param_names
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18 19:38:23 +00:00
Simon Sapin
ce933f77c8 Make u8::to_ascii_lowercase and to_ascii_uppercase branchless 2019-03-18 20:16:37 +01:00
Simon Sapin
8740d5d171 Add benchmarks for [u8]::make_ascii_uppercase 2019-03-18 20:08:32 +01:00
Mateusz Mikuła
986f88b86e Update Clippy, RLS and Rustfmt 2019-03-18 18:34:18 +01:00