about summary refs log tree commit diff
path: root/src/librustc/ich
AgeCommit message (Collapse)AuthorLines
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-1/+2
fixes remaining test failures
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-6/+6
2018-12-04cleanup: remove static lifetimes from constsljedrz-8/+8
2018-12-04Emit feature gate suggestionOliver Scherer-1/+2
2018-12-04syntax: Remove `#[non_exhaustive]` from `Edition`Vadim Petrochenkov-8/+4
`Edition` is not a public API, we want users to break when a new edition is added
2018-12-03s/AllocType/AllocKind/Oliver Scherer-1/+1
2018-12-03Monomorphize `AllocType`Oliver Scherer-1/+1
2018-12-03Retag needs to know whether this is a 2-phase-reborrowRalf Jung-45/+12
2018-12-02Remove not used `DotEq` tokenyui-knk-1/+0
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-11-26Auto merge of #56070 - oli-obk:const_let, r=eddybbors-0/+1
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
2018-11-25Auto merge of #55921 - scalexm:placeholders, r=nikomatsakisbors-2/+7
Add placeholder types Fixes #48696 (handle universes in canonicalization of type inference vars), and fixes #55098.
2018-11-25Auto merge of #55959 - matthewjasper:remove-end-region, r=nikomatsakisbors-3/+0
Cleanup from lexical MIR borrowck removal Lexical MIR borrowck was removed months ago now, and `EndRegion`s are no longer used for MIRI verification. * Remove `rustc::mir::StatementKind::EndRegion` and the `-Zemit_end_regions` flag * Use `RegionVid` instead of `Region` in BorrowSet * Rewrite drop generation to create fewer goto terminators. r? @nikomatsakis
2018-11-24Move `BoundTy` debruijn index to the `TyKind` enum variantscalexm-1/+2
2018-11-24Handle placeholder types in canonicalizationscalexm-1/+2
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+3
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-2/+1
2018-11-19Make const_eval_raw query return just an AllocIdRalf Jung-0/+4
2018-11-19Also catch static mutation at evaluation timeOliver Scherer-0/+1
2018-11-19Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obkPietro Albini-3/+3
Miri backtrace improvements Nicer pretty-printing of the `RUST_CTFE_BACKTRACE`-backtraces: ``` 0: backtrace::backtrace::libunwind::trace::hc410fcb66fe85b11 at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/libunwind.rs:53 backtrace::backtrace::trace::h2106294a22648407 at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/mod.rs:42 1: backtrace::capture::Backtrace::new_unresolved::h5d8d98b993d092ba at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/capture.rs:88 2: <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx, u64>>>::from::h6355269b2a661412 at librustc/mir/interpret/error.rs:236 3: <T as core::convert::Into<U>>::into::h70fcb917509539bd at /home/r/src/rust/rustc.2/src/libcore/convert.rs:455 4: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::emulate_foreign_item::h9cde0e3ce7455a4a at src/fn_call.rs:292 5: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::find_fn::h83f89524b9d1a49a at src/fn_call.rs:74 6: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'a, 'mir, 'tcx>>::find_fn::hf9980473c4775f0c at src/lib.rs:345 rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call::h401dec4a687f96e9 at /home/r/src/rust/rustc.2/src/librustc_mir/interpret/terminator.rs:285 ``` Indentation is now consistent with `RUST_BACKTRACE`, and the frame number is not repeated when there are multiple symbols for a frame. Also preserve the `ty::Instance` for the internal backtrace (showing which frames in the user code where on the interpreter stack when the error happened), used by miri to avoid printing spans for libstd internals: ``` error[E0080]: constant evaluation error: the evaluated program panicked --> /home/r/src/rust/rustc.2/src/libstd/panicking.rs:525:9 | 525 | __rust_start_panic(obj as usize) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked | = note: inside call to `std::panicking::rust_panic` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:496:5 = note: inside call to `std::panicking::rust_panic_with_hook` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:390:5 = note: inside call to `std::panicking::continue_panic_fmt` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:345:5 note: inside call to `std::rt::begin_panic_fmt` at <::std::macros::panic macros>:8:1 --> tests/compile-fail/panic.rs:4:5 | 4 | assert_eq!(5, 6); | ^^^^^^^^^^^^^^^^^ = note: inside call to `main` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:34 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:75 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/sys_common/backtrace.rs:136:5 = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1913 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:13 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:310:40 = note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:306:5 = note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/src/rust/rustc.2/src/libstd/panic.rs:398:9 = note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:58:25 = note: inside call to `std::rt::lang_start_internal` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:5 = note: inside call to `std::rt::lang_start::<()>` ``` Also notice that we show filenames and line numbers here now. r? @oli-obk
2018-11-19Rollup merge of #55953 - blitzerr:master, r=nikomatsakisPietro Albini-1/+3
#53488 Refactoring UpvarId
2018-11-18Rollup merge of #55894 - RalfJung:validation-enums, r=oli-obkPietro Albini-1/+6
miri enum discriminant handling: Fix treatment of pointers, better error when it is undef r? @oli-obk
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-3/+0
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-15Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoeristerPietro Albini-2/+9
Make `NodeId` and `HirLocalId` `newtype_index`
2018-11-15do not accept out-of-bounds pointers in enum discriminants, they might be NULLRalf Jung-1/+6
2018-11-15rename FrameInfo span field to call_siteRalf Jung-1/+1
2018-11-14capture_disjoint_fields(rust-lang#53488)Blitzerr-1/+3
Refactoring out the HirId of the UpvarId in another struct.
2018-11-15Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obkbors-0/+3
Add escape-to-raw MIR statement Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses. ~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
2018-11-14miri: backtraces with instancesRalf Jung-2/+2
2018-11-12Turn `HirLocalId` into a `newtype_index`Oliver Scherer-2/+9
2018-11-07no more action on ref or cast, but add new MIR statement for escaping a ptr ↵Ralf Jung-0/+3
to raw
2018-11-06impl_stable_hash_for: support enums and tuple structs with generic parametersRalf Jung-355/+142
2018-11-03Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakisbors-0/+17
Implement trait aliases (RFC 1733) Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733. CC @durka @nikomatsakis
2018-11-03Remove `ReCanonical` in favor of `ReLateBound`scalexm-3/+0
2018-11-03Rename `BoundTyIndex` to `BoundVar`scalexm-1/+1
2018-11-03Move `BoundTy` to `ty::TyKind`scalexm-1/+3
2018-11-03Added support for trait aliases as bounds.Alexander Regueiro-0/+17
2018-11-02Auto merge of #55316 - RalfJung:retagging, r=oli-obkbors-20/+3
Add Retagging statements This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year. NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
2018-11-02Auto merge of #55305 - nikomatsakis:universes-refactor-3, r=scalexmbors-2/+3
universes refactor 3 Some more refactorings from my universe branch. These are getting a bit more "invasive" -- they start to plumb the universe information through the canonicalization process. As of yet though I don't **believe** this branch changes our behavior in any notable way, though I'm marking the branch as `WIP` to give myself a chance to verify this. r? @scalexm
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-2/+2
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-20/+3
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-28remove some unused CTFE error variantsRalf Jung-42/+0
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-0/+3
Implement by-value object safety This PR implements **by-value object safety**, which is part of unsized rvalues #48055. That means, with `#![feature(unsized_locals)]`, you can call a method `fn foo(self, ...)` on trait objects. One aim of this is to enable `Box<FnOnce>` in the near future. The difficulty here is this: when constructing a vtable for a trait `Foo`, we can't just put the function `<T as Foo>::foo` into the table. If `T` is no larger than `usize`, `self` is usually passed directly. However, as the caller of the vtable doesn't know the concrete `Self` type, we want a variant of `<T as Foo>::foo` where `self` is always passed by reference. Therefore, when the compiler encounters such a method to be generated as a vtable entry, it produces a newly introduced instance called `InstanceDef::VtableShim(def_id)` (that wraps the original instance). the shim just derefs the receiver and calls the original method. We give different symbol names for the shims by appending `::{{vtable-shim}}` to the symbol path (and also adding vtable-shimness as an ingredient to the symbol hash). r? @eddyb
2018-10-27extend query response to potentially contain fresh universesNiko Matsakis-0/+1
The idea here is that an incoming query may refer to some universes, and they query response may contain fresh universes that go beyond those. When we instantiate the query response in the caller's scope, therefore, we map those new universes into fresh universes for the caller.
2018-10-27allow canonicalized regions to carry universe and track max-universeNiko Matsakis-2/+2
But.. we don't really use it for anything right now.
2018-10-26Add the actual chain of projections to `UserTypeProjection`.Felix S. Klock II-1/+1
Update the existing NLL `patterns.rs` test accordingly. includes changes addressing review feedback: * Added example to docs for `UserTypeProjections` illustrating how we build up multiple projections when descending into a pattern with type ascriptions. * Adapted niko's suggested docs for `UserTypeProjection`. * Factored out `projection_ty` from more general `projection_ty_core` (as a drive-by, made its callback an `FnMut`, as I discovered later that I need that). * Add note to docs that `PlaceTy.field_ty(..)` does not normalize its result. * Normalize as we project out `field_ty`.
2018-10-26Checkpoint: Added abstraction over collection of projections into user type.Felix S. Klock II-0/+1
I did not think I would need this in the MIR, but in general local decls are going to need to support this. (That, or we need to be able define a least-upper-bound for a collection of types encountered via the pattern compilation.)
2018-10-26Added `mir::UserTypeProjection`, a stub for a structure that projects *into* ↵Felix S. Klock II-0/+2
a given UserTypeAnnotation. (That is, it will pull out some component type held or referenced by the type annotation.) Note: this still needs to actually do projection itself. That comes in a later commit
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-8/+4
Report const eval error inside the query Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized. r? @RalfJung fixes #53561
2018-10-26dump refs for path segments in save-analysisNick Cameron-0/+1
Requires adding path segments to the hir map
2018-10-26Store a resolved def on hir::PathSegmentNick Cameron-0/+1