Commit graph

279 commits

Author SHA1 Message Date
Ellen
d1e5e72f7d change doc comment 2021-07-24 17:32:11 +01:00
Guillaume Gomez
1008ace95c
Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk
Recognize bounds on impls as const bounds

r? ```@oli-obk```
2021-07-21 15:52:47 +02:00
Deadbeef
4b82bbeac0
Recognize bounds on impls as const bounds 2021-07-19 19:51:44 +08:00
Santiago Pastorino
5cefdbdab5
Use == to compare OpaqueTyOrigin values 2021-07-18 09:30:10 -03:00
Santiago Pastorino
000b945cea
Remove OpaqueTyOrigin::Misc, use TyAlias instead 2021-07-18 09:30:10 -03:00
Santiago Pastorino
66c9cd9e66
Remove OpaqueTyOrigin::Binding 2021-07-17 23:14:22 -03:00
Cameron Steffen
1537cd4fb1 Remove refs from pat slices 2021-07-15 16:09:57 -05:00
Ellen
8c40360ed4 Put checking if anonct is a default into a method on hir map 2021-07-13 17:23:51 +01:00
bors
72568552fd Auto merge of #85941 - cjgillot:qresolve, r=Aaron1011
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-11 16:09:17 +00:00
Guillaume Gomez
d12b16887b
Rollup merge of #86726 - 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-08 18:30:33 +02:00
Camille GILLOT
071a047dc7 Make resolutions a query. 2021-07-06 19:22:27 +02:00
bors
d04ec47358 Auto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, 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-06 11:31:59 +00:00
bjorn3
96d3bd467d Revert "Revert "Fix test""
This reverts commit 6c5b6985fd.
2021-07-06 11:28:06 +02:00
bjorn3
489ad8b8b5 Revert "Revert "Merge CrateDisambiguator into StableCrateId""
This reverts commit 8176ab8bc1.
2021-07-06 11:28:04 +02:00
Camille GILLOT
3162c37b59 Store macro parent module in ExpnData. 2021-07-06 08:07:06 +02:00
Roxane Fruytier
3e569dd2df Remove lang items Send, UnwindSafe and RefUnwindSafe 2021-06-29 17:47:57 -04:00
Mark Rousskov
06661ba759 Update to new bootstrap compiler 2021-06-28 11:30:49 -04:00
Dylan DPC
af9e5d1a14
Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkov
Specify the kind of the item for E0121

Fixes #86005
2021-06-23 00:20:18 +02:00
bors
4573a4a879 Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3
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-21 22:24:13 +00:00
Deadbeef
200fdaac77
Specify the kind of the item for E0121 2021-06-22 00:40:47 +08:00
Alex Vlasov
aa53928ed7 Squashed implementation of the pass 2021-06-20 16:09:42 +02:00
bors
312b894cc1 Auto merge of #85421 - Smittyvb:rm_pushpop_unsafe, r=matthewjasper
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-18 14:17:53 +00:00
Camille GILLOT
a7a50b0c0a Hash DefId in rustc_span. 2021-06-11 12:25:02 +02:00
Camille GILLOT
aeb050da9f Do not require the DefPathTable to construct the on-disk cache. 2021-06-08 22:23:03 +02:00
bjorn3
8176ab8bc1 Revert "Merge CrateDisambiguator into StableCrateId"
This reverts commit d0ec85d3fb.
2021-06-07 10:37:45 +02:00
bjorn3
6c5b6985fd Revert "Fix test"
This reverts commit 3abdebe79d.
2021-06-07 10:25:32 +02:00
Smitty
45c55540a8 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-06 17:04:03 -04:00
Yuki Okushi
36f1ed6de2
Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514
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-04 13:42:54 +09:00
bors
1e13a9bb33 Auto merge of #85892 - tmiasko:i, r=oli-obk
Miscellaneous inlining improvements
2021-06-02 10:47:58 +00:00
Tomasz Miąsko
c1f6495b8e Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
Camille GILLOT
273778086c Remove StableVec. 2021-06-01 20:53:04 +02:00
Camille GILLOT
e291be3649 Only compute the trait_map once. 2021-06-01 20:43:50 +02:00
Camille Gillot
0f0f3138cb
Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
bjorn3
312f964478 Remove unused feature gates 2021-05-31 13:55:43 +02:00
Camille GILLOT
ee567fe1b1 Remove StableVec. 2021-05-30 19:54:21 +02:00
Camille GILLOT
5d9f96ab27 Make resolutions a query. 2021-05-30 19:47:00 +02:00
Camille GILLOT
139f7ad637 Only compute the trait_map once. 2021-05-30 19:37:53 +02:00
bjorn3
3abdebe79d Fix test 2021-05-30 12:51:36 +02:00
bjorn3
d0ec85d3fb Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
Jacob Pratt
bc2f0fb5a9
Specialize implementations
Implementations in stdlib are now optimized as they were before.
2021-05-26 18:07:09 -04:00
Pietro Albini
9e22b844dd remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
Jack Huey
3c99dcd82d
Rollup merge of #83366 - jyn514:stabilize-key-value-attrs, r=petrochenkov
Stabilize extended_key_value_attributes

Closes https://github.com/rust-lang/rust/issues/44732. Closes https://github.com/rust-lang/rust/issues/78835. Closes https://github.com/rust-lang/rust/issues/82768 (by making it irrelevant).

 # Stabilization report

 ## Summary

This stabilizes using macro expansion in key-value attributes, like so:

 ```rust
 #[doc = include_str!("my_doc.md")]
 struct S;

 #[path = concat!(env!("OUT_DIR"), "/generated.rs")]
 mod m;
 ```

See Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455)
for alternatives that were considered and rejected ("why accept no more and no less?")

This has been available on nightly since 1.50 with no major issues.

## Notes

### Accepted syntax

The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`).  Note that decorators and the like may be able to observe other expression forms.

### Expansion ordering

Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input.

There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work).

## Test cases

 - https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs
 - https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs

The feature has also been dogfooded extensively in the compiler and
standard library:

- https://github.com/rust-lang/rust/pull/83329
- https://github.com/rust-lang/rust/pull/83230
- https://github.com/rust-lang/rust/pull/82641
- https://github.com/rust-lang/rust/pull/80534

## Implementation history

- Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412
- Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121
- Preliminary work to restrict expansion that would conflict with this
feature: https://github.com/rust-lang/rust/pull/77271
- Initial implementation: https://github.com/rust-lang/rust/pull/78837
- Fix for an ICE: https://github.com/rust-lang/rust/pull/80563

## Unresolved Questions

~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~

 ## Additional Information

 There are two workarounds that have a similar effect for `#[doc]`
attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons:

```rust
macro_rules! forward_inner_docs {
    ($e:expr => $i:item) => {
        #[doc = $e]
        $i
    };
}

forward_inner_docs!(include_str!("lib.rs") => struct S {});
```

This also works for other attributes (like `#[path = concat!(...)]`).
The other is to use `doc(include)`:

```rust
 #![feature(external_doc)]
 #[doc(include = "lib.rs")]
 struct S {}
```

The first works, but is non-trivial for people to discover, and
difficult to read and maintain. The second is a strange special-case for
a particular use of the macro. This generalizes it to work for any use
case, not just including files.

I plan to remove `doc(include)` when this is stabilized
(https://github.com/rust-lang/rust/pull/82539). The `forward_inner_docs`
workaround will still compile without warnings, but I expect it to be
used less once it's no longer necessary.
2021-05-18 22:35:54 -04:00
bors
4e3e6db011 Auto merge of #84767 - scottmcm:try_trait_actual, r=lcnr
Implement the new desugaring from `try_trait_v2`

~~Currently blocked on https://github.com/rust-lang/rust/issues/84782, which has a PR in https://github.com/rust-lang/rust/pull/84811~~ Rebased atop that fix.

`try_trait_v2` tracking issue: https://github.com/rust-lang/rust/issues/84277

Unfortunately this is already touching a ton of things, so if you have suggestions for good ways to split it up, I'd be happy to hear them.  (The combination between the use in the library, the compiler changes, the corresponding diagnostic differences, even MIR tests mean that I don't really have a great plan for it other than trying to have decently-readable commits.

r? `@ghost`

~~(This probably shouldn't go in during the last week before the fork anyway.)~~ Fork happened.
2021-05-18 20:50:01 +00:00
Joshua Nelson
e48b6b4599 Stabilize extended_key_value_attributes
# Stabilization report

 ## Summary

This stabilizes using macro expansion in key-value attributes, like so:

 ```rust
 #[doc = include_str!("my_doc.md")]
 struct S;

 #[path = concat!(env!("OUT_DIR"), "/generated.rs")]
 mod m;
 ```

See the changes to the reference for details on what macros are allowed;
see Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455)
for alternatives that were considered and rejected ("why accept no more
and no less?")

This has been available on nightly since 1.50 with no major issues.

 ## Notes

 ### Accepted syntax

The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`).  Note that decorators and the like may be able to observe other expression forms.

 ### Expansion ordering

Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input.

There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work).

 ## Test cases

 - https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs
 - https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs

The feature has also been dogfooded extensively in the compiler and
standard library:

- https://github.com/rust-lang/rust/pull/83329
- https://github.com/rust-lang/rust/pull/83230
- https://github.com/rust-lang/rust/pull/82641
- https://github.com/rust-lang/rust/pull/80534

 ## Implementation history

- Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412
- Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121
- Preliminary work to restrict expansion that would conflict with this
feature: https://github.com/rust-lang/rust/pull/77271
- Initial implementation: https://github.com/rust-lang/rust/pull/78837
- Fix for an ICE: https://github.com/rust-lang/rust/pull/80563

 ## Unresolved Questions

~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~

 ## Additional Information

 There are two workarounds that have a similar effect for `#[doc]`
attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons:

```rust
macro_rules! forward_inner_docs {
    ($e:expr => $i:item) => {
        #[doc = $e]
        $i
    };
}

forward_inner_docs!(include_str!("lib.rs") => struct S {});
```

This also works for other attributes (like `#[path = concat!(...)]`).
The other is to use `doc(include)`:

```rust
 #![feature(external_doc)]
 #[doc(include = "lib.rs")]
 struct S {}
```

The first works, but is non-trivial for people to discover, and
difficult to read and maintain. The second is a strange special-case for
a particular use of the macro. This generalizes it to work for any use
case, not just including files.

I plan to remove `doc(include)` when this is stabilized. The
`forward_inner_docs` workaround will still compile without warnings, but
I expect it to be used less once it's no longer necessary.
2021-05-18 01:01:36 -04:00
Amanieu d'Antras
5918ee4317 Add support for const operands and options to global_asm!
On x86, the default syntax is also switched to Intel to match asm!
2021-05-13 22:31:57 +01:00
bors
631e989738 Auto merge of #83759 - SkiFire13:fix-diag, r=estebank
Handle more span edge cases in generics diagnostics

This should fix invalid suggestions that didn't account for empty bracket pairs (`<>`) or type bindings.
2021-05-13 03:19:13 +00:00
Giacomo Stevanato
b1c8835a0f Add more precise span informations to generic types 2021-05-12 11:36:07 +02:00
Scott McMurray
ca92b5a23a Actually implement the feature in the compiler
Including all the bootstrapping tweaks in the library.
2021-05-06 11:37:45 -07:00
Roxane
9afea614bf Add additional migrations to handle auto-traits and clone traits
Combine all 2229 migrations under one flag name
2021-05-06 14:17:59 -04:00
Justus K
b6120bfb35
Add type to differentiate between fake and real DefId's 2021-05-04 19:34:12 +02:00
bors
58bdb08947 Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkor
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-25 14:00:49 +00:00
bors
b56b175c6c Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obk
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-24 23:16:03 +00:00
Joshua Nelson
2b026782d8 Update comment on PrimTy::name_str 2021-04-22 23:32:48 -04:00
lcnr
7cb1dcd488 loosen ordering restricts for const_generics_defaults 2021-04-21 15:25:58 +02:00
Ralf Jung
bd9556956a fix feature use in rustc libs 2021-04-18 22:05:45 +02:00
Dylan DPC
74b23f9d11
Rollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davidtwco
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-08 20:29:58 +02:00
pierwill
0019ca9141 Fix outdated crate names in compiler docs
Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

Also fix incorrect file paths.
2021-04-08 11:12:14 -05:00
bors
0bbf473151 Auto merge of #82958 - camelid:res-docs, r=petrochenkov
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-08 02:43:31 +00:00
Camelid
8563a19384 Document Res and its friends 2021-04-07 18:03:38 -07:00
Dylan DPC
1ab186aeed
Rollup merge of #83965 - rust-lang:debug-intravisit-fnkind, r=lqd
Add Debug implementation for hir::intravisit::FnKind
2021-04-08 01:01:46 +02:00
Guillaume Gomez
6e77bcbbcd
Add Debug implementation for hir::intravisit::FnKind 2021-04-07 13:30:37 +02:00
Dylan DPC
b81c6cdb57
Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov
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-07 13:07:14 +02:00
Amanieu d'Antras
32be124e30 Use AnonConst for asm! constants 2021-04-06 12:35:41 +01:00
bors
cb17136405 Auto merge of #83599 - jyn514:unorderable, r=Aaron1011
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 😅 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-04-03 04:11:35 +00:00
Jack Huey
6d5efa9f04 Add var to BoundRegion. Add query to get bound vars for applicable items. 2021-03-31 10:16:37 -04:00
Jack Huey
84f82d348c Revert explicit lifetimes 2021-03-31 10:15:56 -04:00
Jack Huey
30187c81f6 Track bound vars 2021-03-31 10:15:27 -04:00
Camille GILLOT
9d8f833e05 Remove hir::CrateItem. 2021-03-30 20:31:06 +02:00
Joshua Nelson
a0957c9d26 Avoid sorting by DefId for necessary_variants() 2021-03-28 01:13:16 -04:00
Joshua Nelson
de0fda9558 Address review comments
- 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-27 22:16:34 -04:00
Joshua Nelson
441dc3640a Remove (lots of) dead code
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-27 22:16:33 -04:00
lcnr
b0feb5be2f progress, stuff compiles now 2021-03-23 17:16:20 +00:00
mark
db5629adcb stabilize or_patterns 2021-03-19 19:45:32 -05:00
Vadim Petrochenkov
38ed36bba4 hir: Preserve used syntax in TyKind::TraitObject 2021-03-18 03:02:32 +03:00
bors
b4adc21c4f Auto merge of #83188 - petrochenkov:field, r=lcnr
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-17 16:49:46 +00:00
Yuki Okushi
70edab895d
Rollup merge of #83092 - petrochenkov:qspan, r=estebank
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-17 15:20:54 +09:00
Vadim Petrochenkov
b25d3ba781 ast/hir: Rename field-related structures
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-16 11:41:24 +03:00
bors
195ad4830e Auto merge of #82898 - oli-obk:tait_🧊, r=nikomatsakis
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-16 04:24:48 +00:00
Vadim Petrochenkov
7e66e9d6b0 More precise spans for HIR paths 2021-03-15 22:13:45 +03:00
Oli Scherer
cdbb0ff8ca Special case type aliases from impl trait in const/static types 2021-03-15 17:33:28 +00:00
Joshua Nelson
e161a2fd73 Remove unused opt_local_def_id_to_hir_id function
Found while investigating #82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
2021-03-14 01:37:13 -05:00
bors
04fce73196 Auto merge of #82641 - camelid:lang-item-docs, r=jyn514
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-11 06:38:22 +00:00
Camelid
ab42f96cff Remove unnecessary #[allow(dead_code)] 2021-03-10 10:27:04 -08:00
Camelid
d31f70c87c Clarify docs 2021-03-10 09:20:53 -08:00
Camelid
b782939c06 Remove sym:: and kw:: from generated docs 2021-03-10 09:15:16 -08:00
Camelid
4900836ab7 Fix bug
It needs to be a variable!

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-03-10 09:03:45 -08:00
Camille GILLOT
38d9d09a58 Use BTreeMap to store attributes. 2021-03-09 19:28:01 +01:00
Camille GILLOT
27ef0eeaa4 Track HirId when visiting attributes. 2021-03-09 19:27:59 +01:00
Camille GILLOT
fb753cced8 Remove hir::Expr::attrs. 2021-03-09 19:27:58 +01:00
Camille GILLOT
c701872a6c Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
Camille GILLOT
5474f17011 Remove hir::ImplItem::attrs. 2021-03-09 19:23:08 +01:00
Camille GILLOT
c49359add2 Remove hir::TraitItem::attrs. 2021-03-09 19:23:08 +01:00
Camille GILLOT
4bab93a039 Remove hir::ForeignItem::attrs. 2021-03-09 19:23:07 +01:00
Camille GILLOT
c298744da7 Remove hir::StructField::attrs. 2021-03-09 19:23:07 +01:00
Camille GILLOT
3c0afc3e1c Remove hir::Variant::attrs. 2021-03-09 19:23:06 +01:00
Camille GILLOT
a0a4611a81 Remove hir::Param::attrs. 2021-03-09 19:23:06 +01:00
Camille GILLOT
96788df68c Remove hir::Arm::attrs. 2021-03-09 19:23:05 +01:00
Camille GILLOT
a987bbb97c Remove hir::Crate::attrs. 2021-03-09 19:22:55 +01:00
Camille GILLOT
c05c90275c Remove hir::MacroDef::attrs. 2021-03-09 19:09:36 +01:00
Camille GILLOT
fd8a021757 Remove hir::GenericParam::attrs. 2021-03-09 19:09:36 +01:00