about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-01-17auto merge of #21233 : huonw/rust/simd-size, r=Aatchbors-0/+140
This stops the compiler ICEing on the use of SIMD types in FFI signatures. It emits correct code for LLVM intrinsics, but I am quite unsure about the ABI handling in general so I've added a new feature gate `simd_ffi` to try to ensure people don't use it without realising there's a non-trivial risk of codegen brokenness. Closes #20043.
2015-01-17auto merge of #21205 : alexcrichton/rust/issue-21202, r=nikomatsakisbors-0/+41
Loading methods from external crates was erroneously using the type's privacy for each method instead of each method's privacy. This commit fixes that. Closes #21202 This commit also moves privacy to its own crate because I thought that was where the bug was. Turns out it wasn't, but it helped me iterate at least!
2015-01-17Feature gate SIMD in FFI, due to unknown ABIs.Huon Wilson-1/+27
I don't know if this handling of SIMD types is correct for the C ABI on all platforms, so lets add an even finer feature gate than just the `simd` one. The `simd` one can be used with (relatively) little risk of complete nonsense, the reason for it is that it is likely that things will change. Using the types in FFI with an incorrect ABI will at best give absolute nonsense results, but possibly cause serious breakage too, so this is a step up in badness, hence a new feature gate.
2015-01-17Add comprehensive test for no-ICE behaviour of SIMD FFI.Huon Wilson-0/+114
This just compiles a test using SIMD in FFI (mostly importing LLVM intrinsics) for almost all rustc's supported platforms, but not linking it or running it, so there's absolutely no guarantee that this is correct.
2015-01-16auto merge of #21008 : huonw/rust/trait-suggestions, r=nikomatsakisbors-0/+105
For a call like `foo.bar()` where the method `bar` can't be resolved, the compiler will search for traits that have methods with name `bar` to give a more informative error, providing a list of possibilities. Closes #7643.
2015-01-16auto merge of #21113 : alexcrichton/rust/plug-a-hole, r=brsonbors-9/+55
With the addition of separate search paths to the compiler, it was intended that applications such as Cargo could require a `--extern` flag per `extern crate` directive in the source. The system can currently be subverted, however, due to the `existing_match()` logic in the crate loader. When loading crates we first attempt to match an `extern crate` directive against all previously loaded crates to avoid reading metadata twice. This "hit the cache if possible" step was erroneously leaking crates across the search path boundaries, however. For example: extern crate b; extern crate a; If `b` depends on `a`, then it will load crate `a` when the `extern crate b` directive is being processed. When the compiler reaches `extern crate a` it will use the previously loaded version no matter what. If the compiler was not invoked with `-L crate=path/to/a`, it will still succeed. This behavior is allowing `extern crate` declarations in Cargo without a corresponding declaration in the manifest of a dependency, which is considered a bug. This commit fixes this problem by keeping track of the origin search path for a crate. Crates loaded from the dependency search path are not candidates for crates which are loaded from the crate search path.
2015-01-16rustc: Fix a leak in dependency= pathsAlex Crichton-9/+55
With the addition of separate search paths to the compiler, it was intended that applications such as Cargo could require a `--extern` flag per `extern crate` directive in the source. The system can currently be subverted, however, due to the `existing_match()` logic in the crate loader. When loading crates we first attempt to match an `extern crate` directive against all previously loaded crates to avoid reading metadata twice. This "hit the cache if possible" step was erroneously leaking crates across the search path boundaries, however. For example: extern crate b; extern crate a; If `b` depends on `a`, then it will load crate `a` when the `extern crate b` directive is being processed. When the compiler reaches `extern crate a` it will use the previously loaded version no matter what. If the compiler was not invoked with `-L crate=path/to/a`, it will still succeed. This behavior is allowing `extern crate` declarations in Cargo without a corresponding declaration in the manifest of a dependency, which is considered a bug. This commit fixes this problem by keeping track of the origin search path for a crate. Crates loaded from the dependency search path are not candidates for crates which are loaded from the crate search path. As a result of this fix, this is a likely a breaking change for a number of Cargo packages. If the compiler starts informing that a crate can no longer be found, it likely means that the dependency was forgotten in your Cargo.toml. [breaking-change]
2015-01-16rustc_resolve: Correctly record privacy of methodsAlex Crichton-0/+41
Loading methods from external crates was erroneously using the type's privacy for each method instead of each method's privacy. This commit fixes that. Closes #21202
2015-01-16auto merge of #21162 : apasel422/rust/issue-16530, r=huonwbors-0/+18
This fixes #16530 by hashing nullary structs [the same way as the empty tuple] (https://github.com/rust-lang/rust/blob/master/src/libcore/hash/mod.rs#L185). Other approaches are possible, but this was the simplest.
2015-01-16Prefer implemented traits in suggestions.Huon Wilson-7/+44
If `a.method();` can't be resolved, we first look for implemented traits globally and suggest those. If there are no such traits found, we only then fall back to suggesting from the unfiltered list of traits.
2015-01-16fix pretty test falloutFlavio Percoco-6/+2
2015-01-16fix latest changes falloutFlavio Percoco-2/+0
2015-01-16addressed commentsFlavio Percoco-48/+39
2015-01-16Allow negative impls just for Send and SyncFlavio Percoco-0/+20
2015-01-16Don't use NoSend/NoSync in testsFlavio Percoco-41/+59
2015-01-16Fix coherence for negative implementationsFlavio Percoco-0/+20
2015-01-16add a run-pass test that used to failFlavio Percoco-0/+29
2015-01-16Check for negative impls for `Send` and `Sync`Flavio Percoco-20/+38
2015-01-16Negative impls are considered safeFlavio Percoco-0/+41
2015-01-16Add test for missing default implFlavio Percoco-0/+20
2015-01-15Test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-15rollup merge of #21197: michaelwoerister/linestablesonly-forloopAlex Crichton-1/+5
Fixes #21067.
2015-01-15rollup merge of #21170: Diggsey/issue-21058Alex Crichton-0/+30
While it's unstable and will probably be replaced or "reformed" at some point, it's useful in the mean time to be able to introspect the type system when debugging, and not be limited to sized types. Fixes #21058
2015-01-15rollup merge of #21167: FlaPer87/coherence-implsAlex Crichton-0/+37
Fixes #21080 r? @nikomatsakis [breaking-change]
2015-01-15rollup merge of #21161: japaric/ufcs-hashAlex Crichton-0/+21
expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of `(*__self_0_0).hash(__arg_0)` closes #21160 r? @alexcrichton
2015-01-15rollup merge of #21144: nagisa/asm-str-fixAlex Crichton-0/+16
Fixes #21045
2015-01-15rollup merge of #21115: dotdash/iter_vecAlex Crichton-0/+19
There are two places left where we used to only know the byte size of/offset into an array and had to cast to i8 and back to get the right addresses. But by now, we always know the sizes in terms of the number of elements in the array. In fact we have to add an extra Mul instruction so we can use the weird cast-to-u8 code. So we should really just embrace our new knowledge and use simple GEPs to do the address calculations. Fixes #3729
2015-01-15rollup merge of #21107: nikomatsakis/assoc-type-ice-hunt-take-1Alex Crichton-15/+136
Fixes for #20831 and #21010 r? @nick29581
2015-01-15rollup merge of #21089: nikomatsakis/issue-20676-invalid-vtable-for-objectAlex Crichton-0/+45
Support UFCS style calls to a method defined in `Trait` where `Self` is bound to a trait object. Fixes #20676. r? @alexcrichton
2015-01-15rollup merge of #21088: aochagavia/obsoleteAlex Crichton-58/+0
Only the most recent changes (since November 2014) get a special error. Fixes #20599
2015-01-15rollup merge of #21085: pnkfelix/pp-flowgraph-kill-labelsAlex Crichton-19/+19
Add `--xpretty flowgraph,unlabelled` variant to the (unstable) flowgraph printing `rustc` option. This makes the tests much easier to maintain; the particular details of the labels attached to exiting scopes is not worth the effort required to keep it up to date as things change in the compiler internals.
2015-01-15rollup merge of #21066: japaric/issue-20575Alex Crichton-0/+19
closes #20575
2015-01-15rollup merge of #21052: nick29581/methods-extAlex Crichton-3/+54
Allows modifiers to be used on methods, associated types, etc. r? @sfackler
2015-01-15rustc: implement fully qualified UFCS expressions.Eduard Burtescu-3/+65
2015-01-15support deriving `Hash` for nullary structsAndrew Paseltiner-0/+18
fixes #16530
2015-01-15debuginfo: Fix ICE when compiling for-loops with lines-tables-only.Michael Woerister-1/+5
2015-01-15Forbid impls for builtin traits on types that are not structs/enumsFlavio Percoco-0/+37
2015-01-15Allow get_tydesc intrinsic to accept unsized typesDiggory Blake-0/+30
Fix tabs Added missing ty_str cases when generating type descriptions Reduce code duplication and improve test
2015-01-14use better spanJorge Aparicio-1/+1
2015-01-14use UFCS in `#[deriving(Hash)]`Jorge Aparicio-0/+21
expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of `(*__self_0_0).hash(__arg_0)` closes #21160
2015-01-14Refactor compare_impl_method to use all boundsJared Roesch-17/+46
Refactor compare_impl_method into its own file. Modify the code to stop comparing individual parameter bounds. Instead we now use the predicates list attached to the trait and implementation generics. This ensures consistency even when bounds are declared in different places (i.e on a parameter vs. in a where clause).
2015-01-14Revert "rustc_trans: Fix type projection debuginfo" -- it potentially papers ↵Niko Matsakis-28/+0
over a lack of normalization that should have taken place. This reverts commit f7745a9be3eb2d9438f08b383156f0a33cbb0cdf.
2015-01-14Normalize associated types in the type_is_newtype_immediate pass. Fixes #21010.Niko Matsakis-0/+32
2015-01-14Fix propagation of the HAS_PROJECTION flag in object types. Fixes #20831 ↵Niko Matsakis-0/+43
some more.
2015-01-14Fix DeBruijn accounting. It used to be that all trait-refs were binders,Niko Matsakis-0/+74
but now only poly-trait-refs are binders. Fixes #20831.
2015-01-14Remove old obsolete syntax testsAdolfo Ochagavía-58/+0
2015-01-15Syntax extensions on trait and impl items.Nick Cameron-3/+54
Allows modifiers to be used on methods, associated types, etc.
2015-01-14Disallow a form of invalid asm! macroSimonas Kazlauskas-0/+16
Fixes #21045
2015-01-14auto merge of #21082 : brson/rust/finally, r=alexcrichtonbors-6/+11
No in-tree users. Ugly interface. Closes #14332. I just happened to notice that this module still lives and has no users. Assuming we don't want it. r? @aturon cc @alexcrichton
2015-01-14auto merge of #21061 : japaric/rust/range, r=nick29581bors-6/+6