about summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
AgeCommit message (Collapse)AuthorLines
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-1/+1
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-03-18Require braces when a closure has an explicit return type. This is aNiko Matsakis-2/+3
[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`. Fixes #23420.
2015-03-16Auto merge of #23331 - eddyb:attr-lookahead, r=nikomatsakisbors-9/+5
Most of the changes are cleanup facilitated by straight-forward attribute handling. This is a minor [breaking-change] for users of `quote_stmt!` (returns `Option<P<Stmt>>` now) and some of the public methods in `Parser` (a few `Vec<Attribute>` arguments/returns were removed). r? @nikomatsakis
2015-03-13rm unused importManish Goregaokar-1/+0
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-9/+5
passing the latter around.
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-1/+1
2015-03-05Rollup merge of #22764 - ivanradanov:fileline_help, r=huonwManish Goregaokar-1/+1
When warnings and errors occur, the associated help message should not print the same code snippet. https://github.com/rust-lang/rust/issues/21938
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-13/+15
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-04Encode codemap and span information in crate metadata.Michael Woerister-110/+44
This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.
2015-03-03Change span_help calls to fileline_help where appropriateIvan Radanov Ivanov-1/+1
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-6/+6
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-1/+1
2015-02-22Fix errors from #22592Manish Goregaokar-4/+4
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-6/+6
where possible.
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-12/+12
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-12/+12
2015-02-18For now, accept the `i`, `u`, `is`, and `us` suffixes, but warn whenNiko Matsakis-11/+4
they are used without a feature-gate. This is both kinder to existing code and should make it easier to land this PR, since we don't have to catch EVERY SINGLE SUFFIX.
2015-02-18Modify parser to require `isize`/`usize` suffixes.Niko Matsakis-4/+13
2015-02-07Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichtonbors-4/+4
It's in order to make the code more homogeneous.
2015-02-06librustdoc has been updatedGuillaumeGomez-4/+4
Fixes run build error Fix test failure Fix tests' errors
2015-02-06Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnikManish Goregaokar-1/+1
The spelling corrections were made in both documentation comments and regular comments.
2015-02-05make codemap more robust in face of ill-formed spans.Felix S. Klock II-2/+2
This can be considered partial work on #8256. The main observable change: macro expansion sometimes results in spans where `lo > hi`; so for now, when we have such a span, do not attempt to return a snippet result. (Longer term, we might think about whether we could still present a snippet for the cases where this arises, e.g. perhaps by showing the whole macro as the snippet, assuming that is the sole cause of such spans; or by somehow looking up the closest AST node that holds both `lo` and `hi`, and showing that.) As a drive-by, revised the API to return a `Result` rather than an `Option`, with better information-packed error value that should help us (and maybe also our users) identify the causes of such problems in the future. Ideally the call-sites that really want an actual snippet would be updated to catch the newly added `Err` case and print something meaningful about it, but that is not part of this PR.
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-8/+8
2015-02-04Fix for misspelled comments.Joseph Crail-1/+1
The spelling corrections were made in both documentation comments and regular comments.
2015-02-04remove all kind annotations from closuresJorge Aparicio-5/+5
2015-02-02rollup merge of #21842: alexcrichton/issue-21839Alex Crichton-2/+2
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-1/+1
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21825: kmcallister/ttdelim-spanAlex Crichton-0/+23
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-02-02Omit integer suffix when unnecessaryAlfie John-5/+5
See PR # 21378 for context
2015-02-01std: Remove extra type params on iter adaptorsAlex Crichton-2/+2
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-01-31Fix end of TtDelimited spanKeegan McAllister-0/+23
2015-01-31Kill more `isize`sTobias Bucher-1/+1
2015-01-30std: Stabilize FromStr and parseAlex Crichton-4/+4
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-2/+2
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-2/+2
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29Rollup merge of 21662 - oli-obk:hashmap_enum_json, r=alexcrichtonManish Goregaokar-1/+1
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-1/+1
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-26Make '-A warnings' apply to all warnings, including feature gate warningsBrian Anderson-1/+1
2015-01-26Fallout of io => old_ioAlex Crichton-1/+1
2015-01-26falloutOliver Schneider-1/+1
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-12/+10
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21tests: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-8/+8
2015-01-21rollup merge of #21463: sanxiyn/demutAlex Crichton-1/+1
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-26/+26
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-12/+10
2015-01-21De-mut the parserSeo Sanghyeon-1/+1
2015-01-20Test fixes and rebase conflictsAlex Crichton-3/+1
2015-01-21Rollup merge of #21336 - rylev:better-nofile-error, r=brsonBarosl LEE-2/+3
Contribution from @look! Addresses https://github.com/rust-lang/rust/issues/21329
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-6/+6