about summary refs log tree commit diff
path: root/src/libsyntax_pos/symbol.rs
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-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-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-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-81/+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-81/+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-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-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-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-6/+5
2019-09-28Upgrade async/await to "used" keywords.Eric Huss-4/+4
2019-09-24reserve `impl<T> From<!> for T`Ariel Ben-Yehuda-0/+1
this is necessary for never-type stabilization
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-15/+12
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-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-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
2019-09-04Remove hashing impls for `LocalInternedString`.Nicholas Nethercote-1/+1
2019-09-04Remove `LocalInternedString::get`.Nicholas Nethercote-9/+0
It has a single use, which is easily changed to something better.
2019-09-04Remove `LocalInternedString::as_interned_str()`.Nicholas Nethercote-6/+0
It's unused.
2019-08-30Add a "diagnostic item" schemeOliver Scherer-1/+4
This allows lints and other diagnostics to refer to items by a unique ID instead of relying on whacky path resolution schemes that may break when items are relocated.
2019-08-29Rollup merge of #63945 - Centril:recover-mut-pat, r=estebankMazdak Farrokhzad-0/+5
Recover `mut $pat` and other improvements - Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes https://github.com/rust-lang/rust/issues/63764. - Recover on e.g. `let mut mut x;` - Recover on e.g. `let keyword` and `let keyword(...)`. - Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.
2019-08-27Add default serialization for `Ident`sMatthew Jasper-2/+22
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
2019-08-27Simplify with Symbol/Token::is_book_lit.Mazdak Farrokhzad-0/+5
2019-08-18Auto merge of #61708 - dlrobertson:or-patterns-0, r=centrilbors-0/+1
Initial implementation of or-patterns An incomplete implementation of or-patterns (e.g. `Some(0 | 1)` as a pattern). This patch set aims to implement initial parsing of `or-patterns`. Related to: #54883 CC @alexreg @varkor r? @Centril
2019-08-17initial implementation of or-pattern parsingDan Robertson-0/+1
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`. This is a partial implementation of RFC 2535.
2019-08-17Stop emulating cross-crate hygiene with gensymsMatthew Jasper-21/+3
Most `Ident`s are serialized as `InternedString`s the exceptions are: * Reexports * Attributes * Idents in macro definitions Using gensyms helped reexports emulate hygiene. However, the actual item wouldn't have a gensymmed name so would be usable cross-crate. So removing this case until we have proper cross-crate hygiene seems sensible. Codegen attributes (`inline`, `export_name`) are resolved by their `Symbol`. This meant that opaque macro-expanded codegen attributes could cause linker errors. This prevented making built-in derives hygienic.
2019-08-16Rollup merge of #63613 - petrochenkov:stdhyg, r=alexcrichtonMazdak Farrokhzad-1/+0
Hygienize use of built-in macros in the standard library Same as https://github.com/rust-lang/rust/pull/61629, but for built-in macros. Closes https://github.com/rust-lang/rust/issues/48781 r? @alexcrichton
2019-08-15Remove `__rust_unstable_column`Vadim Petrochenkov-1/+0
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-5/+5
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-15syntax_pos: Introduce a helper for checking whether a span comes from expansionVadim Petrochenkov-2/+1
2019-08-11add basic lint testing for misuse of mem::zeroed and mem::uninitializedRalf Jung-0/+3
2019-08-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-1/+0
infrastructure to elsewhere
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-1/+1
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-02Replace "existential" by "opaque"varkor-1/+0
2019-08-02Switch existential_type to type_alias_impl_traitvarkor-0/+1