summary refs log tree commit diff
path: root/src/libsyntax_pos
AgeCommit message (Collapse)AuthorLines
2019-11-01Rollup merge of #65902 - gilescope:issue62570, r=estebankTyler Mandry-0/+1
Make ItemContext available for better diagnositcs Fix #62570
2019-10-30Make ItemContext available for better diagnositcs.Giles Cope-0/+1
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-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-17/+78
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-25RFC 2008: StabilizationDavid Wood-1/+1
This commit stabilizes RFC 2008 (#44109) by removing the feature gate. Signed-off-by: David Wood <david@davidtw.co>
2019-10-23Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddybMazdak Farrokhzad-115/+5
Remove `InternedString` This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places. r? @eddyb
2019-10-23Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakisbors-0/+1
Object safe for dispatch cc #43561
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-0/+1
These are a squashed series of commits.
2019-10-21Fix the start/end byte positions in the compiler JSON outputMikko Rantanen-17/+78
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-1/+1
2019-10-21Remove `InternedString`.Nicholas Nethercote-115/+5
By using `LocalInternedString` instead for the few remaining uses.
2019-10-18Remove `Copy` and `Clone` impls for `LocalInternedString`.Nicholas Nethercote-3/+3
They aren't used.
2019-10-18Change how `Symbol::Debug` works.Nicholas Nethercote-1/+1
Currently, `Symbol::Debug` and `Symbol::Display` produce the same output; neither wraps the symbol in double quotes. This commit changes `Symbol::Debug` so it wraps the symbol in quotes. This change brings `Symbol`'s behaviour in line with `String` and `InternedString`. The change requires a couple of trivial test output adjustments.
2019-10-18Use `with` in `Symbol` trait methods.Nicholas Nethercote-3/+3
Instead of `as_str()`, which unnecessarily involves `LocalInternedString`.
2019-10-15Rollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkovTyler Mandry-88/+9
Remove last uses of gensyms Underscore bindings now use unique `SyntaxContext`s to avoid collisions. This was the last use of gensyms in the compiler, so this PR also removes them. closes #49300 cc #60869 r? @petrochenkov
2019-10-15Remove gensymsMatthew Jasper-88/+9
2019-10-15Rollup merge of #65426 - ↵Mazdak Farrokhzad-24/+0
nnethercote:rm-custom-LocalInternedString-PartialEq-impls, r=petrochenkov Remove custom `PartialEq` impls for `LocalInternedString`. This is on-trend with the recent changes simplifying `LocalInternedString` and reducing its use. r? @petrochenkov
2019-10-15Stabilize proc macros generating `macro_rules` itemsVadim Petrochenkov-1/+1
2019-10-15Remove custom `PartialEq` impls for `LocalInternedString`.Nicholas Nethercote-24/+0
This is on-trend with the recent changes simplifying `LocalInternedString` and reducing its use.
2019-10-13Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichtonMazdak Farrokhzad-0/+1
Split non-CAS atomic support off into target_has_atomic_load_store This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s: * `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations). * ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS). cc #32976 r? @alexcrichton
2019-10-08Split non-CAS atomic support off into target_has_atomic_load_storeAmanieu d'Antras-0/+1
2019-10-07[RFC 2091] Add #[track_caller] attribute.Ayose-0/+1
- The attribute is behind a feature gate. - Error if both #[naked] and #[track_caller] are applied to the same function. - Error if #[track_caller] is applied to a non-function item. - Error if ABI is not "rust" - Error if #[track_caller] is applied to a trait function. Error codes and descriptions are pending.
2019-10-07Add feature gate for raw_dylib.Charles Lew-0/+2
2019-10-07Auto merge of #64906 - Aaron1011:feature/extern-const-fn, r=Centrilbors-0/+1
Add support for `const unsafe? extern fn` This works just as you might expect - an `const extern fn` is a `const fn` that is callable from foreign code. Currently, panicking is not allowed in `const`s. When https://github.com/rust-lang/rfcs/pull/2345 (https://github.com/rust-lang/rust/issues/51999) is stabilized, then panicking in an `const extern fn` will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime. Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary. This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well. Tracking issue: https://github.com/rust-lang/rust/issues/64926.
2019-10-03proc_macro: Add `Span::mixed_site` exposing `macro_rules` hygieneVadim Petrochenkov-0/+6
2019-10-02Add support for 'extern const fn'Aaron Hill-0/+1
This works just as you might expect - an 'extern const fn' is a 'const fn' that is callable from foreign code. Currently, panicking is not allowed in consts. When RFC 2345 is stabilized, then panicking in an 'extern const fn' will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime. Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary. This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.
2019-10-01Add `rustc_peek` support for `IndirectlyMutableLocals`Dylan MacKenzie-0/+1
2019-10-01Rollup merge of #64907 - alexreg:tidy-up, r=Mark-SimulacrumMazdak Farrokhzad-16/+15
A small amount of tidying-up factored out from PR #64648 As requested by @Mark-Simulacrum, I put this in a separate commit to make it easier to review. (As far as I can tell, no violations of the policy here, and they are simply in a separate PR because they're not directly related to the import of that PR.) r? @Mark-Simulacrum
2019-09-30Fixed weird non-sequential indices for serialisation of `SourceFile` type.Alexander Regueiro-16/+15
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-6/+6
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-6/+6
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-28Upgrade async/await to "used" keywords.Eric Huss-4/+4
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-6/+6
2019-09-24reserve `impl<T> From<!> for T`Ariel Ben-Yehuda-0/+1
this is necessary for never-type stabilization
2019-09-17Rollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkovTyler Mandry-0/+32
Print out more information for `-Zunpretty=expanded,hygiene` I've found this helpful when trying to understand how hygiene works. Closes #16420
2019-09-17Print syntax contexts and marks when printing hygiene informationMatthew Jasper-0/+32
2019-09-15Auto merge of #64483 - petrochenkov:expectattr2, r=Centrilbors-0/+7
resolve: Tweak some "cannot find" wording for macros
2019-09-15resolve: Tweak "cannot find" wording for attributesVadim Petrochenkov-0/+7
2019-09-15Remove `with_legacy_ctxt`Matthew Jasper-7/+0
2019-09-15Give more `Idents` spansMatthew Jasper-1/+1
2019-09-07Support "soft" feature-gating using a lintVadim Petrochenkov-0/+1
Use it for feature-gating `#[bench]`
2019-09-07Rollup merge of #63919 - matthewjasper:remove-gensymmed, r=petrochenkovMazdak Farrokhzad-18/+57
Use hygiene for AST passes AST passes are now able to have resolve consider their expansions as if they were opaque macros defined either in some module in the current crate, or a fake empty module with `#[no_implicit_prelude]`. * Add an ExpnKind for AST passes. * Remove gensyms in AST passes. * Remove gensyms in`#[test]`, `#[bench]` and `#[test_case]`. * Allow opaque macros to define tests. * Move tests for unit tests to their own directory. * Remove `Ident::{gensym, is_gensymed}` - `Ident::gensym_if_underscore` still exists. cc #60869, #61019 r? @petrochenkov
2019-09-05Add `with_{def_site,call_site,legacy}_ctxt,` methods to `Span`Vadim Petrochenkov-1/+20
Use these to create call-site spans for AST passes when needed.
2019-09-05Remove `Ident::{gensym, is_gensymed}`Matthew Jasper-15/+12
`gensym_if_underscore` still exists. The symbol interner can still create arbitray gensyms, this is just not exposed publicly.
2019-09-05Allow ast passes to create hygienic spansMatthew Jasper-1/+1
2019-09-05Add an ExpnKind for AST passesMatthew Jasper-1/+24
2019-09-04Add `Symbol::{with,with2}`.Nicholas Nethercote-13/+29
And remove the `unsafe` blocks, they're not necessary. Also rewrite `InternedString::{with,with2}` to use the new functions. Finally, add some comments about the speed of the `as_str()`/`as_interned_str()` functions.
2019-09-04Remove `LocalInternedString::intern`.Nicholas Nethercote-13/+0
2019-09-04Remove `Encodable`/`Decodable` impls for `LocalInternedString`.Nicholas Nethercote-12/+0