about summary refs log tree commit diff
path: root/src/librustc/traits/object_safety.rs
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-909/+0
2020-02-11Run RustFmtjumbatm-2/+10
2020-02-11Invert control in struct_lint_level.jumbatm-27/+29
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-08Make `associated_items` query return a sliceJonas Schievink-1/+5
2020-02-03Change wording for object unsafe because of assoc constEsteban Küber-5/+3
2020-02-02Point at reason in object unsafe trait with `Self` in supertraits or ↵Esteban Küber-16/+38
`where`-clause
2020-02-02Use more appropriate spans on object unsafe traits and provide structured ↵Esteban Küber-26/+77
suggestions when possible
2020-02-02Wording changes to object unsafe trait errorsEsteban Küber-8/+45
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02review commentsEsteban Küber-3/+3
2020-02-02Remove duplicated codeEsteban Küber-8/+1
2020-02-02Slight rewording of diagnostic messageEsteban Küber-1/+1
2020-02-02Point at the `Sized` obligation in `where` clausesEsteban Küber-4/+35
2020-02-02Tweak `Self: Sized` restriction diagnostic outputEsteban Küber-28/+35
2020-02-02Point at `Sized` boundEsteban Küber-7/+33
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-2/+4
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-2/+2
2020-01-11reduce diversity in linting methodsMazdak Farrokhzad-3/+4
2020-01-11canonicalize some lint importsMazdak Farrokhzad-3/+4
2020-01-07Make ↵Camille GILLOT-43/+41
rustc::traits::object_safety::{astconv_object_safety_violations,is_vtable_safe_method,object_safety_violations} free functions.
2020-01-07Remove private methods from TyCtxt impl block: rustc::trait::object_safety.Camille GILLOT-501/+508
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-147/+137
2019-10-26Update comments re type parameter hack in object safetyMichael Hewson-5/+7
To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue https://github.com/rust-lang/rust/issues/43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.
2019-10-21Convert some `InternedString`s to `Symbols`.Nicholas Nethercote-2/+2
This avoids the needs for various conversions, and makes the code slightly faster, because `Symbol` comparisons and hashing is faster.
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-11/+11
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-3/+4
2019-09-03review commentsEsteban Küber-1/+3
2019-09-02account for DUMMY_SP and correct wordingEsteban Küber-4/+4
2019-09-02On object safety violation, point at source when possibleEsteban Küber-21/+33
2019-09-02Refer to "`self` type" instead of "receiver type"Esteban Küber-7/+9
2019-08-18Pre intern the `Self` parameter typeMatthew Jasper-34/+21
Use this to simplify the object safety code a bit.
2019-08-11Remove `is_self` and `has_self_ty` methodsMatthew Jasper-63/+81
2019-07-03Remove needless lifetimesJeremy Stucki-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-2/+2
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-3/+1
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-2/+2
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-2/+2
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-10/+10
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-20Introduce `InternedString::intern`.Nicholas Nethercote-2/+3
`InternedString::intern(x)` is preferable to `Symbol::intern(x).as_interned_str()`, because the former involves one call to `with_interner` while the latter involves two. The case within InternedString::decode() is particularly hot, and this change reduces the number of `with_interner` calls by up to 13%.
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-1/+1
2019-03-05Handle const generics elsewherevarkor-1/+2
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-27rename Substs to InternalSubstscsmoe-9/+13
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-24hir: remove NodeId from Blockljedrz-1/+2
2019-02-10rustc: doc commentsAlexander Regueiro-19/+21
2019-02-05move librustc to 2018Mark Mansi-6/+6
2019-01-11Auto merge of #57355 - arielb1:correct-subst, r=nikomatsakisbors-9/+24
use the correct supertrait substitution in `object_ty_for_trait` beta-nominating because regression. Fixes #57156.