about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/sty.rs
AgeCommit message (Collapse)AuthorLines
2021-09-24Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakisJubilee-2/+5
Be explicit about using Binder::dummy This is somewhat of a late followup to the binder refactor PR. It removes `ToPredicate` and `ToPolyTraitImpls` that hide the use of `Binder::dummy`. While this does make code a bit more verbose, it allows us be more careful about where we create binders. Another alternative here might be to add a new trait `ToBinder` or something with a `dummy()` fn. Which could still allow grepping but allows doing something like `trait_ref.dummy()` (but I also wonder if longer-term, it would be better to be even more explicit with a `bind_with_vars(ty::List::empty())` *but* that's not clear yet. r? ``@nikomatsakis``
2021-09-17introduce new fallback algorithmNiko Matsakis-0/+8
We now fallback type variables using the following rules: * Construct a coercion graph `A -> B` where `A` and `B` are unresolved type variables or the `!` type. * Let D be those variables that are reachable from `!`. * Let N be those variables that are reachable from a variable not in D. * All variables in (D \ N) fallback to `!`. * All variables in (D & N) fallback to `()`.
2021-09-15Remove ToPolyTraitRef impl for TraitRefjackh726-2/+5
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-2/+2
2021-08-27Add `ty::BoundConstness`Deadbeef-1/+1
2021-08-26update `TypeFlags` to deal with missing ct substslcnr-10/+10
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-1/+1
same search
2021-08-22Fix typos “a”→“an”Frank Steffahn-2/+2
2021-08-13move Constness into TraitPredicateDeadbeef-1/+4
2021-07-05Convert `debug_assert!` to `assert!` in `Binder::dummy`Yuki Okushi-1/+1
This is needed for #85350 not to be passed.
2021-07-03Remove `ty::Binder::bind()`Yuki Okushi-8/+0
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2021-06-27Derive `Copy` for `VarianceDiagInfo`Aaron Hill-2/+2
2021-06-23Use HTTPS links where possibleSmitty-2/+2
2021-06-06Add variance-related information to lifetime error messagesAaron Hill-0/+52
2021-06-05Auto merge of #85919 - workingjubilee:simd-ptrs-are-valid, r=petrochenkovbors-5/+0
Allow raw pointers in SIMD types Closes #85915 by loosening the strictness in typechecking and adding a test to guarantee it passes. This still might be too strict, as references currently do pass monomorphization, but my understanding is that they are not guaranteed to be "scalar" in the same way.
2021-06-02Inline is_machine into check_simdJubilee Young-8/+0
2021-06-02Add `Ty::is_union` predicate and use itTomasz Miąsko-0/+5
2021-06-02Implement `Ty::is_enum` using `matches!`Tomasz Miąsko-4/+1
2021-06-01Allow raw pointers in SIMD typesJubilee Young-1/+4
2021-05-22Make THIR building a stealable queryLeSeulArtichaut-1/+1
2021-04-08Fix outdated crate names in compiler docspierwill-2/+2
Changes `librustc_X` to `rustc_X`, only in documentation comments. Plain code comments are left unchanged. Also fix incorrect file paths.
2021-03-31Add var to BoundRegion. Add query to get bound vars for applicable items.Jack Huey-34/+33
2021-03-31Track bound varsJack Huey-43/+26
2021-03-31Add tcx lifetime to BinderJack Huey-41/+41
2021-03-31count bound varsJack Huey-6/+44
2021-03-31Add u32 for bound variables to BinderJack Huey-10/+11
2021-03-27Address more review commentsJoshua Nelson-0/+14
- Add back various diagnostic methods on `Session`. It seems unfortunate to duplicate these in so many places, but in the meantime, making the API inconsistent between `Session` and `Diagnostic` also seems unfortunate. - Add back TyCtxtAt methods These will hopefully be used in the near future. - Add back `with_const`, it would need to be added soon after anyway. - Add back `split()` and `get_mut()`, they're useful.
2021-03-27Remove (lots of) dead codeJoshua Nelson-80/+1
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-26fix doc comment for `ty::Dynamiclcnr-1/+1
2021-03-06Change x64 size checks to not apply to x32.Harald van Dijk-1/+1
Rust contains various size checks conditional on target_arch = "x86_64", but these checks were never intended to apply to x86_64-unknown-linux-gnux32. Add target_pointer_width = "64" to the conditions.
2021-02-26Miscellaneous inlining improvementsTomasz Miąsko-0/+4
Inline a few small and hot functions.
2021-02-24Auto merge of #82159 - BoxyUwU:uwu, r=varkorbors-47/+0
Use correct param_env in conservative_is_privately_uninhabited cc `@lcnr` r? `@varkor` since this is your FIXME that was removed ^^
2021-02-23yeetEllen-47/+0
2021-02-18Rollup merge of #82066 - matthewjasper:trait-ref-fix, r=jackh726Dylan DPC-29/+41
Ensure valid TraitRefs are created for GATs This fixes `ProjectionTy::trait_ref` to use the correct substs. Places that need all of the substs have been updated to not use `trait_ref`. r? ````@jackh726````
2021-02-15Parameterize `DynMetadata` over its `dyn SomeTrait` typeSimon Sapin-1/+4
2021-02-15Add `ptr::Pointee` trait (for all types) and `ptr::metadata` functionSimon Sapin-0/+45
RFC: https://github.com/rust-lang/rfcs/pull/2580
2021-02-13Make ProjectionTy::trait_ref truncate substs againMatthew Jasper-11/+26
Also make sure that type arguments of associated types are printed in some error messages.
2021-02-13Avoid `trait_ref` when lowering ExistentialProjectionsMatthew Jasper-5/+18
2021-02-13Remove ProjectionTy::from_ref_and_nameMatthew Jasper-16/+0
2021-02-12Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnrbors-0/+9
Try fast_reject::simplify_type in coherence before doing full check This is a reattempt at landing #69010 (by `@jonas-schievink).` The change adds a fast path for coherence checking to see if there's no way for types to unify since full coherence checking can be somewhat expensive. This has big effects on code generated by the [`windows`](https://github.com/microsoft/windows-rs) which in some cases spends as much as 20% of compilation time in the `specialization_graph_of` query. In local benchmarks this took a compilation that previously took ~500 seconds down to ~380 seconds. This is surely not going to make a difference on much smaller crates, so the question is whether it will have a negative impact. #69010 was closed because some of the perf suite crates did show small regressions. Additional discussion of this issue is happening [here](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/windows-rs.20perf).
2021-02-12Short circuit full corherence check when dealing with types with different ↵Ryan Levick-0/+9
reference mutability
2021-02-04use generic arguments of associated item in trait_ref methodb-naber-1/+9
2021-02-02Bump rustfmt versionMark Rousskov-2/+8
Also switches on formatting of the mir build module
2021-01-18Use `rustc_type_ir::{IntTy,UintTy,FloatTy} instead of the `rustc_ast` ones ↵LeSeulArtichaut-9/+8
in types
2021-01-18Move a few more types to `rustc_type_ir`LeSeulArtichaut-56/+1
2021-01-17Whitespace and typoJack Huey-1/+1
2021-01-17Add comment about Encodable/Decodable implJack Huey-0/+2
2021-01-17Don't derive TyEncodable/TyDecodable for BinderJack Huey-1/+1
2021-01-14Don't ICE when computing a layout of a generator tainted by errorsTomasz Miąsko-2/+2
2020-12-27Also show the displayed version of IntVar and FloatVarCamelid-2/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>