about summary refs log tree commit diff
path: root/compiler/rustc_hir/src
AgeCommit message (Collapse)AuthorLines
2021-08-13Fix call-generic-method-nonconst testDeadbeef-1/+5
2021-08-13move Constness into TraitPredicateDeadbeef-0/+9
2021-08-06Auto merge of #87462 - ibraheemdev:tidy-file-length-ignore-comment, ↵bors-1/+0
r=Mark-Simulacrum Ignore comments in tidy-filelength Ref https://github.com/rust-lang/rust/issues/60302#issuecomment-652402127
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-1/+1
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-30Do not discard `?Sized` type params and suggest their removalEsteban Küber-0/+3
2021-07-28Make const panic!("..") work in Rust 2021.Mara Bos-0/+3
During const eval, this replaces calls to core::panicking::panic_fmt and std::panicking::being_panic_fmt with a call to a new const fn: core::panicking::const_panic_fmt. That function uses fmt::Arguments::as_str() to get the str and calls panic_str with that instead. panic!() invocations with formatting arguments are still not accepted, as the creation of such a fmt::Arguments cannot be done in constant functions right now.
2021-07-27Auto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnrbors-13/+65
Add hir::GenericArg::Infer In order to extend inference to consts, make an Infer type on hir::GenericArg.
2021-07-26Actually infer args in visitorskadmin-14/+35
2021-07-25ignore comments in tidy-filelengthibraheemdev-1/+0
2021-07-25Auto merge of #83723 - cjgillot:ownernode, r=petrochenkovbors-60/+220
Store all HIR owners in the same container This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem. This should allow for a more compact storage. Based on https://github.com/rust-lang/rust/pull/83114
2021-07-25clippy::filter_map_identityMatthias Krüger-1/+1
2021-07-25Introduce OwnerNode::Crate.Camille GILLOT-27/+44
2021-07-25Merge the BTreeMap in hir::Crate.Camille GILLOT-57/+200
2021-07-25Add inferred args to typeckkadmin-6/+1
2021-07-25Add generic arg inferkadmin-0/+36
2021-07-24Auto merge of #86580 - BoxyUwU:cgd-subst-ice, r=nikomatsakisbors-0/+3
dont provide fwd declared params to cg defaults Fixes #83938 ```rust #![feature(const_evaluatable_checked, const_generics, const_generics_defaults)] #![allow(incomplete_features)] pub struct Bar<const N: usize, const M: usize = { N + 1 }>; pub fn foo<const N1: usize>() -> Bar<N1> { loop {} } fn main() {} ``` This PR makes this code no longer ICE, it was ICE'ing previously because when building substs for `Bar<N1>` we would subst the anon ct: `ConstKind::Unevaluated({N + 1}, substs: [N, M])` with substs of `[N1]`. the anon const has forward declared params supplied though so we end up trying to substitute the provided `M` param which causes the ICE. This PR doesn't handle the predicates of the const so ```rust trait Foo<const N: usize> { const Assoc: usize; } pub struct Bar<const N: usize = { <()>::Assoc }> where (): Foo<N>; ``` Resolves to `<() as Foo<N>>::Assoc` which can allow for using fwd declared params indirectly. ```rust trait Foo<const N: usize> {} struct Bar<const N: usize = { 2 + 3 }> where (): Foo<N>; ``` This code also ICEs under this PR because instantiating the default's predicates causes an ICE as predicates_of contains predicates with fwd declared params PR was briefly discussed [in this zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/evil.20preds.20in.20param.20env.20.2386580)
2021-07-24change doc commentEllen-1/+1
2021-07-21Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obkGuillaume Gomez-0/+21
Recognize bounds on impls as const bounds r? ```@oli-obk```
2021-07-19Recognize bounds on impls as const boundsDeadbeef-0/+21
2021-07-18Use == to compare OpaqueTyOrigin valuesSantiago Pastorino-1/+1
2021-07-18Remove OpaqueTyOrigin::Misc, use TyAlias insteadSantiago Pastorino-2/+0
2021-07-17Remove OpaqueTyOrigin::BindingSantiago Pastorino-2/+0
2021-07-15Remove refs from pat slicesCameron Steffen-8/+8
2021-07-13Put checking if anonct is a default into a method on hir mapEllen-0/+3
2021-07-11Auto merge of #85941 - cjgillot:qresolve, r=Aaron1011bors-2/+2
Reduce the amount of untracked state in TyCtxt -- Take 2 Main part of #85153 The offending line (https://github.com/rust-lang/rust/pull/85153#discussion_r642866298) is replaced by a FIXME until the possible bug and the perf concern are both resolved. r? `@Aaron1011`
2021-07-08Rollup merge of #86726 - ↵Guillaume Gomez-3/+0
sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis Use diagnostic items instead of lang items for rfc2229 migrations This PR removes the `Send`, `UnwindSafe` and `RefUnwindSafe` lang items introduced in https://github.com/rust-lang/rust/pull/84730, and uses diagnostic items instead to check for `Send`, `UnwindSafe` and `RefUnwindSafe` traits for RFC2229 migrations. r? ```@nikomatsakis```
2021-07-06Make resolutions a query.Camille GILLOT-2/+2
2021-07-06Auto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, ↵bors-11/+6
r=michaelwoerister Reland "Merge CrateDisambiguator into StableCrateId" Reverts https://github.com/rust-lang/rust/pull/85891 as this revert of #85804 made perf even worse. r? `@Mark-Simulacrum`
2021-07-06Revert "Revert "Fix test""bjorn3-8/+5
This reverts commit 6c5b6985fdce0921fe4ac0247fd026355953c1ea.
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-3/+1
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-06Store macro parent module in ExpnData.Camille GILLOT-15/+1
2021-06-29Remove lang items Send, UnwindSafe and RefUnwindSafeRoxane Fruytier-3/+0
2021-06-28Update to new bootstrap compilerMark Rousskov-1/+0
2021-06-23Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkovDylan DPC-0/+21
Specify the kind of the item for E0121 Fixes #86005
2021-06-21Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3bors-0/+2
Add MIR pass to lower call to `core::slice::len` into `Len` operand During some larger experiment with range analysis I've found that code like `let l = slice.len()` produces different MIR then one found in bound checks. This optimization pass replaces terminators that are calls to `core::slice::len` with just a MIR operand and Goto terminator. It uses some heuristics to remove the outer borrow that is made to call `core::slice::len`, but I assume it can be eliminated, just didn't find how. Would like to express my gratitude to `@oli-obk` who helped me a lot on Zullip
2021-06-22Specify the kind of the item for E0121Deadbeef-0/+21
2021-06-20Squashed implementation of the passAlex Vlasov-0/+2
2021-06-18Auto merge of #85421 - Smittyvb:rm_pushpop_unsafe, r=matthewjasperbors-2/+0
Remove some last remants of {push,pop}_unsafe! These macros have already been removed, but there was still some code handling these macros. That code is now removed.
2021-06-11Hash DefId in rustc_span.Camille GILLOT-7/+6
2021-06-08Do not require the DefPathTable to construct the on-disk cache.Camille GILLOT-9/+8
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-1/+3
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-07Revert "Fix test"bjorn3-5/+8
This reverts commit 3abdebe79d9a3a2256a36fe8f408dad6a466f89f.
2021-06-06Remove some last remants of {push,pop}_unsafe!Smitty-2/+0
These macros have already been removed, but there was still some code handling these macros. That code is now removed.
2021-06-04Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514Yuki Okushi-2/+0
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-02Auto merge of #85892 - tmiasko:i, r=oli-obkbors-0/+2
Miscellaneous inlining improvements
2021-06-02Miscellaneous inlining improvementsTomasz Miąsko-0/+2
2021-06-01Remove StableVec.Camille GILLOT-2/+1
2021-06-01Only compute the trait_map once.Camille GILLOT-2/+6
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-8/+4
2021-05-31Remove unused feature gatesbjorn3-2/+0