about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-02-26Auto merge of #48082 - jseyfried:improve_struct_field_hygiene, r=petrochenkovbors-1/+1
macros: improve struct constructor field hygiene, fix span bug Fixes #47311. r? @nrc
2018-02-25Fix find_width_of_character_at_span bounds checkRyan Cumming-8/+11
Commit 0bd96671f0 added bounds checking of our current target byte position to prevent infinite loops. Unfortunately it was comparing the file-relative `target` versus the global relative `file_start_pos` and `file_end_pos`. The result is failing to detect multibyte characters unless their file-relative offset fit within their global offset. This causes other parts of the compiler to generate spans pointing to the middle of a multibyte character which will ultimately panic in `bytepos_to_file_charpos`. Fix by comparing the `target` to the total file size when moving forward and doing checked subtraction when moving backwards. This should preserve the intent of the bounds check while removing the offset confusion. Fixes #48508
2018-02-24Rollup merge of #48490 - petrochenkov:orpat, r=eddybManish Goregaokar-32/+46
Implement multiple patterns with `|` in `if let` and `while let` (RFC 2175) cc https://github.com/rust-lang/rust/issues/48215
2018-02-24Rollup merge of #48481 - Manishearth:dyn-paren, r=petrochenkovManish Goregaokar-5/+9
Allow parentheses in `dyn (Trait)` r? @eddyb @nikomatsakis
2018-02-24Rollup merge of #48441 - petrochenkov:exty, r=estebankManish Goregaokar-1/+1
Fix parsing of extern paths in types and poly-traits Fixes https://github.com/rust-lang/rust/issues/48262
2018-02-24Rollup merge of #48356 - estebank:unsafe-without-braces, r=nikomatsakisManish Goregaokar-0/+2
When encountering invalid token after `unsafe`, mention `{` Fix #37158.
2018-02-24Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddybManish Goregaokar-52/+149
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-24Rollup merge of #48084 - cramertj:impl-trait-errors, r=nikomatsakisManish Goregaokar-69/+1
Error on nested impl Trait and path projections from impl Trait cc #34511 r? @nikomatsakis
2018-02-24Implement multiple patterns with `|` in `if let` and `while let`Vadim Petrochenkov-32/+46
2018-02-23parse `dyn (Foo)` as a trait objectManish Goregaokar-5/+9
2018-02-23Rollup merge of #48429 - toidiu:patch-1, r=nikomatsakisManish Goregaokar-1/+1
update tracking issue for nll Point to the new tracing issue for nll For reference https://github.com/rust-lang/rust/issues/44928
2018-02-23Rollup merge of #48083 - ↵Manish Goregaokar-5/+3
jseyfried:improve_tuple_struct_field_access_hygiene, r=petrochenkov Improve tuple struct field access hygiene Fixes #47312 by fixing a span bug. r? @nrc
2018-02-23Auto merge of #47799 - topecongiro:fix-span-of-visibility, r=petrochenkovbors-63/+100
Fix span of visibility This PR 1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`. 2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`. This PR is motivated by the bug found in rustfmt (https://github.com/rust-lang-nursery/rustfmt/issues/2398). The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
2018-02-22handle `#[bench]` functions betterNiko Matsakis-19/+43
2018-02-22remove tokenstreamNiko Matsakis-1/+0
2018-02-22Implement --remap-path-prefixJeremy Fitzhardinge-1/+1
Remove experimental -Zremap-path-prefix-from/to, and replace it with the stabilized --remap-path-prefix=from=to variant. This is an implementation for issue of #41555.
2018-02-22put the "unit test" logic into libtestNiko Matsakis-36/+24
Also make `std::termination` module public and rename feature. The lib feature needs a different name from the language feature.
2018-02-22begin crate-relative paths with `crate`Niko Matsakis-10/+9
2018-02-22support unit tests with return values that implement `Terminaton`Niko Matsakis-42/+129
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-23Fix parsing of extern paths in types and poly-traitsVadim Petrochenkov-1/+1
2018-02-22update tracking issue for nlltoidiu-1/+1
Point to the new tracing issue for nll
2018-02-20make `#[unwind]` attribute specify expectations more clearlyNiko Matsakis-1/+73
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
2018-02-20stage0 cfg cleanupMark Simulacrum-1/+0
2018-02-19When encountering invalid token after `unsafe`, mention `{`Esteban Küber-0/+2
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-4/+4
fix more typos found by codespell.
2018-02-17Fix span bug.Jeffrey Seyfried-1/+1
2018-02-17fix more typos found by codespell.Matthias Krüger-4/+4
2018-02-18Fix up tests and typosSeiichi Uchida-2/+2
2018-02-18Replace dummy spans with empty spansSeiichi Uchida-13/+13
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-68/+95
2018-02-18Add a span field to Visibility::RestrictedSeiichi Uchida-6/+15
This span covers the whole visibility expression: e.g. `pub (in path)`.
2018-02-18Add a closing parenthesis to the span of Visibility::CrateSeiichi Uchida-2/+3
2018-02-16Remove unneeded string allocationsAlex Crawford-4/+4
2018-02-14Rollup merge of #48167 - Mark-Simulacrum:remove-allocation-codemap, r=estebankkennytm-3/+5
Remove allocation from width of character function. Locally this seems to eliminate the problem or at least resolve most of the issue. Fixes #48153. r? @estebank
2018-02-14Rollup merge of #48154 - estebank:issue-31481, r=nikomatsakiskennytm-5/+16
Continue parsing function after finding `...` arg When encountering a variadic argument in a function definition that doesn't accept it, if immediately after there's a closing paren, continue parsing as normal. Otherwise keep current behavior of emitting error and stopping. Fix #31481.
2018-02-14Rollup merge of #48130 - ollie27:stab, r=Mark-Simulacrumkennytm-1/+1
Correct a few stability attributes * `core_float_bits`, `duration_core`, `path_component_asref`, and `repr_align` were stabalized in 1.25.0 not 1.24.0. * Impls for `NonNull` involving unstable things should remain unstable. * `Duration` should remain stable since 1.3.0 so it appears correctly in the `std` docs. * `cursor_mut_vec` is an impl on only stable things so should be marked stable.
2018-02-13Make nested impl Trait a hard errorTaylor Cramer-69/+1
2018-02-12Remove allocation from width of character function.Mark Simulacrum-3/+5
2018-02-11Continue parsing function after finding `...` argEsteban Küber-5/+16
When encountering a variadic argument in a function definition that doesn't accept it, if immediately after there's a closing paren, continue parsing as normal. Otherwise keep current behavior of emitting error and stopping.
2018-02-11Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakisbors-53/+177
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
2018-02-10Correct a few stability attributesOliver Middleton-1/+1
2018-02-08Use the right tracking issueMark Mansi-3/+1
2018-02-08Fix span bug.Jeffrey Seyfried-5/+3
2018-02-08Add `rustc_args_required_const` to the feature whitelistAlex Crichton-0/+5
Unfortunately left out it means that when the `#![feature(proc_macro)]` flag is in effect it fails to find `rustc_args_required_const` for expansion. This version, however, is verified to work with stdsimd's requirements!
2018-02-07libsyntax/ext: trailing commas in builtin macrosMichael Lamparski-2/+4
Most notably this changes 'syntax::ext::base::get_single_str_from_tts' to accept a trailing comma, and revises the documentation so that this aspect is not surprising. I made this change under the understanding that this crate is private rustc implementation detail (I hope this is correct!). After reviewing all call sites, I believe the revised semantics are closer to the intended spirit of the function.
2018-02-07Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakisManish Goregaokar-17/+14
Add filtering options to `rustc_on_unimplemented` - Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments. - Add a way to provide custom notes. - Tweak binops text. - Add filter to detect wether `Self` is local or belongs to another crate. - Add filter to `Iterator` diagnostic for `&str`. Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.
2018-02-05Stabilize use_nested_groupsPietro Albini-26/+2
2018-02-04Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, ↵kennytm-18/+4
r=petrochenkov Stabilize feature(match_beginning_vert) With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm. Reference PR: rust-lang-nursery/reference#231 Closes #44101
2018-02-03Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakisbors-0/+1
Generator bugfixes r? @nikomatsakis
2018-02-02Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, ↵kennytm-12/+19
r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902