about summary refs log tree commit diff
path: root/src/test/auxiliary
AgeCommit message (Collapse)AuthorLines
2014-11-01Rebasing and review changesNick Cameron-26/+44
2014-11-01testNick Cameron-0/+87
2014-10-30rustc: Implement -l and include! tweaksAlex Crichton-0/+26
This is an implementation of the rustc bits of [RFC 403][rfc]. This adds a new flag to the compiler, `-l`, as well as tweaking the `include!` macro (and related source-centric macros). The compiler's new `-l` flag is used to link libraries in from the command line. This flag stacks with `#[link]` directives already found in the program. The purpose of this flag, also stated in the RFC, is to ease linking against native libraries which have wildly different requirements across platforms and even within distributions of one platform. This flag accepts a string of the form `NAME[:KIND]` where `KIND` is optional or one of dylib, static, or framework. This is roughly equivalent to if the equivalent `#[link]` directive were just written in the program. The `include!` macro has been modified to recursively expand macros to allow usage of `concat!` as an argument, for example. The use case spelled out in RFC 403 was for `env!` to be used as well to include compile-time generated files. The macro also received a bit of tweaking to allow it to expand to either an expression or a series of items, depending on what context it's used in. [rfc]: https://github.com/rust-lang/rfcs/pull/403
2014-10-30auto merge of #18279 : bgamari/rust/check-static-recursion, r=alexcrichtonbors-0/+19
I just found this patch which at some point solved a problem I encountered. Unfortunately I apparently dropped it before I managed to write a test case. I'll try to dig up the code that triggered the issue.
2014-10-29check_static_recursion: Handle foreign itemsBen Gamari-0/+19
2014-10-29Update infrastructure for fail -> panicSteve Klabnik-2/+2
This includes updating the language items and marking what needs to change after a snapshot. If you do not use the standard library, the language items you need to implement have changed. For example: ```rust #[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} } ``` is now ```rust #[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } ``` Related, lesser-implemented language items `fail` and `fail_bounds_check` have become `panic` and `panic_bounds_check`, as well. These are implemented by `libcore`, so it is unlikely (though possible!) that these two renamings will affect you. [breaking-change] Fix test suite
2014-10-29Rename fail! to panic!Steve Klabnik-8/+8
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-2/+2
2014-10-26Use standard capitalisation for TokenTree variantsBrendan Zabarauskas-2/+2
2014-10-26Rename TokenTree variants for clarityBrendan Zabarauskas-2/+2
This should be clearer, and fits in better with the `TTNonterminal` variant. Renames: - `TTTok` -> `TTToken` - `TTDelim` -> `TTDelimited` - `TTSeq` -> `TTSequence`
2014-10-21Adjust orphan rules to consider all input types, not just self type.Niko Matsakis-0/+14
Fixes #18222.
2014-10-21The new method lookup mechanism typechecks calls against the method type ↵Niko Matsakis-1/+10
declared in the trait, not in the impl. In some cases that results in tighter rules, and in some cases looser. Correct for that.
2014-10-20auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturonbors-61/+59
This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed. I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.
2014-10-19Ensure that the return type of a function is SizedAriel Ben-Yehuda-0/+3
While no real rvalue of an unsized type can exist, a diverging function can still "return" a value of such a type, which causes an ICE. Fixes #18107.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-61/+59
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-16Remove libdebug and update tests.Luqman Aden-6/+3
2014-10-12Continue cfg syntax transitionSteven Fackler-2/+1
All deprecation warnings have been converted to errors. This includes the warning for multiple cfgs on one item. We'll leave that as an error for some period of time to ensure that all uses are updated before the behavior changes from "or" to "and".
2014-10-10auto merge of #17669 : nikomatsakis/rust/multidispatch, r=pcwaltonbors-0/+51
Implement multidispatch and conditional dispatch. Because we do not attempt to preserve crate concatenation, this is a backwards compatible change. This is not yet fully integrated into method dispatch, so "UFCS"-style wrappers must be used to take advantage of the new features (see the run-pass tests). cc #17307 (multidispatch) cc #5527 (trait reform -- conditional dispatch) Because we no longer preserve crate concatenability, this deviates slightly from what was specified in the RFC. The motivation for this change is described in [this blog post](http://smallcultfollowing.com/babysteps/blog/2014/09/30/multi-and-conditional-dispatch-in-traits/). I will post an amendment to the RFC in due course but do not anticipate great controversy on this point -- particularly as the RFCs more important features (e.g., conditional dispatch) just don't work without the change.
2014-10-09Convert tests to cross-crate, fix a RefCell bug I found in the process.Niko Matsakis-0/+51
2014-10-09test: Convert statics to constantsAlex Crichton-6/+46
Additionally, add lots of tests for new functionality around statics and `static mut`.
2014-10-03auto merge of #16995 : kmcallister/rust/plugin-tutorial, r=alexcrichtonbors-0/+70
@steveklabnik, are you interested in looking this over?
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-13/+8
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs
2014-10-02rollup merge of #17722 : jakub-/issue-17169Alex Crichton-0/+2
2014-10-02Fix cross-crate tuple structs in staticsJakub Wieczorek-0/+2
Fixes #17169. Fixes #17649.
2014-10-02tests: remove uses of Gc.Eduard Burtescu-12/+7
2014-10-02syntax: mark the managed_boxes feature as Removed.Eduard Burtescu-1/+1
2014-10-02auto merge of #17663 : eddyb/rust/method-origin-subst, r=nikomatsakisbors-0/+22
Fixes #17662.
2014-10-01Add a guide to compiler pluginsKeegan McAllister-0/+70
Fixes #16983.
2014-09-30Fold `MethodOrigin`s to resolve inference variables they may contain.Eduard Burtescu-0/+22
Fixes #17662.
2014-09-30Fixes ICE when using reexported unit-like structsMichael Kainer-0/+21
Fixes that unit-like structs cannot be used if they are reexported and used in another crate. The compiler fails with an ICE, because unit-like structs are exported as DefFn and the expression `UnitStruct` is interpreted as function pointer instead of a call to the constructor. To resolve this ambiguity tuple-like struct constructors are now exported as CtorFn. When `rustc::metadata::decoder` finds a CtorFn it sets a new flag `is_ctor` in DefFn to true. Relevant changes are in `rustc::metadata::{encoder, decoder}` and in `rustc::middle::ty`. Closes #12660 and #16973.
2014-09-25Rename `fail_` lang item to `fail`, closes #16114Florian Hahn-1/+1
2014-09-22librustc: Forbid private types in public APIs.Patrick Walton-4/+4
This breaks code like: struct Foo { ... } pub fn make_foo() -> Foo { ... } Change this code to: pub struct Foo { // note `pub` ... } pub fn make_foo() -> Foo { ... } The `visible_private_types` lint has been removed, since it is now an error to attempt to expose a private type in a public API. In its place a `#[feature(visible_private_types)]` gate has been added. Closes #16463. RFC #48. [breaking-change]
2014-09-22auto merge of #17286 : vberger/rust/deprecated_in_macros, r=aturonbors-0/+10
Closes #17185. The stability lint will now check code generated by macro expansion. It will allow to detect : - arguments passed to macros using deprecated (and others) items - macro expansion generating code using deprecated items due to its arguments (hence the second commit, fixing such issue found in libcollections) Checking is still done at expansion, but it will also detect a macro explicitly using a deprecated item in its definition.
2014-09-22Lint stability now checks macro arguments.Victor Berger-0/+10
Closes #17185.
2014-09-22Fix snapshot buildersAlex Crichton-1/+3
The test in question does not pass when cross compiling because the syntax extension must always be compiled for the host, not the target.
2014-09-19rollup merge of #17338 : nick29581/variants-namespaceAlex Crichton-2/+2
2014-09-19Allow syntax extensions to return multiple items, closes #16723.Florian Hahn-0/+33
This patch replaces `MacItem` with `MacItems`.
2014-09-19Add enum variants to the type namespaceNick Cameron-2/+2
Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant.
2014-09-17rustdoc: Correctly distinguish enums and typesP1start-4/+9
This is done by adding a new field to the `DefTy` variant of `middle::def::Def`, which also clarifies an error message in the process. Closes #16712.
2014-09-14auto merge of #17163 : pcwalton/rust/impls-next-to-struct, r=alexcrichtonbors-12/+12
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Closes #17059. RFC #155. [breaking-change] r? @brson
2014-09-14Fix fallout in macro_crate/quote tests.Eduard Burtescu-6/+5
2014-09-13librustc: Forbid inherent implementations that aren't adjacent to thePatrick Walton-12/+12
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Additionally, if you used the I/O path extension methods `stat`, `lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have been moved to the the `std::io::fs::PathExtensions` trait. This breaks code like: fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Change this code to: use std::io::fs::PathExtensions; fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Closes #17059. RFC #155. [breaking-change]
2014-09-10Change ItemModifier and ItemDecorator to traitsSteven Fackler-1/+1
For convenience, the traits are implemented for the respective bare functions. Change code from this: ```rust ItemDecorator(some_function) // or ItemModifier(some_other_function) ``` to ```rust ItemDecorator(box some_function) // or ItemModifier(box some_other_function) ``` [breaking-change]
2014-09-05add tests for separate compilationStuart Pernsteiner-0/+62
2014-08-30Add lint groups; define built-in lint groups `bad_style` and `unused`P1start-0/+53
This adds support for lint groups to the compiler. Lint groups are a way of grouping a number of lints together under one name. For example, this also defines a default lint for naming conventions, named `bad_style`. Writing `#[allow(bad_style)]` is equivalent to writing `#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These lint groups can also be defined as a compiler plugin using the new `Registry::register_lint_group` method. This also adds two built-in lint groups, `bad_style` and `unused`. The contents of these groups can be seen by running `rustc -W help`.
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-7/+40
2014-08-27auto merge of #16751 : luqmana/rust/tr, r=alexcrichtonbors-0/+15
Fixes #15562.
2014-08-27auto merge of #16689 : wickerwaka/rust/crate-as, r=pcwaltonbors-11/+11
For review. Not sure about the link_attrs stuff. Will work on converting all the tests. extern crate "foobar" as foo; extern crate foobar as foo; Implements remaining part of RFC #47. Addresses issue #16461. Removed link_attrs from rust.md, they don't appear to be supported by the parser.
2014-08-25Add test.Luqman Aden-0/+27
2014-08-25Add tests to make sure intrinsicck doesn't apply to non-intrinsic fn's.Luqman Aden-0/+15