about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-09-30Rollup merge of #64838 - GuillaumeGomez:long-err-explanation-e0550, r=oli-obkTyler Mandry-1/+19
Add long error explanation for E0550 Part of #61137
2019-09-30syntax: Support modern attribute syntax in the `meta` matcherVadim Petrochenkov-46/+64
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-19/+28
2019-09-30Stabilize proc macros in type positionsVadim Petrochenkov-5/+5
2019-09-30Stabilize macros in `extern` blocksVadim Petrochenkov-15/+3
Add some tests for macros in extern blocks, remove duplicate tests
2019-09-30Add long error explanation for E0550Guillaume Gomez-1/+19
2019-09-30Auto merge of #64778 - csmoe:index, r=eddybbors-5/+5
Introduce librustc_index crate Closes #50592
2019-09-30syntax: reduce repetition in fn parsing.Mazdak Farrokhzad-26/+21
2019-09-30syntax: stylistic cleanup in item parsing.Mazdak Farrokhzad-107/+47
2019-09-30syntax: fuse more code paths together.Mazdak Farrokhzad-48/+51
2019-09-30syntax: extract `error_on_invalid_abi`.Mazdak Farrokhzad-14/+17
2019-09-30syntax: cleanup `parse_visibility`.Mazdak Farrokhzad-53/+69
2019-09-30syntax: misc cleanupMazdak Farrokhzad-44/+30
2019-09-30syntax: cleanup `parse_fn_decl`.Mazdak Farrokhzad-6/+3
2019-09-30syntax: reorder param parsing to make more sense.Mazdak Farrokhzad-153/+153
2019-09-30syntax refactor `parse_self_param` (5)Mazdak Farrokhzad-22/+21
2019-09-30syntax refactor `parse_self_param` (4)Mazdak Farrokhzad-30/+37
2019-09-30syntax refactor `parse_self_param` (3)Mazdak Farrokhzad-28/+20
2019-09-30syntax refactor `parse_self_param` (2)Mazdak Farrokhzad-11/+16
2019-09-30syntax refactor `parse_self_param` (1)Mazdak Farrokhzad-12/+13
2019-09-30syntax refactor `parse_fn_params`Mazdak Farrokhzad-28/+29
2019-09-30syntax: `is_named_argument` -> `is_named_param`.Mazdak Farrokhzad-2/+2
2019-09-30syntax: cleanup method parsing.Mazdak Farrokhzad-74/+66
2019-09-30Added backticks for one diagnostic message.Alexander Regueiro-1/+1
2019-09-29Rollup merge of #64894 - Centril:fix-64682, r=petrochenkovMazdak Farrokhzad-76/+41
syntax: fix dropping of attribute on first param of non-method assocated fn Fixes #64682. The general idea is that we bake parsing of `self` into `parse_param_general` and then we just use standard list parsing. Overall, this simplifies the parsing and makes it more consistent. r? @petrochenkov cc @c410-f3r
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-4/+3
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-1/+2
2019-09-29syntax: fix #64682.Mazdak Farrokhzad-76/+41
Fuse parsing of `self` into `parse_param_general`.
2019-09-29syntax: recover trailing `|` in or-patterns.Mazdak Farrokhzad-26/+79
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-5/+2
r=michaelwoerister No StableHasherResult everywhere This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping. This is done for two reasons: * we should avoid false "generic" dependency on the result of StableHasher * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too. * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-29Rollup merge of #63492 - eddyb:cvarargs, r=nagisa,matthewjasperMazdak Farrokhzad-15/+21
Remove redundancy from the implementation of C variadics. This cleanup was first described in https://github.com/rust-lang/rust/issues/44930#issuecomment-497163539: * AST doesn't track `c_variadic: bool` anymore, relying solely on a trailing `CVarArgs` type in fn signatures * HIR doesn't have a `CVarArgs` anymore, relying solely on `c_variadic: bool` * same for `ty::FnSig` (see tests for diagnostics improvements from that) * `{hir,mir}::Body` have one extra argument than the signature when `c_variadic == true` * `rustc_typeck` and `rustc_mir::{build,borrowck}` need to give that argument the right type (which no longer uses a lifetime parameter, but a function-internal scope) * `rustc_target::abi::call` doesn't need special hacks anymore (since it never sees the `VaListImpl` now, it's all inside the body) r? @nagisa / @rkruppe cc @dlrobertson @oli-obk
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-5/+2
2019-09-28syntax: don't keep a redundant c_variadic flag in the AST.Eduard-Mihai Burtescu-15/+21
2019-09-27Filter out stmts made for the redundant_semicolon lint when pretty-printingnathanwhit-3/+12
2019-09-27Auto merge of #64813 - varkor:node-to-kind, r=Centrilbors-298/+295
Rename `*.node` to `*.kind`, and `hair::Pattern*` to `hair::Pat*` In both `ast::Expr` and `hir::Expr`: - Rename `Expr.node` to `Expr.kind`. - Rename `Pat.node` to `Pat.kind`. - Rename `ImplItem.node` to `ImplItem.kind`. - Rename `Lit.node` to `Lit.kind`. - Rename `TraitItem.node` to `TraitItem.kind`. - Rename `Ty.node` to `Ty.kind`. - Rename `Stmt.node` to `Stmt.kind`. - Rename `Item.node` to `Item.kind`. - Rename `ForeignItem.node` to `ForeignItem.kind`. - Rename `MetaItem.node` to `MetaItem.kind`. Also: - Rename `hair::FieldPattern` to `hair::FieldPat`. - Rename `hair::PatternKind` to `hair::PatKind`. - Rename `hair::PatternRange` to `hair::PatRange`. - Rename `PatternContext` to `PatCtxt`. - Rename `PatternTypeProjection` to `PatTyProj`. - Rename `hair::Pattern` to `hair::Pat`. These two sets of changes are grouped together to aid with merging. The only changes are renamings. r? @petrochenkov
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-35/+35
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-13/+13
2019-09-26Rename `Item.node` to `Item.kind`varkor-28/+28
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-40/+40
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-37/+37
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-11/+11
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-15/+15
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-13/+13
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-39/+39
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-70/+67
For both `ast::Expr` and `hir::Expr`.
2019-09-26Rollup merge of #64783 - onehr:onehrxn, r=varkorMazdak Farrokhzad-1/+7
Fix issue #64732 Based on issue #64732, when creating a byte literal with single quotes, the suggestion message would indicate that you meant to write a `str` literal, but we actually meant to write a byte string literal. So I changed the unescape_error_reporting.rs to decide whether to print out "if you meant to write a `str` literal, use double quotes", or "if you meant to write a byte string literal, use double quotes". Fixes #64732.
2019-09-26Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakisbors-1/+4
reserve `impl<T> From<!> for T` this is necessary for never-type stabilization. cc #57012 #35121 I think we wanted a crater run for this @nikomatsakis? r? @nikomatsakis
2019-09-25Fix issue #64732Haoran Wang-1/+7
Based on issue #64732, when creating a byte literal with single quotes, the suggestion message would indicate that you meant to write a `str` literal, but we actually meant to write a byte string literal. So I changed the unescape_error_reporting.rs to decide whether to print out "if you meant to write a `str` literal, use double quotes", or "if you meant to write a byte string literal, use double quotes".
2019-09-25Rollup merge of #64764 - Mark-Simulacrum:snap, r=CentrilMazdak Farrokhzad-1/+0
Master is now 1.40 r? @pietroalbini
2019-09-25Rollup merge of #64759 - matklad:simplify-macro, r=petrochenkovMazdak Farrokhzad-48/+18
Refactor mbe a tiny bit