Commit Graph

60136 Commits

Author SHA1 Message Date
comex
743535a643 Add test case. 2017-01-06 23:15:08 -05:00
comex
55513696bd Fix test/ui/span/issue-24690.stderr
The errors are now emitted in a different order (in order of source
location rather than going back and forth) but otherwise everything's
the same.
2017-01-06 23:14:57 -05:00
comex
b16a54dd30 Remove accidental submodule change. 2017-01-06 23:13:32 -05:00
comex
b32246279d Fix lint attributes on non-item nodes.
Currently, late lint checking uses two HIR visitors: LateContext and
IdVisitor.  IdVisitor only overrides visit_id, and for each node searches
for builtin lints previously added to the session; LateContext overrides
a number of methods, and runs late lints.  When LateContext encounters an
item, it first has IdVisitor walk everything in it except nested items
(OnlyBodies), then recurses into it itself - i.e. there are two separate
walks.

Aside from apparently being unnecessary, this separation prevents lint
attributes (allow/deny/warn) on non-item HIR nodes from working
properly.  Test case:

// generates warning without this change
fn main() { #[allow(unreachable_code)] loop { break; break; } }

LateContext contains logic to merge attributes seen into the current lint
settings while walking (with_lint_attrs), but IdVisitor does not.  So
such attributes will affect late lints (because they are called from
LateContext), and if the node contains any items within it, they will
affect builtin lints within those items (because that IdVisitor is run
while LateContext is within the attributed node), but otherwise the
attributes will be ignored for builtin lints.

This change simply removes IdVisitor and moves its visit_id into
LateContext itself.  Hopefully this doesn't break anything...

Also added walk calls to visit_lifetime and visit_lifetime_def
respectively, so visit_lifetime_def will recurse into the lifetime and
visit_lifetime will recurse into the name.  In principle this could
confuse lint plugins.  This is "necessary" because walk_lifetime calls
visit_id on the lifetime; of course, an alternative would be directly
calling visit_id (which would require manually iterating over the
lifetimes in visit_lifetime_def), but that seems less clean.
2017-01-03 22:30:41 +01:00
bors
8f62c29200 Auto merge of #38473 - zackmdavis:issue_kebab, r=sanxiyn
prefer hyphens in test files named after issue numbers

We have a lot of tests with filenames honoring particular issues by
number. Typically, these are called issue-${issue_no}.rs (note the
hyphen):

```
$ find . -regextype posix-egrep -regex '.*/issue-[0-9]*.rs' | wc
   1289    1289   35935
```

We also had a much smaller number of files that are like this, but don't
have a hyphen in between the substring `issue` and the number:

```
$ find . -regextype posix-egrep -regex '.*/issue[0-9]*.rs'
./debuginfo/issue14411.rs
./debuginfo/issue12886.rs
./debuginfo/issue13213.rs
./debuginfo/issue22656.rs
./debuginfo/issue7712.rs
./compile-fail/issue32829.rs
./run-pass/issue24353.rs
./run-pass/issue34796.rs
./run-pass/issue18173.rs
./run-pass/issue22346.rs
./run-pass/auxiliary/issue13507.rs
./run-pass/issue26127.rs
./run-pass/issue22008.rs
./run-pass/issue34569.rs
./run-pass/issue29927.rs
./run-pass/issue36260.rs
```

Some would argue that the inconsistency is æsthetically displeasing,
hence this trivial patch. (Note that run-pass/auxiliary/issue13507.rs
has an excuse; it's `use`d in run-pass/issue-13507-2.rs; the matter of
there being two different compile-fail tests with different name
conventions for issue no. 32829 is also neglected here for the sake of
keeping this trivial cleanup patch as trivial as possible for ease of
review.)
2017-01-03 09:42:22 +00:00
bors
7766b509b3 Auto merge of #38791 - dylanmckay:foreign-item-dc, r=eddyb
Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present

This functionality was missing, and should have existed previously.

Fixes #38780
2017-01-03 07:41:43 +00:00
bors
1659d65e03 Auto merge of #38782 - clarcharr:stupid, r=GuillaumeGomez
Reword 'stupid' and 'crazy' in docs.

These terms are not very descriptive and are better reworded as something else.
2017-01-03 02:21:00 +00:00
Dylan McKay
09178e455e Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present
This functionality was missing, and should have existed previously.

Fixes #38780
2017-01-03 14:54:15 +13:00
Clar Charr
8ffc3e7790 Reword 'stupid' and 'crazy' in docs. 2017-01-02 16:29:19 -05:00
bors
d3a2efa14b Auto merge of #38543 - philipc:unsized-debuginfo, r=michaelwoerister
Fix debuginfo for unsized struct members

The member was given the size of a fat pointer, which caused
llvm to emit DWARF attributes for a 128-bit bitfield.
2017-01-02 20:17:01 +00:00
bors
9953e76ca4 Auto merge of #38760 - est31:ignorecfg, r=sanxiyn
Fix pre-cfg_attr notation in comment

Commit aa3b1261b1 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
2017-01-02 18:10:37 +00:00
bors
df61658c8a Auto merge of #38766 - eddyb:less-fake-hir, r=arielb1
Stop creating fake HIR pattern nodes.

This replaces all the HIR patterns `rustc_const_eval` creates with the more appropriate HAIR equivalent.

The only place left that creates HIR nodes is the "explicit lifetimes in function signature" suggestion, which only creates type nodes while rebuilding the signature, but that is only in case of an error.

cc @arielb1
2017-01-02 13:51:43 +00:00
bors
07191e2b11 Auto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcv
Add missing example for Thread struct

r? @frewsxcv
2017-01-01 22:45:02 +00:00
bors
917e5baae7 Auto merge of #38765 - xen0n:i-dont-like-red-bots-2, r=alexcrichton
rustbuild: fix dist-analysis with full bootstrap disabled

Really fixes #38734, per discussion in #38752 which was solving the underlying problem the wrong way.

This just mirrors the [similar logic] in documentation building as suggested, that just takes the stage1 compiler artifacts instead in case of non-full-bootstrap builds. Actually copying the artifacts around seems to be unnecessary.

r? @alexcrichton

[similar logic]: 7b659cfdbc/src/bootstrap/doc.rs (L140-L144)
2017-01-01 20:43:21 +00:00
Eduard-Mihai Burtescu
c6e130e89b rustc_const_eval: convert constants to Pattern instead of hir::Pat. 2017-01-01 22:17:18 +02:00
Wang Xuerui
24c7340e3e
rustbuild: fix dist-analysis with full bootstrap disabled 2017-01-02 04:12:49 +08:00
est31
2dc2284808 Fix pre-cfg_attr notation in comment
Commit aa3b1261b1 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
2017-01-01 20:34:23 +01:00
Eduard-Mihai Burtescu
c001b0940c rustc_const_eval: build Pattern instead of hir::Pat for pretty-printing. 2017-01-01 20:57:21 +02:00
bors
4947adaa8c Auto merge of #38692 - estebank:remove-try-from-pprust, r=petrochenkov
Use `?` instead of `try!` macro in `print::pprust`
2017-01-01 18:42:34 +00:00
bors
7b659cfdbc Auto merge of #38753 - philipc:debuginfo-union, r=petrochenkov
Add pretty printing of unions in debuggers

Fixes #37479
2017-01-01 16:41:29 +00:00
bors
ac5cd3bd43 Auto merge of #38745 - CannedYerins:llvm-code-style, r=rkruppe
Improve naming style in rustllvm.

As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.

Fixes #38688.

r? @rkruppe
2017-01-01 11:58:02 +00:00
bors
e1279a0b30 Auto merge of #38726 - japaric:sparc64, r=sanxiyn
sparc64-linux support

This is built on top of #38656 and depends on rust-lang/libc#483

Hello world works.

The libc-test test suite passes.

`panic!` doesn't fully work:

```
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)
```

Backtraces don't work either, probably related to the previous point:

```
$ export RUST_BACKTRACE=1
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
stack backtrace:
Illegal instruction (core dumped)
```

r? @alexcrichton

@jakllsch Does panicking / backtraces work on sparc64-netbsd?

cc @glaubitz
2017-01-01 09:56:18 +00:00
Philip Craig
1765a3fd30 Add pretty printing of unions in debuggers
Fixes #37479
2017-01-01 19:34:06 +10:00
bors
e227433dc3 Auto merge of #38711 - programble:doc/slice-iter-method-links, r=brson
Add links to methods on all slice iterator struct docs

In the same style as `std::slice::Iter` to help people find how to create iterators.

r? @steveklabnik
2017-01-01 07:54:04 +00:00
bors
453172bdf9 Auto merge of #38713 - clarcharr:trusted_len, r=brson
TrustedLen for Empty and Once.

These implementations were missing, so, I went ahead and added them.
2017-01-01 05:39:16 +00:00
Seo Sanghyeon
b14785d3d0 Merge branch 'master' into sparc64 2017-01-01 12:40:10 +09:00
bors
08babdb412 Auto merge of #38653 - Mark-Simulacrum:dropless-arena, r=eddyb
Add a DroplessArena and utilize it as a more efficient arena when possible

I will collect performance (probably just `-Ztime-passes`, and more if that shows significant differences, perhaps).

6feba98 also fixes a potential infinite loop if inplace reallocation failed for `TypedArena` (and `DroplessArena` via copied code).

r? @eddyb
2017-01-01 02:39:40 +00:00
bors
07412c8d25 Auto merge of #38736 - xen0n:save-the-save-analysis, r=alexcrichton
rustbuild: save the save analysis

Fixes #38734. ~~call me the nightly firefighter~~

r? @alexcrichton
2017-01-01 00:27:35 +00:00
bors
90c80e0c4d Auto merge of #38708 - alexcrichton:add-distcheck, r=brson
Gate on distcheck on Travis

This commit adds a new entry to the Travis matrix to gate on distcheck, the illustrious test process that has historically taken *8 hours* to complete and also breaks all the time on nightly. By adding it to Travis we should hope to never see nightly breakage (like https://github.com/rust-lang/rust/issues/38690) because of this ever again!

"But wait, surely we can't wait 8 hours for all PRs!" you might be thinking, and you are indeed correct. The distcheck added here is much more optimized for speed than the old buildbot instances for a number of reasons:

* We're not building *two host compilers* beforehand. The current distcheck bot does a cross for i686 Linux and x86_64 Linux before it actually runs distcheck, building 6 compilers and LLVM twice. None of this is done in parallel as well (e.g. `-j1`). Not doing any of this work will be a huge win!
* We're using sccache to compile LLVM, so it should be much faster. Distcheck on the bots didn't cache LLVM well and rebuilt it every time.

All in all, this version of "distcheck" should be exactly like other matrix entries that run tests except that it's a *little* slower to start as it has to create the source tarball then rebuild the build system in the distcheck dir. Overall this should be well under the 2 hours that Android is currently taking anyway.

Closes https://github.com/rust-lang/rust/issues/38691
2016-12-31 22:08:32 +00:00
bors
38bd207626 Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)
2016-12-31 18:54:31 +00:00
Mark Simulacrum
1676bec5bf Utilize new in_arena method instead of hashing for Lifting interned items 2016-12-31 11:48:48 -07:00
Mark Simulacrum
0e43b378c1 Split CtxtArenas into GlobalArenas and CtxtInterners.
CtxtInterners contains a single DroplessArena, while GlobalArenas
contains the TypedArenas still required for the remaining
Drop-containing types.
2016-12-31 11:48:48 -07:00
Ian Kerins
e6f97114ca Improve naming style in rustllvm.
As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.

Fixes #38688.
2016-12-31 13:20:30 -05:00
est31
29e01af6a6 Fix iabs and add some more tests 2016-12-31 18:19:06 +01:00
bors
6185c54452 Auto merge of #38737 - keeperofdakeys:proc-macro-derive-Dec-16, r=jseyfried
Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation

Fixes #38706

r? @jseyfried
2016-12-31 16:49:27 +00:00
Mark Simulacrum
bb1959f416 Fix TypedArena infinitely looping when inplace reallocation fails. 2016-12-31 08:38:56 -07:00
Mark Simulacrum
9e963b9b2f Add a non type-specific arena.
It relies on the underlying types not having special Drop behavior.
2016-12-31 08:38:55 -07:00
Wang Xuerui
e46d2d8ca2
rustbuild: fix save-analysis not being saved for 2-stage builds 2016-12-31 23:07:55 +08:00
bors
ca0cc27ab6 Auto merge of #38709 - alexcrichton:check-xsv, r=nikomatsakis
cargotest: Add xsv to tested crates

This was intended to land in #37149 but I ended up backing it out to land the
rollup (#38697) last night as I was itching to do so. This morning though xsv
has been fixed now (BurntSushi/xsv#53) so we should be able to add it!
2016-12-31 12:44:32 +00:00
Guillaume Gomez
3312febf22 Add missing example for Thread struct 2016-12-31 13:10:44 +01:00
bors
9a07f3e236 Auto merge of #38702 - philipc:debuginfo-lldb, r=alexcrichton
rustbuild: allow running debuginfo-lldb tests on linux
2016-12-31 10:39:46 +00:00
bors
f29a9a2192 Auto merge of #38667 - alexcrichton:stage0-tools, r=brson
rustbuild: Compile all support tools in stage0

This commit changes all tools and such to get compiled in stage0, not in
later stages. The purpose of this commit is to cut down dependencies on later
stages for future modifications to the build system. Notably we're going to be
adding builders that produce a full suite of cross-compiled artifacts for a
particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu`
compiler more than once. Currently dependencies on, for example, the error index
end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary.

As a result here we move many dependencies on these tools to being produced by a
stage0 compiler, not a stage1+ compiler. None of these tools actually need to be
staged at all, so they'll exhibit consistent behavior across the stages.
2016-12-31 08:21:59 +00:00
Josh Driver
e9b5839918 Style fixes 2016-12-31 17:55:59 +10:30
Josh Driver
22f788c644 Stop macro calls in structs for proc_macro_derive from panicing 2016-12-31 17:19:23 +10:30
Wang Xuerui
8d5b91a19f
rustbuild: check if compiler is final stage wrt the full bootstrap setting 2016-12-31 14:29:34 +08:00
bors
8c547a021e Auto merge of #38729 - alexcrichton:android-steps, r=brson
rustbuild: Add more deps on android-copy-libs

The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!
2016-12-31 04:44:52 +00:00
Alex Crichton
cf8fde1441 rustbuild: Add more deps on android-copy-libs
The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!
2016-12-30 18:55:31 -08:00
Simonas Kazlauskas
ee69cd7925 Calculate discriminant bounds within 64 bits
Since discriminants do not support i128 yet, lets just calculate the boundaries within the 64 bits
that are supported. This also avoids an issue with bootstrapping on 32 bit systems due to #38727.
2016-12-31 04:55:29 +02:00
Jorge Aparicio
728ec85e9a sparc64-linux support 2016-12-30 20:46:19 -05:00
bors
b68d3293e3 Auto merge of #38601 - schulzch:master, r=brson
Partial fix for #38489.

Fixes script name resolution for windows by invoking `emcc.bat` instead of `emcc`, etc.

Remaining issue:
```
Traceback (most recent call last):
  File "C:\Program Files\Emscripten\emscripten\1.35.0\\emcc", line 1309, in <module>
    final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
  File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1471, in llvm_opt
    assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
```
2016-12-31 00:50:46 +00:00