about summary refs log tree commit diff
path: root/src/libsyntax_pos/symbol.rs
AgeCommit message (Collapse)AuthorLines
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
2019-08-02libsyntax_pos: Unconfigure tests during normal buildVadim Petrochenkov-36/+3
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-1/+1
2019-07-19Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwcobors-0/+1
resolve: Improve candidate search for unresolved macro suggestions Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names. The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around). This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086. r? @davidtwco
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-0/+1
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-18resolve: Visit all scopes to collect suggestion candidates for unresolved macrosVadim Petrochenkov-0/+1
2019-07-11Remove feature gate `dropck_parametricity` completelyLzu Tao-1/+0
Therefore we also remove `#[unsafe_destructor_blind_to_params]` attribute completly.
2019-07-11hygiene: Introduce a helper method for creating new expansionsVadim Petrochenkov-0/+2
Creating a fresh expansion and immediately generating a span from it is the most common scenario. Also avoid allocating `allow_internal_unstable` lists for derive markers repeatedly. And rename `ExpnInfo::with_unstable` to `ExpnInfo::allow_unstable`, seems to be a better fitting name.
2019-07-07syntax: Add feature gate.David Wood-0/+1
This commit adds a `const_in_array_repeat_expressions` feature gate and only create `Candidate::Repeat` if it is enabled.
2019-07-07Rollup merge of #62213 - QuietMisdreavus:cfg-doctest, r=GuillaumeGomezMazdak Farrokhzad-0/+2
rustdoc: set cfg(doctest) when collecting doctests Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR. As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.) Tracking issue: https://github.com/rust-lang/rust/issues/62210
2019-07-07syntax: Pre-intern names of all built-in macrosVadim Petrochenkov-1/+19
They always end up interned anyway
2019-07-06rustdoc: set cfg(doctest) when collecting doctestsQuietMisdreavus-0/+2
2019-07-06`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`Vadim Petrochenkov-1/+1
2019-07-06`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`Vadim Petrochenkov-1/+1
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-0/+4
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk