about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-11-12Remove impls for cases considered `niche`Alexander Bulaev-29/+0
2015-11-04liballoc: implement From for Box, Rc, ArcAlexander Bulaev-0/+69
Sometimes when writing generic code you want to abstract over owning/pointer type so that calling code isn't restricted by one concrete owning/pointer type. This commit makes possible such code: ``` fn i_will_work_with_arc<T: Into<Arc<MyTy>>>(t: T) { let the_arc = t.into(); // Do something } i_will_work_with_arc(MyTy::new()); i_will_work_with_arc(Box::new(MyTy::new())); let arc_that_i_already_have = Arc::new(MyTy::new()); i_will_work_with_arc(arc_that_i_already_have); ``` Please note that this patch doesn't work with DSTs.
2015-11-04Auto merge of #29217 - nikomatsakis:mir-trans, r=dotdashbors-387/+2022
This branch implements a variant of trans that is based on MIR. It is very incomplete (intentionally), and had only the goal of laying out enough work to enable more incremental follow-on patches. Currently, only fns tagged with `#[rustc_mir]` use the new trans code. I plan to build up a meta-issue as well that tracks the various "not-yet-implemented" points. The only fn that has been tested so far is this amazingly complex "spike" fn: ```rust #[rustc_mir] fn sum(x: i32, y: i32) -> i32 { x + y } ``` In general, the most interesting commit is the last one. There are some points on which I would like feedback from @rust-lang/compiler: - I did not use `Datum`. Originally, I thought that maybe just a `ValueRef` would be enough but I wound up with two very simple structures, `LvalueRef` and `OperandRef`, that just package up a `ValueRef` and a type. Because of MIR's structure, you don't wind up mixing by-ref and by-value so much, and I tend to think that a thinner abstraction layer is better here, but I'm not sure. - Related to the above, I expect that sooner or later we will analyze temps (and maybe variables too) to find those whose address is never taken and which are word-sized and which perhaps meet a few other criteria. For those, we'll probably want to avoid the alloca, just because it means prettier code. - I generally tried to re-use data structures from elsewhere in trans, though I'm sure we can trim these down. - I didn't do any debuginfo primarily because it seems to want node-ids and we have only spans. I haven't really read into that code so I don't know what's going on there. r? @nrc
2015-11-03remove unused importNiko Matsakis-1/+0
2015-11-04Auto merge of #29547 - arielb1:speculative-upvar, r=eddybbors-151/+194
`resolve_identifier` used to mark a variable as an upvar when used within a closure. However, the function is also used for the "unnecessary qualification" lint, which would mark paths whose last component had the same name as a local as upvars. Fixes #29522 r? @eddyb
2015-11-03address nits from dotdashNiko Matsakis-4/+13
2015-11-03correct typosNiko Matsakis-2/+2
2015-11-03Add (and use) an analysis to determine which temps can forgo an alloca.Niko Matsakis-25/+160
2015-11-03Auto merge of #29545 - mystor:vec-deque-test-panic, r=blussbors-7/+9
I think this should fix the test failures in debug mode from #29492 The assertion was written incorrectly, and I don't like the way the new assertion is written, but I _think_ it does the right thing now.
2015-11-03Auto merge of #29532 - Ryman:cow_path, r=alexcrichtonbors-18/+87
2015-11-03resolve: don't speculatively create freevars when resolvingAriel Ben-Yehuda-151/+194
Fixes #29522
2015-11-03Correct incorrect assertion in VecDeque::wrap_copyMichael Layzell-7/+9
2015-11-03libcollections: DRY up a PartialEq impl for StringKevin Butler-18/+3
2015-11-03libstd: implement PartialEq<Path> for PathBuf and Cow<Path>Kevin Butler-0/+48
2015-11-03Auto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichtonbors-0/+21
This sets the `cap-lints` setting to 'allow' for all doc compilations. There's precedent for this as rustdoc [already whitelists unstable code](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L112) when compiling documentation, with the expectation being that a regular compile will complain about any problems. I think the same justification applies here. Problem case in the wild: https://github.com/laumann/compiletest-rs/pull/28 r? @Manishearth
2015-11-03Auto merge of #29515 - Manishearth:ice-itembody, r=eddybbors-1/+39
r? @eddyb or @nrc
2015-11-03Fix ICE with unresolved associated items in closures (fixes #28971)Manish Goregaokar-1/+39
2015-11-03Auto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnikbors-6/+24
A line may be indented with either spaces or tabs, but not a mix of both. If there is a mix of tabs and spaces, only the kind that occurs first is counted. This addresses issue #29268.
2015-11-03Fix #29533Toby Scrace-1/+1
This replaces usage of the (missing) `fatal!` macro with `panic!`.
2015-11-03Add a MIR visitorNiko Matsakis-0/+240
2015-11-03libstd: implement From<&Path|PathBuf> for Cow<Path>Kevin Butler-0/+36
2015-11-03Plumbing to omit allocas for temps when possible (currently unused)Niko Matsakis-44/+166
2015-11-03New trans codepath that builds fn body from MIR instead.Niko Matsakis-0/+887
2015-11-03Move shifting code out of expr and into somewhere more accessibleNiko Matsakis-63/+88
2015-11-03Change adt case handling fn to be less tied to matchNiko Matsakis-14/+7
2015-11-03Add helper methods that require tcx; these compute types ofNiko Matsakis-1/+126
lvalues and operands
2015-11-03Change Call operands to be, well, OperandsNiko Matsakis-28/+25
2015-11-03Add adt_def into Switch, since it's convenient to have in transNiko Matsakis-2/+4
2015-11-03Move the "HAIR" code that reads the tcx tables etc out of the `tcx`Niko Matsakis-79/+94
module and into `hair/cx`, now that we don't have a trait defining the interface
2015-11-03Pass the mir map to transNiko Matsakis-17/+37
2015-11-03Convert from using named fields to always using indicesNiko Matsakis-10/+27
2015-11-03Change ShallowDrop to Free, so that it matches what trans will doNiko Matsakis-4/+4
2015-11-03Build the MIR using the liberated fn sigs, and track the return typeNiko Matsakis-29/+49
2015-11-03Introduce a "liberated fn sigs" map so that we have easy access to thisNiko Matsakis-24/+53
information when constructing MIR.
2015-11-03Auto merge of #29459 - tshepang:simplify, r=steveklabnikbors-3/+3
2015-11-03Auto merge of #29523 - durka:patch-9, r=alexcrichtonbors-3/+0
`Rc::try_unwrap` and `Rc::make_mut` are stable since 1.4.0, but the example code still has `#![feature(rc_unique)]`. Ideally the stable and beta docs would be updated, but I don't think that's possible :(
2015-11-03Auto merge of #29514 - apasel422:issue-26220, r=alexcrichtonbors-0/+14
Closes #26220. r? @alexcrichton
2015-11-03Auto merge of #29285 - eefriedman:libsyntax-panic, r=nrcbors-190/+174
A set of commits which pushes some panics out of core parser methods, and into users of those parser methods.
2015-11-03Auto merge of #29500 - vadimcn:rustlib, r=alexcrichtonbors-10/+7
According to a recent [discussion on IRC](https://botbot.me/mozilla/rust-tools/2015-10-27/?msg=52887517&page=2), there's no good reason for Windows builds to store target libraries under `bin`, when on every other platform they are under `lib`. This might be a [breaking-change] for some users. I am pretty sure VisualRust has that path hard-coded somewhere. r? @brson
2015-11-02librustdoc: ignore lint warnings when compiling documentationKevin Butler-0/+21
2015-11-02Auto merge of #29291 - petrochenkov:privacy, r=alexcrichtonbors-143/+217
The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set. This is needed for https://github.com/rust-lang/rust/pull/29083 because stability annotation pass uses the public set and all things listed above need to be annotated. Rustdoc can now be migrated to the public set as well, I guess. Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public. r? @alexcrichton or maybe someone else
2015-11-03Parens + issue number + typoVadim Petrochenkov-4/+4
2015-11-02Auto merge of #29456 - alexcrichton:path-hash, r=aturonbors-3/+37
Almost all operations on Path are based on the components iterator in one form or another to handle equivalent paths. The `Hash` implementations, however, mistakenly just went straight to the underlying `OsStr`, causing these equivalent paths to not get merged together. This commit updates the `Hash` implementation to also be based on the iterator which should ensure that if two paths are equal they hash to the same thing. cc #29008, but doesn't close it
2015-11-02std: Base Hash for Path on its iteratorAlex Crichton-3/+37
Almost all operations on Path are based on the components iterator in one form or another to handle equivalent paths. The `Hash` implementations, however, mistakenly just went straight to the underlying `OsStr`, causing these equivalent paths to not get merged together. This commit updates the `Hash` implementation to also be based on the iterator which should ensure that if two paths are equal they hash to the same thing. cc #29008, but doesn't close it
2015-11-02remove #![feature(rc_unique)] from Rc docsAlex Burka-3/+0
`Rc::try_unwrap` and `Rc::make_mut` are stable since 1.4.0, but the example code still has `#![feature(rc_unique)]`. Ideally the stable and beta docs would be updated, but I don't think that's possible...
2015-11-02Auto merge of #29513 - apasel422:issue-23217, r=alexcrichtonbors-0/+16
Closes #23217. r? @alexcrichton
2015-11-02Merged windows and unix `find_libdir()`Vadim Chugunov-6/+0
2015-11-02Auto merge of #29510 - mneumann:dragonfly-guard-page, r=alexcrichtonbors-0/+4
Only tested on DragonFly.
2015-11-02Minor fix to Rust Book, Macros chapterKyle Mayes-1/+1
Fixes one of the `expr` examples to be a proper expression
2015-11-02Auto merge of #28846 - Ms2ger:categorization, r=nikomatsakisbors-193/+203