Commit Graph

60345 Commits

Author SHA1 Message Date
Jeremy Soller
537b3aa3fd Remove -lc, -lm from the target spec - the cross compiler will link those 2017-01-03 15:42:41 -07:00
Alex Crichton
3ab778b4af rustbuild: Update where we look for mtime changes
Recent versions of Cargo lift less output up into the "main" directory, so let's
look more inside the `deps` folder for changes to propagate differences.

Closes #38744
Closes #38746
2017-01-03 14:17:02 -08:00
Alex Crichton
753dff63c6 rustbuild: Allow create_sysroot in stage0
Despite what the comment says, we actually need to do this. We're not cleaning
out the stage0 compiler's sysroot, but rather just our own sysroot that we
assembled previously.
2017-01-03 14:07:30 -08:00
Ariel Ben-Yehuda
4cab2931c8 simplify Copy implementation error reporting
Span the affected fields instead of reporting the field/variant name.
2017-01-04 00:03:34 +02:00
Mina Naguib
ae23f036f0 Doc fix 2017-01-03 14:52:14 -05:00
Ariel Ben-Yehuda
e41920a1c3 rustfmt coherence::builtin 2017-01-03 21:51:28 +02:00
Ariel Ben-Yehuda
243e45aac3 normalize field types in copy implementations
Fixes #34377.
2017-01-03 21:50:18 +02:00
Ariel Ben-Yehuda
d938ba4769 coherence: check builtin impls after the specialization graph is ready
Fixes #33187.
2017-01-03 21:50:18 +02:00
Ariel Ben-Yehuda
7309babf17 coherence: code cleanup 2017-01-03 21:50:18 +02:00
Ariel Ben-Yehuda
f8a2f9838d coherence: move the builtin trait checks to their own module
no functional changes
2017-01-03 21:50:18 +02:00
Eduard-Mihai Burtescu
fbdadcbed4 Properly ban the negation of unsigned integers in type-checking. 2017-01-03 21:48:17 +02:00
Jeremy Fitzhardinge
a8fa2cff28 rustc: use -Xlinker when specifying an rpath with ',' in it
The `-Wl` option splits its parameters on commas, so if rustc specifies
`-Wl,-rpath,<path>` when `<path>` contains commas, the path gets split up
and the linker gets a partial path and spurious extra parameters.

Gcc/clang support the more verbose `-Xlinker` option to pass options
to the linker directly, so use it for comma-containing paths.

Fixes rust issue #38795.
2017-01-03 11:40:48 -08:00
comex
7883543100 Print attributes on expressions when pretty printing. 2017-01-03 20:24:53 +01:00
Felix S. Klock II
ab8e92514c Regression test and exploratory unit test. 2017-01-03 09:58:05 -05:00
Felix S. Klock II
ae13a72ded Dont check stability for items that are not pub to universe.
Includes special case handling for trait methods.

Fix #38412.
2017-01-03 09:57:49 -05:00
abhijeetbhagat
d910837e78 Fix process module tests to run on Windows 2017-01-03 17:50:30 +05:30
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
Andrew Cann
c0cd145c1f Fix make tidy 2017-01-03 15:54:23 +08:00
Andrew Cann
f947890226 Change file structure, add comments for inhabitedness.rs 2017-01-03 15:54:23 +08:00
Andrew Cann
e9ffc409bc Spelling. s/forrest/forest 2017-01-03 15:54:23 +08:00
Niko Matsakis
699b25ff3a fix comment that got split in two 2017-01-03 15:54:23 +08:00
Andrew Cann
9f83e962de Fix build after rebase.
Mostly just rename stuff.
Visibility checks use DefIds rather than NodeIds now.
2017-01-03 15:54:23 +08:00
Andrew Cann
4136ba072e Remove E0001 diagnostic 2017-01-03 15:48:29 +08:00
Andrew Cann
a1570828b2 Amend compile-fail tests 2017-01-03 15:48:29 +08:00
Andrew Cann
5ba61edbd0 Disable unreachable patterns error entirely 2017-01-03 15:48:29 +08:00
Andrew Cann
44a70f0221 Fix inhabitedness bug 2017-01-03 15:48:29 +08:00
Andrew Cann
7946597f75 Refactor is_uninhabited
We now cache the inhabitedness of types in the GlobalCtxt.

Rather than calculating whether a type is visibly uninhabited from a given
NodeId we calculate the full set of NodeIds from which a type is visibly
uninhabited then cache that set. We can then use that to answer queries about
the inhabitedness of a type relative to any given node.
2017-01-03 15:48:29 +08:00
Andrew Cann
9482492ab6 Add drain method to AccumulateVec/ArrayVec
You can now call .drain(..) on SmallVec, AccumulateVec and ArrayVec
2017-01-03 15:48:29 +08:00
Andrew Cann
f8c4d10e95 Fix test I broke 2017-01-03 15:48:29 +08:00
Andrew Cann
56f355c83a Fix build after rebase 2017-01-03 15:48:29 +08:00
Andrew Cann
d2827aa9bc Fix build after rebase 2017-01-03 15:48:29 +08: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
Andrew Cann
cfc45d52bb Style fix 2017-01-03 15:33:31 +08:00
Andrew Cann
9ba9cd5fd5 Improve error message, fix and add tests.
Changes the non-exhaustive match error message to generate more general
witnesses.
2017-01-03 15:33:31 +08:00
Andrew Cann
9c5e86d0cd More pattern matching for empty types changes
Fix is_uninhabited for enum types. It used to assume that an enums variant's
fields were all private.

Fix MIR generation for irrefutable Variant pattern matches. This allows code
like this to work:

    let x: Result<32, !> = Ok(123);
    let Ok(y) = x;

Carry type information on dummy wildcard patterns. Sometimes we need to expand
these patterns into their constructors and we don't want to be expanding a
TyError into a Constructor::Single.
2017-01-03 15:33:31 +08:00
Andrew Cann
bcdbe942e1 Make is_useful handle empty types properly 2017-01-03 15:31:46 +08:00
Andrew Cann
9ad20442e8 Start enabling empty types in pattern matching.
Remove the assumption at the start of is_useful that any suitably-long array of
wildcard patterns is useful relative the any empty vector. Instead we just
continue to recurse column-wise over the matrix.

This assumption is false in the presence of empty types.
eg. in the simplest case:

let x: ! = ...;
match x {
    // This pattern should not be considered useful by the algorithm
    _   => ...
}
2017-01-03 15:30:19 +08:00
Simon Sapin
3b208d2dac Reduce the size of static data in std_unicode::tables.
`BoolTrie` works well for sets of code points spread out through
most of Unicode’s range, but is uses a lot of space for sets
with few, mostly low, code points.

This switches a few of its instances to a similar but simpler trie
data structure.

 ## Before

`size_of::<BoolTrie>()` is 1552, which is added to
`table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`:

* `Cc_table`: 1632
* `White_Space_table`: 1656
* `Pattern_White_Space_table`: 1640
* Total: 4928 bytes

 ## After

`size_of::<SmallBoolTrie>()` is 32, which is added to
`t.r1.len() + t.r2.len() * 8`:

* `Cc_table`: 51
* `White_Space_table`: 273
* `Pattern_White_Space_table`: 193
* Total: 517 bytes

 ## Difference

Every Rust program with `std` statically linked should be about 4 KB smaller.
2017-01-03 08:28:58 +01: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
Jeffrey Seyfried
fd532a1608 Add regression test. 2017-01-03 02:11:32 +00:00
Jeffrey Seyfried
a2fc566d41 Fold all spans in the AST. 2017-01-03 02:00:40 +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
Alex Crichton
045f8f6929 rustc: Stabilize the proc_macro feature
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the
compiler to stabilize the "Macros 1.1" feature of the language. Many more
details can be found on the tracking issue, #35900.

Closes #35900
2017-01-02 12:13:30 -08: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
Simon Sapin
90c7c05ecb Remove some dead Python code.
It was used to measure before/after size in cfaf66c94e.
2017-01-02 12:55:41 +01:00
Seo Sanghyeon
631955888e Avoid rustdoc ICE when an unstable feature is used 2017-01-02 20:32:58 +09:00
Steven Fackler
f2cb47adf9 Add PeekMut::pop
A fairly common workflow is to put a bunch of stuff into a binary heap
and then mutate the top value until its empty. This both makes that a
bit more convenient (no need to save a boolean off and pop after to
avoid borrowck issues), and a bit more efficient since you only shift
once.
2017-01-01 19:18:07 -08:00