about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-12-20Use `delay_span_bug` less oftenMatthew Jasper-3/+2
2019-12-20Correctly lower paths to generic associated typesMatthew Jasper-3/+3
2019-12-20Rollup merge of #64588 - matthewjasper:mir-address-of, r=oli-obkMazdak Farrokhzad-3/+0
Add a raw "address of" operator * Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`) * Add `mir::Rvalue::AddressOf` * Use the new `Rvalue` for: * the new syntax * reference to pointer casts * drop shims for slices and arrays * Stop using `mir::Rvalue::Cast` with a reference as the operand * Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation cc @Centril @RalfJung @oli-obk @eddyb cc #64490
2019-12-20Rollup merge of #67127 - estebank:disambiguate-suggestion, r=varkorMazdak Farrokhzad-0/+11
Use structured suggestion for disambiguating method calls Fix #65635.
2019-12-18Add Rvalue::AddressOf to MIRMatthew Jasper-3/+0
This operator creates a raw pointer to a Place directly, without first creating a reference. See RFC #2582 for motivation. The Rvalue is currently unused.
2019-12-18Propagate cfg bootstrapMark Rousskov-3/+0
2019-12-13Consistently name `min_const_fn`Oliver Scherer-2/+2
2019-12-13Change the const stab default for internal const fnsOliver Scherer-4/+7
2019-12-13Elaborate internal const fn commentOliver Scherer-1/+3
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-12/+50
functions with a `const` modifier
2019-12-11Use structured suggestion for disambiguating method callsEsteban Küber-0/+11
Fix #65635.
2019-12-08Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddybMazdak Farrokhzad-8/+8
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in #65947) cc @eddyb @oli-obk
2019-12-08Rollup merge of #66325 - BartMassey:master, r=joshtriplettMazdak Farrokhzad-1/+1
Change unused_labels from allow to warn Fixes #66324, making the unused_labels lint warn instead of allow by default. I'm told @rust-lang/lang will need to review this, and perhaps will want to do a crater run.
2019-12-07Auto merge of #65881 - anp:implicit-caller-location, r=eddyb,oli-obkbors-6/+26
Implement #[track_caller] attribute. (RFC 2091 4/N) Implements the `#[track_caller]` attribute in both const and codegen contexts. The const implementation walks up the stack to find the nearest untracked callsite. The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has `#[track_caller]` with a copy of the location passed to the current function. Also includes a little cleanup and a few comments in the other caller location areas. [Depends on: 65664](https://github.com/rust-lang/rust/pull/65664) [RFC 2091 text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) [Tracking issue](https://github.com/rust-lang/rust/issues/47809) [Tracking doc](https://paper.dropbox.com/doc/track_rfc_2091_impl-notes--Anf1NwnIb0xcRv31YLIadyj0Ag-rwCdRc2fi2yvRZ7syGZ9q#:uid=863513134494965680023183&h2=TODO-actually-pass-location-to)
2019-12-06Rename to `then_some` and `then`varkor-3/+3
2019-12-06Use `to_option` in various placesvarkor-13/+4
2019-12-05Add caller_location paramter to FnAbi::new_internal.Adam Perry-2/+11
We pass it in `of_instance` when the instance requires caller location.
2019-12-05Generate &core::panic::Location type in a single place.Adam Perry-0/+10
2019-12-05Implement #[track_caller] in const.Adam Perry-4/+5
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-8/+8
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-05Rollup merge of #67010 - estebank:raw-idents, r=CentrilMazdak Farrokhzad-0/+3
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
2019-12-04Auto merge of #66275 - oli-obk:organize-intrinsics-promotion-checks, r=RalfJungbors-3/+112
Organize intrinsics promotion checks cc @vertexclique supersedes #61835 r? @RalfJung
2019-12-03Accurately portray raw identifiers in error messagesEsteban Küber-0/+3
When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
2019-12-04Leave fixmeOliver Scherer-0/+1
2019-12-03rustc: add docs to FnAbi::{of_fn_ptr,of_instance} and InstanceDef::Virtual.Eduard-Mihai Burtescu-1/+16
2019-12-03rustc: move Instance::fn_sig to ty::layout and privatize it.Eduard-Mihai Burtescu-66/+72
2019-12-03rustc_target: add abi::call::Conv::Rust distinct from Conv::C.Eduard-Mihai Burtescu-1/+1
2019-12-03rustc: take a PolyFnSig instead of an FnSig in FnAbi::of_fn_ptr.Eduard-Mihai Burtescu-7/+8
2019-12-03rustc: rename FnAbi::new to FnAbi::of_fn_ptr.Eduard-Mihai Burtescu-2/+2
2019-12-03rustc: compute FnAbi's for virtual calls through FnAbi::of_instance.Eduard-Mihai Burtescu-12/+8
2019-12-03rustc: use ReifyShim for reifying Virtual call instances.Eduard-Mihai Burtescu-12/+20
2019-12-03rustc: combine Instance::fn_sig_noadjust and Instance::fn_sig.Eduard-Mihai Burtescu-17/+15
2019-12-03const fns can read constants that invoke unstable const fnsOliver Scherer-1/+1
2019-12-03Explain the difference between the two whitelistsOliver Scherer-0/+9
2019-12-03Move all intrinsic whitelists into the constness check fileOliver Scherer-0/+35
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-3/+67
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-2/+2
rename all body_cache back to body
2019-12-02Remove BodyCache.body and rely on Deref as much as possible for ↵Paul Daniel Faria-1/+1
ReadOnlyBodyCache
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-2/+2
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-12/+12
(lifetime errors still exist)
2019-12-02Rollup merge of #66907 - eddyb:br-nicer-named, r=oli-obkMazdak Farrokhzad-2/+6
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl. Context: these `fmt::Debug` impls only get used with `-Z verbose` (which some tests use). I was going to print the path like in #66850 (or rather, use `DefId`'s `fmt::Debug`, which is close but not as nice), but then I realized that most of the `DefId`s were `crate0:DefIndex(0)`, i.e. the crate root. As the crate root is not a lifetime, they're clearly dummies of some sort, and we don't have to print anything other than the name for them. This means that out of all the tests, there's only 5 instances of `BrNamed` that now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad. cc @nikomatsakis
2019-12-02Rollup merge of #66850 - eddyb:span-free-formats, r=oli-obkMazdak Farrokhzad-1/+1
rustc: hide HirId's fmt::Debug output from -Z span_free_formats. This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.: ```rust [closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T] ``` becomes, after this PR: ```rust [closure@foo<T>::{{closure}}#0 q:&i32, t:&T] ``` r? @oli-obk cc @michaelwoerister
2019-12-01Rollup merge of #66679 - mark-i-m:fix-anon-lifetime-errors, r=matthewjasperMazdak Farrokhzad-1/+1
Improve lifetime errors with implicit trait object lifetimes r? @matthewjasper cc @estebank I still think the ideal solution would be to construct a `BrAnon`, but that seems like a more invasive change, and can be done later. This at least gets rid of the hack in `OutliveSuggestion` and is slightly more principled.
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-3/+1
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30Rollup merge of #66883 - eddyb:we-cant-have-nice-things, r=oli-obkMazdak Farrokhzad-14/+35
rustc_typeck: gate AnonConst's generics on feature(const_generics). This PR employs the fix for #43408 when `#![feature(const_generics)]` is enabled, making the feature-gate the opt-in for all the possible breakage this may incur. For example, if this PR lands, this will cause a cycle error (due to #60471): ```rust #![feature(const_generics)] fn foo<T: Into<[u8; 4]>>() {} ``` And so will anything with type-level const expressions, in its bounds. Surprisingly, `impl`s don't seem to be affected (if they were, even libcore wouldn't compile). One thing I'm worried about is not knowing how much unstable code out there, using const-generics, will be broken. But types like `Foo<{N+1}>` never really worked, and do after this PR, just not in bounds - so ironically, it's type-level const expressions that don't depend on generics, which will break (in bounds). Also, if we do this, we'll have effectively blocked stabilization of const generics on #60471. r? @oli-obk cc @varkor @yodaldevoid @nikomatsakis
2019-11-30rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.Eduard-Mihai Burtescu-2/+6
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-3/+1
2019-11-30rustc: fix ty::Const::eval's handling of inference variables.Eduard-Mihai Burtescu-14/+35
2019-11-29Rollup merge of #66793 - matthewjasper:record-static-refs, r=cramertjRalf Jung-0/+17
Record temporary static references in generator witnesses Closes #66695 * Record the pointer to static's type in MIR. * Normalize the static's type (so that constants can be compared correctly).
2019-11-29Rollup merge of #66791 - cjgillot:arena, r=Mark-SimulacrumRalf Jung-2/+3
Handle GlobalCtxt directly from librustc_interface query system This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface. This simplifies the code to construct it, at the expense of added complexity in the query control flow. This allows to handle the arenas directly from librustc_interface. Based on #66707 r? @Zoxc