Commit Graph

46197 Commits

Author SHA1 Message Date
llogiq e1f89196a0 take mapped function by mutable reference 2015-09-03 14:50:06 +02:00
Manish Goregaokar a520568ae7 Elide lifetimes in libcore 2015-09-03 17:46:35 +05:30
Ariel Ben-Yehuda 16f75f773d create a region-map for types in generics
Fixes #28181
This may fix #28151
2015-09-03 13:35:41 +03:00
llogiq b6a3978886 clippy improvements to iterators 2015-09-03 12:35:34 +02:00
Ariel Ben-Yehuda cde09e7ca3 rewrite metadata indexing
this improves the compilation time for small crates by ~20%
2015-09-03 12:59:51 +03:00
Ariel Ben-Yehuda fcad49e416 remove totally useless struct-field index 2015-09-03 12:23:56 +03:00
Simonas Kazlauskas c493084ec1 Adapt the PR for HIR changes 2015-09-03 11:54:17 +03:00
Vadim Petrochenkov 405c616eaf Use consistent terminology for byte string literals
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03 10:54:53 +03:00
Vadim Petrochenkov 06fb196256 Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T` 2015-09-03 09:49:50 +03:00
John Thomas 6fcdead4ee Bash output fix to match real 'ruby embed.rb' call
The embed rust file that we compile prints out 'Thread finished..' messages along with a 'done!'
2015-09-02 23:13:56 -07:00
Vadim Petrochenkov 3903ea96f5 Make `null()` and `null_mut()` const functions 2015-09-03 09:03:52 +03:00
Xiao Chuan Yu 865d6c3b5b Fix mistake in trait.md 2015-09-03 01:36:22 -04:00
bors 1661947014 Auto merge of #28182 - jackwilsonv:patch-2, r=steveklabnik
r? @steveklabnik

##### About the `struct` section specifically:
I wasn't sure how you'd feel about the first instance since it was originally capitalized, happy to change it back if you think that's better.

Also, I left 'tuple struct' as is since together it isn't a keyword. The first instance currently has single quotes but the others have nothing. I think that feels right.

##### Generally:
I'm working through the book now and I'm happy to keep updating this branch with any formatting tweaks or updates I find if that's easier for you guys, otherwise I'll just create smaller PRs as I go. Just let me know.
2015-09-03 04:43:40 +00:00
bors 69c3b39d0d Auto merge of #28174 - steveklabnik:gh14705, r=alexcricton
Because 'doc' is a directory, when running `make doc`, you'll see
this:

    make: Nothing to be done for `doc'.

By adding a target for `doc` to build `docs`, both work.

Fixes #14705
2015-09-03 02:12:21 +00:00
Steve Klabnik 7c8c72d3b0 Introduce 'make doc' -> 'make docs'
Because 'doc' is a directory, when running `make doc`, you'll see
this:

    make: Nothing to be done for `doc'.

By adding a target for `doc` to build `docs`, both work.

Fixes #14705
2015-09-02 22:00:58 -04:00
Jack Wilson 28bf68f3fe Makes formatting of struct keyword consistent 2015-09-02 18:58:18 -07:00
Simonas Kazlauskas 1a6934840e Fix hygienic-label-x tests 2015-09-03 03:50:46 +03:00
Simonas Kazlauskas f6244f1516 Fix #28105 test and add a test for #28109 2015-09-03 03:50:46 +03:00
Simonas Kazlauskas d8074e65b0 Use proper span for break and continue labels
Fixes #28109
2015-09-03 03:50:43 +03:00
Alex Crichton 04c09f9466 std: Run at_exit cleanup on process::exit
This adds a call to `rt::cleanup` on `process::exit` to make sure we clean up
after ourselves on the way out from Rust.

Closes #28065
2015-09-02 17:21:11 -07:00
bors cd138dc447 Auto merge of #28138 - nrc:hir, r=nikomatsakis
r? @nikomatsakis 

Trying to land this first stab, which basically just duplicates the AST. Will file issues for the various things I've got in mind to improve.
2015-09-02 22:44:25 +00:00
Ariel Ben-Yehuda ab86bf53eb consolidate type-variable handling in assemble_candidates
this resolves type-variables early in assemble_candidates and
bails out quickly if the self type is an inference variable (which would
fail anyway because of `assemble_candidates_from_projected_tys`).

In both these cases, `assemble_candidates_from_impls` would try to go
over all impls and match them, leading to O(n*m) performance. Fixing this
improves rustc type-checking performance by 10%. As type-checking is only
is 5% of compilation, this doesn't impact bootstrap times, but *does*
improve type-error-detection time which is nice.

Crates that have many dependencies and contain significant amounts of
generic functions could see a bigger perf boost. As a microbenchmark,
the crate generated by

echo '#![feature(rustc_private)]'
echo 'extern crate rustc_driver;'
for i in {1..1000}; do cat << _EOF_
    pub fn foo$i<T>() {
        let mut v = Vec::new();
        let _w = v.clone();
        v.push("");
    }
_EOF_
done

sees performance improve from 7.2 to 1.4 seconds. I imagine many crates
would fall somewhere in-between.
2015-09-03 01:42:18 +03:00
Nick Cameron facdf2ebb1 Add an intital HIR and lowering step 2015-09-03 10:02:36 +12:00
bors b7b1dced3c Auto merge of #28117 - marcusklaas:continue-break, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/28108.
2015-09-02 21:02:34 +00:00
bors cfd76b364c Auto merge of #28135 - jackwilsonv:patch-1, r=steveklabnik
Small formatting change

r? @steveklabnik
2015-09-02 19:08:18 +00:00
Marcus Klaas 3a360fca78 Fix overly long spans for break and continue
The spans of break and continue would include the next token.
2015-09-02 20:55:17 +02:00
bors a53d31a51b Auto merge of #28165 - mneumann:dragonfly_snapshots, r=alexcrichton
@alexcrichton: The snapshot file is here: http://www.ntecs.de/downloads/rust/rust-stage0-2015-08-11-1af31d4-dragonfly-x86_64-08e7dd9d77434b377c0905cc5f8c705b2daf3a0e.tar.bz2.

This is the first part in getting Continuous builds for DragonFly (#16298).
2015-09-02 17:27:10 +00:00
Michael Neumann ebf311cef5 Add snapshot for DragonFly BSD 2015-09-02 18:21:02 +02:00
bors ef02ffa9fb Auto merge of #28162 - mneumann:dragonfly_fix_stat, r=alexcrichton 2015-09-02 14:51:11 +00:00
Alisdair Owens c6b0fccac8 Add long diagnostics for E0329 2015-09-02 15:35:56 +01:00
bors 370fe27861 Auto merge of #28163 - llogiq:master, r=Manishearth 2015-09-02 10:20:41 +00:00
llogiq 2a65474221 Improved libfmt_macros code style with clippy 2015-09-02 12:13:10 +02:00
Michael Neumann 52e7f5553e Fix compile on DragonFly: Replace unknown uint32_t/in64_t by u32/i64. 2015-09-02 10:57:57 +02:00
bors 0dbbab9049 Auto merge of #28156 - nagisa:binaryheap-debug, r=Gankro
r? @Gankro
2015-09-02 06:37:32 +00:00
bors cb40b8a2ab Auto merge of #28155 - vchimishuk:doc-rust-inside-other-languages-tab, r=alexcrichton
Fixed x variable identation. How it was displayed in Firefox before: http://s16.postimg.org/c9448tn0k/Screenshot_from_2015_09_01_17_35_43.jpg
2015-09-02 04:55:37 +00:00
bors e758946f96 Auto merge of #28149 - jakerr:atomic, r=alexcrichton
Makes the code agree with the comment: 'value answers "am I locked?"'.
2015-09-02 03:13:43 +00:00
bors dfe9326941 Auto merge of #28148 - eefriedman:binary_heap, r=alexcrichton 2015-09-02 01:33:20 +00:00
bors 7780408af6 Auto merge of #28132 - arielb1:uninstantiable, r=nikomatsakis
It is *very* easy to bypass, and is a relic of a bygone age where the type-checker was *much* less robust.

Fixes #27497

r? @nikomatsakis
2015-09-01 23:51:47 +00:00
bors 40c00e9c06 Auto merge of #28146 - eefriedman:deque_extras, r=alexcrichton 2015-09-01 22:07:59 +00:00
bors cb9323ec09 Auto merge of #28130 - alexcrichton:fix-msvc-static-tls-dtor, r=brson
Running TLS destructors for a MSVC Windows binary requires the linker doesn't
elide the `_tls_used` or `__tls_used` symbols (depending on the architecture).
This is currently achieved via a `#[link_args]` hack but this only works for
dynamically linked binaries because the link arguments aren't propagated to
statically linked binaries.

This commit alters the strategy to instead emit a volatile load from those
symbols so LLVM can't elide it, forcing the reference to the symbol to stay
alive as long as the callback function stays alive (which we've made sure of
with the `#[linkage]` attribute).

Closes #28111
2015-09-01 19:34:21 +00:00
Alex Crichton 9a3acece30 std: Run TLS destructors in a statically linked binary
Running TLS destructors for a MSVC Windows binary requires the linker doesn't
elide the `_tls_used` or `__tls_used` symbols (depending on the architecture).
This is currently achieved via a `#[link_args]` hack but this only works for
dynamically linked binaries because the link arguments aren't propagated to
statically linked binaries.

This commit alters the strategy to instead emit a volatile load from those
symbols so LLVM can't elide it, forcing the reference to the symbol to stay
alive as long as the callback function stays alive (which we've made sure of
with the `#[linkage]` attribute).

Closes #28111
2015-09-01 11:03:28 -07:00
bors 5c7c5bb1e1 Auto merge of #28088 - tbu-:pr_fixed_size_array, r=alexcrichton 2015-09-01 17:39:33 +00:00
Simonas Kazlauskas 8db906c752 Implement Debug for BinaryHeap
Fixes #28154
2015-09-01 20:27:48 +03:00
bors 7e3eabc699 Auto merge of #28152 - llogiq:master, r=Manishearth
This changes a lot of `.to_string()` to `.to_owned()`, removes a few redundant closures, and changes some `match`es to `if let`s.

I'm currently in the process of trying out clippy and acting on its suggestions. I started with compiletest, because we use it to test clippy, too. If this finds positive reception, I may continue refactoring other parts of the rust codebase.
2015-09-01 15:44:50 +00:00
Viacheslav Chimishuk 5ae8a0d38f Source code style fixed: tab replaced with whitespaces. 2015-09-01 17:49:08 +03:00
bors 2e9a74e3ab Auto merge of #28115 - AlexDenisov:patch-1, r=steveklabnik
r? @steveklabnik
2015-09-01 13:51:11 +00:00
llogiq 99383f8f5c refactored compiletest following clippy's suggestions 2015-09-01 14:43:42 +02:00
bors 19a33edaa9 Auto merge of #28060 - GuillaumeGomez:patch-3, r=Manishearth
Part of #24407

r? @Manishearth
2015-09-01 11:58:28 +00:00
bors ae75ef9e62 Auto merge of #28137 - nrc:remove-non-multi, r=huonw
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-09-01 09:12:52 +00:00
Jake Kerr 8213f01a76 Reverse AtomicBool value in nomicon example to agree with its comment.
Makes the code agree with the comment: 'value answers "am I locked?"'.
2015-09-01 17:32:22 +09:00