]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #29875 - steveklabnik:gh29784, r=Manishearth
Manish Goregaokar [Tue, 17 Nov 2015 09:42:15 +0000 (15:12 +0530)]
Rollup merge of #29875 - steveklabnik:gh29784, r=Manishearth

Fixes #29784

8 years agoRollup merge of #29874 - steveklabnik:gh29711, r=alexcrichton
Manish Goregaokar [Tue, 17 Nov 2015 09:42:14 +0000 (15:12 +0530)]
Rollup merge of #29874 - steveklabnik:gh29711, r=alexcrichton

in their API docs

Fixes #29711

8 years agoRollup merge of #29873 - steveklabnik:gh29493, r=nikomatsakis
Manish Goregaokar [Tue, 17 Nov 2015 09:42:14 +0000 (15:12 +0530)]
Rollup merge of #29873 - steveklabnik:gh29493, r=nikomatsakis

Fixes #29493

8 years agoRollup merge of #29868 - petrochenkov:gv, r=sanxiyn
Manish Goregaokar [Tue, 17 Nov 2015 09:42:14 +0000 (15:12 +0530)]
Rollup merge of #29868 - petrochenkov:gv, r=sanxiyn

r? @arielb1

8 years agoAuto merge of #29837 - Wafflespeanut:unicode_chars, r=Manishearth
bors [Tue, 17 Nov 2015 07:42:03 +0000 (07:42 +0000)]
Auto merge of #29837 - Wafflespeanut:unicode_chars, r=Manishearth

fixes #25957

8 years agoDetect confusing unicode characters and show the alternative
Ravi Shankar [Sat, 14 Nov 2015 21:07:49 +0000 (02:37 +0530)]
Detect confusing unicode characters and show the alternative

8 years agoAuto merge of #29870 - petrochenkov:typaren, r=nrc
bors [Tue, 17 Nov 2015 05:55:07 +0000 (05:55 +0000)]
Auto merge of #29870 - petrochenkov:typaren, r=nrc

Like https://github.com/nrc/rust/commit/d21bfff78cd949ce72be57d3528c4f6985190feb, but for the type grammar.

r? @nrc

8 years agoAuto merge of #29860 - steveklabnik:stackheapfixes, r=huonw
bors [Tue, 17 Nov 2015 04:08:11 +0000 (04:08 +0000)]
Auto merge of #29860 - steveklabnik:stackheapfixes, r=huonw

Fixes #29853
Fixes #29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.

r? @huonw

8 years agoAuto merge of #29794 - semarie:openbsd-stdcpp-path, r=alexcrichton
bors [Tue, 17 Nov 2015 02:21:20 +0000 (02:21 +0000)]
Auto merge of #29794 - semarie:openbsd-stdcpp-path, r=alexcrichton

under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).

but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).

this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.

r? @alexcrichton

8 years agoAuto merge of #29297 - tbu-:pr_env_ignore_malformed, r=alexcrichton
bors [Tue, 17 Nov 2015 00:31:20 +0000 (00:31 +0000)]
Auto merge of #29297 - tbu-:pr_env_ignore_malformed, r=alexcrichton

Otherwise, the iterator and the functions for getting specific
environment variables might disagree, for environments like

    FOOBAR

8 years agoMake note about traits that can be derived
Steve Klabnik [Mon, 16 Nov 2015 21:57:37 +0000 (16:57 -0500)]
Make note about traits that can be derived

in their API docs

Fixes #29711

8 years agoIgnore malformed environment strings like glibc does
Tobias Bucher [Sun, 25 Oct 2015 12:05:34 +0000 (12:05 +0000)]
Ignore malformed environment strings like glibc does

Otherwise, the iterator and the functions for getting specific
environment variables might disagree, for environments like

    FOOBAR

Variable names starting with equals sign are OK:

glibc only interprets equals signs not in the first position as
separators between variable name and variable value. Instead of skipping
them entirely, a leading equals sign is interpreted to be part of the
variable name.

8 years agoAuto merge of #29872 - steveklabnik:rollup, r=steveklabnik
bors [Mon, 16 Nov 2015 22:43:32 +0000 (22:43 +0000)]
Auto merge of #29872 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29549, #29796, #29843, #29863, #29865
- Failed merges:

8 years agoRemove nomicon reference to copy_lifetime
Steve Klabnik [Mon, 16 Nov 2015 21:58:52 +0000 (16:58 -0500)]
Remove nomicon reference to copy_lifetime

Fixes #29784

8 years agoImprove UFCS example
Steve Klabnik [Mon, 16 Nov 2015 21:51:58 +0000 (16:51 -0500)]
Improve UFCS example

Fixes #29493

8 years agoRollup merge of #29865 - apasel422:mutex, r=alexcrichton
Steve Klabnik [Mon, 16 Nov 2015 21:22:48 +0000 (16:22 -0500)]
Rollup merge of #29865 - apasel422:mutex, r=alexcrichton

r? @alexcrichton

8 years agoRollup merge of #29863 - steveklabnik:gh29526, r=alexcrichton
Steve Klabnik [Mon, 16 Nov 2015 21:22:48 +0000 (16:22 -0500)]
Rollup merge of #29863 - steveklabnik:gh29526, r=alexcrichton

Fixes #29526

8 years agoRollup merge of #29843 - arcnmx:authors, r=brson
Steve Klabnik [Mon, 16 Nov 2015 21:22:48 +0000 (16:22 -0500)]
Rollup merge of #29843 - arcnmx:authors, r=brson

Duplicate entries removed. This doesn't quite completely allow for generating AUTHORS.txt from scratch but it's much closer now.

8 years agoRollup merge of #29796 - barosl:unresolved-import-extern-crate, r=steveklabnik
Steve Klabnik [Mon, 16 Nov 2015 21:22:48 +0000 (16:22 -0500)]
Rollup merge of #29796 - barosl:unresolved-import-extern-crate, r=steveklabnik

The command-line error message for E0432 does mention the possibility of missing the `extern crate` declaration, but the detailed error message for it doesn't.

Fixes #29517.

8 years agoRollup merge of #29549 - brson:docidx, r=steveklabnik
Steve Klabnik [Mon, 16 Nov 2015 21:22:47 +0000 (16:22 -0500)]
Rollup merge of #29549 - brson:docidx, r=steveklabnik

I noticed the nomicon was not listed!

I also removed links to racer and rustfmt since they were not *doc-specific* links, just links to tools, as well as pointed the cargo link directly at the docs.

Removed all the community stuff. There are lots of other places to find this now, including the website.

With pending website changes this page will continue to be pared back, reflecting only what's in-tree, not general Rust docs.

r? @steveklabnik

8 years agoAuto merge of #29862 - ranma42:const_min_max, r=alexcrichton
bors [Mon, 16 Nov 2015 20:53:59 +0000 (20:53 +0000)]
Auto merge of #29862 - ranma42:const_min_max, r=alexcrichton

They can be useful for constructing constant items.

8 years agoRemove `TyParen` from HIR
Vadim Petrochenkov [Mon, 16 Nov 2015 19:49:47 +0000 (22:49 +0300)]
Remove `TyParen` from HIR

8 years agoMinor tweaks to doc index
Brian Anderson [Mon, 16 Nov 2015 19:48:18 +0000 (11:48 -0800)]
Minor tweaks to doc index

8 years agoAuto merge of #29580 - alexbool:smart-pointer-conversion, r=alexcrichton
bors [Mon, 16 Nov 2015 19:06:52 +0000 (19:06 +0000)]
Auto merge of #29580 - alexbool:smart-pointer-conversion, r=alexcrichton

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:
```rust
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.
Also to mention, I made those impls stable, and I don't know whether they should be actually stable from the beginning. Please tell me if this should be feature-gated.

8 years agoDo not generate comparefoo.gv and simpleeq.gv during testing
Vadim Petrochenkov [Mon, 16 Nov 2015 18:16:44 +0000 (21:16 +0300)]
Do not generate comparefoo.gv and simpleeq.gv during testing

8 years agoCorrect comment in `Mutex` example
Andrew Paseltiner [Mon, 16 Nov 2015 17:56:18 +0000 (12:56 -0500)]
Correct comment in `Mutex` example

8 years agoAuto merge of #29805 - norcalli:patch-1, r=steveklabnik
bors [Mon, 16 Nov 2015 17:18:21 +0000 (17:18 +0000)]
Auto merge of #29805 - norcalli:patch-1, r=steveklabnik

Fixes #29730

8 years agoNomicon: mention tuple structs with repr(c)
Steve Klabnik [Mon, 16 Nov 2015 17:04:25 +0000 (12:04 -0500)]
Nomicon: mention tuple structs with repr(c)

Fixes #29526

8 years agoMake `min_value()` and `max_value()` const functions
Andrea Canciani [Mon, 16 Nov 2015 16:43:09 +0000 (17:43 +0100)]
Make `min_value()` and `max_value()` const functions

8 years agoReaffirm that this is an abstraction
Steve Klabnik [Mon, 16 Nov 2015 15:38:25 +0000 (10:38 -0500)]
Reaffirm that this is an abstraction

Fixes #29853
Fixes #29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.

8 years agoAuto merge of #29830 - petrochenkov:mapdoc, r=alexcrichton
bors [Mon, 16 Nov 2015 11:08:50 +0000 (11:08 +0000)]
Auto merge of #29830 - petrochenkov:mapdoc, r=alexcrichton

r? @steveklabnik

8 years agoAuto merge of #29851 - shahn:hashset_doc_fix, r=steveklabnik
bors [Mon, 16 Nov 2015 09:22:51 +0000 (09:22 +0000)]
Auto merge of #29851 - shahn:hashset_doc_fix, r=steveklabnik

insert() returns bool, but it was wrongly stated that if the set had the
key already present, that key would be returned (this was probably
copied from the HashMap docs). Also remove a reference to the
module-level documentation, which doesn't make sense as it doesn't give
any more context.

r? @steveklabnik

8 years agoFix feature name
Alexander Bulaev [Mon, 16 Nov 2015 08:04:17 +0000 (11:04 +0300)]
Fix feature name

8 years agoAuto merge of #29845 - wthrowe:libdir, r=alexcrichton
bors [Mon, 16 Nov 2015 07:34:05 +0000 (07:34 +0000)]
Auto merge of #29845 - wthrowe:libdir, r=alexcrichton

This should get `--libdir` working as well as it was a couple of weeks ago.  (That is, it still rewrites paths incorrectly but it no longer fails during `make install`.)

Fixes gentoo/gentoo-rust#28 and gentoo/gentoo-rust#29.

8 years agoAuto merge of #29828 - sanxiyn:check-macro, r=nrc
bors [Mon, 16 Nov 2015 05:48:35 +0000 (05:48 +0000)]
Auto merge of #29828 - sanxiyn:check-macro, r=nrc

Fix #27409.

8 years agoFix docs for HashSet::insert
Sebastian Hahn [Mon, 16 Nov 2015 05:32:58 +0000 (06:32 +0100)]
Fix docs for HashSet::insert

insert() returns bool, but it was wrongly stated that if the set had the
key already present, that key would be returned (this was probably
copied from the HashMap docs). Also remove a reference to the
module-level documentation, which doesn't make sense as it doesn't give
any more context.

8 years agoPrepare to the correct directory with --libdir
William Throwe [Sun, 15 Nov 2015 04:59:35 +0000 (23:59 -0500)]
Prepare to the correct directory with --libdir

This is to handle the case where CFG_LIBDIR is not a direct child of
CFG_PREFIX (in other words, where CFG_LIBDIR_RELATIVE has more than
one component).

8 years agoAuto merge of #29788 - mitaa:module_name, r=arielb1
bors [Sun, 15 Nov 2015 23:58:26 +0000 (23:58 +0000)]
Auto merge of #29788 - mitaa:module_name, r=arielb1

f357d55 caused a regression by retrieving item names from metadata, while previously using the last element of its absolute path (which in the case of a root module is the prefixed crate name since the stored path in metadata is empty)

fixes #28927

8 years agoAuto merge of #29387 - little-dude:rustfmt_librustc_resolve, r=nrc
bors [Sun, 15 Nov 2015 22:07:12 +0000 (22:07 +0000)]
Auto merge of #29387 - little-dude:rustfmt_librustc_resolve, r=nrc

Another rustfmt PR.
I ran rustfmt, then split the changes in multiple commits. First commit are the non-problematic changed. The others are all the little weirdness that caught my attention and could be discussed.

8 years agoAuto merge of #29836 - eefriedman:normalize-fn, r=arielb1
bors [Sun, 15 Nov 2015 20:19:57 +0000 (20:19 +0000)]
Auto merge of #29836 - eefriedman:normalize-fn, r=arielb1

Fixes #23406.
Fixes #23958.
Fixes #29832.

CC @arielb1

8 years agoAuto merge of #29209 - arielb1:exponential-evaluation, r=nmatsakis
bors [Sun, 15 Nov 2015 18:26:18 +0000 (18:26 +0000)]
Auto merge of #29209 - arielb1:exponential-evaluation, r=nmatsakis

This fixes an exponential worst-case and also provides an additional 1% perf improvement.

r? @nikomatsakis

8 years agoaddress review comments
Ariel Ben-Yehuda [Sun, 15 Nov 2015 18:11:42 +0000 (20:11 +0200)]
address review comments

8 years agofix pretty
Ariel Ben-Yehuda [Thu, 22 Oct 2015 15:25:02 +0000 (18:25 +0300)]
fix pretty

8 years agofix remaining bugs
Ariel Ben-Yehuda [Wed, 21 Oct 2015 16:01:58 +0000 (19:01 +0300)]
fix remaining bugs

8 years agoadd a global evaluation cache
Ariel Ben-Yehuda [Wed, 21 Oct 2015 11:50:38 +0000 (14:50 +0300)]
add a global evaluation cache

8 years agointroduce evaluate_obligation_conservatively and use it
Ariel Ben-Yehuda [Tue, 20 Oct 2015 16:14:05 +0000 (19:14 +0300)]
introduce evaluate_obligation_conservatively and use it

8 years agoevaluate projections outside the outer probe in recursive evaluation
Ariel Ben-Yehuda [Tue, 20 Oct 2015 15:23:46 +0000 (18:23 +0300)]
evaluate projections outside the outer probe in recursive evaluation

8 years agoput projections in RFC447 order
Ariel Ben-Yehuda [Tue, 20 Oct 2015 14:15:58 +0000 (17:15 +0300)]
put projections in RFC447 order

8 years agosimplify and reduce the size of EvaluationResult
Ariel Ben-Yehuda [Sun, 18 Oct 2015 16:15:57 +0000 (19:15 +0300)]
simplify and reduce the size of EvaluationResult

8 years agoAuto merge of #29846 - JanLikar:#29823, r=steveklabnik
bors [Sun, 15 Nov 2015 15:33:23 +0000 (15:33 +0000)]
Auto merge of #29846 - JanLikar:#29823, r=steveklabnik

Fix #29823 by further explaining `&str` and pointing out the
difference between `&str` and `&'static str`.

8 years agoFix a typo
Jan Likar [Sun, 15 Nov 2015 13:21:13 +0000 (14:21 +0100)]
Fix a typo

8 years agoImprove Strings chapter
Jan Likar [Sun, 15 Nov 2015 07:14:46 +0000 (08:14 +0100)]
Improve Strings chapter

8 years agoUpdate 'Strings' chapter of the book
Jan Likar [Sun, 15 Nov 2015 05:55:30 +0000 (06:55 +0100)]
Update 'Strings' chapter of the book

Fix #29823 by further explaining `&str` and pointing out the
difference between `&str` and `&'static str`.

8 years agoAuto merge of #29840 - gereeter:move-error-no-refcell, r=sanxiyn
bors [Sun, 15 Nov 2015 05:09:45 +0000 (05:09 +0000)]
Auto merge of #29840 - gereeter:move-error-no-refcell, r=sanxiyn

8 years agoAUTHORS and .mailmap cleanup
arcnmx [Sun, 15 Nov 2015 04:11:20 +0000 (23:11 -0500)]
AUTHORS and .mailmap cleanup

8 years agoStop using dynamic borrowing in MoveErrorCollector
Jonathan S [Sat, 14 Nov 2015 23:23:31 +0000 (17:23 -0600)]
Stop using dynamic borrowing in MoveErrorCollector

8 years agoConsistently normalize fn types after erasing lifetimes.
Eli Friedman [Sat, 14 Nov 2015 20:12:12 +0000 (12:12 -0800)]
Consistently normalize fn types after erasing lifetimes.

Fixes #23406.
Fixes #23958.
Fixes #29832.

8 years agorustfmt librustc_resolve
corentih [Mon, 26 Oct 2015 19:31:11 +0000 (20:31 +0100)]
rustfmt librustc_resolve

8 years agodocs: Clarify insertion behavior for maps
Vadim Petrochenkov [Sat, 14 Nov 2015 12:05:20 +0000 (15:05 +0300)]
docs: Clarify insertion behavior for maps

8 years agoAuto merge of #29827 - Manishearth:diag-fn-field, r=eddyb
bors [Sat, 14 Nov 2015 12:02:20 +0000 (12:02 +0000)]
Auto merge of #29827 - Manishearth:diag-fn-field, r=eddyb

Fixes #29043

8 years agoCheck macro definition and do not expand invalid macros
Seo Sanghyeon [Sat, 14 Nov 2015 10:50:46 +0000 (19:50 +0900)]
Check macro definition and do not expand invalid macros

8 years agoReindent code
Seo Sanghyeon [Sat, 14 Nov 2015 10:18:32 +0000 (19:18 +0900)]
Reindent code

8 years agoStore TokenTree in MacroRulesMacroExpander
Seo Sanghyeon [Sat, 14 Nov 2015 10:11:40 +0000 (19:11 +0900)]
Store TokenTree in MacroRulesMacroExpander

8 years agoFix diagnostics for calling indirect extern function pointer field
Manish Goregaokar [Sat, 14 Nov 2015 05:14:57 +0000 (10:44 +0530)]
Fix diagnostics for calling indirect extern function pointer field

Fixes #29043

8 years agoAuto merge of #29819 - mdinger:block-comments, r=steveklabnik
bors [Sat, 14 Nov 2015 09:55:32 +0000 (09:55 +0000)]
Auto merge of #29819 - mdinger:block-comments, r=steveklabnik

These really aren't documented well at all. The fact that doc comments end on a `*/` is really weird. I'm not sure if this is a mistake or not though.

None of the block comments are even mentioned in the [book nightly](http://doc.rust-lang.org/nightly/book/comments.html). Probably should be fixed.

8 years agoAuto merge of #29825 - KyleMayes:move-parse-panic, r=sanxiyn
bors [Sat, 14 Nov 2015 08:03:14 +0000 (08:03 +0000)]
Auto merge of #29825 - KyleMayes:move-parse-panic, r=sanxiyn

Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.

8 years agoAuto merge of #29817 - michaelwoerister:mir-ty-closure-fields, r=nikomatsakis
bors [Sat, 14 Nov 2015 06:08:09 +0000 (06:08 +0000)]
Auto merge of #29817 - michaelwoerister:mir-ty-closure-fields, r=nikomatsakis

Add a missing case in LvalueTy::projection_ty() that popped up earlier today.

cc @rust-lang/compiler @nikomatsakis

8 years agoAuto merge of #29820 - wthrowe:makefile-fixes, r=brson
bors [Sat, 14 Nov 2015 04:14:22 +0000 (04:14 +0000)]
Auto merge of #29820 - wthrowe:makefile-fixes, r=brson

The first commit fixes the "jobserver unavailable" warning reported at gentoo/gentoo-rust#29.  I don't think the warning is related to the compilation failure shown there.

The remaining commits are minor fixes I noticed while investigating the jobserver warning.

8 years agoMove the panicking parse functions out of the parser
Kyle Mayes [Sat, 14 Nov 2015 03:18:59 +0000 (22:18 -0500)]
Move the panicking parse functions out of the parser

Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.

8 years agoAuto merge of #29816 - nikomatsakis:incr-comp-visitor-refactor-hir-folder, r=nrc
bors [Sat, 14 Nov 2015 02:05:05 +0000 (02:05 +0000)]
Auto merge of #29816 - nikomatsakis:incr-comp-visitor-refactor-hir-folder, r=nrc

Simplify HIR folder so that it only maps 1 item to 1 item, removing a bunch of asserts. This is a small refactoring on the way to my larger branch for moving items out of line in the tree and isolating attempts to access them.

r? @nrc

8 years agosimplify HIR folder so that it only maps 1 item to 1 item,
Niko Matsakis [Fri, 13 Nov 2015 16:38:45 +0000 (11:38 -0500)]
simplify HIR folder so that it only maps 1 item to 1 item,
removing a bunch of asserts

8 years agoAuto merge of #29781 - arielb1:mir-casts, r=nikomatsakis
bors [Sat, 14 Nov 2015 00:10:28 +0000 (00:10 +0000)]
Auto merge of #29781 - arielb1:mir-casts, r=nikomatsakis

I am also planning to implement casts, but I will probably do it in a separate PR.

r? @nikomatsakis

8 years agoAuto merge of #29808 - aphistic:trait-debug-example-fix, r=steveklabnik
bors [Fri, 13 Nov 2015 22:12:51 +0000 (22:12 +0000)]
Auto merge of #29808 - aphistic:trait-debug-example-fix, r=steveklabnik

The example given for the manual implementation of the core::fmt::Debug trait doesn't match the output after the code sample. This updates it so it matches.

8 years agoaddress review comments
Ariel Ben-Yehuda [Thu, 12 Nov 2015 22:12:50 +0000 (00:12 +0200)]
address review comments

8 years agoimplement coercions in MIR
Ariel Ben-Yehuda [Wed, 11 Nov 2015 20:02:51 +0000 (22:02 +0200)]
implement coercions in MIR

8 years agoDocument block doc comments better
mdinger [Fri, 13 Nov 2015 21:06:00 +0000 (16:06 -0500)]
Document block doc comments better

8 years agorustc_mir: don't miss the autoref when doing an unsize
Ariel Ben-Yehuda [Tue, 10 Nov 2015 22:07:34 +0000 (00:07 +0200)]
rustc_mir: don't miss the autoref when doing an unsize

8 years agoimplement lvalue_len
Ariel Ben-Yehuda [Tue, 10 Nov 2015 20:26:59 +0000 (22:26 +0200)]
implement lvalue_len

no tests - sorry

8 years agorepresent fat ptr operands as 2 separate pointers
Ariel Ben-Yehuda [Tue, 10 Nov 2015 20:05:11 +0000 (22:05 +0200)]
represent fat ptr operands as 2 separate pointers

this does add some complexity, but to do otherwise would require unsized
lvalues to have their own allocas, which would be ugly.

8 years agoMIR: implement fat raw pointer comparisons
Ariel Ben-Yehuda [Mon, 9 Nov 2015 00:16:19 +0000 (02:16 +0200)]
MIR: implement fat raw pointer comparisons

The implementation itself only requires changes to trans, but
a few additional bugs concerning the handling of fat pointers
had to be fixed.

8 years agoAuto merge of #29806 - tsion:compile-state-mir_map, r=nikomatsakis
bors [Fri, 13 Nov 2015 20:18:18 +0000 (20:18 +0000)]
Auto merge of #29806 - tsion:compile-state-mir_map, r=nikomatsakis

This allows "rustc drop-in replacement" programs like https://github.com/nrc/stupid-stats to access the MIR map.

Working toy example: https://gist.github.com/tsion/288423389e32eb73bb39

r? @nikomatsakis

8 years agoRemove extra eval call in snap.mk
William Throwe [Fri, 13 Nov 2015 20:13:05 +0000 (15:13 -0500)]
Remove extra eval call in snap.mk

8 years agoClean up some "suspicious" whitespace in target.mk
William Throwe [Fri, 13 Nov 2015 20:01:07 +0000 (15:01 -0500)]
Clean up some "suspicious" whitespace in target.mk

Emacs warns that makefile lines that start with spaces followed by
tabs are "suspicious".  These were harmless since they were
continuation lines, but getting rid of the warning is nice and this
version looks better.

8 years agoEscape some variables in llvm.mk
William Throwe [Fri, 13 Nov 2015 19:54:25 +0000 (14:54 -0500)]
Escape some variables in llvm.mk

The important one is $(MAKE).  make handles recipes containing the
literal string "$(MAKE)" specially, so it is important to make sure it
isn't evaluated until recipe invocation time.

8 years agoAuto merge of #29759 - nagisa:mir-static, r=nikomatsakis
bors [Fri, 13 Nov 2015 17:10:25 +0000 (17:10 +0000)]
Auto merge of #29759 - nagisa:mir-static, r=nikomatsakis

Fixes #29578

r? @nikomatsakis

My own observations are posted inline as comments.

8 years agoMIR: Support closure up-vars in LvalueTy::projection_ty()
Michael Woerister [Fri, 13 Nov 2015 16:01:37 +0000 (17:01 +0100)]
MIR: Support closure up-vars in LvalueTy::projection_ty()

8 years agoAuto merge of #29811 - bluss:binary-heap-sift-less, r=gankro
bors [Fri, 13 Nov 2015 14:28:57 +0000 (14:28 +0000)]
Auto merge of #29811 - bluss:binary-heap-sift-less, r=gankro

BinaryHeap: Simplify sift down

Sift down was doing all too much work: it can stop directly when the
current element obeys the heap property in relation to its children.

In the old code, sift down didn't compare the element to sift down at
all, so it was maximally sifted down and relied on the sift up call to
put it in the correct location.

This should speed up heapify and .pop().

Also rename Hole::removed() to Hole::element()

8 years agoBinaryHeap: Simplify sift down
Ulrik Sverdrup [Fri, 13 Nov 2015 00:54:33 +0000 (01:54 +0100)]
BinaryHeap: Simplify sift down

Sift down was doing all too much work: it can stop directly when the
current element obeys the heap property in relation to its children.

In the old code, sift down didn't compare the element to sift down at
all, so it was maximally sifted down and relied on the sift up call to
put it in the correct location.

This should speed up heapify and .pop().

Also rename Hole::removed() to Hole::element()

8 years agoAuto merge of #29761 - eefriedman:rename-nopanic, r=sanxiyn
bors [Fri, 13 Nov 2015 10:28:25 +0000 (10:28 +0000)]
Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiyn

Just `sed s/_nopanic//g`.  Hopefully makes libsyntax a bit more
readable.

8 years agoAuto merge of #29800 - Detegr:master, r=nikomatsakis
bors [Fri, 13 Nov 2015 08:41:50 +0000 (08:41 +0000)]
Auto merge of #29800 - Detegr:master, r=nikomatsakis

Fundamental attribute was missing a feature gate test.

8 years agoStore a valid name for the root module in metadata
mitaa [Wed, 11 Nov 2015 21:10:21 +0000 (22:10 +0100)]
Store a valid name for the root module in metadata

8 years agoAuto merge of #29675 - bluss:merge-sort-fastpath, r=huonw
bors [Fri, 13 Nov 2015 01:44:58 +0000 (01:44 +0000)]
Auto merge of #29675 - bluss:merge-sort-fastpath, r=huonw

sort: Fast path for already sorted data

When merging two sorted blocks `left` and `right` if the last element in
`left` is <= the first in `right`, the blocks are already in sorted order.

Add this as an additional fast path by simply copying the whole left
block into the output and advancing the left pointer. The right block is
then treated the same way by the already present logic in the merge
loop.

Can reduce runtime of .sort() to less than 50% of the previous, if the data
was already perfectly sorted. Sorted data with a few swaps are also
sorted quicker than before. The overhead of one comparison per merge
seems to be negligible.

8 years agoAuto merge of #29807 - nrc:op_span, r=brson
bors [Thu, 12 Nov 2015 23:48:56 +0000 (23:48 +0000)]
Auto merge of #29807 - nrc:op_span, r=brson

cc @nagisa

8 years agoFix the manual implementation example for the Debug trait so it matches the given...
Erik Davidson [Thu, 12 Nov 2015 21:03:36 +0000 (15:03 -0600)]
Fix the manual implementation example for the Debug trait so it matches the given output

8 years agoFix a bad span for binops
Nick Cameron [Thu, 12 Nov 2015 20:34:41 +0000 (09:34 +1300)]
Fix a bad span for binops

8 years agoAuto merge of #29780 - KyleMayes:quote-ext, r=nrc
bors [Thu, 12 Nov 2015 20:31:12 +0000 (20:31 +0000)]
Auto merge of #29780 - KyleMayes:quote-ext, r=nrc

This is my first code contribution to Rust, so I'm sure there are some issues with the changes I've made.

I've added the `quote_arg!`, `quote_block!`, `quote_path!`, and `quote_meta_item!` quasiquoting macros. From my experience trying to build AST in compiler plugins, I would like to be able to build any AST piece with a quasiquoting macro (e.g., `quote_struct_field!` or `quote_variant!`) and then use those AST pieces in other quasiquoting macros, but this pull request just adds some of the low-hanging fruit.

I'm not sure if these additions are desirable, and I'm sure these macros can be implemented in an external crate if not.

8 years agoMake the mir_map available to the after_analysis CompileController step.
Scott Olson [Thu, 12 Nov 2015 20:18:11 +0000 (14:18 -0600)]
Make the mir_map available to the after_analysis CompileController step.

8 years agoUpdate references and borrowing (Fixes #29730)
Ashkan Kiani [Thu, 12 Nov 2015 18:35:53 +0000 (10:35 -0800)]
Update references and borrowing (Fixes #29730)

Fixes #29730

8 years agoAuto merge of #29712 - Toby-S:patch-1, r=steveklabnik
bors [Thu, 12 Nov 2015 18:00:27 +0000 (18:00 +0000)]
Auto merge of #29712 - Toby-S:patch-1, r=steveklabnik

Adds `Example` sections to the rest of the integer methods.

cc @steveklabnik

8 years agoAuto merge of #29757 - dotdash:mir_simplify_cfg, r=nikomatsakis
bors [Thu, 12 Nov 2015 15:48:34 +0000 (15:48 +0000)]
Auto merge of #29757 - dotdash:mir_simplify_cfg, r=nikomatsakis

For now, this pass does some easy transformations, like eliminating
empty blocks that just jump to another block, some trivial
conversion of If terminators into Gotos and removal of dead blocks.

r? @nikomatsakis