Commit Graph

54179 Commits

Author SHA1 Message Date
bors
aee3073bd9 Auto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelix
Prevent overflows by increasing ring buffer size

Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.
2016-05-29 03:02:46 -07:00
Srinivas Reddy Thatiparthy
593e1567ca run rustfmt on librustc_llvm folder 2016-05-29 14:57:34 +05:30
Srinivas Reddy Thatiparthy
5ed45ef354 run rustfmt on libunwind 2016-05-29 08:47:51 +05:30
Srinivas Reddy Thatiparthy
72baa41b88 run rustfmt on librand folder 2016-05-29 08:40:34 +05:30
bors
397cfaec0c Auto merge of #33848 - alexcrichton:android-gdb-sysroot, r=michaelwoerister
test: Use `set sysroot` for more NDK compatibility

Recent versions of the Android NDK no longer ship debuggers like
`arm-linux-androideabi-gdb`, but instead one prebuilt binary `gdb`. We can
symlink this into place at least to get our detection still working, but it now
needs to be told what the sysroot is so it can correctly do... something. Long
story short, tests didn't pass with this change and after this change they pass.
2016-05-28 19:19:27 -07:00
bors
7746a334da Auto merge of #33825 - alexcrichton:fix-beta, r=aturon
mk: Fix bootstrapping cross-hosts on beta

The beta builds are currently failing, unfortunately, due to what is presumably
some odd behavior with our makefiles. The wrong bootstrap key is being used to
generate the stage1 cross-compiled libraries, which fails the build.
Interestingly enough if the targets are directly specified as part of the build
then it works just fine! Just a bare `make` fails...

Instead of trying to understand what's happening in the makefiles instead just
tweak how we configure the bootstrap key in a way that's more likely to work.
2016-05-28 16:21:53 -07:00
bors
90d9a515af Auto merge of #33824 - alexcrichton:rustbuild-fix-local-rust, r=nikomatsakis
rustbuild: Add support for --enable-local-rust

This commit adds support for the `--enable-local-rust` `./configure` switch
which uses the locally installed `rustc` to bootstrap the compiler.
2016-05-28 13:24:51 -07:00
Sebastian Thiel
406378b6bb Prevent overflows by increasing ring buffer size
Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.
2016-05-28 21:29:14 +02:00
Vadim Petrochenkov
731144b95a sanity -> validation
Add test for `::super` in import prefix
2016-05-28 20:52:49 +03:00
Vadim Petrochenkov
c02c6e88e6 Move some other checks to AST sanity pass 2016-05-28 20:27:57 +03:00
Vadim Petrochenkov
2abdf96344 Add an AST sanity checking pass and use it to catch some illegal lifetime/label names 2016-05-28 20:27:57 +03:00
bors
623af22b9a Auto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakis
Do not inject test harness for --cfg test

Fix #33670.
2016-05-28 10:24:01 -07:00
Vadim Petrochenkov
ae999e9c8f Address review comments 2016-05-28 19:58:06 +03:00
Vadim Petrochenkov
cf46820694 Refactor away some functions from hir::pat_util 2016-05-28 17:37:58 +03:00
bors
f1776fe244 Auto merge of #33927 - Manishearth:rollup, r=Manishearth
Rollup of 15 pull requests

- Successful merges: #33820, #33821, #33822, #33824, #33825, #33831, #33832, #33848, #33849, #33852, #33854, #33856, #33859, #33860, #33861
- Failed merges:
2016-05-28 07:22:51 -07:00
Manish Goregaokar
fe9a91589e Rollup merge of #33856 - GuillaumeGomez:fmt_error, r=alexcrichton
Implement Error trait for fmt::Error type

Fixes #33827.

r? @alexcrichton

Just one last thing: I added a feature name, but don't hesitate to ask me to change it if you think it doesn't fit well.
2016-05-28 19:52:16 +05:30
Manish Goregaokar
81aeb0cdde Rollup merge of #33854 - petrochenkov:prefvis, r=eddyb
Apply visit_path to import prefixes by default

Overriding `visit_path` is not enough to visit all paths, some import prefixes are not visited and `visit_path_list_item` need to be overridden as well. This PR removes this catch, it should be less error prone this way. Also, the prefix is visited once now, not repeatedly for each path list item.

r? @eddyb
2016-05-28 19:52:16 +05:30
Manish Goregaokar
edd7d422b7 Rollup merge of #33852 - arielb1:autoderef-iterator, r=eddyb
refactor autoderef to avoid prematurely registering obligations

Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes #24819
Fixes #25801
Fixes #27631
Fixes #31258
Fixes #31964
Fixes #32320
Fixes #33515
Fixes #33755

r? @eddyb
2016-05-28 19:52:16 +05:30
Manish Goregaokar
6e897d78ae Rollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton
Implement `count` for `EscapeUnicode`

and cleanup the code for `count` for `EscapeDefault` (instead of repeating the `match` for `size_hint` and `count`).

This PR marks EscapeUnicode and EscapeDefault as ExactSizeIterator. The constraints for the trait implementations held even before this PR, but I am not sure if this is something we want to guarantee/expose (I would love feedback on this, especially on what would be the appropriate way to handle stabilisation, if needed).

Part of #24214, split from #31049.

The test for `count` was added in #33103.
2016-05-28 19:52:16 +05:30
Manish Goregaokar
320dd04fab Rollup merge of #33832 - alexcrichton:android-memalign, r=luqmana
std: Use memalign, not posix_memalign, on Android

We've gotten requests to move our Android support as far back as API level 9
where unfortunately the `posix_memalign` API wasn't implemented yet. Thankfully,
however, the `memalign` API was and it appears to be usable with `free` on the
Android platform (see comments included in commit).

This should help fix some of the last few test failures when compiling against
API level 9.
2016-05-28 19:52:16 +05:30
Manish Goregaokar
0a6bf3744b Rollup merge of #33831 - diwic:patch-1, r=aturon
panic.rs: fix docs (recover -> catch_unwind)

The current docs are a bit inconsistent. First, change all references of "recover" to "catch_unwind" because the function was renamed. Second, consistently use the term "unwind safe" instead of "panic safe", "exception safe" and "recover safe" (all these terms were used previously).
2016-05-28 19:52:16 +05:30
Manish Goregaokar
0ed494e92e Rollup merge of #33822 - soltanmm:dot-vec-div-mag-square, r=nikomatsakis
Propagate obligations through projection

Up next: generating region obligations in inference.

r? @nikomatsakis
2016-05-28 19:52:15 +05:30
Manish Goregaokar
fe19b473d2 Rollup merge of #33820 - jonathandturner:format_readability_updates, r=nikomatsakis
Increase spacing in error format for readability.

Two small tweaks that seem to help readability quite a bit:
* Add spacing header<->snippet, but use the |> on the side for visual consistency
* Fix #33819
* Fix #33763
* Move format-sensitive test (issue-26480 in cfail) to ui test

r? @nikomatsakis
2016-05-28 19:52:15 +05:30
Jeffrey Seyfried
a0e606c380 Use the span of #[derive_Eq] for #[structural_match] 2016-05-28 11:58:45 +00:00
bors
7d68b3d106 Auto merge of #33818 - alexcrichton:bump, r=nikomatsakis
mk: Bump version number

The 1.10 betas are now under way so we're now working on the 1.11 release.
2016-05-28 01:59:04 -07:00
Jeffrey Seyfried
40f047dc7a Add test 2016-05-28 08:43:36 +00:00
Jeffrey Seyfried
6019816da8 Refactor away set_expn_info 2016-05-28 08:43:35 +00:00
Jeffrey Seyfried
074f4c2c91 Fix spans of generated #[derive_*] attributes 2016-05-28 08:43:34 +00:00
Jeffrey Seyfried
cc36e38279 Fix fallout in tests 2016-05-28 05:22:22 +00:00
Jeffrey Seyfried
4259fba7e6 Fix macro call site spans 2016-05-28 05:22:16 +00:00
bors
f89c0c2f4b Auto merge of #33800 - nrc:save-fn-name, r=eddyb
save-analysis: use a function's short name
2016-05-27 20:45:46 -07:00
Jamey Sharp
80d733385a Inline simple Cursor write calls
Implementing the Write trait for Cursors over slices is so light-weight that under some circumstances multiple writes can be fused into a single instruction. In general I think inlining these functions is a good idea because most of the code can be constant-folded and copy-propagated away.

Closes issue #33916.
2016-05-27 19:34:20 -07:00
bors
8b012ed142 Auto merge of #33706 - jseyfried:refactor_cfg, r=nrc
Perform `cfg` attribute processing during macro expansion and fix bugs

This PR refactors `cfg` attribute processing and fixes bugs. More specifically:
 - It merges gated feature checking for stmt/expr attributes, `cfg_attr` processing, and `cfg` processing into a single fold.
  - This allows feature gated `cfg` variables to be used in `cfg_attr` on unconfigured items. All other feature gated attributes can already be used on unconfigured items.
 - It performs `cfg` attribute processing during macro expansion instead of after expansion so that macro-expanded items are configured the same as ordinary items. In particular, to match their non-expanded counterparts,
  - macro-expanded unconfigured macro invocations are no longer expanded,
  - macro-expanded unconfigured macro definitions are no longer usable, and
  - feature gated `cfg` variables on macro-expanded macro definitions/invocations are now errors.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m {
    () => {
        #[cfg(attr)]
        macro_rules! foo { () => {} }
        foo!(); // This will be an error

        macro_rules! bar { () => { fn f() {} } }
        #[cfg(attr)] bar!(); // This will no longer be expanded ...
        fn g() { f(); } // ... so that `f` will be unresolved.

        #[cfg(target_thread_local)] // This will be a gated feature error
        macro_rules! baz { () => {} }
    }
}

m!();
```

r? @nrc
2016-05-27 17:46:14 -07:00
Jeffrey Seyfried
53ab137841 Comment methods in CfgFolder 2016-05-27 23:57:02 +00:00
Jeffrey Seyfried
6b3edc2f89 Test that unconfigured macro-expanded macro invocations are not expanded. 2016-05-27 23:57:01 +00:00
Vadim Petrochenkov
216f5fba04 Separate bindings from other patterns in HIR 2016-05-28 00:54:29 +03:00
Ty Coghlan
feb0b27e41 Added examples/docs to split in str.rs
Added documentation clarifying the behavior of split when used with the empty string and contiguous separators.
2016-05-27 17:53:13 -04:00
bors
7bddce693c Auto merge of #33798 - locallycompact:lc/misleading-intentation, r=alexcrichton
Fix misleading intentation errors on gcc 6.0

Currently building with latest gcc results in the following error:

    compile: x86_64-unknown-linux-gnu/rt/miniz.o
    /home/lc/rust/src/rt/miniz.c: In function ‘tinfl_decompress’:
    /home/lc/rust/src/rt/miniz.c:578:9: error: this ‘for’ clause does not guard... [-Werror=misleading-indentation]
             for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
             ^~~
    /home/lc/rust/src/rt/miniz.c:578:47: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
             for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
                                                   ^~~
    /home/lc/rust/src/rt/miniz.c: In function ‘tdefl_find_match’:
    /home/lc/rust/src/rt/miniz.c:1396:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
         ^~
    /home/lc/rust/src/rt/miniz.c:1396:23: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
                           ^

This patch stops this.
2016-05-27 14:49:10 -07:00
Srinivas Reddy Thatiparthy
3fd0e4c7f2 rustfmt liballoc folder 2016-05-28 02:25:16 +05:30
Guillaume Gomez
4fa84830f8 improve E0152 error explanation 2016-05-27 21:57:06 +02:00
Guillaume Gomez
c848ca1f8d Improve E0133 error explanation 2016-05-27 21:53:38 +02:00
Guillaume Gomez
360d7234c7 Improve E0138 error explanation 2016-05-27 21:47:59 +02:00
Guillaume Gomez
a1e240ccec Improve E0137 error explanatIon 2016-05-27 21:45:15 +02:00
Guillaume Gomez
a850d407b2 Improve E0132 error explanation 2016-05-27 21:29:07 +02:00
bors
17b6261cc4 Auto merge of #33795 - srinivasreddy:lib_coll_test, r=nrc
run rustfmt on libcollections test module
2016-05-27 11:51:53 -07:00
Michael Woerister
4f7ab0e16b Emit "no-frame-pointer-elim" attribute for closures, shims, and glue. 2016-05-27 13:54:43 -04:00
M Farkas-Dyck
db84fc1403 make core::str::next_code_point work on arbitrary iterator 2016-05-27 08:54:52 -08:00
bors
ab7c35fa0f Auto merge of #33900 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests

- Successful merges: #33753, #33815, #33829, #33858, #33865, #33866, #33870, #33874, #33891, #33898
- Failed merges:
2016-05-27 03:56:19 -07:00
flo-l
ef82f78ee9 save-temps was moved under the -C switch 2016-05-27 11:01:27 +02:00
Guillaume Gomez
2c4fd94636 Rollup merge of #33898 - srinivasreddy:rustfmt_liblog, r=Manishearth
rustfmt on liblog
2016-05-27 10:50:05 +02:00