summary refs log tree commit diff
path: root/src/librustc/ty/error.rs
AgeCommit message (Collapse)AuthorLines
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-13add `canonicalize` method to `InferCtxt` [VIC]Niko Matsakis-0/+1
2018-03-08Revert all changes to the instcombine passOliver Schneider-1/+1
2018-03-08Report errors in statics during collecting instead of translatingOliver Schneider-6/+2
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-4/+0
2018-03-08Produce instead of pointersOliver Schneider-4/+7
2018-03-01kill supporting code from type-variable defaultsNiko Matsakis-44/+1
This was all unused anyway.
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-0/+1
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2017-12-19Closure type error ui tweakEsteban Küber-4/+2
Do not point at the same span on all notes/help messages, and instead show them without a span.
2017-11-18give better error messages when a cycle arisesNiko Matsakis-2/+14
2017-11-17issue better error message when LUB/GLB diverge under new behaviorNiko Matsakis-0/+6
2017-11-17make LUB/GLB of higher-ranked things actually do EQNiko Matsakis-0/+5
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-0/+1
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-3/+10
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-1/+3
2017-09-01rustc: take TyCtxt and RegionMaps in CodeMap::span.Eduard-Mihai Burtescu-35/+2
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-7/+7
2017-07-29Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lintVadim Petrochenkov-7/+7
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+1
2017-07-11Downgrade ProjectionTy's TraitRef to its substsTobias Schottdorf-6/+6
Addresses the second part of #42171 by removing the `TraitRef` from `ProjectionTy`, and directly storing its `Substs`. Closes #42171.
2017-05-02Rollup merge of #41662 - nikomatsakis:on-demandify-region-mapping, r=eddybCorey Farwell-5/+5
On demandify region mapping This is an adaptation of @cramertj's PR. I am sort of tempted to keep simplifying it, but also tempted to land it so and we can refactor more in follow-up PRs. As is, it does the following things: - makes the region-maps an on-demand query, per function `tcx.region_maps(def_id)` - interns code extents instead of of having them be integers - remove the "root region extent" and (to some extent) item extents; instead we use `Option<CodeExtent<'tcx>>` in a few places (no space inefficiency since `CodeExtent<'tcx>` is now a pointer). I'm not entirely happy with the way I have it setup though. Here are some of the changes I was considering (I'm not sure if they would work out well): 1. Removing `item_extents` entirely -- they are rarely used now, because most of the relevant places now accept an `Option<Region<'tcx>>` or an `Option<CodeExtent<'tcx>>`, but I think still used in a few places. 2. Merging `RegionMaps` into the typeck tables, instead of having it be its own query. 3. Change `CodeExtent<'tcx>` to store the parent pointer. This would mean that fewer places in the code actually *need* a `RegionMaps` anyhow, since most of them just want to be able to walk "up the tree". On the other hand, you wouldn't be able to intern a `CodeExtent<'tcx>` for some random node-id, you'd need to look it up in the table (since there'd be more information). Most of this code is semi-temporary -- I expect it to largely go away as we move to NLL -- so I'm also not *that* concerned with making it perfect. r? @eddyb
2017-04-30intern CodeExtentsNiko Matsakis-5/+5
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-23Avoid spurious ` ` in lifetime diagnosticsEsteban Küber-4/+8
2017-03-26store a copy of the Issue32230 info within TypeErrorAriel Ben-Yehuda-7/+7
The data can't be looked up from the region variable directly, because the region variable might have been destroyed at the end of a snapshot. Fixes #40000. Fixes #40743.
2017-03-13some style fixesTshepang Lekhonkhobe-1/+1
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-3/+5
2017-02-03Add warning for () to ! switchAndrew Cann-2/+2
2017-01-30Merge ty::TyBox into ty::TyAdtVadim Petrochenkov-1/+0
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-2/+2
2016-11-30Auto merge of #37954 - eddyb:rustdoc-2, r=alexcrichtonbors-8/+2
rustdoc: link to cross-crate sources directly. Fixes #37684 by implementing proper support for getting the `Span` of definitions across crates. In rustdoc this is used to generate direct links to the original source instead of fragile redirects. This functionality could be expanded further for making error reporting code more uniform and seamless across crates, although at the moment there is no actual source to print, only file/line/column information. Closes #37870 which is also "fixes" #37684 by throwing away the builtin macro docs from libcore. After this lands, #37727 could be reverted, although it doesn't matter much either way.
2016-11-30rustc: track the Span's of definitions across crates.Eduard-Mihai Burtescu-8/+2
2016-11-28Refactor TyTrait to contain a interned ExistentialPredicate slice.Mark-Simulacrum-2/+7
Renames TyTrait to TyDynamic.
2016-11-28Remove BuiltinBound and BuiltinBounds.Mark-Simulacrum-14/+0
2016-11-28Privatize TraitObject.principal and add a method accessor, returning Option.Mark-Simulacrum-1/+2
2016-09-28Remove unused `TypeError` variantsJonas Schievink-27/+0
These weren't flagged by the lint because they were still technically created somewhere... if you created them before, somehow.
2016-09-15Specify when type parameter shadows primitive typeEsteban Küber-1/+1
When a type parameter shadows a primitive type, the error message was non obvious. For example, given the file `file.rs`: ```rust trait Parser<T> { fn parse(text: &str) -> Option<T>; } impl<bool> Parser<bool> for bool { fn parse(text: &str) -> Option<bool> { Some(true) } } fn main() { println!("{}", bool::parse("ok").unwrap_or(false)); } ``` The output was: ```bash % rustc file.rs error[E0308]: mismatched types --> file.rs:7:14 | 7 | Some(true) | ^^^^ expected type parameter, found bool | = note: expected type `bool` = note: found type `bool` error: aborting due to previous error ``` We now show extra information about the type: ```bash % rustc file.rs error[E0308]: mismatched types --> file.rs:7:14 | 7 | Some(true) | ^^^^ expected type parameter, found bool | = note: expected type `bool` (type parameter) = note: found type `bool` (bool) error: aborting due to previous error ``` Fixes #35030
2016-09-08Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`Vadim Petrochenkov-7/+1
2016-09-03Add union typesVadim Petrochenkov-0/+3
2016-08-27rustc: pass ty::Region behind an interned 'tcx reference.Eduard Burtescu-6/+6
2016-08-19wording fixes in error messagesJonathan Turner-2/+2
2016-08-17rustc: remove SelfSpace from ParamSpace.Eduard Burtescu-2/+1
2016-08-17rustc: move trait objects from TraitRef to ExistentialTraitRef.Eduard Burtescu-1/+1
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-1/+1
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-14Rollup merge of #35611 - jonathandturner:ptr-helper, r=nikomatsakisEduard-Mihai Burtescu-1/+18
Improve &-ptr printing This PR replaces printing `&-ptr` with a more readable description. To do so it uses a few heuristics. If the name of the type is unknown, too long (longer than just saying "reference"), or too complex (a type with explicit lifetime annotations), it will instead opt to print either "reference" or "mutable reference", depending on the mutability of the type. Before: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found &-ptr | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ``` After: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found mutable reference | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ```
2016-08-13Rename empty/bang to neverAndrew Cann-1/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-1/+1
Add `TyKind::Empty` and fix resulting build errors.
2016-08-11Improve &-ptr printingJonathan Turner-1/+18
2016-08-12rustc: add TyAnon (impl Trait) to the typesystem.Eduard Burtescu-0/+1
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-2/+2
2016-05-11rustc: Generalize a minimum set of functions over 'tcx != 'gcx.Eduard Burtescu-3/+3