about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-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-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]
2015-03-31rollup merge of #23549: aturon/stab-numAlex Crichton-9/+11
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Auto merge of #23549 - aturon:stab-num, r=alexcrichtonbors-9/+11
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Stabilize std::numAaron Turon-9/+11
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-31Lex binary and octal literals more eagerly.Huon Wilson-14/+39
Previously 0b12 was considered two tokens, 0b1 and 2, as 2 isn't a valid base 2 digit. This patch changes that to collapse them into one (and makes `0b12` etc. an error: 2 isn't a valid base 2 digit). This may break some macro invocations of macros with `tt` (or syntax extensions) that rely on adjacent digits being separate tokens and hence is a [breaking-change] The fix is to separate the tokens, e.g. `0b12` -> `0b1 2`. cc https://github.com/rust-lang/rfcs/pull/879
2015-03-30Implement new type-checking strategy for binary operators. Basically,Niko Matsakis-22/+6
the plan is to treat all binary operators as if they were overloaded, relying on the fact that we have impls for all the builtin scalar operations (and no more). But then during writeback we clear the overload if the types correspond to a builtin op. This strategy allows us to avoid having to know the types of the operands ahead of time. It also avoids us overspecializing as we did in the past.
2015-03-29Port of pcwalton removal of `#[unsafe_destructor]` check.Felix S. Klock II-12/+6
Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check. ---- So remove the check for the unsafe_destructor attribute. And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe. In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated. However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.) ---- I consider this to: Fix #22196 (techincally there is still the post snapshot work of removing the last remants of the feature and the attribute, but the ticket can still be closed in my opinion).
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-7/+7
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-7/+7
2015-03-27rollup merge of #23786: alexcrichton/less-quotesAlex Crichton-38/+11
Conflicts: src/test/auxiliary/static-function-pointer-aux.rs src/test/auxiliary/trait_default_method_xc_aux.rs src/test/run-pass/issue-4545.rs
2015-03-27rollup merge of #23794: brson/slicegateAlex Crichton-0/+9
Conflicts: src/test/run-pass/issue-13027.rs
2015-03-27Feature gate *all* slice patterns. #23121Brian Anderson-0/+9
Until some backwards-compatibility hazards are fixed in #23121, these need to be unstable. [breaking-change]
2015-03-27Merge 'richo/unquote-crates' into less-quotesAlex Crichton-1/+1
Conflicts: src/libsyntax/parse/parser.rs
2015-03-27Unquote all crate names without underscoresRicho Healey-3/+3
2015-03-27rustc: Remove support for hyphens in crate namesAlex Crichton-37/+10
This commit removes parser support for `extern crate "foo" as bar` as the renamed crate is now required to be an identifier. Additionally this commit enables hard errors on crate names that contain hyphens in them, they must now solely contain alphanumeric characters or underscores. If the crate name is inferred from the file name, however, the file name `foo-bar.rs` will have the crate name inferred as `foo_bar`. If a binary is being emitted it will have the name `foo-bar` and a library will have the name `libfoo_bar.rlib`. This commit is a breaking change for a number of reasons: * Old syntax is being removed. This was previously only issuing warnings. * The output for the compiler when input is received on stdin is now `rust_out` instead of `rust-out`. * The crate name for a crate in the file `foo-bar.rs` is now `foo_bar` which can affect infrastructure such as logging. [breaking-change]
2015-03-27rollup merge of #23749: alexcrichton/remove-old-impl-checkAlex Crichton-11/+0
Conflicts: src/libsyntax/feature_gate.rs