about summary refs log tree commit diff
path: root/src/test/auxiliary
AgeCommit message (Collapse)AuthorLines
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-2/+2
2015-01-17auto merge of #21205 : alexcrichton/rust/issue-21202, r=nikomatsakisbors-0/+16
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-16auto merge of #21008 : huonw/rust/trait-suggestions, r=nikomatsakisbors-0/+43
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-16rustc_resolve: Correctly record privacy of methodsAlex Crichton-0/+16
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-16Prefer implemented traits in suggestions.Huon Wilson-1/+6
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-15Syntax extensions on trait and impl items.Nick Cameron-2/+29
Allows modifiers to be used on methods, associated types, etc.
2015-01-14Implement suggestions for traits to import.Huon Wilson-0/+38
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-11Rename AtomicInt and AtomicUintSteven Fackler-2/+2
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize Closes #20893 [breaking-change]
2015-01-08Improvements to feature stagingBrian Anderson-16/+20
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07Test fixes and rebase conflictsAlex Crichton-0/+5
2015-01-08fallout: run-pass tests that use box. (many could be ported to `Box::new` ↵Felix S. Klock II-0/+10
instead in the future.)
2015-01-07Merge pull request #20675 from jbcrail/fix-test-commentsbors-2/+2
Fix misspelled comments in tests. Reviewed-by: steveklabnik
2015-01-06Fix misspelled comments in tests.Joseph Crail-2/+2
I separated these changes out from the other commit to minimize issues with tests.
2015-01-06rollup merge of #20615: aturon/stab-2-threadAlex Crichton-1/+1
This commit takes a first pass at stabilizing `std::thread`: * It removes the `detach` method in favor of two constructors -- `spawn` for detached threads, `scoped` for "scoped" (i.e., must-join) threads. This addresses some of the surprise/frustrating debug sessions with the previous API, in which `spawn` produced a guard that on destruction joined the thread (unless `detach` was called). The reason to have the division in part is that `Send` will soon not imply `'static`, which means that `scoped` thread creation can take a closure over *shared stack data* of the parent thread. On the other hand, this means that the parent must not pop the relevant stack frames while the child thread is running. The `JoinGuard` is used to prevent this from happening by joining on drop (if you have not already explicitly `join`ed.) The APIs around `scoped` are future-proofed for the `Send` changes by taking an additional lifetime parameter. With the current definition of `Send`, this is forced to be `'static`, but when `Send` changes these APIs will gain their full flexibility immediately. Threads that are `spawn`ed, on the other hand, are detached from the start and do not yield an RAII guard. The hope is that, by making `scoped` an explicit opt-in with a very suggestive name, it will be drastically less likely to be caught by a surprising deadlock due to an implicit join at the end of a scope. * The module itself is marked stable. * Existing methods other than `spawn` and `scoped` are marked stable. The migration path is: ```rust Thread::spawn(f).detached() ``` becomes ```rust Thread::spawn(f) ``` while ```rust let res = Thread::spawn(f); res.join() ``` becomes ```rust let res = Thread::scoped(f); res.join() ``` [breaking-change]
2015-01-06rollup merge of #20593: nikomatsakis/unused-tps-in-implAlex Crichton-4/+4
Conflicts: src/libcollections/lib.rs src/librustc/lib.rs src/libserialize/lib.rs src/libstd/lib.rs
2015-01-06Fallout from stabilizationAaron Turon-1/+1
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-1/+1
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-06Fix fallout in tests.Niko Matsakis-4/+4
2015-01-05More test fixes!Alex Crichton-3/+1
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-57/+199
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05rollup merge of #20556: japaric/no-for-sizedAlex Crichton-1/+1
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs
2015-01-05rollup merge of #20568: huonw/ungate-AT-globsAlex Crichton-16/+2
These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice. Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
2015-01-05rollup merge of #20507: alexcrichton/issue-20444Alex Crichton-1/+1
This commit is an implementation of [RFC 494][rfc] which removes the entire `std::c_vec` module and redesigns the `std::c_str` module as `std::ffi`. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0494-c_str-and-c_vec-stability.md The interface of the new `CString` is outlined in the linked RFC, the primary changes being: * The `ToCStr` trait is gone, meaning the `with_c_str` and `to_c_str` methods are now gone. These two methods are replaced with a `CString::from_slice` method. * The `CString` type is now just a wrapper around `Vec<u8>` with a static guarantee that there is a trailing nul byte with no internal nul bytes. This means that `CString` now implements `Deref<Target = [c_char]>`, which is where it gains most of its methods from. A few helper methods are added to acquire a slice of `u8` instead of `c_char`, as well as including a slice with the trailing nul byte if necessary. * All usage of non-owned `CString` values is now done via two functions inside of `std::ffi`, called `c_str_to_bytes` and `c_str_to_bytes_with_nul`. These functions are now the one method used to convert a `*const c_char` to a Rust slice of `u8`. Many more details, including newly deprecated methods, can be found linked in the RFC. This is a: [breaking-change] Closes #20444
2015-01-05Add a test case for accidental macro re-exportKeegan McAllister-0/+19
2015-01-05Un-gate macro_rulesKeegan McAllister-39/+1
2015-01-05Pass the #[plugin(...)] meta item to the registrarKeegan McAllister-0/+50
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-12/+12
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05Allow selective macro importKeegan McAllister-0/+34
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-2/+1
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-13/+9
2015-01-05fix rpass testsJorge Aparicio-13/+9
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-1/+0
In preparation for the rename.
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-1/+1
2015-01-05Implement macro re-exportKeegan McAllister-0/+34
Fixes #17103.
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-0/+24
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-0/+25
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2015-01-05std: Redesign c_str and c_vecAlex Crichton-1/+1
This commit is an implementation of [RFC 494][rfc] which removes the entire `std::c_vec` module and redesigns the `std::c_str` module as `std::ffi`. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0494-c_str-and-c_vec-stability.md The interface of the new `CString` is outlined in the linked RFC, the primary changes being: * The `ToCStr` trait is gone, meaning the `with_c_str` and `to_c_str` methods are now gone. These two methods are replaced with a `CString::from_slice` method. * The `CString` type is now just a wrapper around `Vec<u8>` with a static guarantee that there is a trailing nul byte with no internal nul bytes. This means that `CString` now implements `Deref<Target = [c_char]>`, which is where it gains most of its methods from. A few helper methods are added to acquire a slice of `u8` instead of `c_char`, as well as including a slice with the trailing nul byte if necessary. * All usage of non-owned `CString` values is now done via two functions inside of `std::ffi`, called `c_str_to_bytes` and `c_str_to_bytes_with_nul`. These functions are now the one method used to convert a `*const c_char` to a Rust slice of `u8`. Many more details, including newly deprecated methods, can be found linked in the RFC. This is a: [breaking-change] Closes #20444
2015-01-05Remove uses of default_type_params feature gate from tests.Huon Wilson-2/+0
2015-01-05Remove use of globs feature gate from tests.Huon Wilson-6/+2
2015-01-05Remove use of associated_types feature gate from tests.Huon Wilson-8/+0
2015-01-03Remove deprecated functionalityAlex Crichton-5/+4
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-04auto merge of #20490 : japaric/rust/assoc-types, r=aturonbors-7/+18
closes #20486 closes #20474 closes #20441 [breaking-change] The `Index[Mut]` traits now have one less input parameter, as the return type of the indexing operation is an associated type. This breaks all existing implementations. --- binop traits (`Add`, `Sub`, etc) now have an associated type for their return type. Also, the RHS input parameter now defaults to `Self` (except for the `Shl` and `Shr` traits). For example, the `Add` trait now looks like this: ``` rust trait Add<Rhs=Self> { type Output; fn add(self, Rhs) -> Self::Output; } ``` The `Neg` and `Not` traits now also have an associated type for their return type. This breaks all existing implementations of these traits. --- Affected traits: - `Iterator { type Item }` - `IteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods - `DoubleEndedIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods - `DoubleEndedIteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods - `RandomAccessIterator` no input/output types - `ExactSizeIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods This breaks all the implementations of these traits.
2015-01-03use assoc types in binop traitsJorge Aparicio-5/+13
2015-01-03Initial version of AArch64 support.Akos Kiss-2/+2
Adds AArch64 knowledge to: * configure, * make files, * sources, * tests, and * documentation.
2015-01-03fix rpass/cfail testsJorge Aparicio-2/+5
2015-01-02rollup merge of #20410: japaric/assoc-typesAlex Crichton-1/+5
Conflicts: src/liballoc/lib.rs src/libcollections/lib.rs src/libcollections/slice.rs src/libcore/ops.rs src/libcore/prelude.rs src/libcore/ptr.rs src/librustc/middle/traits/project.rs src/libstd/c_str.rs src/libstd/io/mem.rs src/libstd/io/mod.rs src/libstd/lib.rs src/libstd/path/posix.rs src/libstd/path/windows.rs src/libstd/prelude.rs src/libstd/rt/exclusive.rs src/libsyntax/lib.rs src/test/compile-fail/issue-18566.rs src/test/run-pass/deref-mut-on-ref.rs src/test/run-pass/deref-on-ref.rs src/test/run-pass/dst-deref-mut.rs src/test/run-pass/dst-deref.rs src/test/run-pass/fixup-deref-mut.rs src/test/run-pass/issue-13264.rs src/test/run-pass/overloaded-autoderef-indexing.rs
2015-01-02rollup merge of #20341: nikomatsakis/impl-trait-for-trait-2Alex Crichton-1/+1
Conflicts: src/librustc/middle/traits/mod.rs src/libstd/io/mod.rs src/test/run-pass/builtin-superkinds-self-type.rs
2015-01-02Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-1/+1
Conflicts: src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
2015-01-02rollup merge of #20416: nikomatsakis/coherenceAlex Crichton-0/+25
Conflicts: src/test/run-pass/issue-15734.rs src/test/run-pass/issue-3743.rs
2015-01-02rollup merge of #20404: japaric/at-testsAlex Crichton-0/+15
Closes #17732 Closes #18819 Closes #19479 Closes #19631 Closes #19632 Closes #19850 Closes #19883 Closes #20005 Closes #20009 Closes #20389 --- cc @nikomatsakis @sfackler