about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2018-06-03Rollup merge of #51329 - kennytm:trans-left-over, r=oli-obkMark Simulacrum-2/+0
Remove the unused `-Z trans-time-graph` flag. Rebase of #50783 has accidentally revived the flag (which should be renamed to `-Z codegen-time-graph` by #50615).
2018-06-03Rollup merge of #51288 - Mark-Simulacrum:delete-is-import, r=eddybMark Simulacrum-5/+1
Remove rustdoc-specific is_import field from HIR Fixes #47100. I believe that there is no need to check for the name being the same, as this part of rustdoc seems to be strictly interested in exploring "public modules." Re-exports from the same module cannot visit another module; and, re-exports cannot export items with a greater visibility than that item declares. Therefore, I think this code is either sufficient, or in fact does more than is necessary, depending on whether rustdoc cares about the re-export itself. r? @eddyb
2018-06-03Remove is_import fieldMark Simulacrum-5/+1
2018-06-04Remove the unused `-Z trans-time-graph` flag.kennytm-2/+0
Rebase of #50783 has accidentally revived the flag (which should be renamed to `-Z codegen-time-graph` by #50615).
2018-06-03s/panic_fmt/panic_impl/g in docsJorge Aparicio-3/+3
2018-06-03implement #[panic_implementation]Jorge Aparicio-3/+6
2018-06-02Rollup merge of #51291 - evincarofautumn:master, r=oli-obkMark Simulacrum-5/+5
Fix typos of ‘ambiguous’ I had trouble finding this code because of the typo after it was [referenced in a tweet](https://twitter.com/bstrie/status/1002751044605153280). Also fixes an identical but unrelated typo in a comment.
2018-06-02Auto merge of #51274 - nikomatsakis:issue-46557-promote-ref-mut, r=eddybbors-0/+16
also check `let` arms and nested patterns for mutable borrows Fixes #46557 r? @eddyb
2018-06-02Auto merge of #51015 - nikomatsakis:issue-50672-remove-extern-crate-idiom, ↵bors-13/+30
r=alexcrichton merge unused-extern-crate and unnecessary-extern-crate lints Extend the `unused_extern_crates` lint to offer a suggestion to remove the extern crate and remove the `unnecessary_extern_crate` lint. Still a few minor issues to fix: - [x] this *does* now leave a blank line... (defer to https://github.com/rust-lang/rust/issues/51176) - idea: extend the span to be replaced by 1 character if the next character is a `\n` - [x] what about macros? do we need to watch out for that? (defer to https://github.com/rust-lang/rust/issues/48704) - [x] also it doesn't work for `extern crate foo; fn main() { foo::bar(); }` - this is subtle: the `foo` might be shadowing a glob import too, can't always remove - defer to https://github.com/rust-lang/rust/issues/51177 - [x] we also don't do the `pub use` rewrite thang (https://github.com/rust-lang/rust/issues/51013) Spun off from https://github.com/rust-lang/rust/pull/51010 Fixes #50672 r? @alexcrichton
2018-06-02Fix typos of 'ambiguous'Jon Purdy-5/+5
2018-06-01merge UNNECESSARY_EXTERN_CRATE and UNUSED_EXTERN_CRATESNiko Matsakis-13/+30
2018-06-01also check `let` arms and nested patterns for mutable borrowsNiko Matsakis-0/+16
2018-06-01Add Sync impl for SliceJohn Kåre Alsaker-0/+2
2018-06-01Assert that GlobalCtxt is SyncJohn Kåre Alsaker-1/+3
2018-06-01Have worker-local GlobalArenasJohn Kåre Alsaker-4/+4
2018-06-01Ensure ImplicitCtxt is SyncJohn Kåre Alsaker-1/+5
2018-06-01Fix optimization_fuelJohn Kåre Alsaker-1/+2
2018-06-01Remove outdated AllocId decoding function.Michael Woerister-42/+1
2018-06-01Make const decoding from the incremental cache thread-safe.Michael Woerister-41/+180
2018-05-31Stabilize short error formatGuillaume Gomez-13/+1
2018-05-31Auto merge of #51235 - nikomatsakis:issue-51117-borrowck-implicit-deref, r=eddybbors-53/+79
remove notion of Implicit derefs from mem-cat `PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo. Fixes #51117 r? @eddyb
2018-05-31change `PointerKind::Implicit` to a noteNiko Matsakis-53/+79
`PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo. The `note` field, in contrast, is intended more-or-less primarily for this purpose of adding extra data.
2018-05-31Auto merge of #51182 - eddyb:not-just-visibility, r=nikomatsakisbors-75/+77
[MIR] Change "scopes" from "visibility scopes" to "source scopes". These scopes are already used for source-oriented diagnostics, lint levels and unsafety checks. This PR generalizes the naming around scopes, making the type `SourceScope`, and flips (across several commits) the relationship/priority between `LocalDecl`'s "visibility" and "syntactic" scopes. r? @nikomatsakis
2018-05-31Auto merge of #51145 - petrochenkov:npbot, r=alexcrichtonbors-1/+1
resolve: Make sure indeterminate and inconsistent macro resolutions always generate errors Addresses the issue described in https://github.com/rust-lang/rust/pull/50911#issuecomment-392560525 I haven't come up with a minimized reproduction yet, but confirmed that `npbot` now generates the correct error with `![feature(use_extern_macros)]`.
2018-05-31Auto merge of #51220 - ↵bors-48/+82
nikomatsakis:issue-51008-false-positive-lifetime-must-be-declared, r=cramertj reset anonymous-lifetime-mode as we enter `()` scopes Background: The anonymous lifetime mode is used to prohibit elided lifetimes where they didn't used to be permitted, and instead require that `'_` be used. For example: ```rust impl Trait for Ref<T> { .. } // ^^^^^^ ERROR: should be `Ref<'_, T>` ``` When we are parsing the parts of the impl header, we enter into an alternate mode called `CreateParameter`. In this mode, we give an error for things like `Ref<T>`, but for elided lifetimes in a reference type like `&T` we make the elided lifetime into an in-band lifetime: https://github.com/rust-lang/rust/blob/4f99f37b7e213d69a489884f651adfc6d217cef5/src/librustc/hir/lowering.rs#L4017-L4035 This was not intended to change behavior because we only enter into that mode in contexts where elision was not historically permitted. However, the problem is that we fail to reset the mode when we enter into bounds like `Fn(&u32)`, where elision *was* allowed -- the same occurs for fn types like `fn(&u32`). This PR restores the original mode in those contexts. Fixes #51008 r? @cramertj
2018-05-30resolve: Make sure indeterminate and inconsistent macro resolutions always ↵Vadim Petrochenkov-1/+1
generate errors
2018-05-30also reset anon-param-mode for `fn()` typesNiko Matsakis-11/+16
2018-05-30reset the "anonymous lifetime mode" for parenthesized where clausesNiko Matsakis-37/+66
Background: The anonymous lifetime mode is used to prohibit elided lifetimes where they didn't used to be permitted, and instead require that `'_` be used. For example: ```rust impl Trait for Ref<T> { .. } // ^^^^^^ ERROR: should be `Ref<'_, T>` ``` When we are parsing the parts of the impl header, we enter into an alternate mode called `CreateParameter`. In this mode, we give an error for things like `Ref<T>`, but for elided lifetimes in a reference type like `&T` we make the elided lifetime into an in-band lifetime: https://github.com/rust-lang/rust/blob/4f99f37b7e213d69a489884f651adfc6d217cef5/src/librustc/hir/lowering.rs#L4017-L4035 This was not intended to change behavior because we only enter into that mode in contexts where elision was not historically permitted. However, the problem is that we fail to reset the mode when we enter into bounds like `Fn(&u32)`, where elision *was* allowed -- the same occurs for fn types like `fn(&u32`). This PR restores the original mode in those contexts.
2018-05-30rustc: rename mir::LocalDecl's syntactic_source_info to source_info.Eduard-Mihai Burtescu-13/+13
2018-05-30rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.Eduard-Mihai Burtescu-22/+13
2018-05-30rustc: use syntactic (instead of visibility) source info where appropriate.Eduard-Mihai Burtescu-1/+1
2018-05-30rustc: rename mir::LocalDecl's source_info to visibility_source_info.Eduard-Mihai Burtescu-19/+19
2018-05-30rustc: turn mir::LocalDecl's syntactic_scope into a SourceInfo.Eduard-Mihai Burtescu-13/+22
2018-05-30rustc: rename mir::SourceScopeInfo to mir::SourceScopeLocalData.Eduard-Mihai Burtescu-17/+17
2018-05-30rustc: rename mir::VisibilityScope to mir::SourceScope.Eduard-Mihai Burtescu-57/+59
2018-05-30rustc: don't visit lifetime parameters through visit_lifetime.Eduard-Mihai Burtescu-86/+76
2018-05-30Auto merge of #51017 - estebank:crate-name-in-path, r=michaelwoeristerbors-1/+5
Use crate name for reexported `extern crate` paths Fix #43189.
2018-05-29rust-lang/rust#27282: emit `ReadForMatch` on each match arm.Felix S. Klock II-0/+17
Also, turn on ReadForMatch emission by default (when using NLL).
2018-05-29rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.Felix S. Klock II-0/+14
(This is just the data structure changes and some boilerplate match code that followed from it; the actual emission of these statements comes in a follow-up commit.)
2018-05-29Debug flag to bypass restriction of mutation in match guards.Felix S. Klock II-0/+8
Now, if you pass `-Z disable-ast-check-for-mutation-in-guard`, then we will just allow you to mutably-borrow and assign in guards of `match` arms. This is wildly unsound with AST-borrowck. It is also unsound with MIR-borrowck without further adjustments, which come in later in the commit series on this Pull Request. See also rust-lang/rust#24535 and rust-lang/rfcs#1006.
2018-05-29Use polonius_outputSantiago Pastorino-1/+1
2018-05-29expose -Zpolonius flagDouglas Campos-0/+2
2018-05-29bump polonius engineDouglas Campos-1/+1
2018-05-29Auto merge of #50475 - csmoe:debr, r=nikomatsakisbors-147/+314
Refactor DebruijnIndex to be 0-based Fixes #49813
2018-05-28change to 0-based indicesNiko Matsakis-12/+12
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28make depth privateNiko Matsakis-1/+1
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28remove use of depth from `TyS` and replace with a debruijn indexNiko Matsakis-32/+72
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28convert `LateBoundRegionsCollector` to track a debruijn indexNiko Matsakis-6/+15
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28replace use of DebruijnIndex in `for_each_free_region`Niko Matsakis-5/+25
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28refactor `resolve_lifetime` to track outer-index, not depthNiko Matsakis-15/+11
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>