about summary refs log tree commit diff
path: root/src/librustc/ich/impls_syntax.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-149/+0
2020-03-18Properly handle Spans that reference imported SourceFilesAaron Hill-5/+3
Previously, metadata encoding used DUMMY_SP to represent any spans that referenced an 'imported' SourceFile - e.g. a SourceFile from an upstream dependency. These leads to sub-optimal error messages in certain cases (see the included test). This PR changes how we encode and decode spans in crate metadata. We encode spans in one of two ways: * 'Local' spans, which reference non-imported SourceFiles, are encoded exactly as before. * 'Foreign' spans, which reference imported SourceFiles, are encoded with the CrateNum of their 'originating' crate. Additionally, their 'lo' and 'high' values are rebased on top of the 'originating' crate, which allows them to be used with the SourceMap data encoded for that crate. The `ExternalSource` enum is renamed to `ExternalSourceKind`. There is now a struct called `ExternalSource`, which holds an `ExternalSourceKind` along with the original line number information for the file. This is used during `Span` serialization to rebase spans onto their 'owning' crate.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-07Remove HashStable impl for ast::LifetimeJohn Kåre Alsaker-7/+0
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-3/+2
2020-01-04hir::{hir,def,itemlikevisit,pat_util,print} -> rustc_hirMazdak Farrokhzad-10/+8
Also fix fallout wrt. HashStable.
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-10/+10
2019-12-22Format the worldMark Rousskov-31/+22
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-2/+1
2019-11-23Derive HashStable for TokenKind.Camille GILLOT-66/+1
2019-11-23Rename StableHashingContextLike to HashStableContext.Camille GILLOT-2/+2
2019-11-22Retire impl_stable_hash_for.Camille GILLOT-1/+6
2019-11-22Retire impl_stable_hash_for_spanned.Camille GILLOT-2/+0
2019-11-22Derives for ast.Camille GILLOT-17/+0
2019-11-22Invert implementations for TokenKind.Camille GILLOT-49/+9
Also export a bunch of Token-related impls.
2019-11-22Export HashStable for DelimSpan, Lit and Path.Camille GILLOT-15/+0
2019-11-22Derive HashStable_Generic for ExpnData.Camille GILLOT-11/+0
2019-11-22Invert flow in impl HashStable of Span.Camille GILLOT-1/+0
2019-11-22Add StableHashingContextLike to HashStable_Generic derive.Camille GILLOT-0/+4
2019-11-17HashStable_Generic for librustc_target.Camille GILLOT-23/+0
2019-11-17HashStable_Generic for libsyntax_pos.Camille GILLOT-48/+0
2019-11-17HashStable literals in libsyntax.Camille GILLOT-19/+0
2019-11-17Further HashStable_Generic derives.Camille GILLOT-47/+0
2019-11-17Move impl HashStable for Symbol in libsyntax_pos.Camille GILLOT-20/+1
2019-11-17Move impl HashStable for SymbolStr in libsyntax_pos.Camille GILLOT-19/+0
2019-11-17Use proc_macro for HashStable derive in libsyntax.Camille GILLOT-33/+0
2019-11-10Merge hir::ImplPolarity into ast::ImplPolarity.Camille GILLOT-0/+1
2019-11-10Merge hir::IsAuto into ast::IsAuto.Camille GILLOT-0/+1
2019-11-10Merge hir::CaptureClause into ast::CaptureBy.Camille GILLOT-0/+1
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-0/+1
2019-11-08Rollup merge of #66190 - eddyb:primflt, r=CentrilYuki Okushi-1/+0
rustc_target: inline abi::FloatTy into abi::Primitive. This effectively undoes a small part of @oli-obk's #50967, now that the rest of the compiler doesn't use the `FloatTy` definition from `rustc_target`, post-#65884.
2019-11-07rustc_target: inline abi::FloatTy into abi::Primitive.Eduard-Mihai Burtescu-1/+0
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-2/+2
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-3/+7
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-14/+11
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-02Rename `LocalInternedString` as `SymbolStr`.Nicholas Nethercote-7/+7
It makes the relationship with `Symbol` clearer. The `Str` suffix matches the existing `Symbol::as_str()` method nicely, and is also consistent with it being a wrapper of `&str`.
2019-10-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-0/+1
Add new EFIAPI ABI Fixes #54527 Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI. Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-25Add new EFIAPI ABIroblabla-0/+1
Adds a new ABI for the EFIAPI calls. This ABI should reflect the latest version of the UEFI specification at the time of commit (UEFI spec 2.8, URL below). The specification says that for x86_64, we should follow the win64 ABI, while on all other supported platforms (ia32, itanium, arm, arm64 and risc-v), we should follow the C ABI. To simplify the implementation, we will simply follow the C ABI on all platforms except x86_64, even those technically unsupported by the UEFI specification. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
2019-10-25Rollup merge of #65074 - Rantanen:json-byte-pos, r=matkladMazdak Farrokhzad-0/+19
Fix the start/end byte positions in the compiler JSON output Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output. This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one. The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions. Fixes #65029
2019-10-21Fix the start/end byte positions in the compiler JSON outputMikko Rantanen-0/+19
2019-10-21Remove `InternedString`.Nicholas Nethercote-9/+10
By using `LocalInternedString` instead for the few remaining uses.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-6/+7
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-37/+12
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-1/+1
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-1/+1
2019-09-07Support "soft" feature-gating using a lintVadim Petrochenkov-1/+2
Use it for feature-gating `#[bench]`