about summary refs log tree commit diff
path: root/src/test/pretty
AgeCommit message (Collapse)AuthorLines
2015-01-21tests: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-2/+2
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-0/+17
2015-01-16fix pretty test falloutFlavio Percoco-6/+2
2015-01-07More test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-07Preliminary feature stagingBrian Anderson-1/+0
This partially implements the feature staging described in the [release channel RFC][rc]. It does not yet fully conform to the RFC as written, but does accomplish its goals sufficiently for the 1.0 alpha release. It has three primary user-visible effects: * On the nightly channel, use of unstable APIs generates a warning. * On the beta channel, use of unstable APIs generates a warning. * On the beta channel, use of feature gates generates a warning. Code that does not trigger these warnings is considered 'stable', modulo pre-1.0 bugs. Disabling the warnings for unstable APIs continues to be done in the existing (i.e. old) style, via `#[allow(...)]`, not that specified in the RFC. I deem this marginally acceptable since any code that must do this is not using the stable dialect of Rust. Use of feature gates is itself gated with the new 'unstable_features' lint, on nightly set to 'allow', and on beta 'warn'. The attribute scheme used here corresponds to an older version of the RFC, with the `#[staged_api]` crate attribute toggling the staging behavior of the stability attributes, but the user impact is only in-tree so I'm not concerned about having to make design changes later (and I may ultimately prefer the scheme here after all, with the `#[staged_api]` crate attribute). Since the Rust codebase itself makes use of unstable features the compiler and build system to a midly elaborate dance to allow it to bootstrap while disobeying these lints (which would otherwise be errors because Rust builds with `-D warnings`). This patch includes one significant hack that causes a regression. Because the `format_args!` macro emits calls to unstable APIs it would trigger the lint. I added a hack to the lint to make it not trigger, but this in turn causes arguments to `println!` not to be checked for feature gates. I don't presently understand macro expansion well enough to fix. This is bug #20661. Closes #16678 [rc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md
2015-01-06test fallout from isize/usizeCorey Richardson-24/+25
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-2/+1
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-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-2/+1
2015-01-05fix pretty testsJorge Aparicio-5/+5
2015-01-04Put negative trait implemtations behind a feature gateFlavio Percoco-0/+2
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-0/+21
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-02rollup merge of #20425: sanxiyn/opt-local-tyAlex Crichton-0/+19
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-02std: Stabilize the prelude moduleAlex Crichton-1/+1
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2015-01-02Add a pretty-print testSeo Sanghyeon-0/+19
2015-01-02More falloutNick Cameron-7/+7
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-2/+2
2014-12-27Fallout of changing format_args!(f, args) to f(format_args!(args)).Eduard Burtescu-25/+39
2014-12-22rollup merge of #19891: nikomatsakis/unique-fn-types-3Alex Crichton-16/+17
Conflicts: src/libcore/str.rs src/librustc_trans/trans/closure.rs src/librustc_typeck/collect.rs src/libstd/path/posix.rs src/libstd/path/windows.rs
2014-12-22Fix fallout from changes. In cases where stage0 compiler is needed, weNiko Matsakis-16/+17
cannot use an `as` expression to coerce, so I used a one-off function instead (this is a no-op in stage0, but in stage1+ it triggers coercion from the fn pointer to the fn item type).
2014-12-22pprust: Fix asm optionsklutzy-0/+21
2014-12-21rollup merge of #20057: nick29581/array-syntaxAlex Crichton-19/+18
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported. Part of #19999 r? @nikomatsakis
2014-12-20patch up pretty-printing testNiko Matsakis-3/+4
2014-12-20Add parser support for generalized where clausesJared Roesch-0/+15
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
2014-12-20Allow use of `[_ ; n]` syntax for fixed length and repeating arrays.Nick Cameron-19/+18
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
2014-12-15Remove all shadowed lifetimes.Niko Matsakis-8/+8
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-0/+4
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-0/+21
integrating into rustdoc etc.
2014-12-14Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`)Niko Matsakis-2/+1
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-08test: adjust pretty/issue-4264 for formatting changes.Eduard Burtescu-15/+10
2014-11-30syntax: Make `asm!` clobbers a proper vector.Kang Seonghoon-0/+14
Otherwise `--pretty expanded` diverges.
2014-11-23Fixes to the roll-upJakub Bukaj-1/+1
2014-11-22Add testAdolfo Ochagavía-0/+20
2014-11-20Fallout from libgreen and libnative removalAaron Turon-1/+0
2014-11-17Fix fallout from coercion removalNick Cameron-3/+4
2014-11-04libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` inPatrick Walton-5/+5
Unicode characters and strings. Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected. This PR introduces a new function, `escape_default`, into the ASCII module. This was necessary for the pretty printer to continue to function. RFC #326. Closes #18062. [breaking-change]
2014-10-29Rename fail! to panic!Steve Klabnik-1/+1
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-27Preserve struct field pattern shorthand in the prettyprinter.Kevin Mehall-0/+15
Use the `is_shorthand` field introduced by #17813 (ead6c4b) to make the prettyprinter output the shorthand form. Fixes a few places that set `is_shorthand: true` when the pattern is not a PatIdent with the same name as the field.
2014-10-09test: Convert statics to constantsAlex Crichton-2/+2
Additionally, add lots of tests for new functionality around statics and `static mut`.
2014-10-03Test fixes from the rollupAlex Crichton-14/+14
2014-10-02Test fixes from the rollupAlex Crichton-1/+1
2014-10-02tests: remove uses of Gc.Eduard Burtescu-9/+8
2014-09-27Convert cfg syntax to new systemSteven Fackler-1/+1
This removes the ability to use `foo(bar)` style cfgs. Switch them to `foo_bar` or `foo="bar"` instead. [breaking-change]
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-09Decouple string and argument piecesPiotr Czarnecki-14/+8
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-9/+9
2014-08-27auto merge of #16689 : wickerwaka/rust/crate-as, r=pcwaltonbors-3/+3
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-26Rebasing changesNick Cameron-3/+3
2014-08-23extern crate foobar as foo;wickerwaka-3/+3
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-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-0/+1
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]