about summary refs log tree commit diff
path: root/src/librustc_builtin_macros
AgeCommit message (Collapse)AuthorLines
2020-06-11Rollup merge of #73172 - matthiaskrgr:cl9ppy, r=Dylan-DPCDylan DPC-1/+1
Fix more clippy warnings Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next r? @Dylan-DPC
2020-06-11Add a suggestion to use unused asm arguments in commentsAmanieu d'Antras-18/+29
2020-06-09expand: Give reasonable NodeIds to lints associated with macro expansionsVadim Petrochenkov-2/+3
2020-06-09Fix more clippy warningsMatthias Krüger-1/+1
Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next
2020-06-08Don't lose empty `where` clause when pretty-printingAaron Hill-1/+5
Previously, we would parse `struct Foo where;` and `struct Foo;` identically, leading to an 'empty' `where` clause being omitted during pretty printing. This will cause us to lose spans when proc-macros involved, since we will have a collected `where` token that does not appear in the pretty-printed item. We now explicitly track the presence of a `where` token during parsing, so that we can distinguish between `struct Foo where;` and `struct Foo;` during pretty-printing
2020-06-02Rename the crates in source codeVadim Petrochenkov-5/+3
2020-06-02Make things build againVadim Petrochenkov-1/+1
2020-05-31Clarify errors and warnings about the transition to the new asm!Amanieu d'Antras-1/+4
2020-05-31Print accessed env vars as special comments into depinfo filesVadim Petrochenkov-7/+12
2020-05-30Rollup merge of #72637 - euclio:env-hygiene, r=davidtwcoRalf Jung-0/+1
expand `env!` with def-site context Similar to #66349. Fixes rust-lang/rust-clippy#5619.
2020-05-29Improve inline asm error diagnosticsAmanieu d'Antras-2/+8
2020-05-26expand `env!` with def-site contextAndy Russell-0/+1
2020-05-24Collect tokens for `ast::Expr`Aaron Hill-0/+3
2020-05-21Auto merge of #70705 - lcnr:generic_discriminant, r=nikomatsakisbors-70/+10
Use `T`'s discriminant type in `mem::Discriminant<T>` instead of `u64`. fixes #70509 Adds the lang-item `discriminant_kind`. Updates the function signature of `intrinsics::discriminant_value`. Adds the *probably permanently unstable* trait `DiscriminantKind`. `mem::Discriminant` should now be smaller in some cases. r? @ghost
2020-05-19update `discriminant_value` usage in the compilerBastian Kauschke-70/+10
2020-05-18Move InlineAsmTemplatePiece and InlineAsmOptions to librustc_astAmanieu d'Antras-20/+21
2020-05-18Implement att_syntax optionAmanieu d'Antras-2/+4
2020-05-18Apply review feedbackAmanieu d'Antras-59/+66
2020-05-18Implement asm! in librustc_builtin_macrosAmanieu d'Antras-109/+540
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-58/+57
2020-05-04fix typo in function nameAndy Russell-3/+3
2020-05-04Rollup merge of #71773 - tshepang:links, r=davidtwcoDylan DPC-2/+2
doc: misc rustdoc things
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+3
2020-05-01doc: misc rustdoc thingsTshepang Lekhonkhobe-2/+4
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-19/+13
2020-04-18Move `MapInPlace` to rustc_data_structuresYuki Okushi-1/+1
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-8/+4
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-13/+14
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-5/+5
2020-03-24defatalize expand_test_or_benchMazdak Farrokhzad-8/+8
2020-03-24defatalize get_test_runnerMazdak Farrokhzad-10/+10
2020-03-24nix remaining rustc_expand::panictry! uses.Mazdak Farrokhzad-15/+18
2020-03-23Rollup merge of #70269 - matthiaskrgr:clippy_closures, r=Dylan-DPCMazdak Farrokhzad-2/+2
remove redundant closures (clippy::redundant_closure)
2020-03-23Rollup merge of #70248 - Centril:unroot, r=petrochenkovMazdak Farrokhzad-2/+2
parser: simplify & remove unused field r? @petrochenkov
2020-03-22Rollup merge of #70266 - petrochenkov:prochead, r=varkorDylan DPC-5/+8
proc_macro_harness: Use item header spans for errors Addresses https://github.com/rust-lang/rust/pull/70233#discussion_r396043004.
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-2/+2
2020-03-22proc_macro_harness: Use item header spans for errorsVadim Petrochenkov-5/+8
2020-03-22parse: nix new_sub_parser_from_fileMazdak Farrokhzad-2/+2
2020-03-21parse: nix unused `root_module_name`.Mazdak Farrokhzad-1/+1
2020-03-21use let instead of match for matches with single bindings ↵Matthias Krüger-2/+3
(clippy::match_single_binding)
2020-03-21Rollup merge of #70187 - matthiaskrgr:cl2ppy, r=Mark-SimulacrumMazdak Farrokhzad-9/+8
more clippy fixes * remove redundant returns (clippy::needless_return) * remove redundant import (clippy::single_component_path_imports) * remove redundant format!() call (clippy::useless_format) * don't use ok() before calling expect() (clippy::ok_expect)
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-9/+8
2020-03-20expand_include: set `.directory` to dir of included file.Mazdak Farrokhzad-1/+12
2020-03-18fix pre-expansion linting infraMazdak Farrokhzad-3/+3
2020-03-18outline modules: parse -> expand.Mazdak Farrokhzad-3/+2
2020-03-17Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasperMazdak Farrokhzad-4/+60
expand: Implement something similar to `#[cfg(accessible(path))]` cc https://github.com/rust-lang/rust/issues/64797 The feature is implemented as a `#[cfg_accessible(path)]` attribute macro rather than as `#[cfg(accessible(path))]` because it needs to wait until `path` becomes resolvable, and `cfg` cannot wait, but macros can wait. Later we can think about desugaring or not desugaring `#[cfg(accessible(path))]` into `#[cfg_accessible(path)]`. This implementation is also incomplete in the sense that it never returns "false" from `cfg_accessible(path)`, it requires some tweaks to resolve, which is not quite ready to answer queries like this during early resolution. However, the most important part of this PR is not `cfg_accessible` itself, but expansion infrastructure for retrying expansions. Before this PR we could say "we cannot resolve this macro path, let's try it later", with this PR we can say "we cannot expand this macro, let's try it later" as well. This is a pre-requisite for - turning `#[derive(...)]` into a regular attribute macro, - properly supporting eager expansion for macros that cannot yet be resolved like ``` fn main() { println!(not_available_yet!()); } macro_rules! make_available { () => { #[macro_export] macro_rules! not_available_yet { () => { "Hello world!" } }} } make_available!(); ```
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-7/+7
2020-03-10builtin_macros: Add attribute macro `#[cfg_accessible(path)]`Vadim Petrochenkov-0/+56
2020-03-10expand: Implement support for retrying macro expansionsVadim Petrochenkov-3/+3