forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 2
rebase code from rust-lang/rust master branch #6
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bump to 1.39 r? @Centril
Add lint for excess trailing semicolons Closes #60876. A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning. For the following example: ``` fn main() { extra_semis(); } fn extra_semis() -> i32 { let mut sum = 0;;; for i in 0..10 { if i == 5 { continue;; } else if i == 9 { break;; } else { sum += i;; } } return sum;; } ``` The output is: ``` warning: unnecessary trailing semicolons --> src/main.rs:5:21 | 5 | let mut sum = 0;;; | ^^ help: remove these semicolons | = note: `#[warn(redundant_semicolon)]` on by default warning: unnecessary trailing semicolon --> src/main.rs:8:22 | 8 | continue;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:10:19 | 10 | break;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:12:22 | 12 | sum += i;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:15:16 | 15 | return sum;; | ^ help: remove this semicolon warning: unreachable statement --> src/main.rs:8:22 | 8 | continue;; | ^ | = note: `#[warn(unreachable_code)]` on by default warning: unreachable statement --> src/main.rs:10:19 | 10 | break;; | ^ warning: unreachable statement --> src/main.rs:15:16 | 15 | return sum;; | ^ ```
Miri: Check that a ptr is aligned and inbounds already when evaluating `*` This syncs Miri with what the Nomicon and the Reference say, and resolves rust-lang/miri#447. Also this would not have worked without #62982 due to new cycles. ;) r? @oli-obk
libsyntax: cleanup and refactor `pat.rs` A smaller refactoring & cleanup of `pat.rs` (best read commit by commit). r? @petrochenkov
Point at the right enclosing scope when using `await` in non-async fn Fix #63398.
syntax: Remove `DummyResult::expr_only` The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported. This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments. (There wasn't even a test making sure it worked.) Addresses #63468 (comment) r? @estebank
expand: Unimplement `MutVisitor` on `MacroExpander` Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention. It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass. So, it shouldn't hide under a generic visitor call. Also, from all the implemented visitor methods only two were actually used. cc #63468 (comment)
Add NodeId for Arm, Field and FieldPat Extracted from #63468
Merge Variant and Variant_ Extracted from #63468.
move test that shouldn't be in test/run-pass/ We no longer test `src/test/run-pass/`; the proper way now is `// run-pass` in `src/test/ui/` r? @petrochenkov
Rollup of 11 pull requests Successful merges: - #62984 (Add lint for excess trailing semicolons) - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`) - #63490 (libsyntax: cleanup and refactor `pat.rs`) - #63507 (When needing type annotations in local bindings, account for impl Trait and closures) - #63509 (Point at the right enclosing scope when using `await` in non-async fn) - #63528 (syntax: Remove `DummyResult::expr_only`) - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`) - #63542 (Add NodeId for Arm, Field and FieldPat) - #63543 (Merge Variant and Variant_) - #63560 (move test that shouldn't be in test/run-pass/) - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates) Failed merges: r? @ghost
Reduce the genericity of closures in the iterator traits By default, closures inherit the generic parameters of their scope, including `Self`. However, in most cases, the closures used to implement iterators don't need to be generic on the iterator type, only its `Item` type. We can reduce this genericity by redirecting such closures through local functions. This does make the closures more cumbersome to write, but it will hopefully reduce duplication in their monomorphizations, as well as their related type lengths.
That way, callers don't need to repeat "let's add this to sm manually for tracking dependencies" trick. It should make it easier to switch to using `FileLoader` for binary files in the future as well
The grouping led to a lot of `mv`. Therefore, some relative paths were wrong. In this commit the dependent files were also moved so that the paths work again.
In sys/unix/process, we work around the sigemptyset linking issues on android in two different ways. This change consolidates these workarounds, and avoids duplicating bindings from `libc`.
rustc_mir: fix miri substitution/"universe" discipline. Alternative to #61041, based on @RalfJung's own attempt at it. I haven't done a full audit, but I believe everything is fixed now. Fixes #61432. Closes #61336, as a drive-by fix (for a subset of #43408, that is already special-cased). r? @oli-obk / @RalfJung cc @varkor @yodaldevoid
Move token gluing to token stream parsing work towards #63689, this moves token gluing from the lexer to the token tree layer. This is only a minimal step, but I like the negative diff here. r? @petrochenkov
Update Clippy and cargo r? @Manishearth @oli-obk
avoid unnecessary reservations in std::io::Take::read_to_end Prevously the `read_to_end` implementation for `std::io::Take` used its own `limit` as a cap on the `reservation_size`. However, that could still result in an over-allocation like this: 1. Call `reader.take(5).read_to_end(&mut vec)`. 2. `read_to_end_with_reservation` reserves 5 bytes and calls `read`. 3. `read` writes 5 bytes. 4. `read_to_end_with_reservation` reserves 5 bytes and calls `read`. 5. `read` writes 0 bytes. 6. The read loop ends with `vec` having length 5 and capacity 10. The reservation of 5 bytes was correct for the read at step 2 but unnecessary for the read at step 4. By that second read, `Take::limit` is 0, but the `read_to_end_with_reservation` loop is still using the same `reservation_size` it started with. Solve this by having `read_to_end_with_reservation` take a closure, which lets it get a fresh `reservation_size` for each read. This is an implementation detail which doesn't affect any public API.
Fix bug in iter::Chain::size_hint `Chain::size_hint` currently ignores `self.state`, which means that the size hints of the underlying iterators are always combined regardless of the iteration state. This, of course, should only happen when the state is `ChainState::Both`.
…richton Don't use stage naming in RUSTFLAGS environment variables This patch supports less behavior than before, since specifiying stage 1 vs stage 2 is no longer possible, but that is presumably a somewhat rare use case anyway, so not supporting it seems acceptable (and it can be readded easily if desired). Fixes #33609
Consolidate sigemptyset workarounds In sys/unix/process, we work around the sigemptyset linking issues on android in two different ways. This change consolidates these workarounds, and avoids duplicating bindings from `libc`.
Rollup of 7 pull requests Successful merges: - #63216 (avoid unnecessary reservations in std::io::Take::read_to_end) - #63265 (Implement `nth_back` for ChunksExactMut) - #63691 (Fix bug in iter::Chain::size_hint) - #63722 (Don't use stage naming in RUSTFLAGS environment variables) - #63723 (Consolidate sigemptyset workarounds) - #63736 (Restore the rustc_plugin crate in the sysroot) - #63743 (Allow git to merge `Cargo.lock`) Failed merges: r? @ghost
Fix double resolving custom libdir Fixes #62496 Related issue is https://bugs.gentoo.org/672816
Stabilize `async_await` in Rust 1.39.0 Here we stabilize: - free and inherent `async fn`s, - the `<expr>.await` expression form, - and the `async move? { ... }` block form. Closes #62149. Closes #50547. All the blockers are now closed. <details> - [x] FCP in #62149 - [x] #61949; PR in #62849. - [x] #62517; PR in #63376. - [x] #63225; PR in #63501 - [x] #63388; PR in #63499 - [x] #63500; PR in #63501 - [x] #62121 (comment) - [x] Some tests for control flow (PR #63387): - `?` - `return` in `async` blocks - `break` - [x] #61775 (comment), i.e. tests for #60944 with `async fn`s instead). PR in #63383 </details> r? @cramertj
…from-src/test, r=Centril Cherry-pick src/test changes with Centril's changes None
rustc_metadata: replace LazySeq<T> with Lazy<[T]>. Part of #59953, split out for separate landing (see #59953 (comment)). r? @Zoxc
n-salim
approved these changes
Aug 20, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @n-salim