about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-2/+6
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-23syntax: Some code cleanupVadim Petrochenkov-1/+1
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-64/+33
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-2/+2
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-18/+19
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-12/+12
2019-05-20Remove `Symbol::gensym()`.Nicholas Nethercote-1/+1
2019-05-20Eliminate `Symbol::gensymed`.Nicholas Nethercote-1/+1
2019-05-17Avoid unnecessary interning in `Ident::from_str()` calls.Nicholas Nethercote-5/+6
A lot of these static symbols are pre-interned.
2019-05-13Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichtonMazdak Farrokhzad-1/+6
Add #[doc(hidden)] attribute on compiler generated module. Resolves unavoidable `missing_docs` warning/error on proc-macro crates. Resolves #42008. Changes not yet tested locally, however I wanted to submit first since `rustc` takes forever to compile.
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-2/+2
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-6/+6
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-31/+36
2019-05-11Add #[doc(hidden)] attribute on compiler generated proc-macro module.Mike Boutin-1/+6
Stops unavoidable `missing_docs` warning/error on proc-macro crates. Resolves #42008.
2019-04-29Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichtonbors-14/+67
Make assert! ensure the macro is parsed completely Fixes https://github.com/rust-lang/rust/issues/60024
2019-04-25Handle common assert! misusesAlexey Shmalko-14/+60
2019-04-21Introduce `LocalSource` into the AST.David Wood-0/+1
This will be used to keep track of the origin of a local in the AST. In particular, it will be used by `async fn` lowering for the locals in `let <pat>: <ty> = __arg0;` statements.
2019-04-18Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkovbors-1/+1
Rename files about error codes fixes #60017 This PR will be failed in tidy. <details> <summary>The log is here:</summary> ``` tidy check tidy error: duplicate error code: 411 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:83: __diagnostic_used!(E0411); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:84: err.code(DiagnosticId::Error("E0411".to_owned())); tidy error: duplicate error code: 424 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:90: debug!("smart_resolve_path_fragment: E0424, source={:?}", source); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:92: __diagnostic_used!(E0424); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:93: err.code(DiagnosticId::Error("E0424".to_owned())); some tidy checks failed ``` </details> I'd like to fix this but I don't know what to do. I will work on later. Please let me know if you have any solutions. r? @petrochenkov
2019-04-17Make assert! ensure the macro is parsed completelyAlexey Shmalko-2/+9
2019-04-17Rename modulesYuki OKUSHI-1/+1
2019-04-17Rename diagnostics to error_codesYuki OKUSHI-0/+0
2019-04-17Fix comments around test harness generationAlexey Shmalko-1/+1
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-15Make check_name genericJohn Kåre Alsaker-1/+1
2019-04-11Auto merge of #59227 - Zoxc:fix-get, r=eddybbors-3/+3
Fix lifetime on LocalInternedString::get function cc @eddyb @nnethercote
2019-04-04Fix cases of conflicting two-phase borrowsMatthew Jasper-2/+2
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-03-31Fix lifetime on LocalInternedString::get functionJohn Kåre Alsaker-3/+3
2019-03-27Visit path in `walk_mac`varkor-1/+1
2019-03-27Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkovbors-0/+3
Introduce proc_macro::Span::source_text A function to extract the actual source behind a Span. Background: I would like to use `syn` in a `build.rs` script to parse the rust code, and extract part of the source code. However, `syn` only gives access to proc_macro2::Span, and i would like to get the source code behind that. I opened an issue on proc_macro2 bug tracker for this feature https://github.com/alexcrichton/proc-macro2/issues/110 and @alexcrichton said the feature should first go upstream in proc_macro. So there it is! Since most of the Span API is unstable anyway, this is guarded by the same `proc_macro_span` feature as everything else.
2019-03-25Auto merge of #59256 - petrochenkov:derval2, r=Zoxcbors-3/+4
Make meta-item API compatible with `LocalInternedString::get` soundness fix r? @Zoxc
2019-03-24Remove methods is_struct/is_tuple/is_unit from VariantDataVadim Petrochenkov-53/+51
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-3/+4
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-8/+8
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-8/+4
2019-03-16syntax_ext: Validate `#[proc_macro_derive]` input betterVadim Petrochenkov-4/+14
Tweak some error wording
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-28/+32
2019-03-06Simplify codeEsteban Küber-5/+2
2019-03-06Emit missing unclosed delimiter errorsEsteban Küber-2/+2
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-1/+1
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-1/+1
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-24Use ? in some macrosTaiki Endo-1/+1
2019-02-18Make `interpolated_to_tokenstream` a method on `Nonterminal`.Nicholas Nethercote-1/+1
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-1/+2
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-18Change `Token::interpolated_to_tokenstream()`.Nicholas Nethercote-2/+2
It is currently a method of `Token`, but it only is valid to call if `self` is a `Token::Interpolated`. This commit eliminates the possibility of misuse by changing it to an associated function that takes a `Nonterminal`, which also simplifies the call sites. This requires splitting out a new function, `nonterminal_to_string`.
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-13/+10
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-12Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichtonbors-1/+0
Stabilize str::escape_* methods with new return types… … that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-15/+15
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Cleanup importsTaiki Endo-2/+2
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-13/+10