summary refs log tree commit diff
path: root/src/test/auxiliary
AgeCommit message (Collapse)AuthorLines
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
2014-08-25rustc: Encode the visibility of foreign itemsAlex Crichton-1/+15
The privacy pass of the compiler was previously not taking into account the privacy of foreign items, or bindings to external functions. This commit fixes this oversight by encoding the visibility of foreign items into the metadata for each crate. Any code relying on this will start to fail to compile and the bindings must be marked with `pub` to indicate that they can be used externally. Closes #16725 [breaking-change]
2014-08-23extern crate foobar as foo;wickerwaka-11/+11
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. Changed all the tests to use the new extern crate syntax Change pretty printer to use 'as' syntax
2014-08-20liblibc: don't use int/uint for intptr_t/uintptr_tCorey Richardson-3/+3
int/uint aren't considered FFI safe, replace them with the actual type they represent (i64/u64 or i32/u32). This is a breaking change, but at most a cast to `uint` or `int` needs to be added. [breaking-change]
2014-08-20librustc: handle repr on structs, require it for ffi, unify with packedCorey Richardson-1/+1
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct layout is now down with #[repr(C)]. For consistency, specifying a packed layout is now also down with #[repr(packed)]. Both can be specified. To fix errors caused by this, just add #[repr(C)] to the structs, and change #[packed] to #[repr(packed)] Closes #14309 [breaking-change]
2014-08-17librustc: Allow trait bounds on structures and enumerations, and checkPatrick Walton-0/+22
them during kind checking. This implements RFC #11. Closes #15759.
2014-08-15auto merge of #16494 : pnkfelix/rust/fsk-quotstx-followup, r=alexcrichtonbors-0/+12
Followup to PR #16477: a run-pass regression test for Issue #15750.
2014-08-15auto merge of #16424 : pcwalton/rust/where-clauses, r=nikomatsakisbors-0/+30
These `where` clauses are accepted everywhere generics are currently accepted and desugar during type collection to the type parameter bounds we have today. A new keyword, `where`, has been added. Therefore, this is a breaking change. Change uses of `where` to other identifiers. [breaking-change] r? @nikomatsakis (or whoever)
2014-08-14librustc: Implement simple `where` clauses.Patrick Walton-0/+30
These `where` clauses are accepted everywhere generics are currently accepted and desugar during type collection to the type parameter bounds we have today. A new keyword, `where`, has been added. Therefore, this is a breaking change. Change uses of `where` to other identifiers. [breaking-change]
2014-08-14libsyntax: Accept `use foo as bar;` in lieu of `use bar as foo;`Patrick Walton-6/+6
The old syntax will be removed after a snapshot. RFC #47. Issue #16461.
2014-08-14Followup to PR #16477: a run-pass regression test for Issue #15750.Felix S. Klock II-0/+12
2014-08-13rustc lexer: regression tests for embedded Idents.Felix S. Klock II-0/+26
I chose to make two of them because I wanted something close to an "end-to-end" test (*), but at the same time I wanted a test that would run on Windows (**). (*) The run-make test serves as the end-to-end: It constructs an input that is trying to subvert the hack and we are going to check that it fails in the attempt). (**) The compile-fail-fulldeps test serves as a more narrow test that will be tested on all platforms. It also attempts to subvert the hack, testing that when you use `new_parser_from_tts`, the resulting parser does not support reading embedded Idents.
2014-08-07Rename `Share` to `Sync`Alex Crichton-4/+4
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-07-31Test fixes from the rollupAlex Crichton-1/+1
Closes #16097 (fix variable name in tutorial) Closes #16100 (More defailbloating) Closes #16104 (Fix deprecation commment on `core::cmp::lexical_ordering`) Closes #16105 (fix formatting in pointer guide table) Closes #16107 (remove serialize::ebml, add librbml) Closes #16108 (Fix heading levels in pointer guide) Closes #16109 (rustrt: Don't conditionally init the at_exit QUEUE) Closes #16111 (hexfloat: Deprecate to move out of the repo) Closes #16113 (Add examples for GenericPath methods.) Closes #16115 (Byte literals!) Closes #16116 (Add a non-regression test for issue #8372) Closes #16120 (Deprecate semver) Closes #16124 (Deprecate uuid) Closes #16126 (Deprecate fourcc) Closes #16127 (Remove incorrect example) Closes #16129 (Add note about production deployments.) Closes #16131 (librustc: Don't ICE when trying to subst regions in destructor call.) Closes #16133 (librustc: Don't ICE with struct exprs where the name is not a valid struct.) Closes #16136 (Implement slice::Vector for Option<T> and CVec<T>) Closes #16137 (alloc, arena, test, url, uuid: Elide lifetimes.)
2014-07-26Remove managed_box gate from testsBrian Anderson-5/+1
No longer does anything.
2014-07-19librustc: Implement lifetime elision.Patrick Walton-3/+3
This implements RFC 39. Omitted lifetimes in return values will now be inferred to more useful defaults, and an error is reported if a lifetime in a return type is omitted and one of the two lifetime elision rules does not specify what it should be. This primarily breaks two uncommon code patterns. The first is this: unsafe fn get_foo_out_of_thin_air() -> &Foo { ... } This should be changed to: unsafe fn get_foo_out_of_thin_air() -> &'static Foo { ... } The second pattern that needs to be changed is this: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed { Owned(format!("hello world")) } Change code like this to: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed<'static> { Owned(format!("hello world")) } Closes #15552. [breaking-change]
2014-07-18auto merge of #15733 : sanxiyn/rust/use-from-type, r=alexcrichtonbors-0/+10
Importing from types was disallowed in #6462. Flag was set for paths whether it is a module or a type. Type flag was set when impl was seen. The problem is, for cross-crate situations, when reexport is involved, it is possible that impl is seen too late because metadata is loaded lazily. Fix #15664.
2014-07-17Disallow importing from types when reexport is involvedSeo Sanghyeon-0/+10
2014-07-16stability lint: ignore code from macro expansionAaron Turon-0/+8
This small patch causes the stability lint to bail out when traversing any AST produced via a macro expansion. Ultimately, we would like to lint the contents of the macro at the place where the macro is defined, but regardless we should not be linting it at the use site. Closes #15703
2014-07-10rustc: Forbid plugin_registrar in only rlib formAlex Crichton-0/+21
If a plugin registrar is available, the library must be found in dylib form, not just in rlib form. Closes #15475
2014-07-07auto merge of #15394 : pcwalton/rust/new-index-traits, r=nick29581bors-45/+0
This will break code that used the old `Index` trait. Change this code to use the new `Index` traits. For reference, here are their signatures: pub trait Index<Index,Result> { fn index<'a>(&'a self, index: &Index) -> &'a Result; } pub trait IndexMut<Index,Result> { fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } Closes #6515. [breaking-change] r? @nick29581