about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-08-04Privatize some exports from code_statsMark Rousskov-2/+2
2018-08-04Auto merge of #52927 - Mark-Simulacrum:cratestore-cleanup, r=alexcrichtonbors-302/+255
Crate store cleanup Each commit mostly stands on its own. Most of the diff is lifetime-related and uninteresting.
2018-08-03Auto merge of #53034 - Manishearth:clippyup, r=oli-obkbors-5/+19
Update clippy r? @kennytm @alexcrichton
2018-08-03Auto merge of #52973 - davidtwco:issue-52663-lifetimes-not-included-in-span, ↵bors-5/+103
r=pnkfelix NLL mentions lifetimes that are not included in printed span(s). Part of #52663. r? @pnkfelix
2018-08-03Move unused trait functions to inherent functionsMark Rousskov-101/+81
2018-08-03Update clippyManish Goregaokar-5/+19
2018-08-03Store concrete crate stores where possibleMark Rousskov-105/+101
2018-08-03Visibility is now a queryMark Rousskov-5/+0
2018-08-03Delete dummy crate storeMark Rousskov-63/+0
2018-08-03Move validate_crate_name to rustc_metadataMark Rousskov-30/+75
2018-08-03Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJungbors-617/+627
Reintroduce `Undef` and properly check constant value sizes r? @RalfJung cc @eddyb basically all kinds of silent failures that never occurred are assertions now
2018-08-03Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichtonbors-0/+12
Disable debug sections when optimization flags is set for LLD. Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901) Using `--strip-debug` along with the `-O` option.
2018-08-03Unify API of `Scalar` and `ScalarMaybeUndef`Oliver Schneider-2/+6
2018-08-03Reintroduce alignment checkOliver Schneider-0/+1
2018-08-03Remove spurious whitespaceOliver Schneider-1/+1
2018-08-03Auto merge of #52948 - davidtwco:issue-52633-later-loop-iteration, r=pnkfelixbors-13/+92
NLL: Better Diagnostic When "Later" means "A Future Loop Iteration" Part of #52663. r? @pnkfelix
2018-08-03Remove some more unnecessary `mut`Oliver Schneider-4/+4
2018-08-03Auto merge of #52925 - RalfJung:sanity_check, r=oli-obkbors-3/+9
check_const: use the same ParamEnv as codegen for statics Fixes at least part of https://github.com/rust-lang/rust/issues/52849 (my CTFE-stress benchmark). Note that I do not know what I am doing here, this is just based on hints from @oli-obk. r? @oli-obk
2018-08-03Auto merge of #52919 - alexcrichton:update-cargo, r=Mark-Simulacrumbors-68/+259
Update tool submodules, update feature unification strategy * Bring in some fixes for `cargo fix` * Update RLS/rustfmt to keep them compiling * Update all tools to [depend on `rustc-workspace-hack`](https://github.com/rust-lang/rust/pull/52919#issuecomment-409802418) * Change how we deal with feature unification amongst these builds.
2018-08-02Update Cargo submoduleAlex Crichton-68/+259
Bring in some fixes for `cargo fix` notably
2018-08-03Auto merge of #51657 - wesleywiser:wip_profiling, r=eddybbors-1/+332
Implement a self profiler This is a work in progress implementation of #50780. I'd love feedback on the overall structure and code as well as some specific things: - [The query categorization mechanism](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-19e0a69c10eff31eb2d16805e79f3437R101). This works but looks kind of ugly to me. Perhaps there's a better way? - [The profiler assumes only one activity can run at a time](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-f8a403b2d88d873e4b27c097c614a236R177). This is obviously incompatible with the ongoing parallel queries. - [The output code is just a bunch of `format!()`s](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-f8a403b2d88d873e4b27c097c614a236R91). Is there a better way to generate markdown or json in the compiler? - [The query categorizations are likely wrong](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-19e0a69c10eff31eb2d16805e79f3437R101). I've marked what seemed obvious to me but I'm sure I got a lot of them wrong. The overhead currently seems very low. Running `perf` on a sample compilation with profiling enabled reveals: ![image](https://user-images.githubusercontent.com/831192/41657821-9775efec-7462-11e8-9e5e-47ec94105d9d.png)
2018-08-02Generate self-profiler types with macrosWesley Wiser-130/+91
2018-08-02Fix tidyWesley Wiser-12/+25
2018-08-02Remove some dead codeWesley Wiser-17/+1
2018-08-02Include additional data in the json outputWesley Wiser-3/+12
2018-08-02Include query hits/totalsWesley Wiser-3/+10
2018-08-02Refactor json printingWesley Wiser-35/+21
2018-08-02First pass at json outputWesley Wiser-0/+56
2018-08-02Fix more missed query dataWesley Wiser-0/+9
2018-08-02Remove redundant s in outputWesley Wiser-1/+1
2018-08-02Fix some missed query dataWesley Wiser-4/+3
2018-08-02Switch to markdown outputWesley Wiser-12/+15
2018-08-02Add units to timesWesley Wiser-1/+1
2018-08-02Basic incremental statsWesley Wiser-9/+55
2018-08-02Basic profilingWesley Wiser-1/+259
2018-08-02Auto merge of #52841 - petrochenkov:premacro, r=alexcrichtonbors-135/+675
resolve: Implement prelude search for macro paths, implement tool attributes When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment in `fn resolve_lexical_macro_path_segment` for more details. "Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude. This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope. The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order. If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway). Fixes https://github.com/rust-lang/rust/issues/52576 Fixes https://github.com/rust-lang/rust/issues/52512 Fixes https://github.com/rust-lang/rust/issues/51277 cc https://github.com/rust-lang/rust/issues/52269
2018-08-02Auto merge of #52782 - pnkfelix:issue-45696-dangly-paths-for-box, r=eddybbors-9/+586
[NLL] Dangly paths for box Special-case `Box` in `rustc_mir::borrow_check`. Since we know dropping a box will not access any `&mut` or `&` references, it is safe to model its destructor as only touching the contents *owned* by the box. ---- There are three main things going on here: 1. The first main thing, this PR is fixing a bug in NLL where `rustc` previously would issue a diagnostic error in a case like this: ```rust fn foo(x: Box<&mut i32>) -> &mut i32 { &mut **x } ``` such code was accepted by the AST-borrowck in the past, but NLL was rejecting it with the following message ([playground](https://play.rust-lang.org/?gist=13c5560f73bfb16d6dab3ceaad44c0f8&version=nightly&mode=release&edition=2015)) ``` error[E0597]: `**x` does not live long enough --> src/main.rs:3:40 | 3 | fn foo(x: Box<&mut i32>) -> &mut i32 { &mut **x } | ^^^^^^^^ - `**x` dropped here while still borrowed | | | borrowed value does not live long enough | note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 3:1... --> src/main.rs:3:1 | 3 | fn foo(x: Box<&mut i32>) -> &mut i32 { &mut **x } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error ``` 2. The second main thing: The reason such code was previously rejected was because NLL (MIR-borrowck) incorporates a fix for issue #31567, where it models a destructor's execution as potentially accessing any borrows held by the thing being destructed. The tests with `Scribble` model this, showing that the compiler now catches such unsoundness. However, that fix for issue #31567 is too strong, in that NLL (MIR-borrowck) includes `Box` as one of the types with a destructor that potentially accesses any borrows held by the box. This thus was the cause of the main remaining discrepancy between AST-borrowck and MIR-borrowck, as documented in issue #45696, specifically in [the last example of this comment](https://github.com/rust-lang/rust/issues/45696#issuecomment-345367873), which I have adapted into the `fn foo` shown above. We did close issue #45696 back in December of 2017, but AFAICT that example was not fixed by PR #46268. (And we did not include a test, etc etc.) This PR fixes that case, by trying to model the so-called `DerefPure` semantics of `Box<T>` when we traverse the type of the input to `visit_terminator_drop`. 3. The third main thing is that during a review of the first draft of this PR, @matthewjasper pointed out that the new traversal of `Box<T>` could cause the compiler to infinite loop. I have adjusted the PR to avoid this (by tracking what types we have previously seen), and added a much needed test of this somewhat odd scenario. (Its an odd scenario because the particular case only arises for things like `struct A(Box<A>);`, something which cannot be constructed in practice.) Fix #45696.
2018-08-02Auto merge of #52949 - Mark-Simulacrum:snap, r=alexcrichtonbors-277/+34
Switch to bootstrapping from 1.29 beta r? @alexcrichton
2018-08-02Auto merge of #52975 - ↵bors-3/+43
pnkfelix:issue-52967-edition-2018-implies-2-phase-borrows, r=Mark-Simulacrum NLL migration in the 2018 edition needs two-phase borrows too! NLL migration in the 2018 edition needs two-phase borrows too! Fix #52967.
2018-08-02When we turn on NLL migration in the 2018 edition, we need two-phase borrows ↵Felix S. Klock II-3/+43
too! Fix #52967.
2018-08-02Second field of ScalarPair can be undef in some casesOliver Schneider-18/+28
2018-08-02Auto merge of #52906 - RalfJung:jemalloc, r=alexcrichtonbors-5/+4
enable jemalloc assertions when configured to do so This is essentially a re-submission of the functional part of https://github.com/rust-lang/rust/pull/43648. I was unable to reproduce the issue I had back then, maybe something changed somewhere to no longer trigger the assertion. Fixes https://github.com/rust-lang/rust/issues/44152
2018-08-02Explicitly label any named lifetimes mentioned in error messages.David Wood-5/+103
2018-08-02Auto merge of #52890 - djrenren:test-visibility, r=petrochenkovbors-5/+100
Reexport tests without polluting namespaces This should fix issue #52557. Basically now we gensym a new name for the test function and reexport that. That way the test function's reexport name can't conflict because it was impossible for the test author to write it down. We then use a `use` statement to expose the original name using the original visibility.
2018-08-02Reading values should not be looking at the variantOliver Schneider-19/+7
2018-08-02Auto merge of #52847 - upsuper:thread-stack-reserve, r=alexcrichtonbors-1/+4
Don't commit thread stack on Windows On Windows, there is a system level resource limitation called commit limit, which is roughly the sum of physical memory + paging files[1]. `CreateThread` by default commits the stack size[2], which unnecessarily takes such resource from the shared limit. This PR changes it to only reserve the stack size rather than commit it. Reserved memory would only take the address space of the current process until it's actually accessed. This should make the behavior on Windows match other platforms, and is also a pretty standard practice on Windows nowadays. [1] https://blogs.technet.microsoft.com/markrussinovich/2008/11/17/pushing-the-limits-of-windows-virtual-memory/ [2] https://docs.microsoft.com/zh-cn/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createthread
2018-08-02Auto merge of #52787 - riscv-rust:riscv-rust-pr, r=alexcrichtonbors-2/+137
Enable RISCV - Enable LLVM backend. - Implement call abi. - Add built-in target riscv32imac-unknown-none. - Enable CI.
2018-08-02Auto merge of #52206 - RalfJung:zst-slices, r=alexcrichtonbors-212/+277
slices: fix ZST slice iterators making up pointers; debug_assert alignment in from_raw_parts This fixes the problem that we are fabricating pointers out of thin air. I also managed to share more code between the mutable and shared iterators, while reducing the amount of macros. I am not sure how useful it really is to add a `debug_assert!` in libcore. Everybody gets a release version of that anyway, right? Is there at least a CI job that runs the test suite with a debug version? Fixes #42789
2018-08-02use the same length computation everywhereRalf Jung-21/+10
2018-08-02Introduce another way to compute the length, to fix position codegen regressionRalf Jung-8/+21