summary refs log tree commit diff
path: root/src/librustc/ty/error.rs
AgeCommit message (Collapse)AuthorLines
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
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-3/+3
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-3/+3
2016-05-11rustc: Always refer to TyCtxt as tcx.Eduard Burtescu-4/+4
2016-04-06rustc: move middle::{def,def_id,pat_util} to hir.Eduard Burtescu-1/+1
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-1/+1
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-0/+343