about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2017-08-16Auto merge of #43838 - eddyb:stable-rvalue-promotion, r=arielb1bors-98/+87
Stabilize rvalue promotion to 'static. Closes #38865. Documentation PR at rust-lang-nursery/reference#98.
2017-08-16Stabilize rvalue promotion to 'static.Eduard-Mihai Burtescu-98/+87
2017-08-16Auto merge of #43108 - pnkfelix:mir-borrowck3c, r=arielb1bors-1098/+2940
MIR borrow check (under debug flag) Here is the current state of MIR borrow check. It consists of (1.) some refactoring, (2.) a dataflow analysis to identify the borrows themselves, and (3.) a mir "transform" that does the borrow check itself based on the aforementioned dataflow results. (There's also a drive-by fix to dataflow that I can factor into a separate PR if necessary. Interestingly I could not find a way to observe the bug outside of MIR borrowck.) To be clear, this branch is not ready to be used as the default borrow check. Thus the code is guarded: To get mir-borrowck to run, you need to either supply an attribute `#[rustc_mir_borrowck]` or a debug flag `-Z borrowck-mir`. Here are the main issues with the current MIR borrowck as it stands in this PR: * No Notes emitted yet, just errors. (So the feedback is definitely inferior compared to AST borrowck today) * Lvalue rendering differs between Ast and Mir. (Mostly minor, but replacement of field names with indices is very bad; big priority for me to fix ASAP.) * Lots of ICEs (presumably because some MIR operations used here have well-formedness assumptions that are violated in borrowck-broken code) * Conflates lots of cases that are distinguished by AST-borrowck * Conflates "uninitialized" with "moved" (special case of previous bullet, one that I think should be fixed ASAP) (I am hoping to fix as many of the above issues as I can in the near term, but I also would like to land this even if they are *not* all fixed, because the rebasing effort is getting to be a real drag.)
2017-08-16Moved mir-borrowck pass down to where comments say it should be.Felix S. Klock II-1/+9
Added two fixmes: The `SimplifyBranches` pass cannot stay where it is, and `BorrowckMir` should be a query, not a pass. But I am going to leave those changes to a future PR.
2017-08-16Address review comment: `StatementKind::StorageDead` has an effect (running ↵Felix S. Klock II-2/+10
dtors) relevant to borrowck.
2017-08-16Cleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.Felix S. Klock II-21/+11
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
2017-08-16Added some documentation for the `struct BlockSets` in `rustc_mir::dataflow`.Felix S. Klock II-0/+19
2017-08-16MIR based borrow check (opt-in).Felix S. Klock II-4/+1422
One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute to opt into MIR based borrow checking. Note that regardless of whether one opts in or not, AST-based borrow check will still run as well. The errors emitted from AST-based borrow check will include a "(Ast)" suffix in their error message, while the errors emitted from MIR-based borrow check will include a "(Mir)" suffix. post-rebase: removed check for intra-statement mutual conflict; replaced with assertion checking that at most one borrow is generated per statement. post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
2017-08-16Factored `MoveData` construction code into `builder` submodule.Felix S. Klock II-313/+334
2017-08-16Move `DataFlowState::{each_bit,interpret_set}` method definitions to parent ↵Felix S. Klock II-50/+56
module. Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of its implementation lives in `rustc_data_structures`.
2017-08-16remove now unnecessary constraint on BitDenotation for `fn do_dataflow`.Felix S. Klock II-2/+1
2017-08-16Migrated some code out of `dataflow::drop_flag_effects` and into its parent ↵Felix S. Klock II-74/+71
module. (This code is more general purpose than just supporting drop flag elaboration.)
2017-08-16Added dataflow analysis for `Borrows`.Felix S. Klock II-1/+187
post-rebase: addressed review comment: rename `loc_map`/`location_map` and `rgn_map`/`region_map`. post-rebase: remove now unnecessary `mut` decl. post-rebase: address comments: bind iterator expr, and alpha-rename `loc`/`location` and `idx`/`index`.
2017-08-16Refactor `trait BitDenotation` to take `Location` instead of ↵Felix S. Klock II-40/+29
`BasicBlock`/`usize` argument pairs.
2017-08-16Move borrowck error msg construction to module in `rustc_mir` (for later ↵Felix S. Klock II-599/+800
reuse by mir borrowck). post-rebase: Do not put "(Ast)" suffix in error msg unless passed `-Z borrowck-mir`. (But unconditionally include "(Mir)" suffix for mir-borrowck errors.)
2017-08-16Auto merge of #43850 - GuillaumeGomez:unused-variable-lint, r=arielb1bors-3/+19
Add a note to unused variables Fixes #26720.
2017-08-16Add a note to unused variablesGuillaume Gomez-3/+19
2017-08-16Auto merge of #43841 - alexcrichton:fix-another-regression, r=eddybbors-19/+62
rustc: Fix `unknown_lints` next to an unknown lint The lint refactoring in #43522 didn't account for `#[allow(unknown_lints)]` happening at the same node as an unknown lint itself, so this commit updates the handling to ensure that the local set of lint configuration being built is queried before looking at the chain of lint levels. Closes #43809
2017-08-16Auto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, ↵bors-3/+13
r=QuietMisdreavus Clarify writable behavior of readonly-named `Permissions` methods. Opened primarily to fix https://github.com/rust-lang/rust/issues/41984.
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-1376/+1376
r=Mark-Simulacrum use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
2017-08-15Clarify 'writable'-changing behavior of `set_readonly`.Corey Farwell-1/+5
Fixes https://github.com/rust-lang/rust/issues/41984.
2017-08-16Auto merge of #43651 - petrochenkov:foreign-life, r=eddybbors-14/+18
Fix ICE with elided lifetimes in return type of foreign functions cc https://github.com/rust-lang/rust/issues/43567 This is for a preliminary crater/cargobomb run. Lifetime elision in foreign functions now works exactly like in other functions or function-like entities. If the breakage is significant, I'll have to partially revert https://github.com/rust-lang/rust/pull/43543 (all the stuff that was required for dealing with late bound lifetimes in this position). r? @eddyb
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1376/+1376
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Auto merge of #43245 - Gankro:drain-filter, r=sfacklerbors-0/+281
Add Vec::drain_filter This implements the API proposed in #43244. So I spent like half a day figuring out how to implement this in some awesome super-optimized unsafe way, which had me very confident this was worth putting into the stdlib. Then I looked at the impl for `retain`, and was like "oh dang". I compared the two and they basically ended up being the same speed. And the `retain` impl probably translates to DoubleEndedIter a lot more cleanly if we ever want that. So now I'm not totally confident this needs to go in the stdlib, but I've got two implementations and an amazingly robust test suite, so I figured I might as well toss it over the fence for discussion.
2017-08-15Auto merge of #43635 - ids1024:backtrace-redox, r=alexcrichtonbors-45/+197
Make backtraces work on Redox, copying Unix implementation The `backtrace/` directory here is the same as the Unix one, except for adding an implementation of `get_executable_filename`.
2017-08-15Auto merge of #43500 - murarth:string-retain, r=alexcrichtonbors-0/+95
Add method `String::retain` Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool` and reducing the string to only characters for which the predicate returns `true`.
2017-08-15Clarify `readonly` method is also about being 'unwritable'.Corey Farwell-1/+1
2017-08-15Add comments clarifying behavior of unix `set_readonly` behavior.Corey Farwell-1/+7
2017-08-15Auto merge of #43303 - redox-os:redox_docker, r=alexcrichtonbors-1/+56
Add Redox Dockerfile and Travis Environment This adds Redox to the Travis build. This is an example implementation of https://github.com/rust-lang/rust/issues/43206
2017-08-15Mark install-x86_64-redox.sh as executableJeremy Soller-0/+0
2017-08-15Auto merge of #43863 - steveklabnik:ship-the-rustdoc-book, r=frewsxcvbors-33/+6
Ship the rustdoc book Fixes #42322, as it's the last step. Blocked on https://github.com/rust-lang/rust/pull/43790, though they will not conflict. r? @rust-lang/docs
2017-08-15Auto merge of #43859 - arielb1:nonfree-block-live, r=nagisabors-3/+97
emit StorageLive for box temporaries We started emitting StorageDead, so we better emit the corrseponding StorageLive to avoid problems. cc #43772 solson/miri#303
2017-08-14Add method `String::retain`Murarth-0/+95
Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool` and reducing the string to only characters for which the predicate returns `true`.
2017-08-15Auto merge of #43872 - frewsxcv:rollup, r=frewsxcvbors-14/+134
Rollup of 6 pull requests - Successful merges: #43756, #43790, #43846, #43848, #43862, #43868 - Failed merges:
2017-08-14Remove plugins chaptersteveklabnik-32/+2
we don't want to support plugins
2017-08-14Rollup merge of #43868 - lukaramu:issue-43866, r=steveklabnikCorey Farwell-0/+2
Add missing newline in Deref docs to fix rendering Fixes #43866. (Verified locally.) r? @steveklabnik
2017-08-14Rollup merge of #43862 - QuietMisdreavus:get-in-line-autohide, r=GuillaumeGomezCorey Farwell-1/+1
rustdoc: put auto-hidden docblock labels in line with the toggle before: ![image](https://user-images.githubusercontent.com/5217170/29279951-0cf21d86-80df-11e7-86d5-bfd76c5df429.png) after: ![image](https://user-images.githubusercontent.com/5217170/29279962-18479ce2-80df-11e7-952a-d22cb03965e5.png) (images taken from `std::heap::AllocErr`)
2017-08-14Rollup merge of #43848 - frewsxcv:frewsxcv-stack-size, r=QuietMisdreavusCorey Farwell-10/+45
Rewrite/reorganize docs for stack size/thread names for spawned threads. * Moves docs about stack size and thread naming from `Builder` to the `std::thread` module * Adds more links to the new module-level documentation * Mentions the 2 MiB stack size default, but indicate it's subject to change Fixes https://github.com/rust-lang/rust/issues/43805.
2017-08-14Rollup merge of #43790 - steveklabnik:rustdoc-passes, r=QuietMisdreavusCorey Farwell-1/+84
Write the "passes" chapter of the rustdoc book cc #42322 r? @rust-lang/docs
2017-08-14Rollup merge of #43756 - sfackler:instant-nondecreasing, r=alexcrichtonCorey Farwell-2/+2
Instant is monotonically nondecreasing We don't want to guarantee that `Instant::now() != Instant::now()` is always true since that depends on the speed of the processor and the resolution of the clock.
2017-08-14Auto merge of #43858 - arielb1:escaping-default, r=eddybbors-4/+39
remove the "defaulted unit" type bit during writeback The defaulted unit bit is only relevant for the surrounding inference context, and can cause trouble, including spurious lints and ICEs, outside of it. Fixes #43853. r? @eddyb
2017-08-14Move Redox Dockerfile to disabled directory :(Jeremy Soller-0/+0
2017-08-14Use scripts to reduce code sizeJeremy Soller-33/+23
2017-08-14Add redox build to crossJeremy Soller-6/+29
2017-08-14Add Redox DockerfileJeremy Soller-0/+42
2017-08-14Add missing newline in Deref docs to fix renderinglukaramu-0/+2
Fixes #43866.
2017-08-14Auto merge of #43826 - kennytm:fix-43796-mis-calculated-spans, r=petrochenkovbors-123/+33
Fix "Mis-calculated spans" errors from `-Z save-analysis` + refactoring Removed the path span extraction methods from `SpanUtils`: * spans_with_brackets * spans_for_path_segments * spans_for_ty_params Use the `span` fields in `PathSegment` and `TyParam` instead. (Note that since it processes `ast::Path` not a qualified path (`hir::QPath` / `ast::QSelf`), UFCS path will be flattened: `<Foo as a::b::c::Trait>::D::E::F::g` will be seen as `a::b::c::Trait::D::E::F::g`.) Fix #43796. Close #41478. r? @nrc
2017-08-14Write the "passes" chapter of the rustdoc booksteveklabnik-1/+84
cc #42322
2017-08-14Indicate which stack size option has precedence.Corey Farwell-1/+1
2017-08-14link to the rustdoc book from the main docssteveklabnik-0/+2