about summary refs log tree commit diff
path: root/src/librustc_interface
AgeCommit message (Collapse)AuthorLines
2020-03-19Don't unwind when hitting the macro expansion recursion limitJohn Kåre Alsaker-2/+11
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-20/+19
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-18fix pre-expansion linting infraMazdak Farrokhzad-9/+14
2020-03-17Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisabors-1/+1
Don't use static crt by default when build proc-macro Don't check value of `crt-static` when build proc-macro crates, since they are always built dynamically. For more information, see https://github.com/rust-lang/cargo/issues/7563#issuecomment-591965320 I hope this will fix issues about compiling `proc_macro` crates on musl host without bring more issues. Fix https://github.com/rust-lang/cargo/issues/7563
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-20/+19
2020-03-15Auto merge of #68944 - Zoxc:hir-map, r=eddybbors-6/+7
Use queries for the HIR map r? @eddyb cc @michaelwoerister
2020-03-15Rollup merge of #69589 - petrochenkov:maccall, r=CentrilMazdak Farrokhzad-1/+1
ast: `Mac`/`Macro` -> `MacCall` It's now obvious that these refer to macro calls rather than to macro definitions. It's also a single name instead of two different names in different places. `rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls. cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513 r? @eddyb
2020-03-14Fix HIR map validationJohn Kåre Alsaker-0/+2
2020-03-14Index HIR after creating TyCtxtJohn Kåre Alsaker-6/+4
2020-03-14Clean up the collectorJohn Kåre Alsaker-1/+2
2020-03-14Collect the new mapsJohn Kåre Alsaker-1/+1
2020-03-14Make downstream crates compile.Camille GILLOT-1/+1
2020-03-14Move rustc_infer::traits to new crate rustc_trait_selection.Camille GILLOT-0/+1
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-1/+1
2020-03-05Auto merge of #69746 - Dylan-DPC:rollup-wr6dvdk, r=Dylan-DPCbors-1/+1
Rollup of 8 pull requests Successful merges: - #69697 (Add explanation for E0380) - #69698 (Use associated constants of integer types) - #69711 (Update macros.rs: fix documentation typo.) - #69713 (more clippy cleanups) - #69728 (Make link to `std::str` active) - #69732 (Clean E0382 and E0384 explanations) - #69736 (even more clippy cleanups) - #69742 (Fixed a typo) Failed merges: r? @ghost
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-1/+1
rename feature to const_eval_limit
2020-03-04Don't use "if let" bindings to only check a value and not actually bind ↵Matthias Krüger-1/+1
anything. For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
2020-03-03Don't use static crt by default when build proc-macro.12101111-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-23/+22
2020-02-29Make it build againVadim Petrochenkov-4/+4
2020-02-28Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morseMazdak Farrokhzad-1/+1
use char instead of &str for single char patterns
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-1/+1
example: let s: String = format!("hello").into();
2020-02-27use char instead of &str for single char patternsMatthias Krüger-1/+1
2020-02-24parse/ast: move `Defaultness` into variants.Mazdak Farrokhzad-2/+2
2020-02-19Split query stats into its own fileJohn Kåre Alsaker-3/+3
2020-02-18Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkovMazdak Farrokhzad-1/+1
parse: fuse associated and extern items up to defaultness Language changes: - The grammar of extern `type` aliases is unified with associated ones, and becomes: ```rust TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ; ``` Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`). (Work still remains to fuse this with free `type` aliases, but this can be done later.) - The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes: ```rust GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ; ``` - A semantic restriction is added to enforce the presence of the expression (the body). - A semantic restriction is added to reject `const _` in associated contexts. Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR. ----------------------- We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s. r? @petrochenkov
2020-02-17Rename `FunctionRetTy` to `FnRetTy`Yuki Okushi-2/+2
2020-02-16Other crates.Camille GILLOT-1/+2
2020-02-15ast: move Generics into AssocItemKindsMazdak Farrokhzad-1/+1
2020-02-13Move resolve_instance to rustc_ty.Camille GILLOT-0/+1
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-1/+1
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-12Rollup merge of #68487 - 0dvictor:nolink, r=tmandryYuki Okushi-2/+15
[experiment] Support linking from a .rlink file Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file. Part of Issue #64191
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-2/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11Support linking from a .rlink fileVictor Ding-2/+15
Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file.
2020-02-07Remove unused feature gates from librustc_interfacebjorn3-2/+0
2020-02-06Remove the `Forest` typeJohn Kåre Alsaker-15/+15
2020-02-04Rollup merge of #68815 - matthiaskrgr:redundant_imports, r=alexcrichtonDylan DPC-5/+0
remove redundant imports (clippy::single_component_path_imports)
2020-02-04Auto merge of #68601 - 0dvictor:split, r=tmandrybors-10/+13
Split `join_codegen_and_link()` into two steps `join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04Split `join_codegen_and_link()` into two stepsVictor Ding-10/+13
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-5/+0
2020-02-02Rollup merge of #68460 - sinkuu:emit_mir_buffered, r=Mark-SimulacrumYuki Okushi-2/+2
Use BufWriter for emitting MIR I noticed that `--emit=mir` takes long time on a large crate. https://github.com/rust-lang/rust/pull/64344 seem to have fixed `-Zdump-mir`, but not `--emit=mir`.
2020-02-01syntax: reexport attr globalsMazdak Farrokhzad-5/+5
2020-02-01pacify the parallel compilerMazdak Farrokhzad-3/+3
2020-02-011. move node_id to syntaxMazdak Farrokhzad-4/+5
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-2/+3
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-02-01syntax: move GLOBALS to attr moduleMazdak Farrokhzad-2/+2
2020-02-01{syntax -> rustc_ast_passes}::node_countMazdak Farrokhzad-2/+1
2020-02-01Use BufWriterShotaro Yamada-2/+2
2020-01-30Use `P` for `NtTraitItem`, `NtImplItem`, and `NtForeignItem`.Nicholas Nethercote-2/+2
This commit reduces the size of `Nonterminal` from a whopping 240 bytes to 72 bytes (on x86-64), which gets it below the `memcpy` threshold. It also removes some impedance mismatches with `Annotatable`, which already uses `P` for these variants.
2020-01-22Privatize private fields of OutputFilenamesMark Rousskov-19/+14