about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-09-16or-patterns: middle/dead: make a hack less hacky.Mazdak Farrokhzad-2/+2
2019-09-16or-patterns: euv/`walk_arm`: remove `top_pats_hack`.Mazdak Farrokhzad-3/+1
2019-09-16or-patterns: euv/`arm_move_mode`: remove `top_pats_hack`.Mazdak Farrokhzad-3/+1
2019-09-16or-patterns: remove `Arm::contains_explicit_ref_binding`.Mazdak Farrokhzad-17/+0
2019-09-16or-patterns: liveness: generalize + remove `top_pats_hack`.Mazdak Farrokhzad-175/+141
2019-09-16or-patterns: liveness/`visit_arm`: remove `top_pats_hack`.Mazdak Farrokhzad-18/+11
2019-09-15Hide diagnostics emitted during --cfg parsingMark Rousskov-1/+12
The early error is more than sufficient for fixing the problem.
2019-09-15Auto merge of #64491 - Centril:rollup-21wkl69, r=Centrilbors-20/+18
Rollup of 3 pull requests Successful merges: - #63872 (Document platform-specific behavior of the iterator returned by std::fs::read_dir) - #64250 (save-analysis: Nest typeck tables when processing functions/methods) - #64472 (Don't mark expression with attributes as not needing parentheses) Failed merges: r? @ghost
2019-09-15Rollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkorMazdak Farrokhzad-20/+18
save-analysis: Nest typeck tables when processing functions/methods Fixes an issue where we did not nest tables correctly when resolving associated types in formal argument/return type positions. This was the minimized reproduction case that I tested the fix on: ```rust pub trait Trait { type Assoc; } pub struct A; pub fn func() { fn _inner1<U: Trait>(_: U::Assoc) {} fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() } impl A { fn _inner1<U: Trait>(self, _: U::Assoc) {} fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() } } } ``` using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`. Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this. Closes #63663 Closes #50328 Closes #43982
2019-09-15simplify `hir::Pat::walk_`.Mazdak Farrokhzad-11/+6
2019-09-15or-patterns: use `top_pats_hack` to make things compile.Mazdak Farrokhzad-9/+10
2019-09-15or-patterns: normalize HIR pretty priting.Mazdak Farrokhzad-10/+1
2019-09-15or-patterns: `hir::Arm::pats` -> `::pat` + `Arm::top_pats_hack`.Mazdak Farrokhzad-3/+14
2019-09-15or-patterns: remove hack from lowering.Mazdak Farrokhzad-61/+19
2019-09-15Auto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasperbors-0/+7
Permit impls referencing errors to overlap Fixes #43400; previously this would emit an overlapping impls error, but no longer does.
2019-09-15Permit impls referencing errors to overlapMark Rousskov-0/+7
2019-09-15Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkovbors-1/+1
Cleanup handling of hygiene for built-in macros This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms. * `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}` * Remove `Span::with_legacy_ctxt` * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically. * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene. * everything else is moved to def-site hygiene r? @petrochenkov
2019-09-15Give more `Idents` spansMatthew Jasper-1/+1
2019-09-15Auto merge of #64478 - Centril:rollup-bnt51w1, r=Centrilbors-21/+29
Rollup of 5 pull requests Successful merges: - #64457 (def_collector: Do not ICE on attributes on unnamed fields) - #64463 (resolve: Tweak some expected/found wording) - #64471 (Warn on no_start, crate_id attribute use) - #64473 (Use try_fold instead of manually carrying an accumulator) - #64475 (simplify the initialization) Failed merges: r? @ghost
2019-09-15Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasperMazdak Farrokhzad-21/+29
def_collector: Do not ICE on attributes on unnamed fields The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`). Fixes https://github.com/rust-lang/rust/issues/64385
2019-09-15Auto merge of #60584 - jonas-schievink:ice-panic-hook, r=oli-obkbors-39/+0
Use `panic::set_hook` to print the ICE message This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker. ICE messages are printed in a slightly different order now. Nightly prints: ``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0658. For more information about an error, try `rustc --explain E0277`. error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu ``` After this PR, rustc prints: ``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0658. For more information about an error, try `rustc --explain E0277`. ```
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-14Rollup merge of #64439 - 12101111:fix-owned-box, r=CentrilMazdak Farrokhzad-3/+3
fix #64430, confusing `owned_box` error message in no_std build Fixes #64430
2019-09-14Rollup merge of #64425 - guanqun:typo-fix, r=matthewjasperMazdak Farrokhzad-1/+1
typo fix
2019-09-14Rollup merge of #64302 - nnethercote:shrink-ObligationCauseCode, r=zackmdavisMazdak Farrokhzad-34/+58
Shrink `ObligationCauseCode` These commits reduce the size of `ObligationCauseCode` from 56 bytes to 32 bytes on 64-bit. This reduces instruction counts on various benchmarks by up to 1%, due to less `memcpy`ing.
2019-09-14Rollup merge of #64116 - ZeGentzy:patch-1, r=oli-obkMazdak Farrokhzad-2/+2
Fix minor typo in docs. This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.
2019-09-14def_collector: Factor out common field handling codeVadim Petrochenkov-26/+21
2019-09-14def_collector: Do not ICE on attributes on unnamed fieldsVadim Petrochenkov-2/+15
2019-09-13Update value.rsHal Gentz-2/+2
2019-09-14fix #6443012101111-3/+3
2019-09-13Auto merge of #63420 - spastorino:place2_5, r=oli-obkbors-260/+135
[Place 2.0] Convert Place's projection to a boxed slice This is still work in progress, it's not compiling right now I need to review a bit more to see what's going on but wanted to open the PR to start discussing it. r? @oli-obk
2019-09-13Always validate HIR ID for TypeckTablesIgor Matuszewski-20/+18
Performance shouldn't be impacted (see [1] for a perf run) and this should allow us to catch more bugs, e.g. [2] and [3]. [1]: https://github.com/rust-lang/rust/pull/64262 [2]: https://github.com/rust-lang/rust/pull/64250 [3]: https://github.com/rust-lang/rust/issues/57298
2019-09-13typo fixGuanqun Lu-1/+1
2019-09-12Use foldSantiago Pastorino-7/+4
2019-09-12Add long error explanation for E0312Guillaume Gomez-1/+33
2019-09-12Auto merge of #64303 - nnethercote:avoid-more-Symbol-to-string-operations, ↵bors-3/+3
r=petrochenkov Avoid more `Symbol`-to-string operations These commits avoid various `Symbol`-to-string conversions, by doing more operations directly on `Symbol`s. This requires adding a few more static `Symbol`s to the binary. r? @petrochenkov
2019-09-12Shrink `SubregionOrigin`.Nicholas Nethercote-14/+18
It's currently 120 bytes on x86-64, due to one oversized variant (`Subtype`). This commit boxes `Subtype`'s contents, reducing the size of `SubregionOrigin` to 32 bytes. The change speeds things up by avoiding lots of `memcpy` calls, mostly relating to `RegionConstraintData::constraints`, which is a `BTreeMap` with `SubregionOrigin` values.
2019-09-11Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytesSantiago Pastorino-12/+17
2019-09-11Auto merge of #64271 - Centril:non-exhaustive-peel-refs, r=estebankbors-0/+18
check_match: refactor + improve non-exhaustive diagnostics for default binding modes Refactor `check_match` a bit with more code-reuse and improve the diagnostics for a non-exhaustive pattern match by peeling off any references from the scrutinee type so that the "defined here" label is added in more cases. For example: ```rust error[E0004]: non-exhaustive patterns: `&mut &B` not covered --> foo.rs:4:11 | 1 | enum E { A, B } | --------------- | | | | | not covered | `E` defined here ... 4 | match x { | ^ pattern `&mut &B` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms ``` Moreover, wrt. "defined here", we give irrefutable pattern matching (i.e. in `let`, `for`, and `fn` parameters) a more consistent treatment in line with `match`. r? @estebank
2019-09-11Upgrade parking_lot and tempfile rustc dependenciesMateusz Mikuła-1/+1
2019-09-11Use `Symbol` in `weak_lang_items!`.Nicholas Nethercote-3/+3
2019-09-10Rollup merge of #64292 - davidtwco:issue-63832-await-temporary-lifetimes, ↵Mazdak Farrokhzad-20/+15
r=matthewjasper lowering: extend temporary lifetimes around await Fixes #63832. r? @matthewjasper cc @nikomatsakis
2019-09-10lowering: extend temporary lifetimes around awaitDavid Wood-20/+15
This commit changes the HIR lowering around `await` so that temporary lifetimes are extended. Previously, await was lowered as: ```rust { let mut pinned = future; loop { match ::std::future::poll_with_tls_context(unsafe { <::std::pin::Pin>::new_unchecked(&mut pinned) }) { ::std::task::Poll::Ready(result) => break result, ::std::task::Poll::Pending => {} } yield (); } } ``` With this commit, await is lowered as: ```rust match future { mut pinned => loop { match ::std::future::poll_with_tls_context(unsafe { <::std::pin::Pin>::new_unchecked(&mut pinned) }) { ::std::task::Poll::Ready(result) => break result, ::std::task::Poll::Pending => {} } yield (); } } ``` However, this change has the following side-effects: - All temporaries in future will be considered to live across a yield for the purpose of auto-traits. - Borrowed temporaries in future are likely to be considered to be live across the yield for the purpose of the generator transform. Signed-off-by: David Wood <david@davidtw.co>
2019-09-09Use slice patterns to match projection baseSantiago Pastorino-4/+1
2019-09-09Convert Place's projection to a boxed sliceSantiago Pastorino-248/+124
2019-09-09Rollup merge of #63468 - c410-f3r:attrs, r=petrochenkovMazdak Farrokhzad-1/+57
Resolve attributes in several places Resolve attributes for Arm, Field, FieldPat, GenericParam, Param, StructField and Variant. This PR is based on @petrochenkov work located at https://github.com/petrochenkov/rust/commit/83fdb8d598c1a871d40b21faed64ee698b74f814.
2019-09-09check_match: refactor + improve non-exhaustive diag for default binding modes.Mazdak Farrokhzad-0/+18
2019-09-09Resolve attributes in several placesCaio-1/+57
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-09Shrink `ObligationCauseCode` by boxing `IfExpression`.Nicholas Nethercote-15/+21
The reduction in `memcpy` calls outweighs the cost of the extra allocations, for a net performance win.