about summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-2/+2
2020-03-24save/restore `pessimistic_yield` when entering bodiesNiko Matsakis-0/+2
This flag is used to make the execution order around `+=` operators pessimistic. Failure to save/restore the flag was causing independent async blocks to effect one another, leading to strange ICEs and failed assumptions.
2020-03-24rustc: remove rustc_hir_pretty dependency.Mazdak Farrokhzad-14/+4
2020-03-24{rustc::hir::map -> rustc_passes}::hir_id_validatorMazdak Farrokhzad-0/+177
2020-03-23Reword unused variable warningAlex Tokarev-1/+1
2020-03-22Allow #[track_caller] in traits.Adam Perry-3/+3
The codegen implementation already works for this, so we're: * propagating track_caller attr from trait def to impl * relaxing errors * adding tests Approved in a recent lang team meeting: https://github.com/rust-lang/lang-team/blob/master/minutes/2020-01-09.md
2020-03-21Rollup merge of #69901 - RalfJung:rustc_layout, r=eddybDylan DPC-8/+21
add #[rustc_layout(debug)] @eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
2020-03-20fmtRalf Jung-4/+4
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-6/+4
2020-03-20make rustc_layout also work for type definitionsRalf Jung-4/+10
2020-03-20add debug option to #[rustc_layout]Ralf Jung-0/+7
2020-03-20fix layout_test visitor nameRalf Jung-4/+4
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-3/+3
2020-03-19rustc: introduce DefId::as_local(self) -> Option<LocalDefId> and use it.Eduard-Mihai Burtescu-1/+1
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-28/+21
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-16Fiddle `ParamEnv` through to a place that used to use `ParamEnv::empty` in a ↵Oliver Scherer-5/+16
buggy manner
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-11/+10
2020-03-16remove unnecessary hir::map importsMazdak Farrokhzad-17/+11
2020-03-15More Method->Fn renamingMark Mansi-12/+12
2020-03-15Auto merge of #68944 - Zoxc:hir-map, r=eddybbors-40/+38
Use queries for the HIR map r? @eddyb cc @michaelwoerister
2020-03-15Rollup merge of #69589 - petrochenkov:maccall, r=CentrilMazdak Farrokhzad-2/+2
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-14Index HIR after creating TyCtxtJohn Kåre Alsaker-35/+33
2020-03-14Update `krate_attrs` and `get_module`John Kåre Alsaker-5/+5
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-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-3/+0
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-14Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddybYuki Okushi-4/+4
remove lifetimes that can be elided (clippy::needless_lifetimes)
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-2/+2
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-4/+4
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-2/+2
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-7/+7
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-03-06fix various typosMatthias Krüger-2/+2
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-3/+0
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-03rename TraitItemKind::Method -> FnMark Mansi-7/+7
2020-03-01Auto merge of #69612 - Dylan-DPC:rollup-f180gcc, r=Dylan-DPCbors-1/+1
Rollup of 7 pull requests Successful merges: - #69504 (Use assert_ne in hash tests) - #69554 (Cleanup e0374) - #69568 (Clarify explanation of Vec<T> 'fn resize') - #69569 (simplify boolean expressions) - #69577 (Clean up E0375 explanation) - #69598 (rustdoc: HTML escape crate version) - #69607 (Clean up E0376 explanation) Failed merges: r? @ghost
2020-03-01Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-SimulacrumDylan DPC-1/+1
simplify boolean expressions
2020-03-01Auto merge of #69380 - Zoxc:parent-module, r=michaelwoeristerbors-2/+2
Use a query to get parent modules Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944. r? @michaelwoerister
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-15/+15
2020-02-29Make it build againVadim Petrochenkov-2/+2
2020-02-29simplify boolean expressionsMatthias Krüger-1/+1
2020-02-29Add a `parent_module_from_def_id` queryJohn Kåre Alsaker-2/+2
2020-02-29use .to_string() instead of format!() macro to create stringsMatthias Krüger-1/+1
2020-02-28Rollup merge of #69541 - dotdash:format, r=Mark-SimulacrumMazdak Farrokhzad-2/+2
Remove unneeded calls to format!()
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-27Remove unneeded calls to format!()Björn Steinbrink-2/+2