about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2014-05-07auto merge of #14005 : alexcrichton/rust/extern-unsafe, r=pcwaltonbors-0/+17
Previously, the parser would not allow you to simultaneously implement a function with a different abi as well as being unsafe at the same time. This extends the parser to allow functions of the form: unsafe extern fn foo() { // ... } The closure type grammar was also changed to reflect this reversal, types previously written as "extern unsafe fn()" must now be written as "unsafe extern fn()". The parser currently has a hack which allows the old style, but this will go away once a snapshot has landed. Closes #10025 [breaking-change]
2014-05-07auto merge of #13726 : michaelwoerister/rust/lldb-autotests, r=alexcrichtonbors-3301/+3294
This pull request contains preparations for adding LLDB autotests: + the debuginfo tests are split into debuginfo-gdb and debuginfo-lldb + the `compiletest` tool is updated to support the debuginfo-lldb mode + tests.mk is modified to provide debuginfo-gdb and debuginfo-lldb make targets + GDB test cases are moved from `src/test/debug-info` to `src/test/debuginfo-gdb` + configure will now look for LLDB and set the appropriate CFG variables + the `lldb_batchmode.py` script is added to `src/etc`. It emulates GDB's batch mode The LLDB autotests themselves are not part of this PR. Those will probable require some manual work on the test bots to make them work for the first time. Better to get these unproblematic preliminaries out of the way in a separate step.
2014-05-07auto merge of #13901 : alexcrichton/rust/facade, r=brsonbors-10/+10
This is the second step in implementing #13851. This PR cannot currently land until a snapshot exists with #13892, but I imagine that this review will take longer. This PR refactors a large amount of functionality outside of the standard library into a new library, libcore. This new library has 0 dependencies (in theory). In practice, this library currently depends on these symbols being available: * `rust_begin_unwind` and `rust_fail_bounds_check` - These are the two entry points of failure in libcore. The symbols are provided by libstd currently. In the future (see the bullets on #13851) this will be officially supported with nice error mesages. Additionally, there will only be one failure entry point once `std::fmt` migrates to libcore. * `memcpy` - This is often generated by LLVM. This is also quite trivial to implement for any platform, so I'm not too worried about this. * `memcmp` - This is required for comparing strings. This function is quite common *everywhere*, so I don't feel to bad about relying on a consumer of libcore to define it. * `malloc` and `free` - This is quite unfortunate, and is a temporary stopgap until we deal with the `~` situation. More details can be found in the module `core::should_not_exist` * `fmod` and `fmodf` - These exist because the `Rem` trait is defined in libcore, so the `Rem` implementation for floats must also be defined in libcore. I imagine that any platform using floating-point modulus will have these symbols anyway, and otherwise they will be optimized out. * `fdim` and `fdimf` - Like `fmod`, these are from the `Signed` trait being defined in libcore. I don't expect this to be much of a problem These dependencies all "Just Work" for now because libcore only exists as an rlib, not as a dylib. The commits themselves are organized to show that the overall diff of this extraction is not all that large. Most modules were able to be moved with very few modifications. The primary module left out of this iteration is `std::fmt`. I plan on migrating the `fmt` module to libcore, but I chose to not do so at this time because it had implications on the `Writer` trait that I wanted to deal with in isolation. There are a few breaking changes in these commits, but they are fairly minor, and are all labeled with `[breaking-change]`. The nastiest parts of this movement come up with `~[T]` and `~str` being language-defined types today. I believe that much of this nastiness will get better over time as we migrate towards `Vec<T>` and `Str` (or whatever the types will be named). There will likely always be some extension traits, but the situation won't be as bad as it is today. Known deficiencies: * rustdoc will get worse in terms of readability. This is the next issue I will tackle as part of #13851. If others think that the rustdoc change should happen first, I can also table this to fix rustdoc first. * The compiler reveals that all these types are reexports via error messages like `core::option::Option`. This is filed as #13065, and I believe that issue would have a higher priority now. I do not currently plan on fixing that as part of #13851. If others believe that this issue should be fixed, I can also place it on the roadmap for #13851. I recommend viewing these changes on a commit-by-commit basis. The overall change is likely too overwhelming to take in.
2014-05-07debuginfo: Split debuginfo autotests into debuginfo-gdb and debuginfo-lldbMichael Woerister-3301/+3294
2014-05-07test: Update with std => core movementAlex Crichton-10/+10
2014-05-07auto merge of #13832 : alexcrichton/rust/cfail-full, r=brsonbors-0/+0
Compile-fail tests for syntax extensions belong in this suite which has correct dependencies on all artifacts rather than just the target artifacts. Closes #13818
2014-05-07auto merge of #13967 : richo/rust/features/ICE-fails, r=alexcrichtonbors-0/+6
This change makes internal compile errors in the compile-fail tests failures. I believe this is the correct behaviour- those tests are intended to assert that the compiler doesn't proceed, not that it explodes. So far, it fails on 4 tests in my environment, my testcase for #13943 which is what caused me to tackle this, and 3 others: ``` failures: [compile-fail] compile-fail/incompatible-tuple.rs # This one is mine and not on master [compile-fail] compile-fail/inherit-struct8.rs [compile-fail] compile-fail/issue-9725.rs [compile-fail] compile-fail/unsupported-cast.rs ```
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-802/+929
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-06Ignore tests broken by failing on ICERicho Healey-0/+6
2014-05-06rustc: Enable writing "unsafe extern fn() {}"Alex Crichton-0/+17
Previously, the parser would not allow you to simultaneously implement a function with a different abi as well as being unsafe at the same time. This extends the parser to allow functions of the form: unsafe extern fn foo() { // ... } The closure type grammar was also changed to reflect this reversal, types previously written as "extern unsafe fn()" must now be written as "unsafe extern fn()". The parser currently has a hack which allows the old style, but this will go away once a snapshot has landed. Closes #10025 [breaking-change]
2014-05-06auto merge of #13892 : alexcrichton/rust/mixing-rlib-dylib-deps, r=brsonbors-9/+152
Currently, rustc requires that a linkage be a product of 100% rlibs or 100% dylibs. This is to satisfy the requirement that each object appear at most once in the final output products. This is a bit limiting, and the upcoming libcore library cannot exist as a dylib, so these rules must change. The goal of this commit is to enable *some* use cases for mixing rlibs and dylibs, primarily libcore's use case. It is not targeted at allowing an exhaustive number of linkage flavors. There is a new dependency_format module in rustc which calculates what format each upstream library should be linked as in each output type of the current unit of compilation. The module itself contains many gory details about what's going on here. cc #10729
2014-05-06log: Use writeln!() instead of write!()Alex Crichton-0/+44
This was accidentally left out of the recent logging improvements.
2014-05-05auto merge of #13940 : edwardw/rust/refutable-match, r=pcwaltonbors-0/+73
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing #12582 and #13027 without causing regressions such as #13867. Closes #13867
2014-05-05auto merge of #13912 : seanmonstar/rust/logrecord, r=alexcrichtonbors-4/+8
The logging macros now create a LogRecord, and pass that to the Logger. This will allow custom loggers to change the formatting, and possible filter on more properties of the log record. DefaultLogger's formatting was taken from Python's default formatting: `LEVEL:from: message` Also included: fmt::Arguments now implement Show, so they can be used to extend format strings. @alexcrichton r?
2014-05-05auto merge of #13782 : alexcrichton/rust/issue-13775, r=pcwaltonbors-0/+15
These often crop up when using default methods that don't actually bind their argument names. Closes #13775
2014-05-05log: Logger receiveis a LogRecordSean McArthur-4/+8
The logging macros now create a LogRecord, and pass that to the Logger, instead of passing a `level` and `args`. The new signature is: trait Logger { fn log(&mut self, record: &LogRecord); } The LogRecord includes additional values that may be useful to custom loggers, and also allows for further expansion if not values are found useful. DefaultLogger's formatting was taken from Python's default formatting: `LEVEL:from: message` Also included: fmt::Arguments now implement Show, so they can be used to extend format strings. [breaking-change]
2014-05-05auto merge of #13271 : stepancheg/rust/align, r=pcwaltonbors-0/+66
This patch fixes issue #13186. When generating constant expression for enum, it is possible that alignment of expression may be not equal to alignment of type. In that case space after last struct field must be padded to match size of value and size of struct. This commit adds that padding. See detailed explanation in src/test/run-pass/trans-tag-static-padding.rs
2014-05-05Adjust codegen logic for range and guarded armsEdward Wang-0/+73
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing #12582 and #13027 without causing regressions such as #13867. Closes #13867
2014-05-05auto merge of #13936 : Armavica/rust/lint_check-range, r=kballardbors-0/+12
Some cases were not correctly handled by this lint, for instance `let a = 42u8; a < 0` and `let a = 42u8; a > 255`. It led to the discovery of two useless comparisons, which I removed.
2014-05-04Register new snapshotsAlex Crichton-4/+0
2014-05-04auto merge of #13905 : alexcrichton/rust/issue-13337, r=thestingerbors-0/+21
This has long since not been too relevant since the introduction of many crate type outputs. This commit removes the flag entirely, adjusting all logic to do the most reasonable thing when building both a library and an executable. Closes #13337
2014-05-04auto merge of #13921 : TeXitoi/rust/shootout-spectralnorm-tweaks, r=alexcrichtonbors-1/+5
- using libgreen to optimize CPU usage - less tasks to limit wasted resources Here, on a one core 2 threads CPU, new version is ~1.2 faster. May be better with more core.
2014-05-04Add missing cases to the type_limits lintVirgile Andreani-0/+12
and exhaustive testing for the `u8` type.
2014-05-04auto merge of #13916 : TeXitoi/rust/shootout-mandelbrot-rewrite, r=pcwaltonbors-55/+52
- removed warning - improved performances - parallelization
2014-05-04auto merge of #13908 : pcwalton/rust/box-pattern, r=alexcrichtonbors-0/+20
r? @alexcrichton
2014-05-04auto merge of #13898 : nikomatsakis/rust/type-bounds-b, r=acrichtobors-0/+42
This is needed to bootstrap fix for #5723.
2014-05-03Skip pretty printing for the regions bound testNiko Matsakis-0/+1
2014-05-03auto merge of #13906 : alexcrichton/rust/issue-13620, r=luqmanabors-0/+50
This ensures that private functions exported through static initializers will actually end up being public in the object file (so other objects can continue to reference the function). Closes #13620
2014-05-03shootout-spectralnorm tweaksGuillaume Pinot-1/+5
- using libgreen to optimize CPU usage - less tasks to limit wasted resources Here, on a one core 2 threads CPU, new version is ~1.2 faster. May be better with more core.
2014-05-03auto merge of #13685 : Ryman/rust/issue7575, r=alexcrichtonbors-0/+104
Closes #7575. I don't think the change from a contains lookup to an iteration of the HashSet in the resolver should be much of a burden as the set of methods with the same name should be relatively small.
2014-05-03Temporary patch to accept arbitrary lifetimes (behind feature gate) in bound ↵Niko Matsakis-0/+41
lists. This is needed to bootstrap fix for #5723.
2014-05-03auto merge of #13904 : pcwalton/rust/box, r=alexcrichtonbors-0/+41
r? @alexcrichton RFC#14 Issue #13885.
2014-05-03auto merge of #13868 : FlaPer87/rust/opt-in-phase1, r=alexcrichtonbors-19/+33
This is a first patch towards an opt-in built-in trait world. This patch removes the restriction on built-in traits and allows such traits to be derived. [RFC#3] cc #13231 @nikomatsakis r?
2014-05-03auto merge of #13903 : alexcrichton/rust/issue-13890, r=thestingerbors-0/+39
The logic of the custom realpath function in metadata::loader was incorrect, but the logic in util::fs was correct. Closes #13890
2014-05-03shootout-mandelbrot rewriteGuillaume Pinot-55/+52
- removed warning - improved performances - parallelization
2014-05-03auto merge of #13899 : bjz/rust/simd, r=pcwaltonbors-16/+87
cc. @pcwalton
2014-05-02libsyntax: Add `box PAT` to the pattern grammar. RFC #14.Patrick Walton-0/+20
2014-05-02librustc: Implement the `Box<T>` type syntax. RFC #14. Issue #13885.Patrick Walton-0/+41
2014-05-02auto merge of #13579 : hirschenberger/rust/lint_unsigned_negate, r=alexcrichtonbors-0/+11
See #11273 and #13318
2014-05-02rustc: Crawl static initializers for reachabilityAlex Crichton-0/+50
This ensures that private functions exported through static initializers will actually end up being public in the object file (so other objects can continue to reference the function). Closes #13620
2014-05-02rustc: Remove the session building_library flagAlex Crichton-0/+21
This has long since not been too relevant since the introduction of many crate type outputs. This commit removes the flag entirely, adjusting all logic to do the most reasonable thing when building both a library and an executable. Closes #13337
2014-05-03Add lint check for negating uint literals and variables.Falco Hirschenberger-0/+11
See #11273 and #13318
2014-05-02Provide a note if method lookup fails and there are static definitions with ↵Kevin Butler-0/+104
the same name.
2014-05-02rustc: Use the "real" realpath functionAlex Crichton-0/+39
The logic of the custom realpath function in metadata::loader was incorrect, but the logic in util::fs was correct. Closes #13890
2014-05-02Implement comparison operators for int and uint SIMD vectorsBrendan Zabarauskas-4/+63
2014-05-02rustc: Add some suppot for mixing rlibs and dylibsAlex Crichton-9/+152
Currently, rustc requires that a linkage be a product of 100% rlibs or 100% dylibs. This is to satisfy the requirement that each object appear at most once in the final output products. This is a bit limiting, and the upcoming libcore library cannot exist as a dylib, so these rules must change. The goal of this commit is to enable *some* use cases for mixing rlibs and dylibs, primarily libcore's use case. It is not targeted at allowing an exhaustive number of linkage flavors. There is a new dependency_format module in rustc which calculates what format each upstream library should be linked as in each output type of the current unit of compilation. The module itself contains many gory details about what's going on here. cc #10729
2014-05-02auto merge of #13879 : huonw/rust/more-re, r=alexcrichtonbors-0/+4
Commits for details. This shouldn't change the generated code at all (except for switching to `LitBinary` from an explicit ExprVec of individual ExprLit bytes for `prefix_bytes`).
2014-05-02syntax: implement ToSource for more things in the quasiquoter.Huon Wilson-0/+4
The last few primitive types were missing.
2014-05-01auto merge of #13886 : japaric/rust/fix-an-typos, r=alexcrichtonbors-1/+1
Found the first one in the rust reference docs. I was going to submit a PR with one fix, but figured I could look for more... This is the result.
2014-05-01Fix a/an typosJorge Aparicio-1/+1