about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/print
AgeCommit message (Collapse)AuthorLines
2021-07-04Query-ify global limit attribute handlingAaron Hill-1/+1
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-1/+1
2021-06-12Pretty print generator witness only in `-Zverbose` modeTomasz Miąsko-3/+3
In release build of deeply-nested-async benchmark the size of `no-opt.bc` file is reduced from 46MB to 62kB.
2021-06-02Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-2/+2
2021-05-30Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-05-30Make resolutions a query.Camille GILLOT-1/+1
2021-05-18CTFE core engine allocation & memory API improvemenetsRalf Jung-7/+6
- make Allocation API offset-based (no more Pointer) - make Memory API higher-level (combine checking for access and getting access into one operation)
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-6/+4
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-12Use () for visible_parent_map.Camille GILLOT-6/+4
2021-05-12Auto merge of #83813 - cbeuw:remap-std, r=michaelwoeristerbors-3/+19
Fix `--remap-path-prefix` not correctly remapping `rust-src` component paths and unify handling of path mapping with virtualized paths This PR fixes #73167 ("Binaries end up containing path to the rust-src component despite `--remap-path-prefix`") by preventing real local filesystem paths from reaching compilation output if the path is supposed to be remapped. `RealFileName::Named` introduced in #72767 is now renamed as `LocalPath`, because this variant wraps a (most likely) valid local filesystem path. `RealFileName::Devirtualized` is renamed as `Remapped` to be used for remapped path from a real path via `--remap-path-prefix` argument, as well as real path inferred from a virtualized (during compiler bootstrapping) `/rustc/...` path. The `local_path` field is now an `Option<PathBuf>`, as it will be set to `None` before serialisation, so it never reaches any build output. Attempting to serialise a non-`None` `local_path` will cause an assertion faliure. When a path is remapped, a `RealFileName::Remapped` variant is created. The original path is preserved in `local_path` field and the remapped path is saved in `virtual_name` field. Previously, the `local_path` is directly modified which goes against its purpose of "suitable for reading from the file system on the local host". `rustc_span::SourceFile`'s fields `unmapped_path` (introduced by #44940) and `name_was_remapped` (introduced by #41508 when `--remap-path-prefix` feature originally added) are removed, as these two pieces of information can be inferred from the `name` field: if it's anything other than a `FileName::Real(_)`, or if it is a `FileName::Real(RealFileName::LocalPath(_))`, then clearly `name_was_remapped` would've been false and `unmapped_path` would've been `None`. If it is a `FileName::Real(RealFileName::Remapped{local_path, virtual_name})`, then `name_was_remapped` would've been true and `unmapped_path` would've been `Some(local_path)`. cc `@eddyb` who implemented `/rustc/...` path devirtualisation
2021-05-11Split span_to_string into span_to_diagnostic/embeddable_stringAndy Wang-3/+19
2021-05-02Use new thread-local const-initMark Rousskov-4/+4
Let's see if this gives us any speedup - some of the TLS state modified in this commit *is* pretty heavily accessed, so we can hope!
2021-04-09Auto merge of #83870 - jackh726:binder-refactor-fix, r=nikomatsakisbors-22/+87
Don't concatenate binders across types Partially addresses #83737 There's actually two issues that I uncovered in #83737. The first is that we are concatenating bound vars across types, i.e. in ``` F: Fn(&()) -> &mut (dyn Future<Output = ()> + Unpin) ``` the bound vars on `Future` get set as `for<anon>` since those are the binders on `Fn(&()`. This is obviously wrong, since we should only concatenate directly nested trait refs. This is solved here by introducing a new `TraitRefBoundary` scope, that we put around the "syntactical" trait refs and basically don't allow concatenation across. Now, this alone *shouldn't* be a super terrible problem. At least not until you consider the other issue, which is a much more elusive and harder to design a "perfect" fix. A repro can be seen in: ``` use core::future::Future; async fn handle<F>(slf: &F) where F: Fn(&()) -> &mut (dyn for<'a> Future<Output = ()> + Unpin), { (slf)(&()).await; } ``` Notice the `for<'a>` around `Future`. Here, `'a` is unused, so the `for<'a>` Binder gets changed to a `for<>` Binder in the generator witness, but the "local decl" still has it. This has heavy intersections with region anonymization and erasing. Luckily, it's not *super* common to find this unique set of circumstances. It only became apparently because of the first issue mentioned here. However, this *is* still a problem, so I'm leaving #83737 open. r? `@nikomatsakis`
2021-04-05Don't concatenate binders across typesJack Huey-22/+87
2021-03-31prevent very long compilation runtimes in LateBoundRegionNameCollectorb-naber-5/+31
2021-03-31Add var to BoundRegion. Add query to get bound vars for applicable items.Jack Huey-4/+5
2021-03-31Add tcx lifetime to BinderJack Huey-25/+25
2021-03-26Use iter::zip in compiler/Josh Stone-1/+2
2021-03-23Add query for const_param_defaultkadmin-4/+1
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-11/+16
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-1/+1
2021-03-12Split pretty printer logic for scalar int and scalar ptrOli Scherer-46/+67
Value trees won't have scalar ptr at all, so we need a scalar int printing method anyway. This way we'll be able to share that method between all const representations.
2021-02-20Rollup merge of #82176 - RalfJung:mir-fn-ptr-pretty, r=oli-obkGuillaume Gomez-9/+12
fix MIR fn-ptr pretty-printing An uninitialized function pointer would get printed as `{{uninit fn()}` (notice the unbalanced parentheses), and a dangling fn ptr would ICE. This fixes both of that. However, I have no idea how to add tests for this. Also, I don't understand this MIR pretty-printing code. Somehow the print function `pretty_print_const_scalar` actually *returns* a transformed form of the const (but there is no doc comment explaining what is being returned); some match arms do `p!` while others do `self =`, and there's a wild mixture of `p!` and `write!`... all very mysterious and confusing.^^ r? ``@oli-obk``
2021-02-20fn ptr pretty printing: fall back to raw ptr printingRalf Jung-3/+2
2021-02-17remove useless ?s (clippy::needless_question_marks)Matthias Krüger-2/+2
Example code: ``` fn opts() -> Option<String> { let s: Option<String> = Some(String::new()); Some(s?) // this can just be "s" } ```
2021-02-16fix MIR fn-ptr pretty-printingRalf Jung-8/+12
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-5/+3
Items are guaranteed to be HIR owner.
2021-02-06path trimming: ignore type aliasesDan Aloni-0/+1
2021-01-18Use `rustc_type_ir::{IntTy,UintTy,FloatTy} instead of the `rustc_ast` ones ↵LeSeulArtichaut-4/+3
in types
2021-01-18Move a few more types to `rustc_type_ir`LeSeulArtichaut-18/+8
2021-01-16More review commentsJack Huey-4/+0
2021-01-16Review changesJack Huey-15/+15
2021-01-16CleanupJack Huey-1/+1
2021-01-16CleanupJack Huey-1/+1
2021-01-16Remove PredicateKindJack Huey-1/+1
2021-01-16Intermediate formatting and suchJack Huey-3/+2
2021-01-16Remove PredicateKind::AtomJack Huey-1/+0
2021-01-01adjust const generics defaults FIXMEs to the new feature gateRémy Rakic-1/+1
2020-12-30Rename kw::Invalid -> kw::EmptyJoshua Nelson-5/+5
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471 for context.
2020-12-18Make BoundRegion have a kind of BoungRegionKindJack Huey-9/+9
2020-12-11Move binder for dyn to each list itemJack Huey-57/+102
2020-11-17Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obkbors-1/+1
Introduce `TypeVisitor::BreakTy` Implements MCP rust-lang/compiler-team#383. r? `@ghost` cc `@lcnr` `@oli-obk` ~~Blocked on FCP in rust-lang/compiler-team#383.~~
2020-11-16compiler: fold by valueBastian Kauschke-1/+1
2020-11-14Introduce `TypeVisitor::BreakTy`LeSeulArtichaut-1/+1
2020-11-09Rollup merge of #78502 - matthewjasper:chalkup, r=nikomatsakisDylan DPC-1/+1
Update Chalk to 0.36.0 This PR updates Chalk and fixes a number of bugs in the chalk integration code. cc `@rust-lang/wg-traits` r? `@nikomatsakis`
2020-11-04s/Scalar::Raw/Scalar::Intoli-9/+9
2020-11-04Use packed struct instead of manually packing into an arrayoli-3/+5
2020-11-04Split the "raw integer bytes" part out of `Scalar`Oliver Scherer-33/+24
2020-10-30Fix query cycle when tracing explicit_item_boundsMatthew Jasper-1/+1