Commit Graph

60261 Commits

Author SHA1 Message Date
Mark Simulacrum
426c558c5a Move trans_field_ptr and struct_field_ptr to mir/lvalue 2017-01-04 11:38:09 -07:00
Mark Simulacrum
982b8f4f49 Move trans_const to mir::constant 2017-01-04 11:37:44 -07:00
Mark Simulacrum
ea0ebe41c7 Change trans_field_ptr to utilize LvalueTy to determine discriminant. 2017-01-04 11:37:42 -07:00
Mark Simulacrum
8038489357 Use LvalueRef instead of MaybeSizedValue 2017-01-04 11:35:33 -07:00
Mark Simulacrum
4c9995a3f9 Simpliy block creation in MirContext 2017-01-04 11:34:27 -07:00
Mark Simulacrum
37dd9f6c7b Add Builder::sess and Builder::tcx methods 2017-01-04 11:34:26 -07:00
Mark Simulacrum
f67e7d6b4a Add method, new_block, to MirContext for block construction.
This makes a slow transition to block construction happening only from
MirContext easier.
2017-01-04 11:34:00 -07:00
Mark Simulacrum
937e8da349 Purge FunctionContext 2017-01-04 11:33:59 -07:00
Mark Simulacrum
1be170b01a Replace BlockAndBuilder with Builder. 2017-01-04 11:33:31 -07:00
est31
28f6d4a637 Add test for i128 ffi usage 2017-01-04 19:05:27 +01:00
est31
1fefa3cc91 enhance u128 overflow tests 2017-01-04 19:00:38 +01:00
bors
05f4a75eba Auto merge of #38414 - estebank:doc-dissambiguate, r=steveklabnik
Rustdoc: disambiguate Implementors when the type name is not unique

Presentation [goes from](https://doc.rust-lang.org/stable/std/iter/trait.ExactSizeIterator.html#implementors):

<img width="492" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276752/b2b50474-c387-11e6-96e1-9766851da269.png">

to:

<img width="787" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276763/bb37f6b0-c387-11e6-8596-9163cb254674.png">

on cases where there're multiple implementors with the same name.

Fixes #37762.
2017-01-04 17:11:02 +00:00
Michael Woerister
ab8fff20d2 trans: Collect drop-glue translation item for closure env in fn-once-adapters. 2017-01-04 10:01:27 -05:00
bors
d40d01bd0e Auto merge of #38670 - dotdash:transmute_align, r=eddyb
Fix transmute::<T, U> where T requires a bigger alignment than U

For transmute::<T, U> we simply pointercast the destination from a U
pointer to a T pointer, without providing any alignment information,
thus LLVM assumes that the destination is aligned to hold a value of
type T, which is not necessarily true. This can lead to LLVM emitting
machine instructions that assume said alignment, and thus cause aborts.

To fix this, we need to provide the actual alignment to store_operand()
and in turn to store() so they can set the proper alignment information
on the stores and LLVM can emit the proper machine instructions.

Fixes #32947
2017-01-04 14:26:17 +00:00
Ariel Ben-Yehuda
5fad51e7f4 typeck::coherence::builtin - sort impls in the DefId order
this makes error messages consistent across architectures
2017-01-04 11:54:57 +02:00
bors
9c0e373f91 Auto merge of #38773 - sanxiyn:rustdoc-ice, r=steveklabnik
Avoid rustdoc ICE when an unstable feature is used

Fix #36159.
2017-01-04 09:24:24 +00:00
Jeffrey Seyfried
927408d9c5 Fix regression with duplicate #[macro_export] macro_rules!. 2017-01-04 08:03:23 +00:00
bors
e06ce71d0b Auto merge of #38552 - eddyb:bad-blocks, r=arielb1
Don't leak the compiler's internal representation of scopes in error messages.

Fixes #37884 (actually fixes #27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.
2017-01-04 06:29:14 +00:00
Jeffrey Seyfried
7dcacf15b9 Don't unused_qualifications-check global paths. 2017-01-04 06:19:58 +00:00
Doug Goldstein
031dd81cc8
fix help for the --print option
Since 8285ab5c99, which was merged in with #38061, the help for the
--print option is missing the surrounding [ ] around the possible
options.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2017-01-03 23:44:10 -06:00
bors
01677eeef2 Auto merge of #38707 - redox-os:master, r=brson
Add socket timeout and ttl support in `sys::redox`

This adds support for `read_timeout`, `write_timeout`, and `ttl` on `TcpStream`, `TcpListener`, and `UdpSocket` in the `sys::redox` module.

The DNS lookup has been set to use a 5 second timeout by default.
2017-01-04 04:28:15 +00:00
Eduard-Mihai Burtescu
987f52f4f5 Update for changes to TraitItem on master. 2017-01-04 05:48:18 +02:00
Eduard-Mihai Burtescu
bb04da4822 Don't leak the compiler's internal representation of scopes in error messages. 2017-01-04 05:48:18 +02:00
Andrew Cann
70b7bd94cc Fix build after rebase 2017-01-04 11:07:32 +08:00
bors
a68622c899 Auto merge of #38809 - alexcrichton:rustbuild-fresh, r=brson
rustbuild: Fix a few rebuilding issues

Did a bit of investigation and found a few small unrelated issues, but this should help clean up a lot of errors we've been seeing locally.
2017-01-04 01:51:06 +00:00
bors
468227129d Auto merge of #38066 - bluss:string-slice-error, r=sfackler
Use more specific panic message for &str slicing errors

Separate out of bounds errors from character boundary errors, and print
more details for character boundary errors.

It reports the first error it finds in:

1. begin out of bounds
2. end out of bounds
3. begin <= end violated
3. begin not char boundary
5. end not char boundary.

Example:

    &"abcαβγ"[..4]

    thread 'str::test_slice_fail_boundary_1' panicked at 'byte index 4 is not
    a char boundary; it is inside 'α' (bytes 3..5) of `abcαβγ`'

Fixes #38052
2017-01-03 23:51:42 +00:00
Jeremy Soller
c6858a1429 Revert cargo.lock 2017-01-03 15:47:14 -07:00
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
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
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