Commit Graph

52885 Commits

Author SHA1 Message Date
Eduard Burtescu
bbc41aa9a6 mir: remove the unused attribute logic in the MIR map construction. 2016-05-07 06:43:57 +03:00
bors
c95cda56a6 Auto merge of #33267 - nagisa:mir-temporary-32959, r=nikomatsakis
[MIR] Temporary hack for 32959

Gets rid of the warning. This is more elegant that I thought it would be, actually.

r? @nikomatsakis

cc #32959
2016-05-06 18:15:39 -07:00
bors
62e2b2fb7a Auto merge of #33228 - nikomatsakis:compiletest-gut, r=acrichto
Move auxiliary directories to live with the tests

This is a step for enabling testing of cross-crate incremental compilation. The idea is that instead of having a central auxiliary directory, when you have a `// aux-build:foo.rs` annotation in the test `run-pass/bar.rs`, it will look in (e.g.) `run-pass/aux/foo.rs`. In general, it looks for an `aux` directory in the same directory as the test. We also ignore the `aux` directories when enumerating the set of tests.

As part of this PR, also refactor `runtest.rs` to use methods on a context, which means we can stop passing around context everywhere.

r? @alexcrichton
2016-05-06 16:04:55 -07:00
Niko Matsakis
707012494d remove stray files in auxiliary directory 2016-05-06 16:24:48 -04:00
Niko Matsakis
8b1941a783 s/aux/auxiliary, because windows
For legacy reasons (presumably), Windows does not permit files name aux.
2016-05-06 16:24:48 -04:00
Niko Matsakis
cefc5b6468 add missing aux files 2016-05-06 16:24:48 -04:00
Niko Matsakis
47c8179bc2 remove unused aux-base argument 2016-05-06 16:24:48 -04:00
Niko Matsakis
ce0f73bbc4 kill the old auxiliary directory 2016-05-06 16:24:48 -04:00
Niko Matsakis
fbc082dcc6 move auxiliary builds to a test-relative aux
Instead of finding aux-build files in `auxiliary`, we now search for an
`aux` directory relative to the test. So if your test is
`compile-fail/foo.rs`, we would look in `compile-fail/aux`.  Similarly,
we ignore the `aux` directory when searching for tets.
2016-05-06 16:24:48 -04:00
Niko Matsakis
77ae7591a8 tweak incremental comment 2016-05-06 16:24:47 -04:00
Niko Matsakis
6b10756a59 move free functions in runtest into methods
Also, promote the for loop iterating over revisions out into the
top-level method, whereas before it was pushed down instead each test's
method. Not entirely clear that this was the right call.
2016-05-06 16:24:47 -04:00
Niko Matsakis
ef884bcb93 use methods for EarlyProps and TestProps 2016-05-06 15:27:29 -04:00
Niko Matsakis
514b37e3d6 refactor interface of make_compile_args 2016-05-06 15:27:29 -04:00
bors
0cb9bc5175 Auto merge of #33472 - alexcrichton:fix-nightlies-again, r=brson
mk: Try to fix nightlies again

Looks like the real bug on nightlies is that the `llvm-pass` run-make test is
not actually getting the value of `LLVM_CXXFLAGS` correct. Namely, it's blank!
Now the only change #33093 which actually affected this is that the argument
`$(LLVM_CXXFLAGS_$(2))` was moved up from a makefile rule into the definition of
a variable. Sounds innocuous?

Turns out the variable this was moved into is defined with `:=`, which means
that it's not recursively expanded, which basically means that it's expanded
immediately. Unfortunately part of this expansion involves running
`llvm-config`, which doesn't exist at the start of distcheck build!

This didn't show up on the bots because they run `make` *then* `make check`, and
the first step builds llvm-config so the next time `make` is loaded everything
is available. The distcheck bots, however, run just a plain `distcheck` so
`make` doesn't exist ahead of time. You can see this in action where the
distcheck bots start out with a bunch of "llvm-config not found" error messages.

This commit just changes a few variables to be defined with `=` which
essentially means they're lazily expanded. I did not run a full distcheck
locally, but this makes the initial "llvm-config not found" error messages go
away so I suspect that this is the fix.

Closes #33379 (hopefully)
2016-05-06 11:57:16 -07:00
Alex Crichton
eeb2f6dde4 mk: Try to fix nightlies again
Looks like the real bug on nightlies is that the `llvm-pass` run-make test is
not actually getting the value of `LLVM_CXXFLAGS` correct. Namely, it's blank!
Now the only change #33093 which actually affected this is that the argument
`$(LLVM_CXXFLAGS_$(2))` was moved up from a makefile rule into the definition of
a variable. Sounds innocuous?

Turns out the variable this was moved into is defined with `:=`, which means
that it's not recursively expanded, which basically means that it's expanded
immediately. Unfortunately part of this expansion involves running
`llvm-config`, which doesn't exist at the start of distcheck build!

This didn't show up on the bots because they run `make` *then* `make check`, and
the first step builds llvm-config so the next time `make` is loaded everything
is available. The distcheck bots, however, run just a plain `distcheck` so
`make` doesn't exist ahead of time. You can see this in action where the
distcheck bots start out with a bunch of "llvm-config not found" error messages.

This commit just changes a few variables to be defined with `=` which
essentially means they're lazily expanded. I did not run a full distcheck
locally, but this makes the initial "llvm-config not found" error messages go
away so I suspect that this is the fix.

Closes #33379
2016-05-06 11:21:42 -07:00
bors
102bab3d68 Auto merge of #33225 - michaelwoerister:fix-debuginfo-struct-ns, r=eddyb
debuginfo: Fix regression in namespace handling for struct types.

Fixes a small regression that has been introduced in recent refactorings.

Fixes #33193

r? @eddyb
2016-05-06 08:31:58 -07:00
bors
5158f3b282 Auto merge of #33138 - arielb1:sized-shortcut, r=nikomatsakis
Short-cut `T: Sized` trait selection for ADTs

Basically avoids all nested obligations when checking whether an ADT is sized - this speeds up typeck by ~15%

The refactoring fixed #32963, but I also want to make `Copy` not object-safe (will commit that soon).

Fixes #33201

r? @nikomatsakis
2016-05-06 06:21:25 -07:00
bors
a36c41912b Auto merge of #33086 - cardoe:non-blocking-rand-read, r=alexcrichton
rand: don't block before random pool is initialized

If we attempt a read with getrandom() on Linux the syscall can block
before the random pool is initialized unless the GRND_NONBLOCK flag is
passed. This flag causes getrandom() to instead return EAGAIN while the
pool is uninitialized. To avoid downstream users of crate or std
functionality that have no ability to avoid this blocking behavior this
change causes Rust to read bytes from /dev/urandom while getrandom()
would block and once getrandom() is available to use that. Fixes #32953.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-05-06 03:07:00 -07:00
bors
6301e22e15 Auto merge of #33072 - tbu-:pr_duration_new_overflow, r=alexcrichton
Panic on overflow in `Duration::new` constructor

Panicking on overflow is also done for `+`, and it replaces the
currently incorrect overflow behavior of wrapping around, which does not
make sense for `Duration`s.
2016-05-06 00:58:59 -07:00
bors
68d399d7e3 Auto merge of #32835 - brson:alldebug, r=michaelwoerister
Distribute both rust-lldb and rust-gdb everywhere

Both debuggers are viable in some capacity on all tier-1 platforms,
and people often ask for rust-lldb on Linux or rust-gdb on OS X.

r? @michaelwoerister

I'm still testing locally, but this *looks* like the right thing to change.
2016-05-05 21:55:02 -07:00
Brian Anderson
5ad99e2296 Distribute both rust-lldb and rust-gdb everywhere except win-msvc
Both debuggers are viable in some capacity on all tier-1 platforms,
and people often ask for rust-lldb on Linux or rust-gdb on OS X.
2016-05-06 03:09:48 +00:00
bors
b071c1feea Auto merge of #32565 - tbu-:pr_cell_as_mut, r=alexcrichton
Add `as_mut` methods to the `std::cell` structs

This is safe since the borrow checking ensures that we have the only
mutable reference to the struct, thus we can safely borrow its interior.
2016-05-05 17:55:28 -07:00
Tobias Bucher
9370d3a051 Add get_mut methods to the RefCell and Cell
This is safe since the borrow checker ensures that we have the only
mutable reference to the struct, thus we can safely borrow its interior.

Tracking issue is #33444.
2016-05-06 00:40:51 +02:00
bors
77987ba898 Auto merge of #32990 - tbu-:pr_more_defaults_cstr_path, r=alexcrichton
Add `Default` implementation for `&CStr`, `CString`, `Path`
2016-05-05 13:18:57 -07:00
bors
413bafdabf Auto merge of #33128 - xen0n:more-confusing-unicode-chars, r=nagisa
Add more aliases for Unicode confusable chars

Building upon #29837, this PR:

* added aliases for space characters,
* distinguished square brackets from parens, and
* added common CJK punctuation characters as aliases.

This will especially help CJK users who may have forgotten to switch off IME when coding.
2016-05-05 08:50:23 -07:00
Tobias Bucher
5efe083ddc Add Default implementation for &CStr and CString 2016-05-05 10:57:06 +02:00
bors
3f65afa694 Auto merge of #33067 - notriddle:wrapping_neg, r=alexcrichton
Implement negation for wrapping numerals.

Fixes #33037
2016-05-05 00:37:56 -07:00
bors
8655587c1e Auto merge of #33381 - alexcrichton:fix-nightlies, r=nikomatsakis
mk: Pass CFLAGS for target, not host

This changes the CFLAGS and related variables passed to compiletest to be passed
for the target, not the host, so we can correctly test 32-bit cross compiles on
64-bit host machines.

Hopefuly fixes #33379
2016-05-04 17:38:39 -07:00
Ariel Ben-Yehuda
238e4ee104 fixes 2016-05-05 01:59:22 +03:00
bors
7a0ccc458f Auto merge of #33376 - Manishearth:rollup, r=Manishearth
Rollup of 14 pull requests

- Successful merges: #33277, #33294, #33314, #33322, #33333, #33338, #33339, #33340, #33343, #33357, #33363, #33365, #33371, #33372
- Failed merges:
2016-05-04 14:26:28 -07:00
Alex Crichton
74d1520c22 mk: Pass CFLAGS for target, not host
This changes the CFLAGS and related variables passed to compiletest to be passed
for the target, not the host, so we can correctly test 32-bit cross compiles on
64-bit host machines.

Hopefuly fixes #33379
2016-05-03 13:49:35 -07:00
Michael Woerister
bb0e5254ae Make runtest::check_debugger_output() handle wildcards at end. 2016-05-03 15:00:24 -04:00
Ariel Ben-Yehuda
6c883840e6 stop dropping impls from cause backtraces 2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
62db786fc8 stop using commit_if_ok where no errors can happen 2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
6057a7f188 change the newly-added errors to warnings
this commit should be reverted after a release cycle
2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
5876b4b12a improve error message for WF Tuples 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
05f1a057b6 address review comments 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
6fc19ada6b fix breaking changes 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
2f8f256cef require the existential bounds of an object type to be object-safe
This is required, as Copy and Sized are object-unsafe.

As a soundness fix, this is a [breaking-change]

Fixes #32963
2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
0a6dfc5177 require the non-last elements of a tuple to be Sized
This requirement appears to be missing from RFC1214, but is clearly
necessary for translation. The last field of a tuple/enum remains in
a state of limbo, compiling but causing an ICE when it is used - we
should eventually fix that somehow.

this is a [breaking-change] - a soundness fix - and requires a
crater run.
2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
babb5df529 refactor the handling of builtin candidates 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
4bcabbd45a add comments and tests 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
73f39a026a Short-cut Sized matching on ADTs
Put a constraint type on every ADT def, such that the ADT def is sized iff the constraint
type is, and use that in selection. This ignores types that are obviously sized.

This improves typeck performance by ~15%.
2016-05-03 18:30:10 +03:00
Manish Goregaokar
631e7b4eaa
Rollup merge of #33372 - birkenfeld:rustdoc-escape-code, r=cmr
rustdoc: HTML-escape Rust code (from constants)

Especially in cases like the one in the test file, this can blow up the rendering big time if string constants in the code contain HTML.

But also other constants can contain special chars (e.g. `&` as an operator in constant expressions).
2016-05-03 19:54:59 +05:30
Manish Goregaokar
1ab019584e
Rollup merge of #33371 - birkenfeld:issue-33302, r=cmr
rustdoc: fix inserting source code spans for constant values

This will go wrong when the constants partially result from macro expansion.
Instead, use the expressions and pretty-print them as Rust code.

Fixes: #33302
2016-05-03 19:54:58 +05:30
Manish Goregaokar
676fd362ff
Rollup merge of #33357 - pcwalton:inline-mem-forget, r=brson
libcore: Inline `mem::forget()`.

Was causing severe performance problems in WebRender.

r? @brson
2016-05-03 19:54:56 +05:30
Manish Goregaokar
51a3a8f523
Rollup merge of #33343 - birkenfeld:issue-32214, r=Manishearth
parser: change warning into an error on `T<A=B, C>`

part of #32214

This seems to be the obvious fix, and the error message is consistent with all the other parser errors ("expected x, found y").
2016-05-03 19:54:55 +05:30
Manish Goregaokar
52c97f237b
Rollup merge of #33340 - birkenfeld:issue-23716, r=Manishearth
resolve: print location of static for "static in pattern" error

The implementation mirrors the one for "constant defined here" annotation used for constant patterns in the irrefutable-pattern case.

Fixes: #23716
2016-05-03 19:54:54 +05:30
Manish Goregaokar
041a269bc7
Rollup merge of #33339 - oli-obk:fix/const_eval, r=japaric
fix various const eval errors

These were found after const_evaluating arbitrary expressions and linting if the const evaluator failed

fixes #33275 (int -> float casts for negative ints)
fixes #33291 (int -> char casts (new! wasn't allowed in constants until this PR))

r? @eddyb

cc @bluss @japaric
2016-05-03 19:54:52 +05:30
Manish Goregaokar
2e4474f890
Rollup merge of #33322 - justsostephen:master, r=steveklabnik
doc/book/getting-started.md: Spelling correction and revised wording.

The word 'Internet' was spelt with both an uppercase and a lowercase 'I'. The correct spelling seems to be a matter of some debate these days, however the first occurrence in the file has an uppercase 'I', so I've changed the second occurrence to suit for consistency.

Under the section titled 'Converting to Cargo', there's mention of creating a new executable. This, however, is not part of the process described. I've revised the wording to reflect as much.

Small changes, but I hope they are of benefit! :-)

r? @steveklabnik
2016-05-03 19:54:51 +05:30