about summary refs log tree commit diff
path: root/src/librustc_ast
AgeCommit message (Collapse)AuthorLines
2020-05-01Rollup merge of #71762 - tshepang:typo, r=jonas-schievinkDylan DPC-1/+1
doc: this resulted in a link pointing to a non-existent target
2020-05-01doc: this resulted in a link pointing to a non-existent targetTshepang Lekhonkhobe-1/+1
2020-05-01doc: reference does not exist, probably a typoTshepang Lekhonkhobe-1/+1
2020-04-20Rollup merge of #71284 - JOE1994:serialize_id, r=petrochenkovDylan DPC-4/+4
fix -Zast-json to output correct JSON form fixes #71086 (Reverts some of the changes made in #70215) JSON output (from an empty library) after fix has something for **"id"** field ```shell lonelyjoe@lonelyjoe-desktop:~/workspace/empty_lib/src$ rustc lib.rs -Zast-json ``` ```json { "module":{ "inner":{ "lo":0, "hi":94 }, "items":[ { "attrs":[ { "kind":{ "variant":"Normal", "fields":[ { "path":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"prelude_import", "span":{ "lo":0, "hi":0 } }, "id":3, "args":null } ] }, "args":"Empty" } ] }, "id":null, "style":"Outer", "span":{ "lo":0, "hi":0 } } ], "id":4, "span":{ "lo":0, "hi":0 }, "vis":{ "node":"Inherited", "span":{ "lo":0, "hi":0 } }, "ident":{ "name":"", "span":{ "lo":0, "hi":0 } }, "kind":{ "variant":"Use", "fields":[ { "prefix":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"{{root}}", "span":{ "lo":0, "hi":0 } }, "id":5, "args":null }, { "ident":{ "name":"std", "span":{ "lo":0, "hi":0 } }, "id":6, "args":null }, { "ident":{ "name":"prelude", "span":{ "lo":0, "hi":0 } }, "id":7, "args":null }, { "ident":{ "name":"v1", "span":{ "lo":0, "hi":0 } }, "id":8, "args":null } ] }, "kind":"Glob", "span":{ "lo":0, "hi":0 } } ] }, "tokens":null }, { "attrs":[ { "kind":{ "variant":"Normal", "fields":[ { "path":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"macro_use", "span":{ "lo":0, "hi":0 } }, "id":9, "args":null } ] }, "args":"Empty" } ] }, "id":null, "style":"Outer", "span":{ "lo":0, "hi":0 } } ], "id":10, "span":{ "lo":0, "hi":0 }, "vis":{ "node":"Inherited", "span":{ "lo":0, "hi":0 } }, "ident":{ "name":"std", "span":{ "lo":0, "hi":0 } }, "kind":{ "variant":"ExternCrate", "fields":[ null ] }, "tokens":null } ], "inline":true }, "attrs":[ ], "span":{ "lo":0, "hi":94 }, "proc_macros":[ ] } ```
2020-04-19fix decode logic for 'AttrId' to be symmetric with encode logicJOE1994-2/+2
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-6/+8
2020-04-18Move `MapInPlace` to rustc_data_structuresYuki Okushi-112/+1
2020-04-17fix -Zast-json to properly output the 'id' fieldJOE1994-2/+2
2020-04-06Rollup merge of #70519 - estebank:constraints-before-args-spans, r=CentrilMazdak Farrokhzad-2/+2
Tweak output of type params and constraints in the wrong order r? @Centril @varkor
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+0
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-3/+3
2020-03-29Suggest correct order for arguments when encountering early constraintsEsteban Küber-2/+2
When encountering constraints before type arguments or lifetimes, suggest the correct order.
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-15/+30
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-17/+17
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-25make bit_width return u64, consistently with other sizes in the compilerRalf Jung-3/+3
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-65/+10
2020-03-23Auto merge of #70296 - Centril:rollup-wvfmb3n, r=Centrilbors-1/+1
Rollup of 9 pull requests Successful merges: - #69251 (#[track_caller] in traits) - #69880 (miri engine: turn error sanity checks into assertions) - #70207 (Use getentropy(2) on macos) - #70227 (Only display definition when suggesting a typo) - #70236 (resolve: Avoid "self-confirming" import resolutions in one more case) - #70248 (parser: simplify & remove unused field) - #70249 (handle ConstKind::Unresolved after monomorphizing) - #70269 (remove redundant closures (clippy::redundant_closure)) - #70270 (Clean up E0449 explanation) Failed merges: r? @ghost
2020-03-23Auto merge of #70204 - Centril:unshackled-lowering, r=Zoxcbors-0/+36
Liberate `rustc_ast_lowering` from `rustc` The whole point of this PR is the very last commit, in which we remove `rustc` as one of `rustc_ast_lowering`'s dependencies, thereby improving `./x.py` parallelism and working towards https://github.com/rust-lang/rust/issues/65031. Noteworthy: - From `rustc::arena` we move logic into `arena`, in particular `declare_arena!`. This is then used in `rustc_ast_lowering` so that lowering has its own separate arena. - Some linting code is unfortunately moved to `rustc_session::lint` cause its used both in `rustc_lint` and `rustc_ast_lowering`, and this is their common dependency. - `rustc_session::CrateDisambiguator` is moved into `rustc_ast` so that `rustc::hir::map::definitions` can be moved into `rustc_hir`, so that `rustc_ast_lowering` can stop referring to `rustc::hir`. r? @Zoxc
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-1/+1
2020-03-21move CrateDisambiguator -> rustc_astMazdak Farrokhzad-0/+36
2020-03-21ast: Compress `AttrId` from `usize` to `u32`Vadim Petrochenkov-18/+12
Also stop encoding/decoding it entirely
2020-03-20can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-5/+14
2020-03-18Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obkMazdak Farrokhzad-1/+3
Make methods declared by `newtype_index` macro `const` Crates that use the macro to define an `Idx` type need to enable `#![feature(const_if_match, const_panic)]`.
2020-03-18de-fatalize outline module parsingMazdak Farrokhzad-1/+1
2020-03-17Add requisite feature gates for const assertDylan MacKenzie-0/+2
2020-03-17Rename `from_u32_const` -> `from_u32`Dylan MacKenzie-1/+1
2020-03-16ast/hir: `MacroDef::legacy` -> `MacroDef::macro_rules`Vadim Petrochenkov-2/+2
2020-03-15Rollup merge of #69988 - petrochenkov:nomacrodef, r=CentrilMazdak Farrokhzad-1/+1
rustc_metadata: Remove `rmeta::MacroDef` And other related cleanups. Follow-up to https://github.com/rust-lang/rust/pull/66364. r? @Centril
2020-03-15Rollup merge of #69589 - petrochenkov:maccall, r=CentrilMazdak Farrokhzad-46/+46
ast: `Mac`/`Macro` -> `MacCall` It's now obvious that these refer to macro calls rather than to macro definitions. It's also a single name instead of two different names in different places. `rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls. cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513 r? @eddyb
2020-03-14rustc_metadata: Remove `rmeta::MacroDef`Vadim Petrochenkov-1/+1
Use `ast::MacroDef` instead. Also remove `Session::imported_macro_spans`, external macros have spans now.
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-46/+46
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-3/+3
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-12Rollup merge of #69722 - estebank:negative-impl-span-ast, r=CentrilMazdak Farrokhzad-2/+2
Tweak output for invalid negative impl AST errors Use more accurate spans for negative `impl` errors. r? @Centril
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-2/+2
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-1/+1
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-2/+2
2020-03-10more reuse in block parsing & improve diagnostics.Mazdak Farrokhzad-0/+10
2020-03-09Address review commentsVadim Petrochenkov-5/+14
2020-03-09Use `Token::uninterpolate` in couple more places matching on `(Nt)Ident`Vadim Petrochenkov-35/+24
2020-03-09rustc_ast: Introduce `Token::uninterpolate`Vadim Petrochenkov-2/+18
2020-03-09rustc_ast: Introduce `Token::uninterpolated_span`Vadim Petrochenkov-0/+34
2020-03-06fix various typosMatthias Krüger-2/+2
2020-03-06Auto merge of #69586 - petrochenkov:unmerge, r=Centrilbors-57/+117
ast: Unmerge structures for associated items and foreign items Follow-up to https://github.com/rust-lang/rust/pull/69194. r? @Centril
2020-03-04Tweak output for invalid negative impl AST errorsEsteban Küber-2/+2
2020-03-03Auto merge of #69506 - Centril:stmt-semi-none, r=petrochenkovbors-7/+8
encode `;` stmt without expr as `StmtKind::Empty` Instead of encoding `;` statements without a an expression as a tuple in AST, encode it as `ast::StmtKind::Empty`. r? @petrochenkov
2020-03-01Rename `syntax` in librustc_ast/README.mdLeSeulArtichaut-1/+1
2020-03-01encode `;` stmt w/o expr as `StmtKind::Empty`Mazdak Farrokhzad-7/+8
2020-03-01ast: Implement `TryFrom<ItemKind>` for associated and foreign itemsVadim Petrochenkov-0/+29
2020-03-01ast: Unmerge structures for associated items and foreign itemsVadim Petrochenkov-57/+88
2020-02-29Make it build againVadim Petrochenkov-2/+2