- 20 6月, 2018 18 次提交
-
-
由 bors 提交于
Reduce number of allocations done by NLL A couple of easy wins. Here are the NLL speedups that exceed 1%: ``` sentry-cli-check avg: -3.5% min: -3.5% max: -3.5% inflate-check avg: -1.9% min: -1.9% max: -1.9% inflate avg: -1.7% min: -1.7% max: -1.7% clap-rs-check avg: -1.6% min: -1.6% max: -1.6% cargo-check avg: -1.6% min: -1.6% max: -1.6% ripgrep-check avg: -1.4% min: -1.4% max: -1.4% serde-check avg: -1.2% min: -1.2% max: -1.2% regex-check avg: -1.0% min: -1.0% max: -1.0% sentry-cli avg: -1.0% min: -1.0% max: -1.0% ``` r? @nikomatsakis
-
由 bors 提交于
Update the error message for a missing global allocator Don’t mention `#[default_lib_allocator]` (which is an implementation detail irrelevant to most users) and instead suggest using `#[global_allocator]`, which is often the correct fix.
-
由 bors 提交于
NLL diagnostics: revise `fn check_access_permissions` NLL: revise `fn check_access_permissions` so that its (still branchy) shares more code paths between the different cases, and also provide more diagnostics in more cases (though the added diagnostics still do not always meet the quality bar established by AST-borrowck) ---- Transcribing "checklist" suggested by Niko, except I am rendering it as a table to make it clear that I do not regard every item in the list to be a "must have" for landing this PR. goal | does this PR do it? -----|------------------------------ no suggestions for `ref mut` | yes suggestions for direct local assignment (`{ let x = 3; x = 4; }`) | yes (see commits at end) suggestions for direct field assignment (`{ let x = (3, 4); x.0 = 5; }` | yes (see commits at end) suggestions for upvars (`let x = 3; let c = \|\| { &mut x; }`) | yes Note that I added support for a couple of rows via changes that are not strictly part of `fn check_access_permissions`. If desired I can remove those commits from this PR and leave them for a later PR. Fix #51031 Fix #51032 (bug #51191 needs a little more investigation before closing.) Fix #51578
-
由 bors 提交于
Rename OOM to allocation error The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`
-
由 Simon Sapin 提交于
Don’t mention `#[default_lib_allocator]` (which is an implementation detail irrelevant to most users) and instead suggest using `#[global_allocator]`, which is often the correct fix.
-
由 Simon Sapin 提交于
-
由 Felix S. Klock II 提交于
(since I made this mistake at first but the tests didn't catch it): we should not suggest adding `mut` to a reassigned `ref` or `ref mut` binding. (The Rust language, since at least 1.0, does not have `mut ref mut` or `ref mut mut` etc.)
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
(Follow-on commits updating the test suite show the resulting changes to diagnostic output.)
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
Tried to unify various common code paths and also vaguely approximate the AST-borrowck diagnostics. The change in (subjective) quality of diagnostics is not a universal improvement. But I think this is a better code base to work from for future fixes.
-
由 Felix S. Klock II 提交于
As a drive-by, removed some dead-code.
-
由 Felix S. Klock II 提交于
Namely, we thread down the `HirId` of the explicit type of the argument. In the case of the special `self` variable with an implicit type, we also thread down a description of its structure (`self`/`mut self`/`&self`/`&mut self`).
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
Thread info about form of variable bindings, including spans of arg types, down into `mir::LocalDecls`. As a drive-by: the ref_for_guards created by `fn declare_binding` should not have been tagged as user_variables in the first place. These secret internal locals are *pointers* to user variables, but themselves are not such (IMO. For now at least.)
-
- 19 6月, 2018 21 次提交
-
-
由 bors 提交于
Use String, not &str in some collection examples Discussed in #46966 Overuse of borrowed values in data structures is a common mistake I see in Rust user forums. Users who copy&paste such examples end up fighting with the borrow checker as soon as they replace string literals with some real values. This changes a couple of examples to use `String`, and it adds opportunity to demonstrate use of `Borrow`.
-
由 bors 提交于
Update books for next release
-
由 bors 提交于
Add ability to apply custom derive to union types. The Union item type has been included in the allowed types for a custom derive. fyi @abonander Closes #50223
-
由 bors 提交于
Run some stuff in parallel Requires https://github.com/rust-lang/rust/pull/50699 to actually work correctly. r? @nikomatsakis
-
由 bors 提交于
Fix processing mod with multi-level path on Windows Fix error in [rustfmt](https://github.com/rust-lang-nursery/rustfmt/issues/1754) because libsyntax can not handle `mod` with multilevel path on Windows. Alternative is do almost same in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/windows/fs.rs#L717 to allow work on paths with different separators, Ex. "\\\\?\\c:\\windows/temp"
-
由 Steve Pentland 提交于
The Union item type has been included in the allowed types for a custom derive. Closes #50223
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
由 Nicholas Nethercote 提交于
These vectors are always small, so this avoids lots of allocations.
-
由 Nicholas Nethercote 提交于
`has_any_child_of` is hot. It allocates a `Vec` that almost always doesn't exceed a length of 1. This patch peels off the first iteration of the loop, avoiding the need for the `Vec` creation in ~99% of cases.
-
由 bors 提交于
Declare DebruijnIndex via newtype_index macro Part of #49887 Declare `DebruijnIndex` via the `newtype_index` macro.
-
由 Simon Sapin 提交于
The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
-
由 bors 提交于
Stabilize std::path::Path::ancestors Closes #48581 r? @BurntSushi
-
由 Tobias Stolzmann 提交于
-
由 bors 提交于
Improve memoization and refactor NLL type check I have a big branch that is refactoring NLL type check with the goal of introducing canonicalization-based memoization for all of the operations it does. This PR contains an initial prefix of that branch which, I believe, stands alone. It does introduce a few smaller optimizations of its own: - Skip operations that are trivially a no-op - Cache the results of the dropck-outlives computations done by liveness - Skip resetting unifications if nothing changed r? @pnkfelix
-
由 Mark Simulacrum 提交于
- 18 6月, 2018 1 次提交
-
-
由 bors 提交于
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
-