summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2015-05-12Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-2/+2
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-04-30Fix zero-normalization of the pos of a `MultiByteChar`.Felix S. Klock II-1/+1
Fix #24687
2015-04-29Rather than storing the relations between free-regions in a globalNiko Matsakis-175/+716
table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of #22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes #22779. ---- This is cherry-pick of commit 6dfeda7 from PR #24553 Manually resolved conflicts in: src/librustc/lib.rs src/librustc/middle/infer/region_inference/mod.rs (both conflicts were related to changes to file structure.)
2015-04-25Fix broken links in the docsFlorian Hartwig-1/+1
2015-04-23Create a struct to represent early-bound regionsNiko Matsakis-37/+54
2015-04-23Make stability attributes an error. #22830Brian Anderson-3/+3
Conflicts: src/librustc_data_structures/lib.rs
2015-04-23std: Remove deprecated/unstable num functionalityAlex Crichton-49/+202
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change] Conflicts: src/libstd/num/strconv.rs
2015-04-22Check for shadowing between lifetimes and loop labels in function bodies.Felix S. Klock II-12/+201
Note: this Warns rather than error on shadowing problems involving labels. We took this more conservative option mostly due to issues with hygiene being broken for labels and/or lifetimes. Add FIXME regarding non-hygienic comparison.
2015-04-16Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichtonbors-43/+43
r? @alexcrichton
2015-04-15Auto merge of #24481 - steveklabnik:rollup, r=steveklabnikbors-1/+1
- Successful merges: #24425, #24435, #24438, #24440, #24449, #24457, #24460, #24465, #24467, #24468, #24471, #24476, #24480 - Failed merges:
2015-04-15Rollup merge of #24449 - richo:typo, r=alexcrichtonSteve Klabnik-1/+1
Spotted a typo, opened a tiny PR.
2015-04-15Auto merge of #24330 - pnkfelix:issue-24267, r=nikomatsakisbors-17/+63
Extend rustc::middle::dataflow to allow filtering kills from flow-exits. Fix borrowck analysis so that it will not treat a break that pops through an assignment ```rust x = { ... break; ... } ``` as a kill of the "moved-out" bit for `x`. Fix #24267. [breaking-change], but really, its only breaking code that was already buggy.
2015-04-15Dataflow changes and associated borrowck fix.Felix S. Klock II-17/+63
Revise rustc::middle::dataflow: one must select kill-kind when calling add_kill. The current kill-kinds are (1.) kills associated with ends-of-scopes and (2.) kills associated with the actual action of the expression/pattern. Then, use this to fix borrowck analysis so that it will not treat a break that pops through an assignment `x = { ... break; ... }` as a kill of the "moved-out" bit for `x`. Fix #24267. (incorporated review feedback.)
2015-04-15rustc: fix a typo in letter to rustcRicho Healey-1/+1
2015-04-15Auto merge of #24431 - ruud-v-a:explain, r=alexcrichtonbors-5/+94
This resolves part of #24407.
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-19/+19
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-24/+24
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14Test fixes and rebase conflictsAlex Crichton-1/+2
2015-04-14rustc: Add long diagnostics for E0165Ruud van Asseldonk-1/+20
2015-04-14rustc: Add long diagnostics for E0162Ruud van Asseldonk-1/+19
2015-04-14rollup merge of #24399: brson/stabAlex Crichton-28/+38
2015-04-14rollup merge of #24391: nrc/visit-visAlex Crichton-5/+5
2015-04-14rustc: Add long diagnostics for E0302Ruud van Asseldonk-1/+14
2015-04-14rustc: Add long diagnostics for E0301Ruud van Asseldonk-1/+14
2015-04-14rustc: Add long diagnostics for E0297Ruud van Asseldonk-1/+27
2015-04-14Reviewer commentsNick Cameron-45/+61
2015-04-14Better explanation of AutoDerefRefNick Cameron-6/+36
2015-04-14RebasedNick Cameron-54/+34
2015-04-14eddyb's refactoring of coercions/adjustmentsEduard Burtescu-569/+188
2015-04-13Make use of the stability attributes issue a deprecation warning. #22830Brian Anderson-28/+38
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-5/+5
2015-04-12Auto merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelixbors-5/+16
Also fixed bug calling .note() instead of .help() See #24036
2015-04-12Auto merge of #24109 - sanxiyn:diverging-closure, r=pnkfelixbors-1/+8
Fix #23896.
2015-04-11Rollup merge of #24245 - nikomatsakis:issue-24241-coherence-failure, r=pnkfelixManish Goregaokar-50/+21
Don't use skolemized parameters but rather fresh variables in coherence. Skolemized parameters wind up preventing unification. Surprised we had no test for this! Fixes #24241. r? @pnkfelix
2015-04-11Rollup merge of #24242 - nikomatsakis:escaping-closure-error-message, r=brsonManish Goregaokar-0/+7
Example showing sample inputs, old message, new message: https://gist.github.com/nikomatsakis/11126784ac678b7eb6ba Also adds infrastructure for reporting suggestions \"in situ\" and does some (minor) cleanups to `CodeMap`. r? @brson
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-1/+2
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-10Add a new `span_suggestion` infrastructure. This lets you edit a snippetNiko Matsakis-0/+7
of text (perhaps obtained by span_snippet) and then splice that edited form back into the original file in the form of a suggestion.
2015-04-09Don't use skolemized parameters but rather fresh variables inNiko Matsakis-50/+21
coherence. Skolemized parameters wind up preventing unification. Surprised we had no test for this! Fixes #24241.
2015-04-10Rollup merge of #24207 - kmcallister:llvm-plugin, r=brsonManish Goregaokar-0/+16
r? @brson I'm using this to integrate rustc with [american-fuzzy-lop](http://lcamtuf.coredump.cx/afl/). Building with afl instrumentation is no different from loading any other plugin library. I'd like this PR to include a `run-make` test with a custom LLVM pass; however I'm not sure it's worth the trouble of building C++ code and linking LLVM from the test suite (are there existing tests that do this?)
2015-04-10Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelixManish Goregaokar-39/+172
Modify the ExprUseVisitor to walk each part of an AutoRef, and in particular to treat an AutoUnsize as as kind of \"instantaneous\" borrow of the value being unsized. This prevents us from feeding uninitialized data. This caused a problem for the eager reborrow of comparison traits, because that wound up introducing a \"double AutoRef\", which was not being thoroughly checked before but turned out not to type check. Fortunately, we can just remove that \"eager reborrow\" as it is no longer needed now that `PartialEq` doesn't force both LHS and RHS to have the same type (and even if we did have this problem, the better way would be to lean on introducing a common supertype). Fixes #20791. r? @nrc
2015-04-08Allow plugins to register LLVM passesKeegan McAllister-0/+16
2015-04-08Auto merge of #24195 - steveklabnik:rollup, r=steveklabnikbors-31/+113
- Successful merges: #24143, #24149, #24167, #24178 - Failed merges:
2015-04-08Rollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelixSteve Klabnik-31/+113
I've taken another look at extended errors - fixing up the printing and adding a few more for match expressions. With regards to printing, the previous behaviour was to just print the error message string directly, despite it containing indentation which caused it to overflow the standard terminal width of 80 columns (try `rustc --explain E0004`). The first approach I considered was to strip the leading whitespace from each line and lay out the text dynamically, inserting spaces in between. This approach became quite messy when taking multi-paragraph errors into account (and seemed overkill). The approach I settled on removes the indentation in the string itself and begins each message with a newline that is stripped before printing. I feel like complete extended errors would be nice to have for 1.0.0 and I'm happy to spearhead an effort to get them written. Brian got me onto writing them at an SF meetup and I think it shouldn't be too hard to get the remaining 80 or so written with the help of people who don't really work on compiler innards.
2015-04-08Modify the ExprUseVisitor to walk each part of an AutoRef, and inNiko Matsakis-39/+172
particular to treat an AutoUnsize as as kind of "instantaneous" borrow of the value being unsized. This prevents us from feeding uninitialized data. This caused a problem for the eager reborrow of comparison traits, because that wound up introducing a "double AutoRef", which was not being thoroughly checked before but turned out not to type check. Fortunately, we can just remove that "eager reborrow" as it is no longer needed now that `PartialEq` doesn't force both LHS and RHS to have the same type (and even if we did have this problem, the better way would be to lean on introducing a common supertype).
2015-04-08Auto merge of #24021 - pnkfelix:fn-params-outlive-body, r=nikomatsakisbors-8/+55
Encode more precise scoping rules for function params Function params outlive everything in the body (incl temporaries). Thus if we assign them their own `CodeExtent`, the region inference can properly show that it is sound to have temporaries with destructors that reference the parameters (because such temporaries will be dropped before the parameters are dropped). Fix #23338
2015-04-08Address review nit by making `map_id` take an `FnMut`.Felix S. Klock II-2/+2
2015-04-08Auto merge of #23998 - nrc:impl-self, r=nikomatsakisbors-6/+12
Closes #23909 r? @nikomatsakis (or anyone else, really)
2015-04-07rustdoc: Improve handling inlined associated typesAlex Crichton-1/+2
* All bounds are now discovered through the trait to be inlined. * The `?Sized` bound now renders correctly for inlined associated types. * All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a hyperlink to the trait `B`. This should improve at least how the docs look at least. * Supertrait bounds are now separated and display as the source lists them. Closes #20727 Closes #21145
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-2/+2
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-2/+2
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]