Commit Graph

167 Commits

Author SHA1 Message Date
Irina Popa a131c518ad Fixed tidy errors. 2018-04-26 17:49:24 +03:00
Irina Popa 04fa0e7bb3 rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
Russell Cohen 14e5e0e9c9 Don't allow #[should_panic] with non-() tests 2018-04-23 07:13:29 -07:00
Vadim Petrochenkov 3a30bad6de Use Ident instead of Name in MetaItem 2018-04-06 11:52:16 +03:00
Vadim Petrochenkov b3b5ef186c Remove more duplicated spans 2018-04-06 11:50:49 +03:00
bors 14ac1b5faa Auto merge of #49279 - varkor:generated-closure-return-type, r=alexcrichton
Fix implicit closure return type generation for libsyntax

The `lambda` function for constructing closures in libsyntax was explicitly setting the return type to `_`, which resulted in incorrect corresponding syntax (as `|| -> _ x` is not valid, without the enclosing brackets). This meant the generated code, when printed, was invalid.

I also took the opportunity to slightly improve the generated code for the `RustcEncodable::encode` method for unit structs.

Fixes #42213.
2018-03-27 07:16:29 +00:00
kennytm 8d57071cbb Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakis
Stabilize termination_trait, split out termination_trait_test

For #48453.

First time contribution, so I'd really appreciate any feedback on how this PR can be better.

Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25 01:26:32 +08:00
varkor 0d278ca6a8 Use FunctionRetTy::Default rather than an explicit TyKind::Infer for lambda-building
This prevents explicit `-> _` return type annotations for closures generated by `lambda`.
2018-03-22 15:55:57 +00:00
kennytm 8d3f3f0cac Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebank
address some FIXME whose associated issues were marked as closed

part of #44366
2018-03-22 22:43:37 +08:00
Tyler Mandry c5c650d670 Split out termination_trait_test feature gate 2018-03-19 00:26:41 -05:00
Vadim Petrochenkov b057c554ab AST: Make renames in imports closer to the source
Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
2018-03-17 22:12:21 +03:00
Niv Kaminer 2c6b7b9323 remove FIXME(#2543) and avoid bad copies 2018-03-17 20:24:49 +02:00
John Kåre Alsaker b74e97cf42 Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
Manish Goregaokar b52b33a386 Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddyb
Termination trait in tests

Support the `Termination` trait in unit tests (cc https://github.com/rust-lang/rust/issues/43301)

Also, a drive-by fix for #47075.

This is joint work with @bkchr.
2018-02-24 12:47:58 -08:00
Niko Matsakis 067c2e3d03 handle #[bench] functions better 2018-02-22 20:09:10 -05:00
Niko Matsakis e446f706a8 put the "unit test" logic into libtest
Also make `std::termination` module public and rename feature.

The lib feature needs a different name from the language feature.
2018-02-22 17:56:24 -05:00
Niko Matsakis 0625d4c282 begin crate-relative paths with crate 2018-02-22 17:31:37 -05:00
Niko Matsakis 1eab1b19a3 support unit tests with return values that implement Terminaton
Extend `Termination` trait with a method to determine what happens
with a unit test.

This commit incorporates work by Bastian Köcher <git@kchr.de>.
2018-02-22 17:31:37 -05:00
Seiichi Uchida d6bdf296a4 Change ast::Visibility to Spanned type 2018-02-18 00:10:40 +09:00
John Kåre Alsaker 9a8d6b8bb5 Do not capture stderr in the compiler. Instead just panic silently for fatal errors 2018-01-26 04:52:30 +01:00
Seiichi Uchida d882691046 Prefer to use attr::contains_name() and attr::find_by_name() 2017-12-28 12:32:24 +09:00
Jonas Platte 78493ed21a Add GenericParam, refactor Generics in ast, hir, rustdoc
The Generics now contain one Vec of an enum for the generic parameters,
rather than two separate Vec's for lifetime and type parameters.

Additionally, places that previously used Vec<LifetimeDef> now use
Vec<GenericParam> instead.
2017-12-21 13:38:10 +01:00
Vadim Petrochenkov a4aa26aaa0 syntax: Rename P::unwrap into P::into_inner 2017-12-17 02:21:29 +03:00
Jeffrey Seyfried 9c7969d3df Use hygiene to access the injected crate (core or std) from builtin macros. 2017-12-09 17:22:07 -08:00
Pietro Albini 91ba8b42fc Implement RFC 2128 (use_nested_groups)
This commit adds support for nested groups inside `use` declarations,
such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-30 13:10:26 +01:00
Vadim Petrochenkov 3da868dcb6 Make fields of Span private 2017-08-30 01:38:54 +03:00
Tamir Duberstein 0463566f27 syntax: clarify field name
The value of this field is meant to indicate whether or not the
crate is rustc's libtest itself - not whether or not it is a test
crate generally.
2017-08-25 16:13:02 -04:00
Tamir Duberstein f2fb45723a syntax: remove unused field 2017-08-25 16:01:14 -04:00
Zack M. Davis 1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Eduard-Mihai Burtescu 8a4facc3c3 syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros. 2017-08-12 09:14:50 +03:00
Alex Crichton 9b2f7624ec syntax: Add tokens: Option<TokenStream> to Item
This commit adds a new field to the `Item` AST node in libsyntax to optionally
contain the original token stream that the item itself was parsed from. This is
currently `None` everywhere but is intended for use later with procedural
macros.
2017-07-28 07:58:20 -07:00
Kevin Mehall 17bd76a516 Remove unused code from librustc_errors 2017-07-06 18:49:32 -07:00
Paul Woolcock 60dd83ea85 add allow_fail test attribute
This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.
2017-06-24 06:42:29 -04:00
Vadim Petrochenkov caecb76f08 Turn sufficiently old compatibility lints into hard errors 2017-05-30 22:00:30 +03:00
Jeffrey Seyfried 7fdc1fb2e4 Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
Jeffrey Seyfried 1f175fa35d Hygienize librustc_resolve. 2017-05-25 05:51:50 +00:00
Andre Bogus a9c163ebe9 Fix some clippy warnings in libsyntax
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-12 20:05:39 +02:00
Guillaume Gomez d5863e9985 Add Options type in libtest and remove argument 2017-05-05 10:52:10 +02:00
Jeffrey Seyfried ec7c0aece1 Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
Oliver Schneider eb447f4ef4 Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
Vadim Petrochenkov 32575a0487 Give spans to individual path segments in AST 2017-03-10 08:21:45 -08:00
Guillaume Gomez 62fb7fc54a Switch logic to Span instead of HashMap 2017-02-03 11:08:20 +01:00
Scott Olson a9f8f98caa Rename ExprKind::Vec to Array in HIR and HAIR.
This is a clearer name since they represent [a, b, c] array literals.
2017-01-16 00:45:51 -08:00
Jeffrey Seyfried f10f50b426 Refactor how global paths are represented (for both ast and hir). 2016-12-22 06:14:35 +00:00
Jeffrey Seyfried 8e61ff25d8 Optimize ast::PathSegment. 2016-12-19 20:57:00 +00:00
Eduard Burtescu 9aaf26e7aa rustc: rework stability to be on-demand for type-directed lookup. 2016-11-28 04:18:11 +02:00
Jeffrey Seyfried e85a0d70b8 Use Symbol instead of InternedString in the AST, HIR, and various other places. 2016-11-21 09:00:55 +00:00
Jeffrey Seyfried d2f8fb0a0a Move syntax::util::interner -> syntax::symbol, cleanup. 2016-11-20 23:40:20 +00:00
Jeffrey Seyfried a2626410d7 Refactor MetaItemKind to use Names instead of InternedStrings. 2016-11-20 11:46:06 +00:00
Josh Driver d6689fdc61 Add warnings when the #[should_panic] attribute is invalid 2016-11-14 22:22:17 +10:30