about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-04-10Simplifications to statement macro handling.Christopher Chambers-37/+12
SmallVector::pop no longer worries about converting a Many repr downward to One or Zero. expand_stmt makes use of `if let` for style purposes.
2015-04-10Eliminates a pointless is_empty test.Christopher Chambers-1/+1
2015-04-10Improves semicolon expansion efficiency, corrects bt_pop placement.Christopher Chambers-16/+51
Implements pop() on SmallVector, and uses it to expand the final semicolon in a statement macro expansion more efficiently. Corrects the placement of the call to fld.cx.bt_pop(). It must run unconditionally to reverse the corresponding push.
2015-04-10fix some comments.Felix S. Klock II-6/+7
2015-04-10Incorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.Felix S. Klock II-13/+38
remove out of date fixme.
2015-04-10Re-add a fixme after some investigation into what's going on.Felix S. Klock II-0/+11
2015-04-10Change `derive` expansions to use `discriminant_value` intrinsic.Felix S. Klock II-30/+27
Fix #15523.
2015-04-10Add a new `span_suggestion` infrastructure. This lets you edit a snippetNiko Matsakis-1/+65
of text (perhaps obtained by span_snippet) and then splice that edited form back into the original file in the form of a suggestion.
2015-04-10Modify the codemap code to use more slices and to information aboutNiko Matsakis-40/+133
columns within a line, not just the line numbers. Also try to clarify and use the term `line_index` when 0-based.
2015-04-10Replace the use of the rather randomly named boolean `custom` to meanNiko Matsakis-30/+37
"highlight end" and instead add a variant to `RenderSpan`
2015-04-10Rollup merge of #24225 - nrc:for-span, r=pnkfelixManish Goregaokar-1/+1
2015-04-09Fix the span for `for` expressionsNick Cameron-1/+1
2015-04-09Debug impls for a few things in syntax::codemapNick Cameron-0/+12
2015-04-08Auto merge of #24144 - richo:ptr-formatter, r=alexcrichtonbors-0/+7
~~I believe this should fix the issue. Opening a PR to ensure noone duplicates effort, I'm running check now.~~ Closes #24091
2015-04-08Auto merge of #23998 - nrc:impl-self, r=nikomatsakisbors-41/+2
Closes #23909 r? @nikomatsakis (or anyone else, really)
2015-04-07alloc: impl fmt::Pointer for Rc, Arc and BoxRicho Healey-0/+7
Closes #24091
2015-04-07Improves handling of statement macros.Christopher Chambers-44/+75
Statement macros are now treated somewhat like item macros, in that a statement macro can now expand into a series of statements, rather than just a single statement. This allows statement macros to be nested inside other kinds of macros and expand properly, where previously the expansion would only work when no nesting was present. See: src/test/run-pass/macro-stmt_macro_in_expr_macro.rs src/test/run-pass/macro-nested_stmt_macro.rs This changes the interface of the MacResult trait. make_stmt has become make_stmts and now returns a vector, rather than a single item. Plugin writers who were implementing MacResult will have breakage, as well as anyone using MacEager::stmt. See: src/libsyntax/ext/base.rs This also causes a minor difference in behavior to the diagnostics produced by certain malformed macros. See: src/test/compile-fail/macro-incomplete-parse.rs
2015-04-06Provide context for macro expansions which result in unparsed tokens.Will Hipschman-0/+17
Issue #22425
2015-04-05Add comments suggested by NikoPhil Dawes-27/+9
2015-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-1312/+1405
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
2015-04-03Validate export_name attributeSimonas Kazlauskas-0/+17
2015-04-03Check uses of `Self` in impls in the compiler rather than during expansionNick Cameron-41/+2
Closes #23909
2015-04-03Auto merge of #23974 - pnkfelix:fix-23973, r=alexcrichtonbors-0/+6
Do not suggest `#![feature(...)]` if we are in beta or stable channel. Fix #23973
2015-04-02Revise logic to match `rustc::session::config::get_unstable_features_setting`Felix S. Klock II-8/+2
2015-04-02Auto merge of #23877 - richo:gardening, r=Manishearthbors-11/+22
I also wanted to unignore https://github.com/rust-lang/rust/blob/master/src/libsyntax/ext/expand.rs#L1768-L1777 since the issue it references is closed, but the test fails, and it's internals aren't super clear to me.
2015-04-02Do not suggest `#![feature(...)]` if we are in beta or stable channel.Felix S. Klock II-0/+12
Fix #23973
2015-04-02Fix parsing of patterns in macrosVadim Petrochenkov-1/+3
2015-04-02syntax: Rewrite parsing of patternsVadim Petrochenkov-225/+127
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-1/+1
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-27/+27
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-4/+10
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-1/+1
Conflicts: src/libcore/num/mod.rs
2015-04-01rollup merge of #23948: nikomatsakis/feature-gate-rust-abiAlex Crichton-3/+9
Like it says. r? @alexcrichton
2015-04-01fallout when bootstrapping `rustc`.Felix S. Klock II-3/+3
2015-04-01added unary_negate feature gate.Felix S. Klock II-0/+6
2015-04-01Feature gate rust-call ABI.Niko Matsakis-3/+9
2015-04-02Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichtonManish Goregaokar-7/+12
Basically stuff I did for unqualified assoc types which is worth landing by itself.
2015-04-01cleanup: Test formattingRicho Healey-11/+22
2015-04-01Fallout in libsyntaxNiko Matsakis-27/+27
2015-04-01Fallout in libsyntax/librustc: use newtype'd options for linked lists,Niko Matsakis-5/+16
since `Option` is not fundamental and hence the old impls run afoul of the orphan rules.
2015-04-01Implement the changes to coherence such that we consider a type to beNiko Matsakis-0/+6
local only if matches `FUNDAMENTAL(LocalType)`, where `FUNDAMENTAL` includes `&T` and types marked as fundamental (which includes `Box`). Also apply these tests to negative reasoning.
2015-04-01Pretty print ids for assoc itemsNick Cameron-7/+12
2015-03-31rollup merge of #23288: alexcrichton/issue-19470Alex Crichton-20/+3
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). Closes #19470 [breaking-change]
2015-03-31Test fixes and rebase conflicts, round 2Alex Crichton-11/+0
2015-03-31rollup merge of #23875: aturon/revise-convert-2Alex Crichton-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change] r? @alexcrichton
2015-03-31Test fixes and rebase conflicts, round 1Alex Crichton-1/+1
2015-03-31rollup merge of #23872: huonw/eager-lexingAlex Crichton-15/+40
Conflicts: src/libsyntax/parse/lexer/mod.rs
2015-03-31rustc: Remove old_orphan_check entirelyAlex Crichton-17/+0
2015-03-31std: Remove #[old_orphan_check] from PartialEqAlex Crichton-3/+3
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). cc #19470 [breaking-change]
2015-03-31Stabilize `std::convert` and related codeAaron Turon-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]