Commit Graph

813 Commits

Author SHA1 Message Date
bjorn3
4ef16d7466 Fix hotplug backend and add test 2018-01-19 20:27:36 +01:00
bjorn3
74c92c5562 Allow runtime switching between trans backends 2018-01-19 20:27:10 +01:00
Carol (Nichols || Goulding)
e168aa385b
Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
bors
5d6f6e65ff Auto merge of #47274 - Manishearth:rustdoc-span, r=QuietMisdreavus
Use correct line offsets for doctests

Not yet tested.

This doesn't handle char positions. It could if I collected a map of char offsets and lines, but this is a bit more work and requires hooking into the parser much more (unsure if it's possible).

r? @QuietMisdreavus

(fixes #45868)
2018-01-14 11:28:27 +00:00
leonardo.yvens
02b5fee732 Adjust tests for removal of impl Foo for .. {} 2018-01-13 18:48:00 +03:00
Manish Goregaokar
44b659ac2d Add test for #45868 2018-01-10 10:34:14 +05:30
Ryan Cumming
b69c32097a Fix typo 2018-01-10 09:15:51 +11:00
Ryan Cumming
4cc0fe5136 Restore the original Window comment
The Windows situation is more complicated than I realised
2018-01-10 09:10:59 +11:00
Ryan Cumming
a713c67a68 Skip linker-output-non-utf8 test on Apple
This test fails on APFS filesystems with the following error:

mkdir: /Users/ryan/Code/rust/build/x86_64-apple-darwin/test/run-make/linker-output-non-utf8.stage2-x86_64-apple-darwin/zzz�: Illegal byte sequence

This is due to APFS now requiring that all paths are valid UTF-8. As
APFS will be the default filesystem for all new Darwin-based systems the
most straightforward fix is to skip this test on Darwin as well as
Windows.
2018-01-09 20:01:35 +11:00
kennytm
470a8e1a97
Remove excessive trailing newlines. 2017-12-30 15:50:52 +08:00
Bastian Köcher
f972f529b2 Revert "Just compare the symbol names and types, not the addresses"
This reverts commit 7d4d98e5c870a2dcdca8ea3aa47ecee680a35e60.
2017-12-26 12:26:39 +01:00
Bastian Köcher
7efeeba13a Use start for the sepcomp-inlining test 2017-12-26 12:26:39 +01:00
Bastian Köcher
347165fd5c The test functions are now in the same compile unit 2017-12-26 12:26:39 +01:00
Bastian Köcher
83cb299e3e Just compare the symbol names and types, not the addresses 2017-12-26 12:26:39 +01:00
kennytm
696e951fe9 Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
tweaks and fixes for doc(include)

This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732):

* Turns errors when loading files into full errors. This matches the original RFC text.
* Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes.
* Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends.
* Adds or modifies tests to check for all of these.
2017-12-22 02:50:53 +08:00
QuietMisdreavus
95b87d18c0 add files loaded through doc(include) into dep-info 2017-12-19 16:43:32 -06:00
varkor
3a29f2878f Fix a compile_input test 2017-12-19 15:03:37 +00:00
varkor
c76cdce3d9 Prevent rustc overwriting input files
If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019.
2017-12-18 15:35:45 +00:00
Oliver Schneider
d732da813b
Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
Irina-Gabriela Popa
dda924ab6a rustc_back: move dynamic_lib to rustc_metadata. 2017-12-04 18:25:29 +02:00
kennytm
918158debb
Disable the cdylib-fewer-symbols test for all Windows (test was broken). 2017-11-28 23:38:04 +08:00
kennytm
ab788a2ee1
Replace most call to grep in run-make by a script that cat the input.
Introduced a new src/etc/cat-and-grep.sh script (called in run-make as
$(CGREP)), which prints the input and do a grep simultaneously. This is
mainly used to debug spurious failures in run-make, such as the sanitizer
error in #45810, as well as real errors such as #46126.
2017-11-28 23:36:12 +08:00
bors
73df30d467 Auto merge of #46273 - semarie:openbsd-libc++, r=alexcrichton
make OpenBSD to use libc++ instead of (e)stdc++
2017-11-27 01:43:41 +00:00
Sébastien Marie
3ef39d3cb6 make OpenBSD to use libc++ instead of (e)stdc++ 2017-11-26 10:08:25 +01:00
Eduard-Mihai Burtescu
5eed95ede9 rustc_trans: don't apply noalias on returned references. 2017-11-25 14:30:45 +02:00
Alex Crichton
47498dea09 rustbuild: Update LLVM and enable ThinLTO
This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(#45661) on test failures related to debuginfo with a presumed cause of #45511.

Closes #45511
2017-11-24 06:55:38 -08:00
bors
eb44c89641 Auto merge of #45946 - estebank:crate-conflict-diag, r=arielb1
Use multiline text for crate conflict diagnostics

After:
```
error[E0464]: multiple matching crates for `libc`
 --> /checkout/src/rustc/dlmalloc_shim/../../dlmalloc/src/linux.rs:1:1
  |
1 | extern crate libc;
  | ^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
          crate `libc`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-658d35794c10b003.rlib
          crate `libc`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f32a17a3111b01aa.rlib
```
Before:
```
error[E0464]: multiple matching crates for `libc`
 --> /checkout/src/rustc/dlmalloc_shim/../../dlmalloc/src/linux.rs:1:1
  |
1 | extern crate libc;
  | ^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
  = note: path: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-658d35794c10b003.rlib
  = note: crate name: libc
  = note: path: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f32a17a3111b01aa.rlib
  = note: crate name: libc
```
2017-11-24 04:03:36 +00:00
Esteban Küber
5eb5e91d7b Use multiline text for crate conflict diagnostics 2017-11-22 18:45:32 -08:00
bors
6af4515de6 Auto merge of #45721 - nikomatsakis:hir-tree, r=arielb1
add -Zunpretty=hir-tree

This uses the debug impls to dump the raw HIR. Particularly useful when
learning how the compiler works.

cc @qmx
2017-11-23 00:52:15 +00:00
Niko Matsakis
61f31fd559 add a simple test that running with hir-tree doesn't go bonkers
Akin to the existing expanded test.
2017-11-20 05:58:11 -05:00
Eduard-Mihai Burtescu
f9f5ab98b0 Revert "tests: Update run-make/issue-25581 to reflect how fat pointers are passed."
This reverts commit b12dcdef4f.
2017-11-19 23:38:48 +02:00
bors
1410d56040 Auto merge of #45920 - sunfishcode:trap-on-unreachable, r=Zoxc
Enable TrapUnreachable in LLVM.

This patch enables LLVM's TrapUnreachable flag, which tells it to translate `unreachable` instructions into hardware trap instructions, rather than allowing control flow to "fall through" into whatever code happens to follow it in memory.

This follows up on https://github.com/rust-lang/rust/issues/28728#issuecomment-332581533. For example, for @zackw's testcase [here](https://github.com/rust-lang/rust/issues/42009#issue-228745924), the output function contains a `ud2` instead of no code, so it won't "fall through" into whatever happens to be next in memory.

(I'm also working on the problem of LLVM optimizing away infinite loops, but the patch here is useful independently.)

I tested this patch on a few different codebases, and the code size increase ranged from 0.0% to 0.1%.
2017-11-16 06:10:36 +00:00
bors
aca22a8f81 Auto merge of #45824 - dotdash:stack_pop, r=alexcrichton
Update LLVM to fix miscompiles with -Copt-level=z on Windows

Fixes #45034
2017-11-13 14:20:15 +00:00
bors
b7ccb0a5a7 Auto merge of #45810 - SimonSapin:ac-dc, r=aturon
Disable LLVM assertions on Nightly, enable them in "alt" builds.

Per IRC discussion https://mozilla.logbot.info/rust-infra/20171106#c13812170-c13812204

Background: https://internals.rust-lang.org/t/disabling-llvm-assertions-in-nightly-builds/5388/14
2017-11-13 11:46:55 +00:00
Björn Steinbrink
1a8c9f895d Update LLVM to fix miscompiles with -Copt-level=z on Windows
Fixes #45034
2017-11-12 15:12:02 +01:00
Simon Sapin
7625c79f2a Do not silence output in run-make/sanitizer-memory 2017-11-12 14:56:45 +01:00
Dan Gohman
365c159b80 Add comments to the intrinsic-unreachable test programs.
The return value in these tests is just being used to generate extra
code so that it can be detected in the test script, which is just
counting lines in the assembly output.
2017-11-11 06:41:45 -08:00
Dan Gohman
626d93b86d Update the "[run-make] run-make/intrinsic-unreachable" test.
With rustc now emitting "ud2" on unreachable code, a "return nothing"
sequence may take the same number of lines as an "unreachable" sequence
in assembly code. This test is testing that intrinsics::unreachable()
works by testing that it reduces the number of lines in the assembly
code. Fix it by adding a return value, which requires an extra
instruction in the reachable case, which provides the test what it's
looking for.
2017-11-10 15:32:06 -08:00
Michael Woerister
48a8d23b97 Update run-make tests. 2017-11-07 08:54:38 +01:00
bors
16e9b9f15c Auto merge of #45748 - petrochenkov:short, r=alexcrichton
Shorten paths to auxiliary files created by tests

I'm hitting issues with long file paths to object files created by the test suite, similar to https://github.com/rust-lang/rust/issues/45103#issuecomment-335622075.

If we look at the object file path in https://github.com/rust-lang/rust/issues/45103 we can see that the patch contains of few components:
```
specialization-cross-crate-defaults.stage2-x86_64-pc-windows-gnu.run-pass.libaux\specialization_cross_crate_defaults.specialization_cross_crate_defaults0.rust-cgu.o
```
=>

1. specialization-cross-crate-defaults // test name, required
2. stage2 // stage disambiguator, required
3. x86_64-pc-windows-gnu // target disambiguator, required
4. run-pass // mode disambiguator, rarely required
5. libaux // suffix, can be shortened
6. specialization_cross_crate_defaults // required, there may be several libraries in the directory
7. specialization_cross_crate_defaults0 // codegen unit name, can be shortened?
8. rust-cgu // suffix, can be shortened?
9. o // object file extension

This patch addresses items `4`, `5` and `8`.
`libaux` is shortened to `aux`, `rust-cgu` is shortened to `rcgu`, mode disambiguator is omitted unless it's necessary (for pretty-printing and debuginfo tests, see 38d26d811a)

I haven't touched names of codegen units though (`specialization_cross_crate_defaults0`).
Is it useful for them to have descriptive names including the crate name, as opposed to just `0` or `cgu0` or something?
2017-11-05 06:42:17 +00:00
Alex Crichton
fbf9869702 rustc: Handle some libstd symbole exports better
Right now symbol exports, particularly in a cdylib, are handled by
assuming that `pub extern` combined with `#[no_mangle]` means "export
this". This isn't actually what we want for some symbols that the
standard library uses to implement itself, for example symbols related
to allocation. Additionally other special symbols like
`rust_eh_personallity` have no need to be exported from cdylib crate
types (only needed in dylib crate types).

This commit updates how rustc handles these special symbols by adding to
the hardcoded logic of symbols like `rust_eh_personallity` but also
adding a new attribute, `#[rustc_std_internal_symbol]`, which forces the
export level to be considered the same as all other Rust functions
instead of looking like a C function.

The eventual goal here is to prevent functions like `__rdl_alloc` from
showing up as part of a Rust cdylib as it's just an internal
implementation detail. This then further allows such symbols to get gc'd
by the linker when creating a cdylib.
2017-11-04 20:01:11 -07:00
Vadim Petrochenkov
d588f9338d Shorten paths to auxiliary files created by tests 2017-11-03 22:41:15 +03:00
leonardo.yvens
8b586e68b5 auto trait future compatibility lint 2017-11-03 16:13:21 -02:00
bors
5ce3d482e2 Auto merge of #45647 - nrc:rls-bugs, r=eddyb
save-analysis: support unions

r? @eddyb
2017-11-02 12:34:13 +00:00
Michael Woerister
d3951ff5e1 Add regression test for symbol visibility when compiling rlib+cdylib in one session. 2017-10-31 14:00:28 +01:00
Nick Cameron
a9bafe5c9e save-analysis: support unions 2017-10-31 18:24:48 +13:00
Paul Lietar
77f7e85d7f Implement RFC 1861: Extern types 2017-10-27 23:01:34 +02:00
bors
ba4e8d7db3 Auto merge of #45202 - alexcrichton:fix-inline-always, r=michaelwoerister
rustc: Handle #[inline(always)] at -O0

This commit updates the handling of `#[inline(always)]` functions at -O0 to
ensure that it's always inlined regardless of the number of codegen units used.

Closes #45201
2017-10-16 16:02:43 +00:00
Vadim Petrochenkov
9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
Alex Crichton
5d415e8d08 rustc: Handle #[inline(always)] at -O0
This commit updates the handling of `#[inline(always)]` functions at -O0 to
ensure that it's always inlined regardless of the number of codegen units used.

Closes #45201
2017-10-11 17:12:29 -07:00