about summary refs log tree commit diff
path: root/src/librustc_ast_passes
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-2372/+0
2020-08-22Auto merge of #74566 - lzutao:guard, r=petrochenkovbors-2/+5
Gate if-let guard feature Enhanced on #74315. That PR is in crater queue so I don't want to push to it. Close #74232 cc #51114
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-5/+6
2020-08-12Flip order of const & typekadmin-1/+1
2020-08-10Auto merge of #74953 - JulianKnodt:master, r=lcnrbors-7/+11
Remove restriction on type parameters preceding consts w/ feature const-generics Removed the restriction on type parameters preceding const parameters when the feature const-generics is enabled. Builds on #74676, which deals with unsorted generic parameters. This just lifts the check in lowering the AST to HIR that permits consts and types to be reordered with respect to each other. Lifetimes still must precede both This change is not intended for min-const-generics, and is gated behind the `#![feature(const_generics)]`. One thing is that it also permits type parameters without a default to come after consts, which I expected to not work, and was hoping to get more guidance on whether that should be permitted or how to prevent it otherwise. I did not go through the RFC process for this pull request because there was prior work to get this feature added. In the previous PR that was cited, work was done to enable this change. r? @lcnr
2020-08-09Change Ord impl for ParamKindOrdkadmin-1/+0
Updated tests and error msgs Update stderr from test Update w/ lcnr comments Change some tests around, and also updated Ord implementation for ParamKindOrd Update w/ nits from lcnr
2020-08-09Switched to unordered field in ParamKindOrdkadmin-2/+6
Run fmt
2020-08-09Add ParamKindOrd::ConstUnordered variantkadmin-2/+1
2020-08-09Blessed old test where error message had changedkadmin-4/+1
Added minor fmt change to ast_validation
2020-08-09Test lifetimes after types after consts forbiddenkadmin-6/+6
Added more complex test and changed error message
2020-08-09Added +1 test for only works w/ feat const genkadmin-2/+5
Added this test to ensure that reordering the parameters only works with the feature const generics enabled. Fixed nits Also added another test to verify that intermixed lifetimes are forbidden
2020-08-08Gate to if-let guard featureLzu Tao-2/+5
2020-08-08Auto merge of #74932 - nnethercote:rm-ast-session-globals, r=petrochenkovbors-41/+39
Remove `librustc_ast` session globals By moving the data onto `Session`. r? @petrochenkov
2020-08-08Rm restriction on ord of default types w/ constskadmin-1/+2
2020-08-08Allow types to come after consts in AST validationjulianknodt-0/+1
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-41/+39
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-08-05impl reviewBastian Kauschke-1/+1
2020-08-05add min_const_generics feature gateBastian Kauschke-4/+11
2020-08-04rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`Vadim Petrochenkov-2/+2
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
2020-08-02Replace from log to tracing in libsrustrustc_ast_lowering, ↵bishtpawan-2/+2
librustc_ast_passes, librustc_ast_pretty
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-23tweak wordingBastian Kauschke-1/+1
Co-authored-by: varkor <github@varkor.com>
2020-07-22require type defaults to be after const generic parametersBastian Kauschke-6/+19
as if this is currently possible. HA!
2020-07-16Revert "Remove spotlight usage"Manish Goregaokar-0/+1
This reverts commit 13c6d5819aae3c0de6a90e7f17ea967bf4487cbb.
2020-06-23Record span of `const` kw in GenericParamKindAyaz Hafiz-3/+3
Context: this is needed to fix https://github.com/rust-lang/rustfmt/issues/4263, which currently records the span of a const generic param incorrectly because the location of the `const` kw is not known. I am not sure how to add tests for this; any guidance in how to do so would be appreciated :slightly_smiling_face:
2020-06-09[AVR] Add AVR platform supportJake Goulding-0/+8
2020-05-17Disallow forbidden usage of non-ascii identifiers.Charles Lew-2/+37
2020-05-14Minor fixes to commentsJOE1994-1/+1
* In 'src/librustc_ast_passes/node_count.rs' * typo fix ('rought' -> 'rough') * In 'src/librustc_middle/middle/region.rs', * fixed broken link to 'rustc-dev-guide' * typo fix ('aluded' -> 'alluded') Thank you for reviewing this PR :)
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-3/+4
2020-05-04Add docstring to `deny_equality_constraints`Esteban Küber-0/+2
2020-05-04On incorrect equality constraint likely to be assoc type, suggest ↵Esteban Küber-11/+83
appropriate syntax When encountering `where <A as Foo>::Bar = B`, it is possible that `Bar` is an associated type. If so, suggest `where A: Foo<Bar = B>`. CC #20041.
2020-04-13allow const generics in const fnBastian Kauschke-24/+1
2020-04-06Rollup merge of #70519 - estebank:constraints-before-args-spans, r=CentrilMazdak Farrokhzad-14/+55
Tweak output of type params and constraints in the wrong order r? @Centril @varkor
2020-04-05Reduce the visual clutterEsteban Küber-2/+7
Using a single label for constraints and generic arguments.
2020-04-05review comments: use `partition_map`Esteban Küber-21/+13
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-8/+6
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-29review comment: wordingEsteban Küber-8/+1
2020-03-29Suggest correct order for arguments when encountering early constraintsEsteban Küber-21/+35
When encountering constraints before type arguments or lifetimes, suggest the correct order.
2020-03-28Suggest correct order for args and constraintsEsteban Küber-0/+23
2020-03-28Point at all constraints before argsEsteban Küber-14/+28
2020-03-27add the label back but make it shorterMazdak Farrokhzad-1/+2
2020-03-27address some review commentsMazdak Farrokhzad-5/+1
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-12/+48
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-2/+2
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26Rollup merge of #70424 - lcnr:nit, r=CentrilMazdak Farrokhzad-5/+1
simplify match stmt We actually have a surprising amount of ```rust match expr { $($p:pat)|+ => true, _ => false, } ``` While I would prefer this to be replaced with `matches!`, most cases are fairly readable anyway so we can just let them be for now.
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-5/+5
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-26simplify match stmtBastian Kauschke-5/+1
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-3/+3
2020-03-21Rollup merge of #70032 - lcnr:issue69970, r=varkorDylan DPC-0/+2
put type params in front of const params in generics_of fixes #69970 r? @varkor
2020-03-19sort generic param order in generics_ofBastian Kauschke-0/+2