summary refs log tree commit diff
path: root/src/test/auxiliary
AgeCommit message (Collapse)AuthorLines
2015-10-01Converted test to rpass.Vadim Chugunov-0/+15
2015-09-14Auto merge of #28392 - arielb1:sort-bounds-list, r=eddybbors-0/+20
The sort key is a (DefId, Name), which is *not* stable between runs, so we must re-sort when loading. Fixes #24063 Fixes #25467 Fixes #27222 Fixes #28377 r? @eddyb
2015-09-13sort the existential bounds list in tydecodeAriel Ben-Yehuda-0/+20
The sort key is a (DefId, Name), which is *not* stable between runs, so we must re-sort when loading. Fixes #24063 Fixes #25467 Fixes #27222 Fixes #28377
2015-09-09Add testManish Goregaokar-0/+38
2015-09-03Move lints to HIRManish Goregaokar-10/+9
2015-09-01Remove the Modifier and Decorator kinds of syntax extensions.Nick Cameron-12/+0
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-0/+2
2015-08-15test: Fix tests for requiring issuesAlex Crichton-43/+45
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-0/+149
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-14Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrcbors-1/+0
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
2015-08-12Fallout in tests -- we now report an error if you even reference a typeNiko Matsakis-1/+0
`&Foo` where `Foo` is a trait that is not object-safe
2015-08-12stop cross-crate associated types from being importedAriel Ben-Yehuda-0/+6
Fixes #22968 Probably fixes #27602
2015-08-12Auto merge of #27618 - dotdash:drop_fixes, r=luqmanabors-0/+23
2015-08-10trans: Stop informing LLVM about dllexportAlex Crichton-0/+3
Rust's current compilation model makes it impossible on Windows to generate one object file with a complete and final set of dllexport annotations. This is because when an object is generated the compiler doesn't actually know if it will later be included in a dynamic library or not. The compiler works around this today by flagging *everything* as dllexport, but this has the drawback of exposing too much. Thankfully there are alternate methods of specifying the exported surface area of a dll on Windows, one of which is passing a `*.def` file to the linker which lists all public symbols of the dynamic library. This commit removes all locations that add `dllexport` to LLVM variables and instead dynamically generates a `*.def` file which is passed to the linker. This file will include all the public symbols of the current object file as well as all upstream libraries, and the crucial aspect is that it's only used when generating a dynamic library. When generating an executable this file isn't generated, so all the symbols aren't exported from an executable. To ensure that statically included native libraries are reexported correctly, the previously added support for the `#[linked_from]` attribute is used to determine the set of FFI symbols that are exported from a dynamic library, and this is required to get the compiler to link correctly.
2015-08-10Remove morestack supportAlex Crichton-3/+0
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-07Fix ICE when trying to drop an unsized type from a different crateBjörn Steinbrink-0/+23
The code to get the LLVM type signature for the drop function doesn't handle unsized types correctly.
2015-08-03syntax: Implement #![no_core]Alex Crichton-4/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-03Auto merge of #27210 - vadimcn:win64-eh-pers, r=alexcrichtonbors-0/+3
After this change, the only remaining symbol we are pulling from libgcc on Win64 is `__chkstk_ms` - the stack probing routine.
2015-07-30Implement Win64 eh_personality natively.Vadim Chugunov-0/+3
2015-07-29Feature gate associated type defaultsBrian Anderson-0/+2
There are multiple issues with them as designed and implemented. cc #27364
2015-07-28Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddybbors-11/+7
this has quite some fallout. but also made lots of stuff more readable imo [breaking-change] for plugin authors
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-11/+7
2015-07-28Auto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonwbors-0/+36
The functionality this was testing was removed somewhere along the line, and this commit restores what it was testing. Closes #20586
2015-07-27test: Fix lto-syntax-extensionAlex Crichton-0/+36
The functionality this was testing was removed somewhere along the line, and this commit restores what it was testing. Closes #20586
2015-07-26Revert "trans: Be a little more picky about dllimport"Alex Crichton-15/+0
This reverts commit a0efd3a3d99a98e3399a4f07abe6a67cf0660335.
2015-07-25Add cross-crate error message testsJared Roesch-0/+19
2015-07-21trans: Be a little more picky about dllimportAlex Crichton-0/+15
Currently you can hit a link error on MSVC by only referencing static items from a crate (no functions for example) and then link to the crate statically (as all Rust crates do 99% of the time). A detailed investigation can be found [on github][details], but the tl;dr is that we need to stop applying dllimport so aggressively. This commit alters the application of dllimport on constants to only cases where the crate the constant originated from will be linked as a dylib in some output crate type. That way if we're just linking rlibs (like the motivation for this issue) we won't use dllimport. For the compiler, however, (which has lots of dylibs) we'll use dllimport. [details]: https://github.com/rust-lang/rust/issues/26591#issuecomment-123513631 cc #26591
2015-07-20Add test of cross-crate impl formattingWilliam Throwe-0/+15
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-07-08trans: Link rlibs to dylibs with --whole-archiveAlex Crichton-0/+59
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to the linker when linking rlibs into dylibs. The primary purpose of this commit is to ensure that the linker doesn't strip out objects from an archive when creating a dynamic library. Information on how this can go wrong can be found in issues #14344 and #25185. The unfortunate part about passing this flag to the linker is that we have to preprocess the rlib to remove the metadata and compressed bytecode found within. This means that creating a dylib will now take longer to link as we've got to copy around the input rlibs to a temporary location, modify them, and then invoke the linker. This isn't done for executables, however, so the "hello world" compile time is not affected. This fix was instigated because of the previous commit where rlibs may not contain multiple object files instead of one due to codegen units being greater than one. That change prevented the main distribution from being compiled with more than one codegen-unit and this commit fixes that. Closes #14344 Closes #25185
2015-07-07Auto merge of #26747 - huonw:stability-issue, r=alexcrichtonbors-0/+20
This takes an issue number and points people to it in the printed error message. This commit does not make it an error to have no `issue` field.
2015-07-06rustc: implement `unstable(issue = "nnn")`.Huon Wilson-0/+20
This takes an issue number and points people to it in the printed error message. This commit does not make it an error to have no `issue` field.
2015-07-03After inferring regions, scan for any bounds that are due to a lifetimeNiko Matsakis-0/+21
bound that is likely to change. In that case, it will change to 'static, so then scan down the graph to see whether there are any hard constraints that would prevent 'static from being a valid value here. Report a warning.
2015-06-30Actually encode default associated typesAriel Ben-Yehuda-0/+16
Fixes #26636
2015-06-25test: Use liblibc in lang-item-publicAlex Crichton-28/+7
Makes this test case more robust by using standard libraries to ensure the binary can be built.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+1
2015-06-17Auto merge of #26025 - alexcrichton:update-llvm, r=brsonbors-1/+1
This commit updates the LLVM submodule in use to the current HEAD of the LLVM repository. This is primarily being done to start picking up unwinding support for MSVC, which is currently unimplemented in the revision of LLVM we are using. Along the way a few changes had to be made: * As usual, lots of C++ debuginfo bindings in LLVM changed, so there were some significant changes to our RustWrapper.cpp * As usual, some pass management changed in LLVM, so clang was re-scrutinized to ensure that we're doing the same thing as clang. * Some optimization options are now passed directly into the `PassManagerBuilder` instead of through CLI switches to LLVM. * The `NoFramePointerElim` option was removed from LLVM, favoring instead the `no-frame-pointer-elim` function attribute instead. * The `LoopVectorize` option of the LLVM optimization passes has been disabled as it causes a divide-by-zero exception to happen in LLVM for zero-sized types. This is reported as https://llvm.org/bugs/show_bug.cgi?id=23763 Additionally, LLVM has picked up some new optimizations which required fixing an existing soundness hole in the IR we generate. It appears that the current LLVM we use does not expose this hole. When an enum is moved, the previous slot in memory is overwritten with a bit pattern corresponding to "dropped". When the drop glue for this slot is run, however, the switch on the discriminant can often start executing the `unreachable` block of the switch due to the discriminant now being outside the normal range. This was patched over locally for now by having the `unreachable` block just change to a `ret void`.
2015-06-16rustc: Update LLVMAlex Crichton-1/+1
This commit updates the LLVM submodule in use to the current HEAD of the LLVM repository. This is primarily being done to start picking up unwinding support for MSVC, which is currently unimplemented in the revision of LLVM we are using. Along the way a few changes had to be made: * As usual, lots of C++ debuginfo bindings in LLVM changed, so there were some significant changes to our RustWrapper.cpp * As usual, some pass management changed in LLVM, so clang was re-scrutinized to ensure that we're doing the same thing as clang. * Some optimization options are now passed directly into the `PassManagerBuilder` instead of through CLI switches to LLVM. * The `NoFramePointerElim` option was removed from LLVM, favoring instead the `no-frame-pointer-elim` function attribute instead. Additionally, LLVM has picked up some new optimizations which required fixing an existing soundness hole in the IR we generate. It appears that the current LLVM we use does not expose this hole. When an enum is moved, the previous slot in memory is overwritten with a bit pattern corresponding to "dropped". When the drop glue for this slot is run, however, the switch on the discriminant can often start executing the `unreachable` block of the switch due to the discriminant now being outside the normal range. This was patched over locally for now by having the `unreachable` block just change to a `ret void`.
2015-06-13Use `assert_eq!` instead of `assert!` in testspetrochenkov-8/+8
2015-06-12Cleanup: rename middle::ty::sty and its variants.Eli Friedman-17/+17
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-05-29New tests for cross-crate usages of const fn and so forthNiko Matsakis-0/+16
2015-05-29add const_fn featuresNiko Matsakis-0/+2
2015-05-27Auto merge of #25790 - eddyb:oh-snap-ctfe-arrived, r=alexcrichtonbors-2/+2
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-2/+2
2015-05-26Auto merge of #24657 - aochagavia:rustdoc, r=alexcrichtonbors-0/+1
Fixes #24575 Fixes #25673 r? @alexcrichton
2015-05-26rustc_back: Don't pass 'u' to ar invocationsAlex Crichton-0/+32
This flag indicates that when files are being replaced or added to archives (the `r` flag) that the new file should not be inserted if it is not newer than the file that already exists in the archive. The compiler never actually has a use case of *not* wanting to insert a file because it already exists, and this causes rlibs to not be updated in some cases when the compiler was re-run too quickly. Closes #18913
2015-05-25Rustdoc: ignore deref-inherited static methodsAdolfo Ochagavía-0/+1
Fixes #24575
2015-05-24Auto merge of #25168 - Manishearth:register_attr, r=eddybbors-0/+30
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks. cc @thepowersgang
2015-05-22Let MultiItemDecorator take `&Annotatable` (fixes #25683)Manish Goregaokar-5/+5
2015-05-17Allow #[derive()] to generate unsafe methodsManish Goregaokar-0/+2