about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2019-09-14Rollup merge of #64290 - Mark-Simulacrum:span-no-main, r=estebankMazdak Farrokhzad-30/+44
Provide a span if main function is not present in crate Unfortunately, the diagnostic machinery does not cope well with an empty span which can happen if the crate is empty, in which case we merely set a spanless note. Tests are already updated for this change, so a dedicated test is not added. Resolves #36561.
2019-09-14Provide a span if main function is not present in crateMark Rousskov-30/+44
Unfortunately, the diagnotic machinery does not cope well with an empty span which can happen if the crate is empty, in which case we merely set a spanless note.
2019-09-11Use `Symbol` in `weak_lang_items!`.Nicholas Nethercote-3/+3
2019-09-08Rollup merge of #64255 - varkor:bool-to-option, r=CentrilMazdak Farrokhzad-0/+1
Add methods for converting `bool` to `Option<T>` This provides a reference implementation for https://github.com/rust-lang/rfcs/pull/2757.
2019-09-08Rollup merge of #64066 - petrochenkov:softstab, r=matthewjasperMazdak Farrokhzad-6/+16
Support "soft" feature-gating using a lint Use it for feature-gating `#[bench]`. Closes https://github.com/rust-lang/rust/issues/63798.
2019-09-07Support "soft" feature-gating using a lintVadim Petrochenkov-6/+16
Use it for feature-gating `#[bench]`
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-63/+57
2019-09-07Add "bool" lang itemvarkor-0/+1
2019-08-30Add a "diagnostic item" schemeOliver Scherer-2/+123
This allows lints and other diagnostics to refer to items by a unique ID instead of relying on whacky path resolution schemes that may break when items are relocated.
2019-08-29Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebankMazdak Farrokhzad-2/+6
Add Option<Span> to `require_lang_item` Fixes #63954 I'm not sure where to take `Some(span)` or something so I use `None` in many places. r? @estebank
2019-08-28Add Option<Span> to `require_lang_item`Yuki Okushi-2/+6
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-23/+23
2019-08-21Do not complain about unused code when used in `impl` `Self` typeEsteban Küber-6/+20
2019-08-19use static as object-lifetime default for type XX in `Foo<Item=XX>`Niko Matsakis-1/+70
Currently the default is "inherited" from context, so e.g. `&impl Foo<Item = dyn Bar>` would default to `&'x impl Foo<Item = dyn Bar + 'x>`, but this triggers an ICE and is not very consistent. This patch doesn't implement what I expect would be the correct semantics, because those are likely too complex. Instead, it handles what I'd expect to be the common case -- where the trait has no lifetime parameters.
2019-08-19distinguish object-lifetime-default elision from other elisionNiko Matsakis-0/+17
Object-lifetime-default elision is distinct from other forms of elision; it always refers to some enclosing lifetime *present in the surrounding type* (e.g., `&dyn Bar` expands to `&'a (dyn Bar + 'a)`. If there is no enclosing lifetime, then it expands to `'static`. Therefore, in an `impl Trait<Item = dyn Bar>` setting, we don't expand to create a lifetime parameter for the `dyn Bar + 'X` bound. It will just be resolved to `'static`. Annoyingly, the responsibility for this resolution is spread across multiple bits of code right now (`middle::resolve_lifetimes`, `lowering`). The lowering code knows that the default is for an object lifetime, but it doesn't know what the correct result would be. Probably this should be fixed, but what we do now is a surgical fix: we have it generate a different result for elided lifetimes in a object context, and then we can ignore those results when figuring out the lifetimes that are captured in the opaque type.
2019-08-19add debug logsNiko Matsakis-0/+5
2019-08-17Initial implementation of or patternsvarkor-0/+6
2019-08-16CrateStore comment fix.Edd Barrett-2/+1
with -> which , and re-wrap line.
2019-08-15Rollup merge of #63586 - petrochenkov:nospanned, r=eddybMazdak Farrokhzad-13/+11
cleanup: Remove `Spanned` where possible It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.
2019-08-15Rollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obkMazdak Farrokhzad-0/+8
Fix ICE #63226 Fixes #63226 r? @oli-obk
2019-08-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-13/+11
2019-08-15Use is_const()Yuki Okushi-2/+2
2019-08-15Use a match guard to avoid code repetitionYuki Okushi-8/+5
2019-08-15Check FnHeader not to cause ICEYuki Okushi-3/+14
2019-08-14Merge Variant and Variant_Caio-10/+10
2019-08-11Derive Debug for NativeLibrary and NativeLibraryKindbjorn3-2/+2
2019-08-07Rollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertjMazdak Farrokhzad-0/+2
Fix generator size regressions due to optimization I tested the generator optimizations in #60187 and #61922 on the Fuchsia build, and noticed that some small generators (about 8% of the async fns in our build) increased in size slightly. This is because in #60187 we split the fields into two groups, a "prefix" non-overlap region and an overlap region, and lay them out separately. This can introduce unnecessary padding bytes between the two groups. In every single case in the Fuchsia build, it was due to there being only a single variant being used in the overlap region. This means that we aren't doing any overlapping, period. So it's better to combine the two regions into one and lay out all the fields at once, which is what this change does. r? @cramertj cc @eddyb @Zoxc
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-2/+9
2019-08-05Don't abort on unevaluated constants without at least tryting to eval themOliver Scherer-1/+1
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-4/+4
2019-08-04Rename `ItemKind::Ty` to `ItemKind::TyAlias`varkor-4/+4
2019-08-03Rollup merge of #63227 - jakubadamw:issue-63151, r=estebankMazdak Farrokhzad-2/+3
dead_code: Properly inspect fields in struct patterns with type relative paths Closes #63151.
2019-08-02dead_code: Properly inspect fields in struct patterns with type relative pathsJakub Adam Wieczorek-2/+3
2019-08-02Replace `exist_ty` and `ExistTy` with `opaque_ty` and `OpaqueTy`varkor-5/+5
2019-08-02Replace `abstract type` with type alias `impl Trait`varkor-24/+24
2019-08-02Replace "existential" by "opaque"varkor-16/+16
2019-07-29Wrap promoted generator fields in MaybeUninitTyler Mandry-0/+2
This prevents uninhabited fields from "infecting" the abi and largest_niche of the generator layout. This fixes a latent bug, where an uninhabited field could be promoted to the generator prefix and cause the entire generator to become uninhabited.
2019-07-28Disallow duplicate lifetime parameters with legacy hygieneMatthew Jasper-1/+1
They were resolved with modern hygiene, making this just a strange way to shadow lifetimes.
2019-07-27Use Set1<Region> instead of Option<Region>Taiki Endo-5/+6
2019-07-27Make is_self_ty a method on SelfVisitorTaiki Endo-32/+35
2019-07-27Remove query for `.pin_type()`Taiki Endo-34/+32
2019-07-27Allow lifetime elision in `Pin<&(mut) Self>`Taiki Endo-1/+28
2019-07-26Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichtonMazdak Farrokhzad-28/+0
Remove support for -Zlower-128bit-ops It is broken and unused cc https://github.com/rust-lang/rust/issues/58969 blocked https://github.com/rust-lang-nursery/compiler-builtins/pull/302 (removes definitions of the lang items removed in this PR) r? @alexcrichton
2019-07-25Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichtonMazdak Farrokhzad-21/+0
Turn `#[global_allocator]` into a regular attribute macro It was a 99% macro with exception of some diagnostic details. As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks. Fixes https://github.com/rust-lang/rust/issues/44113 Fixes https://github.com/rust-lang/rust/issues/58072
2019-07-24syntax_ext: Turn `#[global_allocator]` into a regular attribute macroVadim Petrochenkov-5/+0
2019-07-24Merge `rustc_allocator` into `libsyntax_ext`Vadim Petrochenkov-16/+0
2019-07-23normalize use of backticks for compiler messages in remaining modulesSamy Kacimi-6/+6
https://github.com/rust-lang/rust/issues/60532
2019-07-19Remove support for -Zlower-128bit-opsbjorn3-28/+0
It is broken and unused
2019-07-12Rollup merge of #62453 - zackmdavis:single_path, r=estebankMazdak Farrokhzad-25/+56
in which we suggest anonymizing single-use lifetimes in paths Following @nikomatsakis's [October 2017 comment](https://github.com/rust-lang/rust/issues/44752#issuecomment-340885834). ![path_anon_suggest](https://user-images.githubusercontent.com/1076988/60761598-e2619180-a000-11e9-9144-1bdf8eb848e3.png) r? @estebank cc @eddyb (you were saying something about running single-use-lifetimes against the tree the other week?)
2019-07-11Remove rustc_mir dependency from rustc_borrowckMatthew Jasper-80/+0