about summary refs log tree commit diff
path: root/compiler/rustc_interface
AgeCommit message (Collapse)AuthorLines
2020-09-10Attach tokens to `ast::Stmt`Aaron Hill-0/+2
We currently only attach tokens when parsing a `:stmt` matcher for a `macro_rules!` macro. Proc-macro attributes on statements are still unstable, and need additional work.
2020-09-10Attach `TokenStream` to `ast::Block`Aaron Hill-0/+1
A `Block` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-03Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkovbors-0/+1
diagnostics: shorten paths of unique symbols This is a step towards implementing a fix for #50310, and continuation of the discussion in [Pre-RFC: Nicer Types In Diagnostics - compiler - Rust Internals](https://internals.rust-lang.org/t/pre-rfc-nicer-types-in-diagnostics/11139). Impressed upon me from previous discussion in #21934 that an RFC for this is not needed, and I should just come up with code. The recent improvements to `use` suggestions that I've contributed have given rise to this implementation. Contrary to previous suggestions, it's rather simple logic, and I believe it only reduces the amount of cognitive load that a developer would need when reading type errors. ----- If a symbol name can only be imported from one place, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path to the last component. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable from anywhere.
2020-09-02pretty: trim paths of unique symbolsDan Aloni-0/+1
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-09-02Auto merge of #76216 - marmeladema:use-once-cell-from-std, r=matkladbors-6/+5
compiler: use `OnceCell` from std Fixes #76192 The only remaining direct use of `lazy_static` crate is in `src/bootstrap` but I am not sure how I can remove that dependency for now. r? @matklad
2020-09-01Rollup merge of #76158 - mati865:self-contained-option, r=petrochenkovTyler Mandry-0/+1
Stabilise link-self-contained option MCP has been accepted: https://github.com/rust-lang/compiler-team/issues/343 I'll add improved heuristic in next PR.
2020-09-01interface: use `OnceCell` from standard librarymarmeladema-6/+5
2020-08-31Rollup merge of #76075 - marmeladema:remove-once-cell-crate, r=matkladAleksey Kladov-0/+1
datastructures: replace `once_cell` crate with an impl from std Fixes #75700 r? @matklad We might need a perf run for this change.
2020-08-31Stabilise link-self-contained optionMateusz MikuĊ‚a-0/+1
2020-08-30Add `-Z proc-macro-backtrace` to allow showing proc-macro panicsAaron Hill-0/+2
Fixes #75050 Previously, we would unconditionally suppress the panic hook during proc-macro execution. This commit adds a new flag -Z proc-macro-backtrace, which allows running the panic hook for easier debugging.
2020-08-30datastructures: replace `once_cell` crate with an impl from stdmarmeladema-0/+1
2020-08-30mv compiler to compiler/mark-0/+3156