about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1876/+0
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-1/+1
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-37/+6
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-2/+2
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-2/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-14/+14
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-2/+1
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-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-1/+1
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-10Store `TokenStream` in `rmeta::MacroDef`.Mazdak Farrokhzad-1/+1
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-07Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakisMazdak Farrokhzad-3/+0
Remove the `no_debug` feature Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779 r? @nikomatsakis
2020-03-07Remove `NO_DEBUG` constYuki Okushi-3/+0
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-2/+1
2020-03-05Bumped version number for const_eval_limit in active.rsChristoph Schmidler-8/+6
and renamed 'recursion_limit' in limits.rs to simple 'limit' because it does handle other limits too.
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-3/+3
rename feature to const_eval_limit
2020-03-05Disable CTFE if const_limit was set to 0, otherwise use the value set, which ↵Christoph Schmidler-7/+7
defaults to 1_000_000
2020-03-05Prepare const_limit feature gate and attributeChristoph Schmidler-1/+2
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-1/+1
2020-03-02Auto merge of #69432 - petrochenkov:alldeps, r=eddybbors-4/+1
rustc_metadata: Load metadata for indirect macro-only dependencies Imagine this dependency chain between crates ``` Executable crate -> Library crate -> Macro crate ``` where "Library crate" uses the macros from "Macro crate" for some code generation, but doesn't reexport them any further. Currently, when compiling "Executable crate" we don't even load metadata for it, because why would we want to load any metadata from "Macro crate" if it already did all its code generation job when compiling "Library crate". Right? Wrong! Hygiene data and spans (https://github.com/rust-lang/rust/issues/68686, https://github.com/rust-lang/rust/pull/68941) from "Macro crate" still may need to be decoded from "Executable crate". So we'll have to load them properly. Questions: - How this will affect compile times for larger crate trees in practice? How to measure it? Hygiene/span encoding/decoding will necessarily slow down compilation because right now we just don't do some work that we should do, but this introduces a whole new way to slow down things. E.g. loading metadata for `syn` (and its dependencies) when compiling your executable if one of its library dependencies uses it. - We are currently detecting whether a crate reexports macros from "Macro crate" or not, could we similarly detect whether a crate "reexports spans" and keep it unloaded if it doesn't? Or at least "reexports important spans" affecting hygiene, we can probably lose spans that only affect diagnostics.
2020-03-01Rollup merge of #69580 - matthiaskrgr:map_clone, r=CentrilYuki Okushi-1/+1
use .copied() instead of .map(|x| *x) on iterators
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-4/+4
2020-02-29use .copied() instead of .map(|x| *x) on iteratorsMatthias Krüger-1/+1
2020-02-24rustc_metadata: Load metadata for indirect macro-only dependenciesVadim Petrochenkov-4/+1
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-2/+2
2020-02-16Handle recursion_limit parsing errorsFisher Darling-6/+40
2020-02-11Review comments.Camille GILLOT-1/+1
2020-02-11Merge rustc::middle::*lang_items.Camille GILLOT-33/+24
2020-02-11Move it all into rustc_hir.Camille GILLOT-3/+3
2020-02-11Move weak_lang_items checking to librustc_passes.Camille GILLOT-0/+32
2020-02-11Move weak_lang_items.rs to librustc_passes.Camille GILLOT-130/+0
2020-02-11Move weak lang items to librustc_lang_items.Camille GILLOT-68/+31
2020-02-11Move get_lang_items query in librustc_passes.Camille GILLOT-168/+1
2020-02-11Move lang_items definitions to librustc_lang_items.Camille GILLOT-269/+57
2020-02-11Move hir::check_attr::Target to librustc_lang_items.Camille GILLOT-1/+1
2020-02-11Invert control in struct_lint_level.jumbatm-7/+12
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-07Auto merge of #65232 - nikomatsakis:lazy-norm-anon-const-push-2, r=matthewjasperbors-58/+2
replace the leak check with universes, take 2 This PR is an attempt to revive the "universe-based region check", which is an important step towards lazy normalization. Unlike before, we also modify the definition of `'empty` so that it is indexed by a universe. This sidesteps some of the surprising effects we saw before -- at the core, we no longer think that `exists<'a> { forall<'b> { 'b: 'a } }` is solveable. The new region lattice looks like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` This PR has three effects: * It changes a fair number of error messages, I think for the better. * It fixes a number of bugs. The old algorithm was too conservative and caused us to reject legal subtypings. * It also causes two regressions (things that used to compile, but now do not). * `coherence-subtyping.rs` gets an additional error. This is expected. * `issue-57639.rs` regresses as before, for the reasons covered in #57639. Both of the regressions stem from the same underlying property: without the leak check, the instantaneous "subtype" check is not able to tell whether higher-ranked subtyping will succeed or not. In both cases, we might be able to fix the problem by doing a 'leak-check like change' at some later point (e.g., as part of coherence). This is a draft PR because: * I didn't finish ripping out the leak-check completely. * We might want to consider a crater run before landing this. * We might want some kind of design meeting to cover the overall strategy. * I just remembered I never finished 100% integrating this into the canonicalization code. * I should also review what happens in NLL region checking -- it probably still has a notion of bottom (empty set). r? @matthewjasper
2020-02-06integrate the `sub_free_regions` code so we have only one copy of itNiko Matsakis-58/+2
2020-02-06Add CodegenFnAttrFlags::NO_SANITIZE_ANYTomasz Miąsko-0/+2
2020-02-05Selectively disable sanitizer instrumentationTomasz Miąsko-0/+6
Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
2020-02-011. move node_id to syntaxMazdak Farrokhzad-7/+8
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/+2
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-3/+3
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-24Normalise notes with the/isvarkor-3/+3
2020-01-23Add projection query for upstream drop-glue instances.Michael Woerister-23/+7
This reduces the amount of invalidated data when new types are add to upstream crates.
2020-01-23Always just use symbol name for sorting exported symbols.Michael Woerister-38/+0
2020-01-23Add `-Z no-link` flagVictor Ding-3/+4
Adds a compiler option to allow rustc compile a crate without linking. With this flag, rustc serializes codegen_results into a .rlink file.
2020-01-20Make sure that all upstream generics get re-exported from Rust dylibs.Michael Woerister-3/+18