about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-09-21Rollup merge of #64342 - glorv:master, r=varkorMazdak Farrokhzad-1/+1
factor out pluralisation remains after #64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) as the provided param is already a bool or the check condition is not `x != 1`, so I change the macro accept a boolean expr instead of number to fit all the cases. @Centril please review Fixes #64238.
2019-09-21rename is_async_fn to asyncnesscsmoe-5/+6
2019-09-19append asyncness info to functionscsmoe-0/+15
2019-09-19Rollup merge of #64601 - grovesNL:two-backticks, r=jonas-schievinkMazdak Farrokhzad-1/+1
Fix backticks in documentation Fix a few typos in comments/documentation where backticks were doubled-up on one side.
2019-09-19Rollup merge of #63448 - RalfJung:miri-discriminant, r=eddybMazdak Farrokhzad-0/+11
fix Miri discriminant handling This can be reviewed commit-by-commit fairly well. The Miri side is at https://github.com/rust-lang/miri/pull/903. Fixes https://github.com/rust-lang/rust/issues/62138 r? @eddyb @oli-obk
2019-09-20factor out pluralisation remains after #64280gaolei-1/+1
2019-09-18Fix backticks in documentationJoshua Groves-1/+1
2019-09-18Add explanation to type mismatch involving type params and assoc typesEsteban Küber-4/+92
2019-09-17Privatize DiagnosticBuilder constructorsMark Rousskov-4/+3
2019-09-16`AdtDef` is an algebraic data type, not abstract data type.Mazdak Farrokhzad-1/+7
2019-09-16factor getting the discriminant layout to a new methodRalf Jung-0/+11
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-15Permit impls referencing errors to overlapMark Rousskov-0/+7
2019-09-14fix #6443012101111-3/+3
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-09check_match: refactor + improve non-exhaustive diag for default binding modes.Mazdak Farrokhzad-0/+18
2019-09-08Refactor PluralisationV1shvesh-6/+1
Modify files performing pluralisation checks to incorporate the dedicated macro located in `syntax::errors`.
2019-09-07Apply suggestions from code reviewAlexander Regueiro-39/+30
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-323/+341
2019-09-06Correct pluralisation of various diagnostic messagesvarkor-1/+3
2019-09-05Rollup merge of #64141 - nnethercote:minimize-LocalInternedString, ↵Mazdak Farrokhzad-5/+1
r=petrochenkov Minimize uses of `LocalInternedString` `LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values." This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
2019-09-05Rollup merge of #64038 - matthewjasper:deny-mutual-impl-trait-recursion, ↵Mazdak Farrokhzad-2/+4
r=varkor Check impl trait substs when checking for recursive types closes #64004
2019-09-04Remove `LocalInternedString` uses from `librustc/ty/`.Nicholas Nethercote-5/+1
This is not a compelling change in isolation, but it is a necessary step.
2019-09-03Rollup merge of #64104 - Mark-Simulacrum:intrinsic-fn-ptr-ice, r=estebankMazdak Farrokhzad-0/+7
Emit error on intrinsic to fn ptr casts I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway. Fixes #15694
2019-09-03Rollup merge of #64056 - estebank:arbitrary-self-types, r=CentrilMazdak Farrokhzad-0/+6
Account for arbitrary self types in E0599 Fix https://github.com/rust-lang/rust/issues/62373
2019-09-02Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obkbors-2/+8
Make Allocation::bytes private Fixes #62931. Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic. cc: @RalfJung
2019-09-02Emit error on intrinsic to fn ptr castsMark Rousskov-0/+7
2019-09-01review commentsEsteban Küber-14/+2
2019-09-01Account for arbitrary self types in E0599Esteban Küber-0/+18
2019-08-31Check impl trait substs when checking for recursive typesMatthew Jasper-2/+4
This prevents mutual `async fn` recursion
2019-08-30Add a "diagnostic item" schemeOliver Scherer-0/+23
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 #63914 - hvenev:repr-fields, r=eddybMazdak Farrokhzad-41/+36
ty: use Align for ReprOptions pack and align.
2019-08-29Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebankMazdak Farrokhzad-10/+10
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-10/+10
2019-08-27Add default serialization for `Ident`sMatthew Jasper-2/+23
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
2019-08-26ty: use Align for ReprOptions pack and align.Hristo Venev-41/+36
2019-08-26Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obkbors-1/+11
Move promoted MIR out of `mir::Body` r? @oli-obk
2019-08-25Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkovMazdak Farrokhzad-1/+1
Suggest calling closure with resolved return type when appropriate Follow up to #63337. CC #63100. ``` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:46:20 | LL | let closure = || 42; | -- closure defined here LL | let _: usize = closure; | ^^^^^^^ | | | expected usize, found closure | help: use parentheses to call this closure: `closure()` | = note: expected type `usize` found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` ```
2019-08-24review commentEsteban Küber-1/+0
2019-08-23Suggest calling closure with resolved return type when appropriateEsteban Küber-1/+2
2019-08-23incremental: Do not rely on default transparency when decoding syntax contextsVadim Petrochenkov-10/+10
Using `ExpnId`s default transparency here instead of the mark's real transparency was actually incorrect.
2019-08-22Move promoted out of mir::BodyWesley Wiser-1/+11
2019-08-21review comments: reword and add testEsteban Küber-2/+2
2019-08-21Add clarification on E0308 about opaque typesEsteban Küber-0/+1
2019-08-21Fix typo in E0308 if/else labelEsteban Küber-5/+16
2019-08-21Remove some duplication when resolving constantsOliver Scherer-28/+20
2019-08-19Auto merge of #63463 - matthewjasper:ty_param_cleanup, r=petrochenkovbors-69/+29
Don't special case the `Self` parameter by name This results in a couple of small diagnostic regressions. They could be avoided by keeping the special case just for diagnostics, but that seems worse. closes #50125 cc #60869
2019-08-18Pre intern the `Self` parameter typeMatthew Jasper-4/+5
Use this to simplify the object safety code a bit.
2019-08-17Store allocation size, make bytes, undef_mask privateAndreas Molzer-2/+8
Direct access to the bytes was previously a problem (#62931) where components would read their contents without properly checking relocations and/or definedness. Making bytes private instead of purely renaming them also helps in allowing amendments to their allocation scheme (such as eliding allocation for undef of constant regions).