about summary refs log tree commit diff
path: root/src/libsyntax/ext/build.rs
AgeCommit message (Collapse)AuthorLines
2018-03-17AST: Make renames in imports closer to the sourceVadim Petrochenkov-6/+5
Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
2018-02-24Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddybManish Goregaokar-7/+3
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-22begin crate-relative paths with `crate`Niko Matsakis-7/+3
2018-02-18Replace dummy spans with empty spansSeiichi Uchida-2/+2
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-2/+2
2018-01-30stabilize match_beginning_vertJonathan Goodman-1/+0
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-1/+6
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-1/+1
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-3/+3
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-0/+1
Do not emit type errors on recovered blocks When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user. Fix #44579.
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-0/+1
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-1/+1
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-14Use PathBuf instead of String where applicableOliver Schneider-1/+1
2017-12-09Use hygiene to access the injected crate (`core` or `std`) from builtin macros.Jeffrey Seyfried-1/+4
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-19/+22
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-09-01Implement RFC 1925Matt Ickstadt-1/+2
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-29/+29
Like #43008 (f668999), but _much more aggressive_.
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-2/+4
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-27Give span to angle bracketed generic argumentsVadim Petrochenkov-14/+7
2017-07-27Discern between `Path` and `Path<>` in ASTVadim Petrochenkov-12/+8
2017-07-25Switch to begin_panic againest31-1/+1
In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-2/+1
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-0/+6
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-0/+6
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-5/+6
2017-07-02Output line column info when panickingest31-5/+6
2017-06-26Implement `quote!` and other `proc_macro` API.Jeffrey Seyfried-1/+1
2017-05-25Hygienize lifetimes.Jeffrey Seyfried-6/+6
2017-05-02Removal pass for anonymous parametersest31-1/+1
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685.
2017-03-10Give spans to individual path segments in ASTVadim Petrochenkov-7/+12
2017-02-03Bump version, upgrade bootstrapAlex Crichton-1/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-01-17Auto merge of #39110 - petrochenkov:sum, r=eddybbors-28/+4
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring `ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them. The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality. The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided. The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`. This is the first part of https://github.com/rust-lang/rust/issues/39085#issuecomment-272743755 and https://github.com/rust-lang/rust/issues/39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later. r? @eddyb
2017-01-17Use resizable Vec instead of P<[T]> in ASTVadim Petrochenkov-21/+4
2017-01-17AST/HIR: Merge ObjectSum and PolyTraitRefVadim Petrochenkov-7/+0
2017-01-16Rename ExprKind::Vec to Array in HIR and HAIR.Scott Olson-1/+1
This is a clearer name since they represent [a, b, c] array literals.
2017-01-11syntax: struct field attributes and cfgBenjamin Saunders-1/+7
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-5/+9
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-2/+6
2016-12-20Rollup merge of #38171 - jseyfried:cleanup, r=nrcAlex Crichton-17/+14
Miscellaneous cleanup/refactoring in `resolve` and `syntax::ext` r? @nrc
2016-12-19Optimize `ast::PathSegment`.Jeffrey Seyfried-17/+14
2016-12-06Don't perform span mangling when building field/tup access nodesSean Griffin-15/+3
There are no guarantees that the two spans used to create the new one come from the same place or are even valid. Fixes #36081.
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-1/+1
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-9/+7
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-3/+2
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-8/+8
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-8/+8
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-30/+15
2016-10-31Changed most vec! invocations to use square bracesiirelu-16/+16
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-27Implement field shorthands in struct literal expressions.Eduard Burtescu-1/+1