about summary refs log tree commit diff
path: root/compiler/rustc_hir/src
AgeCommit message (Collapse)AuthorLines
2021-05-12Add more precise span informations to generic typesGiacomo Stevanato-25/+16
2021-05-06Actually implement the feature in the compilerScott McMurray-4/+7
Including all the bootstrapping tweaks in the library.
2021-05-06Add additional migrations to handle auto-traits and clone traitsRoxane-0/+3
Combine all 2229 migrations under one flag name
2021-05-04Add type to differentiate between fake and real DefId'sJustus K-5/+0
2021-04-25Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkorbors-1/+3
various const parameter defaults improvements Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`. --- Split generic parameter ban rib for types and consts, allowing ```rust #![feature(const_generics_defaults)] struct Q; struct Foo<T = Q, const Q: usize = 3>(T); ``` --- Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately. --- Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>` --- Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist. We still forbid generic parameters inside of const param types. r? `@varkor` `@petrochenkov`
2021-04-24Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obkbors-1/+0
further split up const_fn feature flag This continues the work on splitting up `const_fn` into separate feature flags: * `const_fn_trait_bound` for `const fn` with trait bounds * `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here) I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more. `@oli-obk` are you currently able to do reviews?
2021-04-22Update comment on `PrimTy::name_str`Joshua Nelson-1/+1
2021-04-21loosen ordering restricts for `const_generics_defaults`lcnr-1/+3
2021-04-18fix feature use in rustc libsRalf Jung-1/+0
2021-04-08Rollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davidtwcoDylan DPC-3/+3
Fix outdated crate names in compiler docs Changes `librustc_X` to `rustc_X`, only in documentation comments. Plain code comments are left unchanged.
2021-04-08Fix outdated crate names in compiler docspierwill-3/+3
Changes `librustc_X` to `rustc_X`, only in documentation comments. Plain code comments are left unchanged. Also fix incorrect file paths.
2021-04-08Auto merge of #82958 - camelid:res-docs, r=petrochenkovbors-13/+142
Document `Res` and its friends I noticed [this Zulip conversation][z] and thought it would be a good idea to document `Res` and the other types near it. [z]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.2382516.20-.20Add.20inherent.20associated.20types/near/227914819
2021-04-07Document `Res` and its friendsCamelid-13/+142
2021-04-08Rollup merge of #83965 - rust-lang:debug-intravisit-fnkind, r=lqdDylan DPC-1/+1
Add Debug implementation for hir::intravisit::FnKind
2021-04-07Add Debug implementation for hir::intravisit::FnKindGuillaume Gomez-1/+1
2021-04-07Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkovDylan DPC-2/+4
Use AnonConst for asm! constants This replaces the old system which used explicit promotion. See #83169 for more background. The syntax for `const` operands is still the same as before: `const <expr>`. Fixes #83169 Because the implementation is heavily based on inline consts, we suffer from the same issues: - We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`. - We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
2021-04-06Use AnonConst for asm! constantsAmanieu d'Antras-2/+4
2021-04-03Auto merge of #83599 - jyn514:unorderable, r=Aaron1011bors-2/+5
Avoid sorting by DefId for `necessary_variants()` Follow-up to https://github.com/rust-lang/rust/pull/83074. Originally I tried removing `impl Ord for DefId` but that hit *lots* of errors :sweat_smile: so I thought I would start with easy things. I am not sure whether this could actually cause invalid query results, but this is used from `MarkSymbolVisitor::visit_arm` so it's at least feasible. r? `@Aaron1011`
2021-03-31Add var to BoundRegion. Add query to get bound vars for applicable items.Jack Huey-3/+3
2021-03-31Revert explicit lifetimesJack Huey-2/+2
2021-03-31Track bound varsJack Huey-2/+2
2021-03-30Remove hir::CrateItem.Camille GILLOT-10/+3
2021-03-28Avoid sorting by DefId for `necessary_variants()`Joshua Nelson-2/+5
2021-03-27Address review commentsJoshua Nelson-1/+69
- Add back `HirIdVec`, with a comment that it will soon be used. - Add back `*_region` functions, with a comment they may soon be used. - Remove `-Z borrowck_stats` completely. It didn't do anything. - Remove `make_nop` completely. - Add back `current_loc`, which is used by an out-of-tree tool. - Fix style nits - Remove `AtomicCell` with `cfg(parallel_compiler)` for consistency.
2021-03-27Remove (lots of) dead codeJoshua Nelson-103/+5
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-23progress, stuff compiles nowlcnr-1/+8
2021-03-19stabilize or_patternsmark-1/+1
2021-03-18hir: Preserve used syntax in `TyKind::TraitObject`Vadim Petrochenkov-3/+3
2021-03-17Auto merge of #83188 - petrochenkov:field, r=lcnrbors-23/+23
ast/hir: Rename field-related structures I always forget what `ast::Field` and `ast::StructField` mean despite working with AST for long time, so this PR changes the naming to less confusing and more consistent. - `StructField` -> `FieldDef` ("field definition") - `Field` -> `ExprField` ("expression field", not "field expression") - `FieldPat` -> `PatField` ("pattern field", not "field pattern") Various visiting and other methods working with the fields are renamed correspondingly too. The second commit reduces the size of `ExprKind` by boxing fields of `ExprKind::Struct` in preparation for https://github.com/rust-lang/rust/pull/80080.
2021-03-17Rollup merge of #83092 - petrochenkov:qspan, r=estebankYuki Okushi-1/+1
More precise spans for HIR paths `Ty::assoc_item` is lowered to `<Ty>::assoc_item` in HIR, but `Ty` got span from the whole path. This PR fixes that, and adjusts some diagnostic code that relied on `Ty` having the whole path span. This is a pre-requisite for https://github.com/rust-lang/rust/pull/82868 (we cannot report suggestions like `Tr::assoc` -> `<dyn Tr>::assoc` with the current imprecise spans). r? ````@estebank````
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-23/+23
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2021-03-16Auto merge of #82898 - oli-obk:tait_🧊, r=nikomatsakisbors-1/+3
Add a `min_type_alias_impl_trait` feature gate This new feature gate only permits type alias impl trait to be constrained by function and trait method return types. All other possible constraining sites like const/static types, closure return types and binding types are now forbidden and gated under the `type_alias_impl_trait` and `impl_trait_in_bindings` feature gates (which are both marked as incomplete, as they have various ways to ICE the compiler or cause query cycles where they shouldn't). r? `@nikomatsakis` This is best reviewed commit-by-commit
2021-03-15More precise spans for HIR pathsVadim Petrochenkov-1/+1
2021-03-15Special case type aliases from impl trait in const/static typesOli Scherer-1/+3
2021-03-14Remove unused `opt_local_def_id_to_hir_id` functionJoshua Nelson-5/+0
Found while investigating #82933 - all LocalDefIds are expected to have HirIds, there's no point in pretending otherwise.
2021-03-11Auto merge of #82641 - camelid:lang-item-docs, r=jyn514bors-19/+28
Improve lang item generated docs cc https://rust-lang.zulipchat.com/#narrow/stream/146229-wg-secure-code/topic/Is.20.60core.60.20part.20of.20the.20compiler.3F/near/226738260 r? `@jyn514`
2021-03-10Remove unnecessary `#[allow(dead_code)]`Camelid-1/+0
2021-03-10Clarify docsCamelid-1/+2
2021-03-10Remove `sym::` and `kw::` from generated docsCamelid-3/+3
2021-03-10Fix bugCamelid-2/+2
It needs to be a variable! Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-03-09Use BTreeMap to store attributes.Camille GILLOT-3/+3
2021-03-09Track HirId when visiting attributes.Camille GILLOT-3/+5
2021-03-09Remove hir::Expr::attrs.Camille GILLOT-3/+2
2021-03-09Remove hir::Item::attrs.Camille GILLOT-4/+2
2021-03-09Remove hir::ImplItem::attrs.Camille GILLOT-23/+5
2021-03-09Remove hir::TraitItem::attrs.Camille GILLOT-4/+2
2021-03-09Remove hir::ForeignItem::attrs.Camille GILLOT-4/+2
2021-03-09Remove hir::StructField::attrs.Camille GILLOT-1/+0
2021-03-09Remove hir::Variant::attrs.Camille GILLOT-2/+0
2021-03-09Remove hir::Param::attrs.Camille GILLOT-1/+0