about summary refs log tree commit diff
path: root/src/libsyntax_pos
AgeCommit message (Collapse)AuthorLines
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-5794/+0
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`
2019-12-29Auto merge of #67614 - Mark-Simulacrum:global-callbacks, r=Zoxcbors-5/+6
Set callbacks globally This sets the callbacks from syntax and rustc_errors just once, utilizing static (rather than thread-local) storage.
2019-12-27core: add IntoFuture trait and support for awaitSean McArthur-0/+2
2019-12-25Store callbacks in global staticsMark Rousskov-5/+6
The callbacks have precisely two states: the default, and the one present throughout almost all of the rustc run (the filled in value which has access to TyCtxt). We used to store this as a thread local, and reset it on each thread to the non-default value. But this is somewhat wasteful, since there is no reason to set it globally -- while the callbacks themselves access TLS, they do not do so in a manner that fails in when we do not have TLS to work with.
2019-12-24Deprecate Error::description for realDavid Tolnay-5/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-23Introduce `#![feature(bindings_after_at)]`.Mazdak Farrokhzad-0/+1
Under the gate, `x @ Some(y)` is allowed. This is subject to various restrictions for soundness.
2019-12-22Format the worldMark Rousskov-492/+502
2019-12-20recover on 'mut', 'var', 'auto'Mazdak Farrokhzad-0/+1
2019-12-15Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obkbors-0/+1
Enable `loop` and `while` in constants behind a feature flag This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways. `while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user. r? @oli-obk cc @rust-lang/wg-const-eval
2019-12-13Add feature gate for `const_loop`Dylan MacKenzie-0/+1
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+1
functions with a `const` modifier
2019-12-08async/await: more improvements to non-send errorsDavid Wood-0/+2
Signed-off-by: David Wood <david@davidtw.co>
2019-12-06Rollup merge of #66606 - christianpoveda:mut-refs-in-const-fn, r=oli-obkMazdak Farrokhzad-0/+1
Add feature gate for mut refs in const fn r? @oli-obk
2019-12-05Rollup merge of #67010 - estebank:raw-idents, r=CentrilMazdak Farrokhzad-0/+6
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
2019-12-04Auto merge of #66275 - oli-obk:organize-intrinsics-promotion-checks, r=RalfJungbors-0/+29
Organize intrinsics promotion checks cc @vertexclique supersedes #61835 r? @RalfJung
2019-12-03Accurately portray raw identifiers in error messagesEsteban Küber-0/+6
When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
2019-12-03Rollup merge of #66651 - Areredify:on-unimplemented-scope, r=davidtwcoMazdak Farrokhzad-0/+1
Add `enclosing scope` parameter to `rustc_on_unimplemented` Adds a new parameter to `#[rustc_on_unimplemented]`, `enclosing scope`, which highlights the function or closure scope with a message. The wip part refers to adding this annotation to `Try` trait to improve ergonomics (which I don't know how to do since I change both std and librustc) Closes #61709.
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-0/+29
2019-12-02Rename feature gateChristian Poveda-1/+1
2019-12-02Add feature gate for &mut in const fnsChristian Poveda-0/+1
2019-12-01Conditional compilation for sanitizersTomasz Miąsko-0/+2
Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
2019-11-25add `enclosing_scope` param to `rustc_on_unimplmented`Mikhail Babenko-0/+1
add ui test compute enclosing_scope_span on demand add scope test make tidy happy stylistic and typo fixes
2019-11-25Auto merge of #66279 - cjgillot:hashstable, r=Zoxcbors-6/+207
Use proc-macro to derive HashStable everywhere Hello, A second proc-macro is added to derive HashStable for crates librustc depends on. This proc-macro `HashStable_Generic` (to bikeshed) allows to decouple code and strip much of librustc's boilerplate. Still, two implementations `Span` and `TokenKind` require to be placed in librustc. The latter only depends on the `bug` macro. Advise welcome on how to sever that link. A trait `StableHasingContextLike` has been introduced at each crate root, in order to handle those implementations which require librustc's very `StableHashingContext`. This overall effort allowed to remove the `impl_stable_hash_for` macro. Each commit passes the `x.py check`. I still have to double check there was no change in the implementation.
2019-11-25Auto merge of #66671 - matthewjasper:ast-address-of, r=Centrilbors-0/+2
Ast address-of This is the parts of #64588 that don't affect MIR. If an address-of expression makes it to MIR lowering we error and lower to the best currently expressible approximation to limit further errors. r? @Centril
2019-11-24Parse and feature gate raw address of expressionsMatthew Jasper-0/+2
2019-11-24rustc_plugin: Remove support for syntactic pluginsVadim Petrochenkov-2/+0
2019-11-23Rollup merge of #61351 - GuillaumeGomez:stabilize-cfg-rustdoc, r=QuietMisdreavusMazdak Farrokhzad-1/+0
Stabilize cfg(doc) cc #43781.
2019-11-23Implement HashStable for Span in libsyntax_pos.Camille GILLOT-10/+90
2019-11-23Move CachingSourceMapView to libsyntax_pos.Camille GILLOT-0/+105
2019-11-23Rename StableHashingContextLike to HashStableContext.Camille GILLOT-2/+2
2019-11-23Auto merge of #66507 - ecstatic-morse:const-if-match, r=oli-obkbors-0/+1
Enable `if` and `match` in constants behind a feature flag This PR is an initial implementation of #49146. It introduces a `const_if_match` feature flag and does the following if it is enabled: - Allows `Downcast` projections, `SwitchInt` terminators and `FakeRead`s for matched places through the MIR const-checker. - Allows `if` and `match` expressions through the HIR const-checker. - Stops converting `&&` to `&` and `||` to `|` in `const` and `static` items. As a result, the following operations are now allowed in a const context behind the feature flag: - `if` and `match` - short circuiting logic operators (`&&` and `||`) - the `assert` and `debug_assert` macros (if the `const_panic` feature flag is also enabled) However, the following operations remain forbidden: - `while`, `loop` and `for` (see #52000) - the `?` operator (calls `From::from` on its error variant) - the `assert_eq` and `assert_ne` macros, along with their `debug` variants (calls `fmt::Debug`) This PR is possible now that we use dataflow for const qualification (see #64470 and #66385). r? @oli-obk cc @rust-lang/wg-const-eval @eddyb
2019-11-22Retire impl_stable_hash_for_spanned.Camille GILLOT-1/+1
2019-11-22Derive HashStable_Generic for Ident.Camille GILLOT-2/+2
2019-11-22Derive HashStable_Generic for ExpnData.Camille GILLOT-1/+2
2019-11-22Invert flow in impl HashStable of Span.Camille GILLOT-2/+12
2019-11-22Add StableHashingContextLike to HashStable_Generic derive.Camille GILLOT-0/+5
2019-11-22Auto merge of #66460 - cjgillot:hashstable_generic, r=Zoxcbors-7/+48
Add a proc-macro to derive HashStable in librustc dependencies A second proc-macro is added to derive HashStable for crates librustc depends on. This proc-macro HashStable_Generic (to bikeshed) allows to decouple code and some librustc's boilerplate. Not everything is migrated, because `Span` and `TokenKind` require to be placed inside librustc. Types using them stay there too. Split out of #66279 r? @Zoxc
2019-11-21Add feature gate for const `if` and `match`Dylan MacKenzie-0/+1
2019-11-21Rename the cfg attribute from rustdoc to docGuillaume Gomez-1/+0
2019-11-21Gate fallback via `#![feature(never_type_fallback)]`.Mazdak Farrokhzad-0/+1
2019-11-20Rollup merge of #66060 - traxys:test_65401, r=michaelwoeristerMazdak Farrokhzad-0/+1
Making ICEs and test them in incremental This adds: - A way to make the compiler ICE - A way to check for ICE in `cfail` tests with `should-ice` - A regression test for issue #65401 I am not sure the attribute added `should-ice` is the best for this job
2019-11-17Simplify impl for SymbolStr.Camille GILLOT-2/+1
2019-11-17HashStable_Generic for libsyntax_pos.Camille GILLOT-6/+12
2019-11-17Further HashStable_Generic derives.Camille GILLOT-1/+3
2019-11-17Move impl HashStable for Symbol in libsyntax_pos.Camille GILLOT-0/+16
2019-11-17Move impl HashStable for SymbolStr in libsyntax_pos.Camille GILLOT-0/+18
2019-11-17Address review commentsVadim Petrochenkov-1/+0
2019-11-15Remove SourceMapper traitMark Rousskov-34/+8
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
2019-11-15Move SourceMap to syntax_posMark Rousskov-0/+1259
This does not update the use sites or delete the now unnecessary SourceMapper trait, to allow git to interpret the file move as a rename rather than a new file.
2019-11-15Move FatalError to syntax_posMark Rousskov-0/+31
This is a bit unfortunate, but code needs to be able to fatally error early on (in particular, syntax_pos after we move SourceMap there). It's also a tiny bit of code, which means it's ultimately not that bad.