diff options
| author | kennytm <kennytm@gmail.com> | 2018-09-20 21:36:27 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-20 21:36:27 +0800 |
| commit | 2d0262e44ef9854f159401e05d312e8b159d03cf (patch) | |
| tree | e67ac2b7cb2b6c05db0d55d384f0e3a6fa327bd7 /src/test/incremental/thinlto | |
| parent | cf06e03506b23ac425d3c1c700e617849f3c4c62 (diff) | |
| parent | a8ec8e5cb703a5904e8ea96dc4a7b2d96aa25f57 (diff) | |
| download | rust-2d0262e44ef9854f159401e05d312e8b159d03cf.tar.gz rust-2d0262e44ef9854f159401e05d312e8b159d03cf.zip | |
Rollup merge of #54295 - ljedrz:cleanups_rustc_traits, r=nikomatsakis
A few cleanups and minor improvements to rustc/traits
It's a little bigger than usual, so bear with me ^^:
- introduce `TyCtxt::all_impls` and use it to avoid inefficiently allocating push loops
- modify `ArgKind::from_expected_ty` to take an `Option<Span>` argument to make it more versatile
- replace `ArgKind::Arg("_".to_owned(), "_".to_owned())` with `ArgKind::empty`
- move early `return`s earlier where possible
- if all branches of a `match` end with the same expression, move it after it
- change a hacky `match` expression to an `if else` chain
- move the `push` out from a push loop closure to reduce the number of allocations
- correct the vector size for `pretty_predicates` (under `specialize`)
- take advantage of the fact that `if else` is an expression
- prefer `cloned()` to `map(|&x| x)` and `map(|x| *x)`
- prefer `vec![x; y.len()]` to `y.map(|_| x).collect()`
- use `unwrap_or_else` instead of `match` where applicable
- use `if let` instead of `match` when only one branch matters
- prefer `to_owned` to `to_string` for string literals
- remove explicit `return`s
- remove superfluous braces
- whitespace fixes
- several other minor improvements
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
