about summary refs log tree commit diff
path: root/src/librustc_mir
AgeCommit message (Collapse)AuthorLines
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-5/+5
2019-08-26Auto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavisbors-3/+3
Point at method call on missing annotation error Make it clearer where the type name that couldn't be inferred comes from. Before: ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:13 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S` | = note: type must be known at this point ``` after ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:39 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^ cannot infer type for `S` | = note: type must be known at this point ``` CC #63852.
2019-08-26Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obkbors-267/+291
Move promoted MIR out of `mir::Body` r? @oli-obk
2019-08-25Point at method call on missing annotation errorEsteban Küber-3/+3
Make it clearer where the type name that couldn't be infered comes from.
2019-08-25Permit unwinding through FFI by defaultMark Rousskov-1/+1
See #58794 for context.
2019-08-25Auto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centrilbors-2/+2
Places drive by cleanups Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @centril reviews.
2019-08-24Add a period at the end of the sentenceSantiago Pastorino-1/+1
2019-08-24Allow lifetime parameters to be inferredSantiago Pastorino-1/+1
2019-08-25Rollup merge of #63859 - matthewjasper:check-snippet-result, r=CentrilMazdak Farrokhzad-43/+45
Don't unwrap the result of `span_to_snippet` Closes #63800
2019-08-24Don't unwrap the result of `span_to_snippet`Matthew Jasper-43/+45
It can return `Err` due to macros being expanded across crates or files.
2019-08-24Ensure miri can do bit ops on pointer valuesOliver Scherer-12/+16
2019-08-22Handle statics in `Subst::subst()` by implementing `TypeFoldable`Wesley Wiser-15/+0
2019-08-22Resolve PR commentsWesley Wiser-127/+72
2019-08-22Remove unnecessary OptionWesley Wiser-5/+4
2019-08-22Fix tidyWesley Wiser-11/+30
2019-08-22Move def_id out add substsrefWesley Wiser-81/+102
2019-08-22Remove eval_promoted const-prop hackWesley Wiser-26/+10
2019-08-22Move promoted out of mir::BodyWesley Wiser-89/+160
2019-08-22Move 'tcx lifetime on MirPassWesley Wiser-48/+48
2019-08-20Auto merge of #63497 - eddyb:miri-subst, r=oli-obkbors-76/+60
rustc_mir: fix miri substitution/"universe" discipline. Alternative to #61041, based on @RalfJung's own attempt at it. I haven't done a full audit, but I believe everything is fixed now. Fixes #61432. Closes #61336, as a drive-by fix (for a subset of #43408, that is already special-cased). r? @oli-obk / @RalfJung cc @varkor @yodaldevoid
2019-08-19Rollup merge of #63699 - gilescope:async-move-diagnostic, r=estebankMazdak Farrokhzad-1/+10
Fix suggestion from incorrect `move async` to `async move`. PR for #61920. Happy with the test. There must be a better implementation though - possibly a MIR visitor to estabilsh a span that doesn't include the `async` keyword?
2019-08-19distinguish object-lifetime-default elision from other elisionNiko Matsakis-1/+2
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-19Fix suggestion from move async to async move.Giles Cope-1/+10
2019-08-19rustc_mir: disallow non-monomorphic reifications.Eduard-Mihai Burtescu-1/+11
2019-08-19rustc_mir: disallow non-monomorphic vtables.Eduard-Mihai Burtescu-1/+6
2019-08-19rustc_mir: add missing subst_from_frame_and_normalize_erasing_regions calls.Eduard-Mihai Burtescu-1/+4
2019-08-19rustc_mir: use self.resolve instead of Instance::resolve where possible.Eduard-Mihai Burtescu-6/+1
2019-08-19rustc_mir: make subst_from_frame_and_normalize_erasing_regions infallible.Eduard-Mihai Burtescu-17/+10
2019-08-19rustc_mir: remove wrong calls to subst_from_frame_and_normalize_erasing_regions.Eduard-Mihai Burtescu-2/+0
2019-08-19start cleaning up subst messRalf Jung-58/+38
fix an ICE fix method name
2019-08-19Auto merge of #63463 - matthewjasper:ty_param_cleanup, r=petrochenkovbors-1/+1
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-1/+1
Use this to simplify the object safety code a bit.
2019-08-18Auto merge of #61708 - dlrobertson:or-patterns-0, r=centrilbors-11/+55
Initial implementation of or-patterns An incomplete implementation of or-patterns (e.g. `Some(0 | 1)` as a pattern). This patch set aims to implement initial parsing of `or-patterns`. Related to: #54883 CC @alexreg @varkor r? @Centril
2019-08-17Auto merge of #63671 - Centril:rollup-zufavt5, r=Centrilbors-1/+1
Rollup of 5 pull requests Successful merges: - #62451 (Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked)) - #63487 (Remove meaningless comments in src/test) - #63657 (Crank up invalid value lint) - #63667 (resolve: Properly integrate derives and `macro_rules` scopes) - #63669 (fix typos in mir/interpret) Failed merges: r? @ghost
2019-08-17fix typosDante-Broggi-1/+1
2019-08-17initial implementation of or-pattern parsingDan Robertson-3/+6
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`. This is a partial implementation of RFC 2535.
2019-08-17Initial implementation of or patternsvarkor-14/+55
2019-08-17use ImmTy::from_uint in a few more spotsRalf Jung-18/+9
2019-08-17make both unary_op and binary_op fully typed, including a return typeRalf Jung-69/+90
2019-08-17Add ImmTy::from_uintRalf Jung-5/+13
2019-08-17Rollup merge of #63642 - eddyb:wrap-it-up, r=rkruppe,Mark-SimulacrumMazdak Farrokhzad-12/+12
Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}. These confused @Gankra, and then, also me, especially since `overflowing_*` *methods* also exist, but they map to `*_with_overflow` intrinsics! r? @oli-obk / @nikomatsakis cc @Mark-Simulacrum (on the rustbuild workaround)
2019-08-16Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.Eduard-Mihai Burtescu-12/+12
2019-08-16rustc_mir: use the right type for associated const literals.Eduard-Mihai Burtescu-1/+1
2019-08-16rustc_mir: add sanity asserts for the types of `ty::Const`s.Eduard-Mihai Burtescu-0/+6
2019-08-16Remove redundant `ty` fields from `mir::Constant` and ↵Eduard-Mihai Burtescu-105/+41
`hair::pattern::PatternRange`.
2019-08-15Rollup merge of #63586 - petrochenkov:nospanned, r=eddybMazdak Farrokhzad-2/+2
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-15don't add Retag statements for compound typesRalf Jung-13/+9
2019-08-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-2/+2
2019-08-14Rollup merge of #63075 - RalfJung:deref-checks, r=oli-obkMazdak Farrokhzad-9/+41
Miri: Check that a ptr is aligned and inbounds already when evaluating `*` This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447. Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;) r? @oli-obk
2019-08-14Rollup merge of #62760 - chansuke:dedupe-error-messages, r=zackmdavisMazdak Farrokhzad-9/+8
Deduplicate error messages in `librsctc_mir` Deduplicated the error messages in `librustc_mir`. #62022